|
39 | 39 | <span class="form-caption"> |
40 | 40 | These post types will be displayed on the category's homepage. For a Q&A category, you might only want to show questions. |
41 | 41 | </span> |
42 | | - <%= f.select :display_post_types, options_for_select(PostType.mapping.to_a, selected: @category.display_post_types), |
| 42 | + <%= f.select :display_post_types, |
| 43 | + options_for_select(PostType.mapping.to_a, selected: @category.display_post_types), |
43 | 44 | { include_blank: true }, multiple: true, class: 'form-element' %> |
44 | 45 | </div> |
45 | 46 |
|
|
58 | 59 | <div class="form-group"> |
59 | 60 | <%= f.label :tag_set_id, 'Tag set', class: 'form-element' %> |
60 | 61 | <span class="form-caption">Which tag set may posts in this category draw from?</span> |
61 | | - <%= f.select :tag_set_id, options_for_select(TagSet.all.map { |ts| [ts.name, ts.id] }, selected: @category.tag_set_id), |
| 62 | + <%= f.select :tag_set_id, |
| 63 | + options_for_select(TagSet.all.map { |ts| [ts.name, ts.id] }, selected: @category.tag_set_id), |
62 | 64 | { include_blank: true }, class: 'form-element js-category-tag-set-select' %> |
63 | 65 | </div> |
64 | 66 |
|
|
87 | 89 | Users must have at least this trust level to post in this category. Leave blank to allow |
88 | 90 | anyone to post. |
89 | 91 | </span> |
90 | | - <%= f.select :min_trust_level, options_for_select(Ability.trust_levels.invert.each_pair, selected: @category.min_trust_level), |
| 92 | + <%= f.select :min_trust_level, |
| 93 | + options_for_select(Ability.trust_levels.invert.each_pair, selected: @category.min_trust_level), |
91 | 94 | {}, class: 'form-element' %> |
92 | 95 | </div> |
93 | 96 |
|
|
97 | 100 | Users under this trust level cannot see that this category exists. Leave blank to leave the category public. |
98 | 101 | This can be different (higher or lower) than the minimum posting trust level. |
99 | 102 | </span> |
100 | | - <%= f.select :min_view_trust_level, options_for_select(Ability.trust_levels.invert.each_pair, selected: @category.min_view_trust_level), |
| 103 | + <%= f.select :min_view_trust_level, |
| 104 | + options_for_select(Ability.trust_levels.invert.each_pair, selected: @category.min_view_trust_level), |
101 | 105 | {}, class: 'form-element' %> |
102 | 106 | </div> |
103 | 107 |
|
|
132 | 136 |
|
133 | 137 | <div class="form-group"> |
134 | 138 | <%= f.label :color_code, 'Header color', class: 'form-element' %> |
135 | | - <span class="form-caption">Select a color to be used for the header within this category. Leave empty for site-wide default.</span> |
136 | | - <%= f.select :color_code, options_for_select(['turquoise', 'green', 'blue', 'darkblue', 'purple', 'gray', 'bluegray', 'yellow', 'orange', 'pink', 'red'], selected: @category.color_code), |
137 | | - { include_blank: true }, class: 'form-element' %> |
| 139 | + <span class="form-caption"> |
| 140 | + Select a color to be used for the header within this category. Leave empty for site-wide default. |
| 141 | + </span> |
| 142 | + <%= f.select :color_code, |
| 143 | + options_for_select(Category::COLORS, selected: @category.color_code), |
| 144 | + { include_blank: true }, |
| 145 | + class: 'form-element' %> |
138 | 146 | </div> |
139 | 147 |
|
140 | 148 | <div class="form-group"> |
|
150 | 158 | <%= f.label :default_filter_id, class: 'form-element' %> |
151 | 159 | <span class="form-caption">The default filter for this category, used for anonymous users.</span> |
152 | 160 | <% system_filters = User.find(-1).filters.to_h { |filter| [filter.name, filter.id] } %> |
153 | | - <%= f.select :default_filter_id, options_for_select(system_filters, selected: @category.default_filter_id), { include_blank: "No default" } %> |
| 161 | + <%= f.select :default_filter_id, |
| 162 | + options_for_select(system_filters, selected: @category.default_filter_id), |
| 163 | + { include_blank: 'No default' }, |
| 164 | + class: 'form-element' %> |
154 | 165 | </div> |
155 | 166 | </details> |
156 | 167 |
|
|
163 | 174 | <div class="form-group"> |
164 | 175 | <%= f.label :asking_guidance_override, class: 'form-element' %> |
165 | 176 | <span class="form-caption"> |
166 | | - This field overrides the default asking guidance and is shown when a new post is created. Leave blank to use site-default. |
167 | | - </span> |
| 177 | + This field overrides the default asking guidance and is shown when a new post is created.<br/> |
| 178 | + Leave blank to use site-default. |
| 179 | + </span> |
168 | 180 | <%= f.text_area :asking_guidance_override, class: 'form-element' %> |
169 | 181 | </div> |
170 | 182 |
|
171 | 183 | <div class="form-group"> |
172 | 184 | <%= f.label :answering_guidance_override, class: 'form-element' %> |
173 | 185 | <span class="form-caption"> |
174 | | - This field overrides the default answering guidance and is shown when a new answer is created. Leave blank to use site-default. |
| 186 | + This field overrides the default answering guidance and is shown when a new answer is created.<br/> |
| 187 | + Leave blank to use site-default. |
175 | 188 | </span> |
176 | 189 | <%= f.text_area :answering_guidance_override, class: 'form-element' %> |
177 | 190 | </div> |
|
188 | 201 | <span class="form-caption"> |
189 | 202 | Whether the posts of this category are eligible to be selected as hot posts. |
190 | 203 | </span> |
191 | | - <%= f.select :use_for_hot_posts, options_for_select([['yes', true], ['no', false]], selected: @category.use_for_hot_posts), |
| 204 | + <%= f.select :use_for_hot_posts, |
| 205 | + options_for_select([['yes', true], ['no', false]], selected: @category.use_for_hot_posts), |
192 | 206 | {}, class: 'form-element' %> |
193 | 207 | </div> |
194 | 208 |
|
|
197 | 211 | <span class="form-caption"> |
198 | 212 | Whether the posts of this category are eligible to be selected as random advertisement. |
199 | 213 | </span> |
200 | | - <%= f.select :use_for_advertisement, options_for_select([['yes', true], ['no', false]], selected: @category.use_for_advertisement), |
| 214 | + <%= f.select :use_for_advertisement, |
| 215 | + options_for_select([['yes', true], ['no', false]], selected: @category.use_for_advertisement), |
201 | 216 | {}, class: 'form-element' %> |
202 | 217 | </div> |
203 | 218 | </details> |
|
0 commit comments