philomena/lib/philomena_web/templates/forum/show.html.slime

62 lines
2.4 KiB
Text
Raw Normal View History

2019-10-09 01:30:51 +02:00
- pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @topics, route: fn p -> Routes.forum_path(@conn, :show, @forum, p) end
2019-10-06 23:31:48 +02:00
h1 = @forum.name
.block
.block__header
=> link("Forums", to: Routes.forum_path(@conn, :index))
' »
=> link(@forum.name, to: Routes.forum_path(@conn, :show, @forum))
2019-11-19 04:38:22 +01:00
a href=Routes.forum_topic_path(@conn, :new, @forum)
i.fa.fa-fw.fa-pencil>
' New Topic
2019-10-06 23:31:48 +02:00
/= icon_link 'Search Posts', 'fa fa-fw fa-search', posts_path(forum_id: @forum.id)
span.spacing-left
=> @forum.topic_count
' topics
.block__header--sub.block__header--light
2019-10-09 01:30:51 +02:00
= pagination
2019-10-06 23:31:48 +02:00
span.block__header__title = @forum.description
/- if current_user
/ = subscription_link(@forum, current_user)
/- else
/ | Login to subscribe to new threads
.block__content
table.table.table--communication-list
thead
tr
th.table--communication-list__name Topic
th.table--communication-list__stats.hide-mobile Views
th.table--communication-list__stats.hide-mobile Posts
th.table--communication-list__last-post Last Post
tbody
= for topic <- @topics do
tr
td.table--communication-list__name
= if topic.sticky do
2019-11-17 23:54:04 +01:00
i.fa.fa-thumb-tack
2019-10-06 23:31:48 +02:00
= if topic.locked_at do
i.fa.fa-lock
= if topic.poll do
i.fas.fa-poll-h
=< link(topic.title, to: Routes.forum_topic_path(@conn, :show, @forum, topic))
.small-text
' Posted
=> pretty_time(topic.created_at)
' by
2019-11-12 02:27:09 +01:00
= render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic, conn: @conn
2019-10-06 23:31:48 +02:00
td.table--communication-list__stats.hide-mobile = topic.view_count
td.table--communication-list__stats.hide-mobile = topic.post_count
td.table--communication-list__last-post
= if topic.last_post do
2019-11-11 18:57:02 +01:00
=> link("Go to post", to: Routes.forum_topic_path(@conn, :show, @forum, topic, post_id: topic.last_post) <> "#post_#{topic.last_post.id}")
2019-10-06 23:31:48 +02:00
' by
2019-11-12 02:27:09 +01:00
= render PhilomenaWeb.UserAttributionView, "_anon_user.html", object: topic.last_post, conn: @conn
2019-10-06 23:31:48 +02:00
br
=> pretty_time(topic.last_post.created_at)
2019-10-09 01:30:51 +02:00
.block__header.block__header--light
= pagination
2019-10-06 23:31:48 +02:00
/- if current_user
/ = render partial: 'topics/form'