mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 23:08:00 +01:00
151 lines
6.8 KiB
Text
151 lines
6.8 KiB
Text
.profile-top
|
|
.profile-top__avatar
|
|
- avatar = render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @user}, class: "avatar--125px"
|
|
= if current?(@user, @conn.assigns.current_user) do
|
|
= link avatar, to: Routes.avatar_path(@conn, :edit, profile: true), title: "Change avatar"
|
|
- else
|
|
= avatar
|
|
.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
|
|
|
|
span
|
|
' Member since
|
|
= pretty_time(@user.created_at)
|
|
|
|
.profile-top__options
|
|
ul.profile-top__options__column
|
|
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))
|
|
|
|
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}"))
|
|
= if current?(@user, @conn.assigns.current_user) do
|
|
li = link "My reports", to: Routes.report_path(@conn, :index)
|
|
|
|
ul.profile-top__options__column
|
|
li = link("Favorites", to: Routes.search_path(@conn, :index, q: "faved_by_id:#{@user.id}"))
|
|
li = link("Tag changes", to: Routes.profile_tag_change_path(@conn, :index, @user))
|
|
li = link("Source changes", to: Routes.profile_source_change_path(@conn, :index, @user))
|
|
|
|
= if can_index_user?(@conn) do
|
|
.js-staff-action
|
|
= render PhilomenaWeb.ProfileView, "_admin_block.html", assigns
|
|
|
|
= if (current?(@user, @conn.assigns.current_user) or can?(@conn, :index, Philomena.Bans.User)) and Enum.any?(@bans) do
|
|
.block
|
|
.block__header--single-item
|
|
' Ban History
|
|
.block__content
|
|
= render PhilomenaWeb.BanView, "_bans.html", bans: @bans, conn: @conn
|
|
|
|
.column-layout
|
|
.column-layout__left
|
|
.block
|
|
.block__header
|
|
span.block__header__title Commissions
|
|
= render PhilomenaWeb.ProfileView, "_commission.html", user: @user, commission_information: @commission_information, conn: @conn
|
|
|
|
.block
|
|
= if current?(@user, @conn.assigns.current_user) or manages_links?(@conn, @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
|
|
= for link <- @user.verified_links, link.public or can?(@conn, :edit, link) do
|
|
- watchers = if link.tag, do: @watcher_counts[link.tag.id] || 0, else: 0
|
|
|
|
.block__content.alternating-color.break-word
|
|
.center
|
|
= if link.tag do
|
|
.tag_list = render PhilomenaWeb.TagView, "_tag.html", tag: link.tag, conn: @conn
|
|
= 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
|
|
=> if link.public do
|
|
' Public
|
|
- else
|
|
' Hidden
|
|
' •
|
|
a href=Routes.profile_user_link_path(@conn, :edit, @user, link)
|
|
' Edit
|
|
|
|
.block
|
|
= if manages_awards?(@conn) and not hide_staff_tools?(@conn) do
|
|
a.block__header--single-item href=Routes.profile_award_path(@conn, :new, @user) Badges
|
|
- else
|
|
.block__header
|
|
span.block__header__title Badges
|
|
= 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
|
|
.badge = badge_image(award.badge, alt: award.label, width: "32", height: "32")
|
|
br
|
|
= award_title(award)
|
|
.flex__grow.center
|
|
=> pretty_time(award.awarded_on)
|
|
= if manages_awards?(@conn) do
|
|
= user_abbrv(@conn, award.awarded_by)
|
|
|
|
= 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
|
|
|
|
.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
|
|
|
|
= render PhilomenaWeb.ProfileView, "_about_me.html", user: @user, about_me: @about_me, conn: @conn
|
|
|
|
= if can_read_mod_notes?(@conn) and not hide_staff_tools?(@conn) do
|
|
.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
|
|
|
|
.column-layout__main
|
|
= render PhilomenaWeb.ProfileView, "_statistics.html", user: @user, statistics: @statistics, conn: @conn
|
|
= 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
|
|
= 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
|
|
= 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
|