diff --git a/app/assets/javascripts/admin/models/admin-user.js.es6 b/app/assets/javascripts/admin/models/admin-user.js.es6 index 8bbd7290058..267d951e569 100644 --- a/app/assets/javascripts/admin/models/admin-user.js.es6 +++ b/app/assets/javascripts/admin/models/admin-user.js.es6 @@ -9,6 +9,8 @@ const AdminUser = Discourse.User.extend({ customGroups: Em.computed.filter("groups", (g) => !g.automatic && Group.create(g)), automaticGroups: Em.computed.filter("groups", (g) => g.automatic && Group.create(g)), + canViewProfile: Ember.computed.or("active", "staged"), + generateApiKey() { const self = this; return Discourse.ajax("/admin/users/" + this.get('id') + "/generate_api_key", { diff --git a/app/assets/javascripts/admin/templates/user-index.hbs b/app/assets/javascripts/admin/templates/user-index.hbs index b868854e83a..5c1c402d42f 100644 --- a/app/assets/javascripts/admin/templates/user-index.hbs +++ b/app/assets/javascripts/admin/templates/user-index.hbs @@ -1,11 +1,13 @@
- {{#if model.active}} + {{#if model.canViewProfile}} {{#link-to 'user' model class="btn"}} {{fa-icon "user"}} {{i18n 'admin.user.show_public_profile'}} {{/link-to}} + {{/if}} + {{#if model.active}} {{#if model.can_impersonate}}
+ +
+
{{i18n 'admin.user.staged'}}
+
{{model.staged}}
+
{{i18n 'admin.user.stage_explanation'}}
+
diff --git a/app/serializers/admin_detailed_user_serializer.rb b/app/serializers/admin_detailed_user_serializer.rb index 29a93fc2cde..ea7bfbabba9 100644 --- a/app/serializers/admin_detailed_user_serializer.rb +++ b/app/serializers/admin_detailed_user_serializer.rb @@ -56,10 +56,6 @@ class AdminDetailedUserSerializer < AdminUserSerializer scope.can_anonymize_user?(object) end - def moderator - object.moderator - end - def topic_count object.topics.count end @@ -72,18 +68,10 @@ class AdminDetailedUserSerializer < AdminUserSerializer object.suspend_record.try(:acting_user) end - def tl3_requirements - object.tl3_requirements - end - def include_tl3_requirements? object.has_trust_level?(TrustLevel[2]) end - def user_fields - object.user_fields - end - def include_user_fields? object.user_fields.present? end diff --git a/app/serializers/admin_user_list_serializer.rb b/app/serializers/admin_user_list_serializer.rb index df467881350..ba3953e5bb5 100644 --- a/app/serializers/admin_user_list_serializer.rb +++ b/app/serializers/admin_user_list_serializer.rb @@ -23,7 +23,8 @@ class AdminUserListSerializer < BasicUserSerializer :suspended_till, :suspended, :blocked, - :time_read + :time_read, + :staged [:days_visited, :posts_read_count, :topics_entered, :post_count].each do |sym| attributes sym @@ -46,7 +47,7 @@ class AdminUserListSerializer < BasicUserSerializer def can_impersonate scope.can_impersonate?(object) end - + def last_emailed_at return nil if object.last_emailed_at.blank? object.last_emailed_at @@ -56,7 +57,7 @@ class AdminUserListSerializer < BasicUserSerializer return nil if object.last_emailed_at.blank? AgeWords.age_words(Time.now - object.last_emailed_at) end - + def last_seen_at return nil if object.last_seen_at.blank? object.last_seen_at @@ -71,10 +72,6 @@ class AdminUserListSerializer < BasicUserSerializer return nil if object.user_stat.time_read.blank? AgeWords.age_words(object.user_stat.time_read) end - - def created_at - object.created_at - end def created_at_age AgeWords.age_words(Time.now - object.created_at) diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index e026c77c9ba..965269df68f 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2401,6 +2401,7 @@ en: moderator: "Moderator?" admin: "Admin?" blocked: "Blocked?" + staged: "Staged?" show_admin_profile: "Admin" edit_title: "Edit Title" save_title: "Save Title" @@ -2470,6 +2471,7 @@ en: deactivate_explanation: "A deactivated user must re-validate their email." suspended_explanation: "A suspended user can't log in." block_explanation: "A blocked user can't post or start topics." + stage_explanation: "A staged user can only post via email in specific topics." trust_level_change_failed: "There was a problem changing the user's trust level." suspend_modal_title: "Suspend User" trust_level_2_users: "Trust Level 2 Users"