diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-12-23 11:28:28 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2018-12-23 11:28:28 +0100 |
commit | 3e686beaea1931c76c778d8ca6b03c41caaf69db (patch) | |
tree | f659a52ba0245daf2c7776e63c3a5012f906552a /app/views/admin/warning_presets | |
parent | 1a3088364fe602bb48647d78dda440b174424e17 (diff) | |
parent | e25947db4a44cd50fa1daa36d5031a950327b646 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - config/routes.rb Upstream changed some admin routes, conflict was because of an added :show action for statuses on our side. Kept it.
Diffstat (limited to 'app/views/admin/warning_presets')
-rw-r--r-- | app/views/admin/warning_presets/edit.html.haml | 11 | ||||
-rw-r--r-- | app/views/admin/warning_presets/index.html.haml | 30 |
2 files changed, 41 insertions, 0 deletions
diff --git a/app/views/admin/warning_presets/edit.html.haml b/app/views/admin/warning_presets/edit.html.haml new file mode 100644 index 000000000..9522746cd --- /dev/null +++ b/app/views/admin/warning_presets/edit.html.haml @@ -0,0 +1,11 @@ +- content_for :page_title do + = t('admin.warning_presets.edit_preset') + += simple_form_for @warning_preset, url: admin_warning_preset_path(@warning_preset) do |f| + = render 'shared/error_messages', object: @warning_preset + + .fields-group + = f.input :text, wrapper: :with_block_label + + .actions + = f.button :button, t('generic.save_changes'), type: :submit diff --git a/app/views/admin/warning_presets/index.html.haml b/app/views/admin/warning_presets/index.html.haml new file mode 100644 index 000000000..45913ef73 --- /dev/null +++ b/app/views/admin/warning_presets/index.html.haml @@ -0,0 +1,30 @@ +- content_for :page_title do + = t('admin.warning_presets.title') + +- if can? :create, :account_warning_preset + = simple_form_for @warning_preset, url: admin_warning_presets_path do |f| + = render 'shared/error_messages', object: @warning_preset + + .fields-group + = f.input :text, wrapper: :with_block_label + + .actions + = f.button :button, t('admin.warning_presets.add_new'), type: :submit + + %hr.spacer/ + +- unless @warning_presets.empty? + .table-wrapper + %table.table + %thead + %tr + %th= t('simple_form.labels.account_warning_preset.text') + %th + %tbody + - @warning_presets.each do |preset| + %tr + %td + = Formatter.instance.linkify(preset.text) + %td + = table_link_to 'pencil', t('admin.warning_presets.edit'), edit_admin_warning_preset_path(preset) + = table_link_to 'trash', t('admin.warning_presets.delete'), admin_warning_preset_path(preset), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') } |