mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-19 04:16:22 +00:00
fix: deshabilitar la interfaz de orden para invitades #13439
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
41acc89e37
commit
9fd9e5fa4e
1 changed files with 29 additions and 20 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
- reorder_allowed = policy(site).reorder?
|
||||||
|
- if reorder_allowed
|
||||||
|
- reorder_controller = { controller: 'reorder' }
|
||||||
|
- reorder_target = { target: 'reorder.row' }
|
||||||
|
- else
|
||||||
|
- reorder_target = reorder_controller = {}
|
||||||
|
|
||||||
%main.row
|
%main.row
|
||||||
%aside.menu.col-md-3
|
%aside.menu.col-md-3
|
||||||
= render 'sites/header', site: @site
|
= render 'sites/header', site: @site
|
||||||
|
@ -67,14 +74,14 @@
|
||||||
%h2= t('posts.empty')
|
%h2= t('posts.empty')
|
||||||
- else
|
- else
|
||||||
= form_tag site_posts_reorder_path, method: :post do
|
= form_tag site_posts_reorder_path, method: :post do
|
||||||
%input{ type: 'hidden', name: 'post[lang]', value: @locale }
|
%table.table{ data: reorder_controller }
|
||||||
%table.table{ data: { controller: 'reorder' } }
|
|
||||||
%caption.sr-only= t('posts.caption')
|
%caption.sr-only= t('posts.caption')
|
||||||
%thead
|
%thead
|
||||||
%tr.sticky-top
|
%tr.sticky-top
|
||||||
%th.border-0{ colspan: '4' }
|
%th.border-0{ colspan: '4' }
|
||||||
.d-flex.flex-row.justify-content-between
|
.d-flex.flex-row.justify-content-between
|
||||||
%div
|
%div
|
||||||
|
- if reorder_allowed
|
||||||
= submit_tag t('posts.reorder.submit'), class: 'btn'
|
= submit_tag t('posts.reorder.submit'), class: 'btn'
|
||||||
%button.btn{ data: { action: 'reorder#unselect' } }
|
%button.btn{ data: { action: 'reorder#unselect' } }
|
||||||
= t('posts.reorder.unselect')
|
= t('posts.reorder.unselect')
|
||||||
|
@ -83,6 +90,7 @@
|
||||||
%button.btn{ data: { action: 'reorder#down' } }= t('posts.reorder.down')
|
%button.btn{ data: { action: 'reorder#down' } }= t('posts.reorder.down')
|
||||||
%button.btn{ data: { action: 'reorder#top' } }= t('posts.reorder.top')
|
%button.btn{ data: { action: 'reorder#top' } }= t('posts.reorder.top')
|
||||||
%button.btn{ data: { action: 'reorder#bottom' } }= t('posts.reorder.bottom')
|
%button.btn{ data: { action: 'reorder#bottom' } }= t('posts.reorder.bottom')
|
||||||
|
%input{ type: 'hidden', name: 'post[lang]', value: @locale }
|
||||||
|
|
||||||
%div
|
%div
|
||||||
%tbody
|
%tbody
|
||||||
|
@ -94,7 +102,8 @@
|
||||||
les botones por permisos.
|
les botones por permisos.
|
||||||
- cache_if @usuarie, [post, I18n.locale] do
|
- cache_if @usuarie, [post, I18n.locale] do
|
||||||
- checkbox_id = "checkbox-#{post.post_id}"
|
- checkbox_id = "checkbox-#{post.post_id}"
|
||||||
%tr{ id: post.post_id, data: { target: 'reorder.row' } }
|
%tr{ id: post.post_id, data: reorder_target }
|
||||||
|
- if reorder_allowed
|
||||||
%td
|
%td
|
||||||
.custom-control.custom-checkbox
|
.custom-control.custom-checkbox
|
||||||
%input.custom-control-input{ id: checkbox_id, type: 'checkbox', autocomplete: 'off', data: { action: 'reorder#select' } }
|
%input.custom-control-input{ id: checkbox_id, type: 'checkbox', autocomplete: 'off', data: { action: 'reorder#select' } }
|
||||||
|
|
Loading…
Reference in a new issue