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?
|
||||
:markdown
|
||||
#{t('.welcome')}
|
||||
|
||||
%table.table.table-condensed
|
||||
%tbody
|
||||
- @sites.each do |site|
|
||||
- rol = current_usuarie.rol_for_site(site)
|
||||
-#
|
||||
TODO: Solo les usuaries cachean porque tenemos que separar
|
||||
les botones por permisos.
|
||||
- cache_if site.usuarie?(current_usuarie), site do
|
||||
- cache_if (rol.usuarie? && !rol.temporal), site do
|
||||
%tr
|
||||
%td
|
||||
%h2
|
||||
|
@ -29,18 +31,16 @@
|
|||
%p.lead= site.description
|
||||
%br
|
||||
= 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'),
|
||||
site_usuaries_accept_invitation_path(site),
|
||||
data: { toggle: 'tooltip' },
|
||||
title: t('help.sites.invitations.accept'),
|
||||
method: :patch,
|
||||
title: t('help.sites.invitations.accept'),
|
||||
class: 'btn'
|
||||
= button_to t('sites.invitations.reject'),
|
||||
site_usuaries_reject_invitation_path(site),
|
||||
data: { toggle: 'tooltip' },
|
||||
title: t('help.sites.invitations.reject'),
|
||||
method: :patch,
|
||||
title: t('help.sites.invitations.reject'),
|
||||
class: 'btn'
|
||||
- else
|
||||
- if policy(site).show?
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
.row
|
||||
.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
|
||||
.form-group
|
||||
= f.label :invitaciones do
|
||||
|
|
Loading…
Reference in a new issue