From 13b4d7953adfa8455f800a56124c7d6ecafa41ca Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Fri, 10 Jan 2020 14:19:04 -0600 Subject: add ability to toggle individual filters without deleting them --- app/views/filters/_fields.html.haml | 3 +++ app/views/filters/index.html.haml | 2 ++ 2 files changed, 5 insertions(+) (limited to 'app/views') 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 -- cgit