doctype html

div.wrapper.roles(ng-controller="RolesController as ctrl",
                        ng-init="section='admin'", tg-roles)
    sidebar.menu-secondary.sidebar(tg-admin-navigation="roles")
        include ../includes/modules/admin-menu
    sidebar.menu-tertiary.sidebar
        include ../includes/modules/admin-submenu-roles

    section.main.admin-roles.admin-common
        .header-with-actions
            include ../includes/components/mainTitle
            .action-buttons(ng-if="!role.external_user")
                a.button-red.delete-role(href="", title="{{'COMMON.DELETE' | translate}}", ng-click="ctrl.delete()")
                    span(translate="COMMON.DELETE")


        div(ng-if="!role.external_user")
            div(tg-edit-role)
                .edit-role
                    input(type="text", value="{{ role.name }}")
                    a.save.icon.icon-floppy(href="", title="{{'COMMON.SAVE' | translate}}")

                p.total
                    span.role-name(title="{{'ADMIN.ROLES.COUNT_MEMBERS' | translate}}") {{ role.name }}
                    a.edit-value.icon.icon-edit

            div.any-computable-role(ng-hide="anyComputableRole", translate="ADMIN.ROLES.WARNING_NO_ROLE")

            div.general-category(translate="ADMIN.ROLES.HELP_ROLE_ENABLED")
                div.check
                    input(type="checkbox", ng-model="role.computable", ng-change="ctrl.setComputable()")
                    div
                    span.check-text.check-yes(translate="COMMON.YES")
                    span.check-text.check-no(translate="COMMON.NO")

        div(ng-if="role.external_user")
            p.total
                span.role-name {{ role.name }}

        div(tg-role-permissions, ng-model="role")
