From bfe82f1cd2c13375222d790bdb45dd0be2b038b3 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Mon, 25 May 2020 16:32:30 +0400 Subject: [PATCH] PHRAS-3084 --- resources/www/admin/styles/main.scss | 31 ++++- .../images/icons/check-square-regular.svg | 1 + .../common/images/icons/square-duotone.svg | 1 + .../common/images/icons/square-regular.svg | 1 + templates/web/admin/editusers.html.twig | 128 +++++++----------- templates/web/admin/index.html.twig | 2 + 6 files changed, 85 insertions(+), 79 deletions(-) create mode 100644 resources/www/common/images/icons/check-square-regular.svg create mode 100644 resources/www/common/images/icons/square-duotone.svg create mode 100644 resources/www/common/images/icons/square-regular.svg diff --git a/resources/www/admin/styles/main.scss b/resources/www/admin/styles/main.scss index cff7851f82..ecef9a195c 100644 --- a/resources/www/admin/styles/main.scss +++ b/resources/www/admin/styles/main.scss @@ -189,6 +189,31 @@ $mainMenuLinkBackgroundHoverColor: transparent; color: #ffffff; } +.select-all-line { + color: #afafaf; + cursor: pointer; +} +.users_check_line_wrap { + position: absolute; + div { + padding: 5px 10px; + background-color: #cccccc; + color: #000000; + cursor: pointer; + + &:hover { + padding: 5px 10px; + background-color: #4d4d4d; + color: #ffffff; + } + } +} + +.fa-right { + color: #2475b5; + font-size: 16px; +} + /******* EDIT USERS ***********************************************************/ div.no_switch { width: 12px; @@ -211,7 +236,7 @@ div.switch_quota.mixed, div.switch_masks.mixed, div.switch_time.mixed, div.switch_right.mixed { - background-image: url('#{$iconsPath}ccoch2.gif'); + background-image: url('#{$iconsPath}square-duotone.svg'); background-repeat: no-repeat; background-position: center center; } @@ -219,7 +244,7 @@ div.switch_quota.checked, div.switch_masks.checked, div.switch_time.checked, div.switch_right.checked { - background-image: url('#{$iconsPath}ccoch1.gif'); + background-image: url('#{$iconsPath}check-square-regular.svg'); background-repeat: no-repeat; background-position: center center; } @@ -227,7 +252,7 @@ div.switch_quota.unchecked, div.switch_masks.unchecked, div.switch_time.unchecked, div.switch_right.unchecked { - background-image: url('#{$iconsPath}ccoch0.gif'); + background-image: url('#{$iconsPath}square-regular.svg'); background-repeat: no-repeat; background-position: center center; } diff --git a/resources/www/common/images/icons/check-square-regular.svg b/resources/www/common/images/icons/check-square-regular.svg new file mode 100644 index 0000000000..c7699d239b --- /dev/null +++ b/resources/www/common/images/icons/check-square-regular.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/www/common/images/icons/square-duotone.svg b/resources/www/common/images/icons/square-duotone.svg new file mode 100644 index 0000000000..14a344c780 --- /dev/null +++ b/resources/www/common/images/icons/square-duotone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/www/common/images/icons/square-regular.svg b/resources/www/common/images/icons/square-regular.svg new file mode 100644 index 0000000000..4e73fc5fad --- /dev/null +++ b/resources/www/common/images/icons/square-regular.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/templates/web/admin/editusers.html.twig b/templates/web/admin/editusers.html.twig index 39e9b5a3bf..3dbaa77612 100644 --- a/templates/web/admin/editusers.html.twig +++ b/templates/web/admin/editusers.html.twig @@ -61,24 +61,6 @@ div.no_switch{ background-image:url(/assets/common/images/icons/ccoch5.gif); } - div.switch_quota.mixed, - div.switch_masks.mixed, - div.switch_time.mixed, - div.switch_right.mixed{ - background-image:url(/assets/common/images/icons/ccoch2.gif); - } - div.switch_quota.checked, - div.switch_masks.checked, - div.switch_time.checked, - div.switch_right.checked{ - background-image:url(/assets/common/images/icons/ccoch1.gif); - } - div.switch_quota.unchecked, - div.switch_masks.unchecked, - div.switch_time.unchecked, - div.switch_right.unchecked{ - background-image:url(/assets/common/images/icons/ccoch0.gif); - } td.users_col{ vertical-align:middle; text-align:center; @@ -188,49 +170,49 @@
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
@@ -252,70 +234,70 @@
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
- ▼ +
@@ -333,35 +315,32 @@ {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::BAS_MODIFY_STRUCT'), users, 'sbas')}} - - {{ 'admin::users:edit:select all having rights' | trans }} - {% endif %} - + {{rights['base_id']|bas_labels(app)}} - + {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::ACCESS'), users, 'base')}} - + {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::ACTIF'), users, 'base')}} - + {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANPUTINALBUM'), users, 'base')}} - + {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANDWNLDPREVIEW'), users, 'base')}} - + {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::NOWATERMARK'), users, 'base')}} - + {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANDWNLDHD'), users, 'base')}} - + {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::CANCMD'), users, 'base')}} @@ -427,13 +406,15 @@ {{_self.format_checkbox(app.getAuthenticatedUser(), rights, constant('\\ACL::COLL_MODIFY_STRUCT'), users, 'base')}} - - - {{ 'admin::users:edit:select all ' | trans }} - - - {{ 'admin::users:edit:unselect all ' | trans }} - + + +
+ +
+
+
{{'admin::users:edit: check read right' | trans }}
+
{{'admin::users:edit: check all right' | trans }}
+
{% endfor %} @@ -1109,35 +1090,30 @@ } }); - $('.select-all-bdd-right').click(function () { - $('.main-right-item > div').removeClass('unchecked').addClass('checked'); - $('.main-right-item > div > input').val(1); + + $('body').click(function() { + $('.users_check_line_wrap').addClass('hide'); + }); + $('.select-all-line-btn').click(function (event) { + event.stopPropagation(); + var top = $(this).offset().top - 50; + var left = $(this).offset().left + 60; + $('.users_check_line_wrap').addClass('hide'); + $(this).closest('.select-all-line').find('.users_check_line_wrap').removeClass('hide').css('top', +top+'px'); + + }); + $('.check_left_right').click(function () { + $(this).closest('.right-items').find('.left-right div').show().removeClass('unchecked').addClass('checked'); + $(this).closest('.right-items').find('.left-right input').val(1); + $('.users_check_line_wrap').addClass('hide'); }); - $('.select-all-bdd').click(function () { + $('.check-all_right').click(function () { $(this).closest('.right-items').find('div').show().removeClass('unchecked').addClass('checked'); $(this).closest('.right-items').find('input').val(1); - $(this).closest('.right-items').find('.unselect-all-bdd').removeClass('hide'); - $(this).addClass('hide'); - }); - $('.unselect-all-bdd').click(function () { - $(this).closest('.right-items').find('div').hide().addClass('unchecked').remove('checked'); - $(this).closest('.right-items').find('.case_right_access div').show(); - $(this).closest('.right-items').find('input').val(0); - $(this).closest('.right-items').find('.select-all-bdd').removeClass('hide'); - $(this).addClass('hide'); + $('.users_check_line_wrap').addClass('hide'); }); - function countCheckedRight() { - $(".right-items" ).each(function() { - let count_checked = $( this ).find('input.checked').length; - if ( count_checked == 17) { - $(this).find('.select-all-bdd').addClass('hide'); - $(this).find('.unselect-all-bdd').removeClass('hide'); - } - }); - }; - countCheckedRight(); }); require([ diff --git a/templates/web/admin/index.html.twig b/templates/web/admin/index.html.twig index d0cbbbfc86..c9e1f3e195 100644 --- a/templates/web/admin/index.html.twig +++ b/templates/web/admin/index.html.twig @@ -42,6 +42,8 @@ serverDisconnected: '{{ 'phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier' | trans | e('js') }}', check_all : '{{ 'Cocher toute la colonne' | trans | e('js') }}', uncheck_all : '{{ 'Decocher toute la colonne' | trans | e('js') }}', + check_left_right : '{{ 'admin::users:edit: check left right' | trans | e('js') }}', + check_all_right : '{{ 'admin::users:edit: check all right' | trans | e('js') }}', create_template : '{{ 'Creer un model' | trans | e('js') }}', create_user : '{{ 'Creer un utilisateur' | trans | e('js') }}', annuler : '{{ 'boutton::annuler' | trans | e('js') }}',