diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index 45a06b7c..b2f3f661 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -14,14 +14,15 @@ %table.mb-3 - @site.layouts.each do |layout| - next if layout.hidden? + - filter = params[:layout] == layout.value %tr %th= layout.humanized_name %td.pl-3= link_to t('posts.add'), new_site_post_path(@site, layout: layout.name), class: 'badge badge-secondary' - %td= link_to t('posts.filter'), - site_posts_path(@site, layout: layout.value), - class: 'badge badge-secondary' + %td= link_to t(filter ? 'posts.remove_filter' : 'posts.filter'), + site_posts_path(@site, layout: (filter ? nil : layout.value)), + class: 'badge badge-' + (filter ? 'primary' : 'secondary') - if policy(@site).edit? = link_to t('sites.edit.btn', site: @site.title), edit_site_path(@site), class: 'btn' diff --git a/config/locales/en.yml b/config/locales/en.yml index 41f32a73..62634510 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -490,6 +490,7 @@ en: new: 'Post types' add: 'Add' filter: 'Filter' + remove_filter: 'Back' categories: 'Everything' index: 'Posts' edit: 'Edit' diff --git a/config/locales/es.yml b/config/locales/es.yml index d23e3f74..3fecfcd3 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -504,6 +504,7 @@ es: new: 'Tipos de artículos' add: 'Agregar' filter: 'Filtrar' + remove_filter: 'Volver' index: 'Artículos' edit: 'Editar' preview: