2019-09-04 16:50:27 +00:00
|
|
|
= render 'layouts/breadcrumb',
|
2019-09-12 16:55:20 +00:00
|
|
|
crumbs: [link_to(t('sites.index.title'), sites_path),
|
2019-09-04 16:50:27 +00:00
|
|
|
@site.name,
|
|
|
|
link_to(t('posts.index'),
|
|
|
|
site_usuaries_path(@site))]
|
|
|
|
|
2019-07-04 16:23:43 +00:00
|
|
|
.row
|
|
|
|
.col
|
|
|
|
%h1= t('.title')
|
|
|
|
|
|
|
|
.row
|
|
|
|
.col
|
|
|
|
-# Una tabla de usuaries y otra de invitades, con acciones
|
|
|
|
- %i[usuaries invitades].each do |u|
|
2019-07-05 23:55:59 +00:00
|
|
|
%h2
|
2019-09-12 16:55:20 +00:00
|
|
|
= t(".#{u}")
|
|
|
|
.btn-group{ role: 'group', 'aria-label': t('.actions') }
|
2019-07-05 23:55:59 +00:00
|
|
|
- if @policy.invite?
|
2019-07-10 23:07:17 +00:00
|
|
|
= link_to t('.invite'),
|
2019-07-05 23:55:59 +00:00
|
|
|
site_usuaries_invite_path(@site, invite_as: u.to_s),
|
2019-09-12 16:55:20 +00:00
|
|
|
class: 'btn',
|
2019-07-05 23:55:59 +00:00
|
|
|
data: { toggle: 'tooltip' },
|
|
|
|
title: t('.help.invite', invite_as: u.to_s)
|
2019-07-10 23:07:17 +00:00
|
|
|
- if policy(Collaboration.new(@site)).collaborate?
|
|
|
|
= link_to t('.public_invite'),
|
|
|
|
site_collaborate_path(@site),
|
2019-09-12 16:55:20 +00:00
|
|
|
class: 'btn',
|
2019-07-10 23:07:17 +00:00
|
|
|
data: { toggle: 'tooltip' },
|
|
|
|
title: t('.help.public_invite')
|
2019-09-12 16:55:20 +00:00
|
|
|
%p= t(".help.#{u}")
|
2019-07-04 16:23:43 +00:00
|
|
|
%table.table.table-striped.table-condensed
|
|
|
|
%tbody
|
|
|
|
- @site.send(u).each do |cuenta|
|
2019-07-08 21:23:43 +00:00
|
|
|
- rol = cuenta.rol_for_site(@site)
|
2019-07-04 16:23:43 +00:00
|
|
|
%tr
|
|
|
|
-# TODO: avatares
|
|
|
|
%td= cuenta.email
|
2019-07-08 21:23:43 +00:00
|
|
|
%td
|
|
|
|
%time{ datetime: rol.created_at }
|
|
|
|
= time_ago_in_words rol.created_at
|
|
|
|
%td
|
|
|
|
- if rol.temporal
|
|
|
|
%span.badge.badge-info= t('.invited')
|
2019-07-04 16:23:43 +00:00
|
|
|
%td
|
2019-09-12 16:55:20 +00:00
|
|
|
.btn-group{ role: 'group',
|
|
|
|
aria: { label: t('.individual_actions') } }
|
2019-07-04 16:23:43 +00:00
|
|
|
- if @policy.demote? && @site.usuarie?(cuenta)
|
|
|
|
= link_to t('.demote.text'),
|
|
|
|
site_usuarie_demote_path(@site, cuenta),
|
2019-09-12 16:55:20 +00:00
|
|
|
class: 'btn',
|
2019-07-04 16:23:43 +00:00
|
|
|
data: { toggle: 'tooltip',
|
2019-09-12 16:55:20 +00:00
|
|
|
confirm: t('.demote.confirm') },
|
2019-07-04 16:23:43 +00:00
|
|
|
title: t('.help.demote'),
|
|
|
|
method: :patch
|
|
|
|
- if @policy.promote? && @site.invitade?(cuenta)
|
|
|
|
= link_to t('.promote.text'),
|
|
|
|
site_usuarie_promote_path(@site, cuenta),
|
2019-09-12 16:55:20 +00:00
|
|
|
class: 'btn',
|
2019-07-04 16:23:43 +00:00
|
|
|
data: { toggle: 'tooltip',
|
2019-09-12 16:55:20 +00:00
|
|
|
confirm: t('.promote.confirm') },
|
2019-07-04 16:23:43 +00:00
|
|
|
title: t('.help.promote'),
|
|
|
|
method: :patch
|
|
|
|
- if @policy.destroy?
|
|
|
|
= link_to t('.destroy.text'),
|
|
|
|
site_usuarie_path(@site, cuenta),
|
2019-09-12 16:55:20 +00:00
|
|
|
class: 'btn',
|
2019-07-04 16:23:43 +00:00
|
|
|
data: { toggle: 'tooltip',
|
2019-09-12 16:55:20 +00:00
|
|
|
confirm: t('.destroy.confirm') },
|
2019-07-04 16:23:43 +00:00
|
|
|
title: t('.help.destroy'),
|
|
|
|
method: :delete
|