mastodon/app/views/filters/index.html.haml
Sasha Sorokin 345dd93310 Little improvements to filters settings page (#12793)
When you have many filters, it may be hard for you to reach the button
to create yet another one. This commit moves creation button to the
heading, leaving the page just for the list.

On the other hand, when there are no filters, page looks kind of
strange with the empty table. So text stating obvious fact that user
has no filters was added in this commit too.

Closes #11020
Closes #12790
2020-01-07 10:41:19 +01:00

26 lines
889 B
Plaintext

- content_for :page_title do
= t('filters.index.title')
- content_for :page_heading_actions do
= link_to t('filters.new.title'), new_filter_path, class: 'button'
- if @filters.count == 0
%div{ style: 'display: flex; justify-content: center' }
%div.muted-hint= t 'filters.index.empty'
- else
.table-wrapper
%table.table
%thead
%tr
%th= t('simple_form.labels.defaults.phrase')
%th= t('simple_form.labels.defaults.context')
%th
%tbody
- @filters.each do |filter|
%tr
%td= filter.phrase
%td= filter.context.map { |context| I18n.t("filters.contexts.#{context}") }.join(', ')
%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