mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 04:46:21 +00:00
Merge branch 'issue-15154' of 0xacab.org:sutty/sutty into production.panel.sutty.nl
This commit is contained in:
commit
66045beb1c
2 changed files with 29 additions and 29 deletions
|
@ -36,8 +36,7 @@ class SiteUsuariePolicy
|
|||
end
|
||||
|
||||
def accept_invitation?
|
||||
su = site_usuarie
|
||||
(usuarie? || invitade?) && su.usuarie.rol_for_site(su.site).temporal
|
||||
!!site_usuarie.usuarie.rol_for_site(site_usuarie.site)&.temporal
|
||||
end
|
||||
|
||||
def reject_invitation?
|
||||
|
|
|
@ -24,30 +24,31 @@
|
|||
= site.title
|
||||
%p.lead= site.description
|
||||
%br
|
||||
= link_to t('.visit'), site.url, class: 'btn btn-secondary'
|
||||
- if current_usuarie.rol_for_site(site).temporal?
|
||||
= render 'components/btn_base',
|
||||
text: t('sites.invitations.accept'),
|
||||
path: site_usuaries_accept_invitation_path(site),
|
||||
title: t('help.sites.invitations.accept'),
|
||||
class: 'btn-secondary'
|
||||
= render 'components/btn_base',
|
||||
text: t('sites.invitations.reject'),
|
||||
path: site_usuaries_reject_invitation_path(site),
|
||||
title: t('help.sites.invitations.reject'),
|
||||
class: 'btn-secondary'
|
||||
- else
|
||||
- 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')
|
||||
= render 'sites/build', site: site
|
||||
= render 'sites/moderation_queue', site: site
|
||||
- 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)
|
||||
.d-flex.flex-row
|
||||
= link_to t('.visit'), site.url, class: 'btn btn-secondary'
|
||||
- if current_usuarie.rol_for_site(site).temporal?
|
||||
= render 'components/btn_base',
|
||||
text: t('sites.invitations.accept'),
|
||||
path: site_usuaries_accept_invitation_path(site),
|
||||
title: t('help.sites.invitations.accept'),
|
||||
class: 'btn-secondary'
|
||||
= render 'components/btn_base',
|
||||
text: t('sites.invitations.reject'),
|
||||
path: site_usuaries_reject_invitation_path(site),
|
||||
title: t('help.sites.invitations.reject'),
|
||||
class: 'btn-secondary'
|
||||
- else
|
||||
- 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')
|
||||
= render 'sites/build', site: site
|
||||
= render 'sites/moderation_queue', site: site
|
||||
- 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)
|
||||
|
|
Loading…
Reference in a new issue