From a5ac2c48d568309c5420c14715f9cde03ce46334 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Wed, 17 Feb 2016 12:09:23 +0100 Subject: [PATCH] - [x] [view/js/users][view/users][container.scss] Afficher l'indice du resultat pour recherche (pour suppr/modif) - [x] [view/js/machines][view/machines][container.scss] Afficher l'indice du resultat pour recherche (pour suppr/modif) --- css/container.css | 2 +- css/container.scss | 14 ++++++++ todo.md | 3 ++ view/js/machines.js | 80 +++++++++++++++++++++++++++++++++------------ view/js/users.js | 55 ++++++++++++++++++++++++------- view/machines.php | 8 +++-- view/users.php | 11 +++++-- 7 files changed, 135 insertions(+), 38 deletions(-) diff --git a/css/container.css b/css/container.css index e4c6403..50ff5aa 100755 --- a/css/container.css +++ b/css/container.css @@ -1,2 +1,2 @@ -#WRAPPER>#CONTAINER>section{display:none;flex-grow:1}#WRAPPER>#CONTAINER>section.active{display:block}#WRAPPER>#CONTAINER>section.active.list{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:wrap}#WRAPPER>#CONTAINER>section.active.list .inline-box{flex:0 0 1}#WRAPPER>#CONTAINER>section.active.list .searchbar{display:inline-block;position:relative;flex:calc( 100% - 2*1em - 2*1em );height:1em;margin:1em;padding:.5em 1em;padding-left:2em;border-radius:3px;border:1px solid #b1b1b1;background:#fff url("/f/svg/search/st/sub-menu-side/b1b1b1") 0.5em center no-repeat;background-size:1em;transition:border .4s ease-in-out}#WRAPPER>#CONTAINER>section.active.list .searchbar:hover,#WRAPPER>#CONTAINER>section.active.list .searchbar:focus{border-color:#5630ed}#WRAPPER>#CONTAINER>section.active.list .error{display:inline-block;position:relative;width:calc( 100% - 2*1em - 2*1em );height:1em;margin:1em;padding:1em;border-radius:3px;border:1px solid #d52918;background:#d52918;color:#fff;text-shadow:1px 1px #a82013}#WRAPPER>#CONTAINER>section>.inline-box{display:inline-block;position:relative;flex:calc( 50% - 2*1em - 2*1em );margin:1em;padding:1em;border-radius:3px;box-shadow:0 0 1px #b7b7b7;background-color:#fff}#WRAPPER>#CONTAINER>section>.inline-box.hidden{display:none}#WRAPPER>#CONTAINER>section>.inline-box a{text-decoration:none;color:inherit}#WRAPPER>#CONTAINER>section>.inline-box .title{display:inline-block;font-size:1.15em;font-weight:bold;color:#bf2515;white-space:nowrap}#WRAPPER>#CONTAINER>section>.inline-box .title>span{font-size:.8em;color:#333}#WRAPPER>#CONTAINER>section>.inline-box .code,#WRAPPER>#CONTAINER>section>.inline-box .mail{display:block;margin:1em;color:#333;white-space:nowrap}#WRAPPER>#CONTAINER>section>.inline-box .code svg,#WRAPPER>#CONTAINER>section>.inline-box .mail svg{display:inline-block;position:relative;margin-left:.5em;margin-right:.5em;margin-bottom:-.6em;width:1.5em;height:2em;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .code svg path,#WRAPPER>#CONTAINER>section>.inline-box .mail svg path{fill:#333 !important;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .groups{display:block;margin:1em;color:#333;white-space:nowrap}#WRAPPER>#CONTAINER>section>.inline-box .groups svg{display:inline-block;position:relative;margin-left:.5em;margin-right:.5em;margin-bottom:-.6em;width:1.5em;height:2em;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .groups svg path{fill:#333 !important;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .groups span{display:inline-block;padding:.1em .5em;margin-right:.2em;border-radius:3px;border:1px solid #bdbdbd;box-shadow:inset 0 0 2px #fafafa;background-color:#f9f9f9;color:#333;cursor:default}#WRAPPER>#CONTAINER>section>.inline-box .link_edit,#WRAPPER>#CONTAINER>section>.inline-box .link_remove{display:inline-block;position:relative;width:1em;height:1em;margin-left:1em;cursor:pointer}#WRAPPER>#CONTAINER>section>.inline-box .link_edit>svg,#WRAPPER>#CONTAINER>section>.inline-box .link_remove>svg{width:100%;height:100%;fill:#ddd !important;transition:fill .4s ease-in-out;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .link_edit:hover>svg,#WRAPPER>#CONTAINER>section>.inline-box .link_remove:hover>svg{fill:#2193e6 !important}#WRAPPER>#CONTAINER>section>.inline-box .link_remove:hover>svg{fill:#d52918 !important}#WRAPPER>#CONTAINER>section>form{display:inline-block;position:relative;left:50%;margin:.3em 0;padding:1em;border-radius:3px;border-color:#d52918;box-shadow:0 0 1px #b7b7b7;background-color:#fff;transform:translateX(-50%)}#WRAPPER>#CONTAINER>section>form.valid{border-color:#27a560}#WRAPPER>#CONTAINER>section>form.neutral{border-color:#2193e6}#WRAPPER>#CONTAINER>section>form.search{border-color:#2193e6}#WRAPPER>#CONTAINER>section>form input[type=text],#WRAPPER>#CONTAINER>section>form input[type=mail],#WRAPPER>#CONTAINER>section>form input[type=password],#WRAPPER>#CONTAINER>section>form.invalid>input[type=text],#WRAPPER>#CONTAINER>section>form.invalid>input[type=mail],#WRAPPER>#CONTAINER>section>form.invalid>input[type=password],#WRAPPER>#CONTAINER>section>form input.invalid[type=text],#WRAPPER>#CONTAINER>section>form input.invalid[type=mail],#WRAPPER>#CONTAINER>section>form input.invalid[type=password]{display:inline-block;margin:1em 0;padding:.7em 1em;border-radius:3px;border:1px solid #d7dde8;color:#2f3033;transition:border .4s ease-in-out}#WRAPPER>#CONTAINER>section>form input[type=text]:focus,#WRAPPER>#CONTAINER>section>form input[type=text]:hover,#WRAPPER>#CONTAINER>section>form input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input[type=password]:focus,#WRAPPER>#CONTAINER>section>form input[type=password]:hover,#WRAPPER>#CONTAINER>section>form.invalid>input[type=text]:focus,#WRAPPER>#CONTAINER>section>form.invalid>input[type=text]:hover,#WRAPPER>#CONTAINER>section>form.invalid>input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form.invalid>input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form.invalid>input[type=password]:focus,#WRAPPER>#CONTAINER>section>form.invalid>input[type=password]:hover,#WRAPPER>#CONTAINER>section>form input.invalid[type=text]:focus,#WRAPPER>#CONTAINER>section>form input.invalid[type=text]:hover,#WRAPPER>#CONTAINER>section>form input.invalid[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input.invalid[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input.invalid[type=password]:focus,#WRAPPER>#CONTAINER>section>form input.invalid[type=password]:hover{border-color:#d52918}#WRAPPER>#CONTAINER>section>form.valid>input[type=text]:focus,#WRAPPER>#CONTAINER>section>form.valid>input[type=text]:hover,#WRAPPER>#CONTAINER>section>form.valid>input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form.valid>input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form.valid>input[type=password]:focus,#WRAPPER>#CONTAINER>section>form.valid>input[type=password]:hover,#WRAPPER>#CONTAINER>section>form input.valid[type=text]:focus,#WRAPPER>#CONTAINER>section>form input.valid[type=text]:hover,#WRAPPER>#CONTAINER>section>form input.valid[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input.valid[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input.valid[type=password]:focus,#WRAPPER>#CONTAINER>section>form input.valid[type=password]:hover{border-color:#27a560}#WRAPPER>#CONTAINER>section>form.neutral>input[type=text]:focus,#WRAPPER>#CONTAINER>section>form.neutral>input[type=text]:hover,#WRAPPER>#CONTAINER>section>form.neutral>input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form.neutral>input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form.neutral>input[type=password]:focus,#WRAPPER>#CONTAINER>section>form.neutral>input[type=password]:hover,#WRAPPER>#CONTAINER>section>form input.neutral[type=text]:focus,#WRAPPER>#CONTAINER>section>form input.neutral[type=text]:hover,#WRAPPER>#CONTAINER>section>form input.neutral[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input.neutral[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input.neutral[type=password]:focus,#WRAPPER>#CONTAINER>section>form input.neutral[type=password]:hover{border-color:#2193e6}#WRAPPER>#CONTAINER>section>form.search>input[type=text]:focus,#WRAPPER>#CONTAINER>section>form.search>input[type=text]:hover,#WRAPPER>#CONTAINER>section>form.search>input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form.search>input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form.search>input[type=password]:focus,#WRAPPER>#CONTAINER>section>form.search>input[type=password]:hover,#WRAPPER>#CONTAINER>section>form input.search[type=text]:focus,#WRAPPER>#CONTAINER>section>form input.search[type=text]:hover,#WRAPPER>#CONTAINER>section>form input.search[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input.search[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input.search[type=password]:focus,#WRAPPER>#CONTAINER>section>form input.search[type=password]:hover{border-color:#5630ed}#WRAPPER>#CONTAINER>section>form button,#WRAPPER>#CONTAINER>section>form button.invalid,#WRAPPER>#CONTAINER>section>form.invalid>button{display:inline-block;position:relative;left:50%;padding:.7em 1em;border-radius:3px;border:1px solid #d52918;background-color:#d52918;color:#fff;transition:background .4s ease-in-out;transform:translateX(-50%)}#WRAPPER>#CONTAINER>section>form button:hover,#WRAPPER>#CONTAINER>section>form button:focus,#WRAPPER>#CONTAINER>section>form button:disabled,#WRAPPER>#CONTAINER>section>form button.invalid:hover,#WRAPPER>#CONTAINER>section>form button.invalid:focus,#WRAPPER>#CONTAINER>section>form button.invalid:disabled,#WRAPPER>#CONTAINER>section>form.invalid>button:hover,#WRAPPER>#CONTAINER>section>form.invalid>button:focus,#WRAPPER>#CONTAINER>section>form.invalid>button:disabled{background-color:#fff;color:#d52918}#WRAPPER>#CONTAINER>section>form button.valid,#WRAPPER>#CONTAINER>section>form.valid>button{border-color:#27a560;background-color:#27a560}#WRAPPER>#CONTAINER>section>form button.valid:hover,#WRAPPER>#CONTAINER>section>form button.valid:focus,#WRAPPER>#CONTAINER>section>form button.valid:disabled,#WRAPPER>#CONTAINER>section>form.valid>button:hover,#WRAPPER>#CONTAINER>section>form.valid>button:focus,#WRAPPER>#CONTAINER>section>form.valid>button:disabled{background-color:#fff;color:#27a560}#WRAPPER>#CONTAINER>section>form button.neutral,#WRAPPER>#CONTAINER>section>form.neutral>button{border-color:#2193e6;background-color:#2193e6}#WRAPPER>#CONTAINER>section>form button.neutral:hover,#WRAPPER>#CONTAINER>section>form button.neutral:focus,#WRAPPER>#CONTAINER>section>form button.neutral:disabled,#WRAPPER>#CONTAINER>section>form.neutral>button:hover,#WRAPPER>#CONTAINER>section>form.neutral>button:focus,#WRAPPER>#CONTAINER>section>form.neutral>button:disabled{background-color:#fff;color:#2193e6}#WRAPPER>#CONTAINER>section>form button.search,#WRAPPER>#CONTAINER>section>form.search>button{border-color:#5630ed;background-color:#5630ed}#WRAPPER>#CONTAINER>section>form button.search:hover,#WRAPPER>#CONTAINER>section>form button.search:focus,#WRAPPER>#CONTAINER>section>form button.search:disabled,#WRAPPER>#CONTAINER>section>form.search>button:hover,#WRAPPER>#CONTAINER>section>form.search>button:focus,#WRAPPER>#CONTAINER>section>form.search>button:disabled{background-color:#fff;color:#5630ed}#WRAPPER>#CONTAINER>section>form hr.OR[data-label]{display:block;position:relative;width:100%;height:0;border:0;border-bottom:1px dashed #d52918}#WRAPPER>#CONTAINER>section>form hr.OR[data-label]:before{content:attr(data-label);display:inline-block;position:relative;top:50%;left:50%;padding:0 1em;background-color:#fff;color:#d52918;transform:translateX(-50%) translatey(-50%)}#WRAPPER>#CONTAINER>section>form .valid>hr.OR,#WRAPPER>#CONTAINER>section>form hr.OR.valid{border-bottom:1px dashed #27a560}#WRAPPER>#CONTAINER>section>form .valid>hr.OR:before,#WRAPPER>#CONTAINER>section>form hr.OR.valid:before{color:#27a560}#WRAPPER>#CONTAINER>section>form .neutral>hr.OR,#WRAPPER>#CONTAINER>section>form hr.OR.neutral{border-bottom:1px dashed #2193e6}#WRAPPER>#CONTAINER>section>form .neutral>hr.OR:before,#WRAPPER>#CONTAINER>section>form hr.OR.neutral:before{color:#2193e6}#WRAPPER>#CONTAINER>section>form .search>hr.OR,#WRAPPER>#CONTAINER>section>form hr.OR.search{border-bottom:1px dashed #5630ed}#WRAPPER>#CONTAINER>section>form .search>hr.OR:before,#WRAPPER>#CONTAINER>section>form hr.OR.search:before{color:#5630ed} +#WRAPPER>#CONTAINER>section{display:none;flex-grow:1}#WRAPPER>#CONTAINER>section.active{display:block}#WRAPPER>#CONTAINER>section.active.list{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:wrap}#WRAPPER>#CONTAINER>section.active.list .inline-box{flex:0 0 1}#WRAPPER>#CONTAINER>section.active.list .searchbar{display:inline-block;position:relative;flex:calc( 100% - 2*1em - 2*1em );height:1em;margin:1em;padding:.5em 1em;padding-left:2em;border-radius:3px;border:1px solid #b1b1b1;background:#fff url("/f/svg/search/st/sub-menu-side/b1b1b1") 0.5em center no-repeat;background-size:1em;transition:border .4s ease-in-out}#WRAPPER>#CONTAINER>section.active.list .searchbar:hover,#WRAPPER>#CONTAINER>section.active.list .searchbar:focus{border-color:#5630ed}#WRAPPER>#CONTAINER>section.active.list .error{display:inline-block;position:relative;width:calc( 100% - 2*1em - 2*1em );height:1em;margin:1em;padding:1em;border-radius:3px;border:1px solid #d52918;background:#d52918;color:#fff;text-shadow:1px 1px #a82013}#WRAPPER>#CONTAINER>section>.inline-box{display:inline-block;position:relative;flex:calc( 50% - 2*1em - 2*1em );margin:1em;padding:1em;border-radius:3px;box-shadow:0 0 1px #b7b7b7;background-color:#fff}#WRAPPER>#CONTAINER>section>.inline-box.hidden{display:none}#WRAPPER>#CONTAINER>section>.inline-box a{text-decoration:none;color:inherit}#WRAPPER>#CONTAINER>section>.inline-box .title{display:inline-block;font-size:1.15em;font-weight:bold;color:#bf2515;white-space:nowrap}#WRAPPER>#CONTAINER>section>.inline-box .title>span{font-size:.8em;color:#333}#WRAPPER>#CONTAINER>section>.inline-box .code,#WRAPPER>#CONTAINER>section>.inline-box .mail{display:block;margin:1em;color:#333;white-space:nowrap}#WRAPPER>#CONTAINER>section>.inline-box .code svg,#WRAPPER>#CONTAINER>section>.inline-box .mail svg{display:inline-block;position:relative;margin-left:.5em;margin-right:.5em;margin-bottom:-.6em;width:1.5em;height:2em;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .code svg path,#WRAPPER>#CONTAINER>section>.inline-box .mail svg path{fill:#333 !important;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .groups{display:block;margin:1em;color:#333;white-space:nowrap}#WRAPPER>#CONTAINER>section>.inline-box .groups svg{display:inline-block;position:relative;margin-left:.5em;margin-right:.5em;margin-bottom:-.6em;width:1.5em;height:2em;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .groups svg path{fill:#333 !important;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .groups span{display:inline-block;padding:.1em .5em;margin-right:.2em;border-radius:3px;border:1px solid #bdbdbd;box-shadow:inset 0 0 2px #fafafa;background-color:#f9f9f9;color:#333;cursor:default}#WRAPPER>#CONTAINER>section>.inline-box .link_edit,#WRAPPER>#CONTAINER>section>.inline-box .link_remove{display:inline-block;position:relative;width:1em;height:1em;margin-left:1em;cursor:pointer}#WRAPPER>#CONTAINER>section>.inline-box .link_edit>svg,#WRAPPER>#CONTAINER>section>.inline-box .link_remove>svg{width:100%;height:100%;fill:#ddd !important;transition:fill .4s ease-in-out;pointer-events:none}#WRAPPER>#CONTAINER>section>.inline-box .link_edit:hover>svg,#WRAPPER>#CONTAINER>section>.inline-box .link_remove:hover>svg{fill:#2193e6 !important}#WRAPPER>#CONTAINER>section>.inline-box .link_remove:hover>svg{fill:#d52918 !important}#WRAPPER>#CONTAINER>section>form{display:inline-block;position:relative;left:50%;margin:.3em 0;padding:1em;border-radius:3px;border-color:#d52918;box-shadow:0 0 1px #b7b7b7;background-color:#fff;transform:translateX(-50%)}#WRAPPER>#CONTAINER>section>form.valid{border-color:#27a560}#WRAPPER>#CONTAINER>section>form.neutral{border-color:#2193e6}#WRAPPER>#CONTAINER>section>form.search{border-color:#2193e6}#WRAPPER>#CONTAINER>section>form .edit_search_view,#WRAPPER>#CONTAINER>section>form .remove_search_view{display:inline-block;width:100%;text-align:center;color:#aaaaaa}#WRAPPER>#CONTAINER>section>form .edit_search_view span,#WRAPPER>#CONTAINER>section>form .remove_search_view span{color:#888888}#WRAPPER>#CONTAINER>section>form input[type=text],#WRAPPER>#CONTAINER>section>form input[type=mail],#WRAPPER>#CONTAINER>section>form input[type=password],#WRAPPER>#CONTAINER>section>form.invalid>input[type=text],#WRAPPER>#CONTAINER>section>form.invalid>input[type=mail],#WRAPPER>#CONTAINER>section>form.invalid>input[type=password],#WRAPPER>#CONTAINER>section>form input.invalid[type=text],#WRAPPER>#CONTAINER>section>form input.invalid[type=mail],#WRAPPER>#CONTAINER>section>form input.invalid[type=password]{display:inline-block;margin:1em 0;padding:.7em 1em;border-radius:3px;border:1px solid #d7dde8;color:#2f3033;transition:border .4s ease-in-out}#WRAPPER>#CONTAINER>section>form input[type=text]:focus,#WRAPPER>#CONTAINER>section>form input[type=text]:hover,#WRAPPER>#CONTAINER>section>form input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input[type=password]:focus,#WRAPPER>#CONTAINER>section>form input[type=password]:hover,#WRAPPER>#CONTAINER>section>form.invalid>input[type=text]:focus,#WRAPPER>#CONTAINER>section>form.invalid>input[type=text]:hover,#WRAPPER>#CONTAINER>section>form.invalid>input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form.invalid>input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form.invalid>input[type=password]:focus,#WRAPPER>#CONTAINER>section>form.invalid>input[type=password]:hover,#WRAPPER>#CONTAINER>section>form input.invalid[type=text]:focus,#WRAPPER>#CONTAINER>section>form input.invalid[type=text]:hover,#WRAPPER>#CONTAINER>section>form input.invalid[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input.invalid[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input.invalid[type=password]:focus,#WRAPPER>#CONTAINER>section>form input.invalid[type=password]:hover{border-color:#d52918}#WRAPPER>#CONTAINER>section>form.valid>input[type=text]:focus,#WRAPPER>#CONTAINER>section>form.valid>input[type=text]:hover,#WRAPPER>#CONTAINER>section>form.valid>input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form.valid>input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form.valid>input[type=password]:focus,#WRAPPER>#CONTAINER>section>form.valid>input[type=password]:hover,#WRAPPER>#CONTAINER>section>form input.valid[type=text]:focus,#WRAPPER>#CONTAINER>section>form input.valid[type=text]:hover,#WRAPPER>#CONTAINER>section>form input.valid[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input.valid[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input.valid[type=password]:focus,#WRAPPER>#CONTAINER>section>form input.valid[type=password]:hover{border-color:#27a560}#WRAPPER>#CONTAINER>section>form.neutral>input[type=text]:focus,#WRAPPER>#CONTAINER>section>form.neutral>input[type=text]:hover,#WRAPPER>#CONTAINER>section>form.neutral>input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form.neutral>input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form.neutral>input[type=password]:focus,#WRAPPER>#CONTAINER>section>form.neutral>input[type=password]:hover,#WRAPPER>#CONTAINER>section>form input.neutral[type=text]:focus,#WRAPPER>#CONTAINER>section>form input.neutral[type=text]:hover,#WRAPPER>#CONTAINER>section>form input.neutral[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input.neutral[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input.neutral[type=password]:focus,#WRAPPER>#CONTAINER>section>form input.neutral[type=password]:hover{border-color:#2193e6}#WRAPPER>#CONTAINER>section>form.search>input[type=text]:focus,#WRAPPER>#CONTAINER>section>form.search>input[type=text]:hover,#WRAPPER>#CONTAINER>section>form.search>input[type=mail]:focus,#WRAPPER>#CONTAINER>section>form.search>input[type=mail]:hover,#WRAPPER>#CONTAINER>section>form.search>input[type=password]:focus,#WRAPPER>#CONTAINER>section>form.search>input[type=password]:hover,#WRAPPER>#CONTAINER>section>form input.search[type=text]:focus,#WRAPPER>#CONTAINER>section>form input.search[type=text]:hover,#WRAPPER>#CONTAINER>section>form input.search[type=mail]:focus,#WRAPPER>#CONTAINER>section>form input.search[type=mail]:hover,#WRAPPER>#CONTAINER>section>form input.search[type=password]:focus,#WRAPPER>#CONTAINER>section>form input.search[type=password]:hover{border-color:#5630ed}#WRAPPER>#CONTAINER>section>form button,#WRAPPER>#CONTAINER>section>form button.invalid,#WRAPPER>#CONTAINER>section>form.invalid>button{display:inline-block;position:relative;left:50%;padding:.7em 1em;border-radius:3px;border:1px solid #d52918;background-color:#d52918;color:#fff;transition:background .4s ease-in-out;transform:translateX(-50%)}#WRAPPER>#CONTAINER>section>form button:hover,#WRAPPER>#CONTAINER>section>form button:focus,#WRAPPER>#CONTAINER>section>form button:disabled,#WRAPPER>#CONTAINER>section>form button.invalid:hover,#WRAPPER>#CONTAINER>section>form button.invalid:focus,#WRAPPER>#CONTAINER>section>form button.invalid:disabled,#WRAPPER>#CONTAINER>section>form.invalid>button:hover,#WRAPPER>#CONTAINER>section>form.invalid>button:focus,#WRAPPER>#CONTAINER>section>form.invalid>button:disabled{background-color:#fff;color:#d52918}#WRAPPER>#CONTAINER>section>form button.valid,#WRAPPER>#CONTAINER>section>form.valid>button{border-color:#27a560;background-color:#27a560}#WRAPPER>#CONTAINER>section>form button.valid:hover,#WRAPPER>#CONTAINER>section>form button.valid:focus,#WRAPPER>#CONTAINER>section>form button.valid:disabled,#WRAPPER>#CONTAINER>section>form.valid>button:hover,#WRAPPER>#CONTAINER>section>form.valid>button:focus,#WRAPPER>#CONTAINER>section>form.valid>button:disabled{background-color:#fff;color:#27a560}#WRAPPER>#CONTAINER>section>form button.neutral,#WRAPPER>#CONTAINER>section>form.neutral>button{border-color:#2193e6;background-color:#2193e6}#WRAPPER>#CONTAINER>section>form button.neutral:hover,#WRAPPER>#CONTAINER>section>form button.neutral:focus,#WRAPPER>#CONTAINER>section>form button.neutral:disabled,#WRAPPER>#CONTAINER>section>form.neutral>button:hover,#WRAPPER>#CONTAINER>section>form.neutral>button:focus,#WRAPPER>#CONTAINER>section>form.neutral>button:disabled{background-color:#fff;color:#2193e6}#WRAPPER>#CONTAINER>section>form button.search,#WRAPPER>#CONTAINER>section>form.search>button{border-color:#5630ed;background-color:#5630ed}#WRAPPER>#CONTAINER>section>form button.search:hover,#WRAPPER>#CONTAINER>section>form button.search:focus,#WRAPPER>#CONTAINER>section>form button.search:disabled,#WRAPPER>#CONTAINER>section>form.search>button:hover,#WRAPPER>#CONTAINER>section>form.search>button:focus,#WRAPPER>#CONTAINER>section>form.search>button:disabled{background-color:#fff;color:#5630ed}#WRAPPER>#CONTAINER>section>form hr.OR[data-label]{display:block;position:relative;width:100%;height:0;border:0;border-bottom:1px dashed #d52918}#WRAPPER>#CONTAINER>section>form hr.OR[data-label]:before{content:attr(data-label);display:inline-block;position:relative;top:50%;left:50%;padding:0 1em;background-color:#fff;color:#d52918;transform:translateX(-50%) translatey(-50%)}#WRAPPER>#CONTAINER>section>form .valid>hr.OR,#WRAPPER>#CONTAINER>section>form hr.OR.valid{border-bottom:1px dashed #27a560}#WRAPPER>#CONTAINER>section>form .valid>hr.OR:before,#WRAPPER>#CONTAINER>section>form hr.OR.valid:before{color:#27a560}#WRAPPER>#CONTAINER>section>form .neutral>hr.OR,#WRAPPER>#CONTAINER>section>form hr.OR.neutral{border-bottom:1px dashed #2193e6}#WRAPPER>#CONTAINER>section>form .neutral>hr.OR:before,#WRAPPER>#CONTAINER>section>form hr.OR.neutral:before{color:#2193e6}#WRAPPER>#CONTAINER>section>form .search>hr.OR,#WRAPPER>#CONTAINER>section>form hr.OR.search{border-bottom:1px dashed #5630ed}#WRAPPER>#CONTAINER>section>form .search>hr.OR:before,#WRAPPER>#CONTAINER>section>form hr.OR.search:before{color:#5630ed} /*# sourceMappingURL=container.css.map */ diff --git a/css/container.scss b/css/container.scss index 12fedb2..3e88452 100755 --- a/css/container.scss +++ b/css/container.scss @@ -261,6 +261,20 @@ border-color: $form-neutral-color; } + // Textes centres + .edit_search_view, + .remove_search_view{ + display: inline-block; + width: 100%; + + text-align: center; + color: #aaaaaa; + + span{ + color: #888888; + } + } + /* (1) Champs de texte */ input[type=text], diff --git a/todo.md b/todo.md index 031b0dd..317ca77 100755 --- a/todo.md +++ b/todo.md @@ -7,6 +7,7 @@ ############ # EN COURS # ############ + - [ ] [container.scss] Icone dans bouton quand succes sur l'operation - [ ] [view/users][view/js/users.js] Suppression avec recherche comme pour la modification @@ -16,6 +17,8 @@ ######## # FAIT # ######## +- [x] [view/js/users][view/users][container.scss] Afficher l'indice du resultat pour recherche (pour suppr/modif) +- [x] [view/js/machines][view/machines][container.scss] Afficher l'indice du resultat pour recherche (pour suppr/modif) - [x] [view/js/users] Implementer la recherche pour la suppression - [x] [view/js/machines] Implementer la recherche pour la suppression - [x] Nettoyage git diff --git a/view/js/machines.js b/view/js/machines.js index 15e6b8a..b937c95 100755 --- a/view/js/machines.js +++ b/view/js/machines.js @@ -177,6 +177,10 @@ if( section.remove.element != null ){ /* (1) Definition des champs */ section.remove.input = { search: { + view: document.querySelector(section.remove.text + '.remove_search_view'), + num: document.querySelector(section.remove.text + '.remove_search_num'), + sum: document.querySelector(section.remove.text + '.remove_search_sum'), + keyword: document.querySelector(section.remove.text + '#remove_search_keyword'), id: document.querySelector(section.remove.text + '#remove_search_id'), submit: document.querySelector(section.remove.text + '#remove_search_submit') @@ -188,6 +192,9 @@ if( section.remove.element != null ){ submit: document.querySelector(section.remove.text + '#remove_submit') }; + var lastsearch_remove = null; + var searchindex_remove = 0; + /* (2) Gestion de l'auto-remplissage par lien */ function autofill_remove(id_machine){ @@ -211,14 +218,15 @@ if( section.remove.element != null ){ // On gere le caractere "inactif" du submit section.remove.input.submit.disabled = machine_data.disable_input; + + // Muse a jour des indices des resultats + section.remove.input.search.num.innerHTML = searchindex_remove+1; }); }if( pageManager.vars.length >= 2 && !isNaN(pageManager.vars[1]) ) autofill_remove(pageManager.vars[1]); /* (3) Gestion de la recherche */ - var lastsearch_remove = null; - var searchindex_remove = 0; section.remove.input.search.submit.addEventListener('click', function(e){ // On annule l'envoi de base (PHP) e.preventDefault(); @@ -240,11 +248,17 @@ if( section.remove.element != null ){ lastsearch_remove = uidanswer.machines[searchindex_remove].id_machine; section.remove.input.search.id.value = lastsearch_remove; + + // Mise a jour des indices des resultats + section.remove.input.search.sum.innerHTML = uidanswer.machines.length; + // on auto-remplit le formulaire autofill_remove(lastsearch_remove); - }else + }else{ + section.remove.input.search.sum.innerHTML = 0; autofill_remove(null); + } }); } @@ -298,6 +312,10 @@ if( section.edit.element != null ){ // Definition des champs section.edit.input = { search: { + view: document.querySelector(section.edit.text + '.edit_search_view'), + num: document.querySelector(section.edit.text + '.edit_search_num'), + sum: document.querySelector(section.edit.text + '.edit_search_sum'), + keyword: document.querySelector(section.edit.text + '#edit_search_keyword'), id: document.querySelector(section.edit.text + '#edit_search_id'), submit: document.querySelector(section.edit.text + '#edit_search_submit') @@ -309,34 +327,48 @@ if( section.edit.element != null ){ submit: document.querySelector(section.edit.text + '#edit_submit') }; + var lastsearch_edit = null; + var searchindex_edit = 0; + // Gestion de l'auto-remplissage par lien function autofill_edit(id_machine){ // On recupere le code + name de la machine selectionnee - var machine_data = machine_data = { + var machine_data = { id_machine: '', code: '', name: '', disable_input: true }; - api.send({path:'machineDefault/getById', data: [id_machine]}, function(answer){ - if( answer.ModuleError == 0 ){ // Aucune erreur - machine_data = answer.machine; - machine_data.disable_input = false; - } + // Si @id_machine est un entier + if( !isNaN(id_machine) ){ - - // On enregistre l'UID de la machine - section.edit.input.search.id.value = machine_data.id_machine; + api.send({path:'machineDefault/getById', data: [id_machine]}, function(answer){ + if( answer.ModuleError == 0 ){ // Aucune erreur + machine_data = answer.machine; + machine_data.disable_input = false; + } - // Auto-remplissage du formulaire - section.edit.input.code.value = machine_data.code; - section.edit.input.name.value = machine_data.name; + + // On enregistre l'UID de la machine + section.edit.input.search.id.value = machine_data.id_machine; + + // Auto-remplissage du formulaire + section.edit.input.code.value = machine_data.code; + section.edit.input.name.value = machine_data.name; + + // On active ou pas le bouton "Modifier" + section.edit.input.submit.disabled = machine_data.disable_input; + + // Mise a jour des indices des resultats + section.edit.input.search.num.innerHTML = searchindex_edit+1; + + }); + + }else + section.edit.input.search.num.innerHTML = 0; - // On active ou pas le bouton "Modifier" - section.edit.input.submit.disabled = machine_data.disable_input; - }); }if( pageManager.vars.length >= 2 && !isNaN(pageManager.vars[1]) ) autofill_edit(pageManager.vars[1]); @@ -346,8 +378,6 @@ if( section.edit.element != null ){ /* (2) Gestion de la recherche de la machine */ - var lastsearch_edit = null; - var searchindex_edit = 0; section.edit.input.search.submit.addEventListener('click', function(e){ // On annule l'envoi de base (PHP) e.preventDefault(); @@ -366,14 +396,22 @@ if( section.edit.element != null ){ // Si on trouve la meme machine que lors de la derniere recherche if( lastsearch_edit == uidanswer.machines[searchindex_edit].id_machine ) searchindex_edit = (searchindex_edit+1) % uidanswer.machines.length; // on affiche le prochain (decalage cyclique) + else // si nouveau resultat, on remet l'indice a 0 + searchindex_edit = 0; lastsearch_edit = uidanswer.machines[searchindex_edit].id_machine; section.edit.input.search.id.value = lastsearch_edit; + + // Mise a jour des indices des resultats + section.edit.input.search.sum.innerHTML = uidanswer.machines.length; + // on auto-remplit le formulaire autofill_edit(lastsearch_edit); - }else + }else{ + section.edit.input.search.sum.innerHTML = 0; autofill_edit(null); + } }); } diff --git a/view/js/users.js b/view/js/users.js index 38eb900..a3f90cf 100755 --- a/view/js/users.js +++ b/view/js/users.js @@ -188,6 +188,10 @@ if( section.remove.element != null ){ /* (1) Definition des champs */ section.remove.input = { search: { + view: document.querySelector(section.remove.text + '.remove_search_view'), + num: document.querySelector(section.remove.text + '.remove_search_num'), + sum: document.querySelector(section.remove.text + '.remove_search_sum'), + keyword: document.querySelector(section.remove.text + '#remove_search_keyword'), id: document.querySelector(section.remove.text + '#remove_search_id'), submit: document.querySelector(section.remove.text + '#remove_search_submit') @@ -199,6 +203,9 @@ if( section.remove.element != null ){ submit: document.querySelector(section.remove.text + '#remove_submit') }; + var lastsearch_remove = null; + var searchindex_remove = 0; + /* (2) Gestion de l'auto-remplissage par url */ function autofill_remove(id_user){ @@ -220,12 +227,15 @@ if( section.remove.element != null ){ user_data.disable_input = false; } - // Auto-remplissage du formulaire - section.remove.input.code.value = user_data.code; - section.remove.input.username.value = user_data.username; + // Auto-remplissage du formulaire + section.remove.input.code.value = user_data.code; + section.remove.input.username.value = user_data.username; - // On affiche le bouton de suppression - section.remove.input.submit.disabled = user_data.disable_input; + // On affiche le bouton de suppression + section.remove.input.submit.disabled = user_data.disable_input; + + // Muse a jour des indices des resultats + section.remove.input.search.num.innerHTML = searchindex_remove+1; }); }if( pageManager.vars.length >= 2 && !isNaN(pageManager.vars[1]) ) autofill_remove(pageManager.vars[1]); @@ -233,8 +243,6 @@ if( section.remove.element != null ){ /* (3) Gestion de la recherche */ - var lastsearch_remove = null; - var searchindex_remove = 0; section.remove.input.search.submit.addEventListener('click', function(e){ // On annule l'envoi de base (PHP) e.preventDefault(); @@ -253,14 +261,22 @@ if( section.remove.element != null ){ // Si on trouve la meme machine que lors de la derniere recherche if( lastsearch_remove == uidanswer.users[searchindex_remove].id_user ) searchindex_remove = (searchindex_remove+1) % uidanswer.users.length; // on affiche le prochain (decalage cyclique) + else // si nouveau resultat, on remet l'indice a 0 + searchindex_remove = 0; lastsearch_remove = uidanswer.users[searchindex_remove].id_user; section.remove.input.search.id.value = lastsearch_remove; + + // Mise a jour des indices des resultats + section.remove.input.search.sum.innerHTML = uidanswer.users.length; + // on auto-remplit le formulaire autofill_remove(lastsearch_remove); - }else + }else{ + section.remove.input.search.sum.innerHTML = 0; autofill_remove(null); + } }); } @@ -317,6 +333,10 @@ if( section.edit.element != null ){ // Definition des champs section.edit.input = { search: { + view: document.querySelector(section.edit.text + '.edit_search_view'), + num: document.querySelector(section.edit.text + '.edit_search_num'), + sum: document.querySelector(section.edit.text + '.edit_search_sum'), + keyword: document.querySelector(section.edit.text + '#edit_search_keyword'), id: document.querySelector(section.edit.text + '#edit_search_id'), submit: document.querySelector(section.edit.text + '#edit_search_submit') @@ -333,6 +353,8 @@ if( section.edit.element != null ){ submit: document.querySelector(section.edit.text + '#edit_submit') }; + var lastsearch_edit = null; + var searchindex_edit = 0; /* (1) Gestion de l'auto-remplissage par url */ function autofill_edit(id_user){ @@ -375,17 +397,18 @@ if( section.edit.element != null ){ // On active ou pas le bouton "Modifier" section.edit.input.submit.disabled = user_data.disable_input; + // Mise a jour des indices des resultats + section.edit.input.search.num.innerHTML = searchindex_edit+1; }); - } + }else + section.edit.input.search.num.innerHTML = 0; }if( pageManager.vars.length >= 2 && !isNaN(pageManager.vars[1]) ) autofill_edit(pageManager.vars[1]); /* (2) Gestion de la recherche de l'utilisateur */ - var lastsearch_edit = null; - var searchindex_edit = 0; section.edit.input.search.submit.addEventListener('click', function(e){ // On annule l'envoi de base (PHP) e.preventDefault(); @@ -404,14 +427,22 @@ if( section.edit.element != null ){ // Si on trouve le meme utilisateur que lors de la derniere recherche if( lastsearch_edit == uidanswer.users[searchindex_edit].id_user ) searchindex_edit = (searchindex_edit+1) % uidanswer.users.length; // on affiche le prochain (decalage cyclique) + else // si nouveau resultat, on remet l'indice a 0 + searchindex_edit = 0; lastsearch_edit = uidanswer.users[searchindex_edit].id_user; section.edit.input.search.id.value = lastsearch_edit; + + // Mise a jour des indices des resultats + section.edit.input.search.sum.innerHTML = uidanswer.users.length; + // on auto-remplit le formulaire autofill_edit(lastsearch_edit); - }else + }else{ + section.edit.input.search.sum.innerHTML = 0; autofill_edit(null); + } }); } diff --git a/view/machines.php b/view/machines.php index b3349e5..ba504ad 100755 --- a/view/machines.php +++ b/view/machines.php @@ -159,7 +159,9 @@ echo "
"; echo "
"; - echo "
"; + echo ""; + // Indice du resultat + echo "machine 0 sur 0

"; echo "
"; echo "




"; @@ -188,7 +190,9 @@ echo ""; echo "
"; - echo "
"; + echo ""; + // Indice du resultat + echo "machine 0 sur 0

"; echo "
"; echo "




"; diff --git a/view/users.php b/view/users.php index 655ce2c..d726476 100755 --- a/view/users.php +++ b/view/users.php @@ -173,12 +173,17 @@ echo "
"; echo ""; + // Recherche d'utilisateur echo "
"; - echo "
"; + echo ""; + // Indice du resultat + echo "utilisateur 0 sur 0

"; echo "
"; + echo "




"; + // Suppression d'utilisateur echo "
"; echo "
"; echo ""; @@ -203,7 +208,9 @@ echo ""; echo "
"; - echo "
"; + echo ""; + // Indice du resultat + echo "utilisateur 0 sur 0

"; echo "
"; echo "




";