From 12a9813a0cc269d7b7c72095e279f70ddb7bec6e Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 6 Jan 2020 18:22:17 +0100 Subject: Fix reuse of detailed status components (#12792) Fixes #12770 --- app/javascript/mastodon/features/status/index.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js index 6b18f34d1..c058120d6 100644 --- a/app/javascript/mastodon/features/status/index.js +++ b/app/javascript/mastodon/features/status/index.js @@ -542,6 +542,7 @@ class Status extends ImmutablePureComponent {
Date: Tue, 7 Jan 2020 16:41:19 +0700 Subject: 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 --- app/views/filters/index.html.haml | 37 +++++++++++++++++++++---------------- config/locales/en.yml | 1 + 2 files changed, 22 insertions(+), 16 deletions(-) (limited to 'app') diff --git a/app/views/filters/index.html.haml b/app/views/filters/index.html.haml index 18ebee570..530ea6f59 100644 --- a/app/views/filters/index.html.haml +++ b/app/views/filters/index.html.haml @@ -1,20 +1,25 @@ - content_for :page_title do = t('filters.index.title') -.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 +- content_for :page_heading_actions do + = link_to t('filters.new.title'), new_filter_path, class: 'button' -= 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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 42bd81e40..6b52f4cad 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -744,6 +744,7 @@ en: invalid_irreversible: Irreversible filtering only works with home or notifications context index: delete: Delete + empty: You have no filters. title: Filters new: title: Add new filter -- cgit From 5636c94fe911f670a0f51d63c915c722daf24df5 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 6 Jan 2020 18:22:17 +0100 Subject: [Glitch] Fix reuse of detailed status components Port 12a9813a0cc269d7b7c72095e279f70ddb7bec6e to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/features/status/index.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js index 322f92477..411d2a88d 100644 --- a/app/javascript/flavours/glitch/features/status/index.js +++ b/app/javascript/flavours/glitch/features/status/index.js @@ -568,6 +568,7 @@ class Status extends ImmutablePureComponent {