diff --git a/app/assets/javascripts/admin/controllers/admin_site_settings_controller.js b/app/assets/javascripts/admin/controllers/admin_site_settings_controller.js index 924654a2ba..e3d2dacd5b 100644 --- a/app/assets/javascripts/admin/controllers/admin_site_settings_controller.js +++ b/app/assets/javascripts/admin/controllers/admin_site_settings_controller.js @@ -26,7 +26,9 @@ Discourse.AdminSiteSettingsController = Ember.ArrayController.extend(Discourse.P } var adminSettingsController = this; - return this.get('content').filter(function(item, index, enumerable) { + + var maxResults = Em.isNone(filter) ? this.get('content.length') : 20; + return _.first(this.get('content').filter(function(item, index, enumerable) { if (adminSettingsController.get('onlyOverridden') && !item.get('overridden')) return false; if (filter) { if (item.get('setting').toLowerCase().indexOf(filter) > -1) return true; @@ -36,20 +38,11 @@ Discourse.AdminSiteSettingsController = Ember.ArrayController.extend(Discourse.P } return true; - }); + }), maxResults); }.property('filter', 'content.@each', 'onlyOverridden'), actions: { - /** - Changes the currently active filter - - @method changeFilter - **/ - changeFilter: function() { - this.set('filter', this.get('newFilter')); - }, - /** Reset a setting to its default value diff --git a/app/assets/javascripts/admin/templates/site_settings.js.handlebars b/app/assets/javascripts/admin/templates/site_settings.js.handlebars index 25885c1572..ff6e21ab79 100644 --- a/app/assets/javascripts/admin/templates/site_settings.js.handlebars +++ b/app/assets/javascripts/admin/templates/site_settings.js.handlebars @@ -6,8 +6,7 @@
- {{textField value=newFilter}} - + {{textField value=filter placeholderKey="type_to_filter"}}
diff --git a/app/assets/javascripts/discourse/models/post.js b/app/assets/javascripts/discourse/models/post.js index 4696996dda..7cae814f96 100644 --- a/app/assets/javascripts/discourse/models/post.js +++ b/app/assets/javascripts/discourse/models/post.js @@ -32,6 +32,11 @@ Discourse.Post = Discourse.Model.extend({ notDeleted: Em.computed.not('deleted'), userDeleted: Em.computed.empty('user_id'), + showName: function() { + var name = this.get('name'); + return name && (name !== this.get('username')) && Discourse.SiteSettings.display_name_on_posts; + }.property('name', 'username'), + postDeletedBy: function() { if (this.get('firstPost')) { return this.get('topic.deleted_by'); } return this.get('deleted_by'); diff --git a/app/assets/javascripts/discourse/templates/post.js.handlebars b/app/assets/javascripts/discourse/templates/post.js.handlebars index 95da0cd1d8..641d43d93a 100644 --- a/app/assets/javascripts/discourse/templates/post.js.handlebars +++ b/app/assets/javascripts/discourse/templates/post.js.handlebars @@ -21,6 +21,11 @@
{{avatar this imageSize="large"}}

{{breakUp username}}

+ + {{#if showName}} +

{{breakUp name}}

+ {{/if}} + {{#if user_title}}
{{user_title}}
{{/if}}
{{else}} diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index 9a7adf6c22..070b1115c8 100644 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -270,6 +270,7 @@ class SiteSetting < ActiveRecord::Base # hidden setting only used by system setting(:uncategorized_category_id, -1, hidden: true) + client_setting(:display_name_on_posts, false) client_setting(:enable_names, true) def self.call_discourse_hub? diff --git a/config/locales/client.cs.yml b/config/locales/client.cs.yml index 2ade576b92..cce34b0039 100644 --- a/config/locales/client.cs.yml +++ b/config/locales/client.cs.yml @@ -1062,6 +1062,7 @@ cs: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "zadejte text pro filtrování..." admin: title: 'Discourse Administrace' diff --git a/config/locales/client.da.yml b/config/locales/client.da.yml index 55a904717d..ab1e894c31 100644 --- a/config/locales/client.da.yml +++ b/config/locales/client.da.yml @@ -683,6 +683,7 @@ da: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "type to filter..." admin: title: 'Discourse Admin' diff --git a/config/locales/client.de.yml b/config/locales/client.de.yml index b09d24178a..8fc524b39a 100644 --- a/config/locales/client.de.yml +++ b/config/locales/client.de.yml @@ -1049,6 +1049,7 @@ de: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "Tippe etwas ein, um zu filtern..." admin: title: 'Discourse Administrator' diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 3775cae923..f51176145b 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -1074,7 +1074,7 @@ en: # This section is exported to the javascript for i18n in the admin section admin_js: - filter: "filter" + type_to_filter: "type to filter..." admin: title: 'Discourse Admin' diff --git a/config/locales/client.es.yml b/config/locales/client.es.yml index a38aa47f18..4e04aebfa3 100644 --- a/config/locales/client.es.yml +++ b/config/locales/client.es.yml @@ -793,6 +793,7 @@ es: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "type to filter..." admin: title: 'Administrador' diff --git a/config/locales/client.fr.yml b/config/locales/client.fr.yml index 44e0b3f940..32a94c5bc3 100644 --- a/config/locales/client.fr.yml +++ b/config/locales/client.fr.yml @@ -1032,6 +1032,7 @@ fr: create_post: "Répondre / Voir" readonly: "Voir" admin_js: + type_to_filter: "Commencez à taper pour filtrer..." admin: title: 'Administation Discourse' moderator: 'Modérateur' diff --git a/config/locales/client.id.yml b/config/locales/client.id.yml index 4ffb456916..b2ccba06c5 100644 --- a/config/locales/client.id.yml +++ b/config/locales/client.id.yml @@ -638,6 +638,7 @@ id: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "type to filter..." admin: title: 'Discourse Admin' diff --git a/config/locales/client.it.yml b/config/locales/client.it.yml index 7b279a80ac..b174905140 100644 --- a/config/locales/client.it.yml +++ b/config/locales/client.it.yml @@ -1001,6 +1001,7 @@ it: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "scrivi per filtrare..." admin: title: 'Amministrazione Discourse' diff --git a/config/locales/client.ko.yml b/config/locales/client.ko.yml index 722c8a881a..2abaab6bc7 100644 --- a/config/locales/client.ko.yml +++ b/config/locales/client.ko.yml @@ -841,6 +841,7 @@ ko: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "필터를 입력하세요" admin: title: 'Discourse 관리자' diff --git a/config/locales/client.nb_NO.yml b/config/locales/client.nb_NO.yml index 3b56e82cc2..a18da7acb5 100644 --- a/config/locales/client.nb_NO.yml +++ b/config/locales/client.nb_NO.yml @@ -914,6 +914,7 @@ nb_NO: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "skriv for å filtrere..." admin: title: 'Discourse Admin' diff --git a/config/locales/client.nl.yml b/config/locales/client.nl.yml index 8d3dc6357a..5e64204e5c 100644 --- a/config/locales/client.nl.yml +++ b/config/locales/client.nl.yml @@ -1014,6 +1014,7 @@ nl: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: typ om te filteren... admin: title: Discourse Beheer diff --git a/config/locales/client.pseudo.yml b/config/locales/client.pseudo.yml index 5e7f474175..172a7f3126 100644 --- a/config/locales/client.pseudo.yml +++ b/config/locales/client.pseudo.yml @@ -969,6 +969,7 @@ pseudo: ƀřóŵšéř íš ťóó ółď ťó ŵóřǩ óɳ ťĥíš Ďíščóůřšé ƒóřůɱ. Рłéášé <á ĥřéƒ="ĥťťƿ://ƀřóŵšéĥáƿƿý.čóɱ">ůƿǧřáďé ýóůř ƀřóŵšéř. ]]' admin_js: + type_to_filter: '[[ ťýƿé ťó ƒíłťéř... ]]' admin: title: '[[ Ďíščóůřšé Áďɱíɳ ]]' moderator: '[[ Ϻóďéřáťóř ]]' diff --git a/config/locales/client.pt.yml b/config/locales/client.pt.yml index 857a28344f..c6a2179cb0 100644 --- a/config/locales/client.pt.yml +++ b/config/locales/client.pt.yml @@ -602,6 +602,7 @@ pt: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "escreve para filtrar..." admin: title: 'Discourse Admin' diff --git a/config/locales/client.pt_BR.yml b/config/locales/client.pt_BR.yml index aaef72092a..3b0e986d50 100644 --- a/config/locales/client.pt_BR.yml +++ b/config/locales/client.pt_BR.yml @@ -1069,6 +1069,7 @@ pt_BR: # Essa seção é para o javascript para i18n no admin admin_js: + type_to_filter: "escreva para filtrar..." admin: title: 'Discourse Admin' diff --git a/config/locales/client.ru.yml b/config/locales/client.ru.yml index 1d1373eaf7..406c9ab295 100644 --- a/config/locales/client.ru.yml +++ b/config/locales/client.ru.yml @@ -1085,6 +1085,7 @@ ru: create_post: 'Отвечать / Просматривать' readonly: Просматривать admin_js: + type_to_filter: 'Введите текст для фильтрации...' admin: title: 'Discourse Admin' moderator: Модератор diff --git a/config/locales/client.sv.yml b/config/locales/client.sv.yml index a07376eaa2..2fedf9af4a 100644 --- a/config/locales/client.sv.yml +++ b/config/locales/client.sv.yml @@ -788,6 +788,7 @@ sv: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "skriv för att filtrera..." admin: title: 'Discourse Admin' diff --git a/config/locales/client.zh_CN.yml b/config/locales/client.zh_CN.yml index 2843bda89f..26fc3c21f7 100644 --- a/config/locales/client.zh_CN.yml +++ b/config/locales/client.zh_CN.yml @@ -1075,6 +1075,7 @@ zh_CN: # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "输入过滤条件……" admin: title: '论道 管理' diff --git a/config/locales/client.zh_TW.yml b/config/locales/client.zh_TW.yml index 36b940e883..7d913a2040 100644 --- a/config/locales/client.zh_TW.yml +++ b/config/locales/client.zh_TW.yml @@ -968,6 +968,7 @@ zh_TW: readonly: "觀看" # This section is exported to the javascript for i18n in the admin section admin_js: + type_to_filter: "輸入過濾條件……" admin: title: '論道 管理' diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index f1449556ed..bf95d69ad6 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -722,6 +722,7 @@ en: dominating_topic_minimum_percent: "What percentage of posts a user has to make in a topic before we consider it dominating." enable_names: "Allow users to show their full names" + display_name_on_posts: "Also show a user's full name on their posts" notification_types: mentioned: "%{display_username} mentioned you in %{link}"