app/assets/javascripts/views/permissions/index.tmpl.haml

Summary

Maintainability
Test Coverage
%div{:class => "ui-rights-management{{if $item.manageable == false}} unmanageable{{/if}}{{if public[0].view == true}} public-view{{/if}}{{if public[0].download == true}} public-download{{/if}}{{if public[0].edit == true}} public-edit{{/if}}"}

  / User permissions
  .ui-rights-management-users

    .ui-rights-body

      %table.ui-rights-group

        %thead
          %tr
            %td.ui-rights-user-title
              ${_jed('People')}
              %i.icon-privacy-private-alt
            %td.ui-rights-role-title  ${_jed('Permission')}
            %td.ui-rights-check-title ${_jed('Get metadata and previews')}
            %td.ui-rights-check-title ${_jed('Get full size')}
            %td.ui-rights-check-title ${_jed('Edit metadata and add to Set')}
            %td.ui-rights-check-title ${_jed('Edit permissions')}

        %tbody
          {{tmpl(users, {presets: presets, manageable: $item.manageable}) App.renderPath("permissions/line")}}

      {{if $item.manageable}}
      #addUser.ui-add-subject.ptx.row
        .col1of3
          %input.small.block{name: 'user', type: 'text', placeholder:  "${_jed('Name of the person')}"}
      {{/if}}

  / Groups permissions
  .ui-rights-management-groups

    .ui-rights-body

      %table.ui-rights-group

        %thead
          %tr
            %td.ui-rights-user-title
              ${_jed('Groups')}
              %i.icon-privacy-group-alt
            %td.ui-rights-role-title
            %td.ui-rights-check-title
            %td.ui-rights-check-title
            %td.ui-rights-check-title
            %td.ui-rights-check-title

        %tbody
          {{tmpl(groups, {presets: presets, manageable: $item.manageable}) App.renderPath("permissions/line")}}

      {{if $item.manageable}}
      #addGroup.ui-add-subject.ptx.row
        .col1of3
          %input.small.block{type: :text, placeholder: "${_jed('Name of the group')}", name: 'group'}
      {{/if}}


  / ApiApp permissions — hidden on show if no content; always visible on edit
  {{if ($item.manageable == true) || (applications && applications.length)}}
  .ui-rights-management-apiapps

    .ui-rights-body
      
      %table.ui-rights-group

        %thead
          %tr
            %td.ui-rights-user-title
              ${_jed('API-Applikationen')}
              %i.icon-api
            %td.ui-rights-role-title
            %td.ui-rights-check-title
            %td.ui-rights-check-title
            %td.ui-rights-check-title
            %td.ui-rights-check-title

        %tbody
          {{tmpl(applications, {presets: presets, manageable: $item.manageable}) App.renderPath("permissions/line")}}

      {{if $item.manageable}}
      #addApplication.ui-add-subject.ptx.row
        .col1of3
          %input.small.block{type: :text, placeholder: "${_jed('Name of the Application')}", name: 'group'}
      {{/if}}
  {{/if}}

  / Public permissions
  .ui-rights-management-public

    %table.ui-rights-group

      %thead
        %tr
          %td.ui-rights-user-title
            ${_jed('Public')}
            %i.icon-privacy-open
          %td.ui-rights-role-title
          %td.ui-rights-check-title
          %td.ui-rights-check-title
          %td.ui-rights-check-title
          %td.ui-rights-check-title

        %tbody
          {{tmpl(public, {public: true, presets: presets, manageable: $item.manageable}) App.renderPath("permissions/line")}}