diff options
author | multiple creatures <dev@multiple-creature.party> | 2020-01-10 14:19:04 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-01-10 14:19:04 -0600 |
commit | 13b4d7953adfa8455f800a56124c7d6ecafa41ca (patch) | |
tree | 76fa5d86a2e646c09b08637625cc31aaa2f694b0 /app/views | |
parent | e13202c114eeb7584e776a073a41d9e57ae31e02 (diff) |
add ability to toggle individual filters without deleting them
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/filters/_fields.html.haml | 3 | ||||
-rw-r--r-- | app/views/filters/index.html.haml | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/app/views/filters/_fields.html.haml b/app/views/filters/_fields.html.haml index 3df611596..1314e8e02 100644 --- a/app/views/filters/_fields.html.haml +++ b/app/views/filters/_fields.html.haml @@ -1,7 +1,10 @@ .fields-row + .fields-row__column.fields-row__column-6.fields-group = f.input :phrase, as: :string, wrapper: :with_label %p.hint{ style: 'margin-bottom: 25px' }= t('simple_form.hints.defaults.phrase_html') + = f.input :is_enabled, as: :boolean, wrapper: :with_label + .fields-row__column.fields-row__column-6.fields-group = f.input :expires_in, wrapper: :with_label, collection: [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].map(&:to_i), label_method: lambda { |i| I18n.t("invites.expires_in.#{i}") }, prompt: I18n.t('invites.expires_in_prompt') diff --git a/app/views/filters/index.html.haml b/app/views/filters/index.html.haml index 228474f01..44fed886d 100644 --- a/app/views/filters/index.html.haml +++ b/app/views/filters/index.html.haml @@ -6,11 +6,13 @@ %thead %tr %th= t('simple_form.labels.defaults.phrase') + %th= t('simple_form.labels.defaults.is_enabled') %th %tbody - @filters.each do |filter| %tr %td= filter.phrase + %td= (filter.is_enabled ? "\u2705" : "\u274c") %td = table_link_to 'pencil', t('filters.edit.title'), edit_filter_path(filter) = table_link_to 'times', t('filters.index.delete'), filter_path(filter), method: :delete |