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

141 lines
6.4 KiB
Text
Raw Normal View History

2019-11-11 20:27:09 -05:00
.profile-top
.profile-top__avatar
= render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @user}, class: "avatar--125px"
.profile-top__name-and-links
div
h1.profile-top__name-header
= @user.name
| 's profile
= render PhilomenaWeb.UserAttributionView, "_user_title.html", object: %{user: @user}, large: true
br
= if can?(@conn, :edit_description, @user) do
= link "Edit Personal Title", to: Routes.profile_description_path(@conn, :edit, @user)
br
2019-11-11 20:27:09 -05:00
span
' Member since
= pretty_time(@user.created_at)
.profile-top__options
ul.profile-top__options__column
2019-12-04 08:25:10 -05:00
li = link("Send message", to: Routes.conversation_path(@conn, :new, recipient: @user.name))
li = link("Our conversations", to: Routes.conversation_path(@conn, :index, with: @user.id))
li = link("Report this user", to: Routes.profile_report_path(@conn, :new, @user))
2019-11-11 20:27:09 -05:00
ul.profile-top__options__column
li = link("Uploads", to: Routes.search_path(@conn, :index, q: "uploader_id:#{@user.id}"))
li = link("Comments", to: Routes.comment_path(@conn, :index, cq: "user_id:#{@user.id}"))
li = link("Posts", to: Routes.post_path(@conn, :index, pq: "user_id:#{@user.id}"))
2019-12-05 13:32:53 -05:00
= if current?(@user, @conn.assigns.current_user) do
li = link "My reports", to: Routes.report_path(@conn, :index)
2019-11-11 20:27:09 -05:00
ul.profile-top__options__column
li = link("Favorites", to: Routes.search_path(@conn, :index, q: "faved_by_id:#{@user.id}"))
2019-12-04 17:10:35 -05:00
li = link("Tag changes", to: Routes.profile_tag_change_path(@conn, :index, @user))
2019-12-04 17:56:13 -05:00
li = link("Source changes", to: Routes.profile_source_change_path(@conn, :index, @user))
2019-11-11 20:27:09 -05:00
2019-12-17 00:44:24 -05:00
= if can_index_user?(@conn) do
2019-12-20 17:35:46 -05:00
.js-staff-action
= render PhilomenaWeb.ProfileView, "_admin_block.html", assigns
2019-12-17 00:44:24 -05:00
2019-12-19 19:00:09 -05:00
= if (current?(@user, @conn.assigns.current_user) or can?(@conn, :index, Philomena.Bans.User)) and Enum.any?(@bans) do
2019-12-08 15:32:54 -05:00
.block
2019-12-19 19:00:09 -05:00
.block__header--single-item
2019-12-08 15:32:54 -05:00
' Ban History
.block__content
= render PhilomenaWeb.BanView, "_bans.html", bans: @bans, conn: @conn
2019-11-11 20:27:09 -05:00
.column-layout
.column-layout__left
2019-12-05 18:11:15 -05:00
.block
.block__header
span.block__header__title Commissions
= render PhilomenaWeb.ProfileView, "_commission.html", user: @user, commission_information: @commission_information, conn: @conn
2019-11-11 20:27:09 -05:00
.block
2019-12-20 10:05:34 -05:00
= if current?(@user, @conn.assigns.current_user) do
a.block__header--single-item href=Routes.profile_user_link_path(@conn, :new, @user) User Links
- else
.block__header
span.block__header__title User Links
2019-12-09 20:21:49 -05:00
= for link <- @user.verified_links, link.public or can?(@conn, :edit, link) do
2019-12-10 21:58:16 -05:00
- watchers = if link.tag, do: @watcher_counts[link.tag.id] || 0, else: 0
2019-11-11 20:27:09 -05:00
.block__content.alternating-color.break-word
.center
= if link.tag do
2019-12-06 12:12:55 -05:00
.tag_list = render PhilomenaWeb.TagView, "_tag.html", tag: link.tag, conn: @conn
2019-11-11 20:27:09 -05:00
= link(link.uri, to: link.uri)
= if current?(@user, @conn.assigns.current_user) do
br
' Watched by
=> watchers
= pluralize("user", "users", watchers)
= if manages_links?(@conn, @user) do
br
a href=Routes.profile_user_link_path(@conn, :edit, @user, link)
' Edit
2019-11-11 20:27:09 -05:00
.block
2019-12-20 17:35:46 -05:00
= if manages_awards?(@conn) and not hide_staff_tools?(@conn) do
2019-12-20 10:05:34 -05:00
a.block__header--single-item href=Routes.profile_award_path(@conn, :new, @user) Badges
- else
.block__header
span.block__header__title Badges
2019-11-11 20:27:09 -05:00
= for award <- award_order(@user.awards) do
.block__content.flex.flex--centered.flex--center-distributed.alternating-color.no-overflow title=award.label
.flex__grow.center
2019-11-11 20:37:11 -05:00
.badge = badge_image(award.badge, alt: award.label, width: "32", height: "32")
2019-11-11 20:27:09 -05:00
br
2019-11-11 20:41:26 -05:00
= award_title(award)
2019-11-11 20:27:09 -05:00
.flex__grow.center
= pretty_time(award.awarded_on)
2019-12-15 15:02:13 -05:00
= if manages_awards?(@conn) do
.flex__grow.center
a href=Routes.profile_award_path(@conn, :delete, @user, award) data-method="delete" data-confirm="Are you really, really sure?"
' Remove
br
a href=Routes.profile_award_path(@conn, :edit, @user, award)
' Edit
2019-12-05 13:35:44 -05:00
.block
.block__header
= if can?(@conn, :edit_description, @user) do
a.block__header--single-item href=Routes.profile_description_path(@conn, :edit, @user) About Me
- else
span.block__header__title About Me
2019-12-05 13:35:44 -05:00
= render PhilomenaWeb.ProfileView, "_about_me.html", user: @user, about_me: @about_me, conn: @conn
2019-12-20 17:35:46 -05:00
= if can_read_mod_notes?(@conn) and not hide_staff_tools?(@conn) do
2019-12-17 12:29:18 -05:00
.block
a.block__header--single-item href=Routes.profile_detail_path(@conn, :index, @user) Mod Notes
table.table
thead
tr
th Note
th Created
tbody
= for {body, mod_note} <- @mod_notes do
tr
td == body
td = pretty_time(mod_note.created_at)
= if can_index_user?(@conn) do
.block
a.block__header--single-item href=Routes.profile_scratchpad_path(@conn, :edit, @user) Moderation Scratchpad
.block__content.profile-about
== @scratchpad
2019-12-17 12:29:18 -05:00
2019-11-11 20:27:09 -05:00
.column-layout__main
2019-12-05 08:55:49 -05:00
= render PhilomenaWeb.ProfileView, "_statistics.html", user: @user, statistics: @statistics, conn: @conn
2019-12-07 17:07:53 -05:00
= render PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Artwork", images: @recent_artwork, view_all_path: Routes.search_path(@conn, :index, q: tag_disjunction(@tags)), conn: @conn
2019-11-18 08:10:17 -05:00
= render PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Uploads", images: @recent_uploads, view_all_path: Routes.search_path(@conn, :index, q: "uploader_id:#{@user.id}"), conn: @conn
2019-12-04 23:53:56 -05:00
= render PhilomenaWeb.ProfileView, "_recent_images.html", title: "Recent Favorites", images: @recent_faves, view_all_path: Routes.search_path(@conn, :index, q: "faved_by_id:#{@user.id}"), conn: @conn
= render PhilomenaWeb.ProfileView, "_recent_galleries.html", galleries: @recent_galleries, user: @user, conn: @conn
= render PhilomenaWeb.ProfileView, "_recent_comments.html", comments: @recent_comments, user: @user, conn: @conn
= render PhilomenaWeb.ProfileView, "_recent_posts.html", posts: @recent_posts, user: @user, conn: @conn