mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 13:47:58 +01:00
rearrange image tag changes
This commit is contained in:
parent
413c19a97d
commit
ad17b48011
5 changed files with 48 additions and 41 deletions
|
@ -16,43 +16,4 @@ h1
|
|||
= link "Added", to: Routes.image_tag_change_path(@conn, :index, @image, added: 1)
|
||||
= link "All", to: Routes.image_tag_change_path(@conn, :index, @image)
|
||||
|
||||
.block__header
|
||||
= pagination
|
||||
|
||||
.block__content
|
||||
table.table
|
||||
thead
|
||||
tr
|
||||
th colspan=2 Image
|
||||
th Tag
|
||||
th Action
|
||||
th Timestamp
|
||||
th User
|
||||
|
||||
tbody
|
||||
= for tag_change <- @tag_changes do
|
||||
tr
|
||||
td.center
|
||||
= link tag_change.image_id, to: Routes.image_path(@conn, :show, tag_change.image)
|
||||
td.center
|
||||
= render PhilomenaWeb.ImageView, "_image_container.html", image: tag_change.image, size: :thumb_tiny, conn: @conn
|
||||
|
||||
td
|
||||
= if tag_change.tag do
|
||||
= render PhilomenaWeb.TagView, "_tag.html", tag: tag_change.tag, conn: @conn
|
||||
- else
|
||||
= tag_change.tag_name_cache || "Unknown tag"
|
||||
|
||||
= if tag_change.added do
|
||||
td.success Added
|
||||
- else
|
||||
td.danger Removed
|
||||
|
||||
td
|
||||
= pretty_time(tag_change.created_at)
|
||||
|
||||
td
|
||||
= render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: tag_change, conn: @conn
|
||||
|
||||
.block__header
|
||||
= pagination
|
||||
= render PhilomenaWeb.TagChangeView, "index.html", conn: @conn, tag_changes: @tag_changes, pagination: pagination
|
|
@ -3,7 +3,7 @@ meta name="theme-color"
|
|||
meta name="format-detection" content="telephone=no"
|
||||
meta name="robots" content="noindex, nofollow"
|
||||
|
||||
= if !is_nil(@conn.assigns[:image]) and @conn.assigns.image.__meta__.state == :loaded do
|
||||
= if opengraph?(@conn) do
|
||||
- image = @conn.assigns.image
|
||||
- filtered = ImageView.filter_or_spoiler_hits?(@conn, image)
|
||||
|
||||
|
|
40
lib/philomena_web/templates/tag_change/index.html.slime
Normal file
40
lib/philomena_web/templates/tag_change/index.html.slime
Normal file
|
@ -0,0 +1,40 @@
|
|||
.block__header
|
||||
= @pagination
|
||||
|
||||
.block__content
|
||||
table.table
|
||||
thead
|
||||
tr
|
||||
th colspan=2 Image
|
||||
th Tag
|
||||
th Action
|
||||
th Timestamp
|
||||
th User
|
||||
|
||||
tbody
|
||||
= for tag_change <- @tag_changes do
|
||||
tr
|
||||
td.center
|
||||
= link tag_change.image_id, to: Routes.image_path(@conn, :show, tag_change.image)
|
||||
td.center
|
||||
= render PhilomenaWeb.ImageView, "_image_container.html", image: tag_change.image, size: :thumb_tiny, conn: @conn
|
||||
|
||||
td
|
||||
= if tag_change.tag do
|
||||
= render PhilomenaWeb.TagView, "_tag.html", tag: tag_change.tag, conn: @conn
|
||||
- else
|
||||
= tag_change.tag_name_cache || "Unknown tag"
|
||||
|
||||
= if tag_change.added do
|
||||
td.success Added
|
||||
- else
|
||||
td.danger Removed
|
||||
|
||||
td
|
||||
= pretty_time(tag_change.created_at)
|
||||
|
||||
td
|
||||
= render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: tag_change, conn: @conn
|
||||
|
||||
.block__header
|
||||
= @pagination
|
|
@ -76,4 +76,7 @@ defmodule PhilomenaWeb.LayoutView do
|
|||
|
||||
def artist_tags(tags),
|
||||
do: Enum.filter(tags, & &1.namespace == "artist")
|
||||
|
||||
def opengraph?(conn),
|
||||
do: !is_nil(conn.assigns[:image]) and conn.assigns.image.__meta__.state == :loaded and is_list(conn.assigns.image.tags)
|
||||
end
|
||||
|
|
3
lib/philomena_web/views/tag_change_view.ex
Normal file
3
lib/philomena_web/views/tag_change_view.ex
Normal file
|
@ -0,0 +1,3 @@
|
|||
defmodule PhilomenaWeb.TagChangeView do
|
||||
use PhilomenaWeb, :view
|
||||
end
|
Loading…
Reference in a new issue