66 lines
2 KiB
Elixir
66 lines
2 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) and length(subreddit) > 1 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">
|
|
<%= if is_list(subreddit) do %>
|
|
<a class="btn btn-outline-info btn-lg" href="/s/<%= Enum.join(subreddit, "+") %>/most_comments" role="button">Most Comments</a>
|
|
<% else %>
|
|
<a class="btn btn-outline-info btn-lg" href="/s/<%= subreddit %>/most_comments" role="button">Most Comments</a>
|
|
<% end %>
|
|
|
|
<%= 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 class="d-grid gap-2 col-12 mx-auto">
|
|
<p class="text-secondary">
|
|
<%= for {name, post_count, comment_count} <- statistics do %>
|
|
<%= name %>: <%= post_count %> Posts; <%= comment_count %> Comments<br />
|
|
<% end %>
|
|
</p>
|
|
</div>
|
|
</div>
|