mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: show a paintbrush for color schemes
This commit is contained in:
parent
8052218f61
commit
c76d780675
@ -1,11 +1,10 @@
|
||||
<div class='content-list span6'>
|
||||
<div class='content-list span6 color-schemes'>
|
||||
<h3>{{i18n 'admin.customize.colors.long_title'}}</h3>
|
||||
<ul>
|
||||
{{#each model as |scheme|}}
|
||||
{{#unless scheme.is_base}}
|
||||
|
||||
<li>
|
||||
{{#link-to 'adminCustomize.colors.show' scheme replace=true}}{{scheme.description}}{{/link-to}}
|
||||
{{#link-to 'adminCustomize.colors.show' scheme replace=true}}{{fa-icon 'paint-brush'}}{{scheme.description}}{{/link-to}}
|
||||
</li>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
|
@ -39,6 +39,7 @@
|
||||
<p>{{combo-box content=colorSchemes
|
||||
nameProperty="name"
|
||||
value=colorSchemeId
|
||||
selectionIcon="paint-brush"
|
||||
valueAttribute="id"}}
|
||||
{{#if colorSchemeChanged}}
|
||||
{{d-button action="changeScheme" class="btn-primary btn-small submit-edit" icon="check"}}
|
||||
|
@ -90,8 +90,17 @@ export default Ember.Component.extend(bufferedRender({
|
||||
const $elem = this.$();
|
||||
const caps = this.capabilities;
|
||||
const minimumResultsForSearch = (caps && caps.isIOS) ? -1 : 5;
|
||||
if (!this.get("selectionTemplate") && this.get("selectionIcon")) {
|
||||
this.selectionTemplate = (item) => {
|
||||
let name = Em.get(item, 'text');
|
||||
name = Handlebars.escapeExpression(name);
|
||||
return `<i class='fa fa-${this.get("selectionIcon")}'></i>${name}`;
|
||||
};
|
||||
}
|
||||
$elem.select2({
|
||||
formatResult: this.comboTemplate, minimumResultsForSearch,
|
||||
formatResult: this.comboTemplate,
|
||||
formatSelection: this.selectionTemplate,
|
||||
minimumResultsForSearch,
|
||||
width: this.get('width') || 'resolve',
|
||||
allowClear: true
|
||||
});
|
||||
|
@ -13,6 +13,12 @@
|
||||
.admin-footer {
|
||||
margin-top: 20px;
|
||||
}
|
||||
.select2-chosen, .color-schemes li {
|
||||
.fa {
|
||||
margin-right: 6px;
|
||||
color: dark-light-choose(scale-color($primary, $lightness: 50%), scale-color($secondary, $lightness: 50%));
|
||||
}
|
||||
}
|
||||
.show-current-style {
|
||||
margin-left: 20px;
|
||||
float: left;
|
||||
|
Loading…
Reference in New Issue
Block a user