af83/chouette-core

View on GitHub
app/views/workgroup_workbenches/show.html.slim

Summary

Maintainability
Test Coverage
- breadcrumb :workbench, @workbench
- page_header_content_for @workbench

.page_content
  .container-fluid
    .row
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        = simple_block_for @workbench, title: t('metadatas') do |d|
          = d.attribute :name
          = d.attribute :organisation, as: :association

      - if @workbench.invitation_code && WorkgroupWorkbenchPolicy.new(pundit_user, @workbench).show_invitation_code?
        .col-lg-6.col-md-6.col-sm-12.col-xs-12
          = simple_block_for @workbench, title: t('workbenches.show.sections.pending_invitation.title') do |d|
            = d.attribute :invitation_code
            p[style='font-style:italic;'] = t('workbenches.show.sections.pending_invitation.text')

    .row
      .col-lg-6.col-md-6.col-sm-12.col-xs-12
        .definition-list
          .dl-head
            = t("workgroup_workbenches.show.restrictions")
          .dl-checkboxes
            - if @workbench.restrictions.empty?
              = replacement_msg t("permissions.show.no_restrictions")
            - permissions_array_to_hash(@workbench.restrictions.sort).each do |feature, feature_restriction|
              .dl-checkboxes-groups
                .dl-cb-group-content
                  .feature-title
                    = t("permissions.features.#{feature}")
                  ul
                  - feature_restriction.each do |restriction|
                    li
                      = t("permissions.actions.#{restriction.split('.').last}")