philomena/lib/philomena_web/templates/conversation/index.html.slime

43 lines
1.6 KiB
Text
Raw Normal View History

2019-11-16 05:38:42 +01:00
elixir:
route = fn p -> Routes.conversation_path(@conn, :index, p) end
pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @conversations, route: route, conn: @conn
h1 My Conversations
.block
.block__header
2019-11-18 17:00:08 +01:00
a href=Routes.conversation_path(@conn, :new)
i.fa.fa-paper-plane>
' Create New Conversation
2019-11-16 05:38:42 +01:00
= pagination
.block__content
table.table.table--communication-list
thead
tr
th.table--communication-list__name Conversation
th.table--communication-list__stats With
th.table--communication-list__options Options
tbody
2019-12-08 00:24:37 +01:00
= for {c, count} <- @conversations do
2019-11-18 17:00:08 +01:00
tr class=conversation_class(@conn.assigns.current_user, c)
2019-11-16 05:41:10 +01:00
td.table--communication-list__name
=> link c.title, to: Routes.conversation_path(@conn, :show, c)
2019-11-16 05:38:42 +01:00
2019-11-16 05:41:10 +01:00
.small-text.hide-mobile
2019-12-08 00:29:22 +01:00
=> count
= pluralize("message", "messages", count)
' ; started
2019-11-16 05:41:10 +01:00
= pretty_time(c.created_at)
' , last message
= pretty_time(c.last_message_at)
2019-11-16 05:38:42 +01:00
2019-11-16 05:41:10 +01:00
td.table--communication-list__stats
2019-12-08 21:15:59 +01:00
= render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: other_party(@current_user, c)}, conn: @conn
2019-11-16 05:41:10 +01:00
td.table--communication-list__options
2019-12-08 00:24:37 +01:00
=> link "Last message", to: last_message_path(@conn, c, count)
' &bull;
=> link "Hide", to: Routes.conversation_hide_path(@conn, :create, c), data: [method: "post"], data: [confirm: "Are you really, really sure?"]
2019-11-16 05:38:42 +01:00
.block__header.block__header--light
= pagination