This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
bdfr-browser/priv/templates/http/subreddit.eex

52 lines
1.5 KiB
Elixir

<nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Overview</a></li>
<li class="breadcrumb-item active" aria-current="page">
<%= if is_list(subreddit) do %>
<%= Enum.join(subreddit, ", ") %>
<% else %>
<%= subreddit %>
<% end %>
</li>
</ol>
</nav>
<h2>
<%= if is_list(subreddit) do %>
Multi-Reddit
<% else %>
<%= subreddit %>
<% end %>
</h2>
<form method="get" action="/search" class="row">
<div class="col-8">
<input type="text" class="form-control" placeholder="Search term" name="search" />
</div>
<%= if is_list(subreddit) do %>
<%= for s <- subreddit do %>
<input type="hidden" name="subreddit[]" value="<%= s %>" />
<% end %>
<% else %>
<input type="hidden" name="subreddit[]" value="<%= subreddit %>" />
<% end %>
<div class="col-4 text-end">
<button type="submit" class="btn btn-primary">Search</button>
</div>
</form>
<br>
<div class="row text-center">
<div class="d-grid gap-2 col-12 mx-auto">
<%= for date <- dates do %>
<%= if is_list(subreddit) do %>
<a class="btn btn-outline-secondary btn-lg" href="/m/<%= Enum.join(subreddit, "+") %>/<%= date %>" role="button"><%= date %></a>
<% else %>
<a class="btn btn-outline-secondary btn-lg" href="/r/<%= subreddit %>/<%= date %>" role="button"><%= date %></a>
<% end %>
<% end %>
</div>
</div>