FIX: add link to user profile for staged users
This commit is contained in:
parent
29fbc2d7bc
commit
5018a8033d
|
@ -9,6 +9,8 @@ const AdminUser = Discourse.User.extend({
|
||||||
customGroups: Em.computed.filter("groups", (g) => !g.automatic && Group.create(g)),
|
customGroups: Em.computed.filter("groups", (g) => !g.automatic && Group.create(g)),
|
||||||
automaticGroups: 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() {
|
generateApiKey() {
|
||||||
const self = this;
|
const self = this;
|
||||||
return Discourse.ajax("/admin/users/" + this.get('id') + "/generate_api_key", {
|
return Discourse.ajax("/admin/users/" + this.get('id') + "/generate_api_key", {
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
<section class="details {{unless model.active 'not-activated'}}">
|
<section class="details {{unless model.active 'not-activated'}}">
|
||||||
|
|
||||||
<div class='user-controls'>
|
<div class='user-controls'>
|
||||||
{{#if model.active}}
|
{{#if model.canViewProfile}}
|
||||||
{{#link-to 'user' model class="btn"}}
|
{{#link-to 'user' model class="btn"}}
|
||||||
{{fa-icon "user"}}
|
{{fa-icon "user"}}
|
||||||
{{i18n 'admin.user.show_public_profile'}}
|
{{i18n 'admin.user.show_public_profile'}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
|
{{/if}}
|
||||||
|
{{#if model.active}}
|
||||||
{{#if model.can_impersonate}}
|
{{#if model.can_impersonate}}
|
||||||
<button class='btn btn-danger' {{action "impersonate" target="content"}} title="{{i18n 'admin.impersonate.help'}}">
|
<button class='btn btn-danger' {{action "impersonate" target="content"}} title="{{i18n 'admin.impersonate.help'}}">
|
||||||
{{fa-icon "crosshairs"}}
|
{{fa-icon "crosshairs"}}
|
||||||
|
@ -344,6 +346,12 @@
|
||||||
{{/conditional-loading-spinner}}
|
{{/conditional-loading-spinner}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="display-row">
|
||||||
|
<div class='field'>{{i18n 'admin.user.staged'}}</div>
|
||||||
|
<div class='value'>{{model.staged}}</div>
|
||||||
|
<div class='controls'>{{i18n 'admin.user.stage_explanation'}}</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class='details'>
|
<section class='details'>
|
||||||
|
|
|
@ -56,10 +56,6 @@ class AdminDetailedUserSerializer < AdminUserSerializer
|
||||||
scope.can_anonymize_user?(object)
|
scope.can_anonymize_user?(object)
|
||||||
end
|
end
|
||||||
|
|
||||||
def moderator
|
|
||||||
object.moderator
|
|
||||||
end
|
|
||||||
|
|
||||||
def topic_count
|
def topic_count
|
||||||
object.topics.count
|
object.topics.count
|
||||||
end
|
end
|
||||||
|
@ -72,18 +68,10 @@ class AdminDetailedUserSerializer < AdminUserSerializer
|
||||||
object.suspend_record.try(:acting_user)
|
object.suspend_record.try(:acting_user)
|
||||||
end
|
end
|
||||||
|
|
||||||
def tl3_requirements
|
|
||||||
object.tl3_requirements
|
|
||||||
end
|
|
||||||
|
|
||||||
def include_tl3_requirements?
|
def include_tl3_requirements?
|
||||||
object.has_trust_level?(TrustLevel[2])
|
object.has_trust_level?(TrustLevel[2])
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_fields
|
|
||||||
object.user_fields
|
|
||||||
end
|
|
||||||
|
|
||||||
def include_user_fields?
|
def include_user_fields?
|
||||||
object.user_fields.present?
|
object.user_fields.present?
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,8 @@ class AdminUserListSerializer < BasicUserSerializer
|
||||||
:suspended_till,
|
:suspended_till,
|
||||||
:suspended,
|
:suspended,
|
||||||
:blocked,
|
:blocked,
|
||||||
:time_read
|
:time_read,
|
||||||
|
:staged
|
||||||
|
|
||||||
[:days_visited, :posts_read_count, :topics_entered, :post_count].each do |sym|
|
[:days_visited, :posts_read_count, :topics_entered, :post_count].each do |sym|
|
||||||
attributes sym
|
attributes sym
|
||||||
|
@ -72,10 +73,6 @@ class AdminUserListSerializer < BasicUserSerializer
|
||||||
AgeWords.age_words(object.user_stat.time_read)
|
AgeWords.age_words(object.user_stat.time_read)
|
||||||
end
|
end
|
||||||
|
|
||||||
def created_at
|
|
||||||
object.created_at
|
|
||||||
end
|
|
||||||
|
|
||||||
def created_at_age
|
def created_at_age
|
||||||
AgeWords.age_words(Time.now - object.created_at)
|
AgeWords.age_words(Time.now - object.created_at)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2401,6 +2401,7 @@ en:
|
||||||
moderator: "Moderator?"
|
moderator: "Moderator?"
|
||||||
admin: "Admin?"
|
admin: "Admin?"
|
||||||
blocked: "Blocked?"
|
blocked: "Blocked?"
|
||||||
|
staged: "Staged?"
|
||||||
show_admin_profile: "Admin"
|
show_admin_profile: "Admin"
|
||||||
edit_title: "Edit Title"
|
edit_title: "Edit Title"
|
||||||
save_title: "Save Title"
|
save_title: "Save Title"
|
||||||
|
@ -2470,6 +2471,7 @@ en:
|
||||||
deactivate_explanation: "A deactivated user must re-validate their email."
|
deactivate_explanation: "A deactivated user must re-validate their email."
|
||||||
suspended_explanation: "A suspended user can't log in."
|
suspended_explanation: "A suspended user can't log in."
|
||||||
block_explanation: "A blocked user can't post or start topics."
|
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."
|
trust_level_change_failed: "There was a problem changing the user's trust level."
|
||||||
suspend_modal_title: "Suspend User"
|
suspend_modal_title: "Suspend User"
|
||||||
trust_level_2_users: "Trust Level 2 Users"
|
trust_level_2_users: "Trust Level 2 Users"
|
||||||
|
|
Loading…
Reference in New Issue