mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-21 22:46:21 +00:00
Merge branch 'rails' of 0xacab.org:sutty/sutty into rails
This commit is contained in:
commit
30621bb219
2 changed files with 36 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
|
||||||
.mb-3
|
.mb-3
|
||||||
|
@ -67,22 +74,22 @@
|
||||||
%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
|
||||||
= submit_tag t('posts.reorder.submit'), class: 'btn btn-secondary'
|
- if reorder_allowed
|
||||||
%button.btn.btn-secondary{ data: { action: 'reorder#unselect' } }
|
= submit_tag t('posts.reorder.submit'), class: 'btn btn-secondary'
|
||||||
= t('posts.reorder.unselect')
|
%button.btn.btn-secondary{ data: { action: 'reorder#unselect' } }
|
||||||
%span.badge{ data: { target: 'reorder.counter' } } 0
|
= t('posts.reorder.unselect')
|
||||||
%button.btn.btn-secondary{ data: { action: 'reorder#up' } }= t('posts.reorder.up')
|
%span.badge{ data: { target: 'reorder.counter' } } 0
|
||||||
%button.btn.btn-secondary{ data: { action: 'reorder#down' } }= t('posts.reorder.down')
|
%button.btn.btn-secondary{ data: { action: 'reorder#up' } }= t('posts.reorder.up')
|
||||||
%button.btn.btn-secondary{ data: { action: 'reorder#top' } }= t('posts.reorder.top')
|
%button.btn.btn-secondary{ data: { action: 'reorder#down' } }= t('posts.reorder.down')
|
||||||
%button.btn.btn-secondary{ data: { action: 'reorder#bottom' } }= t('posts.reorder.bottom')
|
%button.btn.btn-secondary{ data: { action: 'reorder#top' } }= t('posts.reorder.top')
|
||||||
|
%button.btn.btn-secondary{ data: { action: 'reorder#bottom' } }= t('posts.reorder.bottom')
|
||||||
|
|
||||||
- if @site.pagination
|
- if @site.pagination
|
||||||
%div
|
%div
|
||||||
|
@ -97,16 +104,17 @@
|
||||||
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 }
|
||||||
%td
|
- if reorder_allowed
|
||||||
.custom-control.custom-checkbox
|
%td
|
||||||
%input.custom-control-input{ id: checkbox_id, type: 'checkbox', autocomplete: 'off', data: { action: 'reorder#select' } }
|
.custom-control.custom-checkbox
|
||||||
%label.custom-control-label{ for: checkbox_id }
|
%input.custom-control-input{ id: checkbox_id, type: 'checkbox', autocomplete: 'off', data: { action: 'reorder#select' } }
|
||||||
%span.sr-only= t('posts.reorder.select')
|
%label.custom-control-label{ for: checkbox_id }
|
||||||
-# Orden más alto es mayor prioridad
|
%span.sr-only= t('posts.reorder.select')
|
||||||
= hidden_field 'post[reorder]', post.post_id,
|
-# Orden más alto es mayor prioridad
|
||||||
value: size - i,
|
= hidden_field 'post[reorder]', post.post_id,
|
||||||
data: { reorder: true }
|
value: size - i,
|
||||||
|
data: { reorder: true }
|
||||||
%td.w-100{ class: dir }
|
%td.w-100{ class: dir }
|
||||||
= link_to site_post_path(@site, post.path) do
|
= link_to site_post_path(@site, post.path) do
|
||||||
%span{ lang: post.locale, dir: dir }= post.title
|
%span{ lang: post.locale, dir: dir }= post.title
|
||||||
|
|
|
@ -91,6 +91,14 @@
|
||||||
description_en: "We're working towards adding more themes for you to use. [Contact us!](https://sutty.nl/en/#contact)"
|
description_en: "We're working towards adding more themes for you to use. [Contact us!](https://sutty.nl/en/#contact)"
|
||||||
description_es: "Estamos trabajando para que puedas tener más diseños. [¡Escribinos!](https://sutty.nl/#contacto)"
|
description_es: "Estamos trabajando para que puedas tener más diseños. [¡Escribinos!](https://sutty.nl/#contacto)"
|
||||||
priority: '3'
|
priority: '3'
|
||||||
|
- name_en: 'Worker-recovered factory'
|
||||||
|
name_es: 'Empresa recuperada'
|
||||||
|
gem: 'empresa-recuperada-jekyll-theme'
|
||||||
|
url: 'https://empresa-recuperada.sutty.nl/'
|
||||||
|
disabled: true
|
||||||
|
description_en: "A template for [empresas recuperadas](https://en.wikipedia.org/wiki/Workers%27_self-management#Empresas_recuperadas_movement). We're working towards adding more themes for you to use. [Contact us!](https://sutty.nl/en/#contact)"
|
||||||
|
description_es: "Estamos trabajando para que puedas tener más diseños. [¡Escribinos!](https://sutty.nl/#contacto)"
|
||||||
|
priority: '3'
|
||||||
- name_en: 'More themes'
|
- name_en: 'More themes'
|
||||||
name_es: 'Más plantillas'
|
name_es: 'Más plantillas'
|
||||||
gem: 'sutty-theme-own'
|
gem: 'sutty-theme-own'
|
||||||
|
|
Loading…
Reference in a new issue