solo las usuarias pueden ordenar posts
This commit is contained in:
parent
e3c42bc606
commit
c9e4356dba
1 changed files with 20 additions and 19 deletions
|
@ -51,24 +51,25 @@
|
|||
sort_by: s)
|
||||
= form_tag site_reorder_posts_path, method: :post do
|
||||
= hidden_field 'posts', 'lang', value: @lang
|
||||
- if @site.ordered? @lang
|
||||
.reorder-posts-panel.alert.alert-info.alert-dismissible.fade.show{role: 'alert'}
|
||||
= raw t('help.posts.reorder')
|
||||
%br
|
||||
= submit_tag t('posts.reorder_posts'), class: 'btn btn-success'
|
||||
%button.close{type: 'button',
|
||||
'aria-label': t('help.close') }
|
||||
%span{'aria-hidden': true} ×
|
||||
- else
|
||||
.alert.alert-danger.alert-dismissible.fade.show{role: 'alert'}
|
||||
= raw t('errors.posts.disordered')
|
||||
%br
|
||||
= hidden_field 'posts', 'force', value: true
|
||||
= submit_tag t('errors.posts.disordered_button'), class: 'btn btn-danger'
|
||||
%button.close{type: 'button',
|
||||
data: { dismiss: 'alert' },
|
||||
'aria-label': t('help.close') }
|
||||
%span{'aria-hidden': true} ×
|
||||
- if policy(@site).reorder_posts?
|
||||
- if @site.ordered? @lang
|
||||
.reorder-posts-panel.alert.alert-info.alert-dismissible.fade.show{role: 'alert'}
|
||||
= raw t('help.posts.reorder')
|
||||
%br
|
||||
= submit_tag t('posts.reorder_posts'), class: 'btn btn-success'
|
||||
%button.close{type: 'button',
|
||||
'aria-label': t('help.close') }
|
||||
%span{'aria-hidden': true} ×
|
||||
- else
|
||||
.alert.alert-danger.alert-dismissible.fade.show{role: 'alert'}
|
||||
= raw t('errors.posts.disordered')
|
||||
%br
|
||||
= hidden_field 'posts', 'force', value: true
|
||||
= submit_tag t('errors.posts.disordered_button'), class: 'btn btn-danger'
|
||||
%button.close{type: 'button',
|
||||
data: { dismiss: 'alert' },
|
||||
'aria-label': t('help.close') }
|
||||
%span{'aria-hidden': true} ×
|
||||
%table.table.table-condensed.table-striped{class: (@site.ordered? @lang) ? 'table-draggable' : ''}
|
||||
%tbody
|
||||
- @posts.each_with_index do |post, i|
|
||||
|
@ -79,7 +80,7 @@
|
|||
-# establecer la direccion del texto
|
||||
- direction = post.get_front_matter(:dir)
|
||||
%tr
|
||||
- if @site.ordered? @lang
|
||||
- if policy(@site).reorder_posts? && @site.ordered?(@lang)
|
||||
%td
|
||||
= fa_icon 'arrows-v', class: 'handle'
|
||||
= hidden_field 'posts[order]', i, value: post.order, class: 'post_order'
|
||||
|
|
Loading…
Reference in a new issue