Link avatar on user's own profile to the avatar change page (#151)

This commit is contained in:
David Joseph Guzsik 2020-06-28 21:49:34 +02:00 committed by GitHub
parent fa4aef3051
commit 4f85936437
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -42,4 +42,8 @@
= button_to "Remove my avatar", Routes.avatar_path(@conn, :delete), method: "delete", class: "button", data: [confirm: "Are you really, really sure?"] = button_to "Remove my avatar", Routes.avatar_path(@conn, :delete), method: "delete", class: "button", data: [confirm: "Are you really, really sure?"]
br br
= link "Back", to: Routes.pow_registration_path(@conn, :edit) - return_to = if blank?(@conn.params["profile"]) do
= Routes.pow_registration_path(@conn, :edit)
- else
= Routes.profile_path(@conn, :show, @current_user)
= link "Back", to: return_to

View file

@ -1,6 +1,10 @@
.profile-top .profile-top
.profile-top__avatar .profile-top__avatar
= render PhilomenaWeb.UserAttributionView, "_user_avatar.html", object: %{user: @user}, class: "avatar--125px" - 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 .profile-top__name-and-links
div div
h1.profile-top__name-header h1.profile-top__name-header