superdesk/superdesk-client-core

View on GitHub
scripts/apps/users/views/settings-privileges.html

Summary

Maintainability
Test Coverage
<div class="sd-page__flex-helper">
    <div class="sd-page__header">
        <span class="sd-page__element-grow"></span>
        <button class="btn btn--primary" ng-click="saveAll(rolesForm)" ng-disabled="!rolesForm.$dirty" translate>Save</button>
    </div>

    <div class="sd-page__content privileges-settings">
        <form name="rolesForm">
            <table class="table table--fixed-header">
                <thead>
                    <tr>
                        <th class="name"></th>
                        <th ng-repeat="role in roles">
                            <input type="checkbox" ng-click="toggleAll(role, selectAll)" ng-true-value="1" ng-false-value="0" ng-model="selectAll">
                            {{ :: role.name | translate }}
                            <span class="label label--primary" ng-if="role.is_default" translate>default</span>
                        </th>
                        <th class="blank-field"></th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="p in privileges">
                        <td class="name">
                            <div>
                                <span>{{ :: p.label | translate }}</span>

                                <span
                                    ng-if="p.description"
                                    sd-tooltip="{{ :: p.description }}"
                                    flow="right"
                                    
                                    
                                >
                                    <span class="icon-info-sign"></span>
                                </span>
                            </div>
                        </td>
                        <td ng-repeat="role in roles">
                            <input type="checkbox" ng-true-value="1" ng-false-value="0" ng-model="role.privileges[p.name]">
                        </td>
                        <td class="blank-field"></td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>
</div>