mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-25 14:34:33 +01:00
slightly better tag listing
This commit is contained in:
parent
451a5685e2
commit
962c681c8e
4 changed files with 5 additions and 27 deletions
|
@ -18,7 +18,7 @@ defmodule Philomena.Tags do
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def list_tags do
|
def list_tags do
|
||||||
Repo.all(Tag)
|
Repo.all(Tag |> order_by(desc: :images_count) |> limit(250))
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
= for tag <- @tags do
|
.tag-list
|
||||||
= render PhilomenaWeb.TagView, "_tag.html", tag: tag
|
= for tag <- @tags do
|
||||||
|
= render PhilomenaWeb.TagView, "_tag.html", tag: tag
|
|
@ -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>
|
|
1
lib/philomena_web/templates/tag/index.html.slime
Normal file
1
lib/philomena_web/templates/tag/index.html.slime
Normal file
|
@ -0,0 +1 @@
|
||||||
|
= render PhilomenaWeb.TagView, "_tag_list.html", tags: @tags
|
Loading…
Reference in a new issue