mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 00:26:23 +00:00
Merge branch 'recuperar-partials' into panel.sutty.nl
This commit is contained in:
commit
55f06e97fd
1 changed files with 43 additions and 46 deletions
|
@ -14,50 +14,47 @@
|
||||||
%table.table.table-condensed
|
%table.table.table-condensed
|
||||||
%tbody
|
%tbody
|
||||||
- @sites.each do |site|
|
- @sites.each do |site|
|
||||||
- next unless site.jekyll
|
- begin
|
||||||
- rol = current_usuarie.rol_for_site(site)
|
- next unless site.jekyll
|
||||||
-#
|
- rol = current_usuarie.rol_for_site(site)
|
||||||
TODO: Solo les usuaries cachean porque tenemos que separar
|
-#
|
||||||
les botones por permisos.
|
TODO: Solo les usuaries cachean porque tenemos que separar
|
||||||
- cache_if (rol.usuarie? && !rol.temporal), [site, I18n.locale] do
|
les botones por permisos.
|
||||||
%tr
|
- cache_if (rol.usuarie? && !rol.temporal), [site, I18n.locale] do
|
||||||
%td
|
%tr
|
||||||
%h2
|
%td
|
||||||
- if policy(site).show?
|
%h2
|
||||||
= link_to site.title, site_posts_path(site, locale: site.default_locale)
|
- if policy(site).show?
|
||||||
|
= link_to site.title, site_posts_path(site, locale: site.default_locale)
|
||||||
|
- else
|
||||||
|
= site.title
|
||||||
|
%p.lead= site.description
|
||||||
|
%br
|
||||||
|
= link_to t('.visit'), site.url, class: 'btn'
|
||||||
|
- if rol.temporal
|
||||||
|
= button_to t('sites.invitations.accept'),
|
||||||
|
site_usuaries_accept_invitation_path(site),
|
||||||
|
method: :patch,
|
||||||
|
title: t('help.sites.invitations.accept'),
|
||||||
|
class: 'btn'
|
||||||
|
= button_to t('sites.invitations.reject'),
|
||||||
|
site_usuaries_reject_invitation_path(site),
|
||||||
|
method: :patch,
|
||||||
|
title: t('help.sites.invitations.reject'),
|
||||||
|
class: 'btn'
|
||||||
- else
|
- else
|
||||||
= site.title
|
- if policy(site).show?
|
||||||
%p.lead= site.description
|
= render 'layouts/btn_with_tooltip',
|
||||||
%br
|
tooltip: t('help.sites.edit_posts'),
|
||||||
= link_to t('.visit'), site.url, class: 'btn'
|
type: 'success',
|
||||||
- if rol.temporal
|
link: site_path(site),
|
||||||
= button_to t('sites.invitations.accept'),
|
text: t('sites.posts')
|
||||||
site_usuaries_accept_invitation_path(site),
|
- if policy(SiteUsuarie.new(site, current_usuarie)).index?
|
||||||
method: :patch,
|
= render 'layouts/btn_with_tooltip',
|
||||||
title: t('help.sites.invitations.accept'),
|
tooltip: t('usuaries.index.help.self'),
|
||||||
class: 'btn'
|
text: t('usuaries.index.title'),
|
||||||
= button_to t('sites.invitations.reject'),
|
type: 'info',
|
||||||
site_usuaries_reject_invitation_path(site),
|
link: site_usuaries_path(site)
|
||||||
method: :patch,
|
= render 'sites/build', site: site
|
||||||
title: t('help.sites.invitations.reject'),
|
- rescue ActionView::Template::Error => e
|
||||||
class: 'btn'
|
- ExceptionNotifier.notify_exception(e.cause, data: { site: @site.name, usuarie: current_usuarie.id })
|
||||||
- else
|
|
||||||
- if policy(site).show?
|
|
||||||
= render 'layouts/btn_with_tooltip',
|
|
||||||
tooltip: t('help.sites.edit_posts'),
|
|
||||||
type: 'success',
|
|
||||||
link: site_path(site),
|
|
||||||
text: t('sites.posts')
|
|
||||||
- if policy(SiteUsuarie.new(site, current_usuarie)).index?
|
|
||||||
= render 'layouts/btn_with_tooltip',
|
|
||||||
tooltip: t('usuaries.index.help.self'),
|
|
||||||
text: t('usuaries.index.title'),
|
|
||||||
type: 'info',
|
|
||||||
link: site_usuaries_path(site)
|
|
||||||
- if policy(site).pull? && site.repository.needs_pull?
|
|
||||||
= render 'layouts/btn_with_tooltip',
|
|
||||||
tooltip: t('help.sites.pull'),
|
|
||||||
text: t('.pull'),
|
|
||||||
type: 'info',
|
|
||||||
link: site_pull_path(site)
|
|
||||||
= render 'sites/build', site: site
|
|
||||||
|
|
Loading…
Reference in a new issue