2019-09-12 18:10:01 +00:00
|
|
|
%main.row
|
|
|
|
%aside.col-md-3
|
|
|
|
%h1= t('.title')
|
|
|
|
%p.lead= t('.help')
|
|
|
|
- if policy(Site).new?
|
|
|
|
= link_to t('sites.new.title'), new_site_path,
|
2024-01-12 17:11:29 +00:00
|
|
|
class: 'btn btn-secondary'
|
2018-02-26 19:59:55 +00:00
|
|
|
|
2019-09-12 18:10:01 +00:00
|
|
|
%section.col
|
2020-02-11 17:23:38 +00:00
|
|
|
- if @sites.empty?
|
|
|
|
:markdown
|
|
|
|
#{t('.welcome')}
|
2020-05-12 14:59:18 +00:00
|
|
|
|
2019-09-12 17:09:43 +00:00
|
|
|
%table.table.table-condensed
|
2018-02-05 17:27:12 +00:00
|
|
|
%tbody
|
|
|
|
- @sites.each do |site|
|
2022-12-30 13:55:10 +00:00
|
|
|
- next unless site.jekyll?
|
2020-05-12 14:59:18 +00:00
|
|
|
- rol = current_usuarie.rol_for_site(site)
|
2020-05-11 20:28:38 +00:00
|
|
|
-#
|
|
|
|
TODO: Solo les usuaries cachean porque tenemos que separar
|
|
|
|
les botones por permisos.
|
2021-05-10 17:27:47 +00:00
|
|
|
- cache_if (rol.usuarie? && !rol.temporal), [site, I18n.locale] do
|
2020-05-11 20:28:38 +00:00
|
|
|
%tr
|
|
|
|
%td
|
|
|
|
%h2
|
|
|
|
- if policy(site).show?
|
2021-05-10 17:49:18 +00:00
|
|
|
= link_to site.title, site_posts_path(site, locale: site.default_locale)
|
2020-05-11 20:28:38 +00:00
|
|
|
- else
|
|
|
|
= site.title
|
|
|
|
%p.lead= site.description
|
|
|
|
%br
|
2024-01-12 17:11:29 +00:00
|
|
|
= link_to t('.visit'), site.url, class: 'btn btn-secondary'
|
2020-05-12 14:59:18 +00:00
|
|
|
- if rol.temporal
|
2020-05-11 20:28:38 +00:00
|
|
|
= button_to t('sites.invitations.accept'),
|
|
|
|
site_usuaries_accept_invitation_path(site),
|
|
|
|
method: :patch,
|
2020-05-12 14:59:18 +00:00
|
|
|
title: t('help.sites.invitations.accept'),
|
2024-01-12 17:11:29 +00:00
|
|
|
class: 'btn btn-secondary'
|
2020-05-11 20:28:38 +00:00
|
|
|
= button_to t('sites.invitations.reject'),
|
|
|
|
site_usuaries_reject_invitation_path(site),
|
|
|
|
method: :patch,
|
2020-05-12 14:59:18 +00:00
|
|
|
title: t('help.sites.invitations.reject'),
|
2024-01-12 17:11:29 +00:00
|
|
|
class: 'btn btn-secondary'
|
2019-07-16 19:47:44 +00:00
|
|
|
- else
|
2020-05-11 20:28:38 +00:00
|
|
|
- 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)
|
|
|
|
= render 'sites/build', site: site
|