2018-02-05 17:27:12 +00:00
|
|
|
.row
|
|
|
|
.col
|
2019-07-16 19:47:44 +00:00
|
|
|
= render 'layouts/breadcrumb', crumbs: [t('sites.index')]
|
2018-02-05 17:27:12 +00:00
|
|
|
.row
|
|
|
|
.col
|
2019-07-12 23:40:44 +00:00
|
|
|
%h1
|
|
|
|
= t('sites.title')
|
|
|
|
- if policy(Site).new?
|
|
|
|
= link_to t('sites.new.title'), new_site_path,
|
|
|
|
class: 'btn btn-info'
|
2018-02-05 17:27:12 +00:00
|
|
|
|
2018-02-26 19:59:55 +00:00
|
|
|
= render 'layouts/help', help: t('help.sites.index')
|
|
|
|
|
2018-02-05 17:27:12 +00:00
|
|
|
%table.table.table-striped.table-condensed
|
|
|
|
%tbody
|
|
|
|
- @sites.each do |site|
|
|
|
|
%tr
|
2018-02-26 18:46:47 +00:00
|
|
|
%td
|
2019-07-04 00:47:59 +00:00
|
|
|
%h2
|
2019-07-10 19:58:06 +00:00
|
|
|
- if policy(site).show?
|
|
|
|
= link_to site.name, site_path(site)
|
2019-07-16 19:47:44 +00:00
|
|
|
- else
|
2019-07-10 19:58:06 +00:00
|
|
|
= site.name
|
2019-07-04 00:47:59 +00:00
|
|
|
- if site.invitade? current_usuarie
|
2019-07-16 19:47:44 +00:00
|
|
|
%span.badge.badge-warning{ data: { toggle: 'tooltip' },
|
|
|
|
title: t('help.sites.invitade') }
|
2019-07-04 00:47:59 +00:00
|
|
|
= t('.invitade')
|
2018-02-26 18:46:47 +00:00
|
|
|
%br
|
2019-07-16 19:47:44 +00:00
|
|
|
.btn-group{ role: 'group',
|
|
|
|
'aria-label': t('sites.actions') }
|
2019-07-08 17:55:19 +00:00
|
|
|
- if current_usuarie.rol_for_site(site).temporal
|
|
|
|
= button_to t('sites.invitations.accept'),
|
|
|
|
site_usuaries_accept_invitation_path(site),
|
|
|
|
data: { toggle: 'tooltip' },
|
|
|
|
title: t('help.sites.invitations.accept'),
|
|
|
|
method: :patch,
|
|
|
|
class: 'btn btn-success'
|
|
|
|
= button_to t('sites.invitations.reject'),
|
|
|
|
site_usuaries_reject_invitation_path(site),
|
|
|
|
data: { toggle: 'tooltip' },
|
|
|
|
title: t('help.sites.invitations.reject'),
|
|
|
|
method: :patch,
|
|
|
|
class: 'btn btn-info'
|
|
|
|
- else
|
|
|
|
- if policy(site).show?
|
2018-09-28 15:27:25 +00:00
|
|
|
= render 'layouts/btn_with_tooltip',
|
2019-07-08 17:55:19 +00:00
|
|
|
tooltip: t('help.sites.edit_posts'),
|
|
|
|
type: 'success',
|
|
|
|
link: site_path(site),
|
|
|
|
text: t('sites.posts')
|
|
|
|
- if policy(SiteTranslation.new(site)).edit?
|
|
|
|
= render 'layouts/btn_with_tooltip',
|
|
|
|
tooltip: t('help.sites.edit_translations'),
|
|
|
|
text: t('i18n.edit'),
|
|
|
|
type: 'info',
|
|
|
|
link: site_i18n_edit_path(site)
|
|
|
|
- if policy(SiteUsuarie.new(site, current_usuarie)).index?
|
2018-09-28 15:27:25 +00:00
|
|
|
= render 'layouts/btn_with_tooltip',
|
2019-07-08 17:55:19 +00:00
|
|
|
tooltip: t('usuaries.index.help.self'),
|
|
|
|
text: t('usuaries.index.title'),
|
|
|
|
type: 'info',
|
|
|
|
link: site_usuaries_path(site)
|
|
|
|
- if policy(site).build?
|
|
|
|
- if site.enqueued?
|
|
|
|
= render 'layouts/btn_with_tooltip',
|
|
|
|
tooltip: t('help.sites.enqueued'),
|
|
|
|
text: t('sites.enqueued'),
|
|
|
|
type: 'secondary',
|
|
|
|
link: nil
|
|
|
|
- else
|
2019-07-16 19:47:44 +00:00
|
|
|
= form_tag site_enqueue_path(site),
|
|
|
|
method: :post, class: 'form-inline' do
|
2019-07-08 17:55:19 +00:00
|
|
|
= button_tag type: 'submit',
|
|
|
|
class: 'btn btn-success',
|
|
|
|
title: t('help.sites.enqueue'),
|
|
|
|
data: { toggle: 'tooltip' } do
|
|
|
|
= fa_icon 'building'
|
|
|
|
= t('sites.enqueue')
|
|
|
|
|
2019-08-06 23:17:29 +00:00
|
|
|
- if policy(site).pull? && site.repository.needs_pull?
|
2019-07-16 19:47:44 +00:00
|
|
|
= render 'layouts/btn_with_tooltip',
|
|
|
|
tooltip: t('help.sites.pull'),
|
|
|
|
text: t('.pull'),
|
|
|
|
type: 'info',
|
|
|
|
link: site_pull_path(site)
|