mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 20:37:59 +01:00
63 lines
2.9 KiB
Text
63 lines
2.9 KiB
Text
elixir:
|
|
route = fn p -> Routes.conversation_path(@conn, :show, @conversation, p) end
|
|
pagination = render PhilomenaWeb.PaginationView, "_pagination.html", page: @messages, route: route, conn: @conn
|
|
other = other_party(@current_user, @conversation)
|
|
|
|
h1 = @conversation.title
|
|
.block
|
|
.block__header
|
|
=> link "Message Center", to: Routes.conversation_path(@conn, :index)
|
|
' »
|
|
=> link @conversation.title, to: Routes.conversation_path(@conn, :show, @conversation)
|
|
' Conversation with
|
|
=> render PhilomenaWeb.UserAttributionView, "_user.html", object: %{user: other}, conn: @conn
|
|
.block__header--sub.block__header--light.page__header
|
|
span.page__title>
|
|
=> @messages.total_entries
|
|
= pluralize("message", "messages", @messages.total_entries)
|
|
.page__pagination = pagination
|
|
.page__info
|
|
= if hidden_by?(@current_user, @conversation) do
|
|
= link "Restore conversation", to: Routes.conversation_hide_path(@conn, :delete, @conversation), data: [method: "delete"]
|
|
- else
|
|
= link "Remove conversation", to: Routes.conversation_hide_path(@conn, :create, @conversation), data: [method: "post", confirm: "Are you really, really sure?"]
|
|
= link "Report conversation", to: Routes.conversation_report_path(@conn, :new, @conversation)
|
|
= link "Mark as unread", to: Routes.conversation_read_path(@conn, :delete, @conversation), data: [method: "delete"]
|
|
|
|
= for {message, body} <- @messages do
|
|
= render PhilomenaWeb.MessageView, "_message.html", message: message, body: body, conn: @conn
|
|
|
|
.block
|
|
.block__header.block__header--light.page__header
|
|
.page__pagination = pagination
|
|
|
|
= case DateTime.compare(DateTime.utc_now(), DateTime.add(@conn.assigns.current_user.created_at, 1_209_600)) do
|
|
- :lt ->
|
|
.block.block--fixed.block--warning.hidden.js-hidden-warning
|
|
h2 Warning!
|
|
p
|
|
strong> Your account is too new, so your PM will need to be reviewed by staff members.
|
|
' This is because it contains an external image. If you are not okay with a moderator viewing this PM conversation, please consider linking the image instead of embedding it (change
|
|
code<> ![
|
|
' to
|
|
code<
|
|
| [
|
|
| ).
|
|
- _ ->
|
|
/ Nothing
|
|
|
|
= cond do
|
|
- @conn.assigns.current_ban ->
|
|
= render PhilomenaWeb.BanView, "_ban_reason.html", conn: @conn
|
|
|
|
- @messages.total_entries < 1_000 ->
|
|
= render PhilomenaWeb.Conversation.MessageView, "_form.html", conversation: @conversation, changeset: @changeset, conn: @conn
|
|
|
|
- true ->
|
|
div
|
|
h2 Okay, we're impressed
|
|
p You've managed to send over 1,000 messages in this conversation!
|
|
p We'd like to ask you to make a new conversation. Don't worry, this one won't go anywhere if you need to refer back to it.
|
|
p
|
|
=> link "Click here", to: Routes.conversation_path(@conn, :new, receipient: other.name)
|
|
' to make a new conversation with this user.
|