Merge branch 'master' into search_posts_with_images
This commit is contained in:
commit
4a5907b116
110
.rubocop.yml
110
.rubocop.yml
|
@ -1,14 +1,104 @@
|
|||
AllCops:
|
||||
TargetRubyVersion: 2.3
|
||||
TargetRubyVersion: 2.4
|
||||
DisabledByDefault: true
|
||||
|
||||
Metrics/LineLength:
|
||||
Max: 120
|
||||
# Prefer &&/|| over and/or.
|
||||
Style/AndOr:
|
||||
Enabled: true
|
||||
|
||||
Metrics/MethodLength:
|
||||
# Do not use braces for hash literals when they are the last argument of a
|
||||
# method call.
|
||||
Style/BracesAroundHashParameters:
|
||||
Enabled: true
|
||||
|
||||
# Align `when` with `case`.
|
||||
Layout/CaseIndentation:
|
||||
Enabled: true
|
||||
|
||||
# Align comments with method definitions.
|
||||
Layout/CommentIndentation:
|
||||
Enabled: true
|
||||
|
||||
# No extra empty lines.
|
||||
Layout/EmptyLines:
|
||||
Enabled: true
|
||||
|
||||
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
||||
Style/HashSyntax:
|
||||
Enabled: true
|
||||
|
||||
# Two spaces, no tabs (for indentation).
|
||||
Layout/IndentationWidth:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterColon:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAfterComma:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundEqualsInParameterDefault:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundKeyword:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceAroundOperators:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceBeforeFirstArg:
|
||||
Enabled: true
|
||||
|
||||
# Defining a method with parameters needs parentheses.
|
||||
Style/MethodDefParentheses:
|
||||
Enabled: true
|
||||
|
||||
# Use `foo {}` not `foo{}`.
|
||||
Layout/SpaceBeforeBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `foo { bar }` not `foo {bar}`.
|
||||
Layout/SpaceInsideBlockBraces:
|
||||
Enabled: true
|
||||
|
||||
# Use `{ a: 1 }` not `{a:1}`.
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Enabled: true
|
||||
|
||||
Layout/SpaceInsideParens:
|
||||
Enabled: true
|
||||
|
||||
# Detect hard tabs, no hard tabs.
|
||||
Layout/Tab:
|
||||
Enabled: true
|
||||
|
||||
# Blank lines should not have any spaces.
|
||||
Layout/TrailingBlankLines:
|
||||
Enabled: true
|
||||
|
||||
# No trailing whitespace.
|
||||
Layout/TrailingWhitespace:
|
||||
Enabled: true
|
||||
|
||||
Lint/BlockAlignment:
|
||||
Enabled: true
|
||||
|
||||
# Align `end` with the matching keyword or starting expression except for
|
||||
# assignments, where it should be aligned with the LHS.
|
||||
Lint/EndAlignment:
|
||||
Enabled: true
|
||||
EnforcedStyleAlignWith: variable
|
||||
|
||||
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
||||
Lint/RequireParentheses:
|
||||
Enabled: true
|
||||
|
||||
Layout/MultilineMethodCallIndentation:
|
||||
Enabled: true
|
||||
EnforcedStyle: indented
|
||||
|
||||
Layout/AlignHash:
|
||||
Enabled: true
|
||||
|
||||
Bundler/OrderedGems:
|
||||
Enabled: false
|
||||
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: False
|
||||
|
|
|
@ -36,7 +36,7 @@ cache:
|
|||
- vendor/bundle
|
||||
|
||||
before_install:
|
||||
- gem install bundler
|
||||
- gem install bundler rubocop
|
||||
- git clone --depth=1 https://github.com/discourse/discourse-backup-uploads-to-s3.git plugins/discourse-backup-uploads-to-s3
|
||||
- git clone --depth=1 https://github.com/discourse/discourse-spoiler-alert.git plugins/discourse-spoiler-alert
|
||||
- git clone --depth=1 https://github.com/discourse/discourse-cakeday.git plugins/discourse-cakeday
|
||||
|
@ -48,6 +48,7 @@ before_install:
|
|||
- eslint --ext .es6 test/javascripts
|
||||
- eslint --ext .es6 plugins/**/assets/javascripts
|
||||
- eslint test/javascripts
|
||||
- rubocop --parallel
|
||||
|
||||
before_script:
|
||||
- bundle exec rake db:create db:migrate
|
||||
|
|
3
Gemfile
3
Gemfile
|
@ -66,7 +66,7 @@ gem 'aws-sdk', require: false
|
|||
gem 'excon', require: false
|
||||
gem 'unf', require: false
|
||||
|
||||
gem 'email_reply_trimmer', '0.1.6'
|
||||
gem 'email_reply_trimmer', '0.1.7'
|
||||
|
||||
# TODO Use official image_optim gem once https://github.com/toy/image_optim/pull/149
|
||||
# is merged.
|
||||
|
@ -189,7 +189,6 @@ gem 'logster'
|
|||
|
||||
gem 'sassc', require: false
|
||||
|
||||
|
||||
if ENV["IMPORT"] == "1"
|
||||
gem 'mysql2'
|
||||
gem 'redcarpet'
|
||||
|
|
74
Gemfile.lock
74
Gemfile.lock
|
@ -1,38 +1,38 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actionmailer (4.2.8)
|
||||
actionpack (= 4.2.8)
|
||||
actionview (= 4.2.8)
|
||||
activejob (= 4.2.8)
|
||||
actionmailer (4.2.9)
|
||||
actionpack (= 4.2.9)
|
||||
actionview (= 4.2.9)
|
||||
activejob (= 4.2.9)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
actionpack (4.2.8)
|
||||
actionview (= 4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
actionpack (4.2.9)
|
||||
actionview (= 4.2.9)
|
||||
activesupport (= 4.2.9)
|
||||
rack (~> 1.6)
|
||||
rack-test (~> 0.6.2)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
||||
actionview (4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
actionview (4.2.9)
|
||||
activesupport (= 4.2.9)
|
||||
builder (~> 3.1)
|
||||
erubis (~> 2.7.0)
|
||||
rails-dom-testing (~> 1.0, >= 1.0.5)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
||||
active_model_serializers (0.8.3)
|
||||
activemodel (>= 3.0)
|
||||
activejob (4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
activejob (4.2.9)
|
||||
activesupport (= 4.2.9)
|
||||
globalid (>= 0.3.0)
|
||||
activemodel (4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
activemodel (4.2.9)
|
||||
activesupport (= 4.2.9)
|
||||
builder (~> 3.1)
|
||||
activerecord (4.2.8)
|
||||
activemodel (= 4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
activerecord (4.2.9)
|
||||
activemodel (= 4.2.9)
|
||||
activesupport (= 4.2.9)
|
||||
arel (~> 6.0)
|
||||
activesupport (4.2.8)
|
||||
activesupport (4.2.9)
|
||||
i18n (~> 0.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
|
@ -84,7 +84,7 @@ GEM
|
|||
image_size (~> 1.5)
|
||||
in_threads (~> 1.3)
|
||||
progress (~> 3.0, >= 3.0.1)
|
||||
email_reply_trimmer (0.1.6)
|
||||
email_reply_trimmer (0.1.7)
|
||||
ember-data-source (2.2.1)
|
||||
ember-source (>= 1.8, < 3.0)
|
||||
ember-handlebars-template (0.7.5)
|
||||
|
@ -127,7 +127,7 @@ GEM
|
|||
hiredis (0.6.1)
|
||||
htmlentities (4.3.4)
|
||||
http_accept_language (2.0.5)
|
||||
i18n (0.8.4)
|
||||
i18n (0.8.6)
|
||||
image_size (1.5.0)
|
||||
in_threads (1.4.0)
|
||||
jmespath (1.3.1)
|
||||
|
@ -137,7 +137,7 @@ GEM
|
|||
thor (>= 0.14, < 2.0)
|
||||
jwt (1.5.6)
|
||||
kgio (2.11.0)
|
||||
libv8 (5.7.492.65.1)
|
||||
libv8 (5.9.211.38.1)
|
||||
listen (3.1.5)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
|
@ -153,12 +153,14 @@ GEM
|
|||
rack (>= 1.1.3)
|
||||
metaclass (0.0.4)
|
||||
method_source (0.8.2)
|
||||
mime-types (2.99.3)
|
||||
mime-types (3.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2016.0521)
|
||||
mini_mime (0.1.3)
|
||||
mini_portile2 (2.2.0)
|
||||
mini_racer (0.1.11)
|
||||
libv8 (~> 5.7)
|
||||
minitest (5.10.2)
|
||||
minitest (5.10.3)
|
||||
mocha (1.2.1)
|
||||
metaclass (~> 0.0.1)
|
||||
mock_redis (0.17.3)
|
||||
|
@ -245,16 +247,16 @@ GEM
|
|||
rack
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.2.8)
|
||||
actionmailer (= 4.2.8)
|
||||
actionpack (= 4.2.8)
|
||||
actionview (= 4.2.8)
|
||||
activejob (= 4.2.8)
|
||||
activemodel (= 4.2.8)
|
||||
activerecord (= 4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
rails (4.2.9)
|
||||
actionmailer (= 4.2.9)
|
||||
actionpack (= 4.2.9)
|
||||
actionview (= 4.2.9)
|
||||
activejob (= 4.2.9)
|
||||
activemodel (= 4.2.9)
|
||||
activerecord (= 4.2.9)
|
||||
activesupport (= 4.2.9)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.2.8)
|
||||
railties (= 4.2.9)
|
||||
sprockets-rails
|
||||
rails-deprecated_sanitizer (1.0.3)
|
||||
activesupport (>= 4.2.0.alpha)
|
||||
|
@ -266,9 +268,9 @@ GEM
|
|||
loofah (~> 2.0)
|
||||
rails_multisite (1.0.6)
|
||||
rails (> 4.2, < 5)
|
||||
railties (4.2.8)
|
||||
actionpack (= 4.2.8)
|
||||
activesupport (= 4.2.8)
|
||||
railties (4.2.9)
|
||||
actionpack (= 4.2.9)
|
||||
activesupport (= 4.2.9)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
raindrops (0.18.0)
|
||||
|
@ -396,7 +398,7 @@ DEPENDENCIES
|
|||
certified
|
||||
discourse-qunit-rails
|
||||
discourse_image_optim
|
||||
email_reply_trimmer (= 0.1.6)
|
||||
email_reply_trimmer (= 0.1.7)
|
||||
ember-handlebars-template (= 0.7.5)
|
||||
ember-rails (= 0.18.5)
|
||||
ember-source
|
||||
|
@ -481,4 +483,4 @@ DEPENDENCIES
|
|||
webmock
|
||||
|
||||
BUNDLED WITH
|
||||
1.15.1
|
||||
1.15.3
|
||||
|
|
1
Rakefile
1
Rakefile
|
@ -9,4 +9,3 @@ Discourse::Application.load_tasks
|
|||
# this prevents crashes when migrating a database in production in certain
|
||||
# PostgreSQL configuations when trying to create structure.sql
|
||||
Rake::Task["db:structure:dump"].clear if Rails.env.production?
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
classNames: ['watched-word'],
|
||||
|
||||
buildBuffer(buffer) {
|
||||
buffer.push(iconHTML('times'));
|
||||
buffer.push(' ' + this.get('word.word'));
|
||||
},
|
||||
|
||||
click() {
|
||||
this.get('word').destroy().then(() => {
|
||||
this.sendAction('action', this.get('word'));
|
||||
}).catch(e => {
|
||||
bootbox.alert(I18n.t("generic_error_with_reason", {error: `http: ${e.status} - ${e.body}`}));
|
||||
});;
|
||||
}
|
||||
}));
|
|
@ -1,5 +1,5 @@
|
|||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
/*global Resumable:true */
|
||||
|
@ -40,7 +41,7 @@ export default Ember.Component.extend(bufferedRender({
|
|||
|
||||
buildBuffer(buffer) {
|
||||
const icon = this.get("isUploading") ? "times" : "upload";
|
||||
buffer.push(`<i class="fa fa-${icon}"></i>`);
|
||||
buffer.push(iconHTML(icon));
|
||||
buffer.push("<span class='ru-label'>" + this.get("text") + "</span>");
|
||||
buffer.push("<span class='ru-progress' style='width:" + this.get("progress") + "%'></span>");
|
||||
},
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
import WatchedWord from 'admin/models/watched-word';
|
||||
import { on, observes } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['watched-word-form'],
|
||||
formSubmitted: false,
|
||||
actionKey: null,
|
||||
showSuccessMessage: false,
|
||||
|
||||
@observes('word')
|
||||
removeSuccessMessage() {
|
||||
if (this.get('showSuccessMessage') && !Ember.isEmpty(this.get('word'))) {
|
||||
this.set('showSuccessMessage', false);
|
||||
}
|
||||
},
|
||||
|
||||
actions: {
|
||||
submit() {
|
||||
if (!this.get('formSubmitted')) {
|
||||
this.set('formSubmitted', true);
|
||||
|
||||
const watchedWord = WatchedWord.create({ word: this.get('word'), action: this.get('actionKey') });
|
||||
|
||||
watchedWord.save().then(result => {
|
||||
this.setProperties({ word: '', formSubmitted: false, showSuccessMessage: true });
|
||||
this.sendAction('action', WatchedWord.create(result));
|
||||
Ember.run.schedule('afterRender', () => this.$('.watched-word-input').focus());
|
||||
}).catch(e => {
|
||||
this.set('formSubmitted', false);
|
||||
const msg = (e.responseJSON && e.responseJSON.errors) ?
|
||||
I18n.t("generic_error_with_reason", {error: e.responseJSON.errors.join('. ')}) :
|
||||
I18n.t("generic_error");
|
||||
bootbox.alert(msg, () => this.$('.watched-word-input').focus());
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@on("didInsertElement")
|
||||
_init() {
|
||||
Ember.run.schedule('afterRender', () => {
|
||||
this.$('.watched-word-input').keydown(e => {
|
||||
if (e.keyCode === 13) {
|
||||
this.send('submit');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
|
@ -0,0 +1,25 @@
|
|||
import computed from "ember-addons/ember-computed-decorators";
|
||||
import UploadMixin from "discourse/mixins/upload";
|
||||
|
||||
export default Em.Component.extend(UploadMixin, {
|
||||
type: 'csv',
|
||||
classNames: 'watched-words-uploader',
|
||||
uploadUrl: '/admin/watched_words/upload',
|
||||
addDisabled: Em.computed.alias("uploading"),
|
||||
|
||||
validateUploadedFilesOptions() {
|
||||
return { csvOnly: true };
|
||||
},
|
||||
|
||||
@computed('actionKey')
|
||||
data(actionKey) {
|
||||
return { action_key: actionKey };
|
||||
},
|
||||
|
||||
uploadDone() {
|
||||
if (this) {
|
||||
bootbox.alert(I18n.t("admin.watched_words.form.upload_successful"));
|
||||
this.sendAction("done");
|
||||
}
|
||||
}
|
||||
});
|
|
@ -31,10 +31,10 @@ export default Ember.Controller.extend({
|
|||
];
|
||||
}.property(),
|
||||
|
||||
@computed('model.visibility_level', 'model.public')
|
||||
disableMembershipRequestSetting(visibility_level, publicGroup) {
|
||||
@computed('model.visibility_level', 'model.public_admission')
|
||||
disableMembershipRequestSetting(visibility_level, publicAdmission) {
|
||||
visibility_level = parseInt(visibility_level);
|
||||
return (visibility_level !== 0) || publicGroup;
|
||||
return (visibility_level !== 0) || publicAdmission;
|
||||
},
|
||||
|
||||
@computed('model.visibility_level', 'model.allow_membership_requests')
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import WatchedWord from 'admin/models/watched-word';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
actionNameKey: null,
|
||||
adminWatchedWords: Ember.inject.controller(),
|
||||
showWordsList: Ember.computed.or('adminWatchedWords.filtered', 'adminWatchedWords.showWords'),
|
||||
|
||||
findAction(actionName) {
|
||||
return (this.get('adminWatchedWords.model') || []).findBy('nameKey', actionName);
|
||||
},
|
||||
|
||||
@computed('adminWatchedWords.model', 'actionNameKey')
|
||||
filteredContent() {
|
||||
if (!this.get('actionNameKey')) { return []; }
|
||||
|
||||
const a = this.findAction(this.get('actionNameKey'));
|
||||
return a ? a.words : [];
|
||||
},
|
||||
|
||||
@computed('actionNameKey')
|
||||
actionDescription(actionNameKey) {
|
||||
return I18n.t('admin.watched_words.action_descriptions.' + actionNameKey);
|
||||
},
|
||||
|
||||
actions: {
|
||||
recordAdded(arg) {
|
||||
const a = this.findAction(this.get('actionNameKey'));
|
||||
if (a) {
|
||||
a.words.unshiftObject(arg);
|
||||
a.incrementProperty('count');
|
||||
Em.run.schedule('afterRender', () => {
|
||||
// remove from other actions lists
|
||||
let match = null;
|
||||
this.get('adminWatchedWords.model').forEach(action => {
|
||||
if (match) return;
|
||||
|
||||
if (action.nameKey !== this.get('actionNameKey')) {
|
||||
match = action.words.findBy('id', arg.id);
|
||||
if (match) {
|
||||
action.words.removeObject(match);
|
||||
action.decrementProperty('count');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
recordRemoved(arg) {
|
||||
const a = this.findAction(this.get('actionNameKey'));
|
||||
if (a) {
|
||||
a.words.removeObject(arg);
|
||||
a.decrementProperty('count');
|
||||
}
|
||||
},
|
||||
|
||||
uploadComplete() {
|
||||
WatchedWord.findAll().then(data => {
|
||||
this.set('adminWatchedWords.model', data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
|
@ -0,0 +1,51 @@
|
|||
import debounce from 'discourse/lib/debounce';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
filter: null,
|
||||
filtered: false,
|
||||
showWords: false,
|
||||
disableShowWords: Ember.computed.alias('filtered'),
|
||||
|
||||
filterContentNow() {
|
||||
|
||||
if (!!Ember.isEmpty(this.get('allWatchedWords'))) return;
|
||||
|
||||
let filter;
|
||||
if (this.get('filter')) {
|
||||
filter = this.get('filter').toLowerCase();
|
||||
}
|
||||
|
||||
if (filter === undefined || filter.length < 1) {
|
||||
this.set('model', this.get('allWatchedWords'));
|
||||
return;
|
||||
}
|
||||
|
||||
const matchesByAction = [];
|
||||
|
||||
this.get('allWatchedWords').forEach(wordsForAction => {
|
||||
const wordRecords = wordsForAction.words.filter(wordRecord => {
|
||||
return (wordRecord.word.indexOf(filter) > -1);
|
||||
});
|
||||
matchesByAction.pushObject( Ember.Object.create({
|
||||
nameKey: wordsForAction.nameKey,
|
||||
name: wordsForAction.name,
|
||||
words: wordRecords,
|
||||
count: wordRecords.length
|
||||
}) );
|
||||
});
|
||||
|
||||
this.set('model', matchesByAction);
|
||||
},
|
||||
|
||||
filterContent: debounce(function() {
|
||||
this.filterContentNow();
|
||||
this.set('filtered', !Ember.isEmpty(this.get('filter')));
|
||||
}, 250).observes('filter'),
|
||||
|
||||
actions: {
|
||||
clearFilter() {
|
||||
this.setProperties({ filter: '' });
|
||||
}
|
||||
}
|
||||
|
||||
});
|
|
@ -0,0 +1,7 @@
|
|||
import { registerUnbound } from 'discourse-common/lib/helpers';
|
||||
import { renderIcon } from 'discourse-common/lib/icon-library';
|
||||
|
||||
registerUnbound('check-icon', function(value) {
|
||||
let icon = value ? "check" : "times";
|
||||
return new Handlebars.SafeString(renderIcon('string', icon));
|
||||
});
|
|
@ -1,3 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { ajax } from 'discourse/lib/ajax';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import { propertyNotEqual } from 'discourse/lib/computed';
|
||||
|
@ -108,7 +109,7 @@ const AdminUser = Discourse.User.extend({
|
|||
"class": "cancel-inline",
|
||||
"link": true
|
||||
}, {
|
||||
"label": '<i class="fa fa-exclamation-triangle"></i> ' + I18n.t("admin.user.delete_all_posts"),
|
||||
"label": `${iconHTML('exclamation-triangle')} ` + I18n.t("admin.user.delete_all_posts"),
|
||||
"class": "btn btn-danger",
|
||||
"callback": function() {
|
||||
ajax("/admin/users/" + user.get('id') + "/delete_all_posts", {
|
||||
|
@ -337,7 +338,7 @@ const AdminUser = Discourse.User.extend({
|
|||
"class": "cancel",
|
||||
"link": true
|
||||
}, {
|
||||
"label": '<i class="fa fa-exclamation-triangle"></i>' + I18n.t('admin.user.block_accept'),
|
||||
"label": `${iconHTML('exclamation-triangle')} ` + I18n.t('admin.user.block_accept'),
|
||||
"class": "btn btn-danger",
|
||||
"callback": function() { performBlock(); }
|
||||
}];
|
||||
|
@ -386,7 +387,7 @@ const AdminUser = Discourse.User.extend({
|
|||
"class": "cancel",
|
||||
"link": true
|
||||
}, {
|
||||
"label": '<i class="fa fa-exclamation-triangle"></i>' + I18n.t('admin.user.anonymize_yes'),
|
||||
"label": `${iconHTML('exclamation-triangle')} ` + I18n.t('admin.user.anonymize_yes'),
|
||||
"class": "btn btn-danger",
|
||||
"callback": function() { performAnonymize(); }
|
||||
}];
|
||||
|
@ -450,7 +451,7 @@ const AdminUser = Discourse.User.extend({
|
|||
"class": "btn",
|
||||
"link": true
|
||||
}, {
|
||||
"label": '<i class="fa fa-exclamation-triangle"></i>' + I18n.t('admin.user.delete_and_block'),
|
||||
"label": `${iconHTML('exclamation-triangle')} ` + I18n.t('admin.user.delete_and_block'),
|
||||
"class": "btn btn-danger",
|
||||
"callback": function(){ performDestroy(true); }
|
||||
}, {
|
||||
|
@ -479,7 +480,7 @@ const AdminUser = Discourse.User.extend({
|
|||
"class": "cancel-inline",
|
||||
"link": true
|
||||
}, {
|
||||
"label": '<i class="fa fa-exclamation-triangle"></i> ' + I18n.t("flagging.yes_delete_spammer"),
|
||||
"label": `${iconHTML('exclamation-triangle')} ` + I18n.t("flagging.yes_delete_spammer"),
|
||||
"class": "btn btn-danger",
|
||||
"callback": function() {
|
||||
return ajax("/admin/users/" + user.get('id') + '.json', {
|
||||
|
|
|
@ -2,7 +2,7 @@ import { ajax } from 'discourse/lib/ajax';
|
|||
import AdminUser from 'admin/models/admin-user';
|
||||
import Topic from 'discourse/models/topic';
|
||||
import Post from 'discourse/models/post';
|
||||
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
|
||||
const FlaggedPost = Post.extend({
|
||||
|
||||
|
@ -35,13 +35,14 @@ const FlaggedPost = Post.extend({
|
|||
|
||||
dispositionIcon: function (disposition) {
|
||||
if (!disposition) { return null; }
|
||||
var icon, title = I18n.t('admin.flags.dispositions.' + disposition);
|
||||
let icon;
|
||||
let title = 'admin.flags.dispositions.' + disposition;
|
||||
switch (disposition) {
|
||||
case "deferred": { icon = "fa-external-link"; break; }
|
||||
case "agreed": { icon = "fa-thumbs-o-up"; break; }
|
||||
case "disagreed": { icon = "fa-thumbs-o-down"; break; }
|
||||
case "deferred": { icon = "external-link"; break; }
|
||||
case "agreed": { icon = "thumbs-o-up"; break; }
|
||||
case "disagreed": { icon = "thumbs-o-down"; break; }
|
||||
}
|
||||
return "<i class='fa " + icon + "' title='" + title + "'></i>";
|
||||
return iconHTML(icon, { title });
|
||||
},
|
||||
|
||||
wasEdited: function () {
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
import { ajax } from 'discourse/lib/ajax';
|
||||
|
||||
const WatchedWord = Discourse.Model.extend({
|
||||
save() {
|
||||
return ajax("/admin/watched_words" + (this.id ? '/' + this.id : '') + ".json", {
|
||||
type: this.id ? 'PUT' : 'POST',
|
||||
data: {word: this.get('word'), action_key: this.get('action')},
|
||||
dataType: 'json'
|
||||
});
|
||||
},
|
||||
|
||||
destroy() {
|
||||
return ajax("/admin/watched_words/" + this.get('id') + ".json", {type: 'DELETE'});
|
||||
}
|
||||
});
|
||||
|
||||
WatchedWord.reopenClass({
|
||||
findAll() {
|
||||
return ajax("/admin/watched_words").then(function (list) {
|
||||
const actions = {};
|
||||
list.words.forEach(s => {
|
||||
if (!actions[s.action]) { actions[s.action] = []; }
|
||||
actions[s.action].pushObject(WatchedWord.create(s));
|
||||
});
|
||||
|
||||
list.actions.forEach(a => {
|
||||
if (!actions[a]) { actions[a] = []; }
|
||||
});
|
||||
|
||||
return Object.keys(actions).map(function(n) {
|
||||
return Ember.Object.create({nameKey: n, name: I18n.t('admin.watched_words.actions.' + n), words: actions[n], count: actions[n].length});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
export default WatchedWord;
|
|
@ -90,5 +90,10 @@ export default function() {
|
|||
this.route('adminPlugins', { path: '/plugins', resetNamespace: true }, function() {
|
||||
this.route('index', { path: '/' });
|
||||
});
|
||||
|
||||
this.route('adminWatchedWords', { path: '/watched_words', resetNamespace: true}, function() {
|
||||
this.route('index', { path: '/' } );
|
||||
this.route('action', { path: '/action/:action_id' } );
|
||||
});
|
||||
});
|
||||
};
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
export default Discourse.Route.extend({
|
||||
model(params) {
|
||||
this.controllerFor('adminWatchedWordsAction').set('actionNameKey', params.action_id);
|
||||
let filteredContent = this.controllerFor('adminWatchedWordsAction').get('filteredContent');
|
||||
return Ember.Object.create({
|
||||
nameKey: params.action_id,
|
||||
name: I18n.t('admin.watched_words.actions.' + params.action_id),
|
||||
words: filteredContent
|
||||
});
|
||||
}
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
export default Discourse.Route.extend({
|
||||
beforeModel() {
|
||||
this.replaceWith('adminWatchedWords.action', this.modelFor('adminWatchedWords')[0].nameKey);
|
||||
}
|
||||
});
|
|
@ -0,0 +1,15 @@
|
|||
import WatchedWord from 'admin/models/watched-word';
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
queryParams: {
|
||||
filter: { replace: true }
|
||||
},
|
||||
|
||||
model() {
|
||||
return WatchedWord.findAll();
|
||||
},
|
||||
|
||||
afterModel(watchedWordsList) {
|
||||
this.controllerFor('adminWatchedWords').set('allWatchedWords', watchedWordsList);
|
||||
}
|
||||
});
|
|
@ -22,6 +22,7 @@
|
|||
{{nav-item route='adminApi' label='admin.api.title'}}
|
||||
{{nav-item route='admin.backups' label='admin.backups.title'}}
|
||||
{{/if}}
|
||||
{{nav-item route='adminWatchedWords' label='admin.watched_words.title'}}
|
||||
{{nav-item route='adminPlugins' label='admin.plugins.title'}}
|
||||
{{plugin-outlet name="admin-menu" connectorTagName="li"}}
|
||||
</ul>
|
||||
|
|
|
@ -29,5 +29,5 @@
|
|||
{{/if}}
|
||||
|
||||
{{#unless hasMasterKey}}
|
||||
<button class='btn' {{action "generateMasterKey"}}><i class="fa fa-key"></i>{{i18n 'admin.api.generate_master'}}</button>
|
||||
<button class='btn' {{action "generateMasterKey"}}>{{d-icon "key"}}</button>
|
||||
{{/unless}}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<div>
|
||||
{{#link-to 'adminBadges.show' 'new' class="btn"}}
|
||||
{{fa-icon "plus"}} {{i18n 'admin.badges.new'}}
|
||||
{{d-icon "plus"}} {{i18n 'admin.badges.new'}}
|
||||
{{/link-to}}
|
||||
</div>
|
||||
{{/d-section}}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
content=badgeGroupings
|
||||
optionValuePath="content.id"
|
||||
optionLabelPath="content.displayName"}}
|
||||
<button {{action "editGroupings"}} class='btn'>{{fa-icon 'pencil'}}</button>
|
||||
<button {{action "editGroupings"}} class='btn'>{{d-icon 'pencil'}}</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
{{/each}}
|
||||
</ul>
|
||||
{{#link-to 'adminBadges.show' 'new' class="btn"}}
|
||||
{{fa-icon "plus"}} {{i18n 'admin.badges.new'}}
|
||||
{{d-icon "plus"}} {{i18n 'admin.badges.new'}}
|
||||
{{/link-to}}
|
||||
<br>
|
||||
<br>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<td class="title">
|
||||
{{#if report.icon}}
|
||||
{{fa-icon report.icon}}
|
||||
{{d-icon report.icon}}
|
||||
{{/if}}
|
||||
<a href="{{report.reportUrl}}">{{report.title}}</a>
|
||||
</td>
|
||||
|
@ -8,15 +8,15 @@
|
|||
<td class="value">{{number report.todayCount}}</td>
|
||||
|
||||
<td class="value {{report.yesterdayTrend}}" title={{report.yesterdayCountTitle}}>
|
||||
{{number report.yesterdayCount}} {{fa-icon "caret-up" class="up"}} {{fa-icon "caret-down" class="down"}}
|
||||
{{number report.yesterdayCount}} {{d-icon "caret-up" class="up"}} {{d-icon "caret-down" class="down"}}
|
||||
</td>
|
||||
|
||||
<td class="value {{report.sevenDayTrend}}" title={{report.sevenDayCountTitle}}>
|
||||
{{number report.lastSevenDaysCount}} {{fa-icon "caret-up" class="up"}} {{fa-icon "caret-down" class="down"}}
|
||||
{{number report.lastSevenDaysCount}} {{d-icon "caret-up" class="up"}} {{d-icon "caret-down" class="down"}}
|
||||
</td>
|
||||
|
||||
<td class="value {{report.thirtyDayTrend}}" title={{report.thirtyDayCountTitle}}>
|
||||
{{number report.lastThirtyDaysCount}} {{fa-icon "caret-up" class="up"}} {{fa-icon "caret-down" class="down"}}
|
||||
{{number report.lastThirtyDaysCount}} {{d-icon "caret-up" class="up"}} {{d-icon "caret-down" class="down"}}
|
||||
</td>
|
||||
|
||||
<td class="value">{{number report.total}}</td>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="validation-error {{unless message 'hidden'}}">
|
||||
{{fa-icon "times"}}
|
||||
{{d-icon "times"}}
|
||||
{{message}}
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<b>{{i18n 'admin.watched_words.form.label'}}</b>
|
||||
{{text-field value=word disabled=formSubmitted class="watched-word-input" autocorrect="off" autocapitalize="off"}}
|
||||
{{d-button action="submit" disabled=formSubmitted label="admin.watched_words.form.add"}}
|
||||
|
||||
{{#if showSuccessMessage}}
|
||||
<span class="success-message">{{i18n 'admin.watched_words.form.success'}}</span>
|
||||
{{/if}}
|
|
@ -0,0 +1,7 @@
|
|||
<label class="btn {{if addDisabled 'disabled'}}">
|
||||
{{d-icon "upload"}}
|
||||
{{i18n 'admin.watched_words.form.upload'}}
|
||||
<input disabled={{addDisabled}} type="file" accept="text/plain,text/csv" style="visibility: hidden; position: absolute;" />
|
||||
</label>
|
||||
<br/>
|
||||
<span class="instructions">One word per line</span>
|
|
@ -5,13 +5,13 @@
|
|||
{{#unless model.theme_id}}
|
||||
<button {{action "save"}} disabled={{model.disableSave}} class='btn'>{{i18n 'admin.customize.save'}}</button>
|
||||
{{/unless}}
|
||||
<button {{action "copy" model}} class='btn'><i class="fa fa-copy"></i> {{i18n 'admin.customize.copy'}}</button>
|
||||
<button {{action "copyToClipboard" model}} class='btn'><i class="fa fa-clipboard"></i> {{i18n 'admin.customize.copy_to_clipboard'}}</button>
|
||||
<button {{action "copy" model}} class='btn'>{{d-icon "copy"}} {{i18n 'admin.customize.copy'}}</button>
|
||||
<button {{action "copyToClipboard" model}} class='btn'>{{d-icon "clipboard"}} {{i18n 'admin.customize.copy_to_clipboard'}}</button>
|
||||
{{#if model.theme_id}}
|
||||
{{i18n "admin.customize.theme_owner"}}
|
||||
{{#link-to "adminCustomizeThemes.show" model.theme_id}}{{model.theme_name}}{{/link-to}}
|
||||
{{else}}
|
||||
<button {{action "destroy"}} class='btn btn-danger'><i class="fa fa-trash-o"></i> {{i18n 'admin.customize.delete'}}</button>
|
||||
<button {{action "destroy"}} class='btn btn-danger'>{{d-icon "trash-o"}} {{i18n 'admin.customize.delete'}}</button>
|
||||
{{/if}}
|
||||
<span class="saving {{unless model.savingStatus 'hidden'}}">{{model.savingStatus}}</span>
|
||||
</div>
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
{{#each model as |scheme|}}
|
||||
{{#unless scheme.is_base}}
|
||||
<li>
|
||||
{{#link-to 'adminCustomize.colors.show' scheme replace=true}}{{fa-icon 'paint-brush'}}{{scheme.description}}{{/link-to}}
|
||||
{{#link-to 'adminCustomize.colors.show' scheme replace=true}}{{d-icon 'paint-brush'}}{{scheme.description}}{{/link-to}}
|
||||
</li>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
<button {{action "newColorScheme"}} class='btn'>{{fa-icon 'plus'}}{{i18n 'admin.customize.new'}}</button>
|
||||
<button {{action "newColorScheme"}} class='btn'>{{d-icon 'plus'}}{{i18n 'admin.customize.new'}}</button>
|
||||
</div>
|
||||
|
||||
{{outlet}}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<li>
|
||||
{{#link-to 'adminCustomizeThemes.edit' model.id 'desktop' fieldName replace=true title=field.title}}
|
||||
{{i18n 'admin.customize.theme.desktop'}}
|
||||
{{fa-icon 'desktop'}}
|
||||
{{d-icon 'desktop'}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/if}}
|
||||
|
@ -27,7 +27,7 @@
|
|||
<li class='mobile'>
|
||||
{{#link-to 'adminCustomizeThemes.edit' model.id 'mobile' fieldName replace=true title=field.title}}
|
||||
{{i18n 'admin.customize.theme.mobile'}}
|
||||
{{fa-icon 'mobile'}}
|
||||
{{d-icon 'mobile'}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/if}}
|
||||
|
@ -46,14 +46,14 @@
|
|||
{{#each fields as |field|}}
|
||||
<li>
|
||||
{{#link-to 'adminCustomizeThemes.edit' model.id currentTargetName field.name replace=true title=field.title}}
|
||||
{{#if field.icon}}{{fa-icon field.icon}} {{/if}}
|
||||
{{#if field.icon}}{{d-icon field.icon}} {{/if}}
|
||||
{{i18n field.key}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
{{/each}}
|
||||
<li class='toggle-maximize'>
|
||||
<a {{action "toggleMaximize"}}>
|
||||
<i class="fa fa-{{maximizeIcon}}"></i>
|
||||
{{d-icon maximizeIcon}}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{{d-button action="finishedEditingName" class="btn-primary btn-small submit-edit" icon="check"}}
|
||||
{{d-button action="cancelEditingName" class="btn-small cancel-edit" icon="times"}}
|
||||
{{else}}
|
||||
{{model.name}} <a {{action "startEditingName"}}>{{fa-icon "pencil"}}</a>
|
||||
{{model.name}} <a {{action "startEditingName"}}>{{d-icon "pencil"}}</a>
|
||||
{{/if}}
|
||||
</h2>
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
|||
</p>
|
||||
{{#if model.remote_theme.license_url}}
|
||||
<p>
|
||||
<a href="{{model.remote_theme.license_url}}">{{i18n "admin.customize.theme.license"}} {{fa-icon "copyright"}}</a>
|
||||
<a href="{{model.remote_theme.license_url}}">{{i18n "admin.customize.theme.license"}} {{d-icon "copyright"}}</a>
|
||||
</p>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
@ -133,8 +133,8 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<a href='{{previewUrl}}' title="{{i18n 'admin.customize.explain_preview'}}" target='_blank' class='btn'>{{fa-icon 'desktop'}}{{i18n 'admin.customize.theme.preview'}}</a>
|
||||
<a class="btn export" target="_blank" href={{downloadUrl}}>{{fa-icon "download"}} {{i18n 'admin.export_json.button_text'}}</a>
|
||||
<a href='{{previewUrl}}' title="{{i18n 'admin.customize.explain_preview'}}" target='_blank' class='btn'>{{d-icon 'desktop'}}{{i18n 'admin.customize.theme.preview'}}</a>
|
||||
<a class="btn export" target="_blank" href={{downloadUrl}}>{{d-icon "download"}} {{i18n 'admin.export_json.button_text'}}</a>
|
||||
|
||||
{{d-button action="destroy" label="admin.customize.delete" icon="trash" class="btn-danger"}}
|
||||
</div>
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
{{#link-to 'adminCustomizeThemes.show' theme replace=true}}
|
||||
{{theme.name}}
|
||||
{{#if theme.user_selectable}}
|
||||
{{fa-icon "user"}}
|
||||
{{d-icon "user"}}
|
||||
{{/if}}
|
||||
{{#if theme.default}}
|
||||
{{fa-icon "asterisk"}}
|
||||
{{d-icon "asterisk"}}
|
||||
{{/if}}
|
||||
{{/link-to}}
|
||||
</li>
|
||||
|
|
|
@ -29,15 +29,15 @@
|
|||
<div class="dashboard-stats totals">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="title">{{fa-icon "shield"}} {{i18n 'admin.dashboard.admins'}}</td>
|
||||
<td class="title">{{d-icon "shield"}} {{i18n 'admin.dashboard.admins'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'admins'}}{{admins}}{{/link-to}}</td>
|
||||
<td class="title">{{fa-icon "ban"}} {{i18n 'admin.dashboard.suspended'}}</td>
|
||||
<td class="title">{{d-icon "ban"}} {{i18n 'admin.dashboard.suspended'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'suspended'}}{{suspended}}{{/link-to}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">{{fa-icon "shield"}} {{i18n 'admin.dashboard.moderators'}}</td>
|
||||
<td class="title">{{d-icon "shield"}} {{i18n 'admin.dashboard.moderators'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'moderators'}}{{moderators}}{{/link-to}}</td>
|
||||
<td class="title">{{fa-icon "ban"}} {{i18n 'admin.dashboard.blocked'}}</td>
|
||||
<td class="title">{{d-icon "ban"}} {{i18n 'admin.dashboard.blocked'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'blocked'}}{{blocked}}{{/link-to}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -87,7 +87,7 @@
|
|||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title" title="{{i18n 'admin.dashboard.private_messages_title'}}">{{fa-icon "envelope"}} {{i18n 'admin.dashboard.private_messages_short'}}</th>
|
||||
<th class="title" title="{{i18n 'admin.dashboard.private_messages_title'}}">{{d-icon "envelope"}} {{i18n 'admin.dashboard.private_messages_short'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
|
@ -176,7 +176,7 @@
|
|||
<div class="dashboard-right">
|
||||
{{#if foundProblems}}
|
||||
<div class="dashboard-stats detected-problems">
|
||||
<div class="look-here">{{fa-icon "exclamation-triangle"}}</div>
|
||||
<div class="look-here">{{d-icon "exclamation-triangle"}}</div>
|
||||
<div class="problem-messages">
|
||||
{{#conditional-loading-spinner condition=loadingProblems}}
|
||||
<p>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
{{/if}}
|
||||
</td>
|
||||
<td>
|
||||
{{#if l.bounced}}{{fa-icon "repeat" title="admin.email.bounced"}}{{/if}}
|
||||
{{#if l.bounced}}{{d-icon "repeat" title="admin.email.bounced"}}{{/if}}
|
||||
<a href='mailto:{{unbound l.to_address}}'>{{l.to_address}}</a>
|
||||
</td>
|
||||
<td>{{l.email_type}}</td>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<tr>
|
||||
<th><img class="emoji emoji-custom" src="{{unbound e.url}}" title="{{unbound e.name}}"></th>
|
||||
<th>:{{e.name}}:</th>
|
||||
<th><button {{action "destroy" e}} class='btn btn-danger no-text pull-right'>{{fa-icon 'trash-o'}} </button></th>
|
||||
<th><button {{action "destroy" e}} class='btn btn-danger no-text pull-right'>{{d-icon 'trash-o'}} </button></th>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
|
|
|
@ -19,7 +19,9 @@
|
|||
{{#if flaggedPost.postAuthorFlagged}}
|
||||
{{#if flaggedPost.user}}
|
||||
{{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="large"}}{{/link-to}}
|
||||
{{#if flaggedPost.wasEdited}}<i class="fa fa-pencil" title="{{i18n 'admin.flags.was_edited'}}"></i>{{/if}}
|
||||
{{#if flaggedPost.wasEdited}}
|
||||
{{d-icon "pencil" title="admin.flags.was_edited"}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if adminActiveFlagsView}}
|
||||
|
@ -31,7 +33,7 @@
|
|||
<div class="topic-excerpt">
|
||||
<h3>
|
||||
{{#if flaggedPost.topic.isPrivateMessage}}
|
||||
<span class="private-message-glyph">{{fa-icon "envelope"}}</span>
|
||||
<span class="private-message-glyph">{{d-icon "envelope"}}</span>
|
||||
{{/if}}
|
||||
{{topic-status topic=flaggedPost.topic}}
|
||||
<a href='{{unbound flaggedPost.url}}'>{{{unbound flaggedPost.topic.fancyTitle}}}</a>
|
||||
|
@ -90,7 +92,7 @@
|
|||
{{format-age flagger.disposedAt}}
|
||||
{{{flagger.dispositionIcon}}}
|
||||
{{#if flagger.tookAction}}
|
||||
<i class='fa fa-gavel' title='{{i18n 'admin.flags.took_action'}}'></i>
|
||||
{{d-icon "gavel" title="admin.flags.took_action"}}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -129,7 +131,8 @@
|
|||
</p>
|
||||
{{/if}}
|
||||
<a href="{{unbound c.permalink}}">
|
||||
<button class='btn btn-reply'><i class="fa fa-reply"></i> {{i18n 'admin.flags.reply_message'}}</button>
|
||||
<button class='btn btn-reply'>{{d-icon "reply"}} {{i18n 'admin.flags.reply_message'}}</button>
|
||||
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -141,14 +144,14 @@
|
|||
<tr>
|
||||
<td colspan="3" class="action">
|
||||
{{#if adminActiveFlagsView}}
|
||||
<button title='{{i18n 'admin.flags.agree_title'}}' class='btn' {{action "showAgreeFlagModal" flaggedPost}}><i class="fa fa-thumbs-o-up"></i>{{i18n 'admin.flags.agree'}}…</button>
|
||||
<button title='{{i18n 'admin.flags.agree_title'}}' class='btn' {{action "showAgreeFlagModal" flaggedPost}}>{{d-icon "thumbs-o-up"}}{{i18n 'admin.flags.agree'}}…</button>
|
||||
{{#if flaggedPost.postHidden}}
|
||||
<button title='{{i18n 'admin.flags.disagree_flag_unhide_post_title'}}' class='btn' {{action "disagreeFlags" flaggedPost}}><i class="fa fa-thumbs-o-down"></i>{{i18n 'admin.flags.disagree_flag_unhide_post'}}</button>
|
||||
<button title='{{i18n 'admin.flags.disagree_flag_unhide_post_title'}}' class='btn' {{action "disagreeFlags" flaggedPost}}>{{d-icon "thumbs-o-down"}}{{i18n 'admin.flags.disagree_flag_unhide_post'}}</button>
|
||||
{{else}}
|
||||
<button title='{{i18n 'admin.flags.disagree_flag_title'}}' class='btn' {{action "disagreeFlags" flaggedPost}}><i class="fa fa-thumbs-o-down"></i>{{i18n 'admin.flags.disagree_flag'}}</button>
|
||||
<button title='{{i18n 'admin.flags.disagree_flag_title'}}' class='btn' {{action "disagreeFlags" flaggedPost}}>{{d-icon "thumbs-o-down"}}{{i18n 'admin.flags.disagree_flag'}}</button>
|
||||
{{/if}}
|
||||
<button title='{{i18n 'admin.flags.defer_flag_title'}}' class='btn' {{action "deferFlags" flaggedPost}}><i class="fa fa-external-link"></i>{{i18n 'admin.flags.defer_flag'}}</button>
|
||||
<button title='{{i18n 'admin.flags.delete_title'}}' class='btn btn-danger' {{action "showDeleteFlagModal" flaggedPost}}><i class="fa fa-trash-o"></i>{{i18n 'admin.flags.delete'}}…</button>
|
||||
<button title='{{i18n 'admin.flags.defer_flag_title'}}' class='btn' {{action "deferFlags" flaggedPost}}>{{d-icon "external-link"}}{{i18n 'admin.flags.defer_flag'}}</button>
|
||||
<button title='{{i18n 'admin.flags.delete_title'}}' class='btn btn-danger' {{action "showDeleteFlagModal" flaggedPost}}>{{d-icon "trash-o"}}{{i18n 'admin.flags.delete'}}…</button>
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#if model.id}}
|
||||
{{#unless model.automatic}}
|
||||
<div>
|
||||
<label for='full_name'>{{i18n 'groups.edit.full_name'}}</label>
|
||||
|
@ -31,30 +30,54 @@
|
|||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div>
|
||||
<label for="owner-selector">{{i18n 'admin.groups.add_owners'}}</label>
|
||||
{{user-selector usernames=model.ownerUsernames placeholderKey="admin.groups.selector_placeholder" id="owner-selector"}}
|
||||
{{d-button action="addOwners" class="add" icon="plus" label="admin.groups.add"}}
|
||||
|
||||
{{user-selector usernames=model.ownerUsernames
|
||||
placeholderKey="admin.groups.selector_placeholder"
|
||||
id="owner-selector"}}
|
||||
|
||||
{{#if model.id}}
|
||||
{{d-button
|
||||
action="addOwners"
|
||||
class="add"
|
||||
icon="plus"
|
||||
label="admin.groups.add"}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
||||
<div>
|
||||
{{group-members-input model=model}}
|
||||
{{group-members-input model=model addButton=model.id}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div>
|
||||
<label for="visiblity">{{i18n 'groups.visibility_levels.title'}}</label>
|
||||
{{combo-box name="alias" valueAttribute="value" value=model.visibility_level content=visibilityLevelOptions}}
|
||||
{{combo-box name="alias"
|
||||
valueAttribute="value"
|
||||
value=model.visibility_level
|
||||
content=visibilityLevelOptions
|
||||
castInteger=true}}
|
||||
</div>
|
||||
|
||||
{{#unless model.automatic}}
|
||||
<div>
|
||||
<label>
|
||||
{{input type="checkbox"
|
||||
checked=model.public
|
||||
checked=model.public_admission
|
||||
disabled=disablePublicSetting}}
|
||||
|
||||
{{i18n 'groups.public'}}
|
||||
{{i18n 'groups.public_admission'}}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>
|
||||
{{input type='checkbox'
|
||||
checked=model.public_exit}}
|
||||
|
||||
{{i18n 'groups.public_exit'}}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
@ -123,7 +146,7 @@
|
|||
<div class='buttons'>
|
||||
<button {{action "save"}} disabled={{disableSave}} class='btn btn-primary'>{{i18n 'admin.customize.save'}}</button>
|
||||
{{#unless model.automatic}}
|
||||
<button {{action "destroy"}} class='btn btn-danger'>{{fa-icon "trash-o"}}{{i18n 'admin.customize.delete'}}</button>
|
||||
<button {{action "destroy"}} class='btn btn-danger'>{{d-icon "trash-o"}}{{i18n 'admin.customize.delete'}}</button>
|
||||
{{/unless}}
|
||||
|
||||
<span class="saving {{unless savingStatus 'hidden'}}">{{savingStatus}}</span>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
<div>
|
||||
{{#link-to 'adminGroup' 'new' class="btn"}}
|
||||
{{fa-icon "plus"}} {{i18n 'admin.groups.new'}}
|
||||
{{d-icon "plus"}} {{i18n 'admin.groups.new'}}
|
||||
{{/link-to}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{{d-button action="refreshAutoGroups" icon="refresh" label="admin.groups.refresh" disabled=refreshingAutoGroups}}
|
||||
{{else}}
|
||||
{{#link-to 'adminGroup' 'new' class="btn"}}
|
||||
{{fa-icon "plus"}} {{i18n 'admin.groups.new'}}
|
||||
{{d-icon "plus"}} {{i18n 'admin.groups.new'}}
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<p>
|
||||
{{i18n 'admin.logs.screened_emails.description'}}
|
||||
<button class="btn pull-right" {{action "exportScreenedEmailList"}} title="{{i18n 'admin.export_csv.button_title.screened_email'}}">{{fa-icon "download"}}{{i18n 'admin.export_csv.button_text'}}</button>
|
||||
<button class="btn pull-right" {{action "exportScreenedEmailList"}} title="{{i18n 'admin.export_csv.button_title.screened_email'}}">{{d-icon "download"}}{{i18n 'admin.export_csv.button_text'}}</button>
|
||||
</p>
|
||||
<br>
|
||||
|
||||
|
|
|
@ -41,9 +41,9 @@
|
|||
</div>
|
||||
<div class="col action">
|
||||
{{#if item.isBlocked}}
|
||||
{{fa-icon "ban"}}
|
||||
{{d-icon "ban"}}
|
||||
{{else}}
|
||||
{{fa-icon "check"}}
|
||||
{{d-icon "check"}}
|
||||
{{/if}}
|
||||
{{item.actionName}}
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<p>
|
||||
{{i18n 'admin.logs.screened_urls.description'}}
|
||||
<button class="btn pull-right" {{action "exportScreenedUrlList"}} title="{{i18n 'admin.export_csv.button_title.screened_url'}}">{{fa-icon "download"}}{{i18n 'admin.export_csv.button_text'}}</button>
|
||||
<button class="btn pull-right" {{action "exportScreenedUrlList"}} title="{{i18n 'admin.export_csv.button_title.screened_url'}}">{{d-icon "download"}}{{i18n 'admin.export_csv.button_text'}}</button>
|
||||
</p>
|
||||
<br>
|
||||
|
||||
|
|
|
@ -7,25 +7,25 @@
|
|||
{{#if actionFilter}}
|
||||
<a {{action "clearFilter" "actionFilter"}} class="filter">
|
||||
<span class="label">{{i18n 'admin.logs.action'}}</span>: {{actionFilter}}
|
||||
{{fa-icon "times-circle"}}
|
||||
{{d-icon "times-circle"}}
|
||||
</a>
|
||||
{{/if}}
|
||||
{{#if filters.acting_user}}
|
||||
<a {{action "clearFilter" "acting_user"}} class="filter">
|
||||
<span class="label">{{i18n 'admin.logs.staff_actions.staff_user'}}</span>: {{filters.acting_user}}
|
||||
{{fa-icon "times-circle"}}
|
||||
{{d-icon "times-circle"}}
|
||||
</a>
|
||||
{{/if}}
|
||||
{{#if filters.target_user}}
|
||||
<a {{action "clearFilter" "target_user"}} class="filter">
|
||||
<span class="label">{{i18n 'admin.logs.staff_actions.target_user'}}</span>: {{filters.target_user}}
|
||||
{{fa-icon "times-circle"}}
|
||||
{{d-icon "times-circle"}}
|
||||
</a>
|
||||
{{/if}}
|
||||
{{#if filters.subject}}
|
||||
<a {{action "clearFilter" "subject"}} class="filter">
|
||||
<span class="label">{{i18n 'admin.logs.staff_actions.subject'}}</span>: {{filters.subject}}
|
||||
{{fa-icon "times-circle"}}
|
||||
{{d-icon "times-circle"}}
|
||||
</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
{{#d-modal-body title="admin.flags.agree_flag_modal_title"}}
|
||||
{{#if model.user_deleted}}
|
||||
<button title="{{i18n 'admin.flags.agree_flag_restore_post_title'}}" {{action "agreeFlagRestorePost"}} class="btn"><i class="fa fa-thumbs-o-up"></i><i class="fa fa-eye"></i>{{i18n 'admin.flags.agree_flag_restore_post'}}</button>
|
||||
<button title={{i18n 'admin.flags.agree_flag_restore_post_title'}} {{action "agreeFlagRestorePost"}} class="btn">{{d-icon "thumbs-o-up"}}{{d-icon "eye"}}{{i18n 'admin.flags.agree_flag_restore_post'}}</button>
|
||||
{{else}}
|
||||
{{#unless model.postHidden}}
|
||||
<button title="{{i18n 'admin.flags.agree_flag_hide_post_title'}}" {{action "agreeFlagHidePost"}} class="btn"><i class="fa fa-thumbs-o-up"></i><i class="fa fa-eye-slash"></i>{{i18n 'admin.flags.agree_flag_hide_post'}}</button>
|
||||
<button title="{{i18n 'admin.flags.agree_flag_hide_post_title'}}" {{action "agreeFlagHidePost"}} class="btn">{{d-icon "thumbs-o-up"}}{{d-icon "eye-slash"}}{{i18n 'admin.flags.agree_flag_hide_post'}}</button>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
<button title="{{i18n 'admin.flags.agree_flag_title'}}" {{action "agreeFlagKeepPost"}} class="btn"><i class="fa fa-thumbs-o-up"></i>{{i18n 'admin.flags.agree_flag'}}</button>
|
||||
<button title="{{i18n 'admin.flags.agree_flag_title'}}" {{action "agreeFlagKeepPost"}} class="btn">{{d-icon "thumbs-o-up"}}{{i18n 'admin.flags.agree_flag'}}</button>
|
||||
{{#if model.canDeleteAsSpammer}}
|
||||
<button title="{{i18n 'admin.flags.delete_spammer_title'}}" {{action "deleteSpammer" model.user}} class="btn btn-danger"><i class="fa fa-exclamation-triangle"></i>{{i18n 'admin.flags.delete_spammer'}}</button>
|
||||
<button title="{{i18n 'admin.flags.delete_spammer_title'}}" {{action "deleteSpammer" model.user}} class="btn btn-danger">{{d-icon "exclamation-triangle"}}{{i18n 'admin.flags.delete_spammer'}}</button>
|
||||
{{/if}}
|
||||
{{/d-modal-body}}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
{{#if count_warning}}
|
||||
<div class="count-warning">
|
||||
<p class="heading"><i class="fa fa-warning"></i> {{i18n 'admin.badges.preview.bad_count_warning.header'}}</p>
|
||||
<p class="heading">{{d-icon "warning"}} {{i18n 'admin.badges.preview.bad_count_warning.header'}}</p>
|
||||
<p class="body">{{i18n 'admin.badges.preview.bad_count_warning.text'}}</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -7,6 +7,6 @@
|
|||
valueAttribute="base_scheme_id"}}
|
||||
{{/d-modal-body}}
|
||||
<div class="modal-footer">
|
||||
<button class='btn btn-primary' {{action "selectBase"}}>{{fa-icon 'plus'}}{{i18n 'admin.customize.new'}}</button>
|
||||
<button class='btn btn-primary' {{action "selectBase"}}>{{d-icon 'plus'}}{{i18n 'admin.customize.new'}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{#d-modal-body title="admin.flags.delete_flag_modal_title"}}
|
||||
<button title="{{i18n 'admin.flags.delete_post_defer_flag_title'}}" {{action "deletePostDeferFlag"}} class="btn"><i class="fa fa-trash-o"></i><i class="fa fa-external-link"></i>{{i18n 'admin.flags.delete_post_defer_flag'}}</button>
|
||||
<button title="{{i18n 'admin.flags.delete_post_agree_flag_title'}}" {{action "deletePostAgreeFlag"}} class="btn"><i class="fa fa-trash-o"></i><i class="fa fa-thumbs-o-up"></i>{{i18n 'admin.flags.delete_post_agree_flag'}}</button>
|
||||
<button title="{{i18n 'admin.flags.delete_post_defer_flag_title'}}" {{action "deletePostDeferFlag"}} class="btn">{{d-icon "trash-o"}}{{d-icon "external-link"}}{{i18n 'admin.flags.delete_post_defer_flag'}}</button>
|
||||
<button title="{{i18n 'admin.flags.delete_post_agree_flag_title'}}" {{action "deletePostAgreeFlag"}} class="btn">{{d-icon "trash-o"}}{{d-icon "thumbs-o-up"}}{{i18n 'admin.flags.delete_post_agree_flag'}}</button>
|
||||
{{#if model.canDeleteAsSpammer}}
|
||||
<button title="{{i18n 'admin.flags.delete_spammer_title'}}" {{action "deleteSpammer" model.user}} class="btn btn-danger"><i class="fa fa-exclamation-triangle"></i>{{i18n 'admin.flags.delete_spammer'}}</button>
|
||||
<button title="{{i18n 'admin.flags.delete_spammer_title'}}" {{action "deleteSpammer" model.user}} class="btn btn-danger">{{d-icon "exclamation-triangle"}}{{i18n 'admin.flags.delete_spammer'}}</button>
|
||||
{{/if}}
|
||||
{{/d-modal-body}}
|
||||
|
|
|
@ -5,15 +5,15 @@
|
|||
<li>
|
||||
{{#if wc.editing}}
|
||||
{{input value=wc.name}}
|
||||
<button {{action "save" wc}} class="btn no-text">{{fa-icon 'check'}}</button>
|
||||
<button {{action "save" wc}} class="btn no-text">{{d-icon 'check'}}</button>
|
||||
{{else}}
|
||||
{{wc.displayName}}
|
||||
{{/if}}
|
||||
<div class='actions'>
|
||||
<button {{action "edit" wc}} class="btn no-text" disabled={{wc.system}}>{{fa-icon 'pencil'}}</button>
|
||||
<button {{action "up" wc}} class="btn no-text">{{fa-icon 'toggle-up'}}</button>
|
||||
<button {{action "down" wc}} class="btn no-text">{{fa-icon 'toggle-down'}}</button>
|
||||
<button {{action "delete" wc}} class="btn no-text btn-danger" disabled={{wc.system}}>{{fa-icon 'times'}}</button>
|
||||
<button {{action "edit" wc}} class="btn no-text" disabled={{wc.system}}>{{d-icon 'pencil'}}</button>
|
||||
<button {{action "up" wc}} class="btn no-text">{{d-icon 'toggle-up'}}</button>
|
||||
<button {{action "down" wc}} class="btn no-text">{{d-icon 'toggle-down'}}</button>
|
||||
<button {{action "delete" wc}} class="btn no-text btn-danger" disabled={{wc.system}}>{{d-icon 'times'}}</button>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
{{/d-modal-body}}
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class='btn btn-danger' {{action "suspend"}} disabled={{submitDisabled}}><i class='fa fa-ban'></i>{{i18n 'admin.user.suspend'}}</button>
|
||||
<button class='btn btn-danger' {{action "suspend"}} disabled={{submitDisabled}}>{{d-icon "ban"}}{{i18n 'admin.user.suspend'}}</button>
|
||||
<a {{action "closeModal"}}>{{i18n 'cancel'}}</a>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
{{/save-controls}}
|
||||
|
||||
{{#link-to 'adminSiteText.index' class="go-back"}}
|
||||
{{fa-icon 'arrow-left'}}
|
||||
{{d-icon 'arrow-left'}}
|
||||
{{i18n 'admin.site_text.go_back'}}
|
||||
{{/link-to}}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class='admin-controls'>
|
||||
<div class='span15'>
|
||||
<ul class='nav nav-pills'>
|
||||
<li>{{#link-to 'adminUser' user}}<i class="fa fa-caret-left"></i> {{user.username}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUser' user}}{{d-icon "caret-left"}} {{user.username}}{{/link-to}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class='user-controls'>
|
||||
{{#if model.canViewProfile}}
|
||||
{{#link-to 'user' model class="btn"}}
|
||||
{{fa-icon "user"}}
|
||||
{{d-icon "user"}}
|
||||
{{i18n 'admin.user.show_public_profile'}}
|
||||
{{/link-to}}
|
||||
{{/if}}
|
||||
|
@ -151,7 +151,7 @@
|
|||
{{i18n 'badges.badge_count' count=model.badge_count}}
|
||||
</div>
|
||||
<div class='controls'>
|
||||
{{#link-to 'adminUser.badges' model class="btn"}}{{fa-icon "certificate"}}{{i18n 'admin.badges.edit_badges'}}{{/link-to}}
|
||||
{{#link-to 'adminUser.badges' model class="btn"}}{{d-icon "certificate"}}{{i18n 'admin.badges.edit_badges'}}{{/link-to}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -281,9 +281,11 @@
|
|||
<div class="controls">
|
||||
{{#if model.canLockTrustLevel}}
|
||||
{{#if model.trust_level_locked}}
|
||||
<i title='{{i18n 'admin.user.trust_level_locked_tip'}}' class='fa fa-lock'></i> {{d-button action="lockTrustLevel" actionParam=false label="admin.user.unlock_trust_level"}}
|
||||
{{d-icon "lock" title="admin.user.trust_level_locked_tip"}}
|
||||
{{d-button action="lockTrustLevel" actionParam=false label="admin.user.unlock_trust_level"}}
|
||||
{{else}}
|
||||
<i title='{{i18n 'admin.user.trust_level_unlocked_tip'}}' class='fa fa-unlock'></i> {{d-button action="lockTrustLevel" actionParam=true label="admin.user.lock_trust_level"}}
|
||||
{{d-icon "unlock" title="admin.user.trust_level_unlocked_tip"}}
|
||||
{{d-button action="lockTrustLevel" actionParam=true label="admin.user.lock_trust_level"}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{#if model.tl3Requirements}}
|
||||
|
@ -487,7 +489,7 @@
|
|||
<div class="clearfix"></div>
|
||||
<br/>
|
||||
<div class="pull-right">
|
||||
{{fa-icon "exclamation-triangle"}} {{model.deleteExplanation}}
|
||||
{{d-icon "exclamation-triangle"}} {{model.deleteExplanation}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</section>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class='admin-controls'>
|
||||
<div class='span15'>
|
||||
<ul class="nav nav-pills">
|
||||
<li>{{#link-to 'adminUser' model}}<i class="fa fa-caret-left"></i> {{model.username}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUser' model}}{{d-icon "caret-left"}} {{model.username}}{{/link-to}}</li>
|
||||
<li>{{#link-to 'adminUsersList.show' 'member'}}{{i18n 'admin.user.trust_level_2_users'}}{{/link-to}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<tbody>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.visits'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.days_visited 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.days_visited}}</td>
|
||||
<td>
|
||||
{{model.tl3Requirements.days_visited_percent}}% ({{model.tl3Requirements.days_visited}} / {{model.tl3Requirements.time_period}} {{i18n 'admin.user.tl3_requirements.days'}})
|
||||
</td>
|
||||
|
@ -32,67 +32,67 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.topics_replied_to'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.topics_replied_to 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.topics_replied_to}}</td>
|
||||
<td>{{model.tl3Requirements.num_topics_replied_to}}</td>
|
||||
<td>{{model.tl3Requirements.min_topics_replied_to}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.topics_viewed'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.topics_viewed 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.topics_viewed}}</td>
|
||||
<td>{{model.tl3Requirements.topics_viewed}}</td>
|
||||
<td>{{model.tl3Requirements.min_topics_viewed}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.topics_viewed_all_time'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.topics_viewed_all_time 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.topics_viewed_all_time}}</td>
|
||||
<td>{{model.tl3Requirements.topics_viewed_all_time}}</td>
|
||||
<td>{{model.tl3Requirements.min_topics_viewed_all_time}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.posts_read'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.posts_read 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.posts_read}}</td>
|
||||
<td>{{model.tl3Requirements.posts_read}}</td>
|
||||
<td>{{model.tl3Requirements.min_posts_read}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.posts_read_all_time'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.posts_read_all_time 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.posts_read_all_time}}</td>
|
||||
<td>{{model.tl3Requirements.posts_read_all_time}}</td>
|
||||
<td>{{model.tl3Requirements.min_posts_read_all_time}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.flagged_posts'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.flagged_posts 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.flagged_posts}}</td>
|
||||
<td>{{model.tl3Requirements.num_flagged_posts}}</td>
|
||||
<td>{{i18n 'max_of_count' count=model.tl3Requirements.max_flagged_posts}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.flagged_by_users'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.flagged_by_users 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.flagged_by_users}}</td>
|
||||
<td>{{model.tl3Requirements.num_flagged_by_users}}</td>
|
||||
<td>{{i18n 'max_of_count' count=model.tl3Requirements.max_flagged_by_users}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.likes_given'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.likes_given 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.likes_given}}</td>
|
||||
<td>{{model.tl3Requirements.num_likes_given}}</td>
|
||||
<td>{{model.tl3Requirements.min_likes_given}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.likes_received'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.likes_received 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.likes_received}}</td>
|
||||
<td>{{model.tl3Requirements.num_likes_received}}</td>
|
||||
<td>{{model.tl3Requirements.min_likes_received}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.likes_received_days'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.likes_received_days 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.likes_received_days}}</td>
|
||||
<td>{{model.tl3Requirements.num_likes_received_days}}</td>
|
||||
<td>{{model.tl3Requirements.min_likes_received_days}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{{i18n 'admin.user.tl3_requirements.likes_received_users'}}</th>
|
||||
<td><i class="fa {{if model.tl3Requirements.met.likes_received_users 'fa-check' 'fa-times'}}"></i></td>
|
||||
<td>{{check-icon model.tl3Requirements.met.likes_received_users}}</td>
|
||||
<td>{{model.tl3Requirements.num_likes_received_users}}</td>
|
||||
<td>{{model.tl3Requirements.min_likes_received_users}}</td>
|
||||
</tr>
|
||||
|
@ -105,16 +105,16 @@
|
|||
{{#if model.tl3Requirements.requirements_lost}}
|
||||
{{! tl implicitly not locked }}
|
||||
{{#if model.tl3Requirements.on_grace_period}}
|
||||
<i class="fa fa-times"></i> {{i18n 'admin.user.tl3_requirements.on_grace_period'}}
|
||||
{{d-icon "times"}} {{i18n 'admin.user.tl3_requirements.on_grace_period'}}
|
||||
{{else}} {{! not on grace period }}
|
||||
<i class="fa fa-times"></i> {{i18n 'admin.user.tl3_requirements.does_not_qualify'}}
|
||||
{{d-icon "times"}} {{i18n 'admin.user.tl3_requirements.does_not_qualify'}}
|
||||
{{i18n 'admin.user.tl3_requirements.will_be_demoted'}}
|
||||
{{/if}}
|
||||
{{else}} {{! requirements not lost - remains tl3 }}
|
||||
{{#if model.tl3Requirements.trust_level_locked}}
|
||||
<i class="fa fa-lock"></i> {{i18n 'admin.user.tl3_requirements.locked_will_not_be_demoted'}}
|
||||
{{d-icon "lock"}} {{i18n 'admin.user.tl3_requirements.locked_will_not_be_demoted'}}
|
||||
{{else}} {{! tl not locked }}
|
||||
<i class="fa fa-check"></i> {{i18n 'admin.user.tl3_requirements.qualifies'}}
|
||||
{{d-icon "check"}} {{i18n 'admin.user.tl3_requirements.qualifies'}}
|
||||
{{#if model.tl3Requirements.on_grace_period}}
|
||||
{{i18n 'admin.user.tl3_requirements.on_grace_period'}}
|
||||
{{/if}}
|
||||
|
@ -123,13 +123,13 @@
|
|||
{{else}} {{! is not tl3 }}
|
||||
{{#if model.tl3Requirements.requirements_met}}
|
||||
{{! met & not tl3 - will be promoted}}
|
||||
<i class="fa fa-check"></i> {{i18n 'admin.user.tl3_requirements.qualifies'}}
|
||||
{{d-icon "check"}} {{i18n 'admin.user.tl3_requirements.qualifies'}}
|
||||
{{i18n 'admin.user.tl3_requirements.will_be_promoted'}}
|
||||
{{else}} {{! requirements not met - remains regular }}
|
||||
{{#if model.tl3Requirements.trust_level_locked}}
|
||||
<i class="fa fa-lock"></i> {{i18n 'admin.user.tl3_requirements.locked_will_not_be_promoted'}}
|
||||
{{d-icon "lock"}} {{i18n 'admin.user.tl3_requirements.locked_will_not_be_promoted'}}
|
||||
{{else}}
|
||||
<i class="fa fa-times"></i> {{i18n 'admin.user.tl3_requirements.does_not_qualify'}}
|
||||
{{d-icon "times"}} {{i18n 'admin.user.tl3_requirements.does_not_qualify'}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
|
@ -92,10 +92,10 @@
|
|||
{{/if}}
|
||||
<td>
|
||||
{{#if user.admin}}
|
||||
{{fa-icon "shield" title="admin.title" }}
|
||||
{{d-icon "shield" title="admin.title" }}
|
||||
{{/if}}
|
||||
{{#if user.moderator}}
|
||||
{{fa-icon "shield" title="admin.moderator" }}
|
||||
{{d-icon "shield" title="admin.moderator" }}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{{#if versionCheck.noCheckPerformed}}
|
||||
<td class="version-number">—</td>
|
||||
<td class="face">
|
||||
<span class="icon critical-updates-available">{{fa-icon "frown-o"}}</span>
|
||||
<span class="icon critical-updates-available">{{d-icon "frown-o"}}</span>
|
||||
</td>
|
||||
<td class="version-notes">
|
||||
<span class="normal-note">{{i18n 'admin.dashboard.no_check_performed'}}</span>
|
||||
|
@ -28,9 +28,9 @@
|
|||
<td class="version-number">{{#if versionCheck.version_check_pending}}{{dash-if-empty versionCheck.installed_version}}{{/if}}</td>
|
||||
<td class="face">
|
||||
{{#if versionCheck.version_check_pending}}
|
||||
<span class='icon up-to-date'>{{fa-icon "smile-o"}}</span>
|
||||
<span class='icon up-to-date'>{{d-icon "smile-o"}}</span>
|
||||
{{else}}
|
||||
<span class="icon critical-updates-available">{{fa-icon "frown-o"}}</span>
|
||||
<span class="icon critical-updates-available">{{d-icon "frown-o"}}</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="version-notes">
|
||||
|
@ -46,13 +46,13 @@
|
|||
<td class="version-number">{{dash-if-empty versionCheck.latest_version}}</td>
|
||||
<td class="face">
|
||||
{{#if versionCheck.upToDate }}
|
||||
<span class='icon up-to-date'>{{fa-icon "smile-o"}}</span>
|
||||
<span class='icon up-to-date'>{{d-icon "smile-o"}}</span>
|
||||
{{else}}
|
||||
<span class="icon {{if versionCheck.critical_updates 'critical-updates-available' 'updates-available'}}">
|
||||
{{#if versionCheck.behindByOneVersion}}
|
||||
{{fa-icon "meh-o"}}
|
||||
{{d-icon "meh-o"}}
|
||||
{{else}}
|
||||
{{fa-icon "frown-o"}}
|
||||
{{d-icon "frown-o"}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<h2>{{model.name}}</h2>
|
||||
|
||||
<p class="about">{{actionDescription}}</p>
|
||||
|
||||
{{watched-word-form actionKey=actionNameKey action="recordAdded"}}
|
||||
|
||||
{{watched-word-uploader uploading=uploading actionKey=actionNameKey done="uploadComplete"}}
|
||||
|
||||
<div class='clearfix'></div>
|
||||
<div class="watched-words-list">
|
||||
{{#if showWordsList}}
|
||||
{{#each filteredContent as |word| }}
|
||||
<div class="watched-word-box">{{admin-watched-word word=word action="recordRemoved"}}</div>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
{{i18n 'admin.watched_words.word_count' count=model.words.length}}
|
||||
{{/if}}
|
||||
</div>
|
|
@ -0,0 +1,31 @@
|
|||
<div class='admin-controls'>
|
||||
<div class='search controls'>
|
||||
<label class="show-words-checkbox">
|
||||
{{input type="checkbox" checked=showWords disabled=disableShowWords}}
|
||||
{{i18n 'admin.watched_words.show_words'}}
|
||||
</label>
|
||||
</div>
|
||||
<div class='controls'>
|
||||
{{text-field value=filter placeholderKey="admin.watched_words.search" class="no-blur"}}
|
||||
{{d-button action="clearFilter" label="admin.watched_words.clear_filter"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin-nav pull-left">
|
||||
<ul class="nav nav-stacked">
|
||||
{{#each model as |action|}}
|
||||
{{#link-to 'adminWatchedWords.action' action.nameKey tagName='li' class=action.nameKey}}
|
||||
{{#link-to 'adminWatchedWords.action' action.nameKey}}
|
||||
{{action.name}}
|
||||
{{#if action.count}}<span class="count">({{action.count}})</span>{{/if}}
|
||||
{{/link-to}}
|
||||
{{/link-to}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="admin-detail pull-left mobile-closed watched-words-detail">
|
||||
{{outlet}}
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
|
@ -1,10 +1,10 @@
|
|||
<div class="web-hook-direction">
|
||||
{{#link-to 'adminWebHooks' tagName='button' classNames='btn'}}
|
||||
{{fa-icon 'list'}} {{i18n 'admin.web_hooks.events.go_list'}}
|
||||
{{d-icon 'list'}} {{i18n 'admin.web_hooks.events.go_list'}}
|
||||
{{/link-to}}
|
||||
{{d-button icon="send" label="admin.web_hooks.events.ping" action="ping" disabled=pingDisabled}}
|
||||
{{#link-to 'adminWebHooks.show' model.extras.web_hook_id tagName='button' classNames='btn'}}
|
||||
{{fa-icon 'edit'}} {{i18n 'admin.web_hooks.events.go_details'}}
|
||||
{{d-icon 'edit'}} {{i18n 'admin.web_hooks.events.go_details'}}
|
||||
{{/link-to}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{{#link-to 'adminWebHooks' class="go-back"}}
|
||||
{{fa-icon 'arrow-left'}}
|
||||
{{d-icon 'arrow-left'}}
|
||||
{{i18n 'admin.web_hooks.go_back'}}
|
||||
{{/link-to}}
|
||||
|
||||
|
@ -49,12 +49,12 @@
|
|||
|
||||
<div class='filters'>
|
||||
<div>
|
||||
<label>{{fa-icon 'circle' class='tracking'}}{{i18n 'admin.web_hooks.categories_filter'}}</label>
|
||||
<label>{{d-icon 'circle' class='tracking'}}{{i18n 'admin.web_hooks.categories_filter'}}</label>
|
||||
{{category-selector categories=model.categories blacklist=model.categories}}
|
||||
<div class="instructions">{{i18n 'admin.web_hooks.categories_filter_instructions'}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<label>{{fa-icon 'circle' class='tracking'}}{{i18n 'admin.web_hooks.groups_filter'}}</label>
|
||||
<label>{{d-icon 'circle' class='tracking'}}{{i18n 'admin.web_hooks.groups_filter'}}</label>
|
||||
{{group-selector groupNames=model.groupsFilterInName groupFinder=model.groupFinder}}
|
||||
<div class="instructions">{{i18n 'admin.web_hooks.groups_filter_instructions'}}</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class='pull-right'>
|
||||
{{#link-to 'adminWebHooks.show' 'new' tagName='button' classNames='btn'}}
|
||||
{{fa-icon 'plus'}} {{i18n 'admin.web_hooks.new'}}
|
||||
{{d-icon 'plus'}} {{i18n 'admin.web_hooks.new'}}
|
||||
{{/link-to}}
|
||||
</div>
|
||||
<div class='clearfix'></div>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<td>{{#link-to 'adminWebHooks.show' webHook}}{{webHook.payload_url}}{{/link-to}}</td>
|
||||
<td class='description'>{{webHook.description}}</td>
|
||||
<td class='controls'>
|
||||
{{#link-to 'adminWebHooks.show' webHook tagName='button' classNames='btn btn-default no-text'}}{{fa-icon 'edit'}}{{/link-to}}
|
||||
{{#link-to 'adminWebHooks.show' webHook tagName='button' classNames='btn btn-default no-text'}}{{d-icon 'edit'}}{{/link-to}}
|
||||
{{d-button class="destroy btn-danger" action='destroy' actionParam=webHook icon="remove"}}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
import { on, observes } from 'ember-addons/ember-computed-decorators';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
tagName: 'select',
|
||||
|
@ -97,7 +98,7 @@ export default Ember.Component.extend(bufferedRender({
|
|||
this.selectionTemplate = (item) => {
|
||||
let name = Em.get(item, 'text');
|
||||
name = Handlebars.escapeExpression(name);
|
||||
return `<i class='fa fa-${this.get("selectionIcon")}'></i>${name}`;
|
||||
return iconHTML(this.get('selectionIcon')) + name;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
import { registerUnbound } from 'discourse-common/lib/helpers';
|
||||
import { renderIcon } from 'discourse-common/lib/icon-library';
|
||||
|
||||
registerUnbound('d-icon', function(id, params) {
|
||||
return new Handlebars.SafeString(renderIcon('string', id, params));
|
||||
});
|
|
@ -1,25 +1,12 @@
|
|||
import { registerUnbound } from 'discourse-common/lib/helpers';
|
||||
import { renderIcon } from 'discourse-common/lib/icon-library';
|
||||
import deprecated from 'discourse-common/lib/deprecated';
|
||||
|
||||
export function iconClasses(icon, params) {
|
||||
let classes = "fa fa-" + icon;
|
||||
if (params.modifier) { classes += " fa-" + params.modifier; }
|
||||
if (params['class']) { classes += ' ' + params['class']; }
|
||||
return classes;
|
||||
}
|
||||
|
||||
export function iconHTML(icon, params) {
|
||||
params = params || {};
|
||||
|
||||
var html = "<i class='" + iconClasses(icon, params) + "'";
|
||||
if (params.title) { html += ` title='${I18n.t(params.title)}'`; }
|
||||
if (params.label) { html += " aria-hidden='true'"; }
|
||||
html += "></i>";
|
||||
if (params.label) {
|
||||
html += "<span class='sr-only'>" + I18n.t(params.label) + "</span>";
|
||||
}
|
||||
return html;
|
||||
export function iconHTML(id, params) {
|
||||
return renderIcon('string', id, params);
|
||||
}
|
||||
|
||||
registerUnbound('fa-icon', function(icon, params) {
|
||||
deprecated("Use `{{d-icon}}` instead of `{{fa-icon}}");
|
||||
return new Handlebars.SafeString(iconHTML(icon, params));
|
||||
});
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
import { h } from 'virtual-dom';
|
||||
let _renderers = [];
|
||||
|
||||
export function renderIcon(renderType, id, params) {
|
||||
for (let i=0; i<_renderers.length; i++) {
|
||||
let renderer = _renderers[i];
|
||||
let rendererForType = renderer[renderType];
|
||||
|
||||
if (rendererForType) {
|
||||
let result = rendererForType(id, params || {});
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function iconHTML(id, params) {
|
||||
return renderIcon('string', id, params);
|
||||
}
|
||||
|
||||
export function iconNode(id, params) {
|
||||
return renderIcon('node', id, params);
|
||||
}
|
||||
|
||||
export function registerIconRenderer(renderer) {
|
||||
_renderers.unshift(renderer);
|
||||
}
|
||||
|
||||
// Support for font awesome icons
|
||||
function faClasses(id, params) {
|
||||
let classNames = `fa fa-${id} d-icon d-icon-${id}`;
|
||||
if (params) {
|
||||
if (params.modifier) { classNames += " fa-" + params.modifier; }
|
||||
if (params['class']) { classNames += ' ' + params['class']; }
|
||||
}
|
||||
return classNames;
|
||||
}
|
||||
|
||||
// default resolver is font awesome
|
||||
registerIconRenderer({
|
||||
name: 'font-awesome',
|
||||
|
||||
string(id, params) {
|
||||
let tagName = params.tagName || 'i';
|
||||
let html = `<${tagName} class='${faClasses(id, params)}'`;
|
||||
if (params.title) { html += ` title='${I18n.t(params.title)}'`; }
|
||||
if (params.label) { html += " aria-hidden='true'"; }
|
||||
html += `></${tagName}>`;
|
||||
if (params.label) {
|
||||
html += "<span class='sr-only'>" + I18n.t(params.label) + "</span>";
|
||||
}
|
||||
return html;
|
||||
},
|
||||
|
||||
node(id, params) {
|
||||
let tagName = params.tagName || 'i';
|
||||
|
||||
const properties = {
|
||||
className: faClasses(id, params),
|
||||
attributes: { "aria-hidden": true }
|
||||
};
|
||||
|
||||
if (params.title) { properties.attributes.title = params.title; }
|
||||
if (params.label) {
|
||||
return h(tagName, properties, h('span.sr-only', I18n.t(params.label)));
|
||||
} else {
|
||||
return h(tagName, properties);
|
||||
}
|
||||
}
|
||||
});
|
|
@ -1,3 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { default as computed, observes } from "ember-addons/ember-computed-decorators";
|
||||
import Combobox from 'discourse-common/components/combo-box';
|
||||
import { CLOSE_STATUS_TYPE } from 'discourse/controllers/edit-topic-timer';
|
||||
|
@ -111,9 +112,7 @@ export default Combobox.extend({
|
|||
let icons;
|
||||
|
||||
if (icon) {
|
||||
icons = icon.split(',').map(i => {
|
||||
return `<i class='fa fa-${i}'/>`;
|
||||
}).join(" ");
|
||||
icons = icon.split(',').map(i => iconHTML(i)).join(" ");
|
||||
}
|
||||
|
||||
if (time) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import DropdownButton from 'discourse/components/dropdown-button';
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
|
@ -15,14 +15,14 @@ export default DropdownButton.extend({
|
|||
{ id: 'create',
|
||||
title: I18n.t('category.create'),
|
||||
description: I18n.t('category.create_long'),
|
||||
styleClasses: 'fa fa-plus' }
|
||||
icon: 'plus' }
|
||||
];
|
||||
if (includeReorder) {
|
||||
items.push({
|
||||
id: 'reorder',
|
||||
title: I18n.t('categories.reorder.title'),
|
||||
description: I18n.t('categories.reorder.title_long'),
|
||||
styleClasses: 'fa fa-random'
|
||||
icon: 'random'
|
||||
});
|
||||
}
|
||||
return items;
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { setting } from 'discourse/lib/computed';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
var get = Ember.get;
|
||||
|
||||
export default Ember.Component.extend({
|
||||
|
@ -8,10 +10,10 @@ export default Ember.Component.extend({
|
|||
|
||||
tagName: 'li',
|
||||
|
||||
iconClass: function() {
|
||||
if (this.get('expanded')) { return "fa fa-caret-down"; }
|
||||
return "fa fa-caret-right";
|
||||
}.property('expanded'),
|
||||
@computed('expanded')
|
||||
expandIcon(expanded) {
|
||||
return expanded ? 'caret-down' : 'caret-right';
|
||||
},
|
||||
|
||||
allCategoriesUrl: function() {
|
||||
if (this.get('subCategory')) {
|
||||
|
@ -33,7 +35,7 @@ export default Ember.Component.extend({
|
|||
}.property('category'),
|
||||
|
||||
dropdownButtonClass: function() {
|
||||
var result = 'badge-category category-dropdown-button';
|
||||
let result = 'dropdown-header category-dropdown-button';
|
||||
if (Em.isNone(this.get('category'))) {
|
||||
result += ' home';
|
||||
}
|
||||
|
@ -57,21 +59,35 @@ export default Ember.Component.extend({
|
|||
}.property('category'),
|
||||
|
||||
badgeStyle: function() {
|
||||
var category = this.get('category');
|
||||
let category = this.get('category');
|
||||
|
||||
const categoryStyle = this.siteSettings.category_style;
|
||||
if (categoryStyle === 'bullet') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (category) {
|
||||
var color = get(category, 'color'),
|
||||
textColor = get(category, 'text_color');
|
||||
let color = get(category, 'color');
|
||||
let textColor = get(category, 'text_color');
|
||||
|
||||
if (color || textColor) {
|
||||
var style = "";
|
||||
if (color) { style += "background-color: #" + color + "; border-color: #" + color + ";"; }
|
||||
let style = "";
|
||||
if (color) {
|
||||
if (categoryStyle === "bar") {
|
||||
style += `border-color: #${color};`;
|
||||
} else if (categoryStyle === "box") {
|
||||
style += `background-color: #${color};`;
|
||||
if (textColor) { style += "color: #" + textColor + "; "; }
|
||||
}
|
||||
}
|
||||
|
||||
return style.htmlSafe();
|
||||
}
|
||||
}
|
||||
|
||||
if (categoryStyle === 'box') {
|
||||
return "background-color: #eee; color: #333".htmlSafe();
|
||||
}
|
||||
}.property('category'),
|
||||
|
||||
clickEventName: function() {
|
||||
|
|
|
@ -589,9 +589,10 @@ export default Ember.Component.extend({
|
|||
|
||||
if (post.length > 0) {
|
||||
post = post.replace(/^\n*/, "\n\n");
|
||||
} else {
|
||||
post = "\n";
|
||||
}
|
||||
|
||||
|
||||
const value = pre + text + post;
|
||||
const $textarea = this.$('textarea.d-editor-input');
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import { on } from "ember-addons/ember-computed-decorators";
|
|||
|
||||
export default Ember.Component.extend({
|
||||
elementId: 'discourse-modal',
|
||||
classNameBindings: [':modal', ':hidden', 'modalClass'],
|
||||
classNameBindings: [':modal', 'modalClass'],
|
||||
attributeBindings: ['data-keyboard'],
|
||||
|
||||
// We handle ESC ourselves
|
||||
|
@ -17,6 +17,7 @@ export default Ember.Component.extend({
|
|||
});
|
||||
|
||||
this.appEvents.on('modal:body-shown', data => {
|
||||
this.$().removeClass('hidden');
|
||||
if (data.title) {
|
||||
this.set('title', I18n.t(data.title));
|
||||
} else if (data.rawTitle) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
|
@ -29,7 +30,7 @@ export default Ember.Component.extend(bufferedRender({
|
|||
buffer.push("<h4 class='title'>" + title + "</h4>");
|
||||
}
|
||||
|
||||
buffer.push(`<button class='btn standard dropdown-toggle ${this.get('buttonExtraClasses')}' data-toggle='dropdown'>${this.get('text')}</button>`);
|
||||
buffer.push(`<button class='btn standard dropdown-toggle ${this.get('buttonExtraClasses') || ''}' data-toggle='dropdown'>${this.get('text')}</button>`);
|
||||
buffer.push("<ul class='dropdown-menu'>");
|
||||
|
||||
const contents = this.get('dropDownContent');
|
||||
|
@ -40,7 +41,15 @@ export default Ember.Component.extend(bufferedRender({
|
|||
className = (self.get('activeItem') === id ? 'disabled': '');
|
||||
|
||||
buffer.push("<li data-id=\"" + id + "\" class=\"" + className + "\"><a href>");
|
||||
buffer.push("<span class='icon " + row.styleClasses + "'></span>");
|
||||
|
||||
if (row.icon) {
|
||||
let iconClass = 'icon';
|
||||
if (row.iconClass) {
|
||||
iconClass += ` ${row.iconClass}`;
|
||||
}
|
||||
buffer.push(iconHTML(row.icon, { tagName: 'span', class: iconClass }));
|
||||
}
|
||||
|
||||
buffer.push("<div><span class='title'>" + row.title + "</span>");
|
||||
buffer.push("<span>" + row.description + "</span></div>");
|
||||
buffer.push("</a></li>");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { on } from 'ember-addons/ember-computed-decorators';
|
||||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import LogsNotice from 'discourse/services/logs-notice';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
|
|
|
@ -4,6 +4,7 @@ import { propertyEqual } from 'discourse/lib/computed';
|
|||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ["group-members-input"],
|
||||
addButton: true,
|
||||
|
||||
@computed('model.limit', 'model.offset', 'model.user_count')
|
||||
currentPage(limit, offset, userCount) {
|
||||
|
|
|
@ -5,9 +5,14 @@ import DiscourseURL from 'discourse/lib/url';
|
|||
export default Ember.Component.extend({
|
||||
loading: false,
|
||||
|
||||
@computed("model.public")
|
||||
canJoinGroup(publicGroup) {
|
||||
return publicGroup;
|
||||
@computed("model.public_admission", "userIsGroupUser")
|
||||
canJoinGroup(publicAdmission, userIsGroupUser) {
|
||||
return publicAdmission && !userIsGroupUser;
|
||||
},
|
||||
|
||||
@computed("model.public_exit", "userIsGroupUser")
|
||||
canLeaveGroup(publicExit, userIsGroupUser) {
|
||||
return publicExit && userIsGroupUser;
|
||||
},
|
||||
|
||||
@computed("model.is_group_user", "model.id", "groupUserIds")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export default Ember.Component.extend({
|
||||
didInsertElement() {
|
||||
this._super();
|
||||
$('#discourse-modal').modal('hide');
|
||||
$('#discourse-modal').modal('hide').addClass('hidden');
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
classNameBindings: [':tip', 'good', 'bad'],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import DropdownButton from 'discourse/components/dropdown-button';
|
||||
import { allLevels, buttonDetails } from 'discourse/lib/notification-levels';
|
||||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default DropdownButton.extend({
|
||||
|
@ -22,7 +22,8 @@ export default DropdownButton.extend({
|
|||
id: l.id,
|
||||
title: I18n.t(`${start}.title`),
|
||||
description: I18n.t(`${start}.description`),
|
||||
styleClasses: `${l.key.dasherize()} fa fa-${l.icon}`
|
||||
icon: l.icon,
|
||||
iconClass: l.key.dasherize(),
|
||||
};
|
||||
});
|
||||
},
|
||||
|
|
|
@ -25,7 +25,7 @@ export default Ember.Component.extend(CleansUp, {
|
|||
|
||||
if (!this.get('showPeriods')) {
|
||||
if (!this.site.mobileView) {
|
||||
const $chevron = this.$('i.fa-caret-down');
|
||||
const $chevron = this.$('.d-icon-caret-down');
|
||||
this.$('#period-popup').css($chevron.position());
|
||||
} else {
|
||||
this.$('#period-popup').css({top: this.$().height()});
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import DropdownButton from 'discourse/components/dropdown-button';
|
||||
|
||||
export default DropdownButton.extend({
|
||||
|
@ -28,21 +30,28 @@ export default DropdownButton.extend({
|
|||
{id: 'pinned',
|
||||
title: I18n.t('topic_statuses.pinned' + globally + '.title'),
|
||||
description: I18n.t('topic_statuses.pinned' + globally + '.help'),
|
||||
styleClasses: 'fa fa-thumb-tack' },
|
||||
icon: 'thumb-tack' },
|
||||
{id: 'unpinned',
|
||||
title: I18n.t('topic_statuses.unpinned.title'),
|
||||
description: I18n.t('topic_statuses.unpinned.help'),
|
||||
styleClasses: 'fa fa-thumb-tack unpinned' }
|
||||
icon: 'thumb-tack',
|
||||
iconClass: 'unpinned' }
|
||||
];
|
||||
}.property(),
|
||||
|
||||
text: function() {
|
||||
const globally = this.get('topic.pinned_globally') ? '_globally' : '';
|
||||
const state = this.get('topic.pinned') ? 'pinned' + globally : 'unpinned';
|
||||
@computed('topic.pinned', 'topic.pinned_globally')
|
||||
text(pinned, pinnedGlobally) {
|
||||
const globally = pinnedGlobally ? '_globally' : '';
|
||||
const state = pinned ? 'pinned' + globally : 'unpinned';
|
||||
|
||||
return '<span class="fa fa-thumb-tack' + (state === 'unpinned' ? ' unpinned' : "") + '"></span> ' +
|
||||
const icon = iconHTML(
|
||||
'thumb-tack',
|
||||
{ tagName: 'span', class: (state === 'unpinned' ? 'unpinned' : null) }
|
||||
);
|
||||
|
||||
return icon +
|
||||
I18n.t('topic_statuses.' + state + '.title') + "<span class='caret'></span>";
|
||||
}.property('topic.pinned', 'topic.unpinned'),
|
||||
},
|
||||
|
||||
clicked(id) {
|
||||
const topic = this.get('topic');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { default as computed, observes } from 'ember-addons/ember-computed-decorators';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
|
||||
|
|
|
@ -21,9 +21,8 @@ export default Ember.Component.extend({
|
|||
},
|
||||
|
||||
@computed('expanded')
|
||||
iconClass() {
|
||||
if (this.get('expanded')) { return "fa fa-caret-down"; }
|
||||
return "fa fa-caret-right";
|
||||
expandedIcon(expanded) {
|
||||
return expanded ? 'caret-down' : 'caret-right';
|
||||
},
|
||||
|
||||
@computed('tagId')
|
||||
|
@ -70,7 +69,7 @@ export default Ember.Component.extend({
|
|||
|
||||
@computed('tag')
|
||||
dropdownButtonClass() {
|
||||
var result = 'badge-category category-dropdown-button';
|
||||
let result = 'dropdown-header category-dropdown-button';
|
||||
if (Em.isNone(this.get('tag'))) {
|
||||
result += ' home';
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import DropdownButton from 'discourse/components/dropdown-button';
|
||||
import computed from "ember-addons/ember-computed-decorators";
|
||||
|
||||
|
@ -14,7 +14,7 @@ export default DropdownButton.extend({
|
|||
{ id: 'manageGroups',
|
||||
title: I18n.t('tagging.manage_groups'),
|
||||
description: I18n.t('tagging.manage_groups_description'),
|
||||
styleClasses: 'fa fa-wrench' }
|
||||
icon: 'wrench' }
|
||||
];
|
||||
return items;
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import Combobox from 'discourse-common/components/combo-box';
|
||||
import { observes } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
import { escapeExpression } from 'discourse/lib/utilities';
|
||||
|
||||
|
@ -8,7 +8,7 @@ export default Ember.Component.extend(bufferedRender({
|
|||
rerenderTriggers: ['topic.archived', 'topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned', 'topic.is_warning'],
|
||||
|
||||
click(e) {
|
||||
if ($(e.target).hasClass('fa-thumb-tack')) {
|
||||
if ($(e.target).hasClass('d-icon-thumb-tack')) {
|
||||
const topic = this.get('topic');
|
||||
|
||||
// only pin unpin for now
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
import Category from 'discourse/models/category';
|
||||
|
||||
|
@ -35,7 +36,7 @@ export default Ember.Component.extend(bufferedRender({
|
|||
|
||||
let autoCloseHours = this.get("duration") || 0;
|
||||
|
||||
buffer.push('<h3><i class="fa fa-clock-o"></i> ');
|
||||
buffer.push(`<h3>${iconHTML('clock-o')} `);
|
||||
|
||||
let options = {
|
||||
timeLeft: duration.humanize(true),
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||
import ActionSummary from 'discourse/models/action-summary';
|
||||
import { MAX_MESSAGE_LENGTH } from 'discourse/models/post-action-type';
|
||||
|
@ -83,9 +84,9 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
|
||||
submitText: function(){
|
||||
if (this.get('selected.is_custom_flag')) {
|
||||
return "<i class='fa fa-envelope'></i>" + (I18n.t(this.get('flagTopic') ? "flagging_topic.notify_action" : "flagging.notify_action"));
|
||||
return iconHTML('envelope') + (I18n.t(this.get('flagTopic') ? "flagging_topic.notify_action" : "flagging.notify_action"));
|
||||
} else {
|
||||
return "<i class='fa fa-flag'></i>" + (I18n.t(this.get('flagTopic') ? "flagging_topic.action" : "flagging.action"));
|
||||
return iconHTML('flag') + (I18n.t(this.get('flagTopic') ? "flagging_topic.action" : "flagging.action"));
|
||||
}
|
||||
}.property('selected.is_custom_flag'),
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { default as computed, observes } from 'ember-addons/ember-computed-decor
|
|||
import Category from 'discourse/models/category';
|
||||
import { escapeExpression } from 'discourse/lib/utilities';
|
||||
import { setTransient } from 'discourse/lib/page-tracker';
|
||||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
|
||||
const SortOrders = [
|
||||
{name: I18n.t('search.relevance'), id: 0},
|
||||
|
|
|
@ -48,6 +48,11 @@ export default Ember.Controller.extend({
|
|||
};
|
||||
},
|
||||
|
||||
@computed("model.mentionable")
|
||||
displayGroupMessageButton(mentionable) {
|
||||
return this.currentUser && mentionable;
|
||||
},
|
||||
|
||||
@observes('model.user_count')
|
||||
_setMembersTabCount() {
|
||||
this.get('tabs')[0].set('count', this.get('model.user_count'));
|
||||
|
@ -66,5 +71,11 @@ export default Ember.Controller.extend({
|
|||
|
||||
return canSee;
|
||||
});
|
||||
},
|
||||
|
||||
actions: {
|
||||
messageGroup() {
|
||||
this.send('createNewMessageViaParams', this.get('model.name'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import CanCheckEmails from 'discourse/mixins/can-check-emails';
|
||||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
import PreferencesTabController from "discourse/mixins/preferences-tab-controller";
|
||||
|
@ -81,7 +82,7 @@ export default Ember.Controller.extend(CanCheckEmails, PreferencesTabController,
|
|||
link: true,
|
||||
callback: () => { this.set('deleting', false); }
|
||||
},
|
||||
{ label: '<i class="fa fa-exclamation-triangle"></i> ' + I18n.t("user.delete_account"),
|
||||
{ label: iconHTML('exclamation-triangle') + I18n.t("user.delete_account"),
|
||||
class: "btn btn-danger",
|
||||
callback() {
|
||||
model.delete().then(function() {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||
import PreferencesTabController from "discourse/mixins/preferences-tab-controller";
|
||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
import { cook } from 'discourse/lib/text';
|
||||
import { cookAsync } from 'discourse/lib/text';
|
||||
|
||||
export default Ember.Controller.extend(PreferencesTabController, {
|
||||
|
||||
|
@ -57,10 +57,13 @@ export default Ember.Controller.extend(PreferencesTabController, {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return model.save(this.get('saveAttrNames')).then(() => {
|
||||
model.set('bio_cooked', cook(model.get('bio_raw')));
|
||||
cookAsync(model.get('bio_raw')).then(()=>{
|
||||
model.set('bio_cooked', );
|
||||
this.set('saved', true);
|
||||
}).catch(popupAjaxError);
|
||||
}).catch(popupAjaxError);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import BufferedContent from 'discourse/mixins/buffered-content';
|
||||
import SelectedPostsCount from 'discourse/mixins/selected-posts-count';
|
||||
import { spinnerHTML } from 'discourse/helpers/loading-spinner';
|
||||
|
@ -113,7 +114,7 @@ export default Ember.Controller.extend(SelectedPostsCount, BufferedContent, {
|
|||
@computed('model')
|
||||
suggestedTitle(model) {
|
||||
return model.get('isPrivateMessage') ?
|
||||
`<a href="${this.get('pmPath')}"><i class='private-message-glyph fa fa-envelope'></i></a> ${I18n.t("suggested_topics.pm_title")}` :
|
||||
`<a href="${this.get('pmPath')}">${iconHTML('envelope', { class: 'private-message-glyph' })}</a> ${I18n.t("suggested_topics.pm_title")}` :
|
||||
I18n.t("suggested_topics.title");
|
||||
},
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { registerUnbound } from 'discourse-common/lib/helpers';
|
||||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
|
||||
var get = Em.get,
|
||||
escapeExpression = Handlebars.Utils.escapeExpression;
|
||||
|
@ -24,20 +24,20 @@ export function categoryBadgeHTML(category, opts) {
|
|||
|
||||
if ((!category) ||
|
||||
(!opts.allowUncategorized &&
|
||||
Em.get(category, 'id') === Discourse.Site.currentProp("uncategorized_category_id") &&
|
||||
Ember.get(category, 'id') === Discourse.Site.currentProp("uncategorized_category_id") &&
|
||||
Discourse.SiteSettings.suppress_uncategorized_badge
|
||||
)
|
||||
) return "";
|
||||
|
||||
var description = get(category, 'description_text'),
|
||||
restricted = get(category, 'read_restricted'),
|
||||
url = opts.url ? opts.url : Discourse.getURL("/c/") + Discourse.Category.slugFor(category),
|
||||
href = (opts.link === false ? '' : url),
|
||||
tagName = (opts.link === false || opts.link === "false" ? 'span' : 'a'),
|
||||
extraClasses = (opts.extraClasses ? (' ' + opts.extraClasses) : ''),
|
||||
color = get(category, 'color'),
|
||||
html = "",
|
||||
parentCat = null;
|
||||
let description = get(category, 'description_text');
|
||||
let restricted = get(category, 'read_restricted');
|
||||
let url = opts.url ? opts.url : Discourse.getURL("/c/") + Discourse.Category.slugFor(category);
|
||||
let href = (opts.link === false ? '' : url);
|
||||
let tagName = (opts.link === false || opts.link === "false" ? 'span' : 'a');
|
||||
let extraClasses = (opts.extraClasses ? (' ' + opts.extraClasses) : '');
|
||||
let color = get(category, 'color');
|
||||
let html = "";
|
||||
let parentCat = null;
|
||||
|
||||
if (!opts.hideParent) {
|
||||
parentCat = Discourse.Category.findById(get(category, 'parent_category_id'));
|
||||
|
@ -49,32 +49,36 @@ export function categoryBadgeHTML(category, opts) {
|
|||
|
||||
html += categoryStripe(color, "badge-category-bg");
|
||||
|
||||
var classNames = "badge-category clear-badge";
|
||||
let classNames = "badge-category clear-badge";
|
||||
if (restricted) { classNames += " restricted"; }
|
||||
|
||||
var textColor = "#" + get(category, 'text_color');
|
||||
const categoryStyle = Discourse.SiteSettings.category_style;
|
||||
|
||||
html += "<span" + ' style="color: ' + textColor + ';" '+
|
||||
let style = "";
|
||||
if (categoryStyle === "box") {
|
||||
style = `style="color: #${get(category, 'text_color')};"`;
|
||||
}
|
||||
|
||||
html += `<span ${style} ` +
|
||||
'data-drop-close="true" class="' + classNames + '"' +
|
||||
(description ? 'title="' + escapeExpression(description) + '" ' : '') +
|
||||
">";
|
||||
|
||||
var name = escapeExpression(get(category, 'name'));
|
||||
let categoryName = escapeExpression(get(category, 'name'));
|
||||
|
||||
if (restricted) {
|
||||
html += iconHTML('lock') + " " + name;
|
||||
html += iconHTML('lock') + " " + categoryName;
|
||||
} else {
|
||||
html += name;
|
||||
html += categoryName;
|
||||
}
|
||||
html += "</span>";
|
||||
|
||||
if(href){
|
||||
href = " href='" + href + "' ";
|
||||
if (href) {
|
||||
href = ` href="${href}" `;
|
||||
}
|
||||
|
||||
extraClasses = Discourse.SiteSettings.category_style ? Discourse.SiteSettings.category_style + extraClasses : extraClasses;
|
||||
|
||||
return "<" + tagName + " class='badge-wrapper " + extraClasses + "' " + href + ">" + html + "</" + tagName + ">";
|
||||
extraClasses = categoryStyle ? categoryStyle + extraClasses : extraClasses;
|
||||
return `<${tagName} class="badge-wrapper ${extraClasses}" ${href}>${html}</${tagName}>`;
|
||||
}
|
||||
|
||||
export function categoryLinkHTML(category, options) {
|
||||
|
|
|
@ -1,20 +1,5 @@
|
|||
import { h } from 'virtual-dom';
|
||||
import { iconClasses } from 'discourse-common/helpers/fa-icon';
|
||||
import { renderIcon } from 'discourse-common/lib/icon-library';
|
||||
|
||||
export function iconNode(icon, params) {
|
||||
params = params || {};
|
||||
|
||||
const properties = {
|
||||
className: iconClasses(icon, params),
|
||||
attributes: { "aria-hidden": true }
|
||||
};
|
||||
|
||||
if (params.title) { properties.attributes.title = params.title; }
|
||||
|
||||
if (params.label) {
|
||||
return h('i', properties, h('span.sr-only', I18n.t(params.label)));
|
||||
} else {
|
||||
return h('i', properties);
|
||||
}
|
||||
export function iconNode(id, params) {
|
||||
return renderIcon('node', id, params);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { htmlHelper } from 'discourse-common/lib/helpers';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
|
||||
export default htmlHelper(function(str) {
|
||||
if (Ember.isEmpty(str)) { return ""; }
|
||||
return (str.indexOf('fa-') === 0) ? `<i class='fa ${str}'></i>` : `<img src='${str}'>`;
|
||||
return (str.indexOf('fa-') === 0) ? iconHTML(str.replace('fa-', '')) : `<img src='${str}'>`;
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { iconHTML } from 'discourse-common/helpers/fa-icon';
|
||||
import { iconHTML } from 'discourse-common/lib/icon-library';
|
||||
import { htmlHelper } from 'discourse-common/lib/helpers';
|
||||
import { escapeExpression } from 'discourse/lib/utilities';
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue