diff --git a/liste-envies-war/src/main/webapp/css/style.css b/liste-envies-war/src/main/webapp/css/style.css index f4d722f3..8eab6adc 100644 --- a/liste-envies-war/src/main/webapp/css/style.css +++ b/liste-envies-war/src/main/webapp/css/style.css @@ -1,264 +1,254 @@ body { - } - - #wrapper { - } #page-wrapper { - } -@media(min-width:768px) { - #wrapper { - - } +@media (min-width: 768px) { + #wrapper { + } - #page-wrapper { - padding: 10px; - } + #page-wrapper { + padding: 10px; + } } .page-background { - /* background-image: url('https://images.unsplash.com/photo-1477728275068-39b7f46df4d2?dpr=1&auto=format&fit=crop&w=1500&h=1000&q=80&cs=tinysrgb&crop='); + /* background-image: url('https://images.unsplash.com/photo-1477728275068-39b7f46df4d2?dpr=1&auto=format&fit=crop&w=1500&h=1000&q=80&cs=tinysrgb&crop='); */ - background-repeat: no-repeat; - background-attachment: fixed; - background-position: center; - background-size: cover; + background-repeat: no-repeat; + background-attachment: fixed; + background-position: center; + background-size: cover; } #page-wrapper { - min-height: 1000px; + min-height: 1000px; } .main-raised { - margin: -60px 0px 0px; - padding: 2px; + margin: -60px 0px 0px; + padding: 2px; } -@media(min-width:1024px) { - div.profil-page.main-raised { - margin: 0 33.33333333%; - } +@media (min-width: 1024px) { + div.profil-page.main-raised { + margin: 0 33.33333333%; + } } - .home-header { - margin-bottom: 10px; - padding: 0 20px; + margin-bottom: 10px; + padding: 0 20px; } .list-envies .list-envie-group { - margin: 10px 0; - padding: 15px; + margin: 10px 0; + padding: 15px; } .list-envies .list-envie-group .list-envies-item { - border-radius: 6px; - box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2); - cursor: pointer; + border-radius: 6px; + box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), + 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.2); + cursor: pointer; } .owner { - z-index: 2; - border-color: #337ab7; - border-style: solid; - border-width: 1px; + z-index: 2; + border-color: #337ab7; + border-style: solid; + border-width: 1px; } .owner p { - color: #337ab7; + color: #337ab7; } .owner a:hover p { - color: inherit; + color: inherit; } .list-envies-item { - position: relative; + position: relative; } .list-envies-item .backgroundimg { - top: 0; - left: 0; - right: 0; - bottom: 0; - position: absolute; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - opacity: 0.2; + top: 0; + left: 0; + right: 0; + bottom: 0; + position: absolute; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + opacity: 0.2; } .list-envies-menu-item { - position: relative; + position: relative; } .list-envies-menu-item .backgroundimg { - top: 0; - left: 0; - right: 0; - bottom: 0; - position: absolute; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - opacity: 0.2; + top: 0; + left: 0; + right: 0; + bottom: 0; + position: absolute; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + opacity: 0.2; } .mega-dropdown { - position: static !important; - width:100%; + position: static !important; + width: 100%; } .mega-dropdown-menu { - padding: 20px; - width: 100%; - box-shadow: none; - -webkit-box-shadow: none; + padding: 20px; + width: 100%; + box-shadow: none; + -webkit-box-shadow: none; } .mega-dropdown-menu:before { - content: ""; - border-bottom: 15px solid #fff; - border-right: 17px solid transparent; - border-left: 17px solid transparent; - position: absolute; - top: -14px; - left: 272px; - z-index: 10; + content: ""; + border-bottom: 15px solid #fff; + border-right: 17px solid transparent; + border-left: 17px solid transparent; + position: absolute; + top: -14px; + left: 272px; + z-index: 10; } .mega-dropdown-menu:after { - content: ""; - border-bottom: 17px solid #ccc; - border-right: 19px solid transparent; - border-left: 19px solid transparent; - position: absolute; - top: -16px; - left: 272px; - z-index: 8; + content: ""; + border-bottom: 17px solid #ccc; + border-right: 19px solid transparent; + border-left: 19px solid transparent; + position: absolute; + top: -16px; + left: 272px; + z-index: 8; } .mega-dropdown-menu .list-group-item { - display: inline-block; - width: 220px; - margin: 5px; - padding: 0; - border-radius: 5px; + display: inline-block; + width: 220px; + margin: 5px; + padding: 0; + border-radius: 5px; } .mega-dropdown-menu .list-group-item a { - margin: 0; - cursor: pointer; - text-overflow: ellipsis; - overflow: hidden; + margin: 0; + cursor: pointer; + text-overflow: ellipsis; + overflow: hidden; } .mega-dropdown-menu hr { - } .edit-button { - display: none; - position: absolute; - top: 2px; - right: 9px; + display: none; + position: absolute; + top: 2px; + right: 9px; } button.copy-button { - right: inherit; - left: 9px; + right: inherit; + left: 9px; } - .title .btn { - display: none; + display: none; } .title:hover .btn { - display: inline-block !important; + display: inline-block !important; } .title-edit { - font-size: 36px; - width: auto; - outline: none; - padding: 0; + font-size: 36px; + width: auto; + outline: none; + padding: 0; } .form-share-to-user { - border: solid lightgray 1px; - border-radius: 4px; - padding: 1px; - margin: 0; + border: solid lightgray 1px; + border-radius: 4px; + padding: 1px; + margin: 0; } .form-share-to-user .checkbox { - margin-top: 41px; + margin-top: 41px; } .form-share-to-user .col-xs-6 { - padding: 1px; + padding: 1px; } .form-share-to-user .col-xs-3 { - padding: 1px; - text-align: right; + padding: 1px; + text-align: right; } .form-share-to-user button.btn { - margin-top: 31px; + margin-top: 31px; } #share-list li.list-group-item.ng-binding.ng-scope { - padding: 5px 10px; + padding: 5px 10px; } #share-list li.list-group-item .btn-sm { - padding: 2px; - margin: 2px 5px 2px 0; + padding: 2px; + margin: 2px 5px 2px 0; } - - .order-filter { - /*display: flex; + /*display: flex; justify-content: space-between;*/ - margin-bottom: 15px; + margin-bottom: 15px; } -.order-btn .btn:active, .order-btn .btn:focus { - outline: none; +.order-btn .btn:active, +.order-btn .btn:focus { + outline: none; } .order-filter .form-group { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } .btn-magic i { - display: none; + display: none; } - .list-envie .envie-item:hover .edit-button { - display: block !important; + display: block !important; } .list-envie .envie-separator { - clear: both; + clear: both; } .list-envie .wish-edit { - margin-top: -4px !important; + margin-top: -4px !important; } .list-envie .comment-statusbar { - display: none !important; + display: none !important; } .list-envie .preview-image { - height: 100px; - width: 100px; + height: 100px; + width: 100px; } /*.list-envie .envie-item .panel-body { @@ -269,51 +259,51 @@ button.copy-button { min-height: 70px; }*/ -.list-envie .envie-item .bottom-envie .comments a { - color: black; +.list-envie .envie-item .bottom-envie .comments a { + color: black; } -.list-envie .envie-item .bottom-envie .comments a:hover { - color: gray; +.list-envie .envie-item .bottom-envie .comments a:hover { + color: gray; } .envie-item .bottom-envie .comments a.btn.btn-link { - margin-top: 0; - padding-top: 5px; + margin-top: 0; + padding-top: 5px; } .list-envie .envie-item .logo-envie { - margin-top: -34px; + margin-top: -34px; } - - .list-envie .envie-item { - box-shadow: 0 13px 18px 0 rgba(0, 0, 0, 0.58), 0 13px 22px 0 rgba(0, 0, 0, 0.12); + box-shadow: 0 13px 18px 0 rgba(0, 0, 0, 0.58), + 0 13px 22px 0 rgba(0, 0, 0, 0.12); } .list-envies .list-group-item.owner { - z-index: 2; - border-color: #337ab7; - border-style: solid; - border-width: 1px; - margin: 0px; - box-shadow: inset 0px 0px 0px 5px #337ab7, 0 16px 24px 2px rgba(0, 0, 0, 0.45), 0 6px 30px 5px rgba(0, 0, 0, 0.25), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important; - } + z-index: 2; + border-color: #337ab7; + border-style: solid; + border-width: 1px; + margin: 0px; + box-shadow: inset 0px 0px 0px 5px #337ab7, 0 16px 24px 2px rgba(0, 0, 0, 0.45), + 0 6px 30px 5px rgba(0, 0, 0, 0.25), 0 8px 10px -5px rgba(0, 0, 0, 0.2) !important; +} - .mega-dropdown-menu .list-group-item.owner { - z-index: 2; - border-color: #337ab7; - border-style: solid; - border-width: 1px; +.mega-dropdown-menu .list-group-item.owner { + z-index: 2; + border-color: #337ab7; + border-style: solid; + border-width: 1px; } .list-group.list-envies h2.list-group-item-heading { - display: block; /* Fallback for non-webkit */ + display: block; /* Fallback for non-webkit */ display: -webkit-box; max-width: 100%; - - height: 2em; /*Fallback for non-webkit */ + + height: 2em; /*Fallback for non-webkit */ margin: 0 auto; font-size: 2.5em; line-height: 1em; @@ -324,590 +314,594 @@ button.copy-button { font-align: center; vertical-align: middle; text-align: center; - } - +} .list-group.list-envies p.list-group-item-text { - display: block; /* Fallback for non-webkit */ - display: -webkit-box; - width: 100%; - min-width: 100%; - height: 3em; /*Fallback for non-webkit */ - - font-size: 0.9em; - line-height: 0.8em; - -webkit-line-clamp: 3; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; + display: block; /* Fallback for non-webkit */ + display: -webkit-box; + width: 100%; + min-width: 100%; + height: 3em; /*Fallback for non-webkit */ + + font-size: 0.9em; + line-height: 0.8em; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; } .envie-card .panel-body { - padding-top: 2px; + padding-top: 2px; } -.envie-card .envie-infos .fa{ - margin-right: 3px; +.envie-card .envie-infos .fa { + margin-right: 3px; } -.envie-card .envie-infos .col{ - padding: 1px; +.envie-card .envie-infos .col { + padding: 1px; } .envie-card .wish-price { - margin: 0 !important; + margin: 0 !important; } .envie-card .rating { - margin-top: 2px; + margin-top: 2px; } .envie-card .envie-infos { - min-height: 29px; - border-bottom: lightgray dashed 0.5px; - margin-bottom: 10px; + min-height: 29px; + border-bottom: lightgray dashed 0.5px; + margin-bottom: 10px; } .envie-card a.btn-wish-link { - /* Do not surcharge border top, used bordered */ - border-left: #f1f1f1 solid 1px; - border-right: #f1f1f1 solid 1px; - border-bottom: #f1f1f1 solid 1px; + /* Do not surcharge border top, used bordered */ + border-left: #f1f1f1 solid 1px; + border-right: #f1f1f1 solid 1px; + border-bottom: #f1f1f1 solid 1px; } .order-filter .search { - padding-top: 45px; + padding-top: 45px; } -.order-filter .has-feedback label~.form-control-feedback { - opacity: 1; - top: 14px; - display: block; +.order-filter .has-feedback label ~ .form-control-feedback { + opacity: 1; + top: 14px; + display: block; } .order-filter input#searchEnvieFilter { - } .order-filter .reset-search-icon { - margin-top: -10px; + margin-top: -10px; } div.material-icons.form-control-feedback { - cursor: pointer; - color: gray; + cursor: pointer; + color: gray; } .card .header { - padding: 2px !important; - margin: 6px; - margin-top: 4px; - box-shadow: 0 4px 16px -3px rgba(0, 0, 0, 0.56); - background: white; + padding: 2px !important; + margin: 6px; + margin-top: 4px; + box-shadow: 0 4px 16px -3px rgba(0, 0, 0, 0.56); + background: white; } .card .header-mutted { - background: #eeeeee; - border-top: #8c8c8c 6px solid; } + background: #eeeeee; + border-top: #8c8c8c 6px solid; +} .envie-container { - padding-top: 20px; + padding-top: 20px; } .envie-card .panel { - /*box-shadow: none;*/ + /*box-shadow: none;*/ } .envie-card .panel .footer { - padding: 5px; + padding: 5px; } .envie-card .panel .footer button.btn { - margin: 0; + margin: 0; } .envie-card h1 { - font-size: 1.5em; + font-size: 1.5em; } .envie-card .gift { - margin: 0; - margin-top: 0; - padding: 0px 13px 0 0; + margin: 0; + margin-top: 0; + padding: 0px 13px 0 0; } .envie-card .gift h6 { - margin: 0; + margin: 0; } - - - - - /** Comentaires **/ .chat .chat-history { - padding: 0; - border-bottom: 2px solid white; + padding: 0; + border-bottom: 2px solid white; } .chat .chat-history .message-data { - margin-bottom: 15px; + margin-bottom: 15px; } .chat .chat-history .message-data-time { - color: #a8aab1; - padding-left: 6px; + color: #a8aab1; + padding-left: 6px; } .chat .chat-history .message { - color: white; - padding: 18px 20px; - line-height: 26px; - font-size: 16px; - border-radius: 5px; - margin-bottom: 5px; - width: 90%; - position: relative; + color: white; + padding: 18px 20px; + line-height: 26px; + font-size: 16px; + border-radius: 5px; + margin-bottom: 5px; + width: 90%; + position: relative; } .chat .chat-history .message:after { - content: ""; - position: absolute; - top: -15px; - left: 20px; - border-width: 0 15px 15px; - border-style: solid; - border-color: #31708f transparent; - display: block; - width: 0; + content: ""; + position: absolute; + top: -15px; + left: 20px; + border-width: 0 15px 15px; + border-style: solid; + border-color: #31708f transparent; + display: block; + width: 0; } .chat .chat-history .you-message { - background: #31708f; - color:#FFFFFF; + background: #31708f; + color: #ffffff; } .chat .chat-history .me-message { - background: #8a6d3b; + background: #8a6d3b; } .chat .chat-history .me-message:after { - right: 20px; - top: -15px; - left: auto; - bottom:auto; + right: 20px; + top: -15px; + left: auto; + bottom: auto; } /** For success **/ .panel-success .chat .chat-history .you-message { - background: #3c763d; + background: #3c763d; } .panel-success .chat .chat-history .message:after { - border-color: #3c763d transparent; + border-color: #3c763d transparent; } .panel-success .chat .chat-history .me-message { - background: #5cb85c; + background: #5cb85c; } .panel-success .chat .chat-history .me-message:after { - border-color: #5cb85c transparent; + border-color: #5cb85c transparent; } /** For Warning **/ .panel-warning .chat .chat-history .you-message { - background: #8a6d3b; + background: #8a6d3b; } .panel-warning .chat .chat-history .message:after { - border-color: #8a6d3b transparent; + border-color: #8a6d3b transparent; } .panel-warning .chat .chat-history .me-message { - background: #f0ad4e; + background: #f0ad4e; } .panel-warning .chat .chat-history .me-message:after { - border-color: #f0ad4e transparent; + border-color: #f0ad4e transparent; } /** For info **/ .panel-info .chat .chat-history .you-message { - background: #31708f; + background: #31708f; } .panel-info .chat .chat-history .message:after { - border-color: #31708f transparent; + border-color: #31708f transparent; } .panel-info .chat .chat-history .me-message { - background: #5bc0de; + background: #5bc0de; } .panel-info .chat .chat-history .me-message:after { - border-color: #5bc0de transparent; + border-color: #5bc0de transparent; } - - - .chat { - padding: 0 10px; + padding: 0 10px; } - .chat .chat-message { - padding: 30px; + padding: 30px; } -.chat .chat-message .fa-file-o, .chat .chat-message .fa-file-image-o { - font-size: 16px; - color: gray; - cursor: pointer; +.chat .chat-message .fa-file-o, +.chat .chat-message .fa-file-image-o { + font-size: 16px; + color: gray; + cursor: pointer; } -.chat .chat-ul li{ - list-style-type: none; +.chat .chat-ul li { + list-style-type: none; } -.chat .chat-ul{ - padding: 0; +.chat .chat-ul { + padding: 0; } .chat .align-left { - text-align: left; + text-align: left; } .chat .align-right { - text-align: right; + text-align: right; } .chat .float-right { - float: right; + float: right; } .chat .clearfix:after { - visibility: hidden; - display: block; - font-size: 0; - content: " "; - clear: both; - height: 0; + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; } .chat .you { - color: #CCDBDC; + color: #ccdbdc; } .chat .me { - color: #5f5e5e; + color: #5f5e5e; } .links-editor input { - width: 44%; - display: inline-block; + width: 44%; + display: inline-block; } .picture-editor { - display: flex; + display: flex; } .picture-editor input { - flex: 1 1; + flex: 1 1; } .picture-editor button { - margin-top: 0; + margin-top: 0; } .picture-list-edit { - position: relative; + position: relative; } .picture-list-edit button.delete-picture { - z-index: 999; - font-size: 1.5em; - position: absolute; - top: 5px; - right: 23px; - color: white; - background-color: rgba(1,1,1, 0.5); - border-radius: 50%; - padding: 5px 8px; + z-index: 999; + font-size: 1.5em; + position: absolute; + top: 5px; + right: 23px; + color: white; + background-color: rgba(1, 1, 1, 0.5); + border-radius: 50%; + padding: 5px 8px; } .envie-item .comment-form { - background: white; - padding: 1px 2px; - margin: 5px 0 0; + background: white; + padding: 1px 2px; + margin: 5px 0 0; } .envie-item .comment-form label { - margin: 0; + margin: 0; } .envie-item .comment-form .comment-textarea { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } .envie-item form.form.form-add-comment { - padding: 0 11px 2px 26px; + padding: 0 11px 2px 26px; } .envie-item form.form.form-add-comment button.btn { - position: relative; - bottom: -4px; - margin: 0; - padding: 18px; + position: relative; + bottom: -4px; + margin: 0; + padding: 18px; } .envie-item h5 { - margin-left: 16px; + margin-left: 16px; } .spin { - -webkit-animation: spin .4s infinite linear; - -moz-animation: spin .4s infinite linear; - -o-animation: spin .4s infinite linear; - animation: spin .4s infinite linear; - -webkit-transform-origin: 50% 58%; - transform-origin:50% 58%; - -ms-transform-origin:50% 58%; /* IE 9 */ + -webkit-animation: spin 0.4s infinite linear; + -moz-animation: spin 0.4s infinite linear; + -o-animation: spin 0.4s infinite linear; + animation: spin 0.4s infinite linear; + -webkit-transform-origin: 50% 58%; + transform-origin: 50% 58%; + -ms-transform-origin: 50% 58%; /* IE 9 */ } @-moz-keyframes spin { - from { - -moz-transform: rotate(0deg); - } - to { - -moz-transform: rotate(360deg); - } + from { + -moz-transform: rotate(0deg); + } + to { + -moz-transform: rotate(360deg); + } } @-webkit-keyframes spin { - from { - -webkit-transform: rotate(0deg); - } - to { - -webkit-transform: rotate(360deg); - } + from { + -webkit-transform: rotate(0deg); + } + to { + -webkit-transform: rotate(360deg); + } } @keyframes spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } } -.top5 { margin-top:5px; } -.top7 { margin-top:7px; } -.top10 { margin-top:10px; } -.top15 { margin-top:15px; } -.top17 { margin-top:17px; } -.top30 { margin-top:30px; } - +.top5 { + margin-top: 5px; +} +.top7 { + margin-top: 7px; +} +.top10 { + margin-top: 10px; +} +.top15 { + margin-top: 15px; +} +.top17 { + margin-top: 17px; +} +.top30 { + margin-top: 30px; +} /** loading **/ .loading { - height: 100vh; - width: 100vw; - font-family: Helvetica; + height: 100vh; + width: 100vw; + font-family: Helvetica; } .loader { - height: 20px; - width: 250px; - position: absolute; - top: 0; - bottom: 0; - left: 0; - right: 0; - margin: auto; + height: 20px; + width: 250px; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + margin: auto; } .loader--dot { - animation-name: loader; - animation-timing-function: ease-in-out; - animation-duration: 3s; - animation-iteration-count: infinite; - height: 20px; - width: 20px; - border-radius: 100%; - background-color: black; - position: absolute; - border: 2px solid white; + animation-name: loader; + animation-timing-function: ease-in-out; + animation-duration: 3s; + animation-iteration-count: infinite; + height: 20px; + width: 20px; + border-radius: 100%; + background-color: black; + position: absolute; + border: 2px solid white; } .loader--dot:first-child { - background-color: #8cc759; - animation-delay: 0.5s; + background-color: #8cc759; + animation-delay: 0.5s; } .loader--dot:nth-child(2) { - background-color: #8c6daf; - animation-delay: 0.4s; + background-color: #8c6daf; + animation-delay: 0.4s; } .loader--dot:nth-child(3) { - background-color: #ef5d74; - animation-delay: 0.3s; + background-color: #ef5d74; + animation-delay: 0.3s; } .loader--dot:nth-child(4) { - background-color: #f9a74b; - animation-delay: 0.2s; + background-color: #f9a74b; + animation-delay: 0.2s; } .loader--dot:nth-child(5) { - background-color: #60beeb; - animation-delay: 0.1s; + background-color: #60beeb; + animation-delay: 0.1s; } .loader--dot:nth-child(6) { - background-color: #fbef5a; - animation-delay: 0s; + background-color: #fbef5a; + animation-delay: 0s; } .loader--text { - position: absolute; - top: 200%; - left: 0; - right: 0; - width: 4rem; - margin: auto; + position: absolute; + top: 200%; + left: 0; + right: 0; + width: 4rem; + margin: auto; } .loader--text:after { - content: "Chargement"; - font-weight: bold; - animation-name: loading-text; - animation-duration: 3s; - animation-iteration-count: infinite; + content: "Chargement"; + font-weight: bold; + animation-name: loading-text; + animation-duration: 3s; + animation-iteration-count: infinite; } @keyframes loader { - 15% { - transform: translateX(0); - } - 45% { - transform: translateX(230px); - } - 65% { - transform: translateX(230px); - } - 95% { - transform: translateX(0); - } + 15% { + transform: translateX(0); + } + 45% { + transform: translateX(230px); + } + 65% { + transform: translateX(230px); + } + 95% { + transform: translateX(0); + } } @keyframes loading-text { - 0% { - content: "Chargement"; - } - 25% { - content: "Chargement."; - } - 50% { - content: "Chargement.."; - } - 75% { - content: "Chargement..."; - } + 0% { + content: "Chargement"; + } + 25% { + content: "Chargement."; + } + 50% { + content: "Chargement.."; + } + 75% { + content: "Chargement..."; + } } /** Rating **/ .star-rating { - margin: 0; - padding: 0; - display: flex; + margin: 0; + padding: 0; + display: flex; } -.star-rating > .star, .star-rating > .cancel-rating { - padding: 1px; - color: #ddd; - font-size: 20px; - text-shadow: .05em .05em #aaa; - list-style-type: none; - display: inline-block; - cursor: pointer; +.star-rating > .star, +.star-rating > .cancel-rating { + padding: 1px; + color: #ddd; + font-size: 20px; + text-shadow: 0.05em 0.05em #aaa; + list-style-type: none; + display: inline-block; + cursor: pointer; } .star-rating.readonly > .star { - cursor: not-allowed; + cursor: not-allowed; } - .star-rating .star.filled { - color: #ff572d; + color: #ff572d; } .star-rating.readonly .star.filled { - color: #ffa77c; - cursor: not-allowed; + color: #ffa77c; + cursor: not-allowed; } -.star-rating:not(.readonly):hover .star, .star-rating:not(.readonly):hover .star.filled { - color: #ff002c; +.star-rating:not(.readonly):hover .star, +.star-rating:not(.readonly):hover .star.filled { + color: #ff002c; } -.star-rating:not(.readonly) > .star:hover ~ .star, .star-rating:not(.readonly) > .cancel-rating:hover ~ .star { - color: #ddd !important; +.star-rating:not(.readonly) > .star:hover ~ .star, +.star-rating:not(.readonly) > .cancel-rating:hover ~ .star { + color: #ddd !important; } .modal-dialog { - z-index: 1500 !important; + z-index: 1500 !important; } .modal-backdrop { - z-index: 1 !important; + z-index: 1 !important; } .notif-menu { - padding: 5px; - min-width: 250px; + padding: 5px; + min-width: 250px; + overflow: auto; + max-height: 36em; } .notification .badge { - margin-top: -22px; - margin-left: -15px; - margin-right: 15px; + margin-top: -22px; + margin-left: -15px; + margin-right: 15px; } .title-notification { - color: white !important; - size: 16px; + color: white !important; + size: 16px; } li.notif { - color: white; - border-bottom: 1px solid #e2e2e2; - cursor: pointer; + color: white; + border-bottom: 1px solid #e2e2e2; + cursor: pointer; } li.notif .fa { - color: white; - margin: 0 5px; + color: white; + margin: 0 5px; } +@media (min-width: 768px) { + .title-notification { + color: black !important; + } + li.notif { + color: #333; + border-bottom: 1px solid #e2e2e2; + } -@media(min-width:768px) { - .title-notification { - color: black !important; - } - - li.notif { - color: #333; - border-bottom: 1px solid #e2e2e2; - } - - li.notif .fa { - color: #666; - } + li.notif .fa { + color: #666; + } } .dropdown-menu { - z-index: 2000 !important; + z-index: 2000 !important; } a.thumbnail.background-config img { - max-height: 98px; + max-height: 98px; } span.owners { - word-break: break-all; - overflow-wrap: break-word; + word-break: break-all; + overflow-wrap: break-word; } .list-envie .alert { - height: 200px; - padding: 25px; - border-radius: 5px; - margin: 20px 0; - text-align: center; + height: 200px; + padding: 25px; + border-radius: 5px; + margin: 20px 0; + text-align: center; } diff --git a/liste-envies-war/src/main/webapp/js/controllers/listCtrl.js b/liste-envies-war/src/main/webapp/js/controllers/listCtrl.js index a9c24b19..8e453eed 100644 --- a/liste-envies-war/src/main/webapp/js/controllers/listCtrl.js +++ b/liste-envies-war/src/main/webapp/js/controllers/listCtrl.js @@ -1,544 +1,738 @@ -app.controller('ListCtrl', ListCtrl); -ListCtrl.$inject = ['wishService', 'appUserService', 'wishListService', '$routeParams', '$location', '$anchorScroll', '$scope', '$parse', '$interval', '$timeout', '$filter', 'UtilitiesServices']; - -function ListCtrl(wishService, appUserService, wishListService, $routeParams, $location, $anchorScroll, $scope, $parse, $interval, $timeout, $filter, UtilitiesServices) { - var vm = this; - vm.name = $routeParams.name; - vm.wishList = loadWishList(vm.name); - vm.hasFilter = false; - vm.loading = true; - masonry = null; - vm.newUser = {email: '', type: 'SHARED'}; - vm.url = $location.protocol() + "://" + $location.host(); - vm.newUrl = vm.name; - - vm.editorOptions = { - disableDragAndDrop: true, - placeholder: "Ajouter une description", - toolbar: [ - ['style', ['bold', 'italic', 'underline', 'clear', 'color', 'fontsize']], - ['para', ['ul', 'ol', 'paragraph']] +app.controller("ListCtrl", ListCtrl); +ListCtrl.$inject = [ + "wishService", + "appUserService", + "wishListService", + "$routeParams", + "$location", + "$anchorScroll", + "$scope", + "$parse", + "$interval", + "$timeout", + "$filter", + "UtilitiesServices", +]; + +function ListCtrl( + wishService, + appUserService, + wishListService, + $routeParams, + $location, + $anchorScroll, + $scope, + $parse, + $interval, + $timeout, + $filter, + UtilitiesServices +) { + var vm = this; + vm.name = $routeParams.name; + vm.wishList = loadWishList(vm.name); + vm.hasFilter = false; + vm.loading = true; + masonry = null; + vm.newUser = { email: "", type: "SHARED" }; + vm.url = $location.protocol() + "://" + $location.host(); + vm.newUrl = vm.name; + + vm.editorOptions = { + disableDragAndDrop: true, + placeholder: "Ajouter une description", + toolbar: [ + ["style", ["bold", "italic", "underline", "clear", "color", "fontsize"]], + ["para", ["ul", "ol", "paragraph"]], + ["insert", ["link", "picture"]], + ], + popover: { + image: [ + ["imagesize", ["imageSize100", "imageSize50", "imageSize25"]], + ["float", ["floatLeft", "floatRight", "floatNone"]], + ["remove", ["removeMedia"]], + ], + link: [["link", ["linkDialogShow", "unlink"]]], + air: [ + [ + "style", + ["bold", "italic", "underline", "clear", "color", "fontsize"], ], - popover: { - image: [ - ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']], - ['float', ['floatLeft', 'floatRight', 'floatNone']], - ['remove', ['removeMedia']] - ], - link: [ - ['link', ['linkDialogShow', 'unlink']] - ], - air: [ - ['style', ['bold', 'italic', 'underline', 'clear', 'color', 'fontsize']], - ['para', ['ul', 'ol', 'paragraph']] - ] - }, - height: 200 - }; - - - var orderPrice = function (value) { - var price = value.price; - if (!price) return (vm.reverse) ? -1 : 99999999; - - var matches = price.replace(',', '.').replace(' ', '').match(/(\d+\.?\d+|\.\d+)/g); - if (!matches) return (vm.reverse) ? -1 : 99999999; - - var valTri = matches.reduce(function (returnValue, currentValue) { - if (typeof returnValue == 'string') returnValue = parseFloat(returnValue); - currentValue = parseFloat(currentValue); - if (vm.reverse && returnValue > currentValue) { // If reverse find min - return returnValue; - } else if (!vm.reverse && returnValue < currentValue) { // If no reverse find max - return returnValue; - } - return currentValue; - }); - if (typeof valTri == 'string') valTri = parseFloat(valTri); - if (valTri >= 0) { - return valTri; - } else { - return (vm.reverse) ? -1 : 99999999; - } - - - }; - vm.orderProperties = [{property: 'label', label: 'Titre', reverse: false, selected: false}, - {property: 'date', label: 'Date', reverse: true, selected: true}, - {property: orderPrice, label: 'Prix', reverse: false, selected: false}, - {property: 'rating', label: 'Note', reverse: true, selected: false}, - {property: 'userTakeUsers', label: 'Offert', reverse: true, selected: false}, - { - property: function (value) { - return (value.comments) ? value.comments.length : -1; - }, label: 'Commentaires', reverse: true, selected: false - }]; - - vm.orderPropertiesOwners = [{property: 'label', label: 'Titre', reverse: false, selected: false}, - {property: 'date', label: 'Date', reverse: true, selected: false}, - {property: orderPrice, label: 'Prix', reverse: false, selected: false}]; - - vm.filtersPriceList = [ - {role: "filter", type: 'price', min: 0, max: 30, label: 'Moins de 30 €', class: ''}, - {role: "filter", type: 'price', min: 0, max: 50, label: 'Moins de 50 €', class: ''}, - {role: "filter", type: 'price', min: 0, max: 100, label: 'Moins de 100 €', class: ''}, - {role: "filter", type: 'price', min: 0, max: 200, label: 'Moins de 200 €', class: ''}, - {role: "separator", class: "divider"}, - {role: "filter", type: 'price', min: 30, max: 50, label: 'entre 30 et 50 €', class: ''}, - {role: "filter", type: 'price', min: 50, max: 100, label: 'entre 50 et 100 €', class: ''}, - {role: "filter", type: 'price', min: 100, max: 200, label: 'entre 100 et 200 €', class: ''}, - {role: "separator", class: "divider"}, - {role: "filter", type: 'price', min: 30, max: null, label: 'Plus de 30 €', class: ''}, - {role: "filter", type: 'price', min: 50, max: null, label: 'Plus de 50 €', class: ''}, - {role: "filter", type: 'price', min: 100, max: null, label: 'Plus de 100 €', class: ''}, - {role: "filter", type: 'price', min: 200, max: null, label: 'Plus de 200 €', class: ''} - ]; - - vm.filtersRatingList = [ - {role: "filter", type: 'rating', expression: 'rating == 1', label: '1 coeur', class: ''}, - {role: "filter", type: 'rating', expression: 'rating == 2', label: '2 coeurs', class: ''}, - {role: "filter", type: 'rating', expression: 'rating == 3', label: '3 coeurs', class: ''}, - {role: "filter", type: 'rating', expression: 'rating == 4', label: '4 coeurs', class: ''}, - {role: "filter", type: 'rating', expression: 'rating == 5', label: '5 coeurs', class: ''}, - {role: "separator", class: "divider"}, - {role: "filter", type: 'rating', expression: 'rating >= 1', label: 'plus de 1 coeurs', class: ''}, - {role: "filter", type: 'rating', expression: 'rating >= 2', label: 'plus de 2 coeurs', class: ''}, - {role: "filter", type: 'rating', expression: 'rating >= 3', label: 'plus de 3 coeurs', class: ''}, - {role: "filter", type: 'rating', expression: 'rating >= 4', label: 'plus de 4 coeurs', class: ''}, - {role: "filter", type: 'rating', expression: 'rating >= 5', label: 'plus de 5 coeurs', class: ''} - ]; - - vm.filterProperties = [{ - owner: true, - shared: true, - expression: 'true', - label: 'Toutes', - class: 'btn-white btn-bordered-primary' + ["para", ["ul", "ol", "paragraph"]], + ["insert", ["link", "picture"]], + ], + }, + height: 200, + }; + + var orderPrice = function (value) { + var price = value.price; + if (!price) return vm.reverse ? -1 : 99999999; + + var matches = price + .replace(",", ".") + .replace(" ", "") + .match(/(\d+\.?\d+|\.\d+)/g); + if (!matches) return vm.reverse ? -1 : 99999999; + + var valTri = matches.reduce(function (returnValue, currentValue) { + if (typeof returnValue == "string") returnValue = parseFloat(returnValue); + currentValue = parseFloat(currentValue); + if (vm.reverse && returnValue > currentValue) { + // If reverse find min + return returnValue; + } else if (!vm.reverse && returnValue < currentValue) { + // If no reverse find max + return returnValue; + } + return currentValue; + }); + if (typeof valTri == "string") valTri = parseFloat(valTri); + if (valTri >= 0) { + return valTri; + } else { + return vm.reverse ? -1 : 99999999; + } + }; + vm.orderProperties = [ + { property: "label", label: "Titre", reverse: false, selected: false }, + { property: "date", label: "Date", reverse: true, selected: true }, + { property: orderPrice, label: "Prix", reverse: false, selected: false }, + { property: "rating", label: "Note", reverse: true, selected: false }, + { + property: "userTakeUsers", + label: "Offert", + reverse: true, + selected: false, + }, + { + property: function (value) { + return value.comments ? value.comments.length : -1; + }, + label: "Commentaires", + reverse: true, + selected: false, + }, + ]; + + vm.orderPropertiesOwners = [ + { property: "label", label: "Titre", reverse: false, selected: false }, + { property: "date", label: "Date", reverse: true, selected: false }, + { property: orderPrice, label: "Prix", reverse: false, selected: false }, + ]; + + vm.filtersPriceList = [ + { + role: "filter", + type: "price", + min: 0, + max: 30, + label: "Moins de 30 €", + class: "", + }, + { + role: "filter", + type: "price", + min: 0, + max: 50, + label: "Moins de 50 €", + class: "", + }, + { + role: "filter", + type: "price", + min: 0, + max: 100, + label: "Moins de 100 €", + class: "", + }, + { + role: "filter", + type: "price", + min: 0, + max: 200, + label: "Moins de 200 €", + class: "", + }, + { role: "separator", class: "divider" }, + { + role: "filter", + type: "price", + min: 30, + max: 50, + label: "entre 30 et 50 €", + class: "", + }, + { + role: "filter", + type: "price", + min: 50, + max: 100, + label: "entre 50 et 100 €", + class: "", + }, + { + role: "filter", + type: "price", + min: 100, + max: 200, + label: "entre 100 et 200 €", + class: "", + }, + { role: "separator", class: "divider" }, + { + role: "filter", + type: "price", + min: 30, + max: null, + label: "Plus de 30 €", + class: "", + }, + { + role: "filter", + type: "price", + min: 50, + max: null, + label: "Plus de 50 €", + class: "", + }, + { + role: "filter", + type: "price", + min: 100, + max: null, + label: "Plus de 100 €", + class: "", + }, + { + role: "filter", + type: "price", + min: 200, + max: null, + label: "Plus de 200 €", + class: "", + }, + ]; + + vm.filtersRatingList = [ + { + role: "filter", + type: "rating", + expression: "rating == 1", + label: "1 coeur", + class: "", + }, + { + role: "filter", + type: "rating", + expression: "rating == 2", + label: "2 coeurs", + class: "", + }, + { + role: "filter", + type: "rating", + expression: "rating == 3", + label: "3 coeurs", + class: "", + }, + { + role: "filter", + type: "rating", + expression: "rating == 4", + label: "4 coeurs", + class: "", + }, + { + role: "filter", + type: "rating", + expression: "rating == 5", + label: "5 coeurs", + class: "", + }, + { role: "separator", class: "divider" }, + { + role: "filter", + type: "rating", + expression: "rating >= 1", + label: "plus de 1 coeurs", + class: "", + }, + { + role: "filter", + type: "rating", + expression: "rating >= 2", + label: "plus de 2 coeurs", + class: "", }, + { + role: "filter", + type: "rating", + expression: "rating >= 3", + label: "plus de 3 coeurs", + class: "", + }, + { + role: "filter", + type: "rating", + expression: "rating >= 4", + label: "plus de 4 coeurs", + class: "", + }, + { + role: "filter", + type: "rating", + expression: "rating >= 5", + label: "plus de 5 coeurs", + class: "", + }, + ]; + + vm.filterProperties = [ + { + owner: true, + shared: true, + expression: "true", + label: "Toutes", + class: "btn-white btn-bordered-primary", + }, + { + owner: false, + shared: true, + expression: "userTake.length > 0", + label: "Offerts", + class: "btn-white btn-bordered-warning", + }, + { + owner: false, + shared: true, + expression: "userTake.length == 0", + label: "A offrir", + class: "btn-white btn-bordered-success", + child: [ { - owner: false, - shared: true, - expression: 'userTake.length > 0', - label: 'Offerts', - class: 'btn-white btn-bordered-warning' + role: "filter", + expression: "userTake.length == 0 && suggest == true", + label: "Suggestion", + class: "btn-white btn-bordered-info", }, { - owner: false, - shared: true, - expression: 'userTake.length == 0', - label: 'A offrir', - class: 'btn-white btn-bordered-success', - child: [ - { - role: "filter", - expression: 'userTake.length == 0 && suggest == true', - label: 'Suggestion', - class: 'btn-white btn-bordered-info' - }, - { - role: "filter", - expression: 'userTake.length == 0 && suggest == false ', - label: 'Envie', - class: 'btn-white btn-bordered-success' - } - ] + role: "filter", + expression: "userTake.length == 0 && suggest == false ", + label: "Envie", + class: "btn-white btn-bordered-success", }, + ], + }, + { + owner: false, + shared: true, + expression: "comments.length > 0", + label: "Commentaires", + class: "btn-white btn-bordered-danger", + }, + { + owner: true, + shared: false, + expression: + "description == null || price == null || picture == null || urls == null", + label: "A compléter", + class: "btn-white btn-bordered-danger", + child: [ { - owner: false, - shared: true, - expression: 'comments.length > 0', - label: 'Commentaires', - class: 'btn-white btn-bordered-danger' + role: "filter", + expression: "description == null", + label: "Sans texte", + class: "btn-white btn-bordered-danger", }, { - owner: true, - shared: false, - expression: 'description == null || price == null || picture == null || urls == null', - label: 'A compléter', - class: 'btn-white btn-bordered-danger', - child: [ - { - role: "filter", - expression: 'description == null', - label: 'Sans texte', - class: 'btn-white btn-bordered-danger' - }, - { - role: "filter", - expression: 'price == null', - label: 'Sans prix', - class: 'btn-white btn-bordered-danger' - }, - { - role: "filter", - expression: 'picture == null', - label: 'Sans image', - class: 'btn-white btn-bordered-danger' - }, - {role: "filter", expression: 'urls == null', label: 'Sans lien', class: 'btn-white btn-bordered-danger'} - ] + role: "filter", + expression: "price == null", + label: "Sans prix", + class: "btn-white btn-bordered-danger", }, - { - owner: true, - shared: true, - expression: 'rating > 0', - label: 'Note', - class: 'btn-white btn-bordered-upgrade', - child: vm.filtersRatingList + role: "filter", + expression: "picture == null", + label: "Sans image", + class: "btn-white btn-bordered-danger", }, { - owner: true, - shared: true, - expression: 'price != null', - label: 'Prix', - class: 'btn-white btn-bordered-gray', - child: vm.filtersPriceList - } - ]; - - - loadWishes(); - resetForm(); - - vm.update = function () { - if (masonry) { - masonry.update(); - } - }; - - vm.addWish = function (wish) { - vm.wishes.push(wish); - vm.update(); - }; - - vm.resetFilter = function () { - vm.filterList("true"); - vm.search = ''; - }; - - vm.removeUser = function (user) { - var index = vm.wishList.users.indexOf(user); - if (index >= 0) - vm.wishList.users.splice(index, 1); - }; - - vm.shareUser = function (newUser) { - if (!newUser.type) { - newUser.type = 'SHARED'; - } - if (newUser.email && newUser.email.indexOf('@') > 0) { - var pushUser = {}; - pushUser.email = newUser.email.trim(); - pushUser.type = newUser.type; - vm.wishList.users.push(pushUser); - } - newUser = {email: '', type: 'SHARED'}; - vm.newUser = newUser; - }; + role: "filter", + expression: "urls == null", + label: "Sans lien", + class: "btn-white btn-bordered-danger", + }, + ], + }, - vm.saveWishList = function (wishList) { - if (vm.newUser.email) { - vm.shareUser(vm.newUser); - } - wishListService.save(wishList, function (wishList) { - vm.wishList = wishList; - $("#share-list").modal("hide"); - $("#settings-list").modal("hide"); - hideModal(); - vm.editTitle = false; - updateDate(); - - UtilitiesServices.getList(true); - }); - }; + { + owner: true, + shared: true, + expression: "rating > 0", + label: "Note", + class: "btn-white btn-bordered-upgrade", + child: vm.filtersRatingList, + }, + { + owner: true, + shared: true, + expression: "price != null", + label: "Prix", + class: "btn-white btn-bordered-gray", + child: vm.filtersPriceList, + }, + ]; + loadWishes(); + resetForm(); - function updateDate() { - vm.wishList.dateTimeStamp = vm.wishList.date; - if (vm.wishList.date) - vm.wishList.date = new Date(vm.wishList.date); + vm.update = function () { + if (masonry) { + masonry.update(); } + }; + + vm.addWish = function (wish) { + vm.wishes.push(wish); + vm.update(); + }; + + vm.resetFilter = function () { + vm.filterList("true"); + vm.search = ""; + }; + + vm.removeUser = function (user) { + var index = vm.wishList.users.indexOf(user); + if (index >= 0) vm.wishList.users.splice(index, 1); + }; + + vm.shareUser = function (newUser) { + if (!newUser.type) { + newUser.type = "SHARED"; + } + if (newUser.email && newUser.email.indexOf("@") > 0) { + var pushUser = {}; + pushUser.email = newUser.email.trim(); + pushUser.type = newUser.type; + vm.wishList.users.push(pushUser); + } + newUser = { email: "", type: "SHARED" }; + vm.newUser = newUser; + }; + vm.saveWishList = function (wishList) { + if (vm.newUser.email) { + vm.shareUser(vm.newUser); + } + wishListService.save(wishList, function (wishList) { + vm.wishList = wishList; + $("#share-list").modal("hide"); + $("#settings-list").modal("hide"); + hideModal(); + vm.editTitle = false; + updateDate(); + + UtilitiesServices.getList(true); + }); + }; + function updateDate() { + vm.wishList.dateTimeStamp = vm.wishList.date; + if (vm.wishList.date) vm.wishList.date = new Date(vm.wishList.date); + } + vm.selectedItems = null; - vm.selectedItems = null; - - vm.sortList = function (order) { - - vm.order = order.property; - vm.reverse = order.reverse; - - order.reverse = !order.reverse; - order.selected = true; - - if (vm.selectedItems) vm.selectedItems.selected = false; - - vm.selectedItems = order; + vm.sortList = function (order) { + vm.order = order.property; + vm.reverse = order.reverse; - vm.update(); - }; + order.reverse = !order.reverse; + order.selected = true; - var intervalUpdate; - var timeoutUpdate; - vm.refreshingLayoutAuto = function (delay, end) { - if (intervalUpdate) $interval.cancel(intervalUpdate); + if (vm.selectedItems) vm.selectedItems.selected = false; - intervalUpdate = $interval(function () { - // trigger layout - if (masonry) masonry.layout(); - }, delay, 50); + vm.selectedItems = order; - if (!end) end = 500; + vm.update(); + }; - timeoutUpdate = $timeout(function () { - vm.clearRefreshingLayoutAuto(); - }, end); - }; + var intervalUpdate; + var timeoutUpdate; + vm.refreshingLayoutAuto = function (delay, end) { + if (intervalUpdate) $interval.cancel(intervalUpdate); - vm.clearRefreshingLayoutAuto = function () { - if (intervalUpdate) $interval.cancel(intervalUpdate); - if (timeoutUpdate) $timeout.cancel(timeoutUpdate); - - intervalUpdate = null; + intervalUpdate = $interval( + function () { + // trigger layout if (masonry) masonry.layout(); - }; - - vm.refreshLayout = function (delay) { - vm.refreshingLayoutAuto(30, delay); - }; - - - vm.stampElement = function (id, refresh) { - if (!refresh) refresh = true; - var $element = $("#envie" + id); - // stamp or unstamp element to rest in place. - if (masonry && !masonry.stamps.indexOf($element)) { - if (masonry) masonry.stamp($element); - } - refresh && vm.refreshLayout(200); - - }; - - vm.unStampElement = function (id, refresh) { - if (!refresh) refresh = true; - var $element = $("#envie" + id); - // stamp or unstamp element to rest in place. - if (masonry && !masonry.stamps.indexOf($element)) { - if (masonry) masonry.unstamp($element); - } - refresh && vm.refreshLayout(200); - }; - + }, + delay, + 50 + ); + + if (!end) end = 500; + + timeoutUpdate = $timeout(function () { + vm.clearRefreshingLayoutAuto(); + }, end); + }; + + vm.clearRefreshingLayoutAuto = function () { + if (intervalUpdate) $interval.cancel(intervalUpdate); + if (timeoutUpdate) $timeout.cancel(timeoutUpdate); + + intervalUpdate = null; + if (masonry) masonry.layout(); + }; + + vm.refreshLayout = function (delay) { + vm.refreshingLayoutAuto(30, delay); + }; + + vm.stampElement = function (id, refresh) { + if (!refresh) refresh = true; + var $element = $("#envie" + id); + // stamp or unstamp element to rest in place. + if (masonry && !masonry.stamps.indexOf($element)) { + if (masonry) masonry.stamp($element); + } + refresh && vm.refreshLayout(200); + }; + + vm.unStampElement = function (id, refresh) { + if (!refresh) refresh = true; + var $element = $("#envie" + id); + // stamp or unstamp element to rest in place. + if (masonry && !masonry.stamps.indexOf($element)) { + if (masonry) masonry.unstamp($element); + } + refresh && vm.refreshLayout(200); + }; - vm.filterList = function (expr) { - vm.hasFilter = (expr !== "true"); + vm.filterList = function (expr) { + vm.hasFilter = expr !== "true"; - var expression = $parse(expr); - vm.filter = function (value) { - return expression(value); - }; - vm.update(); + var expression = $parse(expr); + vm.filter = function (value) { + return expression(value); }; + vm.update(); + }; - vm.searchList = function (reset) { - if (reset) { - vm.search = ''; - } - vm.update(); - }; - - vm.refresh = function () { - loadWishes(); - }; + vm.searchList = function (reset) { + if (reset) { + vm.search = ""; + } + vm.update(); + }; - /** - * Function to update a wish, whithout changing the js link. - * @param target - * @param source - */ - vm.updatePropertiesWish = function (target, source) { - if (!target && !source && target !== undefined) return; - /*for(var propertyName in source) { + vm.refresh = function () { + loadWishes(); + }; + + /** + * Function to update a wish, whithout changing the js link. + * @param target + * @param source + */ + vm.updatePropertiesWish = function (target, source) { + if (!target && !source && target !== undefined) return; + /*for(var propertyName in source) { // propertyName is what you want // you can get the value like this: myObject[propertyName] target[propertyName] = source[propertyName]; }*/ - target = angular.merge(target, source); - target.userTake = source.userTake; - updateWishUser(target); - return target; - }; - - function parseSentenceForNumber(sentence) { - var matches = sentence.replace(/,/g, '').match(/(\+|-)?((\d+(\.\d+)?)|(\.\d+))/); - return matches && matches[0] || null; + target = angular.merge(target, source); + target.userTake = source.userTake; + updateWishUser(target); + return target; + }; + + function parseSentenceForNumber(sentence) { + var matches = sentence + .replace(/,/g, "") + .match(/(\+|-)?((\d+(\.\d+)?)|(\.\d+))/); + return (matches && matches[0]) || null; + } + + vm.filterChild = function (filterChild) { + if (filterChild.type == "price") { + vm.filterPrice(filterChild.min, filterChild.max); + } else { + vm.filterList(filterChild.expression); } - - vm.filterChild = function (filterChild) { - if (filterChild.type == 'price') { - vm.filterPrice(filterChild.min, filterChild.max); - } else { - vm.filterList(filterChild.expression); + }; + + vm.filterPrice = function (min, max) { + vm.filter = function (value) { + var price = value.price; + if (!price) return false; + + var matches = price + .replace(",", ".") + .replace(" ", "") + .match(/(\d+\.?\d+|\.\d+)/g); + + if (!matches) return false; + + return matches.some(function (value) { + if (typeof value == "string") value = parseFloat(value); + if (value >= min && value <= max) { + return true; + } else if (max == null && value >= min) { + return true; } - }; - - vm.filterPrice = function (min, max) { - - vm.filter = function (value) { - var price = value.price; - if (!price) return false; - - var matches = price.replace(',', '.').replace(' ', '').match(/(\d+\.?\d+|\.\d+)/g); - - if (!matches) return false; + return false; + }); - return matches.some(function (value) { - if (typeof value == 'string') value = parseFloat(value); - if (value >= min && value <= max) { - return true; - } else if (max == null && value >= min) { - return true; - } - return false; - }); - - return false; - }; - - vm.update(); + return false; }; - vm.deleteWish = function (wish) { - var index = vm.wishes.indexOf(wish); - if (index > -1) - vm.wishes.splice(index, 1); - vm.update(); - }; + vm.update(); + }; - vm.reloadWishList = function() { - vm.wishList = loadWishList(vm.name); - loadWishes(); - }; + vm.deleteWish = function (wish) { + var index = vm.wishes.indexOf(wish); + if (index > -1) vm.wishes.splice(index, 1); + vm.update(); + }; - function gotoForm() { - // call $anchorScroll() - $anchorScroll('formEdit'); - } - - function gotoWish(id) { - // set the location.hash to the id of - // the element you wish to scroll to. - $location.hash('envie' + id); - - // call $anchorScroll() - $anchorScroll(); - } + vm.reloadWishList = function () { + vm.wishList = loadWishList(vm.name); + loadWishes(); + }; + + function gotoForm() { + // call $anchorScroll() + $anchorScroll("formEdit"); + } + + function gotoWish(id) { + // set the location.hash to the id of + // the element you wish to scroll to. + $location.hash("envie" + id); + + // call $anchorScroll() + $anchorScroll(); + } + + function resetForm() { + vm.newWish = {}; + } + + function loadUser(email) { + var foundUser = { email: email, name: "" }; + angular.forEach(vm.wishList.users, function (user) { + if (user.email == email) { + foundUser.name = user.name; + } + }); + return foundUser; + } + + vm.userName = function (email) { + return loadUser(email).name; + }; + + vm.renameWishList = function (oldName, newName) { + vm.renameWishListExist = false; + vm.doingRenameWishList = true; + wishListService + .rename({ name: oldName, new: newName }, {}) + .$promise.then(function () { + $("#change-url").modal("hide"); + hideModal(); + $location.url("/" + newName); + }) + .catch(function (reason) { + console.log(reason); + vm.renameWishListExist = true; + vm.doingRenameWishList = false; + }); + }; + + function loadWishList(name) { + return wishListService.get({ name: name }).$promise.then(function (value) { + if (value.date) { + value.date = new Date(value.date); + } + // updateDate(); + vm.wishList = value; + return value; + }); + } - function resetForm() { - vm.newWish = {}; + var updateWishUser = function (item) { + if (item.owner) { + item.ownerUser = (item.owner || loadUser(item.owner.email)).name; } - - function loadUser(email) { - var foundUser = {email: email, name: ''}; - angular.forEach(vm.wishList.users, function (user) { - if (user.email == email) { - foundUser.name = user.name; - } - }); - return foundUser; + if (item.userTake && item.userTake.length > 0) { + var userTakeNames = []; + angular.forEach( + item.userTake, + function (user) { + this.push((user || loadUser(user)).name); + }, + userTakeNames + ); + item.userTakeUsers = userTakeNames.join(", "); + } else { + //delete item.userTake; + delete item.userTakeUsers; } + }; - vm.userName = function (email) { - return loadUser(email).name; - }; - - vm.renameWishList = function(oldName, newName) { - vm.renameWishListExist = false; - vm.doingRenameWishList = true; - wishListService.rename({name:oldName, new:newName},{}).$promise.then(function() { - $("#change-url").modal("hide"); - hideModal(); - $location.url("/" + newName); - }).catch(function (reason) { console.log(reason); vm.renameWishListExist = true; vm.doingRenameWishList = false;}) - }; - - function loadWishList(name) { - return wishListService.get({name: name}).$promise.then(function (value) { - - if (value.date) { - value.date = new Date(value.date); - } - // updateDate(); - vm.wishList = value; - return value; - }); + function loadWishes() { + var firstLoad = false; + if (!vm.wishes) { + vm.wishes = []; + firstLoad = true; } - - var updateWishUser = function (item) { - if (item.owner) { - item.ownerUser = (item.owner || loadUser(item.owner.email)).name; - } - if (item.userTake && item.userTake.length > 0) { - var userTakeNames = []; - angular.forEach(item.userTake, function (user) { - this.push((user || loadUser(user)).name); - }, userTakeNames); - item.userTakeUsers = userTakeNames.join(", "); + var newWishes = wishService.query({ name: $routeParams.name }); + newWishes.$promise.then(function (list) { + vm.loading = false; + vm.refreshingLayoutAuto(100, 800); + angular.forEach(list, function (item) { + // add to vm.wishes + var foundwish = $filter("filter")(vm.wishes, { id: item.id }); + updateWishUser(item); + + if (foundwish.length) { + vm.updatePropertiesWish(foundwish[0], item); } else { - //delete item.userTake; - delete item.userTakeUsers; + vm.wishes.push(item); } - }; + }); - function loadWishes() { - var firstLoad = false; - if (!vm.wishes) { - vm.wishes = []; - firstLoad = true; - } - var newWishes = wishService.query({name: $routeParams.name}); - newWishes.$promise.then(function (list) { - vm.loading = false; - vm.refreshingLayoutAuto(100, 800); - angular.forEach(list, function (item) { - // add to vm.wishes - var foundwish = $filter('filter')(vm.wishes, {id: item.id}); - updateWishUser(item); - - if (foundwish.length) { - vm.updatePropertiesWish(foundwish[0], item); - } else { - vm.wishes.push(item); - } - }); - - vm.sortList(vm.orderProperties.find(function (value) { - return value.selected - })); - - //vm.update(); - //vm.clearRefreshingLayoutAuto(); - if (firstLoad) vm.update(); - - $.material.init(); - }); - } + vm.sortList( + vm.orderProperties.find(function (value) { + return value.selected; + }) + ); + //vm.update(); + //vm.clearRefreshingLayoutAuto(); + if (firstLoad) vm.update(); - $scope.$on('$viewContentLoaded', function () { - $.material.init(); + $.material.init(); + }); + } - vm.refreshLayout(10000); + $scope.$on("$viewContentLoaded", function () { + $.material.init(); - $('[data-toggle="tooltip"]').tooltip(); - }); + vm.refreshLayout(10000); - //Bug in modal - function hideModal() { - $('body').removeClass('modal-open'); - $('.modal-backdrop').remove(); - } - hideModal(); -} \ No newline at end of file + $('[data-toggle="tooltip"]').tooltip(); + }); + + //Bug in modal + function hideModal() { + $("body").removeClass("modal-open"); + $(".modal-backdrop").remove(); + } + hideModal(); +} diff --git a/liste-envies-war/src/main/webapp/js/directive/WishListSettings.js b/liste-envies-war/src/main/webapp/js/directive/WishListSettings.js index 24eb51ee..f06b4cab 100644 --- a/liste-envies-war/src/main/webapp/js/directive/WishListSettings.js +++ b/liste-envies-war/src/main/webapp/js/directive/WishListSettings.js @@ -1,51 +1,55 @@ -angular.module('ListeEnviesDirectives') - .directive('wishListSettings', function () { - return { - restrict: 'E', - templateUrl: 'templates/directive/WishListSettings.html', - bindToController: true, - controllerAs: 'w', - controller: WishListSettings, - scope: { - 'wishList': '=', - 'backgroundChange': '&' - } - }; - }); +angular + .module("ListeEnviesDirectives") + .directive("wishListSettings", function () { + return { + restrict: "E", + templateUrl: "templates/directive/WishListSettings.html", + bindToController: true, + controllerAs: "w", + controller: WishListSettings, + scope: { + wishList: "=", + backgroundChange: "&", + }, + }; + }); -WishListSettings.$inject = ['WishListTypePicture']; +WishListSettings.$inject = ["WishListTypePicture"]; function WishListSettings(WishListTypePicture) { - var vm = this; - vm.WishListTypePicture = WishListTypePicture; - vm.editorOptions = { - disableDragAndDrop: true, - disableResizeEditor: true, - placeholder: "Ajouter une description", - toolbar: [ - ['style', ['bold', 'italic', 'underline', 'clear', 'color', 'fontsize']], - ['para', ['ul', 'ol', 'paragraph']] + var vm = this; + vm.WishListTypePicture = WishListTypePicture; + vm.editorOptions = { + disableDragAndDrop: true, + disableResizeEditor: true, + placeholder: "Ajouter une description", + toolbar: [ + ["style", ["bold", "italic", "underline", "clear", "color", "fontsize"]], + ["para", ["ul", "ol", "paragraph"]], + ["insert", ["link", "picture"]], + ], + popover: { + image: [ + ["imagesize", ["imageSize100", "imageSize50", "imageSize25"]], + ["float", ["floatLeft", "floatRight", "floatNone"]], + ["remove", ["removeMedia"]], + ], + link: [["link", ["linkDialogShow", "unlink"]]], + air: [ + [ + "style", + ["bold", "italic", "underline", "clear", "color", "fontsize"], ], - popover: { - image: [ - ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']], - ['float', ['floatLeft', 'floatRight', 'floatNone']], - ['remove', ['removeMedia']] - ], - link: [ - ['link', ['linkDialogShow', 'unlink']] - ], - air: [ - ['style', ['bold', 'italic', 'underline', 'clear', 'color', 'fontsize']], - ['para', ['ul', 'ol', 'paragraph']] - ] - }, - height: 100 - }; - vm.changeBackground = function(picture) { - vm.wishList.picture = picture; - if (!picture) { - return; - } - vm.backgroundChange({picture:picture}); + ["para", ["ul", "ol", "paragraph"]], + ["insert", ["link", "picture"]], + ], + }, + height: 100, + }; + vm.changeBackground = function (picture) { + vm.wishList.picture = picture; + if (!picture) { + return; } -} \ No newline at end of file + vm.backgroundChange({ picture: picture }); + }; +} diff --git a/liste-envies-war/src/main/webapp/js/lang/fr-FR.json b/liste-envies-war/src/main/webapp/js/lang/fr-FR.json index 1b41a35d..151e4c92 100644 --- a/liste-envies-war/src/main/webapp/js/lang/fr-FR.json +++ b/liste-envies-war/src/main/webapp/js/lang/fr-FR.json @@ -109,13 +109,13 @@ "INPUT_PRICE": "Prix", "EDIT": "@:COMMONS.EDIT", "EDIT_OTHER_OPTIONS": "Autres options", - "EDIT_OPTIONS_RECEIVED": "Reçu", + "EDIT_OPTIONS_RECEIVED": "Reçu (archiver)", "EDIT_OPTIONS_DELETE": "Supprimer", "EDIT_OPTIONS_COPY": "Copier", "OFFERED_BY": "Offert par {{name}}    ", "OFFERED": "Déjà offert", "PARTICIPATE": "Participer", - "GIVEN": "Offert", + "GIVEN": "Offert (archiver)", "TO_OFFER": "Offrir", "COMMENTS": "Commmentaires ({{comment_number || 0}})", "ADD_COMMENTS_LABEL": "Ajouter un commmentaire", @@ -176,6 +176,7 @@ "PUBLIC": "La liste peut être affiché sans être connecté par toute personne connaissant le lien. Il est nécessaire de se connecter pour interagir avec, et voir si une envie est prise.
Toutes les personnes connectés (bénéficiaires compris) voient qui donne une envie.", "DEFAULT": "Selectionnez la visibilité de la liste" }, + "FORCE_ANONYMOUS": "Afficher de manière anonyme si l'envies est déjà offerte.", "DATE": "Date de l'événement", "DATE_INFO": "Pour afficher un compte à rebours jusqu'à l'événement" }, diff --git a/liste-envies-war/src/main/webapp/templates/directive/WishCard.html b/liste-envies-war/src/main/webapp/templates/directive/WishCard.html index ad4ee9f2..eeee09d1 100644 --- a/liste-envies-war/src/main/webapp/templates/directive/WishCard.html +++ b/liste-envies-war/src/main/webapp/templates/directive/WishCard.html @@ -1,189 +1,529 @@ -
- - - - - - - +
+ + + + + + + -