mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 23:01:41 +00:00
limpieza de vistas, no asumir que el post tiene categorias
This commit is contained in:
parent
6d3e73fdfe
commit
0369716c59
3 changed files with 7 additions and 18 deletions
|
@ -6,7 +6,6 @@
|
|||
link_to(t('posts.index'),
|
||||
site_posts_path(@site)),
|
||||
@category]
|
||||
= render 'layouts/help', help: t('help.breadcrumbs')
|
||||
.row
|
||||
.col
|
||||
%h1= @site.title
|
||||
|
@ -23,14 +22,6 @@
|
|||
- if @posts.present?
|
||||
.row
|
||||
.col
|
||||
%small.pull-right
|
||||
= t('posts.sort.by')
|
||||
- %w[order date].each do |s|
|
||||
= link_to t("posts.sort.#{s}"),
|
||||
site_posts_path(@site,
|
||||
category: @category,
|
||||
lang: @lang,
|
||||
sort_by: s)
|
||||
%table.table.table-condensed.table-striped
|
||||
%tbody
|
||||
- @posts.each do |post|
|
||||
|
@ -38,16 +29,18 @@
|
|||
saltearse el post a menos que esté en la categoría por
|
||||
la que estamos filtrando
|
||||
- if @category
|
||||
- next unless post.attributes.include? :categories
|
||||
- next unless post.categories.value.include?(@category)
|
||||
%tr
|
||||
%td
|
||||
= link_to post.title.value,
|
||||
site_post_path(@site, post.id)
|
||||
- unless post.categories.value.empty?
|
||||
%br
|
||||
%small
|
||||
- post.categories.value.each do |c|
|
||||
= link_to c, site_posts_path(@site, category: c)
|
||||
- if post.attributes.include? :categories
|
||||
- unless post.categories.value.empty?
|
||||
%br
|
||||
%small
|
||||
- post.categories.value.each do |c|
|
||||
= link_to c, site_posts_path(@site, category: c)
|
||||
|
||||
%td= post.date.value.strftime('%F')
|
||||
%td
|
||||
|
|
|
@ -97,7 +97,6 @@ en:
|
|||
edit: Edit my profile
|
||||
category: 'Category'
|
||||
logout: 'Close the session'
|
||||
breadcrumbs: "What you see up here are the bread crumbs for this site. When you enter a new section, you will see the previous ones and also have a path for where you're standing."
|
||||
posts:
|
||||
reorder: 'You can drag and drop articles by the arrow icon (<i class="fa fa-arrows-v"></i>) and then press the "Reorder posts" button to save them in different order.'
|
||||
i18n:
|
||||
|
|
|
@ -97,9 +97,6 @@ es:
|
|||
edit: Editar mi perfil
|
||||
category: 'Categoría'
|
||||
logout: 'Cierra la sesión'
|
||||
breadcrumbs: 'Lo que ves arriba son las migas de pan de este sitio.
|
||||
Cuando ingreses a una sección, podrás volver a las secciones
|
||||
anteriores y además tener una ruta de donde estás parada.'
|
||||
posts:
|
||||
reorder: 'Puedes arrastrar y soltar los artículos por el ícono de
|
||||
las flechas (<i class="fa fa-arrows-v"></i>) y luego presionar el
|
||||
|
|
Loading…
Reference in a new issue