Replace slow auto-filter in site settings with a filter button

This commit is contained in:
Robin Ward 2013-10-29 17:03:28 -04:00
parent caeb91a55f
commit bb135fafb4
22 changed files with 25 additions and 26 deletions

View file

@ -40,6 +40,16 @@ Discourse.AdminSiteSettingsController = Ember.ArrayController.extend(Discourse.P
}.property('filter', 'content.@each', 'onlyOverridden'), }.property('filter', 'content.@each', 'onlyOverridden'),
actions: { actions: {
/**
Changes the currently active filter
@method changeFilter
**/
changeFilter: function() {
this.set('filter', this.get('newFilter'));
},
/** /**
Reset a setting to its default value Reset a setting to its default value

View file

@ -5,8 +5,9 @@
{{i18n admin.site_settings.show_overriden}} {{i18n admin.site_settings.show_overriden}}
</label> </label>
</div> </div>
<div class='search controls'> <div class='controls'>
{{textField value=filter placeHolderKey="type_to_filter"}} {{textField value=newFilter}}
<button class="btn btn-primary" {{action changeFilter}}>{{i18n filter}}</button>
</div> </div>
</div> </div>

View file

@ -10,6 +10,7 @@ Discourse.TextField = Ember.TextField.extend({
attributeBindings: ['autocorrect', 'autocapitalize', 'autofocus'], attributeBindings: ['autocorrect', 'autocapitalize', 'autofocus'],
placeholder: function() { placeholder: function() {
if( this.get('placeholderKey') ) { if( this.get('placeholderKey') ) {
return I18n.t(this.get('placeholderKey')); return I18n.t(this.get('placeholderKey'));
} else { } else {

View file

@ -82,7 +82,7 @@ td {border-bottom: 1px solid #ddd; border-top: 1px solid #ddd;}
@include border-radius-all(5px); @include border-radius-all(5px);
background-color: darken($white, 5%); background-color: darken($white, 5%);
border: 1px solid darken($white, 10%); border: 1px solid darken($white, 10%);
padding: 5px 10px 3px 0px; padding: 10px 10px 3px 0px;
margin-bottom: 20px; margin-bottom: 20px;
height: 35px; height: 35px;
.nav.nav-pills { .nav.nav-pills {
@ -102,11 +102,15 @@ td {border-bottom: 1px solid #ddd; border-top: 1px solid #ddd;}
color: $darkish_gray; color: $darkish_gray;
} }
.controls { .controls {
padding-top: 3px; margin-left: 10px;
} }
button { button {
float: left;
margin-right: 5px; margin-right: 5px;
margin-left: 5px;
}
input[type=text] {
display: inline-block;
float: left;
} }
.result-message { .result-message {
display: inline-block; display: inline-block;

View file

@ -1063,7 +1063,6 @@ cs:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "zadejte text pro filtrování..."
admin: admin:
title: 'Discourse Administrace' title: 'Discourse Administrace'

View file

@ -684,7 +684,6 @@ da:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "type to filter..."
admin: admin:
title: 'Discourse Admin' title: 'Discourse Admin'

View file

@ -1050,7 +1050,6 @@ de:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "Tippe etwas ein, um zu filtern..."
admin: admin:
title: 'Discourse Administrator' title: 'Discourse Administrator'

View file

@ -1075,7 +1075,7 @@ en:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "type to filter..." filter: "filter"
admin: admin:
title: 'Discourse Admin' title: 'Discourse Admin'

View file

@ -794,7 +794,6 @@ es:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "type to filter..."
admin: admin:
title: 'Administrador' title: 'Administrador'

View file

@ -1033,7 +1033,6 @@ fr:
create_post: "Répondre / Voir" create_post: "Répondre / Voir"
readonly: "Voir" readonly: "Voir"
admin_js: admin_js:
type_to_filter: "Commencez à taper pour filtrer..."
admin: admin:
title: 'Administation Discourse' title: 'Administation Discourse'
moderator: 'Modérateur' moderator: 'Modérateur'

View file

@ -639,7 +639,6 @@ id:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "type to filter..."
admin: admin:
title: 'Discourse Admin' title: 'Discourse Admin'

View file

@ -1002,7 +1002,6 @@ it:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "scrivi per filtrare..."
admin: admin:
title: 'Amministrazione Discourse' title: 'Amministrazione Discourse'

View file

@ -842,7 +842,6 @@ ko:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "필터를 입력하세요"
admin: admin:
title: 'Discourse 관리자' title: 'Discourse 관리자'

View file

@ -915,7 +915,6 @@ nb_NO:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "skriv for å filtrere..."
admin: admin:
title: 'Discourse Admin' title: 'Discourse Admin'

View file

@ -1015,7 +1015,6 @@ nl:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: typ om te filteren...
admin: admin:
title: Discourse Beheer title: Discourse Beheer

View file

@ -970,7 +970,6 @@ pseudo:
ƀřóŵšéř íš ťóó ółď ťó ŵóřǩ óɳ ťĥíš Ďíščóůřšé ƒóřůɱ</á>. Рłéášé <á ĥřéƒ="ĥťťƿ://ƀřóŵšéĥáƿƿý.čóɱ">ůƿǧřáďé ƀřóŵšéř íš ťóó ółď ťó ŵóřǩ óɳ ťĥíš Ďíščóůřšé ƒóřůɱ</á>. Рłéášé <á ĥřéƒ="ĥťťƿ://ƀřóŵšéĥáƿƿý.čóɱ">ůƿǧřáďé
ýóůř ƀřóŵšéř</á>. ]]' ýóůř ƀřóŵšéř</á>. ]]'
admin_js: admin_js:
type_to_filter: '[[ ťýƿé ťó ƒíłťéř... ]]'
admin: admin:
title: '[[ Ďíščóůřšé Áďɱíɳ ]]' title: '[[ Ďíščóůřšé Áďɱíɳ ]]'
moderator: '[[ Ϻóďéřáťóř ]]' moderator: '[[ Ϻóďéřáťóř ]]'

View file

@ -603,7 +603,6 @@ pt:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "escreve para filtrar..."
admin: admin:
title: 'Discourse Admin' title: 'Discourse Admin'

View file

@ -1070,7 +1070,6 @@ pt_BR:
# Essa seção é para o javascript para i18n no admin # Essa seção é para o javascript para i18n no admin
admin_js: admin_js:
type_to_filter: "escreva para filtrar..."
admin: admin:
title: 'Discourse Admin' title: 'Discourse Admin'

View file

@ -1086,7 +1086,6 @@ ru:
create_post: 'Отвечать / Просматривать' create_post: 'Отвечать / Просматривать'
readonly: Просматривать readonly: Просматривать
admin_js: admin_js:
type_to_filter: 'Введите текст для фильтрации...'
admin: admin:
title: 'Discourse Admin' title: 'Discourse Admin'
moderator: Модератор moderator: Модератор

View file

@ -789,7 +789,6 @@ sv:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "skriv för att filtrera..."
admin: admin:
title: 'Discourse Admin' title: 'Discourse Admin'

View file

@ -1073,7 +1073,6 @@ zh_CN:
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "输入过滤条件……"
admin: admin:
title: '论道 管理' title: '论道 管理'

View file

@ -969,7 +969,6 @@ zh_TW:
readonly: "觀看" readonly: "觀看"
# This section is exported to the javascript for i18n in the admin section # This section is exported to the javascript for i18n in the admin section
admin_js: admin_js:
type_to_filter: "輸入過濾條件……"
admin: admin:
title: '論道 管理' title: '論道 管理'