que funcionen los botones de invitación
This commit is contained in:
parent
2f3dbc8494
commit
22f7db7cc0
2 changed files with 7 additions and 7 deletions
|
@ -12,13 +12,15 @@
|
||||||
- if @sites.empty?
|
- if @sites.empty?
|
||||||
:markdown
|
:markdown
|
||||||
#{t('.welcome')}
|
#{t('.welcome')}
|
||||||
|
|
||||||
%table.table.table-condensed
|
%table.table.table-condensed
|
||||||
%tbody
|
%tbody
|
||||||
- @sites.each do |site|
|
- @sites.each do |site|
|
||||||
|
- rol = current_usuarie.rol_for_site(site)
|
||||||
-#
|
-#
|
||||||
TODO: Solo les usuaries cachean porque tenemos que separar
|
TODO: Solo les usuaries cachean porque tenemos que separar
|
||||||
les botones por permisos.
|
les botones por permisos.
|
||||||
- cache_if site.usuarie?(current_usuarie), site do
|
- cache_if (rol.usuarie? && !rol.temporal), site do
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
%h2
|
%h2
|
||||||
|
@ -29,18 +31,16 @@
|
||||||
%p.lead= site.description
|
%p.lead= site.description
|
||||||
%br
|
%br
|
||||||
= link_to t('.visit'), site.url, class: 'btn'
|
= link_to t('.visit'), site.url, class: 'btn'
|
||||||
- if current_usuarie.rol_for_site(site).temporal
|
- if rol.temporal
|
||||||
= button_to t('sites.invitations.accept'),
|
= button_to t('sites.invitations.accept'),
|
||||||
site_usuaries_accept_invitation_path(site),
|
site_usuaries_accept_invitation_path(site),
|
||||||
data: { toggle: 'tooltip' },
|
|
||||||
title: t('help.sites.invitations.accept'),
|
|
||||||
method: :patch,
|
method: :patch,
|
||||||
|
title: t('help.sites.invitations.accept'),
|
||||||
class: 'btn'
|
class: 'btn'
|
||||||
= button_to t('sites.invitations.reject'),
|
= button_to t('sites.invitations.reject'),
|
||||||
site_usuaries_reject_invitation_path(site),
|
site_usuaries_reject_invitation_path(site),
|
||||||
data: { toggle: 'tooltip' },
|
|
||||||
title: t('help.sites.invitations.reject'),
|
|
||||||
method: :patch,
|
method: :patch,
|
||||||
|
title: t('help.sites.invitations.reject'),
|
||||||
class: 'btn'
|
class: 'btn'
|
||||||
- else
|
- else
|
||||||
- if policy(site).show?
|
- if policy(site).show?
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col
|
.col
|
||||||
= form_with url: site_usuaries_invite_path(@site) do |f|
|
= form_with url: site_usuaries_invite_path(@site), local: true do |f|
|
||||||
= f.hidden_field :invited_as, value: params[:invite_as].singularize
|
= f.hidden_field :invited_as, value: params[:invite_as].singularize
|
||||||
.form-group
|
.form-group
|
||||||
= f.label :invitaciones do
|
= f.label :invitaciones do
|
||||||
|
|
Loading…
Reference in a new issue