2015-05-19 10:56:32 -04:00
|
|
|
<section class="details {{unless model.active "not-activated"}}">
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="user-controls">
|
2016-01-19 10:41:07 -05:00
|
|
|
{{#if model.canViewProfile}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{#link-to "user" model class="btn btn-default"}}
|
2017-07-26 16:25:09 -04:00
|
|
|
{{d-icon "user"}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "admin.user.show_public_profile"}}
|
2014-09-03 10:41:13 -04:00
|
|
|
{{/link-to}}
|
2016-01-19 10:41:07 -05:00
|
|
|
{{/if}}
|
2018-01-17 13:03:14 -05:00
|
|
|
|
2017-02-21 07:45:30 -05:00
|
|
|
{{#if model.can_view_action_logs}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
action=(action "viewActionLogs")
|
|
|
|
class="btn-default"
|
|
|
|
actionParam=model.username
|
2019-01-22 13:01:21 -05:00
|
|
|
icon="far-list-alt"
|
2019-01-22 10:44:55 -05:00
|
|
|
label="admin.user.action_logs"}}
|
2017-02-21 07:45:30 -05:00
|
|
|
{{/if}}
|
2016-01-19 10:41:07 -05:00
|
|
|
{{#if model.active}}
|
2014-09-03 10:41:13 -04:00
|
|
|
{{#if currentUser.admin}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "logOut")
|
|
|
|
icon="power-off"
|
|
|
|
label="admin.user.log_out"}}
|
2014-09-03 10:41:13 -04:00
|
|
|
{{/if}}
|
2014-08-27 13:52:01 -04:00
|
|
|
{{/if}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{plugin-outlet
|
|
|
|
name="admin-user-controls-after"
|
|
|
|
args=(hash model=model)
|
DEV: Update default tagName and connectorTagName for plugin outlets (#13685)
This commit should be a no-op for all existing core outlets. Outlets which are introduced by themes/plugins may see a change in behavior, and should follow the steps below if they want to maintain their previous behavior.
`tagName="" connectorTagName=""` is almost always the correct choice for plugin outlets. 40eba8cd introduced a `noTags=true` shortcut which achieved this, and left a comment saying it should be the future default. This commit does exactly that. To avoid any breaking changes for plugins, all existing plugin outlets have been reviewed and adjusted by following this logic:
1) If `noTags=true`, remove the `noTags` parameter, and do not complete any further steps
2) If `tagName` is not specified, set `tagName="span"` (the previous default)
3) If `connectorTagName` is not specified, set `selectorTagName="div"` (the previous default)
4) If `tagName=""`, remove it
5) If `connectorTagName=""`, remove it
The updates were accomplished with the help of a ruby script:
```ruby
def removeAttr(tag, attribute)
tag = tag.sub /\s#{attribute}="?\w*"? /, " "
tag = tag.sub /\s#{attribute}="?\w*"?}}/, "}}"
tag = tag.sub /^\s*#{attribute}="?\w*"?\n/, ""
tag
end
files = Dir.glob("app/assets/javascripts/**/*.hbs")
puts "Checking #{files.count} files..."
files.each do |f|
content = File.read(f)
count = 0
edits = 0
content.gsub!(/{{\s*plugin-outlet.*?}}/m) do |match|
count += 1
result = match
noTags = result.include?("noTags=true")
tagName = result[/tagName="(\w*)"/, 1]
connectorTagName = result[/connectorTagName="(\w*)"/, 1]
if noTags
result = removeAttr(result, "noTags")
else
if connectorTagName == ""
result = removeAttr(result, "connectorTagName")
elsif connectorTagName.nil?
result = result.sub(/name="[\w-]+"/) { |m| "#{m} connectorTagName=\"div\"" }
end
if tagName == ""
result = removeAttr(result, "tagName")
elsif tagName.nil?
result = result.sub(/name="[\w-]+"/) { |m| "#{m} tagName=\"span\"" }
end
end
edits += 1 if match != result
result
end
puts "#{count} outlets, #{edits} edited -> #{f}"
File.write(f, content)
end
```
2022-01-06 15:38:17 -05:00
|
|
|
}}
|
2014-08-27 13:52:01 -04:00
|
|
|
</div>
|
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row username">
|
|
|
|
{{admin-editable-field name="user.username.title"
|
2018-12-17 09:28:29 -05:00
|
|
|
value=model.username
|
2019-01-22 10:44:55 -05:00
|
|
|
action=(action "saveUsername")
|
2018-12-17 09:28:29 -05:00
|
|
|
editing=editingUsername}}
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2013-04-20 01:34:11 -04:00
|
|
|
|
2019-05-24 13:39:16 -04:00
|
|
|
<div class="display-row name">
|
2019-01-22 10:44:55 -05:00
|
|
|
{{admin-editable-field name="user.name.title"
|
2018-12-17 09:28:29 -05:00
|
|
|
value=model.name
|
2019-01-22 10:44:55 -05:00
|
|
|
action=(action "saveName")
|
2018-12-17 09:28:29 -05:00
|
|
|
editing=editingName}}
|
2015-09-19 08:13:28 -04:00
|
|
|
</div>
|
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
{{plugin-outlet
|
|
|
|
name="admin-user-below-names"
|
|
|
|
args=(hash user=model)
|
DEV: Update default tagName and connectorTagName for plugin outlets (#13685)
This commit should be a no-op for all existing core outlets. Outlets which are introduced by themes/plugins may see a change in behavior, and should follow the steps below if they want to maintain their previous behavior.
`tagName="" connectorTagName=""` is almost always the correct choice for plugin outlets. 40eba8cd introduced a `noTags=true` shortcut which achieved this, and left a comment saying it should be the future default. This commit does exactly that. To avoid any breaking changes for plugins, all existing plugin outlets have been reviewed and adjusted by following this logic:
1) If `noTags=true`, remove the `noTags` parameter, and do not complete any further steps
2) If `tagName` is not specified, set `tagName="span"` (the previous default)
3) If `connectorTagName` is not specified, set `selectorTagName="div"` (the previous default)
4) If `tagName=""`, remove it
5) If `connectorTagName=""`, remove it
The updates were accomplished with the help of a ruby script:
```ruby
def removeAttr(tag, attribute)
tag = tag.sub /\s#{attribute}="?\w*"? /, " "
tag = tag.sub /\s#{attribute}="?\w*"?}}/, "}}"
tag = tag.sub /^\s*#{attribute}="?\w*"?\n/, ""
tag
end
files = Dir.glob("app/assets/javascripts/**/*.hbs")
puts "Checking #{files.count} files..."
files.each do |f|
content = File.read(f)
count = 0
edits = 0
content.gsub!(/{{\s*plugin-outlet.*?}}/m) do |match|
count += 1
result = match
noTags = result.include?("noTags=true")
tagName = result[/tagName="(\w*)"/, 1]
connectorTagName = result[/connectorTagName="(\w*)"/, 1]
if noTags
result = removeAttr(result, "noTags")
else
if connectorTagName == ""
result = removeAttr(result, "connectorTagName")
elsif connectorTagName.nil?
result = result.sub(/name="[\w-]+"/) { |m| "#{m} connectorTagName=\"div\"" }
end
if tagName == ""
result = removeAttr(result, "tagName")
elsif tagName.nil?
result = result.sub(/name="[\w-]+"/) { |m| "#{m} tagName=\"span\"" }
end
end
edits += 1 if match != result
result
end
puts "#{count} outlets, #{edits} edited -> #{f}"
File.write(f, content)
end
```
2022-01-06 15:38:17 -05:00
|
|
|
}}
|
2018-04-04 15:47:14 -04:00
|
|
|
|
2014-09-29 16:31:05 -04:00
|
|
|
{{#if canCheckEmails}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row email">
|
|
|
|
<div class="field">{{i18n "user.email.primary"}}</div>
|
|
|
|
<div class="value">
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#unless model.active}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">{{i18n "admin.users.not_verified"}}</div>
|
2014-09-29 16:31:05 -04:00
|
|
|
{{/unless}}
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.email}}
|
2020-03-09 10:28:31 -04:00
|
|
|
<a href="mailto:{{model.email}}">{{model.email}}</a>
|
2014-09-29 16:31:05 -04:00
|
|
|
{{else}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(route-action "checkEmail")
|
|
|
|
actionParam=model icon="far-envelope"
|
|
|
|
label="admin.users.check_email.text"
|
|
|
|
title="admin.users.check_email.title"}}
|
2014-09-29 16:31:05 -04:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2020-07-06 20:20:14 -04:00
|
|
|
<div class="controls">
|
2021-02-08 05:04:33 -05:00
|
|
|
{{#if siteSettings.auth_overrides_email}}
|
|
|
|
{{i18n "user.email.auth_override_instructions"}}
|
2020-07-06 20:20:14 -04:00
|
|
|
{{else if model.email}}
|
|
|
|
{{html-safe (i18n "admin.user.visit_profile" url=preferencesPath)}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2014-09-29 16:31:05 -04:00
|
|
|
</div>
|
2013-04-20 01:34:11 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row secondary-emails">
|
|
|
|
<div class="field">{{i18n "user.email.secondary"}}</div>
|
2018-07-03 07:51:22 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="value">
|
2018-07-03 07:51:22 -04:00
|
|
|
{{#if model.email}}
|
|
|
|
{{#if model.secondary_emails}}
|
|
|
|
<ul>
|
|
|
|
{{#each model.secondary_emails as |email| }}
|
2020-03-09 10:28:31 -04:00
|
|
|
<li><a href="mailto:{{email}}">{{email}}</a></li>
|
2018-07-03 07:51:22 -04:00
|
|
|
{{/each}}
|
|
|
|
</ul>
|
|
|
|
{{else}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "user.email.no_secondary"}}
|
2018-07-03 07:51:22 -04:00
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
2019-01-10 05:06:01 -05:00
|
|
|
{{d-button action=(route-action "checkEmail")
|
2018-10-24 16:09:36 -04:00
|
|
|
class="btn-default"
|
2018-07-03 07:51:22 -04:00
|
|
|
actionParam=model
|
2019-01-22 10:44:55 -05:00
|
|
|
icon="far-envelope"
|
2018-07-03 07:51:22 -04:00
|
|
|
label="admin.users.check_email.text"
|
|
|
|
title="admin.users.check_email.title"}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2020-07-06 20:20:14 -04:00
|
|
|
|
|
|
|
<div class="controls">
|
|
|
|
{{#if model.email}}
|
|
|
|
{{#if model.secondary_emails}}
|
2021-02-08 05:04:33 -05:00
|
|
|
{{#if siteSettings.auth_overrides_email}}
|
|
|
|
{{i18n "user.email.auth_override_instructions"}}
|
2020-07-06 20:20:14 -04:00
|
|
|
{{else}}
|
|
|
|
{{html-safe (i18n "admin.user.visit_profile" url=preferencesPath)}}
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2018-07-03 07:51:22 -04:00
|
|
|
</div>
|
|
|
|
|
2016-06-20 06:39:53 -04:00
|
|
|
<div class="display-row bounce-score">
|
2020-03-07 06:58:48 -05:00
|
|
|
<div class="field"><a href={{model.bounceLink}}>{{i18n "admin.user.bounce_score"}}</a></div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="value">{{model.bounceScore}}</div>
|
|
|
|
<div class="controls">
|
2016-06-20 06:39:53 -04:00
|
|
|
{{#if model.canResetBounceScore}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "resetBounceScore")
|
|
|
|
label="admin.user.reset_bounce_score.label"
|
|
|
|
title="admin.user.reset_bounce_score.title"}}
|
2016-06-20 06:39:53 -04:00
|
|
|
{{/if}}
|
|
|
|
{{model.bounceScoreExplanation}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row associations">
|
|
|
|
<div class="field">{{i18n "user.associated_accounts.title"}}</div>
|
|
|
|
<div class="value">
|
2018-07-23 11:51:57 -04:00
|
|
|
{{#if associatedAccountsLoaded}}
|
|
|
|
{{associatedAccounts}}
|
2014-09-29 16:31:05 -04:00
|
|
|
{{else}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(route-action "checkEmail")
|
|
|
|
actionParam=model icon="far-envelope"
|
|
|
|
label="admin.users.check_email.text"
|
|
|
|
title="admin.users.check_email.title"}}
|
2014-09-29 16:31:05 -04:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2014-09-25 01:50:54 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "user.avatar.title"}}</div>
|
|
|
|
<div class="value">{{avatar model imageSize="large"}}</div>
|
2017-05-26 15:00:31 -04:00
|
|
|
<div class="controls">
|
2020-03-12 11:50:20 -04:00
|
|
|
{{html-safe (i18n "admin.user.visit_profile" url=preferencesPath)}}
|
2017-05-26 15:00:31 -04:00
|
|
|
</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2013-04-20 01:34:11 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
{{admin-editable-field name="user.title.title"
|
2018-12-17 09:28:29 -05:00
|
|
|
value=model.title
|
2019-01-22 10:44:55 -05:00
|
|
|
action=(action "saveTitle")
|
2018-12-17 09:28:29 -05:00
|
|
|
editing=editingTitle}}
|
2013-06-25 18:39:20 -04:00
|
|
|
</div>
|
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row last-ip">
|
|
|
|
<div class="field">{{i18n "user.ip_address.title"}}</div>
|
|
|
|
<div class="value">{{model.ip_address}}</div>
|
|
|
|
<div class="controls">
|
2014-11-24 05:08:13 -05:00
|
|
|
{{#if currentUser.staff}}
|
2015-05-19 10:56:32 -04:00
|
|
|
{{ip-lookup ip=model.ip_address userId=model.id}}
|
2013-05-02 01:15:17 -04:00
|
|
|
{{/if}}
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2013-04-20 01:34:11 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row registration-ip">
|
|
|
|
<div class="field">{{i18n "user.registration_ip_address.title"}}</div>
|
|
|
|
<div class="value">{{model.registration_ip_address}}</div>
|
|
|
|
<div class="controls">
|
2014-11-24 05:08:13 -05:00
|
|
|
{{#if currentUser.staff}}
|
2015-05-19 10:56:32 -04:00
|
|
|
{{ip-lookup ip=model.registration_ip_address userId=model.id}}
|
2014-06-15 12:14:19 -04:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2014-04-29 14:37:56 -04:00
|
|
|
</div>
|
|
|
|
|
2014-03-19 10:27:21 -04:00
|
|
|
{{#if showBadges}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.badges.title"}}</div>
|
|
|
|
<div class="value">
|
|
|
|
{{i18n "badges.badge_count" count=model.badge_count}}
|
2014-03-19 10:27:21 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2021-05-08 11:45:18 -04:00
|
|
|
{{#link-to "adminUser.badges" model class="btn btn-default"}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-icon "certificate"}}
|
|
|
|
{{i18n "admin.badges.edit_badges"}}
|
|
|
|
{{/link-to}}
|
2014-03-19 10:27:21 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2017-12-21 20:18:12 -05:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "user.second_factor.title"}}</div>
|
|
|
|
<div class="value">
|
2017-12-21 20:18:12 -05:00
|
|
|
{{#if model.second_factor_enabled}}
|
|
|
|
{{i18n "yes_value"}}
|
|
|
|
{{else}}
|
|
|
|
{{i18n "no_value"}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2017-12-21 20:18:12 -05:00
|
|
|
{{#if canDisableSecondFactor}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "disableSecondFactor")
|
|
|
|
icon="unlock-alt"
|
|
|
|
label="user.second_factor.disable"}}
|
2017-12-21 20:18:12 -05:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</section>
|
|
|
|
|
2014-09-26 14:48:34 -04:00
|
|
|
{{#if userFields}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<section class="details">
|
2016-04-29 17:29:41 -04:00
|
|
|
{{#each userFields as |uf|}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{uf.name}}</div>
|
|
|
|
<div class="value">
|
2014-12-12 13:28:20 -05:00
|
|
|
{{#if uf.value}}
|
|
|
|
{{uf.value}}
|
2014-09-26 14:48:34 -04:00
|
|
|
{{else}}
|
|
|
|
—
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/each}}
|
|
|
|
</section>
|
|
|
|
{{/if}}
|
|
|
|
|
DEV: Update default tagName and connectorTagName for plugin outlets (#13685)
This commit should be a no-op for all existing core outlets. Outlets which are introduced by themes/plugins may see a change in behavior, and should follow the steps below if they want to maintain their previous behavior.
`tagName="" connectorTagName=""` is almost always the correct choice for plugin outlets. 40eba8cd introduced a `noTags=true` shortcut which achieved this, and left a comment saying it should be the future default. This commit does exactly that. To avoid any breaking changes for plugins, all existing plugin outlets have been reviewed and adjusted by following this logic:
1) If `noTags=true`, remove the `noTags` parameter, and do not complete any further steps
2) If `tagName` is not specified, set `tagName="span"` (the previous default)
3) If `connectorTagName` is not specified, set `selectorTagName="div"` (the previous default)
4) If `tagName=""`, remove it
5) If `connectorTagName=""`, remove it
The updates were accomplished with the help of a ruby script:
```ruby
def removeAttr(tag, attribute)
tag = tag.sub /\s#{attribute}="?\w*"? /, " "
tag = tag.sub /\s#{attribute}="?\w*"?}}/, "}}"
tag = tag.sub /^\s*#{attribute}="?\w*"?\n/, ""
tag
end
files = Dir.glob("app/assets/javascripts/**/*.hbs")
puts "Checking #{files.count} files..."
files.each do |f|
content = File.read(f)
count = 0
edits = 0
content.gsub!(/{{\s*plugin-outlet.*?}}/m) do |match|
count += 1
result = match
noTags = result.include?("noTags=true")
tagName = result[/tagName="(\w*)"/, 1]
connectorTagName = result[/connectorTagName="(\w*)"/, 1]
if noTags
result = removeAttr(result, "noTags")
else
if connectorTagName == ""
result = removeAttr(result, "connectorTagName")
elsif connectorTagName.nil?
result = result.sub(/name="[\w-]+"/) { |m| "#{m} connectorTagName=\"div\"" }
end
if tagName == ""
result = removeAttr(result, "tagName")
elsif tagName.nil?
result = result.sub(/name="[\w-]+"/) { |m| "#{m} tagName=\"span\"" }
end
end
edits += 1 if match != result
result
end
puts "#{count} outlets, #{edits} edited -> #{f}"
File.write(f, content)
end
```
2022-01-06 15:38:17 -05:00
|
|
|
{{plugin-outlet name="admin-user-details" tagName="span" connectorTagName="div" args=(hash model=model)}}
|
2017-09-07 10:17:27 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<section class="details">
|
|
|
|
<h1>{{i18n "admin.user.permissions"}}</h1>
|
2013-02-05 14:16:51 -05:00
|
|
|
|
2019-01-03 12:03:01 -05:00
|
|
|
{{#if siteSettings.must_approve_users}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.users.approved"}}</div>
|
|
|
|
<div class="value">
|
2015-08-16 00:02:22 -04:00
|
|
|
{{#if model.approved}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "admin.user.approved_by"}}
|
|
|
|
{{#link-to "adminUser" model.approvedBy}}
|
|
|
|
{{avatar model.approvedBy imageSize="small"}}
|
|
|
|
{{/link-to}}
|
|
|
|
{{#link-to "adminUser" model.approvedBy}}
|
|
|
|
{{model.approvedBy.username}}
|
|
|
|
{{/link-to}}
|
2013-09-09 12:21:47 -04:00
|
|
|
{{else}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "no_value"}}
|
2013-09-09 12:21:47 -04:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2015-08-16 00:02:22 -04:00
|
|
|
{{#if model.approved}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "admin.user.approve_success"}}
|
2013-09-09 12:21:47 -04:00
|
|
|
{{else}}
|
2015-08-16 00:02:22 -04:00
|
|
|
{{#if model.can_approve}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "approve")
|
|
|
|
icon="check"
|
|
|
|
label="admin.user.approve"}}
|
2013-09-09 12:21:47 -04:00
|
|
|
{{/if}}
|
2013-06-06 00:18:22 -04:00
|
|
|
{{/if}}
|
2013-09-09 12:21:47 -04:00
|
|
|
</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2013-09-09 12:21:47 -04:00
|
|
|
{{/if}}
|
2013-02-05 14:16:51 -05:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.users.active"}}</div>
|
|
|
|
<div class="value">{{i18n-yes-no model.active}}</div>
|
|
|
|
<div class="controls">
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.active}}
|
|
|
|
{{#if model.can_deactivate}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "deactivate")
|
|
|
|
label="admin.user.deactivate_account"}}
|
|
|
|
{{i18n "admin.user.deactivate_explanation"}}
|
2013-05-07 21:58:34 -04:00
|
|
|
{{/if}}
|
|
|
|
{{else}}
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.can_send_activation_email}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "sendActivationEmail")
|
|
|
|
icon="envelope"
|
|
|
|
label="admin.user.send_activation_email"}}
|
2013-05-07 21:58:34 -04:00
|
|
|
{{/if}}
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.can_activate}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "activate")
|
|
|
|
icon="check"
|
|
|
|
label="admin.user.activate"}}
|
2013-05-07 21:58:34 -04:00
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-09-26 16:46:37 -04:00
|
|
|
<div class="display-row">
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="field">{{i18n "admin.user.staged"}}</div>
|
|
|
|
<div class="value">{{i18n-yes-no model.staged}}</div>
|
|
|
|
<div class="controls">{{i18n "admin.user.staged_explanation"}}</div>
|
2017-09-26 16:46:37 -04:00
|
|
|
</div>
|
|
|
|
|
2015-10-14 15:40:23 -04:00
|
|
|
{{#if currentUser.admin}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
2019-11-05 09:10:23 -05:00
|
|
|
<div class="field">{{i18n "admin.api.active_keys"}}</div>
|
|
|
|
<div class="value">
|
|
|
|
{{model.api_key_count}}
|
|
|
|
</div>
|
|
|
|
<div class="controls">
|
2021-05-08 11:45:18 -04:00
|
|
|
{{d-button class="btn-default" href="/admin/api/keys" label="admin.api.manage_keys"}}
|
2019-11-05 09:10:23 -05:00
|
|
|
</div>
|
2015-10-14 15:40:23 -04:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2013-10-22 15:53:08 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.admin"}}</div>
|
|
|
|
<div class="value">{{i18n-yes-no model.admin}}</div>
|
|
|
|
<div class="controls">
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.can_revoke_admin}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "revokeAdmin")
|
|
|
|
icon="shield-alt"
|
|
|
|
label="admin.user.revoke_admin"}}
|
2013-02-05 14:16:51 -05:00
|
|
|
{{/if}}
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.can_grant_admin}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
2021-09-14 08:19:28 -04:00
|
|
|
class="btn-default grant-admin"
|
2019-01-22 10:44:55 -05:00
|
|
|
action=(action "grantAdmin")
|
|
|
|
icon="shield-alt"
|
|
|
|
label="admin.user.grant_admin"}}
|
2013-03-20 20:25:41 -04:00
|
|
|
{{/if}}
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2015-03-17 17:59:05 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.moderator"}}</div>
|
|
|
|
<div class="value">{{i18n-yes-no model.moderator}}</div>
|
|
|
|
<div class="controls">
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.can_revoke_moderation}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "revokeModeration")
|
|
|
|
icon="shield-alt"
|
|
|
|
label="admin.user.revoke_moderation"}}
|
2013-02-12 17:58:08 -05:00
|
|
|
{{/if}}
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.can_grant_moderation}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "grantModeration")
|
|
|
|
icon="shield-alt"
|
|
|
|
label="admin.user.grant_moderation"}}
|
2013-03-20 20:25:41 -04:00
|
|
|
{{/if}}
|
2013-02-12 17:58:08 -05:00
|
|
|
</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2013-07-01 10:22:21 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "trust_level"}}</div>
|
2013-07-01 10:22:21 -04:00
|
|
|
<div class="value">
|
2019-06-26 08:51:45 -04:00
|
|
|
{{combo-box
|
|
|
|
content=site.trustLevels
|
2019-10-03 08:52:07 -04:00
|
|
|
nameProperty="detailedName"
|
2020-02-03 08:22:14 -05:00
|
|
|
value=model.trustLevel.id
|
2020-10-06 17:50:05 -04:00
|
|
|
onChange=(action (mut model.trust_level))
|
2019-10-03 08:52:07 -04:00
|
|
|
}}
|
2019-06-26 08:51:45 -04:00
|
|
|
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.dirty}}
|
2014-01-22 17:09:56 -05:00
|
|
|
<div>
|
2019-01-10 05:06:01 -05:00
|
|
|
{{d-button class="ok no-text" action=(action "saveTrustLevel") icon="check"}}
|
|
|
|
{{d-button class="cancel no-text" action=(action "restoreTrustLevel") icon="times"}}
|
2014-01-22 17:09:56 -05:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2013-07-01 10:22:21 -04:00
|
|
|
</div>
|
2014-09-29 23:12:33 -04:00
|
|
|
<div class="controls">
|
|
|
|
{{#if model.canLockTrustLevel}}
|
2018-06-19 20:40:24 -04:00
|
|
|
{{#if hasLockedTrustLevel}}
|
2017-07-26 16:33:17 -04:00
|
|
|
{{d-icon "lock" title="admin.user.trust_level_locked_tip"}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "lockTrustLevel")
|
|
|
|
actionParam=false
|
|
|
|
label="admin.user.unlock_trust_level"}}
|
2014-09-29 23:12:33 -04:00
|
|
|
{{else}}
|
2017-07-26 16:33:17 -04:00
|
|
|
{{d-icon "unlock" title="admin.user.trust_level_unlocked_tip"}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "lockTrustLevel")
|
|
|
|
actionParam=true
|
|
|
|
label="admin.user.lock_trust_level"}}
|
2014-09-29 23:12:33 -04:00
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.tl3Requirements}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{#link-to "adminUser.tl3Requirements" model class="btn btn-default"}}
|
|
|
|
{{i18n "admin.user.trust_level_3_requirements"}}
|
|
|
|
{{/link-to}}
|
2014-09-29 23:12:33 -04:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2013-03-20 20:25:41 -04:00
|
|
|
</div>
|
2013-07-01 10:22:21 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="user-suspended display-row {{if model.suspended "highlight-danger"}}">
|
|
|
|
<div class="field">{{i18n "admin.user.suspended"}}</div>
|
|
|
|
<div class="value">
|
2018-05-25 10:29:26 -04:00
|
|
|
{{i18n-yes-no model.suspended}}
|
|
|
|
{{#if model.suspended}}
|
|
|
|
{{#unless model.suspendedForever}}
|
|
|
|
{{i18n "admin.user.suspended_until" until=model.suspendedTillDate}}
|
|
|
|
{{/unless}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2018-05-25 10:29:26 -04:00
|
|
|
{{#if model.suspended}}
|
2017-09-12 17:07:42 -04:00
|
|
|
{{d-button
|
2017-09-13 14:11:33 -04:00
|
|
|
class="btn-danger unsuspend-user"
|
|
|
|
action=(action "unsuspend")
|
2017-09-12 17:07:42 -04:00
|
|
|
icon="ban"
|
2017-09-13 14:11:33 -04:00
|
|
|
label="admin.user.unsuspend"}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "admin.user.suspended_explanation"}}
|
2017-09-13 14:11:33 -04:00
|
|
|
{{else}}
|
|
|
|
{{#if model.canSuspend}}
|
|
|
|
{{d-button
|
|
|
|
class="btn-danger suspend-user"
|
|
|
|
action=(action "showSuspendModal")
|
|
|
|
icon="ban"
|
|
|
|
label="admin.user.suspend"}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "admin.user.suspended_explanation"}}
|
2017-09-13 14:11:33 -04:00
|
|
|
{{/if}}
|
2013-02-05 14:16:51 -05:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2013-03-20 20:25:41 -04:00
|
|
|
</div>
|
2013-11-01 10:47:03 -04:00
|
|
|
|
2018-05-25 10:29:26 -04:00
|
|
|
{{#if model.suspended}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row highlight-danger suspension-info">
|
|
|
|
<div class="field">{{i18n "admin.user.suspended_by"}}</div>
|
|
|
|
<div class="value">
|
|
|
|
{{#link-to "adminUser" model.suspendedBy}}
|
|
|
|
{{avatar model.suspendedBy imageSize="tiny"}}
|
|
|
|
{{/link-to}}
|
|
|
|
{{#link-to "adminUser" model.suspendedBy}}
|
|
|
|
{{model.suspendedBy.username}}
|
|
|
|
{{/link-to}}
|
2015-03-17 17:59:05 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
|
|
|
<b>{{i18n "admin.user.suspend_reason"}}</b>:
|
|
|
|
<div class="full-reason">{{model.full_suspend_reason}}</div>
|
2015-03-17 17:59:05 -04:00
|
|
|
</div>
|
2013-11-05 14:41:04 -05:00
|
|
|
</div>
|
2013-11-01 10:47:03 -04:00
|
|
|
{{/if}}
|
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row {{if model.silenced "highlight-danger"}}">
|
|
|
|
<div class="field">{{i18n "admin.user.silenced"}}</div>
|
|
|
|
<div class="value">
|
2017-11-13 13:41:36 -05:00
|
|
|
{{i18n-yes-no model.silenced}}
|
2018-05-25 10:29:26 -04:00
|
|
|
{{#if model.silenced}}
|
2017-11-13 13:41:36 -05:00
|
|
|
{{#unless model.silencedForever}}
|
|
|
|
{{i18n "admin.user.suspended_until" until=model.silencedTillDate}}
|
|
|
|
{{/unless}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2017-11-10 12:18:08 -05:00
|
|
|
{{#conditional-loading-spinner size="small" condition=model.silencingUser}}
|
|
|
|
{{#if model.silenced}}
|
2017-11-13 13:41:36 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-danger unsilence-user"
|
2019-01-10 05:06:01 -05:00
|
|
|
action=(action "unsilence")
|
2017-11-13 13:41:36 -05:00
|
|
|
icon="microphone-slash"
|
|
|
|
label="admin.user.unsilence"}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "admin.user.silence_explanation"}}
|
2016-01-14 14:42:06 -05:00
|
|
|
{{else}}
|
2017-11-13 13:41:36 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-danger silence-user"
|
|
|
|
action=(action "showSilenceModal")
|
|
|
|
icon="microphone-slash"
|
|
|
|
label="admin.user.silence"}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{i18n "admin.user.silence_explanation"}}
|
2016-01-14 14:42:06 -05:00
|
|
|
{{/if}}
|
|
|
|
{{/conditional-loading-spinner}}
|
2013-05-31 11:41:40 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
2017-11-13 13:41:36 -05:00
|
|
|
|
2018-05-25 10:29:26 -04:00
|
|
|
{{#if model.silenced}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row highlight-danger silence-info">
|
|
|
|
<div class="field">{{i18n "admin.user.silenced_by"}}</div>
|
|
|
|
<div class="value">
|
|
|
|
{{#link-to "adminUser" model.silencedBy}}
|
|
|
|
{{avatar model.silencedBy imageSize="tiny"}}
|
|
|
|
{{/link-to}}
|
|
|
|
{{#link-to "adminUser" model.silencedBy}}
|
|
|
|
{{model.silencedBy.username}}
|
|
|
|
{{/link-to}}
|
2017-11-13 13:41:36 -05:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
|
|
|
<b>{{i18n "admin.user.silence_reason"}}</b>:
|
|
|
|
<div class="full-reason">{{model.silence_reason}}</div>
|
2017-11-13 13:41:36 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2018-05-25 11:45:42 -04:00
|
|
|
{{#if model.tl3_requirements.penalty_counts.total}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row clear-penalty-history">
|
|
|
|
<div class="field">{{i18n "admin.user.penalty_count"}}</div>
|
|
|
|
<div class="value">{{model.tl3_requirements.penalty_counts.total}}</div>
|
2018-05-25 11:45:42 -04:00
|
|
|
{{#if currentUser.admin}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2018-05-25 11:45:42 -04:00
|
|
|
{{d-button label="admin.user.clear_penalty_history.title"
|
2018-10-24 16:09:36 -04:00
|
|
|
class="btn-default"
|
2018-05-25 11:45:42 -04:00
|
|
|
icon="times"
|
|
|
|
action=(action "clearPenaltyHistory")}}
|
|
|
|
{{i18n "admin.user.clear_penalty_history.description"}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2013-02-05 14:16:51 -05:00
|
|
|
</section>
|
|
|
|
|
2017-04-17 14:53:30 -04:00
|
|
|
{{#if currentUser.admin}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<section class="details">
|
|
|
|
<h1>{{i18n "admin.groups.title"}}</h1>
|
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.groups.automatic"}}</div>
|
2020-03-11 04:23:10 -04:00
|
|
|
<div class="value">{{html-safe automaticGroups}}</div>
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.groups.custom"}}</div>
|
|
|
|
<div class="value">
|
2020-06-12 07:52:32 -04:00
|
|
|
{{group-chooser
|
2020-02-03 08:22:14 -05:00
|
|
|
content=availableGroups
|
|
|
|
value=customGroupIdsBuffer
|
2020-05-28 02:30:31 -04:00
|
|
|
labelProperty="name"
|
2020-10-06 17:50:05 -04:00
|
|
|
onChange=(action (mut customGroupIdsBuffer))
|
2020-04-13 11:17:20 -04:00
|
|
|
}}
|
2015-03-25 15:16:47 -04:00
|
|
|
</div>
|
2018-10-02 00:34:08 -04:00
|
|
|
{{#if customGroupsDirty}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2019-01-10 05:06:01 -05:00
|
|
|
{{d-button icon="check" class="ok" action=(action "saveCustomGroups")}}
|
|
|
|
{{d-button icon="times" class="cancel" action=(action "resetCustomGroups")}}
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2018-10-02 00:34:08 -04:00
|
|
|
{{#if model.customGroups}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.groups.primary"}}</div>
|
|
|
|
<div class="value">
|
|
|
|
{{combo-box
|
2020-02-03 08:22:14 -05:00
|
|
|
content=model.customGroups
|
|
|
|
value=model.primary_group_id
|
2020-10-06 17:50:05 -04:00
|
|
|
onChange=(action (mut model.primary_group_id))
|
2022-04-05 13:01:09 -04:00
|
|
|
options=(hash
|
|
|
|
none="admin.groups.no_primary"
|
|
|
|
)
|
2020-02-03 08:22:14 -05:00
|
|
|
}}
|
2017-04-17 14:53:30 -04:00
|
|
|
</div>
|
2018-10-02 00:34:08 -04:00
|
|
|
{{#if primaryGroupDirty}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2019-01-10 05:06:01 -05:00
|
|
|
{{d-button icon="check" class="ok" action=(action "savePrimaryGroup")}}
|
|
|
|
{{d-button icon="times" class="cancel" action=(action "resetPrimaryGroup")}}
|
2018-10-02 00:34:08 -04:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2017-04-17 14:53:30 -04:00
|
|
|
{{/if}}
|
|
|
|
</section>
|
|
|
|
{{/if}}
|
2015-03-25 15:16:47 -04:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<section class="details">
|
|
|
|
<h1>{{i18n "admin.user.activity"}}</h1>
|
2013-02-05 14:16:51 -05:00
|
|
|
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "created"}}</div>
|
|
|
|
<div class="value">{{format-date model.created_at leaveAgo="true"}}</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.users.last_emailed"}}</div>
|
|
|
|
<div class="value">{{format-date model.last_emailed_at}}</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "last_seen"}}</div>
|
|
|
|
<div class="value">{{format-date model.last_seen_at leaveAgo="true"}}</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.like_count"}}</div>
|
|
|
|
<div class="value">{{model.like_given_count}} / {{model.like_count}}</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.topics_entered"}}</div>
|
|
|
|
<div class="value">{{model.topics_entered}}</div>
|
2013-03-20 20:25:41 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.post_count"}}</div>
|
|
|
|
<div class="value">{{model.post_count}}</div>
|
|
|
|
<div class="controls">
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.can_delete_all_posts}}
|
|
|
|
{{#if model.post_count}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
|
|
|
class="btn-danger"
|
2021-08-25 00:44:22 -04:00
|
|
|
action=(action "showDeletePostsConfirmation")
|
2019-01-22 10:44:55 -05:00
|
|
|
icon="far-trash-alt"
|
2021-08-25 00:44:22 -04:00
|
|
|
label="admin.user.delete_posts.button"}}
|
2015-03-17 11:18:39 -04:00
|
|
|
{{/if}}
|
2014-02-20 12:29:40 -05:00
|
|
|
{{else}}
|
2018-05-25 11:33:01 -04:00
|
|
|
{{deleteAllPostsExplanation}}
|
2013-02-07 02:11:56 -05:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.posts_read_count"}}</div>
|
|
|
|
<div class="value">{{model.posts_read_count}}</div>
|
2013-03-20 20:25:41 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.warnings_received_count"}}</div>
|
|
|
|
<div class="value">{{model.warnings_received_count}}</div>
|
2014-09-08 11:11:56 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.flags_given_received_count"}}</div>
|
|
|
|
<div class="value">
|
2018-01-17 13:03:14 -05:00
|
|
|
{{model.flags_given_count}} / {{model.flags_received_count}}
|
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="controls">
|
2018-01-17 13:03:14 -05:00
|
|
|
{{#if model.flags_received_count}}
|
2019-01-03 12:03:01 -05:00
|
|
|
{{#link-to "review" (query-params username=model.username type="ReviewableFlaggedPost" status="all") class="btn"}}
|
|
|
|
{{i18n "admin.user.show_flags_received"}}
|
|
|
|
{{/link-to}}
|
2018-01-17 13:03:14 -05:00
|
|
|
{{/if}}
|
|
|
|
</div>
|
2013-03-20 20:25:41 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.private_topics_count"}}</div>
|
|
|
|
<div class="value">{{model.private_topics_count}}</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "admin.user.time_read"}}</div>
|
2020-03-11 04:23:10 -04:00
|
|
|
<div class="value">{{format-duration model.time_read}}</div>
|
2013-03-20 20:25:41 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
|
|
|
<div class="field">{{i18n "user.invited.days_visited"}}</div>
|
2020-03-11 04:23:10 -04:00
|
|
|
<div class="value">{{html-safe model.days_visited}}</div>
|
2013-03-20 20:25:41 -04:00
|
|
|
</div>
|
2021-08-02 10:15:53 -04:00
|
|
|
<div class="display-row post-edits-count">
|
|
|
|
<div class="field">{{i18n "admin.user.post_edits_count" }}</div>
|
|
|
|
<div class="value">
|
|
|
|
{{if (gt model.post_edits_count 0) model.post_edits_count "0"}}
|
|
|
|
</div>
|
|
|
|
<div class="controls">
|
|
|
|
{{#if (gt model.post_edits_count 0) }}
|
|
|
|
{{#link-to "adminReports.show" "post_edits" (query-params filters=postEditsByEditorFilter) class="btn btn-icon"}}
|
|
|
|
{{d-icon "far-eye"}}
|
|
|
|
{{i18n "admin.user.view_edits"}}
|
|
|
|
{{/link-to}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-02-05 14:16:51 -05:00
|
|
|
</section>
|
|
|
|
|
2015-05-19 10:56:32 -04:00
|
|
|
{{#if model.single_sign_on_record}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<section class="details">
|
2021-02-08 05:04:33 -05:00
|
|
|
<h1>{{i18n "admin.user.discourse_connect.title"}}</h1>
|
2014-08-22 20:34:48 -04:00
|
|
|
|
2015-11-27 12:58:40 -05:00
|
|
|
{{#with model.single_sign_on_record as |sso|}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
2021-02-08 05:04:33 -05:00
|
|
|
<div class="field">{{i18n "admin.user.discourse_connect.external_id"}}</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="value">{{sso.external_id}}</div>
|
2020-09-15 10:00:10 -04:00
|
|
|
{{#if model.can_delete_sso_record}}
|
|
|
|
<div class="controls">
|
|
|
|
{{d-button
|
|
|
|
class="btn-danger"
|
|
|
|
action=(action "deleteSSORecord")
|
|
|
|
icon="far-trash-alt"
|
2021-02-08 05:04:33 -05:00
|
|
|
label="admin.user.discourse_connect.delete_sso_record"
|
2020-09-15 10:00:10 -04:00
|
|
|
}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2018-06-12 04:07:10 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
2021-02-08 05:04:33 -05:00
|
|
|
<div class="field">{{i18n "admin.user.discourse_connect.external_username"}}</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="value">{{sso.external_username}}</div>
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
2021-02-08 05:04:33 -05:00
|
|
|
<div class="field">{{i18n "admin.user.discourse_connect.external_name"}}</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="value">{{sso.external_name}}</div>
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
2020-11-10 14:12:44 -05:00
|
|
|
{{#if canAdminCheckEmails}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
2021-02-08 05:04:33 -05:00
|
|
|
<div class="field">{{i18n "admin.user.discourse_connect.external_email"}}</div>
|
2020-11-10 14:12:44 -05:00
|
|
|
{{#if ssoExternalEmail}}
|
|
|
|
<div class="value">{{ssoExternalEmail}}</div>
|
|
|
|
{{else}}
|
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "checkSsoEmail")
|
|
|
|
actionParam=model icon="far-envelope"
|
|
|
|
label="admin.users.check_email.text"
|
|
|
|
title="admin.users.check_email.title"}}
|
|
|
|
{{/if}}
|
2020-04-13 11:17:20 -04:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="display-row">
|
2021-02-08 05:04:33 -05:00
|
|
|
<div class="field">{{i18n "admin.user.discourse_connect.external_avatar_url"}}</div>
|
2019-01-22 10:44:55 -05:00
|
|
|
<div class="value">{{sso.external_avatar_url}}</div>
|
2014-08-22 20:34:48 -04:00
|
|
|
</div>
|
2021-02-17 10:57:51 -05:00
|
|
|
{{#if canAdminCheckEmails}}
|
2020-09-15 10:00:10 -04:00
|
|
|
<div class="display-row">
|
2021-02-08 05:04:33 -05:00
|
|
|
<div class="field">{{i18n "admin.user.discourse_connect.last_payload"}}</div>
|
2021-02-17 10:57:51 -05:00
|
|
|
{{#if ssoLastPayload}}
|
|
|
|
<div class="value">
|
|
|
|
{{#each ssoPayload as |line|}}
|
|
|
|
{{line}}<br>
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
{{d-button
|
|
|
|
class="btn-default"
|
|
|
|
action=(action "checkSsoPayload")
|
|
|
|
actionParam=model icon="far-list-alt"
|
|
|
|
label="admin.users.check_sso.text"
|
|
|
|
title="admin.users.check_sso.title"}}
|
|
|
|
{{/if}}
|
2020-09-15 10:00:10 -04:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2014-08-22 20:34:48 -04:00
|
|
|
{{/with}}
|
|
|
|
</section>
|
|
|
|
{{/if}}
|
|
|
|
|
DEV: Update default tagName and connectorTagName for plugin outlets (#13685)
This commit should be a no-op for all existing core outlets. Outlets which are introduced by themes/plugins may see a change in behavior, and should follow the steps below if they want to maintain their previous behavior.
`tagName="" connectorTagName=""` is almost always the correct choice for plugin outlets. 40eba8cd introduced a `noTags=true` shortcut which achieved this, and left a comment saying it should be the future default. This commit does exactly that. To avoid any breaking changes for plugins, all existing plugin outlets have been reviewed and adjusted by following this logic:
1) If `noTags=true`, remove the `noTags` parameter, and do not complete any further steps
2) If `tagName` is not specified, set `tagName="span"` (the previous default)
3) If `connectorTagName` is not specified, set `selectorTagName="div"` (the previous default)
4) If `tagName=""`, remove it
5) If `connectorTagName=""`, remove it
The updates were accomplished with the help of a ruby script:
```ruby
def removeAttr(tag, attribute)
tag = tag.sub /\s#{attribute}="?\w*"? /, " "
tag = tag.sub /\s#{attribute}="?\w*"?}}/, "}}"
tag = tag.sub /^\s*#{attribute}="?\w*"?\n/, ""
tag
end
files = Dir.glob("app/assets/javascripts/**/*.hbs")
puts "Checking #{files.count} files..."
files.each do |f|
content = File.read(f)
count = 0
edits = 0
content.gsub!(/{{\s*plugin-outlet.*?}}/m) do |match|
count += 1
result = match
noTags = result.include?("noTags=true")
tagName = result[/tagName="(\w*)"/, 1]
connectorTagName = result[/connectorTagName="(\w*)"/, 1]
if noTags
result = removeAttr(result, "noTags")
else
if connectorTagName == ""
result = removeAttr(result, "connectorTagName")
elsif connectorTagName.nil?
result = result.sub(/name="[\w-]+"/) { |m| "#{m} connectorTagName=\"div\"" }
end
if tagName == ""
result = removeAttr(result, "tagName")
elsif tagName.nil?
result = result.sub(/name="[\w-]+"/) { |m| "#{m} tagName=\"span\"" }
end
end
edits += 1 if match != result
result
end
puts "#{count} outlets, #{edits} edited -> #{f}"
File.write(f, content)
end
```
2022-01-06 15:38:17 -05:00
|
|
|
{{plugin-outlet name="after-user-details" tagName="span" connectorTagName="div" args=(hash model=model)}}
|
2018-04-16 14:41:03 -04:00
|
|
|
|
2013-04-11 16:04:20 -04:00
|
|
|
<section>
|
2017-09-04 12:55:23 -04:00
|
|
|
<hr>
|
2015-03-10 13:06:08 -04:00
|
|
|
<div class="pull-right">
|
2018-03-13 14:35:50 -04:00
|
|
|
{{#if model.active}}
|
|
|
|
{{#if model.can_impersonate}}
|
2019-01-22 10:44:55 -05:00
|
|
|
{{d-button
|
2022-04-11 20:18:43 -04:00
|
|
|
class="btn-danger btn-impersonate"
|
2019-01-22 10:44:55 -05:00
|
|
|
action=(action "impersonate")
|
|
|
|
icon="crosshairs"
|
|
|
|
label="admin.impersonate.title"
|
|
|
|
title="admin.impersonate.help"}}
|
2018-03-13 14:35:50 -04:00
|
|
|
{{/if}}
|
|
|
|
{{/if}}
|
|
|
|
|
2018-05-25 11:33:01 -04:00
|
|
|
{{#if model.can_be_anonymized}}
|
2015-03-10 13:06:08 -04:00
|
|
|
{{d-button label="admin.user.anonymize"
|
|
|
|
icon="exclamation-triangle"
|
2022-04-11 20:18:43 -04:00
|
|
|
class="btn-danger btn-anonymize"
|
2019-01-10 05:06:01 -05:00
|
|
|
action=(action "anonymize")}}
|
2018-05-25 11:33:01 -04:00
|
|
|
{{/if}}
|
2015-03-10 13:06:08 -04:00
|
|
|
|
2018-05-25 11:33:01 -04:00
|
|
|
{{#if model.canBeDeleted}}
|
2015-03-10 13:06:08 -04:00
|
|
|
{{d-button label="admin.user.delete"
|
2020-04-22 04:37:51 -04:00
|
|
|
icon="trash-alt"
|
2022-04-11 20:18:43 -04:00
|
|
|
class="btn-danger btn-user-delete"
|
2019-01-10 05:06:01 -05:00
|
|
|
action=(action "destroy")}}
|
2020-04-22 08:12:09 -04:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{#if model.can_be_merged}}
|
2020-05-04 09:14:30 -04:00
|
|
|
{{d-button label="admin.user.merge.button"
|
|
|
|
icon="arrows-alt-h"
|
2022-04-11 20:18:43 -04:00
|
|
|
class="btn-danger btn-user-merge"
|
2020-04-22 04:37:51 -04:00
|
|
|
action=(action "promptTargetUser")}}
|
2018-05-25 11:33:01 -04:00
|
|
|
{{/if}}
|
2015-03-10 13:06:08 -04:00
|
|
|
</div>
|
|
|
|
|
2018-05-25 11:33:01 -04:00
|
|
|
{{#if deleteExplanation}}
|
2013-12-20 11:36:43 -05:00
|
|
|
<div class="clearfix"></div>
|
2017-09-04 12:55:23 -04:00
|
|
|
<br>
|
2015-03-17 17:59:05 -04:00
|
|
|
<div class="pull-right">
|
2018-05-25 11:33:01 -04:00
|
|
|
{{d-icon "exclamation-triangle"}} {{deleteExplanation}}
|
2015-03-17 17:59:05 -04:00
|
|
|
</div>
|
2013-12-20 11:36:43 -05:00
|
|
|
{{/if}}
|
2013-04-11 16:04:20 -04:00
|
|
|
</section>
|
2019-01-22 10:44:55 -05:00
|
|
|
|
2013-04-11 16:04:20 -04:00
|
|
|
<div class="clearfix"></div>
|