diff --git a/Gemfile b/Gemfile index cf663f22a9..10d3088d62 100644 --- a/Gemfile +++ b/Gemfile @@ -67,17 +67,19 @@ unless Bundler::Dependency::PLATFORM_MAP.include? :mri_21 end end -gem 'seed-fu', '~> 2.3.3' if rails_master? gem 'arel', git: 'https://github.com/rails/arel.git' gem 'rails', git: 'https://github.com/rails/rails.git' + gem 'rails-observers', git: 'https://github.com/SamSaffron/rails-observers.git' + gem 'seed-fu', git: 'https://github.com/SamSaffron/seed-fu.git', branch: 'discourse' else + gem 'seed-fu', '~> 2.3.3' gem 'rails' + gem 'rails-observers' end gem 'actionpack-action_caching' -gem 'rails-observers' # Rails 4.1.6+ will relax the mail gem version requirement to `~> 2.5, >= 2.5.4`. # However, mail gem 2.6.x currently does not work with discourse because of the @@ -118,11 +120,7 @@ gem 'fastimage' gem 'fog', '1.22.1', require: false gem 'unf', require: false -# see: https://twitter.com/samsaffron/status/412360162297393152 -# Massive amount of changes made in branch we use, no PR upstreamed -# We need to get this sorted -# https://github.com/samsaffron/email_reply_parser -gem 'email_reply_parser-discourse', require: 'email_reply_parser' +gem 'email_reply_parser' # note: for image_optim to correctly work you need # sudo apt-get install -y advancecomp gifsicle jpegoptim libjpeg-progs optipng pngcrush @@ -144,8 +142,15 @@ gem 'omniauth-github-discourse', require: 'omniauth-github' gem 'omniauth-oauth2', require: false gem 'omniauth-google-oauth2' gem 'oj' -# while resolving https://groups.google.com/forum/#!topic/ruby-pg/5_ylGmog1S4 -gem 'pg', '0.15.1' + +if rails_master? + # native casting + gem 'pg', '0.18.0.pre20141117110243' +else + # while resolving https://groups.google.com/forum/#!topic/ruby-pg/5_ylGmog1S4 + gem 'pg', '0.15.1' +end + gem 'pry-rails', require: false gem 'rake' diff --git a/Gemfile.lock b/Gemfile.lock index 0f56e0cbc1..dc78e8f6d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -65,7 +65,7 @@ GEM dotenv (0.11.1) dotenv-deployment (~> 0.0.2) dotenv-deployment (0.0.2) - email_reply_parser-discourse (0.6) + email_reply_parser (0.5.8) ember-data-source (0.14) ember-source ember-rails (0.14.1) @@ -82,7 +82,7 @@ GEM erubis (2.7.0) eventmachine (1.0.3) excon (0.39.6) - execjs (2.2.1) + execjs (2.2.2) exifr (1.1.3) fabrication (2.9.8) fakeweb (1.3.0) @@ -99,7 +99,7 @@ GEM fastimage (1.6.3) addressable (~> 2.3, >= 2.3.5) ffi (1.9.5) - flamegraph (0.0.8) + flamegraph (0.0.9) fast_stack fog (1.22.1) fog-brightbox @@ -185,7 +185,7 @@ GEM net-ssh (>= 2.6.5) net-ssh (2.9.1) netrc (0.7.7) - nokogiri (1.6.4.1) + nokogiri (1.6.5) mini_portile (~> 0.6.0) nokogumbo (1.1.12) nokogiri @@ -273,7 +273,7 @@ GEM rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) raindrops (0.13.0) - rake (10.3.2) + rake (10.4.0) rake-compiler (0.9.3) rake rb-fsevent (0.9.4) @@ -390,7 +390,7 @@ GEM trollop (2.0) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (2.5.3) + uglifier (2.6.0) execjs (>= 0.3.0) json (>= 1.8.0) unf (0.1.4) @@ -412,7 +412,7 @@ DEPENDENCIES better_errors binding_of_caller certified - email_reply_parser-discourse + email_reply_parser ember-rails ember-source (= 1.6.0.beta.2) eventmachine diff --git a/Gemfile_master.lock b/Gemfile_master.lock index c962d2baec..c3f6d3a39b 100644 --- a/Gemfile_master.lock +++ b/Gemfile_master.lock @@ -7,66 +7,26 @@ GIT activemodel (>= 3.0) GIT - remote: https://github.com/rails/arel.git - revision: 1fefe71b1872c0a83f09231164863cd8dbb57174 + remote: https://github.com/SamSaffron/rails-observers.git + revision: 7d2222d758603a004f6599f82a7068ffeb2d7ebf specs: - arel (6.0.0) + rails-observers (0.1.2) + activemodel (> 4.0) GIT - remote: https://github.com/rails/rails.git - revision: 2f8be7ebafcf7815f9f3ec7983789157525a60fa + remote: https://github.com/SamSaffron/seed-fu.git + revision: d93df3b6364ea938d87c5629bf950b0d1ffe037e + branch: discourse specs: - actionmailer (4.2.0.beta4) - actionpack (= 4.2.0.beta4) - actionview (= 4.2.0.beta4) - activejob (= 4.2.0.beta4) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 1.0, >= 1.0.5) - actionpack (4.2.0.beta4) - actionview (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) - rack (~> 1.6.0.beta) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - actionview (4.2.0.beta4) - activesupport (= 4.2.0.beta4) - builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) - rails-html-sanitizer (~> 1.0, >= 1.0.1) - activejob (4.2.0.beta4) - activesupport (= 4.2.0.beta4) - globalid (>= 0.3.0) - activemodel (4.2.0.beta4) - activesupport (= 4.2.0.beta4) - builder (~> 3.1) - activerecord (4.2.0.beta4) - activemodel (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) - arel (~> 6.0) - activesupport (4.2.0.beta4) - i18n (>= 0.7.0.beta1, < 0.8) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.1) - tzinfo (~> 1.1) - rails (4.2.0.beta4) - actionmailer (= 4.2.0.beta4) - actionpack (= 4.2.0.beta4) - actionview (= 4.2.0.beta4) - activejob (= 4.2.0.beta4) - activemodel (= 4.2.0.beta4) - activerecord (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) - bundler (>= 1.3.0, < 2.0) - railties (= 4.2.0.beta4) - sprockets-rails (~> 3.0.0.beta1) - railties (4.2.0.beta4) - actionpack (= 4.2.0.beta4) - activesupport (= 4.2.0.beta4) - rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) + seed-fu (2.3.3) + activerecord (>= 3.1) + activesupport (>= 3.1) + +GIT + remote: https://github.com/rails/arel.git + revision: 98fc25991137ee09b6800578117f8c1c322680f2 + specs: + arel (6.0.0) GIT remote: https://github.com/rails/sass-rails.git @@ -78,6 +38,61 @@ GIT sprockets (~> 2.12) sprockets-rails (>= 2.0, < 4.0) +PATH + remote: ../rails + specs: + actionmailer (5.0.0.alpha) + actionpack (= 5.0.0.alpha) + actionview (= 5.0.0.alpha) + activejob (= 5.0.0.alpha) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (5.0.0.alpha) + actionview (= 5.0.0.alpha) + activesupport (= 5.0.0.alpha) + rack (~> 1.6.0.beta2) + rack-test (~> 0.6.2) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + actionview (5.0.0.alpha) + activesupport (= 5.0.0.alpha) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 1.0, >= 1.0.5) + rails-html-sanitizer (~> 1.0, >= 1.0.1) + activejob (5.0.0.alpha) + activesupport (= 5.0.0.alpha) + globalid (>= 0.3.0) + activemodel (5.0.0.alpha) + activesupport (= 5.0.0.alpha) + builder (~> 3.1) + activerecord (5.0.0.alpha) + activemodel (= 5.0.0.alpha) + activesupport (= 5.0.0.alpha) + arel (~> 6.0) + activesupport (5.0.0.alpha) + i18n (>= 0.7.0.beta1, < 0.8) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.1) + tzinfo (~> 1.1) + rails (5.0.0.alpha) + actionmailer (= 5.0.0.alpha) + actionpack (= 5.0.0.alpha) + actionview (= 5.0.0.alpha) + activejob (= 5.0.0.alpha) + activemodel (= 5.0.0.alpha) + activerecord (= 5.0.0.alpha) + activesupport (= 5.0.0.alpha) + bundler (>= 1.3.0, < 2.0) + railties (= 5.0.0.alpha) + sprockets-rails + railties (5.0.0.alpha) + actionpack (= 5.0.0.alpha) + activesupport (= 5.0.0.alpha) + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + PATH remote: vendor/gems/rails_multisite specs: @@ -150,7 +165,7 @@ GEM fastimage (1.6.3) addressable (~> 2.3, >= 2.3.5) ffi (1.9.5) - flamegraph (0.0.8) + flamegraph (0.0.9) fast_stack fog (1.22.1) fog-brightbox @@ -285,7 +300,7 @@ GEM openid-redis-store (0.0.2) redis ruby-openid - pg (0.15.1) + pg (0.18.0.pre20141117110243) polyglot (0.3.5) progress (3.0.1) pry (0.10.1) @@ -300,7 +315,7 @@ GEM rack (>= 1.1, < 2.0) qunit-rails (0.0.7) railties - rack (1.6.0.beta) + rack (1.6.0.beta2) rack-mini-profiler (0.9.2) rack (>= 1.1.3) rack-openid (1.3.1) @@ -318,8 +333,6 @@ GEM rails-deprecated_sanitizer (>= 1.0.1) rails-html-sanitizer (1.0.1) loofah (~> 2.0) - rails-observers (0.1.2) - activemodel (~> 4.0) raindrops (0.13.0) rake (10.4.0) rake-compiler (0.9.3) @@ -373,9 +386,6 @@ GEM nokogiri (>= 1.4.4) nokogumbo (= 1.1.12) sass (3.2.19) - seed-fu (2.3.3) - activerecord (>= 3.1, < 4.2) - activesupport (>= 3.1, < 4.2) shoulda (3.5.0) shoulda-context (~> 1.0, >= 1.0.1) shoulda-matchers (>= 1.4.1, < 3.0) @@ -498,7 +508,7 @@ DEPENDENCIES omniauth-twitter onebox openid-redis-store - pg (= 0.15.1) + pg (= 0.18.0.pre20141117110243) pry-nav pry-rails puma @@ -506,7 +516,7 @@ DEPENDENCIES rack-mini-profiler rack-protection rails! - rails-observers + rails-observers! rails_multisite! rake rb-fsevent @@ -525,7 +535,7 @@ DEPENDENCIES sanitize sass sass-rails! - seed-fu (~> 2.3.3) + seed-fu! shoulda sidekiq simple-rss diff --git a/README.md b/README.md index ae82fb76fc..006e797675 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ To learn more about the philosophy and goals of the project, [visit **discourse. ## Screenshots -[![](https://raw2.github.com/discourse/discourse-docimages/master/readme/boing-boing-latest-small2.png)](http://bbs.boingboing.net) -[![](https://raw2.github.com/discourse/discourse-docimages/master/readme/how-to-geek-profile-small2.png?breakcache=1)](http://discuss.howtogeek.com) -[![](https://raw2.github.com/discourse/discourse-docimages/master/readme/new-relic-categories-small2.png)](http://discuss.newrelic.com) -[![](https://raw2.github.com/discourse/discourse-docimages/master/readme/turtle-rock-topic-small2.jpg)](https://talk.turtlerockstudios.com/) -[![](https://raw.github.com/discourse/discourse-docimages/master/readme/nexus-7-mobile-discourse-small3.png)](http://discuss.atom.io) -[![](https://raw.github.com/discourse/discourse-docimages/master/readme/iphone-5s-mobile-discourse-small4.png)](http://discourse.soylent.me) +[![](https://raw.githubusercontent.com/discourse/discourse-docimages/master/readme/boing-boing-latest-small2.png)](http://bbs.boingboing.net) +[![](https://raw.githubusercontent.com/discourse/discourse-docimages/master/readme/how-to-geek-profile-small2.png)](http://discuss.howtogeek.com) +[![](https://raw.githubusercontent.com/discourse/discourse-docimages/master/readme/new-relic-categories-small2.png)](http://discuss.newrelic.com) +[![](https://raw.githubusercontent.com/discourse/discourse-docimages/master/readme/turtle-rock-topic-small2.jpg)](https://talk.turtlerockstudios.com/) +[![](https://raw.githubusercontent.com/discourse/discourse-docimages/master/readme/nexus-7-mobile-discourse-small3.png)](http://discuss.atom.io) +[![](https://raw.githubusercontent.com/discourse/discourse-docimages/master/readme/iphone-5s-mobile-discourse-small4.png)](http://discourse.soylent.me) ## Development diff --git a/app/assets/javascripts/admin.js.erb b/app/assets/javascripts/admin.js.erb index 3c536f4ca6..ce47046a21 100644 --- a/app/assets/javascripts/admin.js.erb +++ b/app/assets/javascripts/admin.js.erb @@ -1,12 +1,5 @@ <% -if Rails.env.development? - require_asset ("development/list-view.js") -else - require_asset ("production/list-view.js") -end - require_asset("main_include_admin.js") DiscoursePluginRegistry.admin_javascripts.each { |js| require_asset(js) } - %> diff --git a/app/assets/javascripts/admin/components/resumable_upload_component.js b/app/assets/javascripts/admin/components/resumable_upload_component.js index 3e3c1ad6fc..a5ef4af921 100644 --- a/app/assets/javascripts/admin/components/resumable_upload_component.js +++ b/app/assets/javascripts/admin/components/resumable_upload_component.js @@ -9,13 +9,8 @@ error="errorAction" uploadText="UPLOAD" }} - - @class ResumableUploadComponent - @extends Ember.Component - @namespace Discourse - @module Discourse **/ -Discourse.ResumableUploadComponent = Ember.Component.extend({ +Discourse.ResumableUploadComponent = Ember.Component.extend(Discourse.StringBuffer, { tagName: "button", classNames: ["btn", "ru"], classNameBindings: ["isUploading"], @@ -25,7 +20,7 @@ Discourse.ResumableUploadComponent = Ember.Component.extend({ isUploading: false, progress: 0, - shouldRerender: Discourse.View.renderIfChanged("isUploading", "progress"), + rerenderTriggers: ['isUploading', 'progress'], text: function() { if (this.get("isUploading")) { @@ -35,7 +30,7 @@ Discourse.ResumableUploadComponent = Ember.Component.extend({ } }.property("isUploading", "progress"), - render: function(buffer) { + renderString: function(buffer) { var icon = this.get("isUploading") ? "times" : "upload"; buffer.push(""); buffer.push("" + this.get("text") + ""); diff --git a/app/assets/javascripts/admin/controllers/admin-logs-screened-emails.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-screened-emails.js.es6 index 2b4bd0e29c..745a172d2e 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-screened-emails.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-screened-emails.js.es6 @@ -1,3 +1,5 @@ +import { outputExportResult } from 'admin/lib/export-result'; + export default Ember.ArrayController.extend(Discourse.Presence, { loading: false, @@ -7,12 +9,16 @@ export default Ember.ArrayController.extend(Discourse.Presence, { // feeling lazy window.location.reload(); }); + }, + + exportScreenedEmailList: function(subject) { + Discourse.ExportCsv.exportScreenedEmailList().then(outputExportResult); } }, show: function() { var self = this; - this.set('loading', true); + self.set('loading', true); Discourse.ScreenedEmail.findAll().then(function(result) { self.set('model', result); self.set('loading', false); diff --git a/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js.es6 index 414461edac..b06c74d04e 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-screened-ip-addresses.js.es6 @@ -1,10 +1,12 @@ +import { outputExportResult } from 'admin/lib/export-result'; + export default Ember.ArrayController.extend(Discourse.Presence, { loading: false, itemController: 'admin-log-screened-ip-address', show: function() { var self = this; - this.set('loading', true); + self.set('loading', true); Discourse.ScreenedIpAddress.findAll().then(function(result) { self.set('model', result); self.set('loading', false); @@ -34,6 +36,10 @@ export default Ember.ArrayController.extend(Discourse.Presence, { }); } }); + }, + + exportScreenedIpList: function(subject) { + Discourse.ExportCsv.exportScreenedIpList().then(outputExportResult); } } }); diff --git a/app/assets/javascripts/admin/controllers/admin-logs-screened-urls.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-screened-urls.js.es6 index 92cb40e496..49637494c8 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-screened-urls.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-screened-urls.js.es6 @@ -1,12 +1,20 @@ +import { outputExportResult } from 'admin/lib/export-result'; + export default Ember.ArrayController.extend(Discourse.Presence, { loading: false, show: function() { var self = this; - this.set('loading', true); + self.set('loading', true); Discourse.ScreenedUrl.findAll().then(function(result) { self.set('model', result); self.set('loading', false); }); + }, + + actions: { + exportScreenedUrlList: function(subject) { + Discourse.ExportCsv.exportScreenedUrlList().then(outputExportResult); + } } }); diff --git a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 index 76df4a3b60..9d04374931 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 @@ -6,6 +6,8 @@ @namespace Discourse @module Discourse **/ +import { outputExportResult } from 'admin/lib/export-result'; + export default Ember.ArrayController.extend(Discourse.Presence, { loading: false, filters: {}, @@ -60,6 +62,10 @@ export default Ember.ArrayController.extend(Discourse.Presence, { filterBySubject: function(subject) { this.set('filters.subject', subject); + }, + + exportStaffActionLogs: function(subject) { + Discourse.ExportCsv.exportStaffActionLogs().then(outputExportResult); } } }); diff --git a/app/assets/javascripts/admin/lib/export-result.js.es6 b/app/assets/javascripts/admin/lib/export-result.js.es6 new file mode 100644 index 0000000000..da1058d564 --- /dev/null +++ b/app/assets/javascripts/admin/lib/export-result.js.es6 @@ -0,0 +1,7 @@ +export function outputExportResult(result) { + if (result.success) { + bootbox.alert(I18n.t("admin.export_csv.success")); + } else { + bootbox.alert(I18n.t("admin.export_csv.failed")); + } +} diff --git a/app/assets/javascripts/admin/models/admin_user.js b/app/assets/javascripts/admin/models/admin_user.js index c89b540973..06dd114e47 100644 --- a/app/assets/javascripts/admin/models/admin_user.js +++ b/app/assets/javascripts/admin/models/admin_user.js @@ -298,9 +298,7 @@ Discourse.AdminUser = Discourse.User.extend({ }); }, - deleteForbidden: function() { - return (!this.get('can_be_deleted') || this.get('post_count') > 0); - }.property('post_count'), + deleteForbidden: Em.computed.not("canBeDeleted"), deleteExplanation: function() { if (this.get('deleteForbidden')) { @@ -316,9 +314,10 @@ Discourse.AdminUser = Discourse.User.extend({ destroy: function(opts) { var user = this; + var location = document.location.pathname; var performDestroy = function(block) { - var formData = { context: window.location.pathname }; + var formData = { context: location }; if (block) { formData["block_email"] = true; formData["block_urls"] = true; @@ -332,7 +331,7 @@ Discourse.AdminUser = Discourse.User.extend({ data: formData }).then(function(data) { if (data.deleted) { - document.location = "/admin/users/list/active"; + document.location = location; } else { bootbox.alert(I18n.t("admin.user.delete_failed")); if (data.user) { diff --git a/app/assets/javascripts/admin/models/export_csv.js b/app/assets/javascripts/admin/models/export_csv.js index b747cd449b..082ddeb001 100644 --- a/app/assets/javascripts/admin/models/export_csv.js +++ b/app/assets/javascripts/admin/models/export_csv.js @@ -15,15 +15,42 @@ Discourse.ExportCsv.reopenClass({ @method export_user_list **/ exportUserList: function() { - return Discourse.ajax("/admin/export_csv/users.json"); + return Discourse.ajax("/admin/export_csv/export_entity.json", {data: {entity: 'user'}}); }, /** - Exports screened IPs list + Exports staff action logs - @method export_screened_ips_list + @method export_staff_action_logs **/ - exportScreenedIpsList: function() { - return Discourse.ajax("/admin/export_csv/screened_ips.json"); + exportStaffActionLogs: function() { + return Discourse.ajax("/admin/export_csv/export_entity.json", {data: {entity: 'staff_action'}}); + }, + + /** + Exports screened email list + + @method export_screened_email_list + **/ + exportScreenedEmailList: function() { + return Discourse.ajax("/admin/export_csv/export_entity.json", {data: {entity: 'screened_email'}}); + }, + + /** + Exports screened IP list + + @method export_screened_ip_list + **/ + exportScreenedIpList: function() { + return Discourse.ajax("/admin/export_csv/export_entity.json", {data: {entity: 'screened_ip'}}); + }, + + /** + Exports screened URL list + + @method export_screened_url_list + **/ + exportScreenedUrlList: function() { + return Discourse.ajax("/admin/export_csv/export_entity.json", {data: {entity: 'screened_url'}}); } }); diff --git a/app/assets/javascripts/admin/models/site_setting.js b/app/assets/javascripts/admin/models/site_setting.js index 2990d908cc..aa43219b49 100644 --- a/app/assets/javascripts/admin/models/site_setting.js +++ b/app/assets/javascripts/admin/models/site_setting.js @@ -1,11 +1,3 @@ -/** - Our data model for interacting with site settings. - - @class SiteSetting - @extends Discourse.Model - @namespace Discourse - @module Discourse -**/ Discourse.SiteSetting = Discourse.Model.extend({ validationMessage: null, diff --git a/app/assets/javascripts/admin/routes/admin-logs.js.es6 b/app/assets/javascripts/admin/routes/admin-logs.js.es6 deleted file mode 100644 index a16a9f1a6b..0000000000 --- a/app/assets/javascripts/admin/routes/admin-logs.js.es6 +++ /dev/null @@ -1,15 +0,0 @@ -export default Discourse.Route.extend({ - - actions: { - exportScreenedIps: function() { - Discourse.ExportCsv.exportScreenedIpsList().then(function(result) { - if (result.success) { - bootbox.alert(I18n.t("admin.export_csv.success")); - } else { - bootbox.alert(I18n.t("admin.export_csv.failed")); - } - }); - } - } - -}); diff --git a/app/assets/javascripts/admin/routes/admin-users-list.js.es6 b/app/assets/javascripts/admin/routes/admin-users-list.js.es6 new file mode 100644 index 0000000000..bf460971bb --- /dev/null +++ b/app/assets/javascripts/admin/routes/admin-users-list.js.es6 @@ -0,0 +1,19 @@ +export default Discourse.Route.extend({ + + actions: { + exportUsers: function() { + Discourse.ExportCsv.exportUserList().then(function(result) { + if (result.success) { + bootbox.alert(I18n.t("admin.export_csv.success")); + } else { + bootbox.alert(I18n.t("admin.export_csv.failed")); + } + }); + }, + + deleteUser: function(user) { + Discourse.AdminUser.create(user).destroy({ deletePosts: true }); + } + } + +}); diff --git a/app/assets/javascripts/admin/templates/admin.hbs b/app/assets/javascripts/admin/templates/admin.hbs index 09eadbdb7d..27f4ec3010 100644 --- a/app/assets/javascripts/admin/templates/admin.hbs +++ b/app/assets/javascripts/admin/templates/admin.hbs @@ -4,24 +4,24 @@
diff --git a/app/assets/javascripts/admin/templates/api.hbs b/app/assets/javascripts/admin/templates/api.hbs index 3807e1e681..13267da911 100644 --- a/app/assets/javascripts/admin/templates/api.hbs +++ b/app/assets/javascripts/admin/templates/api.hbs @@ -1,8 +1,8 @@ {{#if model}} - - + + {{#each model}} @@ -14,20 +14,20 @@ {{avatar user imageSize="small"}} {{/link-to}} {{else}} - {{i18n admin.api.all_users}} + {{i18n 'admin.api.all_users'}} {{/if}} {{/each}}
{{i18n admin.api.key}}{{i18n admin.api.user}}{{i18n 'admin.api.key'}}{{i18n 'admin.api.user'}}  
- - + +
{{else}} -

{{i18n admin.api.none}}

+

{{i18n 'admin.api.none'}}

{{/if}} {{#unless hasMasterKey}} - + {{/unless }} diff --git a/app/assets/javascripts/admin/templates/backups.hbs b/app/assets/javascripts/admin/templates/backups.hbs index 3ccbfce80b..e700cff02e 100644 --- a/app/assets/javascripts/admin/templates/backups.hbs +++ b/app/assets/javascripts/admin/templates/backups.hbs @@ -1,18 +1,18 @@
{{#if canRollback}} - + {{/if}} {{#if isOperationRunning}} - + {{else}} - + {{/if}}
diff --git a/app/assets/javascripts/admin/templates/backups_index.hbs b/app/assets/javascripts/admin/templates/backups_index.hbs index 486bf3027c..bfbedd1be2 100644 --- a/app/assets/javascripts/admin/templates/backups_index.hbs +++ b/app/assets/javascripts/admin/templates/backups_index.hbs @@ -1,7 +1,7 @@ - - + + {{else}} - + diff --git a/app/assets/javascripts/admin/templates/badges-index.hbs b/app/assets/javascripts/admin/templates/badges-index.hbs index 5bb47c2170..fcb54478d8 100644 --- a/app/assets/javascripts/admin/templates/badges-index.hbs +++ b/app/assets/javascripts/admin/templates/badges-index.hbs @@ -1,9 +1,9 @@
-

{{i18n admin.badges.none_selected}}

+

{{i18n 'admin.badges.none_selected'}}

{{#link-to 'adminBadges.show' 'new' class="btn"}} - {{fa-icon "plus"}} {{i18n admin.badges.new}} + {{fa-icon "plus"}} {{i18n 'admin.badges.new'}} {{/link-to}}
diff --git a/app/assets/javascripts/admin/templates/badges-show.hbs b/app/assets/javascripts/admin/templates/badges-show.hbs index e12957320d..79b2589ff9 100644 --- a/app/assets/javascripts/admin/templates/badges-show.hbs +++ b/app/assets/javascripts/admin/templates/badges-show.hbs @@ -1,31 +1,31 @@
- + {{input type="text" name="name" value=buffered.name}}
{{#if showDisplayName}}
- {{i18n admin.badges.display_name}} + {{i18n 'admin.badges.display_name'}} {{buffered.displayName}}
{{/if}}
- + {{input type="text" name="name" value=buffered.icon}} -

{{i18n admin.badges.icon_help}}

+

{{i18n 'admin.badges.icon_help'}}

- + {{input type="text" name="name" value=buffered.image}} -

{{i18n admin.badges.icon_help}}

+

{{i18n 'admin.badges.icon_help'}}

- + {{view Ember.Select name="badge_type_id" value=buffered.badge_type_id content=badgeTypes @@ -35,7 +35,7 @@
- + {{view Ember.Select name="badge_grouping_id" value=buffered.badge_grouping_id content=badgeGroupings @@ -46,7 +46,7 @@
- + {{#if canEditDescription}} {{textarea name="description" value=buffered.description}} {{else}} @@ -55,34 +55,34 @@
- + {{textarea name="query" value=buffered.query disabled=readOnly}}
{{#if hasQuery}} - {{i18n admin.badges.preview.link_text}} + {{i18n 'admin.badges.preview.link_text'}} | - {{i18n admin.badges.preview.plan_text}} + {{i18n 'admin.badges.preview.plan_text'}} {{#if preview_loading}} - {{i18n loading}}... + {{i18n 'loading'}}... {{/if}}
- + {{view Ember.Select name="trigger" value=buffered.trigger content=badgeTriggers @@ -95,43 +95,43 @@
- + {{savingStatus}} {{#unless readOnly}} - {{i18n admin.badges.delete}} + {{i18n 'admin.badges.delete'}} {{/unless}}
@@ -140,7 +140,7 @@ {{#if grant_count}}
- {{#link-to 'badges.show' this}}{{i18n badges.granted count=grant_count}}{{/link-to}} + {{#link-to 'badges.show' this}}{{i18n 'badges.granted' count=grant_count}}{{/link-to}}
{{/if}} diff --git a/app/assets/javascripts/admin/templates/badges.hbs b/app/assets/javascripts/admin/templates/badges.hbs index fe2d7ce80a..efee80a608 100644 --- a/app/assets/javascripts/admin/templates/badges.hbs +++ b/app/assets/javascripts/admin/templates/badges.hbs @@ -1,21 +1,21 @@
-

{{i18n admin.badges.title}}

+

{{i18n 'admin.badges.title'}}

    {{#each}}
  • {{#link-to 'adminBadges.show' id}} {{badge-button badge=this}} {{#if newBadge}} - {{i18n filters.new.lower_title}} + {{i18n 'filters.new.lower_title'}} {{/if}} {{/link-to}}
  • {{/each}}
{{#link-to 'adminBadges.show' 'new' class="btn"}} - {{fa-icon "plus"}} {{i18n admin.badges.new}} + {{fa-icon "plus"}} {{i18n 'admin.badges.new'}} {{/link-to}}

diff --git a/app/assets/javascripts/admin/templates/customize.hbs b/app/assets/javascripts/admin/templates/customize.hbs index 8ac29110e1..6b0c1214b4 100644 --- a/app/assets/javascripts/admin/templates/customize.hbs +++ b/app/assets/javascripts/admin/templates/customize.hbs @@ -1,10 +1,10 @@
diff --git a/app/assets/javascripts/admin/templates/customize_colors.hbs b/app/assets/javascripts/admin/templates/customize_colors.hbs index 2f35d97e37..c82b5cd9a6 100644 --- a/app/assets/javascripts/admin/templates/customize_colors.hbs +++ b/app/assets/javascripts/admin/templates/customize_colors.hbs @@ -1,5 +1,5 @@
-

{{i18n admin.customize.colors.long_title}}

+

{{i18n 'admin.customize.colors.long_title'}}

    {{#each model}} {{#unless is_base}} @@ -7,7 +7,7 @@ {{/unless}} {{/each}}
- +
{{#if selectedItem}} @@ -17,16 +17,16 @@

{{text-field class="style-name" value=name}}

- + - - + + {{savingStatus}}
{{/with}} @@ -37,7 +37,7 @@
@@ -47,7 +47,7 @@
- + @@ -61,20 +61,20 @@ {{/each}}
{{i18n admin.backups.columns.filename}}{{i18n admin.backups.columns.size}}{{i18n 'admin.backups.columns.filename'}}{{i18n 'admin.backups.columns.size'}}
{{resumable-upload target="/admin/backups/upload" success="uploadSuccess" error="uploadError" uploadText=uploadText}} @@ -15,15 +15,15 @@
{{human-size backup.size}}
- {{i18n admin.backups.operations.download.text}} + {{i18n 'admin.backups.operations.download.text'}} - +
{{i18n admin.backups.none}}{{i18n 'admin.backups.none'}}
{{i18n admin.customize.color}}{{i18n 'admin.customize.color'}}
{{color-input hexValue=hex brightnessValue=brightness valid=valid}} - - + +
{{else}} -

{{i18n search.no_results}}

+

{{i18n 'search.no_results'}}

{{/if}}
{{else}} -

{{i18n admin.customize.colors.about}}

+

{{i18n 'admin.customize.colors.about'}}

{{/if}}
diff --git a/app/assets/javascripts/admin/templates/customize_css_html.hbs b/app/assets/javascripts/admin/templates/customize_css_html.hbs index 57bccda499..28c1b8cce1 100644 --- a/app/assets/javascripts/admin/templates/customize_css_html.hbs +++ b/app/assets/javascripts/admin/templates/customize_css_html.hbs @@ -1,12 +1,12 @@
-

{{i18n admin.customize.css_html.long_title}}

+

{{i18n 'admin.customize.css_html.long_title'}}

@@ -17,12 +17,12 @@
@@ -37,23 +37,23 @@ {{/with}}
- {{i18n admin.customize.override_default}} {{view Ember.Checkbox checkedBinding="selectedItem.override_default_style"}} - {{i18n admin.customize.enabled}} {{view Ember.Checkbox checkedBinding="selectedItem.enabled"}} + {{i18n 'admin.customize.override_default'}} {{view Ember.Checkbox checkedBinding="selectedItem.override_default_style"}} + {{i18n 'admin.customize.enabled'}} {{view Ember.Checkbox checkedBinding="selectedItem.enabled"}} {{#unless selectedItem.changed}} - {{i18n admin.customize.preview}} + {{i18n 'admin.customize.preview'}} | - {{i18n admin.customize.undo_preview}} + {{i18n 'admin.customize.undo_preview'}} | - {{i18n admin.customize.rescue_preview}}
+ {{i18n 'admin.customize.rescue_preview'}}
{{/unless}}
- + {{selectedItem.savingStatus}} - {{i18n admin.customize.delete}} + {{i18n 'admin.customize.delete'}}
{{else}} -

{{i18n admin.customize.about}}

+

{{i18n 'admin.customize.about'}}

{{/if}} diff --git a/app/assets/javascripts/admin/templates/dashboard.hbs b/app/assets/javascripts/admin/templates/dashboard.hbs index 97d0390ded..4438803dc3 100644 --- a/app/assets/javascripts/admin/templates/dashboard.hbs +++ b/app/assets/javascripts/admin/templates/dashboard.hbs @@ -24,15 +24,15 @@
- + - + - + - +
{{i18n admin.dashboard.admins}} {{i18n 'admin.dashboard.admins'}} {{#link-to 'adminUsersList.show' 'admins'}}{{admins}}{{/link-to}} {{i18n admin.dashboard.suspended}} {{i18n 'admin.dashboard.suspended'}} {{#link-to 'adminUsersList.show' 'suspended'}}{{suspended}}{{/link-to}}
{{i18n admin.dashboard.moderators}} {{i18n 'admin.dashboard.moderators'}} {{#link-to 'adminUsersList.show' 'moderators'}}{{moderators}}{{/link-to}} {{i18n admin.dashboard.blocked}} {{i18n 'admin.dashboard.blocked'}} {{#link-to 'adminUsersList.show' 'blocked'}}{{blocked}}{{/link-to}}
@@ -43,11 +43,11 @@   - {{i18n admin.dashboard.reports.today}} - {{i18n admin.dashboard.reports.yesterday}} - {{i18n admin.dashboard.reports.last_7_days}} - {{i18n admin.dashboard.reports.last_30_days}} - {{i18n admin.dashboard.reports.all}} + {{i18n 'admin.dashboard.reports.today'}} + {{i18n 'admin.dashboard.reports.yesterday'}} + {{i18n 'admin.dashboard.reports.last_7_days'}} + {{i18n 'admin.dashboard.reports.last_30_days'}} + {{i18n 'admin.dashboard.reports.all'}} {{#unless loading}} @@ -67,12 +67,12 @@ - - - - - - + + + + + + {{#unless loading}} @@ -90,10 +90,10 @@ - - - - + + + + {{#unless loading}} @@ -110,7 +110,7 @@

- {{i18n admin.dashboard.problems_found}} + {{i18n 'admin.dashboard.problems_found'}}

- {{i18n admin.dashboard.last_checked}}: {{problemsTimestamp}} - + {{i18n 'admin.dashboard.last_checked'}}: {{problemsTimestamp}} +

@@ -130,8 +130,8 @@
 

- {{i18n admin.dashboard.no_problems}} - + {{i18n 'admin.dashboard.no_problems'}} +

@@ -143,7 +143,7 @@
{{i18n admin.dashboard.private_messages_short}}{{i18n admin.dashboard.reports.today}}{{i18n admin.dashboard.reports.yesterday}}{{i18n admin.dashboard.reports.last_7_days}}{{i18n admin.dashboard.reports.last_30_days}}{{i18n admin.dashboard.reports.all}} {{i18n 'admin.dashboard.private_messages_short'}}{{i18n 'admin.dashboard.reports.today'}}{{i18n 'admin.dashboard.reports.yesterday'}}{{i18n 'admin.dashboard.reports.last_7_days'}}{{i18n 'admin.dashboard.reports.last_30_days'}}{{i18n 'admin.dashboard.reports.all'}}
 {{i18n admin.dashboard.reports.today}}{{i18n admin.dashboard.reports.yesterday}}{{i18n admin.dashboard.reports.7_days_ago}}{{i18n admin.dashboard.reports.30_days_ago}}{{i18n 'admin.dashboard.reports.today'}}{{i18n 'admin.dashboard.reports.yesterday'}}{{i18n 'admin.dashboard.reports.7_days_ago'}}{{i18n 'admin.dashboard.reports.30_days_ago'}}
- + @@ -170,7 +170,7 @@
{{top_referred_topics.title}} ({{i18n admin.dashboard.reports.last_30_days}}){{top_referred_topics.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}}) {{top_referred_topics.ytitles.num_clicks}}
- + @@ -193,7 +193,7 @@
{{top_traffic_sources.title}} ({{i18n admin.dashboard.reports.last_30_days}}){{top_traffic_sources.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}}) {{top_traffic_sources.ytitles.num_clicks}} {{top_traffic_sources.ytitles.num_topics}}
- + @@ -215,7 +215,7 @@
-
{{i18n admin.dashboard.last_updated}} {{updatedTimestamp}}
+
{{i18n 'admin.dashboard.last_updated'}} {{updatedTimestamp}}
diff --git a/app/assets/javascripts/admin/templates/email.hbs b/app/assets/javascripts/admin/templates/email.hbs index 14ee7296f1..40057afbe2 100644 --- a/app/assets/javascripts/admin/templates/email.hbs +++ b/app/assets/javascripts/admin/templates/email.hbs @@ -1,11 +1,11 @@
diff --git a/app/assets/javascripts/admin/templates/email_all.hbs b/app/assets/javascripts/admin/templates/email_all.hbs index 702499c6b4..505d152e14 100644 --- a/app/assets/javascripts/admin/templates/email_all.hbs +++ b/app/assets/javascripts/admin/templates/email_all.hbs @@ -1,16 +1,16 @@
{{top_referrers.title}} ({{i18n admin.dashboard.reports.last_30_days}}){{top_referrers.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}}) {{top_referrers.ytitles.num_clicks}} {{top_referrers.ytitles.num_topics}}
- - - - - + + + + + - + @@ -33,7 +33,7 @@ {{else}} - + {{/each}}
{{i18n admin.email.time}}{{i18n admin.email.user}}{{i18n admin.email.to_address}}{{i18n admin.email.email_type}}{{i18n admin.email.skipped_reason}}{{i18n 'admin.email.time'}}{{i18n 'admin.email.user'}}{{i18n 'admin.email.to_address'}}{{i18n 'admin.email.email_type'}}{{i18n 'admin.email.skipped_reason'}}
{{i18n admin.email.logs.filters.title}}{{i18n 'admin.email.logs.filters.title'}} {{text-field value=filter.user placeholderKey="admin.email.logs.filters.user_placeholder"}} {{text-field value=filter.address placeholderKey="admin.email.logs.filters.address_placeholder"}} {{text-field value=filter.type placeholderKey="admin.email.logs.filters.type_placeholder"}}{{skipped_reason}}
{{i18n admin.email.logs.none}}
{{i18n 'admin.email.logs.none'}}
diff --git a/app/assets/javascripts/admin/templates/email_index.hbs b/app/assets/javascripts/admin/templates/email_index.hbs index 461435534c..89efb036ae 100644 --- a/app/assets/javascripts/admin/templates/email_index.hbs +++ b/app/assets/javascripts/admin/templates/email_index.hbs @@ -1,6 +1,6 @@ - + @@ -14,14 +14,14 @@
{{#if sendingEmail}} -
{{i18n admin.email.sending_test}}
+
{{i18n 'admin.email.sending_test'}}
{{else}}
{{text-field value=testEmailAddress placeholderKey="admin.email.test_email_address"}}
- - {{#if sentTestEmail}}{{i18n admin.email.sent_test}}{{/if}} + + {{#if sentTestEmail}}{{i18n 'admin.email.sent_test'}}{{/if}}
{{/if}}
diff --git a/app/assets/javascripts/admin/templates/email_preview_digest.hbs b/app/assets/javascripts/admin/templates/email_preview_digest.hbs index b9119e5ead..d5f3f932b2 100644 --- a/app/assets/javascripts/admin/templates/email_preview_digest.hbs +++ b/app/assets/javascripts/admin/templates/email_preview_digest.hbs @@ -1,19 +1,19 @@ -

{{i18n admin.email.preview_digest_desc}}

+

{{i18n 'admin.email.preview_digest_desc'}}

- + {{input type="date" value=lastSeen id="last-seen"}}
- +
- + {{#if showHtml}} - {{i18n admin.email.html}} | {{i18n admin.email.text}} + {{i18n 'admin.email.html'}} | {{i18n 'admin.email.text'}} {{else}} - {{i18n admin.email.html}} | {{i18n admin.email.text}} + {{i18n 'admin.email.html'}} | {{i18n 'admin.email.text'}} {{/if}}
diff --git a/app/assets/javascripts/admin/templates/email_sent.hbs b/app/assets/javascripts/admin/templates/email_sent.hbs index f3c2cc436b..6c61a7799e 100644 --- a/app/assets/javascripts/admin/templates/email_sent.hbs +++ b/app/assets/javascripts/admin/templates/email_sent.hbs @@ -1,16 +1,16 @@
{{i18n admin.email.delivery_method}}{{i18n 'admin.email.delivery_method'}} {{model.delivery_method}}
- - - - - + + + + + - + @@ -33,7 +33,7 @@ {{else}} - + {{/each}}
{{i18n admin.email.sent_at}}{{i18n admin.email.user}}{{i18n admin.email.to_address}}{{i18n admin.email.email_type}}{{i18n admin.email.reply_key}}{{i18n 'admin.email.sent_at'}}{{i18n 'admin.email.user'}}{{i18n 'admin.email.to_address'}}{{i18n 'admin.email.email_type'}}{{i18n 'admin.email.reply_key'}}
{{i18n admin.email.logs.filters.title}}{{i18n 'admin.email.logs.filters.title'}} {{text-field value=filter.user placeholderKey="admin.email.logs.filters.user_placeholder"}} {{text-field value=filter.address placeholderKey="admin.email.logs.filters.address_placeholder"}} {{text-field value=filter.type placeholderKey="admin.email.logs.filters.type_placeholder"}}{{reply_key}}
{{i18n admin.email.logs.none}}
{{i18n 'admin.email.logs.none'}}
diff --git a/app/assets/javascripts/admin/templates/email_skipped.hbs b/app/assets/javascripts/admin/templates/email_skipped.hbs index 702499c6b4..505d152e14 100644 --- a/app/assets/javascripts/admin/templates/email_skipped.hbs +++ b/app/assets/javascripts/admin/templates/email_skipped.hbs @@ -1,16 +1,16 @@ - - - - - + + + + + - + @@ -33,7 +33,7 @@ {{else}} - + {{/each}}
{{i18n admin.email.time}}{{i18n admin.email.user}}{{i18n admin.email.to_address}}{{i18n admin.email.email_type}}{{i18n admin.email.skipped_reason}}{{i18n 'admin.email.time'}}{{i18n 'admin.email.user'}}{{i18n 'admin.email.to_address'}}{{i18n 'admin.email.email_type'}}{{i18n 'admin.email.skipped_reason'}}
{{i18n admin.email.logs.filters.title}}{{i18n 'admin.email.logs.filters.title'}} {{text-field value=filter.user placeholderKey="admin.email.logs.filters.user_placeholder"}} {{text-field value=filter.address placeholderKey="admin.email.logs.filters.address_placeholder"}} {{text-field value=filter.type placeholderKey="admin.email.logs.filters.type_placeholder"}}{{skipped_reason}}
{{i18n admin.email.logs.none}}
{{i18n 'admin.email.logs.none'}}
diff --git a/app/assets/javascripts/admin/templates/flags-list.hbs b/app/assets/javascripts/admin/templates/flags-list.hbs index 3afa757d08..e6079d5658 100644 --- a/app/assets/javascripts/admin/templates/flags-list.hbs +++ b/app/assets/javascripts/admin/templates/flags-list.hbs @@ -4,8 +4,8 @@ - {{i18n admin.flags.flagged_by}} - {{#if adminOldFlagsView}}{{i18n admin.flags.resolved_by}}{{/if}} + {{i18n 'admin.flags.flagged_by'}} + {{#if adminOldFlagsView}}{{i18n 'admin.flags.resolved_by'}}{{/if}} @@ -16,12 +16,12 @@ {{#if flaggedPost.postAuthorFlagged}} {{#if flaggedPost.user}} {{#link-to 'adminUser' flaggedPost.user}}{{avatar flaggedPost.user imageSize="small"}}{{/link-to}} - {{#if flaggedPost.wasEdited}}{{/if}} + {{#if flaggedPost.wasEdited}}{{/if}} {{/if}} {{/if}} {{#if adminActiveFlagsView}} {{#if flaggedPost.previous_flags_count}} - {{flaggedPost.previous_flags_count}} + {{flaggedPost.previous_flags_count}} {{/if}} {{/if}} @@ -78,7 +78,7 @@ {{format-age disposedAt}} {{{dispositionIcon}}} {{#if tookAction}} - + {{/if}} @@ -95,7 +95,7 @@
- {{{i18n admin.flags.topic_flagged}}} {{i18n admin.flags.visit_topic}} + {{{i18n 'admin.flags.topic_flagged'}}} {{i18n 'admin.flags.visit_topic'}}
@@ -114,12 +114,12 @@

{{#link-to 'adminUser' reply.user}}{{avatar reply.user imageSize="small"}}{{/link-to}} {{{reply.excerpt}}} {{#if hasMore}} - {{i18n admin.flags.more}} + {{i18n 'admin.flags.more'}} {{/if}}

{{/if}} - + {{/if}}
@@ -130,14 +130,14 @@ {{#if adminActiveFlagsView}} - + {{#if flaggedPost.postHidden}} - + {{else}} - + {{/if}} - - + + {{/if}} @@ -149,5 +149,5 @@ {{loading-spinner condition=view.loading}} {{else}} -

{{i18n admin.flags.no_results}}

+

{{i18n 'admin.flags.no_results'}}

{{/if}} diff --git a/app/assets/javascripts/admin/templates/flags.hbs b/app/assets/javascripts/admin/templates/flags.hbs index 78e11492bf..e99f63cfa5 100644 --- a/app/assets/javascripts/admin/templates/flags.hbs +++ b/app/assets/javascripts/admin/templates/flags.hbs @@ -1,8 +1,8 @@
diff --git a/app/assets/javascripts/admin/templates/group.hbs b/app/assets/javascripts/admin/templates/group.hbs index 396e39b88c..e37eb39a7d 100644 --- a/app/assets/javascripts/admin/templates/group.hbs +++ b/app/assets/javascripts/admin/templates/group.hbs @@ -5,25 +5,25 @@ {{/if}}
- +
{{user-selector usernames=usernames id="group-users" placeholderKey="admin.groups.selector_placeholder" tabindex="1" disabled=automatic}}
- {{input type="checkbox" checked=visible}} {{i18n groups.visible}} + {{input type="checkbox" checked=visible}} {{i18n 'groups.visible'}}
- +
{{combo-box valueAttribute="value" value=alias_level content=aliasLevelOptions}}
- + {{#unless automatic}} - + {{/unless}}
diff --git a/app/assets/javascripts/admin/templates/groups.hbs b/app/assets/javascripts/admin/templates/groups.hbs index aac3928e60..061bf715de 100644 --- a/app/assets/javascripts/admin/templates/groups.hbs +++ b/app/assets/javascripts/admin/templates/groups.hbs @@ -1,6 +1,6 @@
-

{{i18n admin.groups.edit}}

+

{{i18n 'admin.groups.edit'}}

- - + +
diff --git a/app/assets/javascripts/admin/templates/groups_index.hbs b/app/assets/javascripts/admin/templates/groups_index.hbs index 5c29aa24ae..f8a3f440e6 100644 --- a/app/assets/javascripts/admin/templates/groups_index.hbs +++ b/app/assets/javascripts/admin/templates/groups_index.hbs @@ -1 +1 @@ -{{i18n admin.groups.about}} +{{i18n 'admin.groups.about'}} diff --git a/app/assets/javascripts/admin/templates/logs.hbs b/app/assets/javascripts/admin/templates/logs.hbs index 483381353c..c85bb02d7c 100644 --- a/app/assets/javascripts/admin/templates/logs.hbs +++ b/app/assets/javascripts/admin/templates/logs.hbs @@ -1,16 +1,13 @@
-
- -
diff --git a/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.hbs b/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.hbs index f3f5acf196..eced3892f9 100644 --- a/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.hbs +++ b/app/assets/javascripts/admin/templates/logs/_site_customization_change_details.hbs @@ -1,22 +1,22 @@
- {{i18n admin.customize.css}}: + {{i18n 'admin.customize.css'}}: {{#if stylesheet}} - ({{i18n character_count count=stylesheet.length}}) + ({{i18n 'character_count' count=stylesheet.length}}) {{/if}}
{{textarea value=stylesheet class="plain"}}
- {{i18n admin.customize.header}}: + {{i18n 'admin.customize.header'}}: {{#if header}} - ({{i18n character_count count=header.length}}) + ({{i18n 'character_count' count=header.length}}) {{/if}}
{{textarea value=header class="plain"}}
- {{i18n admin.customize.enabled}}: {{enabled}} + {{i18n 'admin.customize.enabled'}}: {{enabled}}
- {{i18n admin.customize.override_default}}: {{override_default_style}} + {{i18n 'admin.customize.override_default'}}: {{override_default_style}}
diff --git a/app/assets/javascripts/admin/templates/logs/details_modal.hbs b/app/assets/javascripts/admin/templates/logs/details_modal.hbs index 232e993736..d789dd9cc8 100644 --- a/app/assets/javascripts/admin/templates/logs/details_modal.hbs +++ b/app/assets/javascripts/admin/templates/logs/details_modal.hbs @@ -2,5 +2,5 @@
{{details}}
diff --git a/app/assets/javascripts/admin/templates/logs/screened_emails.hbs b/app/assets/javascripts/admin/templates/logs/screened_emails.hbs index d61eb44574..f231c39194 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_emails.hbs +++ b/app/assets/javascripts/admin/templates/logs/screened_emails.hbs @@ -1,16 +1,20 @@ -

{{i18n admin.logs.screened_emails.description}}

+

+ {{i18n 'admin.logs.screened_emails.description'}} + +

+
{{#loading-spinner condition=loading}} {{#if model.length}}
- -
{{i18n admin.logs.action}}
-
{{i18n admin.logs.match_count}}
-
{{i18n admin.logs.last_match_at}}
-
{{i18n admin.logs.created_at}}
-
{{i18n admin.logs.ip_address}}
+ +
{{i18n 'admin.logs.action'}}
+
{{i18n 'admin.logs.match_count'}}
+
{{i18n 'admin.logs.last_match_at'}}
+
{{i18n 'admin.logs.created_at'}}
+
{{i18n 'admin.logs.ip_address'}}
@@ -19,6 +23,6 @@
{{else}} - {{i18n search.no_results}} + {{i18n 'search.no_results'}} {{/if}} {{/loading-spinner}} diff --git a/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.hbs b/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.hbs index 9cbd963f87..7522d0af63 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.hbs +++ b/app/assets/javascripts/admin/templates/logs/screened_emails_list_item.hbs @@ -6,5 +6,5 @@
{{age-with-tooltip last_match_at}}
{{age-with-tooltip created_at}}
{{ip_address}}
-
+
diff --git a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses.hbs b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses.hbs index 4a4350fafa..c1b27eb88f 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses.hbs +++ b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses.hbs @@ -1,5 +1,8 @@ -

{{i18n admin.logs.screened_ips.description}}

- +

{{i18n 'admin.logs.screened_ips.description'}}

+
+ + +
{{screened-ip-address-form action="recordAdded"}}
@@ -8,11 +11,11 @@
-
{{i18n admin.logs.ip_address}}
-
{{i18n admin.logs.action}}
-
{{i18n admin.logs.match_count}}
-
{{i18n admin.logs.last_match_at}}
-
{{i18n admin.logs.created_at}}
+
{{i18n 'admin.logs.ip_address'}}
+
{{i18n 'admin.logs.action'}}
+
{{i18n 'admin.logs.match_count'}}
+
{{i18n 'admin.logs.last_match_at'}}
+
{{i18n 'admin.logs.created_at'}}
@@ -21,6 +24,6 @@
{{else}} - {{i18n search.no_results}} + {{i18n 'search.no_results'}} {{/if}} {{/loading-spinner}} diff --git a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.hbs b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.hbs index ed9e7fe8b2..94bc4155e9 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.hbs +++ b/app/assets/javascripts/admin/templates/logs/screened_ip_addresses_list_item.hbs @@ -27,13 +27,13 @@ {{#if isBlocked}} - + {{else}} - + {{/if}} {{else}} - - {{i18n cancel}} + + {{i18n 'cancel'}} {{/unless}}
diff --git a/app/assets/javascripts/admin/templates/logs/screened_urls.hbs b/app/assets/javascripts/admin/templates/logs/screened_urls.hbs index 4a87eaf9ce..701909ff56 100644 --- a/app/assets/javascripts/admin/templates/logs/screened_urls.hbs +++ b/app/assets/javascripts/admin/templates/logs/screened_urls.hbs @@ -1,20 +1,24 @@ -

{{i18n admin.logs.screened_urls.description}}

+

+ {{i18n 'admin.logs.screened_urls.description'}} + +

+
{{#loading-spinner condition=loading}} {{#if model.length}}
-
{{i18n admin.logs.screened_urls.domain}}
-
{{i18n admin.logs.action}}
-
{{i18n admin.logs.match_count}}
-
{{i18n admin.logs.last_match_at}}
-
{{i18n admin.logs.created_at}}
+
{{i18n 'admin.logs.screened_urls.domain'}}
+
{{i18n 'admin.logs.action'}}
+
{{i18n 'admin.logs.match_count'}}
+
{{i18n 'admin.logs.last_match_at'}}
+
{{i18n 'admin.logs.created_at'}}
{{view 'screened-urls-list' content=controller}}
{{else}} - {{i18n search.no_results}} + {{i18n 'search.no_results'}} {{/if}} {{/loading-spinner}} diff --git a/app/assets/javascripts/admin/templates/logs/site_customization_change_modal.hbs b/app/assets/javascripts/admin/templates/logs/site_customization_change_modal.hbs index 301ebd9d5b..7fb1a8d253 100644 --- a/app/assets/javascripts/admin/templates/logs/site_customization_change_modal.hbs +++ b/app/assets/javascripts/admin/templates/logs/site_customization_change_modal.hbs @@ -1,10 +1,10 @@
@@ -23,11 +23,11 @@ {{partial "admin/templates/logs/site_customization_change_details"}} {{/with}} {{else}} - {{i18n admin.logs.staff_actions.no_previous}} + {{i18n 'admin.logs.staff_actions.no_previous'}} {{/if}}
diff --git a/app/assets/javascripts/admin/templates/logs/staff_action_logs.hbs b/app/assets/javascripts/admin/templates/logs/staff_action_logs.hbs index c12978703a..10ae175053 100644 --- a/app/assets/javascripts/admin/templates/logs/staff_action_logs.hbs +++ b/app/assets/javascripts/admin/templates/logs/staff_action_logs.hbs @@ -1,45 +1,50 @@
- {{i18n admin.logs.staff_actions.clear_filters}} + {{i18n 'admin.logs.staff_actions.clear_filters'}} {{#if actionFilter}} - {{i18n admin.logs.action}}: {{actionFilter}} + {{i18n 'admin.logs.action'}}: {{actionFilter}} {{/if}} {{#if filters.acting_user}} - {{i18n admin.logs.staff_actions.staff_user}}: {{filters.acting_user}} + {{i18n 'admin.logs.staff_actions.staff_user'}}: {{filters.acting_user}} {{/if}} {{#if filters.target_user}} - {{i18n admin.logs.staff_actions.target_user}}: {{filters.target_user}} + {{i18n 'admin.logs.staff_actions.target_user'}}: {{filters.target_user}} {{/if}} {{#if filters.subject}} - {{i18n admin.logs.staff_actions.subject}}: {{filters.subject}} + {{i18n 'admin.logs.staff_actions.subject'}}: {{filters.subject}} {{/if}}
+
+ +
+
+
- {{i18n admin.logs.staff_actions.instructions}} + {{i18n 'admin.logs.staff_actions.instructions'}}
-
{{i18n admin.logs.staff_actions.staff_user}}
-
{{i18n admin.logs.action}}
-
{{i18n admin.logs.staff_actions.subject}}
-
{{i18n admin.logs.staff_actions.when}}
-
{{i18n admin.logs.staff_actions.details}}
-
{{i18n admin.logs.staff_actions.context}}
+
{{i18n 'admin.logs.staff_actions.staff_user'}}
+
{{i18n 'admin.logs.action'}}
+
{{i18n 'admin.logs.staff_actions.subject'}}
+
{{i18n 'admin.logs.staff_actions.when'}}
+
{{i18n 'admin.logs.staff_actions.details'}}
+
{{i18n 'admin.logs.staff_actions.context'}}
@@ -47,7 +52,7 @@ {{#if model.length}} {{view "staff-action-logs-list" content=controller}} {{else}} - {{i18n search.no_results}} + {{i18n 'search.no_results'}} {{/if}} {{/loading-spinner}}
diff --git a/app/assets/javascripts/admin/templates/logs/staff_action_logs_list_item.hbs b/app/assets/javascripts/admin/templates/logs/staff_action_logs_list_item.hbs index c0be5acc5a..cbcea891af 100644 --- a/app/assets/javascripts/admin/templates/logs/staff_action_logs_list_item.hbs +++ b/app/assets/javascripts/admin/templates/logs/staff_action_logs_list_item.hbs @@ -18,10 +18,10 @@
{{{formattedDetails}}} {{#if useCustomModalForDetails}} - {{i18n admin.logs.staff_actions.show}} + {{i18n 'admin.logs.staff_actions.show'}} {{/if}} {{#if useModalForDetails}} - {{i18n admin.logs.staff_actions.show}} + {{i18n 'admin.logs.staff_actions.show'}} {{/if}}
{{context}}
diff --git a/app/assets/javascripts/admin/templates/modal/admin_agree_flag.hbs b/app/assets/javascripts/admin/templates/modal/admin_agree_flag.hbs index 324d6f7bc5..14e1ae9c51 100644 --- a/app/assets/javascripts/admin/templates/modal/admin_agree_flag.hbs +++ b/app/assets/javascripts/admin/templates/modal/admin_agree_flag.hbs @@ -1,11 +1,11 @@ {{#if user_deleted}} - + {{else}} {{#unless postHidden}} - + {{/unless}} {{/if}} - + {{#if canDeleteAsSpammer}} - + {{/if}} diff --git a/app/assets/javascripts/admin/templates/modal/admin_badge_preview.hbs b/app/assets/javascripts/admin/templates/modal/admin_badge_preview.hbs index d05abafdca..835a105cda 100644 --- a/app/assets/javascripts/admin/templates/modal/admin_badge_preview.hbs +++ b/app/assets/javascripts/admin/templates/modal/admin_badge_preview.hbs @@ -1,31 +1,31 @@
{{#if errors}} -

{{i18n admin.badges.preview.sql_error_header}}

+

{{i18n 'admin.badges.preview.sql_error_header'}}

{{errors}}
{{else}} -

{{{i18n admin.badges.preview.grant_count count=count}}}

+

{{{i18n 'admin.badges.preview.grant_count' count=count}}}

{{#if count_warning}}
-

{{i18n admin.badges.preview.bad_count_warning.header}}

-

{{i18n admin.badges.preview.bad_count_warning.text}}

+

{{i18n 'admin.badges.preview.bad_count_warning.header'}}

+

{{i18n 'admin.badges.preview.bad_count_warning.text'}}

{{/if}} {{#if sample}}

- {{i18n admin.badges.preview.sample}} + {{i18n 'admin.badges.preview.sample'}}

- + diff --git a/app/assets/javascripts/admin/templates/modal/admin_start_backup.hbs b/app/assets/javascripts/admin/templates/modal/admin_start_backup.hbs index 4967f31e6b..93a3a96bc9 100644 --- a/app/assets/javascripts/admin/templates/modal/admin_start_backup.hbs +++ b/app/assets/javascripts/admin/templates/modal/admin_start_backup.hbs @@ -1,3 +1,3 @@ - - - + + + diff --git a/app/assets/javascripts/admin/templates/modal/admin_suspend_user.hbs b/app/assets/javascripts/admin/templates/modal/admin_suspend_user.hbs index 1f31982469..7a82cc0712 100644 --- a/app/assets/javascripts/admin/templates/modal/admin_suspend_user.hbs +++ b/app/assets/javascripts/admin/templates/modal/admin_suspend_user.hbs @@ -1,15 +1,15 @@ diff --git a/app/assets/javascripts/admin/templates/reports.hbs b/app/assets/javascripts/admin/templates/reports.hbs index e1f011b5a4..98e7097408 100644 --- a/app/assets/javascripts/admin/templates/reports.hbs +++ b/app/assets/javascripts/admin/templates/reports.hbs @@ -1,22 +1,22 @@

{{title}}

- {{i18n admin.dashboard.reports.start_date}} {{input type="date" value=startDate}} - {{i18n admin.dashboard.reports.end_date}} {{input type="date" value=endDate}} - + {{i18n 'admin.dashboard.reports.start_date'}} {{input type="date" value=startDate}} + {{i18n 'admin.dashboard.reports.end_date'}} {{input type="date" value=endDate}} +
{{#if viewingTable}} - {{i18n admin.dashboard.reports.view_table}} + {{i18n 'admin.dashboard.reports.view_table'}} {{else}} - {{i18n admin.dashboard.reports.view_table}} + {{i18n 'admin.dashboard.reports.view_table'}} {{/if}} | {{#if viewingBarChart}} - {{i18n admin.dashboard.reports.view_chart}} + {{i18n 'admin.dashboard.reports.view_chart'}} {{else}} - {{i18n admin.dashboard.reports.view_chart}} + {{i18n 'admin.dashboard.reports.view_chart'}} {{/if}}
diff --git a/app/assets/javascripts/admin/templates/site_settings.hbs b/app/assets/javascripts/admin/templates/site_settings.hbs index 440c919d21..e1bbacc1f7 100644 --- a/app/assets/javascripts/admin/templates/site_settings.hbs +++ b/app/assets/javascripts/admin/templates/site_settings.hbs @@ -2,12 +2,12 @@
{{text-field value=filter placeholderKey="type_to_filter"}} - +
diff --git a/app/assets/javascripts/admin/templates/site_settings/setting_bool.hbs b/app/assets/javascripts/admin/templates/site_settings/setting_bool.hbs index 66939c4da7..2e1a5c9971 100644 --- a/app/assets/javascripts/admin/templates/site_settings/setting_bool.hbs +++ b/app/assets/javascripts/admin/templates/site_settings/setting_bool.hbs @@ -14,6 +14,6 @@ {{else}} {{#if overridden}} - + {{/if}} {{/if}} diff --git a/app/assets/javascripts/admin/templates/site_settings/setting_enum.hbs b/app/assets/javascripts/admin/templates/site_settings/setting_enum.hbs index c53b1cf5d7..9a9ff20fce 100644 --- a/app/assets/javascripts/admin/templates/site_settings/setting_enum.hbs +++ b/app/assets/javascripts/admin/templates/site_settings/setting_enum.hbs @@ -12,6 +12,6 @@ {{else}} {{#if overridden}} - + {{/if}} {{/if}} diff --git a/app/assets/javascripts/admin/templates/site_settings/setting_list.hbs b/app/assets/javascripts/admin/templates/site_settings/setting_list.hbs index f50e4214ff..802a53324e 100644 --- a/app/assets/javascripts/admin/templates/site_settings/setting_list.hbs +++ b/app/assets/javascripts/admin/templates/site_settings/setting_list.hbs @@ -12,6 +12,6 @@ {{else}} {{#if overridden}} - + {{/if}} {{/if}} diff --git a/app/assets/javascripts/admin/templates/site_settings/setting_string.hbs b/app/assets/javascripts/admin/templates/site_settings/setting_string.hbs index a5369cd157..52279773b1 100644 --- a/app/assets/javascripts/admin/templates/site_settings/setting_string.hbs +++ b/app/assets/javascripts/admin/templates/site_settings/setting_string.hbs @@ -13,6 +13,6 @@ {{else}} {{#if overridden}} - + {{/if}} {{/if}} diff --git a/app/assets/javascripts/admin/templates/site_settings_category.hbs b/app/assets/javascripts/admin/templates/site_settings_category.hbs index c7a762e296..002baae2e9 100644 --- a/app/assets/javascripts/admin/templates/site_settings_category.hbs +++ b/app/assets/javascripts/admin/templates/site_settings_category.hbs @@ -2,5 +2,5 @@ {{collection contentBinding="filteredContent" classNames="form-horizontal settings" itemView="site-setting"}} {{else}}
- {{i18n admin.site_settings.no_results}} + {{i18n 'admin.site_settings.no_results'}} {{/if}} diff --git a/app/assets/javascripts/admin/templates/site_text_edit.hbs b/app/assets/javascripts/admin/templates/site_text_edit.hbs index d87d17bd59..6db9dd716b 100644 --- a/app/assets/javascripts/admin/templates/site_text_edit.hbs +++ b/app/assets/javascripts/admin/templates/site_text_edit.hbs @@ -17,10 +17,10 @@
- {{#if saved}}{{i18n saved}}{{/if}} + {{#if saved}}{{i18n 'saved'}}{{/if}}
diff --git a/app/assets/javascripts/admin/templates/site_text_index.hbs b/app/assets/javascripts/admin/templates/site_text_index.hbs index 71b256c9c5..5a448def37 100644 --- a/app/assets/javascripts/admin/templates/site_text_index.hbs +++ b/app/assets/javascripts/admin/templates/site_text_index.hbs @@ -1 +1 @@ -

{{i18n admin.site_text.none}}

+

{{i18n 'admin.site_text.none'}}

diff --git a/app/assets/javascripts/admin/templates/user-fields.hbs b/app/assets/javascripts/admin/templates/user-fields.hbs index c829ef18c2..d20eac4dd1 100644 --- a/app/assets/javascripts/admin/templates/user-fields.hbs +++ b/app/assets/javascripts/admin/templates/user-fields.hbs @@ -1,7 +1,7 @@
-

{{i18n admin.user_fields.title}}

+

{{i18n 'admin.user_fields.title'}}

-

{{i18n admin.user_fields.help}}

+

{{i18n 'admin.user_fields.help'}}

{{#if model}} {{#each f in model itemController="admin-user-field-item" itemView="admin-user-field-item"}} @@ -17,19 +17,19 @@ {{combo-box content=fieldTypes valueAttribute="id" value=f.buffered.field_type}}
- - + +
@@ -41,8 +41,8 @@
- - + +
{{f.flags}}
@@ -53,6 +53,6 @@ diff --git a/app/assets/javascripts/admin/templates/user_badges.hbs b/app/assets/javascripts/admin/templates/user_badges.hbs index c454e4a7db..a4bfc236e1 100644 --- a/app/assets/javascripts/admin/templates/user_badges.hbs +++ b/app/assets/javascripts/admin/templates/user_badges.hbs @@ -8,26 +8,26 @@ {{#loading-spinner condition=loading}}
-

{{i18n admin.badges.grant_badge}}

+

{{i18n 'admin.badges.grant_badge'}}

{{#if noBadges}} -

{{i18n admin.badges.no_badges}}

+

{{i18n 'admin.badges.no_badges'}}

{{else}}
{{combo-box valueAttribute="id" value=controller.selectedBadgeId content=controller.grantableBadges}} - + {{/if}}

-

{{i18n admin.badges.granted_badges}}

+

{{i18n 'admin.badges.granted_badges'}}


- - - + + + @@ -42,13 +42,13 @@ {{else}} {{/each}} diff --git a/app/assets/javascripts/admin/templates/user_index.hbs b/app/assets/javascripts/admin/templates/user_index.hbs index 63b9d64253..a3725767ed 100644 --- a/app/assets/javascripts/admin/templates/user_index.hbs +++ b/app/assets/javascripts/admin/templates/user_index.hbs @@ -4,68 +4,68 @@ {{#if active}} {{#link-to 'user' model class="btn"}} - {{i18n admin.user.show_public_profile}} + {{i18n 'admin.user.show_public_profile'}} {{/link-to}} {{#if can_impersonate}} - {{/if}} {{#if currentUser.admin}} {{/if}} {{/if}}
-
{{i18n user.username.title}}
+
{{i18n 'user.username.title'}}
{{username}}
{{#link-to 'preferences.username' model class="btn"}} - {{i18n user.change_username.title}} + {{i18n 'user.change_username.title'}} {{/link-to}}
{{#if canCheckEmails}}
-
{{i18n user.email.title}}
+
{{i18n 'user.email.title'}}
{{#unless active}} -
{{i18n admin.users.not_verified}}
+
{{i18n 'admin.users.not_verified'}}
{{/unless}} {{#if email}} {{email}} {{else}} - + {{/if}}
-
{{i18n user.associated_accounts}}
+
{{i18n 'user.associated_accounts'}}
{{#if associated_accounts}} {{associated_accounts}} {{else}} - + {{/if}}
{{/if}}
-
{{i18n user.avatar.title}}
+
{{i18n 'user.avatar.title'}}
{{avatar content imageSize="large"}}
-
{{i18n user.title.title}}
+
{{i18n 'user.title.title'}}
{{#if editingTitle}} {{text-field value=title autofocus="autofocus"}} @@ -75,23 +75,23 @@
{{#if editingTitle}} - - {{i18n cancel}} + + {{i18n 'cancel'}} {{else}} - + {{/if}}
{{#if currentUser.admin}}
-
{{i18n admin.groups.title}}
+
{{i18n 'admin.groups.title'}}
{{admin-group-selector selected=model.groups available=availableGroups}}
{{#if custom_groups}} - {{i18n admin.groups.primary}} + {{i18n 'admin.groups.primary'}} {{combo-box content=custom_groups value=primary_group_id nameProperty="name" none="admin.groups.no_primary"}} {{/if}} {{#if primaryGroupDirty}} @@ -103,12 +103,12 @@ {{/if}}
-
{{i18n user.ip_address.title}}
+
{{i18n 'user.ip_address.title'}}
{{ip_address}}
{{#if currentUser.staff}} {{ip-lookup ip=ip_address userId=id}} {{/if}} @@ -116,7 +116,7 @@
-
{{i18n user.registration_ip_address.title}}
+
{{i18n 'user.registration_ip_address.title'}}
{{registration_ip_address}}
{{#if currentUser.staff}} @@ -127,12 +127,12 @@ {{#if showBadges}}
-
{{i18n admin.badges.title}}
+
{{i18n 'admin.badges.title'}}
- {{i18n badges.badge_count count=badge_count}} + {{i18n 'badges.badge_count' count=badge_count}}
- {{#link-to 'adminUser.badges' this class="btn"}}{{i18n admin.badges.edit_badges}}{{/link-to}} + {{#link-to 'adminUser.badges' this class="btn"}}{{i18n 'admin.badges.edit_badges'}}{{/link-to}}
{{/if}} @@ -157,30 +157,30 @@
-

{{i18n admin.user.permissions}}

+

{{i18n 'admin.user.permissions'}}

{{#if showApproval}}
-
{{i18n admin.users.approved}}
+
{{i18n 'admin.users.approved'}}
{{#if approved}} - {{i18n admin.user.approved_by}} + {{i18n 'admin.user.approved_by'}} {{#link-to 'adminUser' approvedBy}}{{avatar approvedBy imageSize="small"}}{{/link-to}} {{#link-to 'adminUser' approvedBy}}{{approvedBy.username}}{{/link-to}} {{else}} - {{i18n no_value}} + {{i18n 'no_value'}} {{/if}}
{{#if approved}} - {{i18n admin.user.approve_success}} + {{i18n 'admin.user.approve_success'}} {{else}} {{#if can_approve}} {{/if}} {{/if}} @@ -189,31 +189,31 @@ {{/if}}
-
{{i18n admin.users.active}}
+
{{i18n 'admin.users.active'}}
{{#if active}} - {{i18n yes_value}} + {{i18n 'yes_value'}} {{else}} - {{i18n no_value}} + {{i18n 'no_value'}} {{/if}}
{{#if active}} {{#if can_deactivate}} - - {{i18n admin.user.deactivate_explanation}} + + {{i18n 'admin.user.deactivate_explanation'}} {{/if}} {{else}} {{#if can_send_activation_email}} {{/if}} {{#if can_activate}} {{/if}} {{/if}} @@ -221,57 +221,57 @@
-
{{i18n admin.api.key}}
+
{{i18n 'admin.api.key'}}
{{#if api_key}}
{{api_key.key}} - - + +
{{else}}
- +
{{/if}}
-
{{i18n admin.user.admin}}
+
{{i18n 'admin.user.admin'}}
{{admin}}
{{#if can_revoke_admin}} {{/if}} {{#if can_grant_admin}} {{/if}}
-
{{i18n admin.user.moderator}}
+
{{i18n 'admin.user.moderator'}}
{{moderator}}
{{#if can_revoke_moderation}} {{/if}} {{#if can_grant_moderation}} {{/if}}
@@ -279,7 +279,7 @@
-
{{i18n trust_level}}
+
{{i18n 'trust_level'}}
{{combo-box content=trustLevels value=trust_level nameProperty="detailedName"}} {{#if dirty}} @@ -292,36 +292,36 @@
{{#if model.canLockTrustLevel}} {{#if model.trust_level_locked}} - + {{else}} - + {{/if}} {{/if}} {{#if tl3Requirements}} - {{#link-to 'adminUser.tl3Requirements' this class="btn"}}{{i18n admin.user.trust_level_3_requirements}}{{/link-to}} + {{#link-to 'adminUser.tl3Requirements' this class="btn"}}{{i18n 'admin.user.trust_level_3_requirements'}}{{/link-to}} {{/if}}
-
{{i18n admin.user.suspended}}
+
{{i18n 'admin.user.suspended'}}
{{isSuspended}}
{{#if isSuspended}} {{suspendDuration}} - {{i18n admin.user.suspended_explanation}} + {{i18n 'admin.user.suspended_explanation'}} {{else}} {{#if canSuspend}} - {{i18n admin.user.suspended_explanation}} + {{i18n 'admin.user.suspended_explanation'}} {{/if}} {{/if}}
@@ -329,64 +329,64 @@ {{#if isSuspended}}
-
{{i18n admin.user.suspended_by}}
+
{{i18n 'admin.user.suspended_by'}}
{{#link-to 'adminUser' suspendedBy}}{{avatar suspendedBy imageSize="tiny"}}{{/link-to}} {{#link-to 'adminUser' suspendedBy}}{{suspendedBy.username}}{{/link-to}}
- {{i18n admin.user.suspend_reason}}: + {{i18n 'admin.user.suspend_reason'}}: {{suspend_reason}}
{{/if}}
-
{{i18n admin.user.blocked}}
+
{{i18n 'admin.user.blocked'}}
{{blocked}}
{{#if blocked}} - {{i18n admin.user.block_explanation}} + {{i18n 'admin.user.block_explanation'}} {{/if}}
-

{{i18n admin.user.activity}}

+

{{i18n 'admin.user.activity'}}

-
{{i18n created}}
+
{{i18n 'created'}}
{{{created_at_age}}}
-
{{i18n admin.users.last_emailed}}
+
{{i18n 'admin.users.last_emailed'}}
{{{last_emailed_age}}}
-
{{i18n last_seen}}
+
{{i18n 'last_seen'}}
{{{last_seen_age}}}
-
{{i18n admin.user.like_count}}
+
{{i18n 'admin.user.like_count'}}
{{like_given_count}} / {{like_count}}
-
{{i18n admin.user.topics_entered}}
+
{{i18n 'admin.user.topics_entered'}}
{{topics_entered}}
-
{{i18n admin.user.post_count}}
+
{{i18n 'admin.user.post_count'}}
{{post_count}}
{{#if can_delete_all_posts}} {{else}} {{deleteAllPostsExplanation}} @@ -394,54 +394,54 @@
-
{{i18n admin.user.posts_read_count}}
+
{{i18n 'admin.user.posts_read_count'}}
{{posts_read_count}}
-
{{i18n admin.user.warnings_received_count}}
+
{{i18n 'admin.user.warnings_received_count'}}
{{warnings_received_count}}
-
{{i18n admin.user.flags_given_received_count}}
+
{{i18n 'admin.user.flags_given_received_count'}}
{{flags_given_count}} / {{flags_received_count}}
-
{{i18n admin.user.private_topics_count}}
+
{{i18n 'admin.user.private_topics_count'}}
{{private_topics_count}}
-
{{i18n admin.user.time_read}}
+
{{i18n 'admin.user.time_read'}}
{{{time_read}}}
-
{{i18n user.invited.days_visited}}
+
{{i18n 'user.invited.days_visited'}}
{{{days_visited}}}
{{#if single_sign_on_record}}
-

{{i18n admin.user.sso.title}}

+

{{i18n 'admin.user.sso.title'}}

{{#with single_sign_on_record}}
-
{{i18n admin.user.sso.external_id}}
+
{{i18n 'admin.user.sso.external_id'}}
{{external_id}}
-
{{i18n admin.user.sso.external_username}}
+
{{i18n 'admin.user.sso.external_username'}}
{{external_username}}
-
{{i18n admin.user.sso.external_name}}
+
{{i18n 'admin.user.sso.external_name'}}
{{external_name}}
-
{{i18n admin.user.sso.external_email}}
+
{{i18n 'admin.user.sso.external_email'}}
{{external_email}}
-
{{i18n admin.user.sso.external_avatar_url}}
+
{{i18n 'admin.user.sso.external_avatar_url'}}
{{external_avatar_url}}
{{/with}} @@ -452,7 +452,7 @@
{{#if deleteExplanation}}
diff --git a/app/assets/javascripts/admin/templates/user_tl3_requirements.hbs b/app/assets/javascripts/admin/templates/user_tl3_requirements.hbs index cb57aa4875..b1086cc84d 100644 --- a/app/assets/javascripts/admin/templates/user_tl3_requirements.hbs +++ b/app/assets/javascripts/admin/templates/user_tl3_requirements.hbs @@ -2,15 +2,15 @@
-

{{username}} - {{i18n admin.user.tl3_requirements.title}}

+

{{username}} - {{i18n 'admin.user.tl3_requirements.title'}}


-

{{i18n admin.user.tl3_requirements.table_title}}

+

{{i18n 'admin.user.tl3_requirements.table_title'}}

{{#with tl3Requirements}}
{{i18n admin.badges.badge}}{{i18n admin.badges.granted_by}}{{i18n admin.badges.granted_at}}{{i18n 'admin.badges.badge'}}{{i18n 'admin.badges.granted_by'}}{{i18n 'admin.badges.granted_at'}}
{{age-with-tooltip granted_at}} - +
-

{{i18n admin.badges.no_user_badges name=user.username}}

+

{{i18n 'admin.badges.no_user_badges' name=user.username}}

@@ -18,81 +18,81 @@ - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -107,31 +107,31 @@ {{#if tl3Requirements.requirements_lost}} {{! tl implicitly not locked }} {{#if tl3Requirements.on_grace_period}} - {{i18n admin.user.tl3_requirements.on_grace_period}} + {{i18n 'admin.user.tl3_requirements.on_grace_period'}} {{else}} {{! not on grace period }} - {{i18n admin.user.tl3_requirements.does_not_qualify}} - {{i18n admin.user.tl3_requirements.will_be_demoted}} + {{i18n 'admin.user.tl3_requirements.does_not_qualify'}} + {{i18n 'admin.user.tl3_requirements.will_be_demoted'}} {{/if}} {{else}} {{! requirements not lost - remains tl3 }} {{#if tl3Requirements.trust_level_locked}} - {{i18n admin.user.tl3_requirements.locked_will_not_be_demoted}} + {{i18n 'admin.user.tl3_requirements.locked_will_not_be_demoted'}} {{else}} {{! tl not locked }} - {{i18n admin.user.tl3_requirements.qualifies}} + {{i18n 'admin.user.tl3_requirements.qualifies'}} {{#if tl3Requirements.on_grace_period}} - {{i18n admin.user.tl3_requirements.on_grace_period}} + {{i18n 'admin.user.tl3_requirements.on_grace_period'}} {{/if}} {{/if}} {{/if}} {{else}} {{! is not tl3 }} {{#if tl3Requirements.requirements_met}} {{! met & not tl3 - will be promoted}} - {{i18n admin.user.tl3_requirements.qualifies}} - {{i18n admin.user.tl3_requirements.will_be_promoted}} + {{i18n 'admin.user.tl3_requirements.qualifies'}} + {{i18n 'admin.user.tl3_requirements.will_be_promoted'}} {{else}} {{! requirements not met - remains regular }} {{#if tl3Requirements.trust_level_locked}} - {{i18n admin.user.tl3_requirements.locked_will_not_be_promoted}} + {{i18n 'admin.user.tl3_requirements.locked_will_not_be_promoted'}} {{else}} - {{i18n admin.user.tl3_requirements.does_not_qualify}} + {{i18n 'admin.user.tl3_requirements.does_not_qualify'}} {{/if}} {{/if}} {{/if}} diff --git a/app/assets/javascripts/admin/templates/users-list-show.hbs b/app/assets/javascripts/admin/templates/users-list-show.hbs index 333e3f664a..750685509a 100644 --- a/app/assets/javascripts/admin/templates/users-list-show.hbs +++ b/app/assets/javascripts/admin/templates/users-list-show.hbs @@ -14,7 +14,7 @@ {{text-field value=listFilter placeholder=searchHint}} {{#unless showEmails}}
- +
{{/unless}} @@ -27,26 +27,26 @@ {{/if}} - - - - - - - - + + + + + + + + {{#if showApproval}} - + {{/if}} {{#each user in model}} - + {{#if controller.showApproval}} {{/if}} @@ -64,21 +64,21 @@ {{#if showApproval}} {{/if}} {{/each}}
{{i18n admin.user.tl3_requirements.value_heading}}{{i18n admin.user.tl3_requirements.requirement_heading}}{{i18n 'admin.user.tl3_requirements.value_heading'}}{{i18n 'admin.user.tl3_requirements.requirement_heading'}}
{{i18n admin.user.tl3_requirements.visits}}{{i18n 'admin.user.tl3_requirements.visits'}} - {{days_visited_percent}}% ({{days_visited}} / {{time_period}} {{i18n admin.user.tl3_requirements.days}}) + {{days_visited_percent}}% ({{days_visited}} / {{time_period}} {{i18n 'admin.user.tl3_requirements.days'}}) {{min_days_visited_percent}}%
{{i18n admin.user.tl3_requirements.topics_replied_to}}{{i18n 'admin.user.tl3_requirements.topics_replied_to'}} {{num_topics_replied_to}} {{min_topics_replied_to}}
{{i18n admin.user.tl3_requirements.topics_viewed}}{{i18n 'admin.user.tl3_requirements.topics_viewed'}} {{topics_viewed}} {{min_topics_viewed}}
{{i18n admin.user.tl3_requirements.topics_viewed_all_time}}{{i18n 'admin.user.tl3_requirements.topics_viewed_all_time'}} {{topics_viewed_all_time}} {{min_topics_viewed_all_time}}
{{i18n admin.user.tl3_requirements.posts_read}}{{i18n 'admin.user.tl3_requirements.posts_read'}} {{posts_read}} {{min_posts_read}}
{{i18n admin.user.tl3_requirements.posts_read_all_time}}{{i18n 'admin.user.tl3_requirements.posts_read_all_time'}} {{posts_read_all_time}} {{min_posts_read_all_time}}
{{i18n admin.user.tl3_requirements.flagged_posts}}{{i18n 'admin.user.tl3_requirements.flagged_posts'}} {{num_flagged_posts}}{{i18n max_of_count count=max_flagged_posts}}{{i18n 'max_of_count' count=max_flagged_posts}}
{{i18n admin.user.tl3_requirements.flagged_by_users}}{{i18n 'admin.user.tl3_requirements.flagged_by_users'}} {{num_flagged_by_users}}{{i18n max_of_count count=max_flagged_by_users}}{{i18n 'max_of_count' count=max_flagged_by_users}}
{{i18n admin.user.tl3_requirements.likes_given}}{{i18n 'admin.user.tl3_requirements.likes_given'}} {{num_likes_given}} {{min_likes_given}}
{{i18n admin.user.tl3_requirements.likes_received}}{{i18n 'admin.user.tl3_requirements.likes_received'}} {{num_likes_received}} {{min_likes_received}}
{{i18n admin.user.tl3_requirements.likes_received_days}}{{i18n 'admin.user.tl3_requirements.likes_received_days'}} {{num_likes_received_days}} {{min_likes_received_days}}
{{i18n admin.user.tl3_requirements.likes_received_users}}{{i18n 'admin.user.tl3_requirements.likes_received_users'}} {{num_likes_received_users}} {{min_likes_received_users}}{{input type="checkbox" checked=selectAll}} {{i18n username}}{{i18n email}}{{i18n admin.users.last_emailed}}{{i18n last_seen}}{{i18n admin.user.topics_entered}}{{i18n admin.user.posts_read_count}}{{i18n admin.user.time_read}}{{i18n created}}{{i18n 'username'}}{{i18n 'email'}}{{i18n 'admin.users.last_emailed'}}{{i18n 'last_seen'}}{{i18n 'admin.user.topics_entered'}}{{i18n 'admin.user.posts_read_count'}}{{i18n 'admin.user.time_read'}}{{i18n 'created'}}{{i18n admin.users.approved}}{{i18n 'admin.users.approved'}} 
{{#if user.can_approve}} - {{input type="checkbox" checked=selected}} + {{input type="checkbox" checked=user.selected}} {{/if}} {{#if user.approved}} - {{i18n yes_value}} + {{i18n 'yes_value'}} {{else}} - {{i18n no_value}} + {{i18n 'no_value'}} {{/if}} - {{#if user.admin}}{{/if}} - {{#if user.moderator}}{{/if}} - + {{#if user.admin}}{{/if}} + {{#if user.moderator}}{{/if}} +
{{else}} -

{{i18n search.no_results}}

+

{{i18n 'search.no_results'}}

{{/if}} {{/loading-spinner}} diff --git a/app/assets/javascripts/admin/templates/users_list.hbs b/app/assets/javascripts/admin/templates/users_list.hbs index 6cdf5c5ddf..14032b4e20 100644 --- a/app/assets/javascripts/admin/templates/users_list.hbs +++ b/app/assets/javascripts/admin/templates/users_list.hbs @@ -1,19 +1,19 @@
- +
diff --git a/app/assets/javascripts/admin/templates/version_checks.hbs b/app/assets/javascripts/admin/templates/version_checks.hbs index 49009e47dc..fefee6fec5 100644 --- a/app/assets/javascripts/admin/templates/version_checks.hbs +++ b/app/assets/javascripts/admin/templates/version_checks.hbs @@ -5,15 +5,15 @@ {{custom-html 'upgrade-header'}}   - {{i18n admin.dashboard.installed_version}} - {{i18n admin.dashboard.latest_version}} + {{i18n 'admin.dashboard.installed_version'}} + {{i18n 'admin.dashboard.latest_version'}}     {{#unless loading}} - {{i18n admin.dashboard.version}} + {{i18n 'admin.dashboard.version'}} {{ versionCheck.installed_version }} {{#if versionCheck.noCheckPerformed}} @@ -22,7 +22,7 @@ - {{i18n admin.dashboard.no_check_performed}} + {{i18n 'admin.dashboard.no_check_performed'}} {{else}} {{#if versionCheck.staleData}} @@ -37,9 +37,9 @@ {{#if versionCheck.version_check_pending}} - {{i18n admin.dashboard.version_check_pending}} + {{i18n 'admin.dashboard.version_check_pending'}} {{else}} - {{i18n admin.dashboard.stale_data}} + {{i18n 'admin.dashboard.stale_data'}} {{/if}} @@ -60,11 +60,11 @@ {{#if versionCheck.upToDate }} - {{i18n admin.dashboard.up_to_date}} + {{i18n 'admin.dashboard.up_to_date'}} {{else}} - {{i18n admin.dashboard.critical_available}} - {{i18n admin.dashboard.updates_available}} - {{i18n admin.dashboard.please_upgrade}} + {{i18n 'admin.dashboard.critical_available'}} + {{i18n 'admin.dashboard.updates_available'}} + {{i18n 'admin.dashboard.please_upgrade'}} {{/if}} {{/if}} diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index 89ec703135..64a1f7dd39 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -6,4 +6,16 @@ require_asset ("./main_include.js") DiscoursePluginRegistry.javascripts.each { |js| require_asset(js) } DiscoursePluginRegistry.handlebars.each { |hb| require_asset(hb) } +# Load any glob dependencies +DiscoursePluginRegistry.asset_globs.each do |g| + root, extension = *g + Dir.glob("#{root}/**/*") do |f| + if File.directory?(f) + depend_on(f) + elsif f.to_s.end_with?(".#{extension}") + require_asset(f) + end + end +end + %> diff --git a/app/assets/javascripts/discourse/components/discourse-action-history.js.es6 b/app/assets/javascripts/discourse/components/discourse-action-history.js.es6 index d941bca62c..7dba3c5828 100644 --- a/app/assets/javascripts/discourse/components/discourse-action-history.js.es6 +++ b/app/assets/javascripts/discourse/components/discourse-action-history.js.es6 @@ -1,23 +1,16 @@ -/** - This component handles rendering of what actions have been taken on a post. It uses - buffer rendering for performance rather than a template. +import StringBuffer from 'discourse/mixins/string-buffer'; - @class ActionsHistoryComponent - @extends Em.Component - @namespace Discourse - @module Discourse -**/ -export default Em.Component.extend({ +export default Em.Component.extend(StringBuffer, { tagName: 'section', classNameBindings: [':post-actions', 'hidden'], actionsHistory: Em.computed.alias('post.actionsHistory'), emptyHistory: Em.computed.empty('actionsHistory'), hidden: Em.computed.and('emptyHistory', 'post.notDeleted'), - shouldRerender: Discourse.View.renderIfChanged('actionsHistory.@each', 'actionsHistory.users.length', 'post.deleted'), + + rerenderTriggers: ['actionsHistory.@each', 'actionsHistory.users.length', 'post.deleted'], // This was creating way too many bound ifs and subviews in the handlebars version. - render: function(buffer) { - + renderString: function(buffer) { if (!this.get('emptyHistory')) { this.get('actionsHistory').forEach(function(c) { buffer.push("
"); diff --git a/app/assets/javascripts/discourse/components/global-notice.js.es6 b/app/assets/javascripts/discourse/components/global-notice.js.es6 index 7dca11a0cf..0f6f60f674 100644 --- a/app/assets/javascripts/discourse/components/global-notice.js.es6 +++ b/app/assets/javascripts/discourse/components/global-notice.js.es6 @@ -1,8 +1,9 @@ -export default Ember.Component.extend({ +import StringBuffer from 'discourse/mixins/string-buffer'; - shouldRerender: Discourse.View.renderIfChanged("site.isReadOnly"), +export default Ember.Component.extend(StringBuffer, { + rerenderTriggers: ['site.isReadOnly'], - render: function(buffer) { + renderString: function(buffer) { var notices = []; if (this.site.get("isReadOnly")) { diff --git a/app/assets/javascripts/discourse/components/navigation-item.js.es6 b/app/assets/javascripts/discourse/components/navigation-item.js.es6 index ff5b01acd5..e66fdd276c 100644 --- a/app/assets/javascripts/discourse/components/navigation-item.js.es6 +++ b/app/assets/javascripts/discourse/components/navigation-item.js.es6 @@ -1,17 +1,11 @@ -/** - This view handles rendering of a navigation item +import StringBuffer from 'discourse/mixins/string-buffer'; - @class NavigationItemComponent - @extends Ember.Component - @namespace Discourse - @module Discourse -**/ -export default Ember.Component.extend({ +export default Ember.Component.extend(StringBuffer, { tagName: 'li', classNameBindings: ['active', 'content.hasIcon:has-icon'], attributeBindings: ['title'], hidden: Em.computed.not('content.visible'), - shouldRerender: Discourse.View.renderIfChanged('content.count'), + rerenderTriggers: ['content.count'], title: function() { var categoryName = this.get('content.categoryName'), @@ -42,7 +36,7 @@ export default Ember.Component.extend({ return I18n.t("filters." + name + ".title", extra); }.property('content.count'), - render: function(buffer) { + renderString: function(buffer) { var content = this.get('content'); buffer.push(""); if (content.get('hasIcon')) { diff --git a/app/assets/javascripts/discourse/components/post-gutter.js.es6 b/app/assets/javascripts/discourse/components/post-gutter.js.es6 index 6f263277d5..925434b50d 100644 --- a/app/assets/javascripts/discourse/components/post-gutter.js.es6 +++ b/app/assets/javascripts/discourse/components/post-gutter.js.es6 @@ -1,8 +1,12 @@ var MAX_SHOWN = 5; -export default Em.Component.extend({ +import StringBuffer from 'discourse/mixins/string-buffer'; + +export default Em.Component.extend(StringBuffer, { classNameBindings: [':gutter'], + rerenderTriggers: ['expanded'], + // Roll up links to avoid duplicates collapsed: function() { var seen = {}, @@ -21,7 +25,7 @@ export default Em.Component.extend({ return result; }.property('links'), - render: function(buffer) { + renderString: function(buffer) { var links = this.get('collapsed'), toRender = links, collapsed = !this.get('expanded'); @@ -62,10 +66,6 @@ export default Em.Component.extend({ } }, - _rerenderIfNeeded: function() { - this.rerender(); - }.observes('expanded'), - click: function(e) { var $target = $(e.target); if ($target.hasClass('toggle-more')) { diff --git a/app/assets/javascripts/discourse/components/poster-avatar.js.es6 b/app/assets/javascripts/discourse/components/poster-avatar.js.es6 deleted file mode 100644 index 03875b6a79..0000000000 --- a/app/assets/javascripts/discourse/components/poster-avatar.js.es6 +++ /dev/null @@ -1,12 +0,0 @@ -export default Ember.Component.extend({ - tagName: 'a', - attributeBindings: ['href','data-user-card'], - classNames: ['trigger-user-card'], - href: Em.computed.oneWay('post.usernameUrl'), - "data-user-card": Em.computed.oneWay('post.username'), - - render: function(buffer) { - var avatar = Handlebars.helpers.avatar(this.get('post'), {hash: {imageSize: 'large'}}); - buffer.push(avatar); - } -}); diff --git a/app/assets/javascripts/discourse/components/top-title.js.es6 b/app/assets/javascripts/discourse/components/top-title.js.es6 index 31c03461d5..cfa065429f 100644 --- a/app/assets/javascripts/discourse/components/top-title.js.es6 +++ b/app/assets/javascripts/discourse/components/top-title.js.es6 @@ -1,8 +1,10 @@ -export default Ember.Component.extend({ - tagName: 'h2', +import StringBuffer from 'discourse/mixins/string-buffer'; - _shouldRerender: Discourse.View.renderIfChanged('period.title'), - render: function(buffer) { +export default Ember.Component.extend(StringBuffer, { + tagName: 'h2', + rerenderTriggers: ['period.title'], + + renderString: function(buffer) { buffer.push(" " + this.get('period.title')); } }); diff --git a/app/assets/javascripts/discourse/components/topic-post-badges.js.es6 b/app/assets/javascripts/discourse/components/topic-post-badges.js.es6 index cf21baa2a4..ff9b0131e4 100644 --- a/app/assets/javascripts/discourse/components/topic-post-badges.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-post-badges.js.es6 @@ -1,3 +1,4 @@ +import StringBuffer from 'discourse/mixins/string-buffer'; // Creates a link function link(buffer, prop, url, cssClass, i18nKey, text) { @@ -7,12 +8,12 @@ function link(buffer, prop, url, cssClass, i18nKey, text) { buffer.push("" + (text || prop) + "\n"); } -export default Ember.Component.extend({ +export default Ember.Component.extend(StringBuffer, { tagName: 'span', classNameBindings: [':topic-post-badges'], - _shouldRerender: Discourse.View.renderIfChanged('url', 'unread', 'newPosts', 'unseen'), + rerenderTriggers: ['url', 'unread', 'newPosts', 'unseen'], - render: function(buffer) { + renderString: function(buffer) { var url = this.get('url'); link(buffer, this.get('unread'), url, 'unread', 'unread_posts'); diff --git a/app/assets/javascripts/discourse/components/topic-status.js.es6 b/app/assets/javascripts/discourse/components/topic-status.js.es6 index 1d0883f2e7..dd8b0f8c0b 100644 --- a/app/assets/javascripts/discourse/components/topic-status.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-status.js.es6 @@ -1,18 +1,12 @@ -/** - This view is for rendering an icon representing the status of a topic +import StringBuffer from 'discourse/mixins/string-buffer'; - @class TopicStatusComponent - @extends Ember.Component - @namespace Discourse - @module Discourse -**/ -export default Ember.Component.extend({ +export default Ember.Component.extend(StringBuffer, { classNames: ['topic-statuses'], hasDisplayableStatus: Em.computed.or('topic.archived','topic.closed', 'topic.pinned', 'topic.unpinned', 'topic.invisible', 'topic.archetypeObject.notDefault', 'topic.is_warning'), - shouldRerender: Discourse.View.renderIfChanged('topic.archived', 'topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned', 'topic.is_warning'), + rerenderTriggers: ['topic.archived', 'topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned', 'topic.is_warning'], - didInsertElement: function(){ + watchClick: function(){ var self = this; this.$('a').click(function(){ @@ -27,13 +21,13 @@ export default Ember.Component.extend({ return false; }); - }, + }.on('didInsertElement'), canAct: function() { return Discourse.User.current() && !this.get('disableActions'); }.property('disableActions'), - render: function(buffer) { + renderString: function(buffer) { if (!this.get('hasDisplayableStatus')) { return; } var self = this; @@ -41,7 +35,7 @@ export default Ember.Component.extend({ var renderIconIf = function(conditionProp, name, key, actionable) { if (!self.get(conditionProp)) { return; } var title = Handlebars.Utils.escapeExpression(I18n.t("topic_statuses." + key + ".help")); - var startTag = actionable ? "a href='#'" : "span"; + var startTag = actionable ? "a href" : "span"; var endTag = actionable ? "a" : "span"; buffer.push("<" + startTag + " title='" + title + "' class='topic-status'>"); diff --git a/app/assets/javascripts/discourse/controllers/composer.js.es6 b/app/assets/javascripts/discourse/controllers/composer.js.es6 index 9e2e43e8c6..c15d158ad4 100644 --- a/app/assets/javascripts/discourse/controllers/composer.js.es6 +++ b/app/assets/javascripts/discourse/controllers/composer.js.es6 @@ -73,14 +73,34 @@ export default DiscourseController.extend({ if (c) { c.updateDraftStatus(); } }, - appendText: function(text) { + appendText: function(text, opts) { var c = this.get('model'); - if (c) { c.appendText(text); } + if (c) { + opts = opts || {}; + var wmd = $('#wmd-input'); + var val = wmd.val() || ''; + var position = opts.position === "cursor" ? wmd.caret() : val.length; + + var caret = c.appendText(text, position, opts); + if(wmd[0]){ + Em.run.next(function(){ + Discourse.Utilities.setCaretPosition(wmd[0], caret); + }); + } + } }, - appendBlockAtCursor: function(text) { - var c = this.get('model'); - if (c) { c.appendText(text, $('#wmd-input').caret(), {block: true}); } + appendTextAtCursor: function(text, opts) { + opts = opts || {}; + opts.position = "cursor"; + this.appendText(text, opts); + }, + + appendBlockAtCursor: function(text, opts) { + opts = opts || {}; + opts.position = "cursor"; + opts.block = true; + this.appendText(text, opts); }, categories: function() { @@ -445,6 +465,11 @@ export default DiscourseController.extend({ canEdit: function() { return this.get("model.action") === "edit" && Discourse.User.current().get("can_edit"); - }.property("model.action") + }.property("model.action"), + + visible: function() { + var state = this.get('model.composeState'); + return state && state !== 'closed'; + }.property('model.composeState') }); diff --git a/app/assets/javascripts/discourse/controllers/forgot-password.js.es6 b/app/assets/javascripts/discourse/controllers/forgot-password.js.es6 index 9003d53dc4..6d38365bd7 100644 --- a/app/assets/javascripts/discourse/controllers/forgot-password.js.es6 +++ b/app/assets/javascripts/discourse/controllers/forgot-password.js.es6 @@ -46,7 +46,7 @@ export default DiscourseController.extend(ModalFunctionality, { }).then(success, fail).finally(function(){ setTimeout(function(){ self.set('disabled',false); - }, 10*1000); + }, 1000); }); return false; diff --git a/app/assets/javascripts/discourse/controllers/search.js.es6 b/app/assets/javascripts/discourse/controllers/search.js.es6 index 24c327a012..4efcd31dca 100644 --- a/app/assets/javascripts/discourse/controllers/search.js.es6 +++ b/app/assets/javascripts/discourse/controllers/search.js.es6 @@ -4,13 +4,23 @@ var _dontSearch = false; export default Em.Controller.extend(Discourse.Presence, { + contextType: function(key, value){ + if(arguments.length > 1) { + // a bit hacky, consider cleaning this up, need to work through all observers though + var context = $.extend({}, this.get('searchContext')); + context.type = value; + this.set('searchContext', context); + } + return this.get('searchContext.type'); + }.property('searchContext'), + contextChanged: function(){ if (this.get('searchContextEnabled')) { _dontSearch = true; this.set('searchContextEnabled', false); _dontSearch = false; } - }.observes("searchContext"), + }.observes('searchContext'), searchContextDescription: function(){ var ctx = this.get('searchContext'); @@ -22,6 +32,8 @@ export default Em.Controller.extend(Discourse.Presence, { return I18n.t('search.context.user', {username: Em.get(ctx, 'user.username')}); case 'category': return I18n.t('search.context.category', {category: Em.get(ctx, 'category.name')}); + case 'private_messages': + return I18n.t('search.context.private_messages'); } } }.property('searchContext'), diff --git a/app/assets/javascripts/discourse/controllers/topic.js.es6 b/app/assets/javascripts/discourse/controllers/topic.js.es6 index fac35fa4d9..7cd9ecdeed 100644 --- a/app/assets/javascripts/discourse/controllers/topic.js.es6 +++ b/app/assets/javascripts/discourse/controllers/topic.js.es6 @@ -78,6 +78,10 @@ export default ObjectController.extend(Discourse.SelectedPostsCount, { }, actions: { + deleteTopic: function() { + this.deleteTopic(); + }, + // Post related methods replyToPost: function(post) { var composerController = this.get('controllers.composer'), @@ -370,8 +374,13 @@ export default ObjectController.extend(Discourse.SelectedPostsCount, { }, togglePinnedForUser: function() { - if (this.get('pinned_at')) - this.get('pinned') ? this.get('content').clearPin() : this.get('content').rePin(); + if (this.get('pinned_at')) { + if (this.get('pinned')) { + this.get('content').clearPin(); + } else { + this.get('content').rePin(); + } + } }, replyAsNewTopic: function(post) { diff --git a/app/assets/javascripts/discourse/controllers/user-card.js.es6 b/app/assets/javascripts/discourse/controllers/user-card.js.es6 index 90cfd46013..a3b71cfb18 100644 --- a/app/assets/javascripts/discourse/controllers/user-card.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-card.js.es6 @@ -13,23 +13,19 @@ export default ObjectController.extend({ postStream: Em.computed.alias('controllers.topic.postStream'), enoughPostsForFiltering: Em.computed.gte('participant.post_count', 2), viewingTopic: Em.computed.match('controllers.application.currentPath', /^topic\./), + viewingAdmin: Em.computed.match('controllers.application.currentPath', /^admin\./), showFilter: Em.computed.and('viewingTopic', 'postStream.hasNoFilters', 'enoughPostsForFiltering'), - - // showFilter: Em.computed.and('postStream.hasNoFilters', 'enoughPostsForFiltering'), showName: Discourse.computed.propertyNotEqual('user.name', 'user.username'), - hasUserFilters: Em.computed.gt('postStream.userFilters.length', 0), - isSuspended: Em.computed.notEmpty('user.suspend_reason'), - showBadges: Discourse.computed.setting('enable_badges'), + showMoreBadges: Em.computed.gt('moreBadgesCount', 0), + showDelete: Em.computed.and("viewingAdmin", "showName", "user.canBeDeleted"), moreBadgesCount: function() { return this.get('user.badge_count') - this.get('user.featured_user_badges.length'); }.property('user.badge_count', 'user.featured_user_badges.@each'), - showMoreBadges: Em.computed.gt('moreBadgesCount', 0), - hasCardBadgeImage: function() { var img = this.get('user.card_badge.image'); return img && img.indexOf('fa-') !== 0; @@ -77,6 +73,7 @@ export default ObjectController.extend({ self.set('cardTarget', target); Discourse.User.findByUsername(username).then(function (user) { + user = Discourse.User.create(user); self.setProperties({ user: user, avatar: user, visible: true}); self.appEvents.trigger('usercard:shown'); }).finally(function(){ diff --git a/app/assets/javascripts/discourse/controllers/user-invited.js.es6 b/app/assets/javascripts/discourse/controllers/user-invited.js.es6 index 4d5fea2f4e..7499b2e5a4 100644 --- a/app/assets/javascripts/discourse/controllers/user-invited.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-invited.js.es6 @@ -80,7 +80,7 @@ export default Ember.ObjectController.extend({ var self = this; var model = self.get('model'); - if(self.get('canLoadMore')) { + if (self.get('canLoadMore') && !self.get('invitesLoading')) { self.set('invitesLoading', true); Discourse.Invite.findInvitedBy(self.get('user'), self.get('searchTerm'), model.invites.length).then(function(invite_model) { self.set('invitesLoading', false); diff --git a/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 b/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 index c39d34df95..2d252ac156 100644 --- a/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user-topics-list.js.es6 @@ -1,8 +1,8 @@ import ObjectController from 'discourse/controllers/object'; // Lists of topics on a user's page. -export default ObjectController.extend({ - needs: ["application"], +export default ObjectController.extend(Discourse.HasCurrentUser, { + needs: ["application", "user"], hideCategory: false, showParticipants: false, @@ -14,6 +14,11 @@ export default ObjectController.extend({ loadMore: function() { this.get('model').loadMore(); } - } + }, + + showNewPM: function(){ + return this.get('controllers.user.viewingSelf') && + Discourse.User.currentProp('can_send_private_messages'); + }.property('controllers.user.viewingSelf'), }); diff --git a/app/assets/javascripts/discourse/ember/resolver.js.es6 b/app/assets/javascripts/discourse/ember/resolver.js.es6 index b4cb4bd0d9..edc98dff7c 100644 --- a/app/assets/javascripts/discourse/ember/resolver.js.es6 +++ b/app/assets/javascripts/discourse/ember/resolver.js.es6 @@ -71,8 +71,10 @@ export default Ember.DefaultResolver.extend({ customResolve: function(parsedName) { // If we end with the name we want, use it. This allows us to define components within plugins. var suffix = parsedName.type + 's/' + parsedName.fullNameWithoutType, + dashed = Ember.String.dasherize(suffix), moduleName = Ember.keys(requirejs.entries).find(function(e) { - return e.indexOf(suffix, e.length - suffix.length) !== -1; + return (e.indexOf(suffix, e.length - suffix.length) !== -1) || + (e.indexOf(dashed, e.length - dashed.length) !== -1); }); var module; diff --git a/app/assets/javascripts/discourse/helpers/i18n_helpers.js b/app/assets/javascripts/discourse/helpers/i18n_helpers.js index 324229c974..69e7db0db5 100644 --- a/app/assets/javascripts/discourse/helpers/i18n_helpers.js +++ b/app/assets/javascripts/discourse/helpers/i18n_helpers.js @@ -26,7 +26,11 @@ I18n.toHumanSize = function(number, options) { Handlebars.registerHelper('i18n', function(property, options) { // Resolve any properties var params = options.hash, - self = this; + self = this; + + if (options.types[0] !== "STRING") { + Em.warn("Using the `{{i18n}}` helper without quotes is deprecated."); + } _.each(params, function(value, key) { params[key] = Em.Handlebars.get(self, value, options); @@ -49,14 +53,13 @@ Ember.Handlebars.registerBoundHelper("boundI18n", function(property, options) { @for Handlebars **/ Ember.Handlebars.registerHelper('countI18n', function(key, options) { - var view = Discourse.View.extend({ + var view = Discourse.View.extend(Discourse.StringBuffer, { tagName: 'span', - shouldRerender: Discourse.View.renderIfChanged('count', 'suffix'), + rerenderTriggers: ['count', 'suffix'], - render: function(buffer) { + renderString: function(buffer) { buffer.push(I18n.t(key + (this.get('suffix') || ''), { count: this.get('count') })); } - }); return Ember.Handlebars.helpers.view.call(this, view, options); }); diff --git a/app/assets/javascripts/discourse/lib/Markdown.Editor.js b/app/assets/javascripts/discourse/lib/Markdown.Editor.js index 589d213cf6..41679bb8d0 100644 --- a/app/assets/javascripts/discourse/lib/Markdown.Editor.js +++ b/app/assets/javascripts/discourse/lib/Markdown.Editor.js @@ -1214,6 +1214,17 @@ makeSpritedButtonRow(); var keyEvent = "keydown"; + + var extendedEvents = []; + + if(window.PagedownCustom){ + window.PagedownCustom.appendButtons.concat(window.PagedownCustom.insertButtons).forEach(function(button){ + if(button.shortcut){ + extendedEvents.push([button.shortcut, button.execute]); + } + }); + } + util.addEvent(inputBox, keyEvent, function (key) { // Check to see if we have a button key and, if so execute the callback. @@ -1222,6 +1233,12 @@ var keyCode = key.charCode || key.keyCode; var keyCodeStr = String.fromCharCode(keyCode).toLowerCase(); + for(var i=0; i 0)) { + for (var i=0; i< appendButtons.length; i++) { + var b = appendButtons[i]; + makeButton(b.id, b.description, b.execute) + } + } + } + + //makeSpacer(3); //buttons.undo = makeButton("wmd-undo-button", getString("undo"), null); //buttons.undo.execute = function (manager) { if (manager) manager.undo(); }; @@ -1450,23 +1480,23 @@ //buttons.redo = makeButton("wmd-redo-button", redoTitle, null); //buttons.redo.execute = function (manager) { if (manager) manager.redo(); }; - if (helpOptions) { - var helpButton = document.createElement("li"); - var helpButtonImage = document.createElement("span"); - helpButton.appendChild(helpButtonImage); - helpButton.className = "wmd-button wmd-help-button"; - helpButton.id = "wmd-help-button" + postfix; - helpButton.isHelp = true; - helpButton.style.right = "0px"; - helpButton.title = getString("help"); - helpButton.onclick = helpOptions.handler; + // if (helpOptions) { + // var helpButton = document.createElement("li"); + // var helpButtonImage = document.createElement("span"); + // helpButton.appendChild(helpButtonImage); + // helpButton.className = "wmd-button wmd-help-button"; + // helpButton.id = "wmd-help-button" + postfix; + // helpButton.isHelp = true; + // helpButton.style.right = "0px"; + // helpButton.title = getString("help"); + // helpButton.onclick = helpOptions.handler; + // + // setupButton(helpButton, true); + // buttonRow.appendChild(helpButton); + // buttons.help = helpButton; + // } - setupButton(helpButton, true); - buttonRow.appendChild(helpButton); - buttons.help = helpButton; - } - - setUndoRedoButtonStates(); + // setUndoRedoButtonStates(); } function setUndoRedoButtonStates() { diff --git a/app/assets/javascripts/discourse/lib/search-for-term.js.es6 b/app/assets/javascripts/discourse/lib/search-for-term.js.es6 index 592195f72e..9f9c3fabaa 100644 --- a/app/assets/javascripts/discourse/lib/search-for-term.js.es6 +++ b/app/assets/javascripts/discourse/lib/search-for-term.js.es6 @@ -39,9 +39,8 @@ export default function searchForTerm(term, opts) { }); results.categories = results.categories.map(function(category){ - category = Discourse.Category.list().findProperty('id', category.id); - return category; - }); + return Discourse.Category.list().findProperty('id', category.id); + }).compact(); var r = results.grouped_search_result; results.resultTypes = []; diff --git a/app/assets/javascripts/discourse/mixins/string-buffer.js.es6 b/app/assets/javascripts/discourse/mixins/string-buffer.js.es6 new file mode 100644 index 0000000000..070dfd1270 --- /dev/null +++ b/app/assets/javascripts/discourse/mixins/string-buffer.js.es6 @@ -0,0 +1,27 @@ +export default Ember.Mixin.create({ + + _watchProps: function() { + var args = this.get('rerenderTriggers'); + if (!Ember.isNone(args)) { + var self = this; + args.forEach(function(k) { + self.addObserver(k, self.rerenderString); + }); + } + }.on('init'), + + render: function(buffer) { + this.renderString(buffer); + }, + + _rerenderString: function() { + var buffer = []; + this.renderString(buffer); + this.$().html(buffer.join('')); + }, + + rerenderString: function() { + Ember.run.once(this, '_rerenderString'); + } + +}); diff --git a/app/assets/javascripts/discourse/models/category_list.js b/app/assets/javascripts/discourse/models/category_list.js index c0478499d3..ee8b08c158 100644 --- a/app/assets/javascripts/discourse/models/category_list.js +++ b/app/assets/javascripts/discourse/models/category_list.js @@ -8,7 +8,7 @@ **/ Discourse.CategoryList = Ember.ArrayProxy.extend({ init: function() { - this.content = []; + this.set('content', []); this._super(); } }); diff --git a/app/assets/javascripts/discourse/models/composer.js b/app/assets/javascripts/discourse/models/composer.js index 164e3c604b..2d9523cace 100644 --- a/app/assets/javascripts/discourse/models/composer.js +++ b/app/assets/javascripts/discourse/models/composer.js @@ -100,33 +100,29 @@ Discourse.Composer = Discourse.Model.extend({ hidePreview: Em.computed.not('showPreview'), - // Whether to disable the post button + // whether to disable the post button cantSubmitPost: function() { - - // Can't submit while loading + // can't submit while loading if (this.get('loading')) return true; - // Title is required when: - // - creating a new topic - // - editing the 1st post - // - creating a private message - + // title is required when + // - creating a new topic/private message + // - editing the 1st post if (this.get('canEditTitle') && !this.get('titleLengthValid')) return true; - // Need at least one user when sending a private message - if ( this.get('creatingPrivateMessage') && - this.get('targetUsernames') && - (this.get('targetUsernames').trim() + ',').indexOf(',') === 0) { - return true; - } - // reply is always required if (this.get('missingReplyCharacters') > 0) return true; - return this.get('canCategorize') && - !Discourse.SiteSettings.allow_uncategorized_topics && - !this.get('categoryId') && - !Discourse.User.currentProp('staff'); + if (this.get("privateMessage")) { + // need at least one user when sending a PM + return this.get('targetUsernames') && (this.get('targetUsernames').trim() + ',').indexOf(',') === 0; + } else { + // has a category? (when needed) + return this.get('canCategorize') && + !Discourse.SiteSettings.allow_uncategorized_topics && + !this.get('categoryId') && + !Discourse.User.currentProp('staff'); + } }.property('loading', 'canEditTitle', 'titleLength', 'targetUsernames', 'replyLength', 'categoryId', 'missingReplyCharacters'), /** @@ -306,7 +302,18 @@ Discourse.Composer = Discourse.Model.extend({ } } + if(opts && opts.space){ + if(before.length > 0 && !before[before.length-1].match(/\s/)){ + before = before + " "; + } + if(after.length > 0 && !after[0].match(/\s/)){ + after = " " + after; + } + } + this.set('reply', before + text + after); + + return before.length + text.length; }, togglePreview: function() { diff --git a/app/assets/javascripts/discourse/models/post_stream.js b/app/assets/javascripts/discourse/models/post_stream.js index 026b84e3cf..cfdfa67d6b 100644 --- a/app/assets/javascripts/discourse/models/post_stream.js +++ b/app/assets/javascripts/discourse/models/post_stream.js @@ -1,59 +1,17 @@ -/** - We use this class to keep on top of streaming and filtering posts within a topic. - - @class PostStream - @extends Ember.Object - @namespace Discourse - @module Discourse -**/ Discourse.PostStream = Em.Object.extend({ - /** - Are we currently loading posts in any way? - - @property loading - **/ loading: Em.computed.or('loadingAbove', 'loadingBelow', 'loadingFilter', 'stagingPost'), - notLoading: Em.computed.not('loading'), - filteredPostsCount: Em.computed.alias("stream.length"), - /** - Have we loaded any posts? - - @property hasPosts - **/ - hasPosts: function(){ + hasPosts: function() { return this.get('posts.length') > 0; }.property("posts.@each"), - /** - Do we have a stream list of post ids? - - @property hasStream - **/ hasStream: Em.computed.gt('filteredPostsCount', 0), - - /** - Can we append more posts to our current stream? - - @property canAppendMore - **/ canAppendMore: Em.computed.and('notLoading', 'hasPosts', 'lastPostNotLoaded'), - - /** - Can we prepend more posts to our current stream? - - @property canPrependMore - **/ canPrependMore: Em.computed.and('notLoading', 'hasPosts', 'firstPostNotLoaded'), - /** - Have we loaded the first post in the stream? - - @property firstPostPresent - **/ firstPostPresent: function() { if (!this.get('hasLoadedData')) { return false; } return !!this.get('posts').findProperty('id', this.get('firstPostId')); @@ -61,47 +19,22 @@ Discourse.PostStream = Em.Object.extend({ firstPostNotLoaded: Em.computed.not('firstPostPresent'), - /** - The first post that we have loaded. Useful for checking to see if we should scroll upwards - - @property firstLoadedPost - **/ firstLoadedPost: function() { return _.first(this.get('posts')); }.property('posts.@each'), - /** - The last post we have loaded. Useful for checking to see if we should load more - - @property lastLoadedPost - **/ lastLoadedPost: function() { return _.last(this.get('posts')); }.property('posts.@each'), - /** - Returns the id of the first post in the set - - @property firstPostId - **/ firstPostId: function() { return this.get('stream')[0]; }.property('stream.@each'), - /** - Returns the id of the last post in the set - - @property lastPostId - **/ lastPostId: function() { return _.last(this.get('stream')); }.property('stream.@each'), - /** - Have we loaded the last post in the stream? - - @property loadedAllPosts - **/ loadedAllPosts: function() { if (!this.get('hasLoadedData')) { return false; } return !!this.get('posts').findProperty('id', this.get('lastPostId')); @@ -149,7 +82,7 @@ Discourse.PostStream = Em.Object.extend({ var firstIndex = this.indexOf(firstPost); if (firstIndex === -1) { return []; } - var startIndex = firstIndex - Discourse.SiteSettings.posts_chunksize; + var startIndex = firstIndex - this.get('topic.chunk_size'); if (startIndex < 0) { startIndex = 0; } return stream.slice(startIndex, firstIndex); @@ -173,7 +106,7 @@ Discourse.PostStream = Em.Object.extend({ if ((lastIndex + 1) >= this.get('highest_post_number')) { return []; } // find our window of posts - return stream.slice(lastIndex+1, lastIndex+Discourse.SiteSettings.posts_chunksize+1); + return stream.slice(lastIndex+1, lastIndex + this.get('topic.chunk_size') + 1); }.property('lastLoadedPost', 'stream.@each'), @@ -527,7 +460,7 @@ Discourse.PostStream = Em.Object.extend({ this.get('stream').removeObjects(postIds); this.get('posts').removeObjects(posts); postIds.forEach(function(id){ - identityMap.remove(id); + identityMap.delete(id); }); }, diff --git a/app/assets/javascripts/discourse/models/site.js b/app/assets/javascripts/discourse/models/site.js index c66481c991..e81c16002b 100644 --- a/app/assets/javascripts/discourse/models/site.js +++ b/app/assets/javascripts/discourse/models/site.js @@ -1,11 +1,3 @@ -/** - A data model representing the site (instance of Discourse) - - @class Site - @extends Discourse.Model - @namespace Discourse - @module Discourse -**/ Discourse.Site = Discourse.Model.extend({ isReadOnly: Em.computed.alias('is_readonly'), @@ -66,7 +58,12 @@ Discourse.Site = Discourse.Model.extend({ updateCategory: function(newCategory) { var existingCategory = this.get('categories').findProperty('id', Em.get(newCategory, 'id')); - if (existingCategory) existingCategory.setProperties(newCategory); + if (existingCategory) { + // Don't update null permissions + if (newCategory.permission === null) { delete newCategory.permission; } + + existingCategory.setProperties(newCategory); + } } }); diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.js index 7088433927..47e36a415e 100644 --- a/app/assets/javascripts/discourse/models/user.js +++ b/app/assets/javascripts/discourse/models/user.js @@ -11,6 +11,9 @@ Discourse.User = Discourse.Model.extend({ hasPMs: Em.computed.gt("private_messages_stats.all", 0), hasStartedPMs: Em.computed.gt("private_messages_stats.mine", 0), hasUnreadPMs: Em.computed.gt("private_messages_stats.unread", 0), + hasPosted: Em.computed.gt("post_count", 0), + hasNotPosted: Em.computed.not("hasPosted"), + canBeDeleted: Em.computed.and("can_be_deleted", "hasNotPosted"), /** The user's stream diff --git a/app/assets/javascripts/discourse/routes/application.js.es6 b/app/assets/javascripts/discourse/routes/application.js.es6 index 794448f8d1..83f8a53a7e 100644 --- a/app/assets/javascripts/discourse/routes/application.js.es6 +++ b/app/assets/javascripts/discourse/routes/application.js.es6 @@ -15,7 +15,7 @@ var ApplicationRoute = Discourse.Route.extend({ composePrivateMessage: function(user) { var self = this; this.transitionTo('userActivity', user).then(function () { - self.controllerFor('user-activity').send('composePrivateMessage'); + self.controllerFor('user-activity').send('composePrivateMessage', user); }); }, @@ -27,10 +27,16 @@ var ApplicationRoute = Discourse.Route.extend({ } var exceptionController = this.controllerFor('exception'), - errorString = err.toString(); - if (err.statusText) { - errorString = err.statusText; - } + errorString = err.toString(), + stack = err.stack; + + // If we have a stack call `toString` on it. It gives us a better + // stack trace since `console.error` uses the stack track of this + // error callback rather than the original error. + if (stack) { errorString = stack.toString(); } + + if (err.statusText) { errorString = err.statusText; } + var c = window.console; if (c && c.error) { c.error(errorString); diff --git a/app/assets/javascripts/discourse/routes/build-user-topic-list-route.js.es6 b/app/assets/javascripts/discourse/routes/build-user-topic-list-route.js.es6 index a65533f9e0..ae1ff7ba3b 100644 --- a/app/assets/javascripts/discourse/routes/build-user-topic-list-route.js.es6 +++ b/app/assets/javascripts/discourse/routes/build-user-topic-list-route.js.es6 @@ -25,7 +25,12 @@ export default function (viewName, path) { showParticipants: true }); - this.controllerFor('user').set("pmView", viewName); + this.controllerFor('user').set('pmView', viewName); + this.controllerFor('search').set('contextType', 'private_messages'); + }, + + deactivate: function(){ + this.controllerFor('search').set('contextType', 'user'); } }); } diff --git a/app/assets/javascripts/discourse/routes/user.js.es6 b/app/assets/javascripts/discourse/routes/user.js.es6 index 910abb196f..e72b26d9b7 100644 --- a/app/assets/javascripts/discourse/routes/user.js.es6 +++ b/app/assets/javascripts/discourse/routes/user.js.es6 @@ -15,11 +15,11 @@ export default Discourse.Route.extend({ Discourse.logout(); }, - composePrivateMessage: function() { - var user = this.modelFor('user'); + composePrivateMessage: function(user) { + var recipient = user ? user.get('username') : ''; return this.controllerFor('composer').open({ action: Discourse.Composer.PRIVATE_MESSAGE, - usernames: user.get('username'), + usernames: recipient, archetypeId: 'private_message', draftKey: 'new_private_message' }); diff --git a/app/assets/javascripts/discourse/templates/about.hbs b/app/assets/javascripts/discourse/templates/about.hbs index 09b02a525c..030eb611a7 100644 --- a/app/assets/javascripts/discourse/templates/about.hbs +++ b/app/assets/javascripts/discourse/templates/about.hbs @@ -1,12 +1,12 @@
-

{{i18n about.title title=title}}

+

{{i18n 'about.title' title=title}}

{{description}}

{{#if admins}}
-

{{i18n about.our_admins}}

+

{{i18n 'about.our_admins'}}

{{#each admins}} {{user-small user=this}} @@ -18,7 +18,7 @@ {{#if moderators}}
-

{{i18n about.our_moderators}}

+

{{i18n 'about.our_moderators'}}

{{#each moderators}} @@ -30,35 +30,35 @@ {{/if}}
-

{{i18n about.stats}}

+

{{i18n 'about.stats'}}

- - + + + - + - + - + - +
 {{i18n about.stat.all_time}}{{i18n about.stat.last_7_days}}{{i18n 'about.stat.all_time'}}{{i18n 'about.stat.last_7_days'}}
{{i18n about.topic_count}}{{i18n 'about.topic_count'}} {{number stats.topic_count}} {{number stats.topics_7_days}}
{{i18n about.post_count}}{{i18n 'about.post_count'}} {{number stats.post_count}} {{number stats.posts_7_days}}
{{i18n about.user_count}}{{i18n 'about.user_count'}} {{number stats.user_count}} {{number stats.users_7_days}}
{{i18n about.like_count}}{{i18n 'about.like_count'}} {{number stats.like_count}} {{number stats.likes_7_days}}
-
diff --git a/app/assets/javascripts/discourse/templates/badges/index.hbs b/app/assets/javascripts/discourse/templates/badges/index.hbs index 35b52a7fe6..a69a185277 100644 --- a/app/assets/javascripts/discourse/templates/badges/index.hbs +++ b/app/assets/javascripts/discourse/templates/badges/index.hbs @@ -1,5 +1,5 @@
-

{{i18n badges.title}}

+

{{i18n 'badges.title'}}

@@ -12,7 +12,7 @@ - + {{/each}} {{/each}} diff --git a/app/assets/javascripts/discourse/templates/badges/show.hbs b/app/assets/javascripts/discourse/templates/badges/show.hbs index 85dc9da6a7..7d69a13889 100644 --- a/app/assets/javascripts/discourse/templates/badges/show.hbs +++ b/app/assets/javascripts/discourse/templates/badges/show.hbs @@ -1,6 +1,6 @@

- {{#link-to 'badges.index'}}{{i18n badges.title}}{{/link-to}} + {{#link-to 'badges.index'}}{{i18n 'badges.title'}}{{/link-to}} {{displayName}}

@@ -10,8 +10,8 @@
- - + diff --git a/app/assets/javascripts/discourse/templates/choose_topic.hbs b/app/assets/javascripts/discourse/templates/choose_topic.hbs index c06bca4cc5..d098ea8b3a 100644 --- a/app/assets/javascripts/discourse/templates/choose_topic.hbs +++ b/app/assets/javascripts/discourse/templates/choose_topic.hbs @@ -1,12 +1,12 @@ - + {{text-field value=view.topicTitle placeholderKey="choose_topic.title.placeholder" id="choose-topic-title"}} {{#if view.loading}} -

{{i18n loading}}

+

{{i18n 'loading'}}

{{else}} {{#if view.noResults}} -

{{i18n choose_topic.none_found}}

+

{{i18n 'choose_topic.none_found'}}

{{else}} {{#each view.topics}}
diff --git a/app/assets/javascripts/discourse/templates/components/auto-close-form.hbs b/app/assets/javascripts/discourse/templates/components/auto-close-form.hbs index c6fe0211cb..7d5f954ad1 100644 --- a/app/assets/javascripts/discourse/templates/components/auto-close-form.hbs +++ b/app/assets/javascripts/discourse/templates/components/auto-close-form.hbs @@ -2,7 +2,7 @@
@@ -13,7 +13,7 @@
diff --git a/app/assets/javascripts/discourse/templates/components/avatar-uploader.hbs b/app/assets/javascripts/discourse/templates/components/avatar-uploader.hbs index 80c9517a18..028b30eab5 100644 --- a/app/assets/javascripts/discourse/templates/components/avatar-uploader.hbs +++ b/app/assets/javascripts/discourse/templates/components/avatar-uploader.hbs @@ -1,10 +1,10 @@ - {{#if uploading}} - {{i18n upload_selector.uploading}} {{view.uploadProgress}}% + {{i18n 'upload_selector.uploading'}} {{view.uploadProgress}}% {{/if}} {{#if imageIsNotASquare}} -
{{i18n user.change_avatar.image_is_not_a_square}}
+
{{i18n 'user.change_avatar.image_is_not_a_square'}}
{{/if}} diff --git a/app/assets/javascripts/discourse/templates/components/basic-topic-list.hbs b/app/assets/javascripts/discourse/templates/components/basic-topic-list.hbs index a29a6b4f90..1cd3fbc1ca 100644 --- a/app/assets/javascripts/discourse/templates/components/basic-topic-list.hbs +++ b/app/assets/javascripts/discourse/templates/components/basic-topic-list.hbs @@ -3,16 +3,16 @@
{{#if this.has_badge}}{{/if}} {{user-badge badge=this}} {{{displayDescriptionHtml}}}{{grant_count}}{{grant_count}}
{{user-badge badge=this}} {{displayDescription}}{{i18n badges.granted count=grant_count}}{{i18n badges.allow_title}} {{{view.allowTitle}}}
{{i18n badges.multiple_grant}} {{{view.multipleGrant}}} +
{{i18n 'badges.granted' count=grant_count}}{{i18n 'badges.allow_title'}} {{{view.allowTitle}}}
{{i18n 'badges.multiple_grant'}} {{{view.multipleGrant}}}
- + {{#unless controller.hideCategory}} - + {{/unless}} - + {{#if controller.showParticipants}} - + {{/if}} - - + + @@ -52,7 +52,7 @@
{{i18n topic.title}}{{i18n 'topic.title'}}{{i18n category_title}}{{i18n 'category_title'}}{{i18n posts}}{{i18n 'posts'}}{{i18n users}}{{i18n 'users'}}{{i18n views}}{{i18n activity}}{{i18n 'views'}}{{i18n 'activity'}}
{{else}}
- {{i18n choose_topic.none_found}} + {{i18n 'choose_topic.none_found'}}
{{/if}} {{/loading-spinner}} diff --git a/app/assets/javascripts/discourse/templates/components/category-drop.hbs b/app/assets/javascripts/discourse/templates/components/category-drop.hbs index 835e9ceb7e..d9412d0e84 100644 --- a/app/assets/javascripts/discourse/templates/components/category-drop.hbs +++ b/app/assets/javascripts/discourse/templates/components/category-drop.hbs @@ -7,7 +7,7 @@ {{else}} {{#if noSubcategories}} - {{i18n categories.no_subcategory}} + {{i18n 'categories.no_subcategory'}} {{else}} {{allCategoriesLabel}} {{/if}} @@ -18,7 +18,7 @@
{{#if subCategory}} - + {{/if}} {{#if renderCategories}} {{#each categories}}
{{category-link this allowUncategorized=true}}
{{/each}} diff --git a/app/assets/javascripts/discourse/templates/components/discourse-banner.hbs b/app/assets/javascripts/discourse/templates/components/discourse-banner.hbs index c675c2f5e8..825bcc44be 100644 --- a/app/assets/javascripts/discourse/templates/components/discourse-banner.hbs +++ b/app/assets/javascripts/discourse/templates/components/discourse-banner.hbs @@ -1,7 +1,7 @@
diff --git a/app/assets/javascripts/discourse/templates/components/image-uploader.hbs b/app/assets/javascripts/discourse/templates/components/image-uploader.hbs index 67ba6ca3e2..8820b7c6fa 100644 --- a/app/assets/javascripts/discourse/templates/components/image-uploader.hbs +++ b/app/assets/javascripts/discourse/templates/components/image-uploader.hbs @@ -5,6 +5,6 @@ {{#if backgroundStyle}} {{/if}} - {{i18n upload_selector.uploading}} {{uploadProgress}}% + {{i18n 'upload_selector.uploading'}} {{uploadProgress}}%
diff --git a/app/assets/javascripts/discourse/templates/components/ip-lookup.hbs b/app/assets/javascripts/discourse/templates/components/ip-lookup.hbs index 396235b569..d34809fa61 100644 --- a/app/assets/javascripts/discourse/templates/components/ip-lookup.hbs +++ b/app/assets/javascripts/discourse/templates/components/ip-lookup.hbs @@ -1,36 +1,36 @@ {{#if ip}} {{/if}} {{#if show}}
{{fa-icon "times"}} -

{{i18n ip_lookup.title}}

+

{{i18n 'ip_lookup.title'}}

{{#if location}} {{#if location.hostname}} -
{{i18n ip_lookup.hostname}}
+
{{i18n 'ip_lookup.hostname'}}
{{location.hostname}}
{{/if}} -
{{i18n ip_lookup.location}}
+
{{i18n 'ip_lookup.location'}}
{{#if location.loc}} {{location.loc}}
{{city}} {{else}} - {{i18n ip_lookup.location_not_found}} + {{i18n 'ip_lookup.location_not_found'}} {{/if}}
{{#if location.org}} -
{{i18n ip_lookup.organisation}}
+
{{i18n 'ip_lookup.organisation'}}
{{location.org}}
{{/if}} {{#if location.phone}} -
{{i18n ip_lookup.phone}}
+
{{i18n 'ip_lookup.phone'}}
{{location.phone}}
{{/if}} {{else}} @@ -38,11 +38,11 @@ {{/if}}
- {{i18n ip_lookup.other_accounts}} + {{i18n 'ip_lookup.other_accounts'}} {{totalOthersWithSameIP}} {{#if other_accounts.length}} {{/if}}
@@ -52,11 +52,11 @@ - - - - - + + + + + diff --git a/app/assets/javascripts/discourse/templates/components/private-message-map.hbs b/app/assets/javascripts/discourse/templates/components/private-message-map.hbs index 54360aea35..87551bc801 100644 --- a/app/assets/javascripts/discourse/templates/components/private-message-map.hbs +++ b/app/assets/javascripts/discourse/templates/components/private-message-map.hbs @@ -1,4 +1,4 @@ -

{{i18n private_message_info.title}}

+

{{i18n 'private_message_info.title'}}

{{#each details.allowed_groups}}
@@ -21,6 +21,6 @@
{{#if details.can_invite_to}}
- +
{{/if}} diff --git a/app/assets/javascripts/discourse/templates/components/screened-ip-address-form.hbs b/app/assets/javascripts/discourse/templates/components/screened-ip-address-form.hbs index d4a7df9a96..5f58a282c4 100644 --- a/app/assets/javascripts/discourse/templates/components/screened-ip-address-form.hbs +++ b/app/assets/javascripts/discourse/templates/components/screened-ip-address-form.hbs @@ -1,4 +1,4 @@ -{{i18n admin.logs.screened_ips.form.label}} +{{i18n 'admin.logs.screened_ips.form.label'}} {{text-field value=ip_address disabled=formSubmitted class="ip-address-input" placeholderKey="admin.logs.screened_ips.form.ip_address" autocorrect="off" autocapitalize="off"}} {{combo-box content=actionNames value=actionName}} - + diff --git a/app/assets/javascripts/discourse/templates/components/toggle-deleted.hbs b/app/assets/javascripts/discourse/templates/components/toggle-deleted.hbs index c6b6d21c39..5475461580 100644 --- a/app/assets/javascripts/discourse/templates/components/toggle-deleted.hbs +++ b/app/assets/javascripts/discourse/templates/components/toggle-deleted.hbs @@ -1,7 +1,7 @@ {{#if postStream.show_deleted}} -

{{i18n deleted_filter.disabled_description}}

- +

{{i18n 'deleted_filter.disabled_description'}}

+ {{else}} -

{{i18n deleted_filter.enabled_description}}

- +

{{i18n 'deleted_filter.enabled_description'}}

+ {{/if}} diff --git a/app/assets/javascripts/discourse/templates/components/toggle-summary.hbs b/app/assets/javascripts/discourse/templates/components/toggle-summary.hbs index bfc26874f5..803a45f478 100644 --- a/app/assets/javascripts/discourse/templates/components/toggle-summary.hbs +++ b/app/assets/javascripts/discourse/templates/components/toggle-summary.hbs @@ -1,12 +1,12 @@ {{#if postStream.summary}} -

{{{i18n summary.enabled_description}}}

- +

{{{i18n 'summary.enabled_description'}}}

+ {{else}} {{#if topic.estimatedReadingTime}} -

{{{i18n summary.description_time count="topic.posts_count" readingTime="topic.estimatedReadingTime"}}}

+

{{{i18n 'summary.description_time' count="topic.posts_count" readingTime="topic.estimatedReadingTime"}}}

{{else}} -

{{{i18n summary.description count="topic.posts_count"}}}

+

{{{i18n 'summary.description' count="topic.posts_count"}}}

{{/if}} - + {{/if}} diff --git a/app/assets/javascripts/discourse/templates/components/topic-map.hbs b/app/assets/javascripts/discourse/templates/components/topic-map.hbs index 1ea79eb44f..e26d698d38 100644 --- a/app/assets/javascripts/discourse/templates/components/topic-map.hbs +++ b/app/assets/javascripts/discourse/templates/components/topic-map.hbs @@ -1,5 +1,5 @@ @@ -8,40 +8,40 @@
{{i18n ip_lookup.username}}{{i18n ip_lookup.trust_level}}{{i18n ip_lookup.read_time}}{{i18n ip_lookup.topics_entered}}{{i18n ip_lookup.post_count}}{{i18n 'ip_lookup.username'}}{{i18n 'ip_lookup.trust_level'}}{{i18n 'ip_lookup.read_time'}}{{i18n 'ip_lookup.topics_entered'}}{{i18n 'ip_lookup.post_count'}}
- {{clicks}} + {{clicks}} @@ -82,7 +82,7 @@ {{#if showAllLinksControls}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/composer.hbs b/app/assets/javascripts/discourse/templates/composer.hbs index d605773741..9d068ec8d8 100644 --- a/app/assets/javascripts/discourse/templates/composer.hbs +++ b/app/assets/javascripts/discourse/templates/composer.hbs @@ -1,3 +1,4 @@ +{{#if visible}}
{{loading-spinner}}
@@ -7,7 +8,7 @@ {{render "composer-messages"}}
- + {{#if model.viewOpen}}
@@ -21,7 +22,7 @@ {{text-field value=editReason tabindex="7" id="edit-reason" maxlength="255" placeholderKey="composer.edit_reason_placeholder"}}
{{else}} - {{i18n composer.show_edit_reason}} + {{i18n 'composer.show_edit_reason'}} {{/if}} {{/if}}
@@ -58,7 +59,7 @@ {{popupInputTip validation=view.categoryValidation shownAt=view.showCategoryTip}} {{#if model.archetype.hasOptions}} - + {{/if}} {{render "additional-composer-buttons" model}} {{/unless}} @@ -79,10 +80,10 @@
{{{model.toggleText}}}
- {{loading-spinner size="small"}} {{i18n upload_selector.uploading}} {{view.uploadProgress}}% {{i18n cancel}} + {{loading-spinner size="small"}} {{i18n 'upload_selector.uploading'}} {{view.uploadProgress}}% {{i18n 'cancel'}}
{{#if site.mobileView}} - {{i18n upload}} + {{i18n 'upload'}} {{/if}}
{{model.draftStatus}}
@@ -91,8 +92,8 @@ {{#if currentUser}}
- - {{i18n cancel}} + + {{i18n 'cancel'}}
{{/if}} @@ -102,13 +103,13 @@
{{#if model.createdPost}} - {{i18n composer.saved}} + {{i18n 'composer.saved'}} {{else}} - {{i18n composer.saving}} + {{i18n 'composer.saving'}} {{/if}}
- {{i18n composer.saved_draft}} + {{i18n 'composer.saved_draft'}}
@@ -116,3 +117,4 @@ +{{/if}} diff --git a/app/assets/javascripts/discourse/templates/composer/similar_topics.hbs b/app/assets/javascripts/discourse/templates/composer/similar_topics.hbs index 9f8776c21f..06806e2754 100644 --- a/app/assets/javascripts/discourse/templates/composer/similar_topics.hbs +++ b/app/assets/javascripts/discourse/templates/composer/similar_topics.hbs @@ -1,8 +1,8 @@ -

{{i18n composer.similar_topics}}

+

{{i18n 'composer.similar_topics'}}

    {{#each similarTopics}} -
  • {{topic-link this}} ({{{i18n topic.filters.n_posts count="posts_count"}}})
  • +
  • {{topic-link this}} ({{{i18n 'topic.filters.n_posts' count="posts_count"}}})
  • {{/each}}
diff --git a/app/assets/javascripts/discourse/templates/discovery.hbs b/app/assets/javascripts/discourse/templates/discovery.hbs index 04c3e4e5e5..b370b38ee4 100644 --- a/app/assets/javascripts/discourse/templates/discovery.hbs +++ b/app/assets/javascripts/discourse/templates/discovery.hbs @@ -6,7 +6,7 @@
- {{outlet navigation-bar}} + {{outlet "navigation-bar"}}
@@ -16,14 +16,14 @@
- {{outlet header-list-container}} + {{outlet "header-list-container"}}
- {{outlet list-container}} + {{outlet "list-container"}}
diff --git a/app/assets/javascripts/discourse/templates/discovery/categories.hbs b/app/assets/javascripts/discourse/templates/discovery/categories.hbs index acf40a5011..788d1d72bc 100644 --- a/app/assets/javascripts/discourse/templates/discovery/categories.hbs +++ b/app/assets/javascripts/discourse/templates/discovery/categories.hbs @@ -3,9 +3,9 @@ - - - + + + @@ -16,10 +16,10 @@
@@ -34,10 +34,10 @@ {{#each subcategories}} {{category-link this showParent=true onlyStripe=true}} {{#if unreadTopics}} - {{unbound unreadTopics}} + {{unbound unreadTopics}} {{/if}} {{#if newTopics}} - {{unbound newTopics}} + {{unbound newTopics}} {{/if}} {{/each}} @@ -52,7 +52,7 @@ {{#if controller.latestTopicOnly}} {{else}} diff --git a/app/assets/javascripts/discourse/templates/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/discovery/topics.hbs index a122bc2a58..82ad64c58f 100644 --- a/app/assets/javascripts/discourse/templates/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/templates/discovery/topics.hbs @@ -5,11 +5,11 @@ {{#if showDismissAtTop}}
{{#if showDismissRead}} - - + + {{/if}} {{#if showResetNew}} - + {{/if}}
{{/if}} @@ -30,7 +30,7 @@
{{countI18n topic_count_ suffix=topicTrackingState.filter count=topicTrackingState.incomingCount}} - {{i18n click_to_show}} + {{i18n 'click_to_show'}}
{{/if}} @@ -41,25 +41,25 @@ {{#if currentUser}} {{/if}} - {{#sortable-heading class="default"}} {{i18n topic.title}} {{/sortable-heading}} + {{#sortable-heading class="default"}} {{i18n 'topic.title'}} {{/sortable-heading}} {{#unless controller.hideCategory}} {{#sortable-heading sortBy="category" action="changeSort" order=order ascending=ascending}} - {{i18n category_title}} + {{i18n 'category_title'}} {{/sortable-heading}} {{/unless}} - {{#sortable-heading class="posters"}} {{i18n users}} {{/sortable-heading}} + {{#sortable-heading class="posters"}} {{i18n 'users'}} {{/sortable-heading}} {{#sortable-heading sortBy="posts" number=true action="changeSort" order=order ascending=ascending}} - {{i18n posts}} + {{i18n 'posts'}} {{/sortable-heading}} {{#sortable-heading sortBy="views" number=true action="changeSort" order=order ascending=ascending}} - {{i18n views}} + {{i18n 'views'}} {{/sortable-heading}} {{#sortable-heading sortBy="activity" number=true action="changeSort" order=order ascending=ascending}} - {{i18n activity}} + {{i18n 'activity'}} {{/sortable-heading}} @@ -74,11 +74,11 @@ {{loading-spinner condition=loadingMore}} {{#if allLoaded}} {{#if showDismissRead}} - - + + {{/if}} {{#if showResetNew}} - + {{/if}} {{#if latest}} @@ -87,12 +87,12 @@

{{footerMessage}} - {{#if can_create_topic}}{{i18n topic.suggest_create_topic}}{{/if}} + {{#if can_create_topic}}{{i18n 'topic.suggest_create_topic'}}{{/if}}

{{else}} {{#if top}}

- {{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}} + {{#link-to "discovery.categories"}}{{i18n 'topic.browse_all_categories'}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n 'topic.view_latest_topics'}}{{/link-to}} {{i18n 'or'}} {{i18n 'filters.top.other_periods'}} {{top-period-buttons period=period}}

{{else}} @@ -100,7 +100,7 @@ {{{footerEducation}}}

- {{footerMessage}}{{#link-to "discovery.categories"}} {{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} + {{footerMessage}}{{#link-to "discovery.categories"}} {{i18n 'topic.browse_all_categories'}}{{/link-to}} {{i18n 'or'}} {{#link-to 'discovery.latest'}}{{i18n 'topic.view_latest_topics'}}{{/link-to}}

{{/if}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/embedded_post.hbs b/app/assets/javascripts/discourse/templates/embedded_post.hbs index 6deb81d0c7..1cb4e3c7c1 100644 --- a/app/assets/javascripts/discourse/templates/embedded_post.hbs +++ b/app/assets/javascripts/discourse/templates/embedded_post.hbs @@ -2,17 +2,17 @@
- {{poster-avatar post=this classNames="main-avatar"}} + {{raw "post/poster-avatar" post=this classNames="main-avatar"}}
{{{unbound cooked}}} - {{#unless view.parentView.previousPost}}{{/unless}} + {{#unless view.parentView.previousPost}}{{/unless}}
diff --git a/app/assets/javascripts/discourse/templates/exception.hbs b/app/assets/javascripts/discourse/templates/exception.hbs index ba19a38b81..e52073f2f2 100644 --- a/app/assets/javascripts/discourse/templates/exception.hbs +++ b/app/assets/javascripts/discourse/templates/exception.hbs @@ -3,7 +3,7 @@
:(
{{reason}}
- {{i18n errors.prev_page}} {{requestUrl}} + {{i18n 'errors.prev_page'}} {{requestUrl}}
{{#if networkFixed}} diff --git a/app/assets/javascripts/discourse/templates/group.hbs b/app/assets/javascripts/discourse/templates/group.hbs index d88ae8f126..f1af1a0ff9 100644 --- a/app/assets/javascripts/discourse/templates/group.hbs +++ b/app/assets/javascripts/discourse/templates/group.hbs @@ -2,12 +2,12 @@
{{i18n categories.category}}{{i18n categories.latest}}{{i18n categories.topics}}{{i18n 'categories.category'}}{{i18n 'categories.latest'}}{{i18n 'categories.topics'}}
{{#if canBulkSelect}} - + {{/if}}
- + {{#each model}} diff --git a/app/assets/javascripts/discourse/templates/header.hbs b/app/assets/javascripts/discourse/templates/header.hbs index 4b8d59635d..4b6e24034c 100644 --- a/app/assets/javascripts/discourse/templates/header.hbs +++ b/app/assets/javascripts/discourse/templates/header.hbs @@ -7,17 +7,17 @@ {{#unless currentUser}} {{#if showSignUpButton}} {{/if}} {{/unless}} {{/each}} +
{{i18n last_seen}}{{i18n 'last_seen'}}
{{else}}
- {{i18n choose_topic.none_found}} + {{i18n 'choose_topic.none_found'}}
{{/if}} {{/loading-spinner}} diff --git a/app/assets/javascripts/discourse/templates/mobile/discovery/categories.hbs b/app/assets/javascripts/discourse/templates/mobile/discovery/categories.hbs index cbe47e1690..789368925e 100644 --- a/app/assets/javascripts/discourse/templates/mobile/discovery/categories.hbs +++ b/app/assets/javascripts/discourse/templates/mobile/discovery/categories.hbs @@ -27,10 +27,10 @@
{{{excerpt}}} {{#if excerptTruncated}} - {{#unless canClearPin}}{{i18n read_more}}{{/unless}} + {{#unless canClearPin}}{{i18n 'read_more'}}{{/unless}} {{/if}} {{#if canClearPin}} - {{i18n topic.clear_pin.title}} + {{i18n 'topic.clear_pin.title'}} {{/if}}
{{/if}} @@ -55,12 +55,12 @@
-
{{number topics_year}}
{{i18n category.this_year}}
-
{{number topics_month}}
{{i18n month}}
-
{{number topics_week}}
{{i18n week}}
+
{{number topics_year}}
{{i18n 'category.this_year'}}
+
{{number topics_month}}
{{i18n 'month'}}
+
{{number topics_week}}
{{i18n 'week'}}
{{#if controller.canEdit}} - {{i18n category.edit}} + {{i18n 'category.edit'}} {{/if}}
diff --git a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs index 10f7529a15..59940fdaaa 100644 --- a/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs +++ b/app/assets/javascripts/discourse/templates/mobile/discovery/topics.hbs @@ -12,7 +12,7 @@
{{countI18n topic_count_ suffix=topicTrackingState.filter count=topicTrackingState.incomingCount}} - {{i18n click_to_show}} + {{i18n 'click_to_show'}}
@@ -27,11 +27,11 @@ {{loading-spinner condition=loadingMore}} {{#if allLoaded}} {{#if showDismissRead}} - - + + {{/if}} {{#if showResetNew}} - + {{/if}} {{#if latest}} @@ -40,12 +40,12 @@

{{footerMessage}} - {{#if can_create_topic}}{{i18n topic.suggest_create_topic}}{{/if}} + {{#if can_create_topic}}{{i18n 'topic.suggest_create_topic'}}{{/if}}

{{else}} {{#if top}}

- {{#link-to "discovery.categories"}}{{i18n topic.browse_all_categories}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} {{i18n or}} {{i18n filters.top.other_periods}} + {{#link-to "discovery.categories"}}{{i18n 'topic.browse_all_categories'}}{{/link-to}}, {{#link-to 'discovery.latest'}}{{i18n 'topic.view_latest_topics'}}{{/link-to}} {{i18n 'or'}} {{i18n 'filters.top.other_periods'}}
{{top-period-buttons period=period}}

@@ -54,7 +54,7 @@ {{{footerEducation}}}

- {{footerMessage}}{{#link-to "discovery.categories"}} {{i18n topic.browse_all_categories}}{{/link-to}} {{i18n or}} {{#link-to 'discovery.latest'}}{{i18n topic.view_latest_topics}}{{/link-to}} + {{footerMessage}}{{#link-to "discovery.categories"}} {{i18n 'topic.browse_all_categories'}}{{/link-to}} {{i18n 'or'}} {{#link-to 'discovery.latest'}}{{i18n 'topic.view_latest_topics'}}{{/link-to}}

{{/if}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.hbs b/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.hbs index cbcbec9694..5db0015b9c 100644 --- a/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.hbs +++ b/app/assets/javascripts/discourse/templates/mobile/list/topic_list_item.hbs @@ -11,10 +11,10 @@
{{{excerpt}}} {{#if excerptTruncated}} - {{#unless canClearPin}}{{i18n read_more}}{{/unless}} + {{#unless canClearPin}}{{i18n 'read_more'}}{{/unless}} {{/if}} {{#if canClearPin}} - {{i18n topic.clear_pin.title}} + {{i18n 'topic.clear_pin.title'}} {{/if}}
{{/if}} @@ -30,7 +30,7 @@
{{posts-count-column topic=this tagName="div" class="num posts" action="showTopicEntrance"}}
- {{last_poster_username}} + {{last_poster_username}} {{raw "list/activity-column" topic=this tagName="span" class="age"}}
diff --git a/app/assets/javascripts/discourse/templates/mobile/modal/login.hbs b/app/assets/javascripts/discourse/templates/mobile/modal/login.hbs index 806ffd6548..c3db1acafc 100644 --- a/app/assets/javascripts/discourse/templates/mobile/modal/login.hbs +++ b/app/assets/javascripts/discourse/templates/mobile/modal/login.hbs @@ -6,7 +6,7 @@
- + {{text-field value=loginName placeholderKey="login.email_placeholder" id="login-account-name" autocorrect="off" autocapitalize="off"}} @@ -14,7 +14,7 @@
- + {{text-field value=loginPassword type="password" id="login-account-password" maxlength="200"}}   @@ -23,7 +23,7 @@
- {{i18n forgot_password.action}} + {{i18n 'forgot_password.action'}}
@@ -35,7 +35,7 @@
diff --git a/app/assets/javascripts/discourse/templates/modal/auto_close.hbs b/app/assets/javascripts/discourse/templates/modal/auto_close.hbs index 0c037bfb83..8c0cd9e64e 100644 --- a/app/assets/javascripts/discourse/templates/modal/auto_close.hbs +++ b/app/assets/javascripts/discourse/templates/modal/auto_close.hbs @@ -6,8 +6,8 @@ limited=details.auto_close_based_on_last_post }}
diff --git a/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs b/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs index cb459c9278..de3ca91c56 100644 --- a/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs +++ b/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs @@ -2,12 +2,12 @@
- +
- - + +
@@ -16,10 +16,10 @@ {{#if view.uploadedAvatarTemplate}} {{bound-avatar-template view.uploadedAvatarTemplate "large"}} {{else}} - {{bound-avatar controller "large" custom_avatar_upload_id}} {{i18n user.change_avatar.uploaded_avatar}} + {{bound-avatar controller "large" custom_avatar_upload_id}} {{i18n 'user.change_avatar.uploaded_avatar'}} {{/if}} {{else}} - {{i18n user.change_avatar.uploaded_avatar_empty}} + {{i18n 'user.change_avatar.uploaded_avatar_empty'}} {{/if}} {{avatar-uploader username=username @@ -30,6 +30,6 @@
diff --git a/app/assets/javascripts/discourse/templates/modal/bulk_actions_buttons.hbs b/app/assets/javascripts/discourse/templates/modal/bulk_actions_buttons.hbs index 3301aa6af0..40ace4bc37 100644 --- a/app/assets/javascripts/discourse/templates/modal/bulk_actions_buttons.hbs +++ b/app/assets/javascripts/discourse/templates/modal/bulk_actions_buttons.hbs @@ -1,10 +1,10 @@

- - - - + + + +

- - + +

diff --git a/app/assets/javascripts/discourse/templates/modal/bulk_change_category.hbs b/app/assets/javascripts/discourse/templates/modal/bulk_change_category.hbs index 4861aa42b9..e67173ff70 100644 --- a/app/assets/javascripts/discourse/templates/modal/bulk_change_category.hbs +++ b/app/assets/javascripts/discourse/templates/modal/bulk_change_category.hbs @@ -3,7 +3,7 @@

{{category-chooser value=newCategoryId}}

{{#if loading}} -
{{i18n loading}}
+
{{i18n 'loading'}}
{{else}} {{/if}} diff --git a/app/assets/javascripts/discourse/templates/modal/bulk_notification_level.hbs b/app/assets/javascripts/discourse/templates/modal/bulk_notification_level.hbs index 4e37543dba..cb40e1802c 100644 --- a/app/assets/javascripts/discourse/templates/modal/bulk_notification_level.hbs +++ b/app/assets/javascripts/discourse/templates/modal/bulk_notification_level.hbs @@ -7,4 +7,4 @@
{{/each}} - + diff --git a/app/assets/javascripts/discourse/templates/modal/change_owner.hbs b/app/assets/javascripts/discourse/templates/modal/change_owner.hbs index e8cc1c2ee0..7b7f2406a4 100644 --- a/app/assets/javascripts/discourse/templates/modal/change_owner.hbs +++ b/app/assets/javascripts/discourse/templates/modal/change_owner.hbs @@ -1,11 +1,11 @@