index.html.haml 1.0 KB

123456789101112131415161718192021222324252627282930
  1. - content_for :page_title do
  2. = t('admin.warning_presets.title')
  3. - if can? :create, :account_warning_preset
  4. = simple_form_for @warning_preset, url: admin_warning_presets_path do |f|
  5. = render 'shared/error_messages', object: @warning_preset
  6. .fields-group
  7. = f.input :text, wrapper: :with_block_label
  8. .actions
  9. = f.button :button, t('admin.warning_presets.add_new'), type: :submit
  10. %hr.spacer/
  11. - unless @warning_presets.empty?
  12. .table-wrapper
  13. %table.table
  14. %thead
  15. %tr
  16. %th= t('simple_form.labels.account_warning_preset.text')
  17. %th
  18. %tbody
  19. - @warning_presets.each do |preset|
  20. %tr
  21. %td
  22. = Formatter.instance.linkify(preset.text)
  23. %td
  24. = table_link_to 'pencil', t('admin.warning_presets.edit'), edit_admin_warning_preset_path(preset)
  25. = table_link_to 'trash', t('admin.warning_presets.delete'), admin_warning_preset_path(preset), method: :delete, data: { confirm: t('admin.accounts.are_you_sure') }