about summary refs log tree commit diff
path: root/app/views
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-01-07 16:47:02 +0100
committerGitHub <noreply@github.com>2020-01-07 16:47:02 +0100
commit9871466958a5db6c4b75cab120eb6ca706c26d7e (patch)
tree56b830794b3b9ead38291e20c9197ebb3095694d /app/views
parentbcfd6e3bb48f6e0eb88f7f3a650832842ab69166 (diff)
parent5636c94fe911f670a0f51d63c915c722daf24df5 (diff)
Merge pull request #1261 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/views')
-rw-r--r--app/views/filters/index.html.haml37
1 files changed, 21 insertions, 16 deletions
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