Version bump
This commit is contained in:
commit
651886be58
@ -9,7 +9,7 @@ env:
|
||||
- "RAILS_MASTER=1"
|
||||
|
||||
addons:
|
||||
postgresql: 9.3
|
||||
postgresql: 9.5
|
||||
apt:
|
||||
packages:
|
||||
- gifsicle
|
||||
@ -40,6 +40,7 @@ before_install:
|
||||
- gem install bundler
|
||||
- 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
|
||||
- npm i -g eslint babel-eslint
|
||||
- eslint app/assets/javascripts
|
||||
- eslint --ext .es6 app/assets/javascripts
|
||||
|
||||
7
Gemfile
7
Gemfile
@ -48,7 +48,7 @@ gem 'onebox'
|
||||
gem 'http_accept_language', '~>2.0.5', require: false
|
||||
|
||||
gem 'ember-rails', '0.18.5'
|
||||
gem 'ember-source', '1.12.2'
|
||||
gem 'ember-source', '2.4.6'
|
||||
gem 'barber'
|
||||
gem 'babel-transpiler'
|
||||
|
||||
@ -66,7 +66,7 @@ gem 'aws-sdk', require: false
|
||||
gem 'excon', require: false
|
||||
gem 'unf', require: false
|
||||
|
||||
gem 'email_reply_trimmer', '0.1.4'
|
||||
gem 'email_reply_trimmer', '0.1.6'
|
||||
|
||||
# note: for image_optim to correctly work you need to follow
|
||||
# https://github.com/toy/image_optim
|
||||
@ -122,6 +122,7 @@ end
|
||||
group :test do
|
||||
gem 'fakeweb', '~> 1.3.0', require: false
|
||||
gem 'minitest', require: false
|
||||
gem 'timecop'
|
||||
end
|
||||
|
||||
group :test, :development do
|
||||
@ -138,7 +139,6 @@ group :test, :development do
|
||||
gem 'rspec-rails', require: false
|
||||
gem 'shoulda', require: false
|
||||
gem 'simplecov', require: false
|
||||
gem 'timecop'
|
||||
gem 'rspec-given'
|
||||
gem 'rspec-html-matchers'
|
||||
gem 'spork-rails'
|
||||
@ -150,7 +150,6 @@ group :development do
|
||||
gem 'bullet', require: !!ENV['BULLET']
|
||||
gem 'better_errors'
|
||||
gem 'binding_of_caller'
|
||||
gem 'librarian', '>= 0.0.25', require: false
|
||||
gem 'annotate'
|
||||
gem 'foreman', require: false
|
||||
end
|
||||
|
||||
40
Gemfile.lock
40
Gemfile.lock
@ -80,10 +80,10 @@ GEM
|
||||
docile (1.1.5)
|
||||
domain_name (0.5.25)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
email_reply_trimmer (0.1.4)
|
||||
ember-data-source (1.0.0.beta.16.1)
|
||||
ember-source (~> 1.8)
|
||||
ember-handlebars-template (0.7.3)
|
||||
email_reply_trimmer (0.1.6)
|
||||
ember-data-source (2.2.1)
|
||||
ember-source (>= 1.8, < 3.0)
|
||||
ember-handlebars-template (0.7.4)
|
||||
barber (>= 0.11.0)
|
||||
sprockets (>= 3.3, < 4)
|
||||
ember-rails (0.18.5)
|
||||
@ -93,7 +93,7 @@ GEM
|
||||
ember-source (>= 1.1.0)
|
||||
jquery-rails (>= 1.0.17)
|
||||
railties (>= 3.1)
|
||||
ember-source (1.12.2)
|
||||
ember-source (2.4.6)
|
||||
erubis (2.7.0)
|
||||
eventmachine (1.2.0.1)
|
||||
excon (0.53.0)
|
||||
@ -137,16 +137,13 @@ GEM
|
||||
image_size (1.4.1)
|
||||
in_threads (1.3.1)
|
||||
jmespath (1.3.1)
|
||||
jquery-rails (4.0.5)
|
||||
rails-dom-testing (~> 1.0)
|
||||
jquery-rails (4.2.1)
|
||||
rails-dom-testing (>= 1, < 3)
|
||||
railties (>= 4.2.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
json (1.8.3)
|
||||
jwt (1.5.2)
|
||||
kgio (2.10.0)
|
||||
librarian (0.1.2)
|
||||
highline
|
||||
thor (~> 0.15)
|
||||
libv8 (5.3.332.38.1)
|
||||
listen (0.7.3)
|
||||
logster (1.2.5)
|
||||
@ -186,7 +183,7 @@ GEM
|
||||
multi_json (~> 1.3)
|
||||
multi_xml (~> 0.5)
|
||||
rack (~> 1.2)
|
||||
oj (2.14.3)
|
||||
oj (2.17.5)
|
||||
omniauth (1.3.1)
|
||||
hashie (>= 1.2, < 4)
|
||||
rack (>= 1.0, < 3)
|
||||
@ -215,7 +212,7 @@ GEM
|
||||
omniauth-twitter (1.2.1)
|
||||
json (~> 1.3)
|
||||
omniauth-oauth (~> 1.1)
|
||||
onebox (1.5.50)
|
||||
onebox (1.6.0)
|
||||
htmlentities (~> 4.3.4)
|
||||
moneta (~> 0.8)
|
||||
multi_json (~> 1.11)
|
||||
@ -224,7 +221,7 @@ GEM
|
||||
openid-redis-store (0.0.2)
|
||||
redis
|
||||
ruby-openid
|
||||
pg (0.18.4)
|
||||
pg (0.19.0)
|
||||
progress (3.1.1)
|
||||
pry (0.10.4)
|
||||
coderay (~> 1.1.0)
|
||||
@ -267,13 +264,14 @@ GEM
|
||||
loofah (~> 2.0)
|
||||
rails-observers (0.1.2)
|
||||
activemodel (~> 4.0)
|
||||
rails_multisite (1.0.4)
|
||||
rails_multisite (1.0.6)
|
||||
rails (> 4.2, < 5)
|
||||
railties (4.2.7.1)
|
||||
actionpack (= 4.2.7.1)
|
||||
activesupport (= 4.2.7.1)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
raindrops (0.16.0)
|
||||
raindrops (0.17.0)
|
||||
rake (11.2.2)
|
||||
rake-compiler (0.9.9)
|
||||
rake
|
||||
@ -284,7 +282,7 @@ GEM
|
||||
ffi (>= 1.0.6)
|
||||
msgpack (>= 0.4.3)
|
||||
trollop (>= 1.16.2)
|
||||
redis (3.3.0)
|
||||
redis (3.3.1)
|
||||
redis-namespace (1.5.2)
|
||||
redis (~> 3.0, >= 3.0.4)
|
||||
rest-client (1.8.0)
|
||||
@ -345,9 +343,10 @@ GEM
|
||||
shoulda-context (1.2.1)
|
||||
shoulda-matchers (2.8.0)
|
||||
activesupport (>= 3.0.0)
|
||||
sidekiq (4.1.2)
|
||||
sidekiq (4.2.4)
|
||||
concurrent-ruby (~> 1.0)
|
||||
connection_pool (~> 2.2, >= 2.2.0)
|
||||
rack-protection (>= 1.5.0)
|
||||
redis (~> 3.2, >= 3.2.1)
|
||||
sidekiq-statistic (1.2.0)
|
||||
sidekiq (>= 3.3.4, < 5)
|
||||
@ -391,7 +390,7 @@ GEM
|
||||
unf (0.1.4)
|
||||
unf_ext
|
||||
unf_ext (0.0.7.1)
|
||||
unicorn (5.1.0)
|
||||
unicorn (5.2.0)
|
||||
kgio (~> 2.6)
|
||||
raindrops (~> 0.7)
|
||||
uniform_notifier (1.10.0)
|
||||
@ -412,9 +411,9 @@ DEPENDENCIES
|
||||
certified
|
||||
discourse-qunit-rails
|
||||
discourse_fastimage (= 2.0.3)
|
||||
email_reply_trimmer (= 0.1.4)
|
||||
email_reply_trimmer (= 0.1.6)
|
||||
ember-rails (= 0.18.5)
|
||||
ember-source (= 1.12.2)
|
||||
ember-source (= 2.4.6)
|
||||
excon
|
||||
execjs
|
||||
fabrication (= 2.9.8)
|
||||
@ -431,7 +430,6 @@ DEPENDENCIES
|
||||
htmlentities
|
||||
http_accept_language (~> 2.0.5)
|
||||
image_optim (= 0.20.2)
|
||||
librarian (>= 0.0.25)
|
||||
listen (= 0.7.3)
|
||||
logster
|
||||
lru_redux
|
||||
|
||||
@ -1,26 +1,17 @@
|
||||
/* global ace:true */
|
||||
import loadScript from 'discourse/lib/load-script';
|
||||
import { escapeExpression } from 'discourse/lib/utilities';
|
||||
import { bufferedRender } from 'discourse-common/lib/buffered-render';
|
||||
import { observes } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Component.extend(bufferedRender({
|
||||
export default Ember.Component.extend({
|
||||
mode: 'css',
|
||||
classNames: ['ace-wrapper'],
|
||||
_editor: null,
|
||||
_skipContentChangeEvent: null,
|
||||
|
||||
contentChanged: function() {
|
||||
@observes('content')
|
||||
contentChanged() {
|
||||
if (this._editor && !this._skipContentChangeEvent) {
|
||||
this._editor.getSession().setValue(this.get('content'));
|
||||
}
|
||||
}.observes('content'),
|
||||
|
||||
buildBuffer(buffer) {
|
||||
buffer.push("<div class='ace'>");
|
||||
if (this.get('content')) {
|
||||
buffer.push(escapeExpression(this.get('content')));
|
||||
}
|
||||
buffer.push("</div>");
|
||||
},
|
||||
|
||||
_destroyEditor: function() {
|
||||
@ -40,31 +31,30 @@ export default Ember.Component.extend(bufferedRender({
|
||||
}
|
||||
},
|
||||
|
||||
_initEditor: function() {
|
||||
const self = this;
|
||||
didInsertElement() {
|
||||
this._super();
|
||||
|
||||
loadScript("/javascripts/ace/ace.js", { scriptTag: true }).then(function() {
|
||||
ace.require(['ace/ace'], function(loadedAce) {
|
||||
const editor = loadedAce.edit(self.$('.ace')[0]);
|
||||
loadScript("/javascripts/ace/ace.js", { scriptTag: true }).then(() => {
|
||||
window.ace.require(['ace/ace'], loadedAce => {
|
||||
const editor = loadedAce.edit(this.$('.ace')[0]);
|
||||
|
||||
editor.setTheme("ace/theme/chrome");
|
||||
editor.setShowPrintMargin(false);
|
||||
editor.getSession().setMode("ace/mode/" + self.get('mode'));
|
||||
editor.on('change', function() {
|
||||
self._skipContentChangeEvent = true;
|
||||
self.set('content', editor.getSession().getValue());
|
||||
self._skipContentChangeEvent = false;
|
||||
editor.getSession().setMode("ace/mode/" + this.get('mode'));
|
||||
editor.on('change', () => {
|
||||
this._skipContentChangeEvent = true;
|
||||
this.set('content', editor.getSession().getValue());
|
||||
this._skipContentChangeEvent = false;
|
||||
});
|
||||
editor.$blockScrolling = Infinity;
|
||||
|
||||
self.$().data('editor', editor);
|
||||
self._editor = editor;
|
||||
if (self.appEvents) {
|
||||
this.$().data('editor', editor);
|
||||
this._editor = editor;
|
||||
if (this.appEvents) {
|
||||
// xxx: don't run during qunit tests
|
||||
self.appEvents.on('ace:resize', self, self.resize);
|
||||
this.appEvents.on('ace:resize', self, self.resize);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}.on('didInsertElement')
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
import { getOwner } from 'discourse-common/lib/get-owner';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
router: function() {
|
||||
return this.container.lookup('router:main');
|
||||
return getOwner(this).lookup('router:main');
|
||||
}.property(),
|
||||
|
||||
active: function() {
|
||||
|
||||
@ -1,12 +1,14 @@
|
||||
export default Ember.View.extend({
|
||||
_disableCustomStylesheets: function() {
|
||||
export default Ember.Component.extend({
|
||||
willInsertElement() {
|
||||
this._super();
|
||||
if (this.session.get("disableCustomCSS")) {
|
||||
$("link.custom-css").attr("rel", "");
|
||||
this.session.set("disableCustomCSS", false);
|
||||
}
|
||||
}.on("willInsertElement"),
|
||||
},
|
||||
|
||||
_enableCustomStylesheets: function() {
|
||||
willDestroyElement() {
|
||||
this._super();
|
||||
$("link.custom-css").attr("rel", "stylesheet");
|
||||
}.on("willDestroyElement")
|
||||
}
|
||||
});
|
||||
@ -1,8 +0,0 @@
|
||||
import ListView from 'ember-addons/list-view';
|
||||
import ListItemView from 'ember-addons/list-item-view';
|
||||
|
||||
export default ListView.extend({
|
||||
height: 700,
|
||||
rowHeight: 32,
|
||||
itemViewClass: ListItemView.extend({templateName: "admin/templates/permalinks_list_item"})
|
||||
});
|
||||
@ -1,8 +0,0 @@
|
||||
import ListView from 'ember-addons/list-view';
|
||||
import ListItemView from 'ember-addons/list-item-view';
|
||||
|
||||
export default ListView.extend({
|
||||
height: 700,
|
||||
rowHeight: 32,
|
||||
itemViewClass: ListItemView.extend({templateName: "admin/templates/logs/screened_emails_list_item"})
|
||||
});
|
||||
@ -1,8 +0,0 @@
|
||||
import ListView from 'ember-addons/list-view';
|
||||
import ListItemView from 'ember-addons/list-item-view';
|
||||
|
||||
export default ListView.extend({
|
||||
height: 700,
|
||||
rowHeight: 32,
|
||||
itemViewClass: ListItemView.extend({templateName: "admin/templates/logs/screened_ip_addresses_list_item"})
|
||||
});
|
||||
@ -1,8 +0,0 @@
|
||||
import ListView from 'ember-addons/list-view';
|
||||
import ListItemView from 'ember-addons/list-item-view';
|
||||
|
||||
export default ListView.extend({
|
||||
height: 700,
|
||||
rowHeight: 32,
|
||||
itemViewClass: ListItemView.extend({templateName: "admin/templates/logs/screened_urls_list_item"})
|
||||
});
|
||||
@ -1,12 +1,11 @@
|
||||
import BufferedContent from 'discourse/mixins/buffered-content';
|
||||
import ScrollTop from 'discourse/mixins/scroll-top';
|
||||
import SiteSetting from 'admin/models/site-setting';
|
||||
import { propertyNotEqual } from 'discourse/lib/computed';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
const CustomTypes = ['bool', 'enum', 'list', 'url_list', 'host_list', 'category_list', 'value_list'];
|
||||
|
||||
export default Ember.Component.extend(BufferedContent, ScrollTop, {
|
||||
export default Ember.Component.extend(BufferedContent, {
|
||||
classNameBindings: [':row', ':setting', 'setting.overridden', 'typeClass'],
|
||||
content: Ember.computed.alias('setting'),
|
||||
dirty: propertyNotEqual('buffered.value', 'setting.value'),
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
import ListView from 'ember-addons/list-view';
|
||||
import ListItemView from 'ember-addons/list-item-view';
|
||||
|
||||
export default ListView.extend({
|
||||
height: 700,
|
||||
rowHeight: 75,
|
||||
itemViewClass: ListItemView.extend({templateName: "admin/templates/logs/staff_action_logs_list_item"})
|
||||
});
|
||||
@ -1,3 +1,4 @@
|
||||
import DiscourseURL from 'discourse/lib/url';
|
||||
import { ajax } from 'discourse/lib/ajax';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
@ -35,8 +36,11 @@ export default Ember.Controller.extend({
|
||||
} else {
|
||||
this._toggleReadOnlyMode(false);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
download(backup) {
|
||||
DiscourseURL.redirectTo(backup.get('link'));
|
||||
}
|
||||
},
|
||||
|
||||
_toggleReadOnlyMode(enable) {
|
||||
|
||||
@ -1,12 +1,23 @@
|
||||
import EmailPreview from 'admin/models/email-preview';
|
||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
|
||||
emailEmpty: Em.computed.empty('email'),
|
||||
sendEmailDisabled: Em.computed.or('emailEmpty', 'sendingEmail'),
|
||||
showSendEmailForm: Em.computed.notEmpty('model.html_content'),
|
||||
htmlEmpty: Em.computed.empty('model.html_content'),
|
||||
|
||||
iframeSrc: function() {
|
||||
return ('data:text/html;charset=utf-8,' + encodeURI(this.get('model.html_content')));
|
||||
}.property('model.html_content'),
|
||||
|
||||
actions: {
|
||||
refresh() {
|
||||
const model = this.get('model');
|
||||
|
||||
this.set('loading', true);
|
||||
this.set('sentEmail', false);
|
||||
EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => {
|
||||
model.setProperties(email.getProperties('html_content', 'text_content'));
|
||||
this.set('loading', false);
|
||||
@ -15,6 +26,23 @@ export default Ember.Controller.extend({
|
||||
|
||||
toggleShowHtml() {
|
||||
this.toggleProperty('showHtml');
|
||||
},
|
||||
|
||||
sendEmail() {
|
||||
this.set('sendingEmail', true);
|
||||
this.set('sentEmail', false);
|
||||
|
||||
const self = this;
|
||||
|
||||
EmailPreview.sendDigest(this.get('lastSeen'), this.get('username'), this.get('email')).then(result => {
|
||||
if (result.errors) {
|
||||
bootbox.alert(result.errors);
|
||||
} else {
|
||||
self.set('sentEmail', true);
|
||||
}
|
||||
}).catch(popupAjaxError).finally(function() {
|
||||
self.set('sendingEmail', false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,38 +1,14 @@
|
||||
import { default as computed } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
let lastSearch;
|
||||
let lastOverridden;
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
_q: null,
|
||||
searching: false,
|
||||
siteTexts: null,
|
||||
preferred: false,
|
||||
_overridden: null,
|
||||
queryParams: ['q', 'overridden'],
|
||||
|
||||
@computed
|
||||
overridden: {
|
||||
set(value) {
|
||||
if (!value || value === "false") { value = false; }
|
||||
this._overridden = value;
|
||||
return value;
|
||||
},
|
||||
get() {
|
||||
return this._overridden;
|
||||
}
|
||||
},
|
||||
|
||||
@computed
|
||||
q: {
|
||||
set(value) {
|
||||
if (Ember.isEmpty(value)) { value = null; }
|
||||
this._q = value;
|
||||
return value;
|
||||
},
|
||||
get() {
|
||||
return this._q;
|
||||
}
|
||||
},
|
||||
q: null,
|
||||
overridden: null,
|
||||
|
||||
_performSearch() {
|
||||
this.store.find('site-text', this.getProperties('q', 'overridden')).then(results => {
|
||||
@ -46,11 +22,14 @@ export default Ember.Controller.extend({
|
||||
},
|
||||
|
||||
search(overridden) {
|
||||
this.set('overridden', overridden);
|
||||
|
||||
const q = this.get('q');
|
||||
if (q !== lastSearch || overridden) {
|
||||
if (q !== lastSearch || overridden !== lastOverridden) {
|
||||
this.set('searching', true);
|
||||
Ember.run.debounce(this, this._performSearch, 400);
|
||||
lastSearch = q;
|
||||
lastOverridden = overridden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import ChangeSiteCustomizationDetailsController from "admin/controllers/modals/change-site-customization-details";
|
||||
|
||||
export default ChangeSiteCustomizationDetailsController.extend({
|
||||
onShow: function() {
|
||||
onShow() {
|
||||
this.send("selectPrevious");
|
||||
}
|
||||
});
|
||||
|
||||
@ -17,6 +17,20 @@ EmailPreview.reopenClass({
|
||||
}).then(function (result) {
|
||||
return EmailPreview.create(result);
|
||||
});
|
||||
},
|
||||
|
||||
sendDigest: function(lastSeenAt, username, email) {
|
||||
if (Em.isEmpty(lastSeenAt)) {
|
||||
lastSeenAt = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
if (Em.isEmpty(username)) {
|
||||
username = Discourse.User.current().username;
|
||||
}
|
||||
|
||||
return ajax("/admin/email/send-digest.json", {
|
||||
data: { last_seen_at: lastSeenAt, username: username, email: email }
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ export default Discourse.Route.extend({
|
||||
|
||||
actions: {
|
||||
startBackup() {
|
||||
showModal('modals/admin-start-backup');
|
||||
showModal('admin-start-backup', { admin: true });
|
||||
this.controllerFor('modal').set('modalClass', 'start-backup-modal');
|
||||
},
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ export default Ember.Route.extend({
|
||||
|
||||
editGroupings() {
|
||||
const model = this.controllerFor('admin-badges').get('badgeGroupings');
|
||||
showModal('modals/admin-edit-badge-groupings', { model });
|
||||
showModal('admin-edit-badge-groupings', { model, admin: true });
|
||||
},
|
||||
|
||||
preview(badge, explain) {
|
||||
@ -42,7 +42,7 @@ export default Ember.Route.extend({
|
||||
}
|
||||
}).then(function(model) {
|
||||
badge.set('preview_loading', false);
|
||||
showModal('modals/admin-badge-preview', { model });
|
||||
showModal('admin-badge-preview', { model, admin: true });
|
||||
}).catch(function(error) {
|
||||
badge.set('preview_loading', false);
|
||||
Em.Logger.error(error);
|
||||
|
||||
@ -3,9 +3,5 @@ import EmailSettings from 'admin/models/email-settings';
|
||||
export default Discourse.Route.extend({
|
||||
model() {
|
||||
return EmailSettings.find();
|
||||
},
|
||||
|
||||
renderTemplate() {
|
||||
this.render('admin/templates/email_index', { into: 'adminEmail' });
|
||||
}
|
||||
});
|
||||
|
||||
@ -6,7 +6,7 @@ export default AdminEmailIncomings.extend({
|
||||
|
||||
actions: {
|
||||
showIncomingEmail(id) {
|
||||
showModal('modals/admin-incoming-email');
|
||||
showModal('admin-incoming-email', { admin: true });
|
||||
this.controllerFor("modals/admin-incoming-email").load(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,12 +14,12 @@ export default Discourse.Route.extend({
|
||||
|
||||
actions: {
|
||||
showAgreeFlagModal(model) {
|
||||
showModal('modals/admin-agree-flag', { model });
|
||||
showModal('admin-agree-flag', { model, admin: true });
|
||||
this.controllerFor('modal').set('modalClass', 'agree-flag-modal');
|
||||
},
|
||||
|
||||
showDeleteFlagModal(model) {
|
||||
showModal('modals/admin-delete-flag', { model });
|
||||
showModal('admin-delete-flag', { model, admin: true });
|
||||
this.controllerFor('modal').set('modalClass', 'delete-flag-modal');
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export default Discourse.Route.extend({
|
||||
renderTemplate: function() {
|
||||
this.render('admin/templates/logs/screened_emails', {into: 'adminLogs'});
|
||||
this.render('admin/templates/logs/screened-emails', {into: 'adminLogs'});
|
||||
},
|
||||
|
||||
setupController: function() {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export default Discourse.Route.extend({
|
||||
renderTemplate() {
|
||||
this.render('admin/templates/logs/screened_ip_addresses', {into: 'adminLogs'});
|
||||
this.render('admin/templates/logs/screened-ip-addresses', {into: 'adminLogs'});
|
||||
},
|
||||
|
||||
setupController() {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export default Discourse.Route.extend({
|
||||
renderTemplate: function() {
|
||||
this.render('admin/templates/logs/screened_urls', {into: 'adminLogs'});
|
||||
this.render('admin/templates/logs/screened-urls', {into: 'adminLogs'});
|
||||
},
|
||||
|
||||
setupController: function() {
|
||||
|
||||
@ -3,7 +3,7 @@ import showModal from 'discourse/lib/show-modal';
|
||||
export default Discourse.Route.extend({
|
||||
// TODO: make this automatic using an `{{outlet}}`
|
||||
renderTemplate: function() {
|
||||
this.render('admin/templates/logs/staff_action_logs', {into: 'adminLogs'});
|
||||
this.render('admin/templates/logs/staff-action-logs', {into: 'adminLogs'});
|
||||
},
|
||||
|
||||
setupController: function(controller) {
|
||||
@ -13,13 +13,18 @@ export default Discourse.Route.extend({
|
||||
|
||||
actions: {
|
||||
showDetailsModal(model) {
|
||||
showModal('modals/admin-staff-action-log-details', { model });
|
||||
showModal('admin-staff-action-log-details', { model, admin: true });
|
||||
this.controllerFor('modal').set('modalClass', 'log-details-modal');
|
||||
},
|
||||
|
||||
showCustomDetailsModal(model) {
|
||||
const modalName = "modals/" + (model.action_name + '_details').replace("_", "-");
|
||||
showModal(modalName, { model });
|
||||
const modalName = (model.action_name + '_details').replace(/\_/g, "-");
|
||||
|
||||
showModal(modalName, {
|
||||
model,
|
||||
admin: true,
|
||||
templateName: 'site-customization-change'
|
||||
});
|
||||
this.controllerFor('modal').set('modalClass', 'tabbed-modal log-details-modal');
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,11 +3,11 @@ export default {
|
||||
|
||||
map() {
|
||||
this.route('dashboard', { path: '/' });
|
||||
this.resource('adminSiteSettings', { path: '/site_settings' }, function() {
|
||||
this.resource('adminSiteSettingsCategory', { path: 'category/:category_id'} );
|
||||
this.route('adminSiteSettings', { path: '/site_settings', resetNamespace: true }, function() {
|
||||
this.route('adminSiteSettingsCategory', { path: 'category/:category_id', resetNamespace: true} );
|
||||
});
|
||||
|
||||
this.resource('adminEmail', { path: '/email'}, function() {
|
||||
this.route('adminEmail', { path: '/email', resetNamespace: true}, function() {
|
||||
this.route('sent');
|
||||
this.route('skipped');
|
||||
this.route('bounced');
|
||||
@ -16,72 +16,72 @@ export default {
|
||||
this.route('previewDigest', { path: '/preview-digest' });
|
||||
});
|
||||
|
||||
this.resource('adminCustomize', { path: '/customize' } ,function() {
|
||||
this.route('adminCustomize', { path: '/customize', resetNamespace: true } ,function() {
|
||||
this.route('colors');
|
||||
|
||||
this.resource('adminCustomizeCssHtml', { path: 'css_html' }, function() {
|
||||
this.route('adminCustomizeCssHtml', { path: 'css_html', resetNamespace: true }, function() {
|
||||
this.route('show', {path: '/:site_customization_id/:section'});
|
||||
});
|
||||
|
||||
this.resource('adminSiteText', { path: '/site_texts' }, function() {
|
||||
this.route('adminSiteText', { path: '/site_texts', resetNamespace: true }, function() {
|
||||
this.route('edit', { path: '/:id' });
|
||||
});
|
||||
|
||||
this.resource('adminUserFields', { path: '/user_fields' });
|
||||
this.resource('adminEmojis', { path: '/emojis' });
|
||||
this.resource('adminPermalinks', { path: '/permalinks' });
|
||||
this.resource('adminEmbedding', { path: '/embedding' });
|
||||
this.resource('adminCustomizeEmailTemplates', { path: '/email_templates' }, function() {
|
||||
this.route('adminUserFields', { path: '/user_fields', resetNamespace: true });
|
||||
this.route('adminEmojis', { path: '/emojis', resetNamespace: true });
|
||||
this.route('adminPermalinks', { path: '/permalinks', resetNamespace: true });
|
||||
this.route('adminEmbedding', { path: '/embedding', resetNamespace: true });
|
||||
this.route('adminCustomizeEmailTemplates', { path: '/email_templates', resetNamespace: true }, function() {
|
||||
this.route('edit', { path: '/:id' });
|
||||
});
|
||||
});
|
||||
|
||||
this.resource('adminApi', { path: '/api' }, function() {
|
||||
this.resource('adminApiKeys', { path: '/keys' });
|
||||
this.route('adminApi', { path: '/api', resetNamespace: true }, function() {
|
||||
this.route('adminApiKeys', { path: '/keys', resetNamespace: true });
|
||||
|
||||
this.resource('adminWebHooks', { path: '/web_hooks' }, function() {
|
||||
this.route('adminWebHooks', { path: '/web_hooks', resetNamespace: true }, function() {
|
||||
this.route('show', { path: '/:web_hook_id' });
|
||||
this.route('showEvents', { path: '/:web_hook_id/events' });
|
||||
});
|
||||
});
|
||||
|
||||
this.resource('admin.backups', { path: '/backups' }, function() {
|
||||
this.route('admin.backups', { path: '/backups', resetNamespace: true }, function() {
|
||||
this.route('logs');
|
||||
});
|
||||
|
||||
this.resource('adminReports', { path: '/reports/:type' });
|
||||
this.route('adminReports', { path: '/reports/:type', resetNamespace: true });
|
||||
|
||||
this.resource('adminFlags', { path: '/flags' }, function() {
|
||||
this.route('adminFlags', { path: '/flags', resetNamespace: true }, function() {
|
||||
this.route('list', { path: '/:filter' });
|
||||
});
|
||||
|
||||
this.resource('adminLogs', { path: '/logs' }, function() {
|
||||
this.route('adminLogs', { path: '/logs', resetNamespace: true }, function() {
|
||||
this.route('staffActionLogs', { path: '/staff_action_logs' });
|
||||
this.route('screenedEmails', { path: '/screened_emails' });
|
||||
this.route('screenedIpAddresses', { path: '/screened_ip_addresses' });
|
||||
this.route('screenedUrls', { path: '/screened_urls' });
|
||||
});
|
||||
|
||||
this.resource('adminGroups', { path: '/groups' }, function() {
|
||||
this.route('adminGroups', { path: '/groups', resetNamespace: true }, function() {
|
||||
this.route('bulk');
|
||||
this.route('bulkComplete', { path: 'bulk-complete' });
|
||||
this.resource('adminGroupsType', { path: '/:type' }, function() {
|
||||
this.resource('adminGroup', { path: '/:name' });
|
||||
this.route('adminGroupsType', { path: '/:type', resetNamespace: true }, function() {
|
||||
this.route('adminGroup', { path: '/:name', resetNamespace: true });
|
||||
});
|
||||
});
|
||||
|
||||
this.resource('adminUsers', { path: '/users' }, function() {
|
||||
this.resource('adminUser', { path: '/:user_id/:username' }, function() {
|
||||
this.route('adminUsers', { path: '/users', resetNamespace: true }, function() {
|
||||
this.route('adminUser', { path: '/:user_id/:username', resetNamespace: true }, function() {
|
||||
this.route('badges');
|
||||
this.route('tl3Requirements', { path: '/tl3_requirements' });
|
||||
});
|
||||
|
||||
this.resource('adminUsersList', { path: '/list' }, function() {
|
||||
this.route('adminUsersList', { path: '/list', resetNamespace: true }, function() {
|
||||
this.route('show', { path: '/:filter' });
|
||||
});
|
||||
});
|
||||
|
||||
this.resource('adminBadges', { path: '/badges' }, function() {
|
||||
this.route('adminBadges', { path: '/badges', resetNamespace: true }, function() {
|
||||
this.route('show', { path: '/:badge_id' });
|
||||
});
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ export default Discourse.Route.extend({
|
||||
|
||||
actions: {
|
||||
showSuspendModal(model) {
|
||||
showModal('modals/admin-suspend-user', { model });
|
||||
showModal('admin-suspend-user', { model, admin: true });
|
||||
this.controllerFor('modal').set('modalClass', 'suspend-user-modal');
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="container">
|
||||
{{#disable-custom-stylesheets class="container"}}
|
||||
<div class="row">
|
||||
<div class="full-width">
|
||||
|
||||
@ -34,4 +34,4 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/disable-custom-stylesheets}}
|
||||
|
||||
@ -19,7 +19,12 @@
|
||||
<td>{{human-size backup.size}}</td>
|
||||
<td>
|
||||
<div class="pull-right">
|
||||
<a href={{backup.link}} class="btn download" title="{{i18n 'admin.backups.operations.download.title'}}">{{fa-icon "download"}}{{i18n 'admin.backups.operations.download.label'}}</a>
|
||||
{{d-button class="download"
|
||||
action="download"
|
||||
actionParam=backup
|
||||
icon="download"
|
||||
title="admin.backups.operations.download.title"
|
||||
label="admin.backups.operations.download.label"}}
|
||||
{{#if status.isOperationRunning}}
|
||||
{{d-button icon="trash-o" action="destroyBackup" actionParam=backup class="btn-danger" disabled="true" title="admin.backups.operations.is_running"}}
|
||||
{{d-button icon="play" action="startRestore" actionParam=backup disabled=status.restoreDisabled title=restoreTitle label="admin.backups.operations.restore.label"}}
|
||||
@ -1,35 +1,37 @@
|
||||
<div class="admin-controls">
|
||||
<div class="span15">
|
||||
<ul class="nav nav-pills">
|
||||
{{nav-item route='admin.backups.index' label='admin.backups.menu.backups'}}
|
||||
{{nav-item route='admin.backups.logs' label='admin.backups.menu.logs'}}
|
||||
</ul>
|
||||
<div class='admin-backups'>
|
||||
<div class="admin-controls">
|
||||
<div class="span15">
|
||||
<ul class="nav nav-pills">
|
||||
{{nav-item route='admin.backups.index' label='admin.backups.menu.backups'}}
|
||||
{{nav-item route='admin.backups.logs' label='admin.backups.menu.logs'}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
{{#if model.canRollback}}
|
||||
{{d-button action="rollback"
|
||||
class="btn-rollback"
|
||||
label="admin.backups.operations.rollback.label"
|
||||
title="admin.backups.operations.rollback.title"
|
||||
icon="ambulance"
|
||||
disabled=rollbackDisabled}}
|
||||
{{/if}}
|
||||
{{#if model.isOperationRunning}}
|
||||
{{d-button action="cancelOperation"
|
||||
class="btn-danger"
|
||||
title="admin.backups.operations.cancel.title"
|
||||
label="admin.backups.operations.cancel.label"
|
||||
icon="times"}}
|
||||
{{else}}
|
||||
{{d-button action="startBackup"
|
||||
class="btn-primary"
|
||||
title="admin.backups.operations.backup.title"
|
||||
label="admin.backups.operations.backup.label"
|
||||
icon="rocket"}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
{{#if model.canRollback}}
|
||||
{{d-button action="rollback"
|
||||
class="btn-rollback"
|
||||
label="admin.backups.operations.rollback.label"
|
||||
title="admin.backups.operations.rollback.title"
|
||||
icon="ambulance"
|
||||
disabled=rollbackDisabled}}
|
||||
{{/if}}
|
||||
{{#if model.isOperationRunning}}
|
||||
{{d-button action="cancelOperation"
|
||||
class="btn-danger"
|
||||
title="admin.backups.operations.cancel.title"
|
||||
label="admin.backups.operations.cancel.label"
|
||||
icon="times"}}
|
||||
{{else}}
|
||||
{{d-button action="startBackup"
|
||||
class="btn-primary"
|
||||
title="admin.backups.operations.backup.title"
|
||||
label="admin.backups.operations.backup.label"
|
||||
icon="rocket"}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin-container">
|
||||
{{outlet}}
|
||||
<div class="admin-container">
|
||||
{{outlet}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div class='current-badge span13'>
|
||||
{{#d-section class="current-badge span13"}}
|
||||
<p>{{i18n 'admin.badges.none_selected'}}</p>
|
||||
|
||||
<div>
|
||||
@ -6,4 +6,4 @@
|
||||
{{fa-icon "plus"}} {{i18n 'admin.badges.new'}}
|
||||
{{/link-to}}
|
||||
</div>
|
||||
</div>
|
||||
{{/d-section}}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div class='current-badge span13'>
|
||||
{{#d-section class="current-badge span13"}}
|
||||
<form class="form-horizontal">
|
||||
<div>
|
||||
<label for="name">{{i18n 'admin.badges.name'}}</label>
|
||||
@ -143,7 +143,7 @@
|
||||
{{/unless}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{{/d-section}}
|
||||
|
||||
{{#if grant_count}}
|
||||
<div class="span13 current-badge-actions">
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<div class='ace'>{{content}}</div>
|
||||
@ -0,0 +1,18 @@
|
||||
<section class="field">
|
||||
<b>{{i18n 'admin.customize.enabled'}}</b>: {{change.enabled}}
|
||||
</section>
|
||||
|
||||
{{site-customization-change-field field=change.stylesheet name="admin.customize.css"}}
|
||||
{{site-customization-change-field icon="mobile" field=change.mobile_stylesheet name="admin.customize.css"}}
|
||||
|
||||
{{site-customization-change-field field=change.header name="admin.customize.header"}}
|
||||
{{site-customization-change-field icon="mobile" field=change.mobile_header name="admin.customize.header"}}
|
||||
|
||||
{{site-customization-change-field field=change.top name="admin.customize.top"}}
|
||||
{{site-customization-change-field icon="mobile" field=change.mobile_top name="admin.customize.top"}}
|
||||
|
||||
{{site-customization-change-field field=change.footer name="admin.customize.footer"}}
|
||||
{{site-customization-change-field icon="mobile" field=change.mobile_footer name="admin.customize.footer"}}
|
||||
|
||||
{{site-customization-change-field icon="file-text-o" field=change.head_tag name="admin.customize.head_tag.text"}}
|
||||
{{site-customization-change-field icon="file-text-o" field=change.body_tag name="admin.customize.body_tag.text"}}
|
||||
@ -0,0 +1,7 @@
|
||||
{{#if field}}
|
||||
<section class="field">
|
||||
<b>{{i18n name}}</b>: ({{i18n 'character_count' count=field.length}})
|
||||
<br/>
|
||||
{{textarea value=field class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
@ -19,9 +19,36 @@
|
||||
</div>
|
||||
|
||||
{{#conditional-loading-spinner condition=loading}}
|
||||
{{#if showHtml}}
|
||||
{{{model.html_content}}}
|
||||
{{else}}
|
||||
<pre>{{{model.text_content}}}</pre>
|
||||
|
||||
<div class="email-preview-digest">
|
||||
{{#if showSendEmailForm}}
|
||||
<br/>
|
||||
<div class="controls">
|
||||
{{#if sendingEmail}}
|
||||
{{i18n 'admin.email.sending_test'}}
|
||||
{{else}}
|
||||
<label>{{i18n 'admin.email.send_digest_label'}}</label>
|
||||
{{text-field value=email placeholderKey="admin.email.test_email_address"}}
|
||||
<button class='btn' {{action "sendEmail"}} disabled={{sendEmailDisabled}}>{{i18n 'admin.email.send_digest'}}</button>
|
||||
{{#if sentEmail}}
|
||||
<span class='result-message'>{{i18n 'admin.email.sent_test'}}</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<br/>
|
||||
{{/if}}
|
||||
|
||||
<div class="preview-output">
|
||||
{{#if showHtml}}
|
||||
{{#if htmlEmpty}}
|
||||
<p>{{i18n 'admin.email.no_result'}}</p>
|
||||
{{else}}
|
||||
<iframe src="{{iframeSrc}}" />
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<pre>{{{model.text_content}}}</pre>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{/conditional-loading-spinner}}
|
||||
@ -1,73 +0,0 @@
|
||||
<section class="field">
|
||||
<b>{{i18n 'admin.customize.enabled'}}</b>: {{enabled}}
|
||||
</section>
|
||||
{{#if stylesheet}}
|
||||
<section class="field">
|
||||
<b>{{i18n 'admin.customize.css'}}</b>: ({{i18n 'character_count' count=stylesheet.length}})
|
||||
<br/>
|
||||
{{textarea value=stylesheet class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if mobile_stylesheet}}
|
||||
<section class="field">
|
||||
<b>{{fa-icon "mobile"}} {{i18n 'admin.customize.css'}}</b>: ({{i18n 'character_count' count=mobile_stylesheet.length}})
|
||||
<br/>
|
||||
{{textarea value=mobile_stylesheet class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if header}}
|
||||
<section class="field">
|
||||
<b>{{i18n 'admin.customize.header'}}</b>: ({{i18n 'character_count' count=header.length}})
|
||||
<br/>
|
||||
{{textarea value=header class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if mobile_header}}
|
||||
<section class="field">
|
||||
<b>{{fa-icon "mobile"}} {{i18n 'admin.customize.header'}}</b>: ({{i18n 'character_count' count=mobile_header.length}})
|
||||
<br/>
|
||||
{{textarea value=mobile_header class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if top}}
|
||||
<section class="field">
|
||||
<b>{{i18n 'admin.customize.top'}}</b>: ({{i18n 'character_count' count=top.length}})
|
||||
<br/>
|
||||
{{textarea value=top class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if mobile_top}}
|
||||
<section class="field">
|
||||
<b>{{fa-icon "mobile"}} {{i18n 'admin.customize.top'}}</b>: ({{i18n 'character_count' count=mobile_top.length}})
|
||||
<br/>
|
||||
{{textarea value=mobile_top class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if footer}}
|
||||
<section class="field">
|
||||
<b>{{i18n 'admin.customize.footer'}}</b>: ({{i18n 'character_count' count=footer.length}})
|
||||
<br/>
|
||||
{{textarea value=footer class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if mobile_footer}}
|
||||
<section class="field">
|
||||
<b>{{fa-icon "mobile"}} {{i18n 'admin.customize.footer'}}</b>: ({{i18n 'character_count' count=mobile_footer.length}})
|
||||
<br/>
|
||||
{{textarea value=mobile_footer class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if head_tag}}
|
||||
<section class="field">
|
||||
<b>{{fa-icon "file-text-o"}} {{i18n 'admin.customize.head_tag.text'}}</b>: ({{i18n 'character_count' count=head_tag.length}})
|
||||
<br/>
|
||||
{{textarea value=head_tag class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
{{#if body_tag}}
|
||||
<section class="field">
|
||||
<b>{{fa-icon "file-text-o"}} {{i18n 'admin.customize.body_tag.text'}}</b>: ({{i18n 'character_count' count=body_tag.length}})
|
||||
<br/>
|
||||
{{textarea value=body_tag class="plain"}}
|
||||
</section>
|
||||
{{/if}}
|
||||
@ -19,7 +19,22 @@
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
{{screened-emails-list content=model}}
|
||||
{{#each model as |item|}}
|
||||
<div class="admin-list-item">
|
||||
<div class="col first email">
|
||||
<div class="overflow-ellipsis" title={{item.email}}>{{item.email}}</div>
|
||||
</div>
|
||||
<div class="col action">{{item.actionName}}</div>
|
||||
<div class="col match_count">{{item.match_count}}</div>
|
||||
<div class="col last_match_at">{{age-with-tooltip item.last_match_at}}</div>
|
||||
<div class="col created_at">{{age-with-tooltip item.created_at}}</div>
|
||||
<div class="col ip_address">{{item.ip_address}}</div>
|
||||
<div class="col action">
|
||||
{{d-button action="clearBlock" actionParam=item icon="check" label="admin.logs.screened_emails.actions.allow"}}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
{{else}}
|
||||
@ -0,0 +1,79 @@
|
||||
<p>{{i18n 'admin.logs.screened_ips.description'}}</p>
|
||||
|
||||
<div class="pull-right">
|
||||
{{text-field value=filter class="ip-address-input" placeholderKey="admin.logs.screened_ips.form.filter" autocorrect="off" autocapitalize="off"}}
|
||||
{{d-button action="rollUp" title="admin.logs.screened_ips.roll_up.title" label="admin.logs.screened_ips.roll_up.text"}}
|
||||
{{d-button action="exportScreenedIpList" icon="download" title="admin.export_csv.button_title.screened_ip" label="admin.export_csv.button_text"}}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{screened-ip-address-form action="recordAdded"}}
|
||||
</div>
|
||||
|
||||
{{#conditional-loading-spinner condition=loading}}
|
||||
{{#if model.length}}
|
||||
|
||||
<div class='table admin-logs-table screened-ip-addresses'>
|
||||
<div class="heading-container">
|
||||
<div class="col heading first ip_address">{{i18n 'admin.logs.ip_address'}}</div>
|
||||
<div class="col heading action">{{i18n 'admin.logs.action'}}</div>
|
||||
<div class="col heading match_count">{{i18n 'admin.logs.match_count'}}</div>
|
||||
<div class="col heading last_match_at">{{i18n 'admin.logs.last_match_at'}}</div>
|
||||
<div class="col heading created_at">{{i18n 'admin.logs.created_at'}}</div>
|
||||
<div class="col heading actions"></div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
{{#each model as |item|}}
|
||||
<div class="admin-list-item">
|
||||
<div class="col first ip_address">
|
||||
{{#if item.editing}}
|
||||
{{text-field value=item.ip_address autofocus="autofocus"}}
|
||||
{{else}}
|
||||
<span {{action "edit" item}}>
|
||||
{{#if item.isRange}}
|
||||
<strong>{{item.ip_address}}</strong>
|
||||
{{else}}
|
||||
{{item.ip_address}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col action">
|
||||
{{#if item.isBlocked}}
|
||||
{{fa-icon "ban"}}
|
||||
{{else}}
|
||||
{{fa-icon "check"}}
|
||||
{{/if}}
|
||||
{{item.actionName}}
|
||||
</div>
|
||||
<div class="col match_count">{{item.match_count}}</div>
|
||||
<div class="col last_match_at">
|
||||
{{#if item.last_match_at}}
|
||||
{{age-with-tooltip item.last_match_at}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col created_at">{{age-with-tooltip item.created_at}}</div>
|
||||
<div class="col actions">
|
||||
{{#unless item.editing}}
|
||||
{{d-button action="destroy" actionParam=item icon="trash-o" class="btn-danger"}}
|
||||
{{d-button action="edit" actionParam=item icon="pencil"}}
|
||||
{{#if isBlocked}}
|
||||
{{d-button action="allow" actionParam=item icon="check" label="admin.logs.screened_ips.actions.do_nothing"}}
|
||||
{{else}}
|
||||
{{d-button action="block" actionParam=item icon="ban" label="admin.logs.screened_ips.actions.block"}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{d-button action="save" actionParam=item label="admin.logs.save"}}
|
||||
<a {{action "cancel" item}}>{{i18n 'cancel'}}</a>
|
||||
{{/unless}}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
{{else}}
|
||||
{{i18n 'search.no_results'}}
|
||||
{{/if}}
|
||||
{{/conditional-loading-spinner}}
|
||||
@ -16,7 +16,18 @@
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
{{screened-urls-list content=model}}
|
||||
{{#each model as |url|}}
|
||||
<div class="admin-list-item">
|
||||
<div class="col first domain">
|
||||
<div class="overflow-ellipsis" title={{url.domain}}>{{url.domain}}</div>
|
||||
</div>
|
||||
<div class="col action">{{url.actionName}}</div>
|
||||
<div class="col match_count">{{url.match_count}}</div>
|
||||
<div class="col last_match_at">{{age-with-tooltip url.last_match_at}}</div>
|
||||
<div class="col created_at">{{age-with-tooltip url.created_at}}</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{i18n 'search.no_results'}}
|
||||
@ -1,10 +0,0 @@
|
||||
<div class="col first email">
|
||||
<div class="overflow-ellipsis" title={{email}}>{{email}}</div>
|
||||
</div>
|
||||
<div class="col action">{{actionName}}</div>
|
||||
<div class="col match_count">{{match_count}}</div>
|
||||
<div class="col last_match_at">{{age-with-tooltip last_match_at}}</div>
|
||||
<div class="col created_at">{{age-with-tooltip created_at}}</div>
|
||||
<div class="col ip_address">{{ip_address}}</div>
|
||||
<div class="col action"><button class="btn" {{action "clearBlock" this}}><i class='fa fa-check'></i> {{i18n 'admin.logs.screened_emails.actions.allow'}}</button></div>
|
||||
<div class="clearfix"></div>
|
||||
@ -1,33 +0,0 @@
|
||||
<p>{{i18n 'admin.logs.screened_ips.description'}}</p>
|
||||
|
||||
<div class="pull-right">
|
||||
{{text-field value=filter class="ip-address-input" placeholderKey="admin.logs.screened_ips.form.filter" autocorrect="off" autocapitalize="off"}}
|
||||
{{d-button action="rollUp" title="admin.logs.screened_ips.roll_up.title" label="admin.logs.screened_ips.roll_up.text"}}
|
||||
{{d-button action="exportScreenedIpList" icon="download" title="admin.export_csv.button_title.screened_ip" label="admin.export_csv.button_text"}}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{screened-ip-address-form action="recordAdded"}}
|
||||
</div>
|
||||
|
||||
{{#conditional-loading-spinner condition=loading}}
|
||||
{{#if model.length}}
|
||||
|
||||
<div class='table admin-logs-table screened-ip-addresses'>
|
||||
<div class="heading-container">
|
||||
<div class="col heading first ip_address">{{i18n 'admin.logs.ip_address'}}</div>
|
||||
<div class="col heading action">{{i18n 'admin.logs.action'}}</div>
|
||||
<div class="col heading match_count">{{i18n 'admin.logs.match_count'}}</div>
|
||||
<div class="col heading last_match_at">{{i18n 'admin.logs.last_match_at'}}</div>
|
||||
<div class="col heading created_at">{{i18n 'admin.logs.created_at'}}</div>
|
||||
<div class="col heading actions"></div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
|
||||
{{screened-ip-addresses-list content=model}}
|
||||
</div>
|
||||
|
||||
{{else}}
|
||||
{{i18n 'search.no_results'}}
|
||||
{{/if}}
|
||||
{{/conditional-loading-spinner}}
|
||||
@ -1,43 +0,0 @@
|
||||
<div class="col first ip_address">
|
||||
{{#if editing}}
|
||||
{{text-field value=ip_address autofocus="autofocus"}}
|
||||
{{else}}
|
||||
<span {{action "edit" this}}>
|
||||
{{#if isRange}}
|
||||
<strong>{{ip_address}}</strong>
|
||||
{{else}}
|
||||
{{ip_address}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col action">
|
||||
{{#if isBlocked}}
|
||||
{{fa-icon "ban"}}
|
||||
{{else}}
|
||||
{{fa-icon "check"}}
|
||||
{{/if}}
|
||||
{{actionName}}
|
||||
</div>
|
||||
<div class="col match_count">{{match_count}}</div>
|
||||
<div class="col last_match_at">
|
||||
{{#if last_match_at}}
|
||||
{{age-with-tooltip last_match_at}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col created_at">{{age-with-tooltip created_at}}</div>
|
||||
<div class="col actions">
|
||||
{{#unless editing}}
|
||||
{{d-button action="destroy" actionParam=this icon="trash-o" class="btn-danger"}}
|
||||
{{d-button action="edit" actionParam=this icon="pencil"}}
|
||||
{{#if isBlocked}}
|
||||
{{d-button action="allow" actionParam=this icon="check" label="admin.logs.screened_ips.actions.do_nothing"}}
|
||||
{{else}}
|
||||
{{d-button action="block" actionParam=this icon="ban" label="admin.logs.screened_ips.actions.block"}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{d-button action="save" actionParam=this label="admin.logs.save"}}
|
||||
<a {{action "cancel" this}}>{{i18n 'cancel'}}</a>
|
||||
{{/unless}}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
@ -1,8 +0,0 @@
|
||||
<div class="col first domain">
|
||||
<div class="overflow-ellipsis" title={{domain}}>{{domain}}</div>
|
||||
</div>
|
||||
<div class="col action">{{actionName}}</div>
|
||||
<div class="col match_count">{{match_count}}</div>
|
||||
<div class="col last_match_at">{{age-with-tooltip last_match_at}}</div>
|
||||
<div class="col created_at">{{age-with-tooltip created_at}}</div>
|
||||
<div class="clearfix"></div>
|
||||
@ -49,10 +49,39 @@
|
||||
</div>
|
||||
|
||||
{{#conditional-loading-spinner condition=loading}}
|
||||
{{#if model.length}}
|
||||
{{staff-action-logs-list content=model}}
|
||||
{{#each model as |item|}}
|
||||
<div class='admin-list-item'>
|
||||
<div class="col value first staff_user">
|
||||
{{#link-to 'adminUser' item.acting_user}}{{avatar item.acting_user imageSize="tiny"}}{{/link-to}}
|
||||
<a {{action "filterByStaffUser" item.acting_user}} class="btn btn-small">{{item.acting_user.username}}</a>
|
||||
</div>
|
||||
<div class="col value action">
|
||||
<a {{action "filterByAction" item}} class="btn btn-small">{{item.actionName}}</a>
|
||||
</div>
|
||||
<div class="col value subject">
|
||||
{{#if item.target_user}}
|
||||
{{#link-to 'adminUser' item.target_user}}{{avatar item.target_user imageSize="tiny"}}{{/link-to}}
|
||||
<a {{action "filterByTargetUser" item.target_user}} class="btn btn-small">{{item.target_user.username}}</a>
|
||||
{{/if}}
|
||||
{{#if item.subject}}
|
||||
<a {{action "filterBySubject" item.subject}} title={{item.subject}} class="btn btn-small">{{item.subject}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col value created_at">{{age-with-tooltip item.created_at}}</div>
|
||||
<div class="col value details">
|
||||
{{{item.formattedDetails}}}
|
||||
{{#if item.useCustomModalForDetails}}
|
||||
<a {{action "showCustomDetailsModal" item}}>{{i18n 'admin.logs.staff_actions.show'}}</a>
|
||||
{{/if}}
|
||||
{{#if item.useModalForDetails}}
|
||||
<a {{action "showDetailsModal" item}}>{{i18n 'admin.logs.staff_actions.show'}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col value context">{{item.context}}</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{i18n 'search.no_results'}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
{{/conditional-loading-spinner}}
|
||||
</div>
|
||||
@ -1,28 +0,0 @@
|
||||
<div class="col value first staff_user">
|
||||
{{#link-to 'adminUser' acting_user}}{{avatar acting_user imageSize="tiny"}}{{/link-to}}
|
||||
<a {{action "filterByStaffUser" acting_user}} class="btn btn-small">{{acting_user.username}}</a>
|
||||
</div>
|
||||
<div class="col value action">
|
||||
<a {{action "filterByAction" this}} class="btn btn-small">{{actionName}}</a>
|
||||
</div>
|
||||
<div class="col value subject">
|
||||
{{#if target_user}}
|
||||
{{#link-to 'adminUser' target_user}}{{avatar target_user imageSize="tiny"}}{{/link-to}}
|
||||
<a {{action "filterByTargetUser" target_user}} class="btn btn-small">{{target_user.username}}</a>
|
||||
{{/if}}
|
||||
{{#if subject}}
|
||||
<a {{action "filterBySubject" subject}} title={{subject}} class="btn btn-small">{{subject}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col value created_at">{{age-with-tooltip created_at}}</div>
|
||||
<div class="col value details">
|
||||
{{{formattedDetails}}}
|
||||
{{#if useCustomModalForDetails}}
|
||||
<a {{action "showCustomDetailsModal" this}}>{{i18n 'admin.logs.staff_actions.show'}}</a>
|
||||
{{/if}}
|
||||
{{#if useModalForDetails}}
|
||||
<a {{action "showDetailsModal" this}}>{{i18n 'admin.logs.staff_actions.show'}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col value context">{{context}}</div>
|
||||
<div class="clearfix"></div>
|
||||
@ -0,0 +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>
|
||||
{{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>
|
||||
{{/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>
|
||||
{{#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>
|
||||
{{/if}}
|
||||
{{/d-modal-body}}
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="badge-query-preview">
|
||||
{{#d-modal-body title="admin.badges.preview.modal_title" class="badge-query-preview"}}
|
||||
{{#if errors}}
|
||||
<p class="error-header">{{i18n 'admin.badges.preview.sql_error_header'}}</p>
|
||||
|
||||
@ -46,4 +46,4 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/d-modal-body}}
|
||||
@ -0,0 +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>
|
||||
{{#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>
|
||||
{{/if}}
|
||||
{{/d-modal-body}}
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="modal-body">
|
||||
{{#d-modal-body title="admin.badges.badge_groupings.modal_title"}}
|
||||
<div>
|
||||
<ul class='badge-groupings'>
|
||||
{{#each workingCopy as |wc|}}
|
||||
@ -20,7 +20,8 @@
|
||||
</ul>
|
||||
</div>
|
||||
<button class='btn' {{action "add"}}>{{i18n 'admin.badges.new'}}</button>
|
||||
</div>
|
||||
{{/d-modal-body}}
|
||||
|
||||
<div class="modal-footer">
|
||||
<button class='btn btn-primary' {{action "saveAll"}} disabled={{submitDisabled}}>{{i18n 'admin.badges.save'}}</button>
|
||||
<a {{action "cancel"}}>{{i18n 'cancel'}}</a>
|
||||
@ -0,0 +1,45 @@
|
||||
{{#d-modal-body class="incoming-emails" title="admin.email.incoming_emails.modal.title"}}
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.error"}}</label>
|
||||
<div class="controls">
|
||||
<p>{{model.error}}</p>
|
||||
{{#if model.error_description}}
|
||||
<p class="error-description">{{model.error_description}}</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.headers"}}</label>
|
||||
<div class="controls">
|
||||
{{textarea value=model.headers wrap="off"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.subject"}}</label>
|
||||
<div class="controls">
|
||||
{{model.subject}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.body"}}</label>
|
||||
<div class="controls">
|
||||
{{textarea value=model.body}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if model.rejection_message}}
|
||||
<hr>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.rejection_message"}}</label>
|
||||
<div class="controls">
|
||||
{{textarea value=model.rejection_message}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/d-modal-body}}
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="modal-body">
|
||||
{{#d-modal-body title="admin.logs.staff_actions.modal_title"}}
|
||||
<pre>{{model.details}}</pre>
|
||||
</div>
|
||||
{{/d-modal-body}}
|
||||
<div class="modal-footer">
|
||||
<button class='btn btn-primary' {{action "closeModal"}}>{{i18n 'close'}}</button>
|
||||
</div>
|
||||
@ -0,0 +1,5 @@
|
||||
{{#d-modal-body title="admin.backups.operations.backup.confirm"}}
|
||||
<button {{action "startBackup"}} class="btn btn-primary">{{i18n 'yes_value'}}</button>
|
||||
<button {{action "startBackupWithoutUpload"}} class="btn">{{i18n 'admin.backups.operations.backup.without_uploads'}}</button>
|
||||
<button {{action "cancel"}} class="btn">{{i18n 'no_value'}}</button>
|
||||
{{/d-modal-body}}
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="modal-body">
|
||||
{{#d-modal-body title="admin.user.suspend_modal_title"}}
|
||||
<form>
|
||||
{{i18n 'admin.user.suspend_duration'}}
|
||||
{{text-field value=duration maxlength="5" autofocus="autofocus"}}
|
||||
@ -8,7 +8,8 @@
|
||||
<br/>
|
||||
{{text-field value=reason class="span8"}}
|
||||
</form>
|
||||
</div>
|
||||
{{/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>
|
||||
<a {{action "closeModal"}}>{{i18n 'cancel'}}</a>
|
||||
@ -1,11 +0,0 @@
|
||||
{{#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>
|
||||
{{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>
|
||||
{{/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>
|
||||
{{#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>
|
||||
{{/if}}
|
||||
@ -1,5 +0,0 @@
|
||||
<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>
|
||||
{{#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>
|
||||
{{/if}}
|
||||
@ -1,45 +0,0 @@
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.error"}}</label>
|
||||
<div class="controls">
|
||||
<p>{{model.error}}</p>
|
||||
{{#if model.error_description}}
|
||||
<p class="error-description">{{model.error_description}}</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.headers"}}</label>
|
||||
<div class="controls">
|
||||
{{textarea value=model.headers wrap="off"}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.subject"}}</label>
|
||||
<div class="controls">
|
||||
{{model.subject}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.body"}}</label>
|
||||
<div class="controls">
|
||||
{{textarea value=model.body}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if model.rejection_message}}
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.email.incoming_emails.modal.rejection_message"}}</label>
|
||||
<div class="controls">
|
||||
{{textarea value=model.rejection_message}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{/if}}
|
||||
@ -1,3 +0,0 @@
|
||||
<button {{action "startBackup"}} class="btn btn-primary">{{i18n 'yes_value'}}</button>
|
||||
<button {{action "startBackupWithoutUpload"}} class="btn">{{i18n 'admin.backups.operations.backup.without_uploads'}}</button>
|
||||
<button {{action "cancel"}} class="btn">{{i18n 'no_value'}}</button>
|
||||
@ -7,26 +7,22 @@
|
||||
<a href {{action "selectPrevious"}}>{{i18n 'admin.logs.staff_actions.previous_value'}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="modal-body">
|
||||
{{#d-modal-body title="admin.logs.staff_actions.modal_title"}}
|
||||
<div class="modal-tab new-tab {{unless newSelected 'invisible'}}">
|
||||
{{#if model.new_value}}
|
||||
{{#with model.new_value}}
|
||||
{{partial "admin/templates/logs/site_customization_change_details"}}
|
||||
{{/with}}
|
||||
{{site-customization-change-details change=model.new_value}}
|
||||
{{else}}
|
||||
{{i18n 'admin.logs.staff_actions.deleted'}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="modal-tab previous-tab {{unless previousSelected 'invisible'}}">
|
||||
{{#if model.previous_value}}
|
||||
{{#with model.previous_value}}
|
||||
{{partial "admin/templates/logs/site_customization_change_details"}}
|
||||
{{/with}}
|
||||
{{site-customization-change-details change=model.previous_value}}
|
||||
{{else}}
|
||||
{{i18n 'admin.logs.staff_actions.no_previous'}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/d-modal-body}}
|
||||
<div class="modal-footer">
|
||||
<button class='btn btn-primary' {{action "closeModal"}}>{{i18n 'close'}}</button>
|
||||
</div>
|
||||
@ -17,7 +17,35 @@
|
||||
<div class="col heading actions"></div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{permalinks-list content=model}}
|
||||
{{#each model as |pl|}}
|
||||
<div class="admin-list-item">
|
||||
<div class="col first url">{{pl.url}}</div>
|
||||
<div class="col topic">
|
||||
{{#if pl.topic_id}}
|
||||
<a href='{{unbound pl.topic_url}}'>{{pl.topic_title}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col post">
|
||||
{{#if pl.post_id}}
|
||||
<a href='{{unbound pl.post_url}}'>#{{pl.post_number}} {{pl.post_topic_title}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col category">
|
||||
{{#if pl.category_id}}
|
||||
<a href='{{unbound pl.category_url}}'>{{pl.category_name}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col external_url">
|
||||
{{#if pl.external_url}}
|
||||
<a href='{{unbound pl.external_url}}'>{{pl.external_url}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col action">
|
||||
{{d-button action="destroy" actionParam=pl icon="trash-o" class="btn-danger"}}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{i18n 'search.no_results'}}
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
<div class="col first url">{{url}}</div>
|
||||
<div class="col topic">
|
||||
{{#if topic_id}}
|
||||
<a href='{{unbound topic_url}}'>{{topic_title}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col post">
|
||||
{{#if post_id}}
|
||||
<a href='{{unbound post_url}}'>#{{post_number}} {{post_topic_title}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col category">
|
||||
{{#if category_id}}
|
||||
<a href='{{unbound category_url}}'>{{category_name}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col external_url">
|
||||
{{#if external_url}}
|
||||
<a href='{{unbound external_url}}'>{{external_url}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
<div class="col action"><button class="btn btn-danger" {{action "destroy" this}}><i class="fa fa-trash-o"></i></button></div>
|
||||
<div class="clearfix"></div>
|
||||
@ -1,4 +1,4 @@
|
||||
{{#if length}}
|
||||
{{#if model.length}}
|
||||
|
||||
{{#if currentUser.admin}}
|
||||
{{d-button label="admin.plugins.change_settings"
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
{{#if filteredContent}}
|
||||
<div class='form-horizontal settings'>
|
||||
{{#d-section class="form-horizontal settings"}}
|
||||
{{#each filteredContent as |setting|}}
|
||||
{{site-setting setting=setting saveAction="saveSetting"}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/d-section}}
|
||||
{{else}}
|
||||
<br/>
|
||||
{{i18n 'admin.site_settings.no_results'}}
|
||||
|
||||
@ -1 +1,3 @@
|
||||
{{outlet}}
|
||||
{{#d-section}}
|
||||
{{outlet}}
|
||||
{{/d-section}}
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
import DiscourseURL from 'discourse/lib/url';
|
||||
|
||||
export default Ember.View.extend({
|
||||
classNames: ["admin-backups"],
|
||||
|
||||
_hijackDownloads: function() {
|
||||
this.$().on("mouseup.admin-backups", "a.download", function (e) {
|
||||
var $link = $(e.currentTarget);
|
||||
|
||||
if (!$link.data("href")) {
|
||||
$link.addClass("no-href");
|
||||
$link.data("href", $link.attr("href"));
|
||||
$link.attr("href", null);
|
||||
$link.data("auto-route", true);
|
||||
}
|
||||
|
||||
DiscourseURL.redirectTo($link.data("href"));
|
||||
});
|
||||
}.on("didInsertElement"),
|
||||
|
||||
_removeBindings: function() {
|
||||
this.$().off("mouseup.admin-backups");
|
||||
}.on("willDestroyElement")
|
||||
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
import ScrollTop from 'discourse/mixins/scroll-top';
|
||||
|
||||
export default Ember.View.extend(ScrollTop);
|
||||
@ -1,7 +0,0 @@
|
||||
import ScrollTop from 'discourse/mixins/scroll-top';
|
||||
|
||||
export default Ember.View.extend(ScrollTop, {
|
||||
_scrollOnModelChange: function() {
|
||||
this._scrollTop();
|
||||
}.observes('controller.model.id')
|
||||
});
|
||||
@ -1,3 +0,0 @@
|
||||
export default Ember.View.extend({
|
||||
templateName: 'admin/templates/customize_colors'
|
||||
});
|
||||
@ -1 +0,0 @@
|
||||
export default Ember.View.extend(Discourse.ScrollTop);
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/modal/admin_agree_flag',
|
||||
title: I18n.t('admin.flags.agree_flag_modal_title')
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/modal/admin_badge_preview',
|
||||
title: I18n.t('admin.badges.preview.modal_title')
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/modal/admin_delete_flag',
|
||||
title: I18n.t('admin.flags.delete_flag_modal_title')
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/modal/admin_edit_badge_groupings',
|
||||
title: I18n.t('admin.badges.badge_groupings.modal_title')
|
||||
});
|
||||
@ -1,7 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/modal/admin_incoming_email',
|
||||
classNames: ['incoming-emails'],
|
||||
title: I18n.t('admin.email.incoming_emails.modal.title')
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/logs/details_modal',
|
||||
title: I18n.t('admin.logs.staff_actions.modal_title')
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/modal/admin_start_backup',
|
||||
title: I18n.t('admin.backups.operations.backup.confirm')
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/modal/admin_suspend_user',
|
||||
title: I18n.t('admin.user.suspend_modal_title')
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/logs/site_customization_change_modal',
|
||||
title: I18n.t('admin.logs.staff_actions.modal_title')
|
||||
});
|
||||
@ -1,6 +0,0 @@
|
||||
import ModalBodyView from "discourse/views/modal-body";
|
||||
|
||||
export default ModalBodyView.extend({
|
||||
templateName: 'admin/templates/logs/site_customization_change_modal',
|
||||
title: I18n.t('admin.logs.staff_actions.modal_title')
|
||||
});
|
||||
@ -2,6 +2,7 @@
|
||||
//= require ./ember-addons/decorator-alias
|
||||
//= require ./ember-addons/macro-alias
|
||||
//= require ./ember-addons/ember-computed-decorators
|
||||
//= require ./ember-addons/fmt
|
||||
//= require_tree ./discourse-common
|
||||
//= require ./discourse
|
||||
//= require ./deprecated
|
||||
@ -24,6 +25,7 @@
|
||||
//= require ./discourse/lib/formatter
|
||||
//= require ./discourse/lib/eyeline
|
||||
//= require ./discourse/mixins/scrolling
|
||||
//= require ./discourse/mixins/scrolling
|
||||
//= require ./discourse/models/model
|
||||
//= require ./discourse/models/rest
|
||||
//= require ./discourse/models/badge-grouping
|
||||
@ -57,10 +59,7 @@
|
||||
//= require ./discourse/models/user-badge
|
||||
//= require ./discourse/controllers/discovery-sortable
|
||||
//= require ./discourse/controllers/navigation/default
|
||||
//= require ./discourse/views/modal-body
|
||||
//= require ./discourse/views/flag
|
||||
//= require ./discourse/components/edit-category-panel
|
||||
//= require ./discourse/views/button
|
||||
//= require ./discourse/components/dropdown-button
|
||||
//= require ./discourse/components/notifications-button
|
||||
//= require ./discourse/lib/link-mentions
|
||||
@ -68,7 +67,6 @@
|
||||
//= require ./discourse/lib/emoji/groups
|
||||
//= require ./discourse/lib/emoji/toolbar
|
||||
//= require ./discourse/components/d-editor
|
||||
//= require ./discourse/views/composer
|
||||
//= require ./discourse/lib/show-modal
|
||||
//= require ./discourse/lib/screen-track
|
||||
//= require ./discourse/routes/discourse
|
||||
@ -90,6 +88,7 @@
|
||||
//= require_tree ./discourse/controllers
|
||||
//= require_tree ./discourse/models
|
||||
//= require_tree ./discourse/components
|
||||
//= require_tree ./discourse/raw-views
|
||||
//= require_tree ./discourse/views
|
||||
//= require_tree ./discourse/helpers
|
||||
//= require_tree ./discourse/templates
|
||||
@ -1,17 +0,0 @@
|
||||
<%
|
||||
|
||||
require_asset ("./main_include.js")
|
||||
|
||||
# Include plugin javascripts/handlebars templates
|
||||
DiscoursePluginRegistry.javascripts.each { |js| require_asset(js) }
|
||||
DiscoursePluginRegistry.handlebars.each { |hb| require_asset(hb) }
|
||||
|
||||
DiscoursePluginRegistry.each_globbed_asset do |f, ext|
|
||||
if File.directory?(f)
|
||||
depend_on(f)
|
||||
elsif f.to_s.end_with?(".#{ext}")
|
||||
require_asset(f)
|
||||
end
|
||||
end
|
||||
|
||||
%>
|
||||
@ -2,10 +2,7 @@
|
||||
// In the long term we'll want to remove this.
|
||||
|
||||
const Mixin = {
|
||||
__bufferTimeout: null,
|
||||
|
||||
_customRender() {
|
||||
Ember.run.cancel(this.__bufferTimeout);
|
||||
if (!this.element || this.isDestroying || this.isDestroyed) { return; }
|
||||
|
||||
const buffer = [];
|
||||
@ -25,20 +22,12 @@ export function bufferedRender(obj) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
const caller = {};
|
||||
const caller = { };
|
||||
|
||||
// True in 1.13 or greater
|
||||
if (Ember.Helper) {
|
||||
caller.didRender = function() {
|
||||
this._super();
|
||||
this._customRender();
|
||||
};
|
||||
} else {
|
||||
caller.didInsertElement = function() {
|
||||
this._super();
|
||||
this._customRender();
|
||||
};
|
||||
}
|
||||
caller.didRender = function() {
|
||||
this._super();
|
||||
this._customRender();
|
||||
};
|
||||
|
||||
const triggers = obj.rerenderTriggers;
|
||||
if (triggers) {
|
||||
|
||||
@ -1,27 +1,16 @@
|
||||
import { get } from 'discourse-common/lib/raw-handlebars';
|
||||
|
||||
// `Ember.Helper` is only available in versions after 1.12
|
||||
export function htmlHelper(fn) {
|
||||
if (Ember.Helper) {
|
||||
return Ember.Helper.helper(function(...args) {
|
||||
args = (args.length > 1) ? args[0].concat({ hash: args[args.length-1] }) : args;
|
||||
return new Handlebars.SafeString(fn.apply(this, args) || '');
|
||||
});
|
||||
} else {
|
||||
return Ember.Handlebars.makeBoundHelper(function() {
|
||||
return new Handlebars.SafeString(fn.apply(this, Array.prototype.slice.call(arguments)) || '');
|
||||
});
|
||||
}
|
||||
return Ember.Helper.helper(function(...args) {
|
||||
args = (args.length > 1) ? args[0].concat({ hash: args[args.length-1] }) : args;
|
||||
return new Handlebars.SafeString(fn.apply(this, args) || '');
|
||||
});
|
||||
}
|
||||
|
||||
const _helpers = {};
|
||||
|
||||
export function registerHelper(name, fn) {
|
||||
if (Ember.Helper) {
|
||||
_helpers[name] = Ember.Helper.helper(fn);
|
||||
} else {
|
||||
return Ember.HTMLBars._registerHelper(name, fn);
|
||||
}
|
||||
_helpers[name] = Ember.Helper.helper(fn);
|
||||
}
|
||||
|
||||
export function findHelper(name) {
|
||||
@ -65,14 +54,8 @@ export function registerUnbound(name, fn) {
|
||||
return fn.call(this, property, resolveParams(this, options));
|
||||
};
|
||||
|
||||
if (Ember.Helper) {
|
||||
_helpers[name] = Ember.Helper.extend({
|
||||
compute: (params, args) => fn(params[0], args)
|
||||
});
|
||||
Handlebars.registerHelper(name, func);
|
||||
return;
|
||||
}
|
||||
|
||||
_helpers[name] = Ember.Helper.extend({
|
||||
compute: (params, args) => fn(params[0], args)
|
||||
});
|
||||
Handlebars.registerHelper(name, func);
|
||||
Ember.Handlebars.registerHelper(name, func);
|
||||
}
|
||||
|
||||
@ -4,22 +4,10 @@ import { findHelper } from 'discourse-common/lib/helpers';
|
||||
var classify = Ember.String.classify;
|
||||
var get = Ember.get;
|
||||
|
||||
var LOADING_WHITELIST = ['badges', 'userActivity', 'userPrivateMessages', 'admin', 'adminFlags',
|
||||
'user', 'preferences', 'adminEmail', 'adminUsersList'];
|
||||
var _dummyRoute;
|
||||
var _loadingView;
|
||||
const _options = {};
|
||||
|
||||
function loadingResolver(cb) {
|
||||
return function(parsedName) {
|
||||
var fullNameWithoutType = parsedName.fullNameWithoutType;
|
||||
|
||||
if (fullNameWithoutType.indexOf('Loading') >= 0) {
|
||||
fullNameWithoutType = fullNameWithoutType.replace('Loading', '');
|
||||
if (LOADING_WHITELIST.indexOf(fullNameWithoutType) !== -1) {
|
||||
return cb(fullNameWithoutType);
|
||||
}
|
||||
}
|
||||
};
|
||||
export function setResolverOption(name, value) {
|
||||
_options[name] = value;
|
||||
}
|
||||
|
||||
function parseName(fullName) {
|
||||
@ -106,7 +94,7 @@ export function buildResolver(baseName) {
|
||||
},
|
||||
|
||||
resolveView(parsedName) {
|
||||
return this.findLoadingView(parsedName) || this.customResolve(parsedName) || this._super(parsedName);
|
||||
return this.customResolve(parsedName) || this._super(parsedName);
|
||||
},
|
||||
|
||||
resolveHelper(parsedName) {
|
||||
@ -128,7 +116,13 @@ export function buildResolver(baseName) {
|
||||
},
|
||||
|
||||
resolveRoute(parsedName) {
|
||||
return this.findLoadingRoute(parsedName) || this.customResolve(parsedName) || this._super(parsedName);
|
||||
return this.customResolve(parsedName) || this._super(parsedName);
|
||||
},
|
||||
|
||||
findLoadingTemplate(parsedName) {
|
||||
if (parsedName.fullNameWithoutType.match(/loading$/)) {
|
||||
return Ember.TEMPLATES.loading;
|
||||
}
|
||||
},
|
||||
|
||||
resolveTemplate(parsedName) {
|
||||
@ -136,36 +130,24 @@ export function buildResolver(baseName) {
|
||||
this.findPluginTemplate(parsedName) ||
|
||||
this.findMobileTemplate(parsedName) ||
|
||||
this.findTemplate(parsedName) ||
|
||||
this.findLoadingTemplate(parsedName) ||
|
||||
Ember.TEMPLATES.not_found;
|
||||
},
|
||||
|
||||
findLoadingRoute: loadingResolver(function() {
|
||||
_dummyRoute = _dummyRoute || Ember.Route.extend();
|
||||
return _dummyRoute;
|
||||
}),
|
||||
|
||||
findLoadingView: loadingResolver(function() {
|
||||
if (!_loadingView) {
|
||||
_loadingView = require('discourse/views/loading', null, null, true /* force sync */);
|
||||
if (_loadingView && _loadingView['default']) { _loadingView = _loadingView['default']; }
|
||||
}
|
||||
return _loadingView;
|
||||
}),
|
||||
|
||||
findPluginTemplate(parsedName) {
|
||||
var pluginParsedName = this.parseName(parsedName.fullName.replace("template:", "template:javascripts/"));
|
||||
return this.findTemplate(pluginParsedName);
|
||||
},
|
||||
|
||||
findPluginMobileTemplate(parsedName) {
|
||||
if (this.mobileView) {
|
||||
if (_options.mobileView) {
|
||||
var pluginParsedName = this.parseName(parsedName.fullName.replace("template:", "template:javascripts/mobile/"));
|
||||
return this.findTemplate(pluginParsedName);
|
||||
}
|
||||
},
|
||||
|
||||
findMobileTemplate(parsedName) {
|
||||
if (this.mobileView) {
|
||||
if (_options.mobileView) {
|
||||
var mobileParsedName = this.parseName(parsedName.fullName.replace("template:", "template:mobile/"));
|
||||
return this.findTemplate(mobileParsedName);
|
||||
}
|
||||
|
||||
@ -1,7 +1,15 @@
|
||||
var define, requireModule, require, requirejs;
|
||||
var define, require, requirejs;
|
||||
|
||||
(function() {
|
||||
|
||||
var MOVED_MODULES = {
|
||||
"discourse/views/list/post-count-or-badges": "discourse/raw-views/list/post-count-or-badges",
|
||||
"discourse/views/list/posts-count-column" : "discourse/raw-views/list/posts-count-column",
|
||||
"discourse/views/list/visited-line" : "discourse/raw-views/list/visited-line",
|
||||
"discourse/views/topic-list-header-column" : "discourse/raw-views/topic-list-header-column",
|
||||
"discourse/views/topic-status" : "discourse/raw-views/topic-status"
|
||||
};
|
||||
|
||||
var _isArray;
|
||||
if (!Array.isArray) {
|
||||
_isArray = function (x) {
|
||||
@ -48,7 +56,7 @@ var define, requireModule, require, requirejs;
|
||||
return this._require || (this._require = function(dep) {
|
||||
return require(resolve(dep, name));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
define = function(name, deps, callback) {
|
||||
if (arguments.length < 2) {
|
||||
@ -76,7 +84,7 @@ var define, requireModule, require, requirejs;
|
||||
return new Alias(path);
|
||||
};
|
||||
|
||||
function reify(mod, name, seen) {
|
||||
function reify(mod, name, rseen) {
|
||||
var deps = mod.deps;
|
||||
var length = deps.length;
|
||||
var reified = new Array(length);
|
||||
@ -88,11 +96,11 @@ var define, requireModule, require, requirejs;
|
||||
for (var i = 0, l = length; i < l; i++) {
|
||||
dep = deps[i];
|
||||
if (dep === 'exports') {
|
||||
module.exports = reified[i] = seen;
|
||||
module.exports = reified[i] = rseen;
|
||||
} else if (dep === 'require') {
|
||||
reified[i] = mod.makeRequire();
|
||||
} else if (dep === 'module') {
|
||||
mod.exports = seen;
|
||||
mod.exports = rseen;
|
||||
module = reified[i] = mod;
|
||||
} else {
|
||||
reified[i] = requireFrom(resolve(dep, name), name);
|
||||
@ -106,7 +114,16 @@ var define, requireModule, require, requirejs;
|
||||
}
|
||||
|
||||
function requireFrom(name, origin) {
|
||||
|
||||
var mod = registry[name];
|
||||
if (!mod) {
|
||||
var moved = MOVED_MODULES[name];
|
||||
if (moved) {
|
||||
console.warn("DEPRECATION: `" + name + "` was moved to `" + moved + "`");
|
||||
}
|
||||
mod = registry[moved];
|
||||
}
|
||||
|
||||
if (!mod) {
|
||||
throw new Error('Could not find module `' + name + '` imported from `' + origin + '`');
|
||||
}
|
||||
@ -116,9 +133,14 @@ var define, requireModule, require, requirejs;
|
||||
function missingModule(name) {
|
||||
throw new Error('Could not find module ' + name);
|
||||
}
|
||||
requirejs = require = requireModule = function(name) {
|
||||
var mod = registry[name];
|
||||
|
||||
requirejs = require = function(name) {
|
||||
|
||||
if (MOVED_MODULES[name]) {
|
||||
name = MOVED_MODULES[name];
|
||||
}
|
||||
|
||||
var mod = registry[name];
|
||||
|
||||
if (mod && mod.callback instanceof Alias) {
|
||||
mod = registry[mod.callback.name];
|
||||
@ -162,6 +184,7 @@ var define, requireModule, require, requirejs;
|
||||
|
||||
return (seen[name] = obj);
|
||||
};
|
||||
window.requireModule = requirejs;
|
||||
|
||||
function resolve(child, name) {
|
||||
if (child.charAt(0) !== '.') { return child; }
|
||||
@ -189,6 +212,6 @@ var define, requireModule, require, requirejs;
|
||||
requirejs.entries = requirejs._eak_seen = registry;
|
||||
requirejs.clear = function() {
|
||||
requirejs.entries = requirejs._eak_seen = registry = {};
|
||||
seen = state = {};
|
||||
seen = {};
|
||||
};
|
||||
})();
|
||||
@ -104,7 +104,14 @@ const Discourse = Ember.Application.extend({
|
||||
if (/\/pre\-initializers\//.test(key)) {
|
||||
const module = require(key, null, null, true);
|
||||
if (!module) { throw new Error(key + ' must export an initializer.'); }
|
||||
Discourse.initializer(module.default);
|
||||
|
||||
const init = module.default;
|
||||
const oldInitialize = init.initialize;
|
||||
init.initialize = function() {
|
||||
oldInitialize.call(this, Discourse.__container__, Discourse);
|
||||
};
|
||||
|
||||
Discourse.initializer(init);
|
||||
}
|
||||
});
|
||||
|
||||
@ -115,8 +122,8 @@ const Discourse = Ember.Application.extend({
|
||||
|
||||
const init = module.default;
|
||||
const oldInitialize = init.initialize;
|
||||
init.initialize = function(app) {
|
||||
oldInitialize.call(this, app.container, Discourse);
|
||||
init.initialize = function() {
|
||||
oldInitialize.call(this, Discourse.__container__, Discourse);
|
||||
};
|
||||
|
||||
Discourse.instanceInitializer(init);
|
||||
|
||||
@ -0,0 +1,34 @@
|
||||
import { observes } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
_slug: null,
|
||||
|
||||
didInsertElement() {
|
||||
this._super();
|
||||
this.refreshClass();
|
||||
},
|
||||
|
||||
_updateClass() {
|
||||
if (this.isDestroying || this.isDestroyed) { return; }
|
||||
const slug = this.get('category.fullSlug');
|
||||
this._removeClass();
|
||||
if (slug) {
|
||||
$("body").addClass(`category-${slug}`);
|
||||
}
|
||||
},
|
||||
|
||||
@observes('category.fullSlug')
|
||||
refreshClass() {
|
||||
Ember.run.scheduleOnce('afterRender', this, this._updateClass);
|
||||
},
|
||||
|
||||
_removeClass() {
|
||||
$("body").removeClass((_, css) => (css.match(/\bcategory-\S+/g) || []).join(" "));
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super();
|
||||
this._removeClass();
|
||||
}
|
||||
|
||||
});
|
||||
@ -1,4 +1,5 @@
|
||||
import { on, observes, default as computed } from 'ember-addons/ember-computed-decorators';
|
||||
import { getOwner } from 'discourse-common/lib/get-owner';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
@computed('placeholderKey')
|
||||
@ -17,7 +18,7 @@ export default Ember.Component.extend({
|
||||
var self = this;
|
||||
var selectedBadges;
|
||||
|
||||
var template = this.container.lookup('template:badge-selector-autocomplete.raw');
|
||||
var template = getOwner(this).lookup('template:badge-selector-autocomplete.raw');
|
||||
self.$('input').autocomplete({
|
||||
allowAny: false,
|
||||
items: _.isArray(this.get('badgeNames')) ? this.get('badgeNames') : [this.get('badgeNames')],
|
||||
|
||||
@ -48,7 +48,7 @@ export default Ember.Component.extend({
|
||||
}
|
||||
|
||||
const topic = this.get('topics').findBy('id', parseInt(topicId));
|
||||
this.sendAction('postsAction', {topic, position: target.offset()});
|
||||
this.appEvents.trigger('topic-entrance:show', { topic, position: target.offset() });
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { categoryBadgeHTML } from 'discourse/helpers/category-link';
|
||||
import Category from 'discourse/models/category';
|
||||
import { on, observes } from 'ember-addons/ember-computed-decorators';
|
||||
import { getOwner } from 'discourse-common/lib/get-owner';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
@observes('categories')
|
||||
@ -12,7 +13,7 @@ export default Ember.Component.extend({
|
||||
@on('didInsertElement')
|
||||
_initializeAutocomplete(opts) {
|
||||
const self = this,
|
||||
template = this.container.lookup('template:category-selector-autocomplete.raw'),
|
||||
template = getOwner(this).lookup('template:category-selector-autocomplete.raw'),
|
||||
regexp = new RegExp(`href=['\"]${Discourse.getURL('/c/')}([^'\"]+)`);
|
||||
|
||||
this.$('input').autocomplete({
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { default as computed, observes } from 'ember-addons/ember-computed-decorators';
|
||||
import Composer from 'discourse/models/composer';
|
||||
import afterTransition from 'discourse/lib/after-transition';
|
||||
import positioningWorkaround from 'discourse/lib/safari-hacks';
|
||||
import { headerHeight } from 'discourse/components/site-header';
|
||||
import { default as computed, on, observes } from 'ember-addons/ember-computed-decorators';
|
||||
import Composer from 'discourse/models/composer';
|
||||
|
||||
const ComposerView = Ember.View.extend({
|
||||
_lastKeyTimeout: null,
|
||||
export default Ember.Component.extend({
|
||||
elementId: 'reply-control',
|
||||
|
||||
classNameBindings: ['composer.creatingPrivateMessage:private-message',
|
||||
'composeState',
|
||||
'composer.loading',
|
||||
@ -15,8 +15,6 @@ const ComposerView = Ember.View.extend({
|
||||
'composer.creatingTopic:topic',
|
||||
'composer.whisper:composing-whisper'],
|
||||
|
||||
composer: Em.computed.alias('controller.model'),
|
||||
|
||||
@computed('composer.composeState')
|
||||
composeState(composeState) {
|
||||
return composeState || Composer.CLOSED;
|
||||
@ -32,6 +30,8 @@ const ComposerView = Ember.View.extend({
|
||||
@observes('composeState', 'composer.action')
|
||||
resize() {
|
||||
Ember.run.scheduleOnce('afterRender', () => {
|
||||
if (!this.element || this.isDestroying || this.isDestroyed) { return; }
|
||||
|
||||
const h = $('#reply-control').height() || 0;
|
||||
this.movePanels(h + "px");
|
||||
|
||||
@ -51,10 +51,7 @@ const ComposerView = Ember.View.extend({
|
||||
},
|
||||
|
||||
keyUp() {
|
||||
const controller = this.get('controller');
|
||||
controller.checkReplyLength();
|
||||
|
||||
this.get('composer').typing();
|
||||
this.sendAction('typed');
|
||||
|
||||
const lastKeyUp = new Date();
|
||||
this._lastKeyUp = lastKeyUp;
|
||||
@ -70,18 +67,17 @@ const ComposerView = Ember.View.extend({
|
||||
|
||||
keyDown(e) {
|
||||
if (e.which === 27) {
|
||||
this.get('controller').send('hitEsc');
|
||||
this.get('controller').send('hideOptions');
|
||||
this.sendAction('cancelled');
|
||||
return false;
|
||||
} else if (e.which === 13 && (e.ctrlKey || e.metaKey)) {
|
||||
// CTRL+ENTER or CMD+ENTER
|
||||
this.get('controller').send('save');
|
||||
this.sendAction('save');
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
@on('didInsertElement')
|
||||
_enableResizing() {
|
||||
didInsertElement() {
|
||||
this._super();
|
||||
const $replyControl = $('#reply-control');
|
||||
const resize = () => Ember.run(() => this.resize());
|
||||
|
||||
@ -113,9 +109,7 @@ const ComposerView = Ember.View.extend({
|
||||
},
|
||||
|
||||
click() {
|
||||
this.get('controller').send('openIfDraft');
|
||||
}
|
||||
});
|
||||
this.sendAction('openIfDraft');
|
||||
},
|
||||
|
||||
RSVP.EventTarget.mixin(ComposerView);
|
||||
export default ComposerView;
|
||||
});
|
||||
@ -6,7 +6,7 @@ import { linkSeenTagHashtags, fetchUnseenTagHashtags } from 'discourse/lib/link-
|
||||
import { load } from 'pretty-text/oneboxer';
|
||||
import { ajax } from 'discourse/lib/ajax';
|
||||
import InputValidation from 'discourse/models/input-validation';
|
||||
|
||||
import { getOwner } from 'discourse-common/lib/get-owner';
|
||||
import { tinyAvatar,
|
||||
displayErrorForUpload,
|
||||
getUploadMarkdown,
|
||||
@ -62,7 +62,7 @@ export default Ember.Component.extend({
|
||||
@on('didInsertElement')
|
||||
_composerEditorInit() {
|
||||
const topicId = this.get('topic.id');
|
||||
const template = this.container.lookup('template:user-selector-autocomplete.raw');
|
||||
const template = getOwner(this).lookup('template:user-selector-autocomplete.raw');
|
||||
const $input = this.$('.d-editor-input');
|
||||
$input.autocomplete({
|
||||
template,
|
||||
@ -137,9 +137,12 @@ export default Ember.Component.extend({
|
||||
},
|
||||
|
||||
_renderUnseenMentions($preview, unseen) {
|
||||
fetchUnseenMentions(unseen).then(() => {
|
||||
// 'Create a New Topic' scenario is not supported (per conversation with codinghorror)
|
||||
// https://meta.discourse.org/t/taking-another-1-7-release-task/51986/7
|
||||
fetchUnseenMentions(unseen, this.get('topic.id')).then(() => {
|
||||
linkSeenMentions($preview, this.siteSettings);
|
||||
this._warnMentionedGroups($preview);
|
||||
this._warnCannotSeeMention($preview);
|
||||
});
|
||||
},
|
||||
|
||||
@ -170,19 +173,33 @@ export default Ember.Component.extend({
|
||||
|
||||
_warnMentionedGroups($preview) {
|
||||
Ember.run.scheduleOnce('afterRender', () => {
|
||||
this._warnedMentions = this._warnedMentions || [];
|
||||
var found = [];
|
||||
var found = this.get('warnedGroupMentions') || [];
|
||||
$preview.find('.mention-group.notify').each((idx,e) => {
|
||||
const $e = $(e);
|
||||
var name = $e.data('name');
|
||||
found.push(name);
|
||||
if (this._warnedMentions.indexOf(name) === -1){
|
||||
this._warnedMentions.push(name);
|
||||
if (found.indexOf(name) === -1){
|
||||
this.sendAction('groupsMentioned', [{name: name, user_count: $e.data('mentionable-user-count')}]);
|
||||
found.push(name);
|
||||
}
|
||||
});
|
||||
|
||||
this._warnedMentions = found;
|
||||
this.set('warnedGroupMentions', found);
|
||||
});
|
||||
},
|
||||
|
||||
_warnCannotSeeMention($preview) {
|
||||
Ember.run.scheduleOnce('afterRender', () => {
|
||||
var found = this.get('warnedCannotSeeMentions') || [];
|
||||
$preview.find('.mention.cannot-see').each((idx,e) => {
|
||||
const $e = $(e);
|
||||
var name = $e.data('name');
|
||||
if (found.indexOf(name) === -1) {
|
||||
this.sendAction('cannotSeeMention', [{name: name}]);
|
||||
found.push(name);
|
||||
}
|
||||
});
|
||||
|
||||
this.set('warnedCannotSeeMentions', found);
|
||||
});
|
||||
},
|
||||
|
||||
@ -490,6 +507,7 @@ export default Ember.Component.extend({
|
||||
}
|
||||
|
||||
this._warnMentionedGroups($preview);
|
||||
this._warnCannotSeeMention($preview);
|
||||
|
||||
// Paint category hashtags
|
||||
const unseenCategoryHashtags = linkSeenCategoryHashtags($preview);
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import { getOwner } from 'discourse-common/lib/get-owner';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNameBindings: [':composer-popup', ':hidden', 'message.extraClass'],
|
||||
|
||||
@computed('message.templateName')
|
||||
defaultLayout(templateName) {
|
||||
return this.container.lookup(`template:composer/${templateName}`);
|
||||
layout(templateName) {
|
||||
return getOwner(this).lookup(`template:composer/${templateName}`);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user