quitar el filtro
This commit is contained in:
parent
c338cb87de
commit
8fa21aa315
3 changed files with 6 additions and 3 deletions
|
@ -14,14 +14,15 @@
|
||||||
%table.mb-3
|
%table.mb-3
|
||||||
- @site.layouts.each do |layout|
|
- @site.layouts.each do |layout|
|
||||||
- next if layout.hidden?
|
- next if layout.hidden?
|
||||||
|
- filter = params[:layout] == layout.value
|
||||||
%tr
|
%tr
|
||||||
%th= layout.humanized_name
|
%th= layout.humanized_name
|
||||||
%td.pl-3= link_to t('posts.add'),
|
%td.pl-3= link_to t('posts.add'),
|
||||||
new_site_post_path(@site, layout: layout.name),
|
new_site_post_path(@site, layout: layout.name),
|
||||||
class: 'badge badge-secondary'
|
class: 'badge badge-secondary'
|
||||||
%td= link_to t('posts.filter'),
|
%td= link_to t(filter ? 'posts.remove_filter' : 'posts.filter'),
|
||||||
site_posts_path(@site, layout: layout.value),
|
site_posts_path(@site, layout: (filter ? nil : layout.value)),
|
||||||
class: 'badge badge-secondary'
|
class: 'badge badge-' + (filter ? 'primary' : 'secondary')
|
||||||
|
|
||||||
- if policy(@site).edit?
|
- if policy(@site).edit?
|
||||||
= link_to t('sites.edit.btn', site: @site.title), edit_site_path(@site), class: 'btn'
|
= link_to t('sites.edit.btn', site: @site.title), edit_site_path(@site), class: 'btn'
|
||||||
|
|
|
@ -490,6 +490,7 @@ en:
|
||||||
new: 'Post types'
|
new: 'Post types'
|
||||||
add: 'Add'
|
add: 'Add'
|
||||||
filter: 'Filter'
|
filter: 'Filter'
|
||||||
|
remove_filter: 'Back'
|
||||||
categories: 'Everything'
|
categories: 'Everything'
|
||||||
index: 'Posts'
|
index: 'Posts'
|
||||||
edit: 'Edit'
|
edit: 'Edit'
|
||||||
|
|
|
@ -504,6 +504,7 @@ es:
|
||||||
new: 'Tipos de artículos'
|
new: 'Tipos de artículos'
|
||||||
add: 'Agregar'
|
add: 'Agregar'
|
||||||
filter: 'Filtrar'
|
filter: 'Filtrar'
|
||||||
|
remove_filter: 'Volver'
|
||||||
index: 'Artículos'
|
index: 'Artículos'
|
||||||
edit: 'Editar'
|
edit: 'Editar'
|
||||||
preview:
|
preview:
|
||||||
|
|
Loading…
Reference in a new issue