Retrospring/app/views/user/_actions.haml

47 lines
2.3 KiB
Plaintext

.profile__actions
- type ||= :nil
- if user_signed_in? && user == current_user
%a.btn.btn-dark.btn-block{ href: settings_profile_path } Edit profile
- elsif user_signed_in?
- if current_user.following? user
%button.btn.btn-primary.btn-block{ type: :button, name: 'user-action', data: { action: :unfollow, type: type, target: user.screen_name } }
= t("voc.unfollow")
- else
%button.btn.btn-primary.btn-block{ type: :button, name: 'user-action', data: { action: :follow, type: type, target: user.screen_name } }
= t("voc.follow")
.btn-group.btn-block
%button.btn.btn-light.btn-block.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } }
= t(".title")
%span.caret
.dropdown-menu
%a.dropdown-item.d-block.d-sm-none{ href: '#', data: { target: '#modal-list-memberships', toggle: :modal } }
%i.fa.fa-list
= t(".list")
- if current_user.blocking?(user)
%a.dropdown-item{ href: '#', data: { action: :unblock, target: user.screen_name } }
%i.fa.fa-minus-circle
%span.pe-none= t("voc.unblock")
- else
%a.dropdown-item{ href: '#', data: { action: :block, target: user.screen_name } }
%i.fa.fa-minus-circle
%span.pe-none= t("voc.block")
%a.dropdown-item{ href: '#', data: { action: 'report-user', target: user.screen_name } }
%i.fa.fa-exclamation-triangle
= t("voc.report")
- if current_user.mod?
%a.dropdown-item{ href: '#', data: { target: '#modal-privileges', toggle: :modal } }
%i.fa.fa-wrench
= raw t(".privilege", user: user.screen_name)
- unless user.has_role?(:administrator)
%a.dropdown-item{ href: '#', data: { target: '#modal-ban', toggle: :modal } }
%i.fa.fa-ban
= t(".ban")
- if current_user.mod? && user != current_user
%a.dropdown-item{ href: mod_inbox_index_path(user: user.screen_name) }
%i.fa.fa-inbox
= t(".view_inbox")
- if current_user.has_role? :administrator
%a.dropdown-item{ href: rails_admin_path_for_resource(user), target: '_blank' }
%i.fa.fa-cogs
= t("voc.view_in_rails_admin")