diff --git a/app/views/sites/index.haml b/app/views/sites/index.haml index 21cf716..07ea670 100644 --- a/app/views/sites/index.haml +++ b/app/views/sites/index.haml @@ -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? diff --git a/app/views/usuaries/invite.haml b/app/views/usuaries/invite.haml index 3243977..62552e7 100644 --- a/app/views/usuaries/invite.haml +++ b/app/views/usuaries/invite.haml @@ -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