slightly better tag listing

This commit is contained in:
byte[] 2019-08-18 14:35:10 -04:00
parent 451a5685e2
commit 962c681c8e
4 changed files with 5 additions and 27 deletions

View file

@ -18,7 +18,7 @@ defmodule Philomena.Tags do
"""
def list_tags do
Repo.all(Tag)
Repo.all(Tag |> order_by(desc: :images_count) |> limit(250))
end
@doc """

View file

@ -1,2 +1,3 @@
= for tag <- @tags do
= render PhilomenaWeb.TagView, "_tag.html", tag: tag
.tag-list
= for tag <- @tags do
= render PhilomenaWeb.TagView, "_tag.html", tag: tag

View file

@ -1,24 +0,0 @@
<h1>Listing Tags</h1>
<table>
<thead>
<tr>
<th></th>
</tr>
</thead>
<tbody>
<%= for tag <- @tags do %>
<tr>
<td>
<%= link "Show", to: Routes.tag_path(@conn, :show, tag) %>
<%= link "Edit", to: Routes.tag_path(@conn, :edit, tag) %>
<%= link "Delete", to: Routes.tag_path(@conn, :delete, tag), method: :delete, data: [confirm: "Are you sure?"] %>
</td>
</tr>
<% end %>
</tbody>
</table>
<span><%= link "New Tag", to: Routes.tag_path(@conn, :new) %></span>

View file

@ -0,0 +1 @@
= render PhilomenaWeb.TagView, "_tag_list.html", tags: @tags