UX: Allow site settings to display as textareas if they like

This commit is contained in:
Robin Ward 2017-07-17 16:38:26 -04:00
parent cdb3706025
commit 29d529020b
3 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,8 @@
{{text-field value=value classNames="input-setting-string"}}
{{#if setting.textarea}}
{{textarea value=value classNames="input-setting-textarea"}}
{{else}}
{{text-field value=value classNames="input-setting-string"}}
{{/if}}
{{setting-validation-message message=validationMessage}}
<div class='desc'>{{{unbound setting.description}}}</div>

View File

@ -461,7 +461,7 @@ td.flaggers td {
.setting-controls {
float: left;
}
.input-setting-string {
.input-setting-string, .input-setting-textarea {
box-sizing: border-box;
height: 30px;
width: 100%;
@ -469,6 +469,9 @@ td.flaggers td {
width: 100%;
}
}
.input-setting-textarea {
height: 150px;
}
.input-setting-list {
@media (max-width: $mobile-breakpoint) {
width: 100%;
@ -531,7 +534,7 @@ td.flaggers td {
}
.setting.overridden.string {
input[type=text] {
input[type=text], textarea {
background-color: dark-light-diff($highlight, $secondary, 50%, -60%);
}
}

View File

@ -195,6 +195,8 @@ module SiteSettingExtension
opts.merge!({valid_values: choices[s].map{|c| {name: c, value: c}}, translate_names: false})
end
opts[:textarea] = true if static_types[s] == :textarea
opts[:choices] = choices[s] if choices.has_key? s
opts
end