= render 'layouts/breadcrumb', crumbs: [t('sites.index.title')] .row .col %h1 = t('.title') - if policy(Site).new? = link_to t('sites.new.title'), new_site_path, class: 'btn' %table.table.table-striped.table-condensed %tbody - @sites.each do |site| %tr %td %h2 - if policy(site).show? = link_to site.name, site_path(site) - else = site.name - if site.invitade? current_usuarie %span.badge.badge-warning{ data: { toggle: 'tooltip' }, title: t('help.sites.invitade') } = t('.invitade') %br .btn-group{ role: 'group', 'aria-label': t('sites.actions') } - 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' = 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' - 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') - 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? = render 'layouts/btn_with_tooltip', tooltip: t('usuaries.index.help.self'), text: t('usuaries.index.title'), type: 'info', link: site_usuaries_path(site) - if policy(site).pull? && site.repository.needs_pull? = render 'layouts/btn_with_tooltip', tooltip: t('help.sites.pull'), text: t('.pull'), type: 'info', link: site_pull_path(site) - if policy(site).build? - if site.enqueued? = render 'layouts/btn_with_tooltip', tooltip: t('help.sites.enqueued'), text: t('.enqueued'), type: 'secondary', link: nil - else = form_tag site_enqueue_path(site), method: :post, class: 'form-inline' do = button_tag type: 'submit', class: 'btn no-border-radius', title: t('help.sites.enqueue'), data: { toggle: 'tooltip' } do = t('sites.enqueue')