WIP: lxs invitadxs solo pueden cargar la primera plantilla

This commit is contained in:
f 2019-02-16 15:28:06 -03:00
parent 4dc08d9dbc
commit a2fa16eb43
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7
3 changed files with 13 additions and 9 deletions

View file

@ -14,16 +14,18 @@
= link_to t('posts.new'), new_site_post_path(@site, lang: @lang), = link_to t('posts.new'), new_site_post_path(@site, lang: @lang),
class: 'btn btn-success' class: 'btn btn-success'
- else - else
= link_to t('posts.new'), new_site_post_path(@site, lang: @lang, template: @site.templates.first.id), = link_to t('posts.new_with_template', template: @site.templates.first.id.humanize),
new_site_post_path(@site, lang: @lang, template: @site.templates.first.id),
class: 'btn btn-success' class: 'btn btn-success'
%button.btn.btn-success.dropdown-toggle.dropdown-toggle-split{data: { toggle: 'split' }, - if policy(Post).usuaria?
aria: { haspopup: 'true', expanded: 'false' }} %button.btn.btn-success.dropdown-toggle.dropdown-toggle-split{data: { toggle: 'split' },
%span.sr-only= t('posts.dropdown') aria: { haspopup: 'true', expanded: 'false' }}
.dropdown-menu %span.sr-only= t('posts.dropdown')
- @site.templates.each do |template| .dropdown-menu
= link_to template.id.camelize, - @site.templates.each do |template|
new_site_post_path(@site, lang: @lang, template: template.id), = link_to template.id.humanize,
class: 'dropdown-item' new_site_post_path(@site, lang: @lang, template: template.id),
class: 'dropdown-item'
- @site.translations.each do |l| - @site.translations.each do |l|
= link_to t("i18n.#{l}"), site_posts_path(@site, category: @category, lang: l), = link_to t("i18n.#{l}"), site_posts_path(@site, category: @category, lang: l),
class: 'btn btn-info' class: 'btn btn-info'

View file

@ -171,6 +171,7 @@ en:
date: 'date' date: 'date'
order: 'Order' order: 'Order'
new: 'New post' new: 'New post'
new_with_template: 'New %{template}'
dropdown: 'Toggle dropdown' dropdown: 'Toggle dropdown'
categories: 'Everything' categories: 'Everything'
index: 'Posts' index: 'Posts'

View file

@ -178,6 +178,7 @@ es:
categories: 'Todos' categories: 'Todos'
dropdown: 'Desplegar el menú' dropdown: 'Desplegar el menú'
new: 'Empezar un artículo nuevo' new: 'Empezar un artículo nuevo'
new_with_template: 'Comenzar %{template}'
index: 'Artículos' index: 'Artículos'
edit: 'Editar' edit: 'Editar'
draft: en revisión draft: en revisión