about summary refs log tree commit diff
path: root/app/views/accounts
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-11-19 01:30:29 -0600
committerDavid Yip <yipdw@member.fsf.org>2017-11-19 01:30:29 -0600
commitd083f7741a5996ee24bbdb7cd177e4db2ddfaead (patch)
tree7c950b5ee0f16b59b7acae023eadd949325fc2d7 /app/views/accounts
parentbcda3f85ce1473e9285299979a471525b2cd7034 (diff)
parent08deec4c84f00d241d60a6962806d5abe4638edd (diff)
Merge remote-tracking branch 'tootsuite/master'
Diffstat (limited to 'app/views/accounts')
-rw-r--r--app/views/accounts/_header.html.haml20
-rw-r--r--app/views/accounts/_moved_strip.html.haml17
-rw-r--r--app/views/accounts/show.html.haml2
3 files changed, 29 insertions, 10 deletions
diff --git a/app/views/accounts/_header.html.haml b/app/views/accounts/_header.html.haml
index 94ec5ae5b..b0062752c 100644
--- a/app/views/accounts/_header.html.haml
+++ b/app/views/accounts/_header.html.haml
@@ -1,7 +1,7 @@
 - processed_bio = FrontmatterHandler.instance.process_bio Formatter.instance.simplified_format account
 .card.h-card.p-author{ style: "background-image: url(#{account.header.url(:original)})" }
   .card__illustration
-    - unless account.memorial?
+    - unless account.memorial? || account.moved?
       - if user_signed_in? && current_account.id != account.id && !current_account.requested?(account)
         .controls
           - if current_account.following?(account)
@@ -27,15 +27,15 @@
       %small
         %span @#{account.local_username_and_domain}
         = fa_icon('lock') if account.locked?
-
-    - if account.user_admin?
-      .roles
-        .account-role.admin
-          = t 'accounts.roles.admin'
-    - elsif account.user_moderator?
-      .roles
-        .account-role.moderator
-          = t 'accounts.roles.moderator'
+    - if Setting.show_staff_badge
+      - if account.user_admin?
+        .roles
+          .account-role.admin
+            = t 'accounts.roles.admin'
+      - elsif account.user_moderator?
+        .roles
+          .account-role.moderator
+            = t 'accounts.roles.moderator'
     .bio
       .account__header__content.p-note.emojify!=processed_bio[:text]
       - if processed_bio[:metadata].length > 0
diff --git a/app/views/accounts/_moved_strip.html.haml b/app/views/accounts/_moved_strip.html.haml
new file mode 100644
index 000000000..6a14a5dd3
--- /dev/null
+++ b/app/views/accounts/_moved_strip.html.haml
@@ -0,0 +1,17 @@
+- moved_to_account = account.moved_to_account
+
+.moved-strip
+  .moved-strip__message
+    = fa_icon 'suitcase'
+    = t('accounts.moved_html', name: content_tag(:strong, display_name(account), class: :emojify), new_profile_link: link_to(content_tag(:strong, safe_join(['@', content_tag(:span, moved_to_account.acct)])), TagManager.instance.url_for(moved_to_account), class: 'mention'))
+
+  .moved-strip__card
+    = link_to TagManager.instance.url_for(moved_to_account), class: 'detailed-status__display-name p-author h-card', target: '_blank', rel: 'noopener' do
+      .detailed-status__display-avatar
+        .account__avatar-overlay
+          .account__avatar-overlay-base{ style: "background-image: url('#{moved_to_account.avatar.url(:original)}')" }
+          .account__avatar-overlay-overlay{ style: "background-image: url('#{account.avatar.url(:original)}')" }
+
+      %span.display-name
+        %strong.emojify= display_name(moved_to_account)
+        %span @#{moved_to_account.acct}
diff --git a/app/views/accounts/show.html.haml b/app/views/accounts/show.html.haml
index fd8ad5530..accad5f78 100644
--- a/app/views/accounts/show.html.haml
+++ b/app/views/accounts/show.html.haml
@@ -14,6 +14,8 @@
 
 - if @account.memorial?
   .memoriam-strip= t('in_memoriam_html')
+- elsif @account.moved?
+  = render partial: 'moved_strip', locals: { account: @account }
 - elsif show_landing_strip?
   = render partial: 'shared/landing_strip', locals: { account: @account }