From da8ed560f5c41f40fac85fe5a97dbcbb125b5777 Mon Sep 17 00:00:00 2001 From: EEA Jenkins <2368628+eea-jenkins@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:29:42 +0200 Subject: [PATCH 01/11] Back to devel --- docs/HISTORY.txt | 3 +++ src/wise/msfd/version.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index b38a12a9..48c52c5d 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -1,6 +1,9 @@ Changelog ========= +7.3-dev0 - (unreleased) +--------------------------- + 7.2 - (2026-03-19) --------------------------- * Change: Release diff --git a/src/wise/msfd/version.txt b/src/wise/msfd/version.txt index 5904f7ad..95faf0b8 100644 --- a/src/wise/msfd/version.txt +++ b/src/wise/msfd/version.txt @@ -1 +1 @@ -7.2 +7.3-dev0 From 35d757030af844a47f15f44f2e4a5e85b727b5d8 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Thu, 19 Mar 2026 13:06:14 +0200 Subject: [PATCH 02/11] fix: MSFD search css small fix --- src/wise/msfd/pt/mainform.pt | 4 ++-- src/wise/msfd/static/wise/dist/css/msfd_search.css | 2 +- src/wise/msfd/static/wise/src/less/search-form.less | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/wise/msfd/pt/mainform.pt b/src/wise/msfd/pt/mainform.pt index 3030fd68..42803cb0 100755 --- a/src/wise/msfd/pt/mainform.pt +++ b/src/wise/msfd/pt/mainform.pt @@ -32,8 +32,8 @@ - - + + diff --git a/src/wise/msfd/static/wise/dist/css/msfd_search.css b/src/wise/msfd/static/wise/dist/css/msfd_search.css index 162cc25d..418ad5df 100644 --- a/src/wise/msfd/static/wise/dist/css/msfd_search.css +++ b/src/wise/msfd/static/wise/dist/css/msfd_search.css @@ -1 +1 @@ -.wise-search-form-container dl{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.wise-search-form-container{position:relative;opacity:0}.wise-search-form-container .form-right-side .row{display:-ms-flexbox;display:flex;gap:1em}#wise-search-form-container-preloader,#wise-search-form-preloader{position:fixed;z-index:1000;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,0.2)}.active-filters-section{border:1px solid #e6e7e8;background-color:#f9f9f9;padding:1em;margin:1em 0}.active-filters-section .active-filters-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.8em;cursor:pointer}.active-filters-section .active-filters-header i{position:relative;top:-2px}.active-filters-section .active-filters-header .active-filters-title{margin-bottom:0}.active-filters-section .active-filter-group{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline;padding:8px 15px;margin-top:10px;margin-right:11px;background-color:#ebebeb;font-size:15px;gap:.7em}.active-filters-section .filter-group-title{font-weight:500}.active-filters-section .active-filter-item{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:4px}.active-filters-section .clear-filter{padding:2px 3px;line-height:.5;cursor:pointer;border:1px solid #0079cf;box-shadow:none !important;border-radius:3px;margin:0;background:transparent}.active-filters-section .clear-filter:hover{background-color:transparent}.active-filters-section .clear-filter i{font-size:10px;color:#0079cf}.form-check-input{margin-top:6px}.form-label{font-size:14px;font-weight:500;margin-bottom:5px}.wise-search-form-container,#wise-search-form{opacity:0}.wise-search-form-container .subform,#wise-search-form .subform{margin-top:0}.wise-search-form-container .subform h3#article-id,#wise-search-form .subform h3#article-id{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;border-bottom:2px solid #52616f;margin:0;font-size:18px;font-weight:500}.wise-search-form-container .subform h3#article-id .article-id-country,#wise-search-form .subform h3#article-id .article-id-country{font-size:26px}.wise-search-form-container .subform #mru-select-prev-next-wrapper,#wise-search-form .subform #mru-select-prev-next-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between}.wise-search-form-container table.table-report tr:last-child th,#wise-search-form table.table-report tr:last-child th{border-bottom:none}.wise-search-form-container table.listing,#wise-search-form table.listing{width:100%;border:none}.wise-search-form-container table.listing th,#wise-search-form table.listing th{font-weight:600;text-align:left;border-bottom:1px solid #0079cf}.wise-search-form-container table.listing th:not(:last-child),#wise-search-form table.listing th:not(:last-child){border-right:1px solid #0079cf}.wise-search-form-container table.listing td,#wise-search-form table.listing td{background-color:white}.wise-search-form-container table.listing td:not(:last-child),#wise-search-form table.listing td:not(:last-child){border-right:1px solid #0079cf}.wise-search-form-container table.listing tr:not(:last-child) td,#wise-search-form table.listing tr:not(:last-child) td{border-bottom:1px solid #acbac7}.wise-search-form-container table.listing th,#wise-search-form table.listing th,.wise-search-form-container table.listing td,#wise-search-form table.listing td{min-width:10rem;padding:.5em}.wise-search-form-container table.listing th.fixed-position,#wise-search-form table.listing th.fixed-position,.wise-search-form-container table.listing td.fixed-position,#wise-search-form table.listing td.fixed-position{position:absolute;background-color:white;width:15rem;color:inherit;margin-left:-15.1rem}.wise-search-form-container table.listing.table-report,#wise-search-form table.listing.table-report{margin-bottom:0;margin-left:15rem}.wise-search-form-container .pagination-text,#wise-search-form .pagination-text{display:inline-block;margin-top:2rem;margin-bottom:2rem;font-size:14px;font-weight:500}.wise-search-form-container .pagination-text>span,#wise-search-form .pagination-text>span{color:#444;font-weight:800}.wise-search-form-container .pagination-text.bottom,#wise-search-form .pagination-text.bottom{padding:.2rem .5rem;margin:0}.wise-search-form-container .pagination-text .pagination-input,#wise-search-form .pagination-text .pagination-input{display:inline-block;max-width:50px;height:auto;padding:0 6px;border:1px solid #ccc;margin-right:5px;margin-left:5px}.wise-search-form-container .pagination-text .pagination-result,#wise-search-form .pagination-text .pagination-result{display:inline-block;padding:0 8px;border:1px solid #ccc;background-color:white;cursor:pointer;line-height:22px;text-decoration:underline}.wise-search-form-container .panel-heading,#wise-search-form .panel-heading{padding:10px 15px}.wise-search-form-container .panel-title>a,#wise-search-form .panel-title>a,.wise-search-form-container .panel-title>small,#wise-search-form .panel-title>small,.wise-search-form-container .panel-title>.small,#wise-search-form .panel-title>.small,.wise-search-form-container .panel-title>small>a,#wise-search-form .panel-title>small>a,.wise-search-form-container .panel-title>.small>a,#wise-search-form .panel-title>.small>a{color:inherit}.wise-search-form-container .btn-default,#wise-search-form .btn-default{padding:1px 6px !important;border-color:#29a2d9;background-color:#004b7f;color:white !important;font-size:10px}.wise-search-form-container .ui.button.close,#wise-search-form .ui.button.close{padding:.5rem .8rem}.wise-search-form-container .btn,#wise-search-form .btn{display:inline-block;border-color:#cbcbcb;margin-bottom:0;border-radius:4px;color:#3a3a3a;cursor:pointer;font-size:15px;text-align:center;vertical-align:middle;white-space:nowrap}.wise-search-form-container .panel-group,#wise-search-form .panel-group{margin-bottom:10px}.wise-search-form-container dl,#wise-search-form dl{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-flow:row wrap;flex-flow:row wrap}.wise-search-form-container dl dt:last-of-type,#wise-search-form dl dt:last-of-type,.wise-search-form-container dl dd:last-of-type,#wise-search-form dl dd:last-of-type{border-bottom:none}.wise-search-form-container dt,#wise-search-form dt{width:25%;border-right:1px solid #0079cf;clear:left;float:left;font-weight:500;padding-top:.4rem}.wise-search-form-container dt:not(:last-child),#wise-search-form dt:not(:last-child){border-bottom:1px solid #0079cf}.wise-search-form-container dd,#wise-search-form dd{overflow:auto;width:100%;margin:0;max-width:75%;max-height:200px;padding:.4rem}.wise-search-form-container dd:not(:last-child),#wise-search-form dd:not(:last-child){border-bottom:1px solid #acbac7}.wise-search-form-container .tab-content,#wise-search-form .tab-content{padding-top:10px}.wise-search-form-container [data-fieldname='form.widgets.page'],#wise-search-form [data-fieldname='form.widgets.page']{border-bottom:none}.option label{display:inline-block;overflow:hidden;max-width:80%;margin-bottom:0;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.controls .label{display:inline-block;padding:0 10px;color:black;font-size:12px;font-weight:500}.controls a .label{color:black}.controls a .label:hover{color:#069;cursor:pointer}.controls a:hover{color:white}.controls .apply-filters{display:none;width:80px;padding:.2rem .5rem !important;margin-bottom:1em;font-size:11px;border:none}.controls .apply-filters span{font-weight:500}.controls .ui-autocomplete{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%;-ms-flex-direction:row;flex-direction:row;margin-top:.5rem}.controls .ui-autocomplete .ui-autocomplete-input{display:inline-block;width:100%;height:auto;padding:5px;box-shadow:none;border:1px solid #ccc;border-radius:4px;height:30px}.controls .ui-autocomplete .clear-btn{position:absolute;top:5px;right:5px;cursor:pointer}.controls .ui-autocomplete .clear-btn:active{transform:rotate(30deg)}.controls .ui-autocomplete .clear-btn:after{padding:3px;content:'\e014';font-family:'Glyphicons Halflings';font-size:12px}.controls>span{font-size:12px}.controls .search-span{position:relative;-ms-flex:1;flex:1}.field .noresults{padding-left:5px}.field>span{position:relative;display:block;max-height:195px;overflow-x:hidden;overflow-y:auto}.field label.horizontal{padding-left:0}.field label.horizontal:after{content:none}.field label.horizontal span.required span:after{content:none}.field label.horizontal.collapsed{border:1px solid #337ab7}.field label.horizontal a{text-decoration:none}.field label.horizontal a:hover{text-decoration:none}.wise-search-form-container ul.topnav li a,#wise-search-form ul.topnav li a{padding:6px}.wise-search-form-container ul.topnav li:first-child a>span:nth-child(2),#wise-search-form ul.topnav li:first-child a>span:nth-child(2){white-space:nowrap}.wise-search-form-container #marine-unit-nav,#wise-search-form #marine-unit-nav{height:3rem;margin-top:2rem;margin-bottom:2rem;clear:both;float:left}.wise-search-form-container div#item-title-wrapper,#wise-search-form div#item-title-wrapper{display:inline-block;width:100%;margin-bottom:1rem;text-align:center}.wise-search-form-container .reported-date,#wise-search-form .reported-date{padding:0 1rem;color:#7d7d7d;font-size:smaller;text-align:center}.wise-search-form-container #form-data-primary,#wise-search-form #form-data-primary{margin-top:2rem}.wise-search-form-container #marine-widget-top,#wise-search-form #marine-widget-top{margin-top:.8em}.wise-search-form-container #marine-widget-top #form-buttons-prev-top,#wise-search-form #marine-widget-top #form-buttons-prev-top{position:relative;float:left}.wise-search-form-container #marine-widget-top #form-buttons-next-top,#wise-search-form #marine-widget-top #form-buttons-next-top{margin-left:2px}.wise-search-form-container #marine-widget-top #marine-unit-trigger .text-trigger,#wise-search-form #marine-widget-top #marine-unit-trigger .text-trigger{border:none;text-decoration:underline}.wise-search-form-container #marine-widget-top .widget,#wise-search-form #marine-widget-top .widget{display:block;width:100%;margin:0}.wise-search-form-container #marine-widget-top .widget .select2-container .select2-chosen,#wise-search-form #marine-widget-top .widget .select2-container .select2-chosen{text-shadow:2px 1px 1px #ccc}.wise-search-form-container #marine-widget-top .widget .select2-container .select2-choice,#wise-search-form #marine-widget-top .widget .select2-container .select2-choice{padding-top:8px;padding-bottom:8px;margin-bottom:-4px}.wise-search-form-container #marine-widget-top .field,#wise-search-form #marine-widget-top .field{border:none;margin:0 auto}.wise-search-form-container #marine-widget-top .field>h4,#wise-search-form #marine-widget-top .field>h4{display:inline-block;margin-top:5px;margin-right:.5em;margin-bottom:2px;font-size:1em;font-weight:500}.item-subform .double-scroll{overflow:auto}.extra-details{padding-top:.7rem}.extra-details .extra-details-section{overflow:auto}.extra-details .extra-details-section .section-title{margin-top:1.5rem;font-weight:500}.extra-details .extra-details-section:not(:first-child){padding-top:1.5rem}.extra-details .extra-details-select{max-width:250px}.extra-details.notselect table.listing{margin-bottom:2rem}.label{color:#555}.label span{display:inline}#wise-search-form-container .hidden{display:none !important}.wise-search-form-container div.formControls,#wise-search-form div.formControls{position:relative;margin-left:0}.wise-search-form-container div.formControls input,#wise-search-form div.formControls input{margin:2px}#mobile-select-article{border:2px solid #004b7f !important;background:white;color:#004b7f;border-radius:5px !important;border:none;padding:.3em .5em;box-shadow:none;font-weight:500;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:15px;width:220px !important}#mobile-select-article option{width:220px !important}#wise-search-form div.formControls [name='form.buttons.next']{position:absolute;right:0}#wise-search-form .form-buttons-next-row,#wise-search-form .form-buttons-prev-row{display:inline-block}#wise-search-form .form-buttons-next-row .label,#wise-search-form .form-buttons-prev-row .label{padding:0}#wise-search-form .prev-next-row .form-buttons-next,#wise-search-form .prev-next-row .form-buttons-prev{background-color:#004b7f;color:white;border:none;border-radius:0;padding:0 8px !important}#wise-search-form .prev-next-row .form-buttons-next:hover,#wise-search-form .prev-next-row .form-buttons-prev:hover{background-color:#0071b3;color:white}.msfd-heading{margin:2em 0 1em 0}.prev-next-row{margin-top:.8em;margin-left:auto}.prev-next-row>span{display:block}.prev-next-row.prev-next-row-bottom{text-align:right}@media (min-width:1199px) and (max-width:1200px){.wise-search-form-container>ul.topnav li,#wise-search-form>ul.topnav li{width:30%}#marine-widget-top{max-width:60%}}@media (max-width:992px){#form-buttons-next-top{margin-left:0 !important}#marine-widget-top{max-width:50%}#marine-widget-top .select-article{clear:none;float:none}#marine-widget-top .select-article .field{text-align:left !important}#marine-widget-top .select-article .select2-choice{margin-bottom:-8px !important}.toggle-sidebar{margin-bottom:20px}}@media (max-width:768px){.wise-search-form-container dt,#wise-search-form dt{border-bottom:none !important;border-right:none !important}.wise-search-form-container dd,#wise-search-form dd{max-width:100%;padding:.4rem 0}#marine-widget-top .select-article{width:100% !important;clear:both;float:left}#marine-widget-top .select-article .field{width:100%;text-align:left !important}#marine-widget-top .select-article .field .widget{display:block !important;width:50%;padding-bottom:2px;margin-left:0 !important;clear:both}.prev-next-row{clear:both}ul.nav li a{overflow:inherit !important;text-overflow:none !important;white-space:inherit !important}.extra-details{padding-top:0}.extra-details h4{padding-top:0}.extra-details .extra-details-section{margin-top:0}}.clear-break{overflow:hidden;clear:both}.pagination-prev:before{content:'\f104';font:normal normal normal 16px/1 FontAwesome}.pagination-next:after{content:'\f105';font:normal normal normal 16px/1 FontAwesome}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;border-radius:3px;font-size:12px;line-height:1.5}#ajax-spinner-form{position:fixed;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.label{display:inline-block;padding:.6em .5em;border-radius:.25em;font-size:13px;font-weight:500;line-height:1.2;text-align:left}.msfd-search-wrapper .msfd-filters-on-top{color:#3d5265}.msfd-search-wrapper .msfd-filters-on-top .article-select label,.msfd-search-wrapper .msfd-filters-on-top .form-right-side label{font-size:14px;font-weight:500;margin-bottom:5px;display:-ms-flexbox;display:flex}.msfd-search-wrapper .msfd-filters-on-top .article-select{max-width:250px}.msfd-search-wrapper .msfd-filters-on-top .form-right-side{display:-ms-flexbox;display:flex;gap:1rem;-ms-flex-align:end;align-items:flex-end}.msfd-search-wrapper .msfd-filters-on-top .panel-content{position:absolute;bottom:auto !important;min-width:350px;max-width:400px;padding:1em;border-bottom:.5px solid #4c677f;background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,0.25)}.msfd-search-wrapper .msfd-filters-on-top .panel-content.open{z-index:99 !important}.msfd-search-wrapper .msfd-filters-on-top .panel-title{padding:.8em 1em;font-size:16px !important;font-weight:normal !important;position:relative;display:block !important;background-color:#fff;margin:0 !important}.msfd-search-wrapper .msfd-filters-on-top .panel-title:after{content:'\f107' !important;font:normal normal normal 16px/1 FontAwesome}.msfd-search-wrapper .msfd-filters-on-top .panel-title.open{z-index:999 !important;box-shadow:0 5px 0 #fff,0 0 4px rgba(0,0,0,0.25)}.msfd-search-wrapper .msfd-filters-on-top .panel-default{position:relative;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;width:auto;max-height:200px;min-height:60px;display:block;overflow:auto;margin-top:.5em}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform{display:-ms-flexbox;display:flex;gap:1rem}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform .option{border:none}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform .option label{max-width:90%}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform .option .label{padding:.5em .3em}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform>.field{border:none;max-width:250px}#form-buttons-download{margin-top:2rem}.wise-search-form-container .panel-heading .accordion-toggle:after,#wise-search-form .panel-heading .accordion-toggle:after,#marine-unit-trigger .text-trigger:after{content:'\f107' !important;font:normal normal normal 16px/1 FontAwesome}#wise-search-form .panel-heading .accordion-toggle.accordion-after:after{font-size:25px}.controls .ui-autocomplete .clear-btn:after{content:'\f00d';font:normal normal normal 14px/1 FontAwesome}dd{margin-left:0}.wise-search-form-container .btn,#wise-search-form .btn{border-width:1px}.wise-search-form-container .field{margin:1em 0;position:relative}#wise-search-form .field{padding-bottom:1em;margin:1em 0}.select2-container{width:100% !important}.dimmer{position:fixed;background-color:rgba(249,249,249,0.4);top:0 !important;left:0 !important;width:100%;height:100%;z-index:9}.subform>.field{border-bottom:1px solid rgba(0,0,0,0.1)}.form-right-side .subform>.field{border-bottom:none !important}.ui-helper-hidden-accessible{display:none}table{width:100%;border-collapse:collapse}#wise-search-form table.listing th{font-weight:600;text-align:left}.tab-panel .listing{font-size:16px}#wise-search-form #a11dataaccessdisplay2020 dl{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-direction:column;flex-direction:column}#wise-search-form #a11dataaccessdisplay2020 dt{border:none !important;font-size:18px;font-weight:600;font-family:'Roboto';margin-bottom:10px;color:#002d54}#wise-search-form #a11dataaccessdisplay2020 dd{max-height:none}.select2-container{width:100%}.select2-container--open .select2-dropdown--below,.select2-container--open .select2-dropdown--above{background:#009966}.select2-container--flat .select2-container--focus .select2-selection--multiple{border:1px solid #006699}.select2-container--flat .select2-results__option--highlighted[aria-selected]{background:#006699 !important;color:#ffffff}.select2-container--flat .select2-results__option[aria-selected='true']{background:#006699;color:#fff;opacity:.8}.select2-container--flat .select2-selection--single{border-radius:0}.select2-container--flat.select2-container--open .select2-selection__arrow b{transform:rotate(180deg)}.select2-container--flat span.select2-search input{height:30px !important}.form-select{border:none;padding:0;background-image:none}.form-select.select-widget.choice-field{margin-bottom:1em}.msfd-search-wrapper .select2-container .select2-choice,#wise-search-form .select2-container .select2-choice,#wise-search-form-container .select2-container .select2-choice{height:auto !important;border:2px solid #004b7f !important;background:white;color:#004b7f;border-radius:5px !important;border:none;padding:.3em .5em;box-shadow:none;font-weight:500;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:15px}.msfd-search-wrapper .select2-container .select2-choice div,#wise-search-form .select2-container .select2-choice div,#wise-search-form-container .select2-container .select2-choice div{border-left:1px solid #dce4ec;background-clip:padding-box;border-radius:0 4px 4px 0}.msfd-search-wrapper .select2-container .select2-choice .select2-arrow,#wise-search-form .select2-container .select2-choice .select2-arrow,#wise-search-form-container .select2-container .select2-choice .select2-arrow{border:0;background:transparent;background-image:none;border-radius:0;position:relative}.msfd-search-wrapper .select2-container .select2-choice .select2-arrow:after,#wise-search-form .select2-container .select2-choice .select2-arrow:after,#wise-search-form-container .select2-container .select2-choice .select2-arrow:after{content:'\f107' !important;font:normal normal normal 16px/1 FontAwesome}.msfd-search-wrapper .select2-container .select2-choice .select2-arrow b,#wise-search-form .select2-container .select2-choice .select2-arrow b,#wise-search-form-container .select2-container .select2-choice .select2-arrow b{background:none}.msfd-search-wrapper .select2-container *:focus,#wise-search-form .select2-container *:focus,#wise-search-form-container .select2-container *:focus{outline:0}.msfd-search-wrapper .select2-container.select2-drop-above .select2-choice,#wise-search-form .select2-container.select2-drop-above .select2-choice,#wise-search-form-container .select2-container.select2-drop-above .select2-choice{border-bottom-color:#dce4ec;border-radius:0}.select2-drop{border:1px solid #dce4ec !important;border-top:0 !important;margin-top:-2px !important;border-radius:0 !important;border-radius:0 0 6px 6px !important;box-shadow:none !important}.select2-drop.select2-drop-above{border-top:2px solid #dce4ec !important;border-bottom:0;margin-top:2px;border-radius:6px 6px 0 0;box-shadow:none}.select2-search{border-top:1px solid #dce4ec}.select2-search input{height:26px;border:1px solid #dce4ec;margin-bottom:5px}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid #dce4ec;box-shadow:none;outline:none}.select2-dropdown-open .select2-choice{border-bottom-left-radius:0;border-bottom-right-radius:0;box-shadow:none}.select2-dropdown-open .select2-choice .select2-choice div{border-left:none;background:transparent;filter:none}.select2-results{padding:0;margin:0}.select2-results .select2-highlighted{background:#ededed !important;border-radius:0;color:inherit !important}.select2-container-multi .select2-choices{height:auto !important;height:1%;border:1px solid #dce4ec}.select2-container-multi.select2-container-active .select2-choices{border:1px solid #dce4ec;border-radius:6px;box-shadow:none}.select2-container--flat .select2-selection--single{height:34px;border:0;background:#009966}.select2-container--flat .select2-selection--single .select2-selection__rendered{color:#fff;line-height:34px}.select2-container--flat .select2-selection--single .select2-selection__arrow{position:absolute;top:1px;right:1px;width:20px;height:26px}.select2-container--flat .select2-selection--single .select2-selection__arrow b{position:absolute;top:60%;left:50%;width:0;height:0;border-width:5px 4px 0 4px;border-style:solid;border-color:#fff transparent transparent transparent;margin-top:-2px;margin-left:-4px}.select2-container--flat .select2-selection--single .select2-selection__placeholder{color:#fff}.select2-container--flat .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--flat .select2-selection--multiple{border:1px solid #006699}.select2-container--flat .select2-selection--multiple .select2-selection__choice__remove:hover{color:#006699;cursor:pointer}.select2-container--flat .select2-selection--multiple .select2-selection__rendered{width:100%;box-sizing:border-box;padding:0 5px;margin:0;list-style:none}.select2-container--flat .select2-selection--multiple .select2-selection__choice{padding:3px 5px;border:1px solid #009966;margin-top:5px;margin-right:5px;background-color:#009966;border-radius:0;color:#fff;cursor:default;float:left}.select2-container--flat .select2-selection--multiple .select2-selection__choice__remove{margin-right:6px;margin-left:6px;color:#006699;float:right}.select2-results{padding:0 !important;margin:0 !important}.select2-result-label{padding:.3em .4em !important;min-height:auto;font-size:15px}#marine-unit-trigger{display:inline-block;max-width:100%;border-spacing:2rem;background:none !important}#marine-unit-trigger:hover{cursor:pointer}#marine-unit-trigger a{position:relative;display:block;padding-top:2px;padding-right:0;padding-bottom:5px;padding-left:0;border-bottom:1px solid rgba(0,0,0,0.1);color:#444;font-size:1.5em;font-weight:bold;line-height:2.5rem;text-decoration:none;text-shadow:2px 1px 1px #ccc}#marine-unit-trigger .arrow-left-container{position:absolute;top:0;left:0;display:block;width:10%;height:100%}#marine-unit-trigger .arrow-left-container .arrow-left{position:absolute;left:0;display:inline-block;width:auto;margin-right:10px}#marine-unit-trigger .arrow-left-container .arrow-left:after{position:absolute;top:50%;left:0;color:#0071b3;content:'\f053';font-family:FontAwesome;font-weight:normal}#marine-unit-trigger .text-trigger{display:inline-block;padding:0;border:1px solid #ddd;text-decoration:none !important}#marine-unit-trigger .text-trigger:after{margin-left:5px;content:'\f107';font:normal normal normal 16px/1 FontAwesome}#marine-unit-trigger .arrow-right-container{position:absolute;top:0;right:0;display:table-cell;width:10%;height:100%}#marine-unit-trigger .arrow-right-container .arrow-right{position:absolute;left:3px;display:inline-block;width:auto}#marine-unit-trigger .arrow-right-container .arrow-right:after{position:absolute;top:50%;left:0;color:#0071b3;content:'\f053';font-family:FontAwesome;font-weight:normal;transform:rotate(180deg)}.select2-top-override.select2-container{width:100% !important;max-width:100% !important;border:none;margin-right:20px;font-size:1.5em;font-weight:bold}.select2-top-override.select2-container>a{border:none}.select2-top-override.select2-container>a:hover b:after{top:25% !important}.select2-top-override.select2-container .select2-choice{display:none !important;padding-left:0;font-size:1.5em}.select2-top-override.select2-container .select2-choice .select2-chosen{margin-right:0}.select2-top-override.select2-container .select2-choice .select2-arrow{position:relative;display:block;width:20px;height:2rem;margin-left:50%;transform:translate3d(-50%, 0, 0)}.select2-top-override.select2-container .select2-choice .select2-arrow b{position:relative;padding:0;margin:0 auto;background:none;color:#0071b3}.select2-top-override.select2-container .select2-choice .select2-arrow b:after{position:absolute;display:block;width:100%;margin-top:0;content:'\f107';font-family:FontAwesome;font-size:2.5rem;font-weight:100}.select2-top-override-dropdown .select2-results li{display:-ms-flexbox;display:flex;overflow:hidden;min-height:1.5em;-ms-flex-align:center;align-items:center;font-size:1.4rem;line-height:1.2em;text-overflow:ellipsis}.select2-top-override-dropdown .select2-results li:first-child{border-top:1px solid #dce4ec}@media (max-width:992px){.select2-top-override.select2-container{margin-right:0}.select2-top-override.select2-container .select2-choice{padding-left:0;font-size:1em}.select2-top-override.select2-container .select2-choice .select2-arrow{width:20px;margin-right:10px}.select2-top-override.select2-container .select2-choice .select2-arrow b{background:none !important}#marine-unit-trigger .text-trigger{word-break:break-all}.select2-top-override-dropdown .select2-results li{font-size:1em}} \ No newline at end of file +.wise-search-form-container dl{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.wise-search-form-container{position:relative;opacity:0}.wise-search-form-container .form-right-side .row{display:-ms-flexbox;display:flex;gap:1em}#wise-search-form-container-preloader,#wise-search-form-preloader{position:fixed;z-index:1000;top:0;left:0;width:100%;height:100%;background:rgba(255,255,255,0.2)}.active-filters-section{border:1px solid #e6e7e8;background-color:#f9f9f9;padding:1em;margin:1em 0}.active-filters-section .active-filters-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.8em;cursor:pointer}.active-filters-section .active-filters-header i{position:relative;top:-2px}.active-filters-section .active-filters-header .active-filters-title{margin-bottom:0}.active-filters-section .active-filter-group{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:baseline;align-items:baseline;padding:8px 15px;margin-top:10px;margin-right:11px;background-color:#ebebeb;font-size:15px;gap:.7em}.active-filters-section .filter-group-title{font-weight:500}.active-filters-section .active-filter-item{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:4px}.active-filters-section .clear-filter{padding:2px 3px;line-height:.5;cursor:pointer;border:1px solid #0079cf;box-shadow:none !important;border-radius:3px;margin:0;background:transparent}.active-filters-section .clear-filter:hover{background-color:transparent}.active-filters-section .clear-filter i{font-size:10px;color:#0079cf}.form-check-input{margin-top:6px}.form-label{font-size:14px;font-weight:500;margin-bottom:5px}.wise-search-form-container,#wise-search-form{opacity:0}.wise-search-form-container .subform,#wise-search-form .subform{margin-top:0}.wise-search-form-container .subform h3#article-id,#wise-search-form .subform h3#article-id{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;border-bottom:2px solid #52616f;margin:0;font-size:18px;font-weight:500}.wise-search-form-container .subform h3#article-id .article-id-country,#wise-search-form .subform h3#article-id .article-id-country{font-size:26px}.wise-search-form-container .subform #mru-select-prev-next-wrapper,#wise-search-form .subform #mru-select-prev-next-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between}.wise-search-form-container table.table-report tr:last-child th,#wise-search-form table.table-report tr:last-child th{border-bottom:none}.wise-search-form-container table.listing,#wise-search-form table.listing{width:100%;border:none}.wise-search-form-container table.listing th,#wise-search-form table.listing th{font-weight:600;text-align:left;border-bottom:1px solid #0079cf}.wise-search-form-container table.listing th:not(:last-child),#wise-search-form table.listing th:not(:last-child){border-right:1px solid #0079cf}.wise-search-form-container table.listing td,#wise-search-form table.listing td{background-color:white}.wise-search-form-container table.listing td:not(:last-child),#wise-search-form table.listing td:not(:last-child){border-right:1px solid #0079cf}.wise-search-form-container table.listing tr:not(:last-child) td,#wise-search-form table.listing tr:not(:last-child) td{border-bottom:1px solid #acbac7}.wise-search-form-container table.listing th,#wise-search-form table.listing th,.wise-search-form-container table.listing td,#wise-search-form table.listing td{min-width:10rem;padding:.5em}.wise-search-form-container table.listing th.fixed-position,#wise-search-form table.listing th.fixed-position,.wise-search-form-container table.listing td.fixed-position,#wise-search-form table.listing td.fixed-position{position:absolute;background-color:white;width:15rem;color:inherit;margin-left:-15.1rem}.wise-search-form-container table.listing.table-report,#wise-search-form table.listing.table-report{margin-bottom:0;margin-left:15rem}.wise-search-form-container .pagination-text,#wise-search-form .pagination-text{display:inline-block;margin-top:2rem;margin-bottom:2rem;font-size:14px;font-weight:500}.wise-search-form-container .pagination-text>span,#wise-search-form .pagination-text>span{color:#444;font-weight:800}.wise-search-form-container .pagination-text.bottom,#wise-search-form .pagination-text.bottom{padding:.2rem .5rem;margin:0}.wise-search-form-container .pagination-text .pagination-input,#wise-search-form .pagination-text .pagination-input{display:inline-block;max-width:50px;height:auto;padding:0 6px;border:1px solid #ccc;margin-right:5px;margin-left:5px}.wise-search-form-container .pagination-text .pagination-result,#wise-search-form .pagination-text .pagination-result{display:inline-block;padding:0 8px;border:1px solid #ccc;background-color:white;cursor:pointer;line-height:22px;text-decoration:underline}.wise-search-form-container .panel-heading,#wise-search-form .panel-heading{padding:10px 15px}.wise-search-form-container .panel-title>a,#wise-search-form .panel-title>a,.wise-search-form-container .panel-title>small,#wise-search-form .panel-title>small,.wise-search-form-container .panel-title>.small,#wise-search-form .panel-title>.small,.wise-search-form-container .panel-title>small>a,#wise-search-form .panel-title>small>a,.wise-search-form-container .panel-title>.small>a,#wise-search-form .panel-title>.small>a{color:inherit}.wise-search-form-container .btn-default,#wise-search-form .btn-default{padding:1px 6px !important;border-color:#29a2d9;background-color:#004b7f;color:white !important;font-size:10px}.wise-search-form-container .ui.button.close,#wise-search-form .ui.button.close{padding:.5rem .8rem}.wise-search-form-container .btn,#wise-search-form .btn{display:inline-block;border-color:#cbcbcb;margin-bottom:0;border-radius:4px;color:#3a3a3a;cursor:pointer;font-size:15px;text-align:center;vertical-align:middle;white-space:nowrap}.wise-search-form-container .panel-group,#wise-search-form .panel-group{margin-bottom:10px}.wise-search-form-container dl,#wise-search-form dl{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-flow:row wrap;flex-flow:row wrap}.wise-search-form-container dl dt:last-of-type,#wise-search-form dl dt:last-of-type,.wise-search-form-container dl dd:last-of-type,#wise-search-form dl dd:last-of-type{border-bottom:none}.wise-search-form-container dt,#wise-search-form dt{width:25%;border-right:1px solid #0079cf;clear:left;float:left;font-weight:500;padding-top:.4rem}.wise-search-form-container dt:not(:last-child),#wise-search-form dt:not(:last-child){border-bottom:1px solid #0079cf}.wise-search-form-container dd,#wise-search-form dd{overflow:auto;width:100%;margin:0;max-width:75%;max-height:200px;padding:.4rem}.wise-search-form-container dd:not(:last-child),#wise-search-form dd:not(:last-child){border-bottom:1px solid #acbac7}.wise-search-form-container .tab-content,#wise-search-form .tab-content{padding-top:10px}.wise-search-form-container [data-fieldname='form.widgets.page'],#wise-search-form [data-fieldname='form.widgets.page']{border-bottom:none}.option label{display:inline-block;overflow:hidden;max-width:80%;margin-bottom:0;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap}.controls .label{display:inline-block;padding:0 10px;color:black;font-size:12px;font-weight:500}.controls a .label{color:black}.controls a .label:hover{color:#069;cursor:pointer}.controls a:hover{color:white}.controls .apply-filters{display:none;width:80px;padding:.2rem .5rem !important;margin-bottom:1em;font-size:11px;border:none}.controls .apply-filters span{font-weight:500}.controls .ui-autocomplete{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;width:100%;-ms-flex-direction:row;flex-direction:row;margin-top:.5rem}.controls .ui-autocomplete .ui-autocomplete-input{display:inline-block;width:100%;height:auto;padding:5px;box-shadow:none;border:1px solid #ccc;border-radius:4px;height:30px}.controls .ui-autocomplete .clear-btn{position:absolute;top:5px;right:5px;cursor:pointer}.controls .ui-autocomplete .clear-btn:active{transform:rotate(30deg)}.controls .ui-autocomplete .clear-btn:after{padding:3px;content:'\e014';font-family:'Glyphicons Halflings';font-size:12px}.controls>span{font-size:12px}.controls .search-span{position:relative;-ms-flex:1;flex:1}.field .noresults{padding-left:5px}.field>span{position:relative;display:block;max-height:195px;overflow-x:hidden;overflow-y:auto}.field label.horizontal{padding-left:0}.field label.horizontal:after{content:none}.field label.horizontal span.required span:after{content:none}.field label.horizontal.collapsed{border:1px solid #337ab7}.field label.horizontal a{text-decoration:none}.field label.horizontal a:hover{text-decoration:none}.wise-search-form-container ul.topnav li a,#wise-search-form ul.topnav li a{padding:6px}.wise-search-form-container ul.topnav li:first-child a>span:nth-child(2),#wise-search-form ul.topnav li:first-child a>span:nth-child(2){white-space:nowrap}.wise-search-form-container #marine-unit-nav,#wise-search-form #marine-unit-nav{height:3rem;margin-top:2rem;margin-bottom:2rem;clear:both;float:left}.wise-search-form-container div#item-title-wrapper,#wise-search-form div#item-title-wrapper{display:inline-block;width:100%;margin-bottom:1rem;text-align:center}.wise-search-form-container .reported-date,#wise-search-form .reported-date{padding:0 1rem;color:#7d7d7d;font-size:smaller;text-align:center}.wise-search-form-container #form-data-primary,#wise-search-form #form-data-primary{margin-top:2rem}.wise-search-form-container #marine-widget-top,#wise-search-form #marine-widget-top{margin-top:.8em}.wise-search-form-container #marine-widget-top #form-buttons-prev-top,#wise-search-form #marine-widget-top #form-buttons-prev-top{position:relative;float:left}.wise-search-form-container #marine-widget-top #form-buttons-next-top,#wise-search-form #marine-widget-top #form-buttons-next-top{margin-left:2px}.wise-search-form-container #marine-widget-top #marine-unit-trigger .text-trigger,#wise-search-form #marine-widget-top #marine-unit-trigger .text-trigger{border:none;text-decoration:underline}.wise-search-form-container #marine-widget-top .widget,#wise-search-form #marine-widget-top .widget{display:block;width:100%;margin:0}.wise-search-form-container #marine-widget-top .widget .select2-container .select2-chosen,#wise-search-form #marine-widget-top .widget .select2-container .select2-chosen{text-shadow:2px 1px 1px #ccc}.wise-search-form-container #marine-widget-top .widget .select2-container .select2-choice,#wise-search-form #marine-widget-top .widget .select2-container .select2-choice{padding-top:8px;padding-bottom:8px;margin-bottom:-4px}.wise-search-form-container #marine-widget-top .field,#wise-search-form #marine-widget-top .field{border:none;margin:0 auto}.wise-search-form-container #marine-widget-top .field>h4,#wise-search-form #marine-widget-top .field>h4{display:inline-block;margin-top:5px;margin-right:.5em;margin-bottom:2px;font-size:1em;font-weight:500}.item-subform .double-scroll{overflow:auto}.extra-details{padding-top:.7rem}.extra-details .extra-details-section{overflow:auto}.extra-details .extra-details-section .section-title{margin-top:1.5rem;font-weight:500}.extra-details .extra-details-section:not(:first-child){padding-top:1.5rem}.extra-details .extra-details-select{max-width:250px}.extra-details.notselect table.listing{margin-bottom:2rem}.label{color:#555}.label span{display:inline}#wise-search-form-container .hidden{display:none !important}.wise-search-form-container div.formControls,#wise-search-form div.formControls{position:relative;margin-left:0}.wise-search-form-container div.formControls input,#wise-search-form div.formControls input{margin:2px}#mobile-select-article{border:2px solid #004b7f !important;background:white;color:#004b7f;border-radius:5px !important;border:none;padding:.3em .5em;box-shadow:none;font-weight:500;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:15px;width:220px !important}#mobile-select-article option{width:220px !important}#wise-search-form div.formControls [name='form.buttons.next']{position:absolute;right:0}#wise-search-form .form-buttons-next-row,#wise-search-form .form-buttons-prev-row{display:inline-block}#wise-search-form .form-buttons-next-row .label,#wise-search-form .form-buttons-prev-row .label{padding:0}#wise-search-form .prev-next-row .form-buttons-next,#wise-search-form .prev-next-row .form-buttons-prev{background-color:#004b7f;color:white;border:none;border-radius:0;padding:0 8px !important}#wise-search-form .prev-next-row .form-buttons-next:hover,#wise-search-form .prev-next-row .form-buttons-prev:hover{background-color:#0071b3;color:white}.msfd-heading{margin:2em 0 1em 0}.prev-next-row{margin-top:.8em;margin-left:auto}.prev-next-row>span{display:block}.prev-next-row.prev-next-row-bottom{text-align:right}@media (min-width:1199px) and (max-width:1200px){.wise-search-form-container>ul.topnav li,#wise-search-form>ul.topnav li{width:30%}#marine-widget-top{max-width:60%}}@media (max-width:992px){#form-buttons-next-top{margin-left:0 !important}#marine-widget-top{max-width:50%}#marine-widget-top .select-article{clear:none;float:none}#marine-widget-top .select-article .field{text-align:left !important}#marine-widget-top .select-article .select2-choice{margin-bottom:-8px !important}.toggle-sidebar{margin-bottom:20px}}@media (max-width:768px){.wise-search-form-container dt,#wise-search-form dt{border-bottom:none !important;border-right:none !important}.wise-search-form-container dd,#wise-search-form dd{max-width:100%;padding:.4rem 0}#marine-widget-top .select-article{width:100% !important;clear:both;float:left}#marine-widget-top .select-article .field{width:100%;text-align:left !important}#marine-widget-top .select-article .field .widget{display:block !important;width:50%;padding-bottom:2px;margin-left:0 !important;clear:both}.prev-next-row{clear:both}ul.nav li a{overflow:inherit !important;text-overflow:none !important;white-space:inherit !important}.extra-details{padding-top:0}.extra-details h4{padding-top:0}.extra-details .extra-details-section{margin-top:0}}.clear-break{overflow:hidden;clear:both}.pagination-prev:before{content:'\f104';font:normal normal normal 16px/1 FontAwesome}.pagination-next:after{content:'\f105';font:normal normal normal 16px/1 FontAwesome}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;border-radius:3px;font-size:12px;line-height:1.5}#ajax-spinner-form{position:fixed;top:50%;left:50%;transform:translate3d(-50%, -50%, 0)}.label{display:inline-block;padding:.6em .5em;border-radius:.25em;font-size:13px;font-weight:500;line-height:1.2;text-align:left}.msfd-search-wrapper .msfd-filters-on-top{color:#3d5265}.msfd-search-wrapper .msfd-filters-on-top .article-select label,.msfd-search-wrapper .msfd-filters-on-top .form-right-side label{font-size:14px;font-weight:500;margin-bottom:5px;display:-ms-flexbox;display:flex}.msfd-search-wrapper .msfd-filters-on-top .article-select{max-width:250px}.msfd-search-wrapper .msfd-filters-on-top .form-right-side{display:-ms-flexbox;display:flex;gap:1rem;-ms-flex-align:end;align-items:flex-end}.msfd-search-wrapper .msfd-filters-on-top .form-right-side .row{display:-ms-flexbox;display:flex;gap:1rem;-ms-flex-align:end;align-items:flex-end}.msfd-search-wrapper .msfd-filters-on-top .panel-content{position:absolute;bottom:auto !important;min-width:350px;max-width:400px;padding:1em;border-bottom:.5px solid #4c677f;background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,0.25)}.msfd-search-wrapper .msfd-filters-on-top .panel-content.open{z-index:99 !important}.msfd-search-wrapper .msfd-filters-on-top .panel-title{padding:.8em 1em;font-size:16px !important;font-weight:normal !important;position:relative;display:block !important;background-color:#fff;margin:0 !important}.msfd-search-wrapper .msfd-filters-on-top .panel-title:after{content:'\f107' !important;font:normal normal normal 16px/1 FontAwesome}.msfd-search-wrapper .msfd-filters-on-top .panel-title.open{z-index:999 !important;box-shadow:0 5px 0 #fff,0 0 4px rgba(0,0,0,0.25)}.msfd-search-wrapper .msfd-filters-on-top .panel-default{position:relative;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;width:auto;max-height:200px;min-height:60px;display:block;overflow:auto;margin-top:.5em}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform{display:-ms-flexbox;display:flex;gap:1rem}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform .option{border:none}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform .option label{max-width:90%}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform .option .label{padding:.5em .3em}.msfd-search-wrapper .msfd-filters-on-top .side-section .subform>.field{border:none;max-width:250px}#form-buttons-download{margin-top:2rem}.wise-search-form-container .panel-heading .accordion-toggle:after,#wise-search-form .panel-heading .accordion-toggle:after,#marine-unit-trigger .text-trigger:after{content:'\f107' !important;font:normal normal normal 16px/1 FontAwesome}#wise-search-form .panel-heading .accordion-toggle.accordion-after:after{font-size:25px}.controls .ui-autocomplete .clear-btn:after{content:'\f00d';font:normal normal normal 14px/1 FontAwesome}dd{margin-left:0}.wise-search-form-container .btn,#wise-search-form .btn{border-width:1px}.wise-search-form-container .field{margin:1em 0;position:relative}#wise-search-form .field{padding-bottom:1em;margin:1em 0}.select2-container{width:100% !important}.dimmer{position:fixed;background-color:rgba(249,249,249,0.4);top:0 !important;left:0 !important;width:100%;height:100%;z-index:9}.subform>.field{border-bottom:1px solid rgba(0,0,0,0.1)}.form-right-side .subform>.field{border-bottom:none !important}.ui-helper-hidden-accessible{display:none}table{width:100%;border-collapse:collapse}#wise-search-form table.listing th{font-weight:600;text-align:left}.tab-panel .listing{font-size:16px}#wise-search-form #a11dataaccessdisplay2020 dl{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-direction:column;flex-direction:column}#wise-search-form #a11dataaccessdisplay2020 dt{border:none !important;font-size:18px;font-weight:600;font-family:'Roboto';margin-bottom:10px;color:#002d54}#wise-search-form #a11dataaccessdisplay2020 dd{max-height:none}.select2-container{width:100%}.select2-container--open .select2-dropdown--below,.select2-container--open .select2-dropdown--above{background:#009966}.select2-container--flat .select2-container--focus .select2-selection--multiple{border:1px solid #006699}.select2-container--flat .select2-results__option--highlighted[aria-selected]{background:#006699 !important;color:#ffffff}.select2-container--flat .select2-results__option[aria-selected='true']{background:#006699;color:#fff;opacity:.8}.select2-container--flat .select2-selection--single{border-radius:0}.select2-container--flat.select2-container--open .select2-selection__arrow b{transform:rotate(180deg)}.select2-container--flat span.select2-search input{height:30px !important}.form-select{border:none;padding:0;background-image:none}.form-select.select-widget.choice-field{margin-bottom:1em}.msfd-search-wrapper .select2-container .select2-choice,#wise-search-form .select2-container .select2-choice,#wise-search-form-container .select2-container .select2-choice{height:auto !important;border:2px solid #004b7f !important;background:white;color:#004b7f;border-radius:5px !important;border:none;padding:.3em .5em;box-shadow:none;font-weight:500;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;font-size:15px}.msfd-search-wrapper .select2-container .select2-choice div,#wise-search-form .select2-container .select2-choice div,#wise-search-form-container .select2-container .select2-choice div{border-left:1px solid #dce4ec;background-clip:padding-box;border-radius:0 4px 4px 0}.msfd-search-wrapper .select2-container .select2-choice .select2-arrow,#wise-search-form .select2-container .select2-choice .select2-arrow,#wise-search-form-container .select2-container .select2-choice .select2-arrow{border:0;background:transparent;background-image:none;border-radius:0;position:relative}.msfd-search-wrapper .select2-container .select2-choice .select2-arrow:after,#wise-search-form .select2-container .select2-choice .select2-arrow:after,#wise-search-form-container .select2-container .select2-choice .select2-arrow:after{content:'\f107' !important;font:normal normal normal 16px/1 FontAwesome}.msfd-search-wrapper .select2-container .select2-choice .select2-arrow b,#wise-search-form .select2-container .select2-choice .select2-arrow b,#wise-search-form-container .select2-container .select2-choice .select2-arrow b{background:none}.msfd-search-wrapper .select2-container *:focus,#wise-search-form .select2-container *:focus,#wise-search-form-container .select2-container *:focus{outline:0}.msfd-search-wrapper .select2-container.select2-drop-above .select2-choice,#wise-search-form .select2-container.select2-drop-above .select2-choice,#wise-search-form-container .select2-container.select2-drop-above .select2-choice{border-bottom-color:#dce4ec;border-radius:0}.select2-drop{border:1px solid #dce4ec !important;border-top:0 !important;margin-top:-2px !important;border-radius:0 !important;border-radius:0 0 6px 6px !important;box-shadow:none !important}.select2-drop.select2-drop-above{border-top:2px solid #dce4ec !important;border-bottom:0;margin-top:2px;border-radius:6px 6px 0 0;box-shadow:none}.select2-search{border-top:1px solid #dce4ec}.select2-search input{height:26px;border:1px solid #dce4ec;margin-bottom:5px}.select2-container-active .select2-choice,.select2-container-active .select2-choices{border:1px solid #dce4ec;box-shadow:none;outline:none}.select2-dropdown-open .select2-choice{border-bottom-left-radius:0;border-bottom-right-radius:0;box-shadow:none}.select2-dropdown-open .select2-choice .select2-choice div{border-left:none;background:transparent;filter:none}.select2-results{padding:0;margin:0}.select2-results .select2-highlighted{background:#ededed !important;border-radius:0;color:inherit !important}.select2-container-multi .select2-choices{height:auto !important;height:1%;border:1px solid #dce4ec}.select2-container-multi.select2-container-active .select2-choices{border:1px solid #dce4ec;border-radius:6px;box-shadow:none}.select2-container--flat .select2-selection--single{height:34px;border:0;background:#009966}.select2-container--flat .select2-selection--single .select2-selection__rendered{color:#fff;line-height:34px}.select2-container--flat .select2-selection--single .select2-selection__arrow{position:absolute;top:1px;right:1px;width:20px;height:26px}.select2-container--flat .select2-selection--single .select2-selection__arrow b{position:absolute;top:60%;left:50%;width:0;height:0;border-width:5px 4px 0 4px;border-style:solid;border-color:#fff transparent transparent transparent;margin-top:-2px;margin-left:-4px}.select2-container--flat .select2-selection--single .select2-selection__placeholder{color:#fff}.select2-container--flat .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--flat .select2-selection--multiple{border:1px solid #006699}.select2-container--flat .select2-selection--multiple .select2-selection__choice__remove:hover{color:#006699;cursor:pointer}.select2-container--flat .select2-selection--multiple .select2-selection__rendered{width:100%;box-sizing:border-box;padding:0 5px;margin:0;list-style:none}.select2-container--flat .select2-selection--multiple .select2-selection__choice{padding:3px 5px;border:1px solid #009966;margin-top:5px;margin-right:5px;background-color:#009966;border-radius:0;color:#fff;cursor:default;float:left}.select2-container--flat .select2-selection--multiple .select2-selection__choice__remove{margin-right:6px;margin-left:6px;color:#006699;float:right}.select2-results{padding:0 !important;margin:0 !important}.select2-result-label{padding:.3em .4em !important;min-height:auto;font-size:15px}#marine-unit-trigger{display:inline-block;max-width:100%;border-spacing:2rem;background:none !important}#marine-unit-trigger:hover{cursor:pointer}#marine-unit-trigger a{position:relative;display:block;padding-top:2px;padding-right:0;padding-bottom:5px;padding-left:0;border-bottom:1px solid rgba(0,0,0,0.1);color:#444;font-size:1.5em;font-weight:bold;line-height:2.5rem;text-decoration:none;text-shadow:2px 1px 1px #ccc}#marine-unit-trigger .arrow-left-container{position:absolute;top:0;left:0;display:block;width:10%;height:100%}#marine-unit-trigger .arrow-left-container .arrow-left{position:absolute;left:0;display:inline-block;width:auto;margin-right:10px}#marine-unit-trigger .arrow-left-container .arrow-left:after{position:absolute;top:50%;left:0;color:#0071b3;content:'\f053';font-family:FontAwesome;font-weight:normal}#marine-unit-trigger .text-trigger{display:inline-block;padding:0;border:1px solid #ddd;text-decoration:none !important}#marine-unit-trigger .text-trigger:after{margin-left:5px;content:'\f107';font:normal normal normal 16px/1 FontAwesome}#marine-unit-trigger .arrow-right-container{position:absolute;top:0;right:0;display:table-cell;width:10%;height:100%}#marine-unit-trigger .arrow-right-container .arrow-right{position:absolute;left:3px;display:inline-block;width:auto}#marine-unit-trigger .arrow-right-container .arrow-right:after{position:absolute;top:50%;left:0;color:#0071b3;content:'\f053';font-family:FontAwesome;font-weight:normal;transform:rotate(180deg)}.select2-top-override.select2-container{width:100% !important;max-width:100% !important;border:none;margin-right:20px;font-size:1.5em;font-weight:bold}.select2-top-override.select2-container>a{border:none}.select2-top-override.select2-container>a:hover b:after{top:25% !important}.select2-top-override.select2-container .select2-choice{display:none !important;padding-left:0;font-size:1.5em}.select2-top-override.select2-container .select2-choice .select2-chosen{margin-right:0}.select2-top-override.select2-container .select2-choice .select2-arrow{position:relative;display:block;width:20px;height:2rem;margin-left:50%;transform:translate3d(-50%, 0, 0)}.select2-top-override.select2-container .select2-choice .select2-arrow b{position:relative;padding:0;margin:0 auto;background:none;color:#0071b3}.select2-top-override.select2-container .select2-choice .select2-arrow b:after{position:absolute;display:block;width:100%;margin-top:0;content:'\f107';font-family:FontAwesome;font-size:2.5rem;font-weight:100}.select2-top-override-dropdown .select2-results li{display:-ms-flexbox;display:flex;overflow:hidden;min-height:1.5em;-ms-flex-align:center;align-items:center;font-size:1.4rem;line-height:1.2em;text-overflow:ellipsis}.select2-top-override-dropdown .select2-results li:first-child{border-top:1px solid #dce4ec}@media (max-width:992px){.select2-top-override.select2-container{margin-right:0}.select2-top-override.select2-container .select2-choice{padding-left:0;font-size:1em}.select2-top-override.select2-container .select2-choice .select2-arrow{width:20px;margin-right:10px}.select2-top-override.select2-container .select2-choice .select2-arrow b{background:none !important}#marine-unit-trigger .text-trigger{word-break:break-all}.select2-top-override-dropdown .select2-results li{font-size:1em}} \ No newline at end of file diff --git a/src/wise/msfd/static/wise/src/less/search-form.less b/src/wise/msfd/static/wise/src/less/search-form.less index c04f6a3f..23d79b5d 100644 --- a/src/wise/msfd/static/wise/src/less/search-form.less +++ b/src/wise/msfd/static/wise/src/less/search-form.less @@ -867,6 +867,12 @@ display: flex; gap: 1rem; align-items: flex-end; + + .row { + display: flex; + gap: 1rem; + align-items: flex-end; + } } .panel-content { From 5a585f3ddd56a0ba0732a7646e61c6c5fb555aa9 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Tue, 24 Mar 2026 15:34:27 +0200 Subject: [PATCH 03/11] small refactor admin.py --- src/wise/msfd/compliance/admin/__init__.py | 0 src/wise/msfd/compliance/{ => admin}/admin.py | 666 +----------------- src/wise/msfd/compliance/admin/bootstrap.py | 654 +++++++++++++++++ .../{admin.zcml => admin/configure.zcml} | 15 +- src/wise/msfd/compliance/admin/migrate.py | 143 ++++ .../{ => admin}/pt/admin-scoring.pt | 0 .../compliance/{ => admin}/pt/admin-users.pt | 0 .../msfd/compliance/{ => admin}/pt/admin.pt | 0 src/wise/msfd/compliance/configure.zcml | 2 +- 9 files changed, 813 insertions(+), 667 deletions(-) create mode 100644 src/wise/msfd/compliance/admin/__init__.py rename src/wise/msfd/compliance/{ => admin}/admin.py (69%) create mode 100644 src/wise/msfd/compliance/admin/bootstrap.py rename src/wise/msfd/compliance/{admin.zcml => admin/configure.zcml} (86%) create mode 100644 src/wise/msfd/compliance/admin/migrate.py rename src/wise/msfd/compliance/{ => admin}/pt/admin-scoring.pt (100%) rename src/wise/msfd/compliance/{ => admin}/pt/admin-users.pt (100%) rename src/wise/msfd/compliance/{ => admin}/pt/admin.pt (100%) diff --git a/src/wise/msfd/compliance/admin/__init__.py b/src/wise/msfd/compliance/admin/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/wise/msfd/compliance/admin.py b/src/wise/msfd/compliance/admin/admin.py similarity index 69% rename from src/wise/msfd/compliance/admin.py rename to src/wise/msfd/compliance/admin/admin.py index 584e1567..30a22194 100644 --- a/src/wise/msfd/compliance/admin.py +++ b/src/wise/msfd/compliance/admin/admin.py @@ -5,7 +5,6 @@ from __future__ import print_function import logging import os -import requests from collections import namedtuple from datetime import datetime @@ -22,17 +21,10 @@ from plone.api import portal from plone.api.content import get_state, transition from plone.api.portal import get_tool -from plone.app.textfield.value import RichTextValue -from plone.dexterity.utils import createContentInContainer as create -from plone.namedfile.file import NamedBlobImage from plone.protect.interfaces import IDisableCSRFProtection from Products.CMFCore.utils import getToolByName -from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault -from Products.CMFPlacefulWorkflow.WorkflowPolicyConfig import \ - WorkflowPolicyConfig from Products.Five.browser import BrowserView from Products.statusmessages.interfaces import IStatusMessage -from wise.msfd import db from wise.msfd.compliance.assessment import ( ARTICLE_WEIGHTS, AssessmentDataMixin, # OverallScores ) @@ -40,22 +32,17 @@ from wise.msfd.compliance.interfaces import (INationalDescriptorAssessment, INationalDescriptorAssessmentSecondary) -from wise.msfd.compliance.vocabulary import (get_all_countries, - get_regions_for_country, - REGIONAL_DESCRIPTORS_REGIONS, - REPORTING_HISTORY_ENV) from wise.msfd.compliance.regionaldescriptors.base import COUNTRY from wise.msfd.gescomponents import (get_all_descriptors, get_descriptor, get_marine_units) from wise.msfd.labels import get_indicator_labels -from wise.msfd.translation import Translation, get_detected_lang +from wise.msfd.translation import get_detected_lang from wise.msfd.translation.interfaces import ITranslationsStorage from wise.msfd.utils import get_annot, timeit -from . import interfaces -from .base import (_get_secondary_articles, BaseComplianceView, - NAT_DESC_QUESTIONS, REG_DESC_QUESTIONS, - report_data_cache_key) +from ..base import (_get_secondary_articles, BaseComplianceView, + NAT_DESC_QUESTIONS, REG_DESC_QUESTIONS, + report_data_cache_key) import six logger = logging.getLogger('wise.msfd') @@ -111,627 +98,6 @@ def __call__(self): return 'ok' -class BootstrapCompliance(BrowserView): - """ Bootstrap the compliance module by creating all needed country folders - /bootstrap-compliance?setup=nationaldesc&production=1 - """ - - compliance_folder_id = 'assessment-module' - - @property - def debug(self): - return 'production' not in self.request.form - - def _get_countries(self): - """ Get a list of (code, name) countries - """ - - countries = get_all_countries() - - if self.debug: - countries = [x for x in countries if x[0] in ('LV', 'NL', 'DE')] - - return countries - - @db.use_db_session('2018') - def _get_countries_names(self, country_codes): - result = [] - all_countries = self._get_countries() - - for code in country_codes: - result.extend([x for x in all_countries if x[0] == code]) - - return result - - def _get_descriptors(self): - """ Get a list of (code, description) descriptors - """ - - descriptors = get_all_descriptors() - descriptors = [d for d in descriptors if d[0] != 'D1'] - - debug_descriptors = ('D1.1', 'D4', 'D5', 'D6') - - if self.debug: - descriptors = [x for x in descriptors if x[0] in debug_descriptors] - - return descriptors - - def _get_articles(self): - """_get_articles""" - return ['Art8', 'Art9', 'Art10', 'Art8-2024', 'Art9-2024', 'Art10-2024'] - - def set_layout(self, obj, name): - """set_layout""" - ISelectableBrowserDefault(obj).setLayout(name) - - def set_policy(self, context, name): - """set_policy""" - logger.info("Set placeful workflow policy for %s", context.getId()) - config = WorkflowPolicyConfig( - workflow_policy_in='compliance_section_policy', - workflow_policy_below='compliance_section_policy', - ) - context._setObject(config.id, config) - - @db.use_db_session('2018') - def get_country_regions(self, country_code): - """get_country_regions""" - regions = get_regions_for_country(country_code) - - return regions - - def get_group(self, code): - """get_group""" - if '.' in code: - code = 'd1' - code = code.lower() - - return "{}-{}".format(CONTRIBUTOR_GROUP_ID, code) - - def create_comments_folder(self, content): - """create_comments_folder""" - for id, title, trans in [ - (u'tl', 'Discussion track with Topic Leads', 'open_for_tl'), - (u'ec', 'Discussion track with EC', 'open_for_ec'), - ]: - if id not in content.contentIds(): - dt = create(content, - 'wise.msfd.commentsfolder', - id=id, - title=title) - transition(obj=dt, transition=trans) - - def create_nda_folder(self, df, desc_code, art, - layout='@@nat-desc-art-view'): - """create_nda_folder""" - if '2024' in art: - layout = '@@nat-desc-art-view-2024' - - if art.lower() in df.contentIds(): - nda = df[art.lower()] - else: - nda = create(df, - 'wise.msfd.nationaldescriptorassessment', - title=art) - lr = nda.__ac_local_roles__ - - group = self.get_group(desc_code) - - lr[group] = ['Contributor'] - - logger.info("Created NationalDescriptorAssessment %s", - nda.absolute_url()) - - self.set_layout(nda, layout) - - self.create_comments_folder(nda) - - def create_rda_folder(self, df, desc_code, art): - """create_rda_folder""" - if art.lower() in df.contentIds(): - rda = df[art.lower()] - else: - rda = create(df, - 'wise.msfd.regionaldescriptorassessment', - title=art) - - lr = rda.__ac_local_roles__ - group = self.get_group(desc_code) - lr[group] = ['Contributor'] - - logger.info("Created RegionalDescriptorArticle %s", - rda.absolute_url()) - - self.set_layout(rda, '@@reg-desc-art-view') - alsoProvides(rda, interfaces.IRegionalDescriptorAssessment) - - self.create_comments_folder(rda) - - def make_country(self, parent, country_code, name): - """make_country""" - if country_code.lower() in parent.contentIds(): - cf = parent[country_code.lower()] - else: - cf = create(parent, - 'wise.msfd.countrydescriptorsfolder', - title=name, - id=country_code) - - # create 2022 Cross cutting assessment folder - art = 'cross-cutting-2022' - if art.lower() in cf.contentIds(): - nda = cf[art.lower()] - else: - nda = create(cf, - 'wise.msfd.nationaldescriptorassessment', - title=art) - - logger.info("Created NationalDescriptorAssessment %s", - nda.absolute_url()) - - self.set_layout(nda, '@@nat-desc-art-view-cross-cutting') - - # Art 13 create 2022 completeness assessment folder - art = 'art13-completeness-2022' - if art.lower() in cf.contentIds(): - nda = cf[art.lower()] - else: - nda = create(cf, - 'wise.msfd.nationaldescriptorassessment', - title=art) - - logger.info("Created NationalDescriptorAssessment %s", - nda.absolute_url()) - - self.set_layout(nda, '@@nat-desc-art-view-completeness') - nda._article = 'Art13Completeness' - - # Art 14 create 2022 completeness assessment folder - art = 'art14-completeness-2022' - if art.lower() in cf.contentIds(): - nda = cf[art.lower()] - else: - nda = create(cf, - 'wise.msfd.nationaldescriptorassessment', - title=art) - - logger.info("Created NationalDescriptorAssessment %s", - nda.absolute_url()) - - self.set_layout(nda, '@@nat-desc-art-view-completeness') - nda._article = 'Art14Completeness' - - for regid, region in self.get_country_regions(country_code): - if regid.lower() in cf.contentIds(): - reg = cf[regid.lower()] - else: - reg = create(cf, - 'Folder', - title=region, - id=regid.lower()) - alsoProvides(reg, interfaces.INationalRegionDescriptorFolder) - self.set_layout(reg, '@@nat-desc-reg-view') - - for desc_code, description in self._get_descriptors(): - if desc_code.lower() in reg.contentIds(): - df = reg[desc_code.lower()] - else: - df = create(reg, 'Folder', title=description, id=desc_code) - alsoProvides(df, interfaces.IDescriptorFolder) - - # articles 8, 9, 10 - for art in self._get_articles(): - self.create_nda_folder(df, desc_code, art) - - # article 11 - self.create_nda_folder(df, desc_code, 'Art11') - - # article 13, 14, 18 - self.create_nda_folder(df, desc_code, 'Art13', - '@@nat-desc-art-view-2022') - self.create_nda_folder(df, desc_code, 'Art14', - '@@nat-desc-art-view-2022') - self.create_nda_folder(df, desc_code, 'Art18') - - return cf - - def make_region(self, parent, region): - """make_region""" - code, name = region.code.lower(), region.title - - if code.lower() in parent.contentIds(): - rf = parent[code.lower()] - else: - rf = create(parent, - 'wise.msfd.regiondescriptorsfolder', - title=name, - id=code) - - rf._subregions = region.subregions - rf._countries_for_region = self._get_countries_names( - region.countries - ) - self.set_layout(rf, '@@reg-region-start') - alsoProvides(rf, interfaces.IRegionalDescriptorRegionsFolder) - - for desc_code, description in self._get_descriptors(): - if desc_code.lower() in rf.contentIds(): - df = rf[desc_code.lower()] - else: - df = create(rf, 'Folder', title=description, id=desc_code) - alsoProvides(df, interfaces.IDescriptorFolder) - - # articles 8, 9, 10 - for art in self._get_articles(): - self.create_rda_folder(df, desc_code, art) - - # article 11 - self.create_rda_folder(df, desc_code, 'Art11') - - return rf - - def setup_nationaldescriptors(self, parent): - """setup_nationaldescriptors""" - # National Descriptors Assessments - - if 'national-descriptors-assessments' in parent.contentIds(): - nda = parent['national-descriptors-assessments'] - else: - nda = create(parent, - 'Folder', title=u'National Descriptors Assessments') - self.set_layout(nda, '@@nat-desc-start') - alsoProvides(nda, interfaces.INationalDescriptorsFolder) - - for code, country in self._get_countries(): - self.make_country(nda, code, country) - - def setup_regionaldescriptors(self, parent): - """setup_regionaldescriptors""" - # Regional Descriptors Assessments - - if 'regional-descriptors-assessments' in parent.contentIds(): - rda = parent['regional-descriptors-assessments'] - else: - rda = create(parent, - 'Folder', title=u'Regional Descriptors Assessments') - self.set_layout(rda, '@@reg-desc-start') - alsoProvides(rda, interfaces.IRegionalDescriptorsFolder) - - for region in REGIONAL_DESCRIPTORS_REGIONS: - if not region.is_main: - continue - - self.make_region(rda, region) - - def setup_nationalsummaries(self, parent): - """setup_nationalsummaries""" - if 'national-summaries' in parent.contentIds(): - ns = parent['national-summaries'] - else: - ns = create(parent, - 'Folder', title=u'National summaries') - self.set_layout(ns, '@@nat-summary-start') - alsoProvides(ns, interfaces.INationalSummaryFolder) - - # Changing the content type for national-summaries is not possible - # need this folder to be able to edit some fields - if 'edit-summary' not in ns.contentIds(): - es = create(ns, 'wise.msfd.nationalsummaryedit', - title='National summary edit', id='edit-summary') - alsoProvides(es, interfaces.INationalSummaryEdit) - - for code, country in self._get_countries(): - if code.lower() in ns.contentIds(): - cf = ns[code.lower()] - else: - # national_summary Art. 12 (8-9-10) National report - 2018 - cf = create(ns, - 'national_summary', - title=country, - id=code) - - self.set_layout(cf, 'assessment-summary') - alsoProvides(cf, interfaces.INationalSummaryCountryFolder) - # self.create_comments_folder(cf) - - # create the country overview folder - if 'overview' in cf.contentIds(): - of = cf['overview'] - else: - of = create(cf, - 'wise.msfd.nationalsummaryoverview', - title='National summary overview', - id='overview') - - self.set_layout(of, 'national-overview') - alsoProvides(of, interfaces.INationalSummaryOverviewFolder) - - # create the Art. 16 (13-14) National report - 2022 - if 'assessment-summary-2022' in cf.contentIds(): - art16f = cf['assessment-summary-2022'] - else: - art16f = create(cf, - 'wise.msfd.nationalsummary2022', - title='National summary 2022', - id='assessment-summary-2022') - - self.set_layout(art16f, 'assessment-summary-2022') - alsoProvides(art16f, interfaces.INationalSummary2022Folder) - - def setup_regionalsummaries(self, parent): - """setup_regionalsummaries""" - if 'regional-summaries' in parent.contentIds(): - ns = parent['regional-summaries'] - else: - ns = create(parent, - 'Folder', - title=u'Regional summaries') - self.set_layout(ns, 'reg-summary-start') - alsoProvides(ns, interfaces.IRegionalSummaryFolder) - - for region in REGIONAL_DESCRIPTORS_REGIONS: - if not region.is_main: - continue - - code, name = region.code.lower(), region.title - if code in ns.contentIds(): - rf = ns[code] - else: - rf = create(ns, - 'wise.msfd.regionalsummaryfolder', - title=name, - id=code) - - rf._subregions = region.subregions - rf._countries_for_region = self._get_countries_names( - region.countries - ) - - self.set_layout(rf, 'assessment-summary') - alsoProvides(rf, interfaces.IRegionalSummaryRegionFolder) - - # create the overview folder - if 'overview' in rf.contentIds(): - of = rf['overview'] - else: - of = create(rf, - 'wise.msfd.regionalsummaryoverview', - title='Regional summary overview', - id='overview') - - self.set_layout(of, 'regional-overview') - alsoProvides(of, interfaces.IRegionalSummaryOverviewFolder) - - def setup_secondary_articles(self, parent): - """setup_secondary_articles""" - if 'national-descriptors-assessments' not in parent.contentIds(): - return - - nda_parent = parent['national-descriptors-assessments'] - country_ids = nda_parent.contentIds() - - for country in country_ids: - country_folder = nda_parent[country] - - for article in _get_secondary_articles(): - if article.lower() in country_folder.contentIds(): - nda = country_folder[article.lower()] - else: - nda = create(country_folder, - 'wise.msfd.nationaldescriptorassessment', - title=article) - - logger.info("Created NationalDescriptorAssessment %s", - nda.absolute_url()) - - alsoProvides( - nda, - interfaces.INationalDescriptorAssessmentSecondary - ) - self.set_layout(nda, '@@nat-desc-art-view-secondary') - - self.create_comments_folder(nda) - - def setup_compliancefolder(self): - """setup_compliancefolder""" - if self.context.id == self.compliance_folder_id: - return self.context - - if self.compliance_folder_id in self.context.contentIds(): - cm = self.context[self.compliance_folder_id] - else: - cm = create(self.context, 'Folder', title=u'Assessment Module') - - self.set_layout(cm, '@@landingpage') - self.set_policy(cm, 'compliance_section_policy') - - alsoProvides(cm, interfaces.IComplianceModuleFolder) - - lr = cm.__ac_local_roles__ - lr[REVIEWER_GROUP_ID] = [u'Reviewer'] - lr[EDITOR_GROUP_ID] = [u'Editor'] - - # Contributor: TL - # Reviewer: EC - # Editor: Milieu - - return cm - - def setup_msfd_reporting_history_folder(self, cm): - """setup_msfd_reporting_history_folder""" - msfd_id = 'msfd-reporting-history' - - if msfd_id in cm.contentIds(): - msfd = cm[msfd_id] - else: - msfd = create(cm, 'wise.msfd.reportinghistoryfolder', - title='MSFD reporting history', - id=msfd_id) - - logger.info("Created MSFD Reporting history folder %s", - msfd.absolute_url()) - - msfd._msfd_reporting_history_data = REPORTING_HISTORY_ENV - - alsoProvides(msfd, interfaces.IMSFDReportingHistoryFolder) - self.set_layout(msfd, '@@msfd-reporting-history') - - return msfd - - def __call__(self): - - # if self.compliance_folder_id in self.context.contentIds(): - # self.context.manage_delObjects([self.compliance_folder_id]) - - cm = self.setup_compliancefolder() - - self.setup_msfd_reporting_history_folder(cm) - - DEFAULT = 'regionaldesc,nationalsummary,regionalsummary,secondary' - targets = self.request.form.get('setup', DEFAULT) - - if targets: - targets = targets.split(',') - else: - targets = DEFAULT - - if "nationaldesc" in targets: - self.setup_nationaldescriptors(cm) - - if "regionaldesc" in targets: - self.setup_regionaldescriptors(cm) - - if "nationalsummary" in targets: - self.setup_nationalsummaries(cm) - - if "secondary" in targets: - self.setup_secondary_articles(cm) - - if 'regionalsummary' in targets: - self.setup_regionalsummaries(cm) - - alsoProvides(self.request, IDisableCSRFProtection) - - return cm.absolute_url() - - -class BootstrapAssessmentLandingpages(BootstrapCompliance): - """BootstrapAssessmentLandingpages""" - - def __call__(self): - image_url = "https://wise-test.eionet.europa.eu/policy-and-reporting/implementation-and-reports/implementation-and-reports/@@download/image/30657450808_59e1973b0b_o.jpg" - image_caption = "© Paweł Gładyś, WaterPIX /EEA" - response = requests.get(image_url) - filename = u'lead_image.png' - image = NamedBlobImage(data=response.content, filename=filename) - - reports_folder = create( - self.context, - 'Folder', - title='Reports and assessments', - id='reports-and-assessments' - ) - - landingpage = create( - reports_folder, - 'Folder', - title='EU overview - Commission reports and assessments, ' - 'Member State reports', - id='assessment-module-overview' - ) - self.set_layout(landingpage, 'landingpage') - - report_per_descr = create( - reports_folder, - 'Folder', - title=u'EU overview - Reports per Descriptor', - id='assessment-per-descriptor' - ) - report_per_descr.image = image - report_per_descr.image_caption = image_caption - self.set_layout(report_per_descr, 'reports-per-descriptor') - - countries = create(self.context, - 'Folder', - title='Assessment by Country', - id='assessment-by-country') - # self.set_layout(countries, 'landingpage') - - for code, country in self._get_countries(): - cpage = create(countries, - 'Document', - title=country, - # id=code.lower() - ) - alsoProvides(cpage, interfaces.ICountryDescriptorsFolder) - - cpage.image = image - cpage.image_caption = image_caption - cpage._ccode = code.lower() - cpage.text = RichTextValue( - '', 'text/plain', 'text/html') - self.set_layout(cpage, 'country-landingpage') - - regions = create(self.context, - 'Folder', - title='Assessment by Region', - id='assessment-by-region') - # self.set_layout(regions, 'landingpage') - - for region in REGIONAL_DESCRIPTORS_REGIONS: - if not region.is_main: - continue - - code, name = region.code.lower(), region.title - - rpage = create(regions, - 'Document', - title=name, - # id=code - ) - - alsoProvides(rpage, interfaces.IRegionalDescriptorRegionsFolder) - rpage.image = image - rpage.image_caption = image_caption - rpage._rcode = code - rpage.text = RichTextValue( - '', 'text/plain', 'text/html') - self.set_layout(rpage, 'region-landingpage') - - alsoProvides(self.request, IDisableCSRFProtection) - - return "Boostrap finished!" - - -class BoostrapMembestateRecommendations(BootstrapCompliance): - """ Bootstrap the member state recommendation pages """ - - def __call__(self): - ms_recommendation_page = create( - self.context, - 'Folder', - title='Member State responses to Article 12 recommendations \ - (2018 reports on Articles 8, 9, 10)', - id='ms-recommendations' - ) - self.set_layout(ms_recommendation_page, 'ms-recommendations-start') - - for code, country in self._get_countries(): - cpage = create(ms_recommendation_page, - 'wise.msfd.msrecommendationfeedback', - title=country, - id=code.lower() - ) - alsoProvides(cpage, interfaces.IMSRecommendationsFeedback) - - self.set_layout(cpage, 'country-ms-recommendation') - - alsoProvides(self.request, IDisableCSRFProtection) - - return "Success!" - - class CleanupCache(BrowserView): """ Remove the persistent cache that we have saved in objects """ @@ -2118,27 +1484,3 @@ def __call__(self): count = +1 return "Added %s labels" % count - - -class MigrateTranslationStorage(BrowserView): - """MigrateTranslationStorage""" - - def __call__(self): - site = portal.get() - storage = ITranslationsStorage(site) - count = 0 - - for langstore in storage.values(): - for original, translated in langstore.items(): - count = +1 - - if hasattr(translated, 'text'): - translated = translated.text - translated = Translation(translated, 'original') - - if not translated.text.startswith('?'): - translated.approved = True - - langstore[original] = translated - - return "Migrated {} strings".format(count) diff --git a/src/wise/msfd/compliance/admin/bootstrap.py b/src/wise/msfd/compliance/admin/bootstrap.py new file mode 100644 index 00000000..566f76a9 --- /dev/null +++ b/src/wise/msfd/compliance/admin/bootstrap.py @@ -0,0 +1,654 @@ +# pylint: skip-file +""" admin.py """ +# coding=utf-8 +from __future__ import absolute_import +from __future__ import print_function +import logging +import requests + +from zope.interface import alsoProvides + +from plone.api.content import transition +from plone.app.textfield.value import RichTextValue +from plone.dexterity.utils import createContentInContainer as create +from plone.namedfile.file import NamedBlobImage +from plone.protect.interfaces import IDisableCSRFProtection +from Products.CMFDynamicViewFTI.interfaces import ISelectableBrowserDefault +from Products.CMFPlacefulWorkflow.WorkflowPolicyConfig import \ + WorkflowPolicyConfig +from Products.Five.browser import BrowserView +from wise.msfd import db + +from wise.msfd.compliance.vocabulary import (get_all_countries, + get_regions_for_country, + REGIONAL_DESCRIPTORS_REGIONS, + REPORTING_HISTORY_ENV) +from wise.msfd.gescomponents import get_all_descriptors + +from .admin import CONTRIBUTOR_GROUP_ID, REVIEWER_GROUP_ID, EDITOR_GROUP_ID +from .. import interfaces +from ..base import _get_secondary_articles + + +logger = logging.getLogger('wise.msfd') + + +class BootstrapCompliance(BrowserView): + """ Bootstrap the compliance module by creating all needed country folders + /bootstrap-compliance?setup=nationaldesc&production=1 + """ + + compliance_folder_id = 'assessment-module' + + @property + def debug(self): + return 'production' not in self.request.form + + def _get_countries(self): + """ Get a list of (code, name) countries + """ + + countries = get_all_countries() + + if self.debug: + countries = [x for x in countries if x[0] in ('LV', 'NL', 'DE')] + + return countries + + @db.use_db_session('2018') + def _get_countries_names(self, country_codes): + result = [] + all_countries = self._get_countries() + + for code in country_codes: + result.extend([x for x in all_countries if x[0] == code]) + + return result + + def _get_descriptors(self): + """ Get a list of (code, description) descriptors + """ + + descriptors = get_all_descriptors() + descriptors = [d for d in descriptors if d[0] != 'D1'] + + debug_descriptors = ('D1.1', 'D4', 'D5', 'D6') + + if self.debug: + descriptors = [x for x in descriptors if x[0] in debug_descriptors] + + return descriptors + + def _get_articles(self): + """_get_articles""" + return ['Art8', 'Art9', 'Art10', 'Art8-2024', 'Art9-2024', 'Art10-2024'] + + def set_layout(self, obj, name): + """set_layout""" + ISelectableBrowserDefault(obj).setLayout(name) + + def set_policy(self, context, name): + """set_policy""" + logger.info("Set placeful workflow policy for %s", context.getId()) + config = WorkflowPolicyConfig( + workflow_policy_in='compliance_section_policy', + workflow_policy_below='compliance_section_policy', + ) + context._setObject(config.id, config) + + @db.use_db_session('2018') + def get_country_regions(self, country_code): + """get_country_regions""" + regions = get_regions_for_country(country_code) + + return regions + + def get_group(self, code): + """get_group""" + if '.' in code: + code = 'd1' + code = code.lower() + + return "{}-{}".format(CONTRIBUTOR_GROUP_ID, code) + + def create_comments_folder(self, content): + """create_comments_folder""" + for id, title, trans in [ + (u'tl', 'Discussion track with Topic Leads', 'open_for_tl'), + (u'ec', 'Discussion track with EC', 'open_for_ec'), + ]: + if id not in content.contentIds(): + dt = create(content, + 'wise.msfd.commentsfolder', + id=id, + title=title) + transition(obj=dt, transition=trans) + + def create_nda_folder(self, df, desc_code, art, + layout='@@nat-desc-art-view'): + """create_nda_folder""" + if '2024' in art: + layout = '@@nat-desc-art-view-2024' + + if art.lower() in df.contentIds(): + nda = df[art.lower()] + else: + nda = create(df, + 'wise.msfd.nationaldescriptorassessment', + title=art) + lr = nda.__ac_local_roles__ + + group = self.get_group(desc_code) + + lr[group] = ['Contributor'] + + logger.info("Created NationalDescriptorAssessment %s", + nda.absolute_url()) + + self.set_layout(nda, layout) + + self.create_comments_folder(nda) + + def create_rda_folder(self, df, desc_code, art): + """create_rda_folder""" + if art.lower() in df.contentIds(): + rda = df[art.lower()] + else: + rda = create(df, + 'wise.msfd.regionaldescriptorassessment', + title=art) + + lr = rda.__ac_local_roles__ + group = self.get_group(desc_code) + lr[group] = ['Contributor'] + + logger.info("Created RegionalDescriptorArticle %s", + rda.absolute_url()) + + self.set_layout(rda, '@@reg-desc-art-view') + alsoProvides(rda, interfaces.IRegionalDescriptorAssessment) + + self.create_comments_folder(rda) + + def make_country(self, parent, country_code, name): + """make_country""" + if country_code.lower() in parent.contentIds(): + cf = parent[country_code.lower()] + else: + cf = create(parent, + 'wise.msfd.countrydescriptorsfolder', + title=name, + id=country_code) + + # create 2022 Cross cutting assessment folder + art = 'cross-cutting-2022' + if art.lower() in cf.contentIds(): + nda = cf[art.lower()] + else: + nda = create(cf, + 'wise.msfd.nationaldescriptorassessment', + title=art) + + logger.info("Created NationalDescriptorAssessment %s", + nda.absolute_url()) + + self.set_layout(nda, '@@nat-desc-art-view-cross-cutting') + + # Art 13 create 2022 completeness assessment folder + art = 'art13-completeness-2022' + if art.lower() in cf.contentIds(): + nda = cf[art.lower()] + else: + nda = create(cf, + 'wise.msfd.nationaldescriptorassessment', + title=art) + + logger.info("Created NationalDescriptorAssessment %s", + nda.absolute_url()) + + self.set_layout(nda, '@@nat-desc-art-view-completeness') + nda._article = 'Art13Completeness' + + # Art 14 create 2022 completeness assessment folder + art = 'art14-completeness-2022' + if art.lower() in cf.contentIds(): + nda = cf[art.lower()] + else: + nda = create(cf, + 'wise.msfd.nationaldescriptorassessment', + title=art) + + logger.info("Created NationalDescriptorAssessment %s", + nda.absolute_url()) + + self.set_layout(nda, '@@nat-desc-art-view-completeness') + nda._article = 'Art14Completeness' + + for regid, region in self.get_country_regions(country_code): + if regid.lower() in cf.contentIds(): + reg = cf[regid.lower()] + else: + reg = create(cf, + 'Folder', + title=region, + id=regid.lower()) + alsoProvides(reg, interfaces.INationalRegionDescriptorFolder) + self.set_layout(reg, '@@nat-desc-reg-view') + + for desc_code, description in self._get_descriptors(): + if desc_code.lower() in reg.contentIds(): + df = reg[desc_code.lower()] + else: + df = create(reg, 'Folder', title=description, id=desc_code) + alsoProvides(df, interfaces.IDescriptorFolder) + + # articles 8, 9, 10 + for art in self._get_articles(): + self.create_nda_folder(df, desc_code, art) + + # article 11 + self.create_nda_folder(df, desc_code, 'Art11') + + # article 13, 14, 18 + self.create_nda_folder(df, desc_code, 'Art13', + '@@nat-desc-art-view-2022') + self.create_nda_folder(df, desc_code, 'Art14', + '@@nat-desc-art-view-2022') + self.create_nda_folder(df, desc_code, 'Art18') + + return cf + + def make_region(self, parent, region): + """make_region""" + code, name = region.code.lower(), region.title + + if code.lower() in parent.contentIds(): + rf = parent[code.lower()] + else: + rf = create(parent, + 'wise.msfd.regiondescriptorsfolder', + title=name, + id=code) + + rf._subregions = region.subregions + rf._countries_for_region = self._get_countries_names( + region.countries + ) + self.set_layout(rf, '@@reg-region-start') + alsoProvides(rf, interfaces.IRegionalDescriptorRegionsFolder) + + for desc_code, description in self._get_descriptors(): + if desc_code.lower() in rf.contentIds(): + df = rf[desc_code.lower()] + else: + df = create(rf, 'Folder', title=description, id=desc_code) + alsoProvides(df, interfaces.IDescriptorFolder) + + # articles 8, 9, 10 + for art in self._get_articles(): + self.create_rda_folder(df, desc_code, art) + + # article 11 + self.create_rda_folder(df, desc_code, 'Art11') + + return rf + + def setup_nationaldescriptors(self, parent): + """setup_nationaldescriptors""" + # National Descriptors Assessments + + if 'national-descriptors-assessments' in parent.contentIds(): + nda = parent['national-descriptors-assessments'] + else: + nda = create(parent, + 'Folder', title=u'National Descriptors Assessments') + self.set_layout(nda, '@@nat-desc-start') + alsoProvides(nda, interfaces.INationalDescriptorsFolder) + + for code, country in self._get_countries(): + self.make_country(nda, code, country) + + def setup_regionaldescriptors(self, parent): + """setup_regionaldescriptors""" + # Regional Descriptors Assessments + + if 'regional-descriptors-assessments' in parent.contentIds(): + rda = parent['regional-descriptors-assessments'] + else: + rda = create(parent, + 'Folder', title=u'Regional Descriptors Assessments') + self.set_layout(rda, '@@reg-desc-start') + alsoProvides(rda, interfaces.IRegionalDescriptorsFolder) + + for region in REGIONAL_DESCRIPTORS_REGIONS: + if not region.is_main: + continue + + self.make_region(rda, region) + + def setup_nationalsummaries(self, parent): + """setup_nationalsummaries""" + if 'national-summaries' in parent.contentIds(): + ns = parent['national-summaries'] + else: + ns = create(parent, + 'Folder', title=u'National summaries') + self.set_layout(ns, '@@nat-summary-start') + alsoProvides(ns, interfaces.INationalSummaryFolder) + + # Changing the content type for national-summaries is not possible + # need this folder to be able to edit some fields + if 'edit-summary' not in ns.contentIds(): + es = create(ns, 'wise.msfd.nationalsummaryedit', + title='National summary edit', id='edit-summary') + alsoProvides(es, interfaces.INationalSummaryEdit) + + for code, country in self._get_countries(): + if code.lower() in ns.contentIds(): + cf = ns[code.lower()] + else: + # national_summary Art. 12 (8-9-10) National report - 2018 + cf = create(ns, + 'national_summary', + title=country, + id=code) + + self.set_layout(cf, 'assessment-summary') + alsoProvides(cf, interfaces.INationalSummaryCountryFolder) + # self.create_comments_folder(cf) + + # create the country overview folder + if 'overview' in cf.contentIds(): + of = cf['overview'] + else: + of = create(cf, + 'wise.msfd.nationalsummaryoverview', + title='National summary overview', + id='overview') + + self.set_layout(of, 'national-overview') + alsoProvides(of, interfaces.INationalSummaryOverviewFolder) + + # create the Art. 16 (13-14) National report - 2022 + if 'assessment-summary-2022' in cf.contentIds(): + art16f = cf['assessment-summary-2022'] + else: + art16f = create(cf, + 'wise.msfd.nationalsummary2022', + title='National summary 2022', + id='assessment-summary-2022') + + self.set_layout(art16f, 'assessment-summary-2022') + alsoProvides(art16f, interfaces.INationalSummary2022Folder) + + def setup_regionalsummaries(self, parent): + """setup_regionalsummaries""" + if 'regional-summaries' in parent.contentIds(): + ns = parent['regional-summaries'] + else: + ns = create(parent, + 'Folder', + title=u'Regional summaries') + self.set_layout(ns, 'reg-summary-start') + alsoProvides(ns, interfaces.IRegionalSummaryFolder) + + for region in REGIONAL_DESCRIPTORS_REGIONS: + if not region.is_main: + continue + + code, name = region.code.lower(), region.title + if code in ns.contentIds(): + rf = ns[code] + else: + rf = create(ns, + 'wise.msfd.regionalsummaryfolder', + title=name, + id=code) + + rf._subregions = region.subregions + rf._countries_for_region = self._get_countries_names( + region.countries + ) + + self.set_layout(rf, 'assessment-summary') + alsoProvides(rf, interfaces.IRegionalSummaryRegionFolder) + + # create the overview folder + if 'overview' in rf.contentIds(): + of = rf['overview'] + else: + of = create(rf, + 'wise.msfd.regionalsummaryoverview', + title='Regional summary overview', + id='overview') + + self.set_layout(of, 'regional-overview') + alsoProvides(of, interfaces.IRegionalSummaryOverviewFolder) + + def setup_secondary_articles(self, parent): + """setup_secondary_articles""" + if 'national-descriptors-assessments' not in parent.contentIds(): + return + + nda_parent = parent['national-descriptors-assessments'] + country_ids = nda_parent.contentIds() + + for country in country_ids: + country_folder = nda_parent[country] + + for article in _get_secondary_articles(): + if article.lower() in country_folder.contentIds(): + nda = country_folder[article.lower()] + else: + nda = create(country_folder, + 'wise.msfd.nationaldescriptorassessment', + title=article) + + logger.info("Created NationalDescriptorAssessment %s", + nda.absolute_url()) + + alsoProvides( + nda, + interfaces.INationalDescriptorAssessmentSecondary + ) + self.set_layout(nda, '@@nat-desc-art-view-secondary') + + self.create_comments_folder(nda) + + def setup_compliancefolder(self): + """setup_compliancefolder""" + if self.context.id == self.compliance_folder_id: + return self.context + + if self.compliance_folder_id in self.context.contentIds(): + cm = self.context[self.compliance_folder_id] + else: + cm = create(self.context, 'Folder', title=u'Assessment Module') + + self.set_layout(cm, '@@landingpage') + self.set_policy(cm, 'compliance_section_policy') + + alsoProvides(cm, interfaces.IComplianceModuleFolder) + + lr = cm.__ac_local_roles__ + lr[REVIEWER_GROUP_ID] = [u'Reviewer'] + lr[EDITOR_GROUP_ID] = [u'Editor'] + + # Contributor: TL + # Reviewer: EC + # Editor: Milieu + + return cm + + def setup_msfd_reporting_history_folder(self, cm): + """setup_msfd_reporting_history_folder""" + msfd_id = 'msfd-reporting-history' + + if msfd_id in cm.contentIds(): + msfd = cm[msfd_id] + else: + msfd = create(cm, 'wise.msfd.reportinghistoryfolder', + title='MSFD reporting history', + id=msfd_id) + + logger.info("Created MSFD Reporting history folder %s", + msfd.absolute_url()) + + msfd._msfd_reporting_history_data = REPORTING_HISTORY_ENV + + alsoProvides(msfd, interfaces.IMSFDReportingHistoryFolder) + self.set_layout(msfd, '@@msfd-reporting-history') + + return msfd + + def __call__(self): + + # if self.compliance_folder_id in self.context.contentIds(): + # self.context.manage_delObjects([self.compliance_folder_id]) + + cm = self.setup_compliancefolder() + + self.setup_msfd_reporting_history_folder(cm) + + DEFAULT = 'regionaldesc,nationalsummary,regionalsummary,secondary' + targets = self.request.form.get('setup', DEFAULT) + + if targets: + targets = targets.split(',') + else: + targets = DEFAULT + + if "nationaldesc" in targets: + self.setup_nationaldescriptors(cm) + + if "regionaldesc" in targets: + self.setup_regionaldescriptors(cm) + + if "nationalsummary" in targets: + self.setup_nationalsummaries(cm) + + if "secondary" in targets: + self.setup_secondary_articles(cm) + + if 'regionalsummary' in targets: + self.setup_regionalsummaries(cm) + + alsoProvides(self.request, IDisableCSRFProtection) + + return cm.absolute_url() + + +class BootstrapAssessmentLandingpages(BootstrapCompliance): + """BootstrapAssessmentLandingpages""" + + def __call__(self): + image_url = "https://wise-test.eionet.europa.eu/policy-and-reporting/implementation-and-reports/implementation-and-reports/@@download/image/30657450808_59e1973b0b_o.jpg" + image_caption = "© Paweł Gładyś, WaterPIX /EEA" + response = requests.get(image_url) + filename = u'lead_image.png' + image = NamedBlobImage(data=response.content, filename=filename) + + reports_folder = create( + self.context, + 'Folder', + title='Reports and assessments', + id='reports-and-assessments' + ) + + landingpage = create( + reports_folder, + 'Folder', + title='EU overview - Commission reports and assessments, ' + 'Member State reports', + id='assessment-module-overview' + ) + self.set_layout(landingpage, 'landingpage') + + report_per_descr = create( + reports_folder, + 'Folder', + title=u'EU overview - Reports per Descriptor', + id='assessment-per-descriptor' + ) + report_per_descr.image = image + report_per_descr.image_caption = image_caption + self.set_layout(report_per_descr, 'reports-per-descriptor') + + countries = create(self.context, + 'Folder', + title='Assessment by Country', + id='assessment-by-country') + # self.set_layout(countries, 'landingpage') + + for code, country in self._get_countries(): + cpage = create(countries, + 'Document', + title=country, + # id=code.lower() + ) + alsoProvides(cpage, interfaces.ICountryDescriptorsFolder) + + cpage.image = image + cpage.image_caption = image_caption + cpage._ccode = code.lower() + cpage.text = RichTextValue( + '', 'text/plain', 'text/html') + self.set_layout(cpage, 'country-landingpage') + + regions = create(self.context, + 'Folder', + title='Assessment by Region', + id='assessment-by-region') + # self.set_layout(regions, 'landingpage') + + for region in REGIONAL_DESCRIPTORS_REGIONS: + if not region.is_main: + continue + + code, name = region.code.lower(), region.title + + rpage = create(regions, + 'Document', + title=name, + # id=code + ) + + alsoProvides(rpage, interfaces.IRegionalDescriptorRegionsFolder) + rpage.image = image + rpage.image_caption = image_caption + rpage._rcode = code + rpage.text = RichTextValue( + '', 'text/plain', 'text/html') + self.set_layout(rpage, 'region-landingpage') + + alsoProvides(self.request, IDisableCSRFProtection) + + return "Boostrap finished!" + + +class BoostrapMembestateRecommendations(BootstrapCompliance): + """ Bootstrap the member state recommendation pages """ + + def __call__(self): + ms_recommendation_page = create( + self.context, + 'Folder', + title='Member State responses to Article 12 recommendations \ + (2018 reports on Articles 8, 9, 10)', + id='ms-recommendations' + ) + self.set_layout(ms_recommendation_page, 'ms-recommendations-start') + + for code, country in self._get_countries(): + cpage = create(ms_recommendation_page, + 'wise.msfd.msrecommendationfeedback', + title=country, + id=code.lower() + ) + alsoProvides(cpage, interfaces.IMSRecommendationsFeedback) + + self.set_layout(cpage, 'country-ms-recommendation') + + alsoProvides(self.request, IDisableCSRFProtection) + + return "Success!" diff --git a/src/wise/msfd/compliance/admin.zcml b/src/wise/msfd/compliance/admin/configure.zcml similarity index 86% rename from src/wise/msfd/compliance/admin.zcml rename to src/wise/msfd/compliance/admin/configure.zcml index 9d3fe34d..263bd670 100644 --- a/src/wise/msfd/compliance/admin.zcml +++ b/src/wise/msfd/compliance/admin/configure.zcml @@ -15,21 +15,21 @@ @@ -105,7 +105,14 @@ + + diff --git a/src/wise/msfd/compliance/admin/migrate.py b/src/wise/msfd/compliance/admin/migrate.py new file mode 100644 index 00000000..eb29b887 --- /dev/null +++ b/src/wise/msfd/compliance/admin/migrate.py @@ -0,0 +1,143 @@ +# pylint: skip-file +""" admin.py """ +# coding=utf-8 +from __future__ import absolute_import +from __future__ import print_function +import logging +import transaction + +from zope.interface import alsoProvides + +from plone import api +from plone.api import portal + +from plone.protect.interfaces import IDisableCSRFProtection +from Products.CMFCore.utils import getToolByName +from Products.Five.browser import BrowserView + +from wise.msfd.translation import Translation +from wise.msfd.translation.interfaces import ITranslationsStorage + + +from plone.base.interfaces import IPloneSiteRoot +from plone.dexterity.interfaces import IDexterityContent + + +logger = logging.getLogger('wise.msfd') + + +class MigrateTranslationStorage(BrowserView): + """MigrateTranslationStorage""" + + def __call__(self): + site = portal.get() + storage = ITranslationsStorage(site) + count = 0 + + for langstore in storage.values(): + for original, translated in langstore.items(): + count = +1 + + if hasattr(translated, 'text'): + translated = translated.text + translated = Translation(translated, 'original') + + if not translated.text.startswith('?'): + translated.approved = True + + langstore[original] = translated + + return "Migrated {} strings".format(count) + + +class MigrateEionetGroups(BrowserView): + """Migrate local roles from extranet- groups to local- groups""" + + def migrate_local_roles(self, obj, dry_run=True): + changed = False + local_roles = obj.get_local_roles() + portal_groups = getToolByName(obj, "portal_groups") + + for principal, roles in local_roles: + if principal.startswith("extranet-"): + new_principal = principal.replace("extranet-", "local-") + existing_roles = dict(local_roles).get(new_principal, []) + if set(roles).issubset(set(existing_roles)): + continue + + final_roles = list(set(roles) | set(existing_roles)) + logger.info( + "Migrating %s -> %s on %s", + principal, new_principal, obj.absolute_url(1) + ) + + if not dry_run: + if not portal_groups.getGroupById(new_principal): + portal_groups.addGroup(new_principal) + obj.manage_setLocalRoles(new_principal, final_roles) + changed = True + + return changed + + def __call__(self): + alsoProvides(self.request, IDisableCSRFProtection) + dry_run = not self.request.get("run") + portal = api.portal.get() + + stack = [(portal, "")] + seen_paths = set() + total_objects = 0 + modified_objects = 0 + + while stack: + obj, current_rel_path = stack.pop() + try: + path = obj.absolute_url(1) + except Exception: + path = current_rel_path + + if path in seen_paths: + continue + seen_paths.add(path) + total_objects += 1 + + try: + if self.migrate_local_roles(obj, dry_run=dry_run): + modified_objects += 1 + except Exception as e: + logger.error("Error processing %s: %s", path, e) + + if hasattr(obj, "objectValues"): + try: + children = obj.objectValues() + except Exception as e: + logger.error("Error getting children for %s: %s", path, e) + continue + + for child in children: + try: + child_id = child.getId() + except Exception: + continue + + if not ( + IDexterityContent.providedBy(child) + or IPloneSiteRoot.providedBy(child) + ): + continue + + child_rel_path = ( + f"{current_rel_path}/{child_id}" + if current_rel_path else child_id + ) + stack.append((child, child_rel_path)) + + if not dry_run: + transaction.commit() + + return ( + f"Migration finished.\n" + f"Total objects processed: {total_objects}\n" + f"Total objects modified: {modified_objects}\n" + f"{"Dry run - no changes committed." if dry_run else "Changes committed."}" + ) diff --git a/src/wise/msfd/compliance/pt/admin-scoring.pt b/src/wise/msfd/compliance/admin/pt/admin-scoring.pt similarity index 100% rename from src/wise/msfd/compliance/pt/admin-scoring.pt rename to src/wise/msfd/compliance/admin/pt/admin-scoring.pt diff --git a/src/wise/msfd/compliance/pt/admin-users.pt b/src/wise/msfd/compliance/admin/pt/admin-users.pt similarity index 100% rename from src/wise/msfd/compliance/pt/admin-users.pt rename to src/wise/msfd/compliance/admin/pt/admin-users.pt diff --git a/src/wise/msfd/compliance/pt/admin.pt b/src/wise/msfd/compliance/admin/pt/admin.pt similarity index 100% rename from src/wise/msfd/compliance/pt/admin.pt rename to src/wise/msfd/compliance/admin/pt/admin.pt diff --git a/src/wise/msfd/compliance/configure.zcml b/src/wise/msfd/compliance/configure.zcml index 1d51f095..b393f8aa 100644 --- a/src/wise/msfd/compliance/configure.zcml +++ b/src/wise/msfd/compliance/configure.zcml @@ -9,7 +9,7 @@ - + Date: Wed, 25 Mar 2026 11:22:09 +0200 Subject: [PATCH 04/11] small change to migrate local roles --- src/wise/msfd/compliance/admin/migrate.py | 24 ++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/wise/msfd/compliance/admin/migrate.py b/src/wise/msfd/compliance/admin/migrate.py index eb29b887..89f744a3 100644 --- a/src/wise/msfd/compliance/admin/migrate.py +++ b/src/wise/msfd/compliance/admin/migrate.py @@ -53,13 +53,15 @@ def __call__(self): class MigrateEionetGroups(BrowserView): """Migrate local roles from extranet- groups to local- groups""" - def migrate_local_roles(self, obj, dry_run=True): + def migrate_local_roles(self, obj, principal_counts, dry_run=True): changed = False local_roles = obj.get_local_roles() portal_groups = getToolByName(obj, "portal_groups") for principal, roles in local_roles: if principal.startswith("extranet-"): + principal_counts[principal] = principal_counts.get(principal, 0) + 1 + new_principal = principal.replace("extranet-", "local-") existing_roles = dict(local_roles).get(new_principal, []) if set(roles).issubset(set(existing_roles)): @@ -87,7 +89,7 @@ def __call__(self): stack = [(portal, "")] seen_paths = set() total_objects = 0 - modified_objects = 0 + principal_counts = {} while stack: obj, current_rel_path = stack.pop() @@ -102,8 +104,7 @@ def __call__(self): total_objects += 1 try: - if self.migrate_local_roles(obj, dry_run=dry_run): - modified_objects += 1 + self.migrate_local_roles(obj, principal_counts, dry_run=dry_run) except Exception as e: logger.error("Error processing %s: %s", path, e) @@ -135,9 +136,14 @@ def __call__(self): if not dry_run: transaction.commit() - return ( - f"Migration finished.\n" - f"Total objects processed: {total_objects}\n" - f"Total objects modified: {modified_objects}\n" - f"{"Dry run - no changes committed." if dry_run else "Changes committed."}" + lines = [f"Migration finished.", f"Total objects processed: {total_objects}", ""] + + for name in sorted(principal_counts): + lines.append(f"{name}: {principal_counts[name]} objects") + + lines.append("") + lines.append( + "Dry run - no changes committed." if dry_run else "Changes committed." ) + + return "\n".join(lines) From f9b7dbf1ca967ecac75bda7a7eeadf75b1e2a11a Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 25 Mar 2026 11:34:22 +0200 Subject: [PATCH 05/11] fix migrate local roles running time --- src/wise/msfd/compliance/admin/migrate.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/wise/msfd/compliance/admin/migrate.py b/src/wise/msfd/compliance/admin/migrate.py index 89f744a3..ad5f0831 100644 --- a/src/wise/msfd/compliance/admin/migrate.py +++ b/src/wise/msfd/compliance/admin/migrate.py @@ -53,10 +53,10 @@ def __call__(self): class MigrateEionetGroups(BrowserView): """Migrate local roles from extranet- groups to local- groups""" - def migrate_local_roles(self, obj, principal_counts, dry_run=True): + def migrate_local_roles(self, obj, principal_counts, portal_groups, + seen_groups, dry_run=True): changed = False local_roles = obj.get_local_roles() - portal_groups = getToolByName(obj, "portal_groups") for principal, roles in local_roles: if principal.startswith("extranet-"): @@ -74,8 +74,10 @@ def migrate_local_roles(self, obj, principal_counts, dry_run=True): ) if not dry_run: - if not portal_groups.getGroupById(new_principal): - portal_groups.addGroup(new_principal) + if new_principal not in seen_groups: + if not portal_groups.getGroupById(new_principal): + portal_groups.addGroup(new_principal) + seen_groups.add(new_principal) obj.manage_setLocalRoles(new_principal, final_roles) changed = True @@ -85,11 +87,13 @@ def __call__(self): alsoProvides(self.request, IDisableCSRFProtection) dry_run = not self.request.get("run") portal = api.portal.get() + portal_groups = getToolByName(portal, "portal_groups") stack = [(portal, "")] seen_paths = set() total_objects = 0 principal_counts = {} + seen_groups = set() while stack: obj, current_rel_path = stack.pop() @@ -104,10 +108,17 @@ def __call__(self): total_objects += 1 try: - self.migrate_local_roles(obj, principal_counts, dry_run=dry_run) + self.migrate_local_roles( + obj, principal_counts, portal_groups, + seen_groups, dry_run=dry_run + ) except Exception as e: logger.error("Error processing %s: %s", path, e) + if not dry_run and total_objects % 1000 == 0: + transaction.commit() + logger.info("Committed batch at %d objects", total_objects) + if hasattr(obj, "objectValues"): try: children = obj.objectValues() From 38facd048b73474456dbc97029c13bea32cd57be Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Fri, 27 Mar 2026 17:46:22 +0200 Subject: [PATCH 06/11] fix compliance users view --- src/wise/msfd/compliance/admin/configure.zcml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wise/msfd/compliance/admin/configure.zcml b/src/wise/msfd/compliance/admin/configure.zcml index 263bd670..e10c127c 100644 --- a/src/wise/msfd/compliance/admin/configure.zcml +++ b/src/wise/msfd/compliance/admin/configure.zcml @@ -53,7 +53,7 @@ name="compliance-users" class=".admin.ComplianceAdmin" template="./pt/admin-users.pt" - permission="zope2.View" + permission="wise.ManageCompliance" /> Date: Tue, 31 Mar 2026 14:07:04 +0300 Subject: [PATCH 07/11] fix national summary to exclude 2024 articles --- src/wise/msfd/compliance/assessment.py | 2 ++ src/wise/msfd/compliance/nationalsummary/assessmentsummary.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/wise/msfd/compliance/assessment.py b/src/wise/msfd/compliance/assessment.py index 4f05aa03..2eb4a011 100644 --- a/src/wise/msfd/compliance/assessment.py +++ b/src/wise/msfd/compliance/assessment.py @@ -1640,6 +1640,8 @@ def setup_descriptor_level_assessment_data(self, country_code=None): if article in self.skip_articles: continue + if '-' in article: + continue assess_data = self._get_assessment_data(article_folder) article_data = self._get_article_data( diff --git a/src/wise/msfd/compliance/nationalsummary/assessmentsummary.py b/src/wise/msfd/compliance/nationalsummary/assessmentsummary.py index 1459f765..500c7493 100644 --- a/src/wise/msfd/compliance/nationalsummary/assessmentsummary.py +++ b/src/wise/msfd/compliance/nationalsummary/assessmentsummary.py @@ -157,6 +157,8 @@ def setup_data(self): for article_folder in self.get_article_folders(descr_folder): if article_folder.title in self.skip_articles: continue + if '-' in article_folder.title: + continue score = self.get_overall_score( region_folder.id.upper(), descr_folder.id.upper(), From a208f5c59e4bed4278b71c61dbc919b7af1483e7 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 1 Apr 2026 13:31:37 +0300 Subject: [PATCH 08/11] fix: assessment module compliance.js --- src/wise/msfd/compliance/pt/js-resources.pt | 2 +- src/wise/msfd/static/wise/dist/js/compliance.js | 2 +- src/wise/msfd/static/wise/dist/js/compliance.js.map | 2 +- src/wise/msfd/static/wise/src/js/compliance.js | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/wise/msfd/compliance/pt/js-resources.pt b/src/wise/msfd/compliance/pt/js-resources.pt index 637d443c..3d9fdb38 100644 --- a/src/wise/msfd/compliance/pt/js-resources.pt +++ b/src/wise/msfd/compliance/pt/js-resources.pt @@ -8,7 +8,7 @@ - + diff --git a/src/wise/msfd/static/wise/dist/js/compliance.js b/src/wise/msfd/static/wise/dist/js/compliance.js index 1eaeebf5..c21acf24 100644 --- a/src/wise/msfd/static/wise/dist/js/compliance.js +++ b/src/wise/msfd/static/wise/dist/js/compliance.js @@ -1,2 +1,2 @@ -!function(p,u,b){function g(){var t=b(".overflow-table"),o=b(p);t.each(function(){var e=b(this),t=e,s=b(".top-scroll",t),i=s.find(".top-scroll-inner"),a=b(".inner",t),n=b(".table-report",t).outerWidth(includeMargin=!0),l=n+b("th",t).width(),r=b(".scroll-wrapper",t);i.width(n),s.on("scroll",function(){a.scrollLeft(b(this).scrollLeft())}),a.on("scroll",function(){s.scrollLeft(b(this).scrollLeft())}),l>e.width()&&o.on("resize scroll",function(){var t=o.scrollTop();e.isInViewport()?r.addClass("fixed-scroll"):r.removeClass("fixed-scroll"),t>=e.offset().top+e.outerHeight()-p.innerHeight?r.hide():r.show()})})}b.fn.fixTableHeaderAndCellsHeight=function(){this.each(function(){b("th",this).each(function(t){var e,s,i,a,n,l,r;b(this).parents("table").hasClass("skip-height-fix")||(a=b(this).parents(".overflow-table").hasClass("side-by-side-table-left"),b(this).parents(".overflow-table").hasClass("side-by-side-table-right")||(s=(e=b(this)).parent().children('td:not(".sub-header")'),a&&(a=b(b(this).parents(".overflow-table.side-by-side-table").siblings(".overflow-table.side-by-side-table-right").find("tr")[t]).children(),s=b.merge(s,a)),t=b("td.sub-header",e.parent()),i=[],s.each(function(){var t,e=b(this);e.hasClass("translatable")?(t=e.find(".tr-text").height(),i.push(t)):i.push(e.height())}),a=Math.max.apply(Math,i),n=Math.max(e.height(),t.height(),a),e.height(n),t.height(n),l=e.height(),r=e.innerHeight(),a<=l&&s.each(function(){b(this).hasClass("translatable")?b(this).height(r):b(this).height(l)}),b("div",this).css("margin-top","-4px")))})})},b.fn.fixTableHeaderHeight=function(){this.each(function(){b(this).parents("table").hasClass("skip-height-fix")||b("th",this).each(function(t){var e,s,i=b(this),a=b("td",i.parent()),n=[],l=b(this).parents(".overflow-table").hasClass("side-by-side-table-left");b(this).parents(".overflow-table").hasClass("side-by-side-table-right")||l||(l&&(e=(t=b(b(this).parents(".overflow-table.side-by-side-table").siblings(".overflow-table.side-by-side-table-right").find("tr")[t])).children("td"),s=t.children("th"),a=b.merge(a,e)),a.each(function(){var t,e=b(this);e.hasClass("translatable")?(t=e.find(".tr-text").height(),n.push(t)):n.push(e.height())}),t=Math.max.apply(Math,n),i.height(t),l&&s.height(t))})})},b.fn.simplifyTable=function(){var t=b(this),i=(t.data("original")||t.data("original",t.html()),{curentLevel:0,setlimits:[{level:-1,limits:[]}]});b("tr",this).each(function(){var t,a,e,n,s,l;a=i,e=[],n=[],s=null!=(s=b(t=this).data("level"))?parseInt(s):-1,b(a.setlimits).each(function(){if(this.level==s)return n=this.limits,!1}),0==n.length&&(n=a.setlimits[a.setlimits.length-1].limits),b("td",t).not(".sub-header").each(function(t){0!=e.length&&!n.includes(t)&&b(this).text().trim()==b(e.last().last()).text().trim()?e.last().push(this):e.push([this])}),b(e).each(function(){var t;1
').insertAfter(b(".overflow-table").find(".inner")),b(".overflow-table").each(function(){var t=b(this).find("table"),e=b(''),s=b('
');s.find("button.reset-pins").click(function(){($ftw=b(this).closest(".fixed-table-wrapper")).removeClass("sticky-table"),$ftw.find("tr").remove(),($innerTable=$ftw.siblings(".inner")).find("tr input").prop("checked",!1)}),(t.find("td.sub-header").length?t.find("td.sub-header"):t.find("th div")).append(e),s.insertBefore(b(this).find(".inner"))});var o=b(".first-header");if(0!==o.length){var c,f="",f=o[0].firstElementChild.innerText;for(i=1;i *").css("display","none"),b("#process-state-change-bulk-wrapper .process-state-change-message").fadeIn(200),b.ajax({url:e,type:"POST",data:t.serialize(),success:function(){location.reload()}})}),b("#process-state-change-bulk-wrapper .btn-clear-checkboxes").click(function(){b(".assessment-status-td.enable-process-state-change input[name='process-state-change']").each(function(){b(this).prop("checked",!1)}),b("#process-state-change-bulk-wrapper").css("display","none"),b("#process-state-change-bulk-wrapper #form-process-state-change-bulk input[name='process-state-change']").remove()}),b(".assessment-status-td.enable-process-state-change").each(function(){var t=b(this),e=t.find(".assessment-status-wrapper form").last().attr("action");b("").attr("name","process-state-change").attr("value",e).appendTo(t).change(function(){var t,e,s=b(this).attr("value");b(this).is(":checked")?(0===b("#form-process-state-change-bulk").find("input[value='"+s+"' ]").length&&(console.log("this: ",b(this)),b(this).clone().attr("type","hidden").appendTo("#form-process-state-change-bulk")),(t=b(this).parent("td").find(".phase-selector").clone(!1).attr("id","process-state-bulk-select")).find(".select2-container").remove(),t.find("select").show().css("display",""),e=t.find("select").removeClass("select2-offscreen select2-hidden-accessible").removeAttr("data-select2-id").removeAttr("tabindex").removeAttr("aria-hidden").removeAttr("style"),b("#form-process-state-change-bulk .phase-selector").replaceWith(t),"function"==typeof e.select2&&e.select2({width:"250px",minimumResultsForSearch:-1}),b("#process-state-change-bulk-wrapper").css("display","block")):(b("#form-process-state-change-bulk").find("input[value='"+s+"' ]").remove(),0===b("#form-process-state-change-bulk").find("input[name='process-state-change']").length&&((e=b("#form-process-state-change-bulk .phase-selector select")).data("select2")&&e.select2("destroy"),e.remove(),b("#process-state-change-bulk-wrapper").css("display","none")))})})})})}(window,document,$); +!function(p,u,b){function g(){var t=b(".overflow-table"),o=b(p);t.each(function(){var e=b(this),t=e,s=b(".top-scroll",t),i=s.find(".top-scroll-inner"),a=b(".inner",t),n=b(".table-report",t).outerWidth(includeMargin=!0),l=n+b("th",t).width(),r=b(".scroll-wrapper",t);i.width(n),s.on("scroll",function(){a.scrollLeft(b(this).scrollLeft())}),a.on("scroll",function(){s.scrollLeft(b(this).scrollLeft())}),l>e.width()&&o.on("resize scroll",function(){var t=o.scrollTop();e.isInViewport()?r.addClass("fixed-scroll"):r.removeClass("fixed-scroll"),t>=e.offset().top+e.outerHeight()-p.innerHeight?r.hide():r.show()})})}b.fn.fixTableHeaderAndCellsHeight=function(){this.each(function(){b("th",this).each(function(t){var e,s,i,a,n,l,r;b(this).parents("table").hasClass("skip-height-fix")||(a=b(this).parents(".overflow-table").hasClass("side-by-side-table-left"),b(this).parents(".overflow-table").hasClass("side-by-side-table-right")||(s=(e=b(this)).parent().children('td:not(".sub-header")'),a&&(a=b(b(this).parents(".overflow-table.side-by-side-table").siblings(".overflow-table.side-by-side-table-right").find("tr")[t]).children(),s=b.merge(s,a)),t=b("td.sub-header",e.parent()),i=[],s.each(function(){var t,e=b(this);e.hasClass("translatable")?(t=e.find(".tr-text").height(),i.push(t)):i.push(e.height())}),a=Math.max.apply(Math,i),n=Math.max(e.height(),t.height(),a),e.height(n),t.height(n),l=e.height(),r=e.innerHeight(),a<=l&&s.each(function(){b(this).hasClass("translatable")?b(this).height(r):b(this).height(l)}),b("div",this).css("margin-top","-4px")))})})},b.fn.fixTableHeaderHeight=function(){this.each(function(){b(this).parents("table").hasClass("skip-height-fix")||b("th",this).each(function(t){var e,s,i=b(this),a=b("td",i.parent()),n=[],l=b(this).parents(".overflow-table").hasClass("side-by-side-table-left");b(this).parents(".overflow-table").hasClass("side-by-side-table-right")||l||(l&&(e=(t=b(b(this).parents(".overflow-table.side-by-side-table").siblings(".overflow-table.side-by-side-table-right").find("tr")[t])).children("td"),s=t.children("th"),a=b.merge(a,e)),a.each(function(){var t,e=b(this);e.hasClass("translatable")?(t=e.find(".tr-text").height(),n.push(t)):n.push(e.height())}),t=Math.max.apply(Math,n),i.height(t),l&&s.height(t))})})},b.fn.simplifyTable=function(){Array.prototype.last||(Array.prototype.last=function(){return this[this.length-1]});var t=b(this),i=(t.data("original")||t.data("original",t.html()),{curentLevel:0,setlimits:[{level:-1,limits:[]}]});b("tr",this).each(function(){var t,a,e,n,s,l;a=i,e=[],n=[],s=null!=(s=b(t=this).data("level"))?parseInt(s):-1,b(a.setlimits).each(function(){if(this.level==s)return n=this.limits,!1}),0==n.length&&(n=a.setlimits[a.setlimits.length-1].limits),b("td",t).not(".sub-header").each(function(t){0!=e.length&&!n.includes(t)&&b(this).text().trim()==b(e.last().last()).text().trim()?e.last().push(this):e.push([this])}),b(e).each(function(){var t;1
').insertAfter(b(".overflow-table").find(".inner")),b(".overflow-table").each(function(){var t=b(this).find("table"),e=b(''),s=b('
');s.find("button.reset-pins").click(function(){($ftw=b(this).closest(".fixed-table-wrapper")).removeClass("sticky-table"),$ftw.find("tr").remove(),($innerTable=$ftw.siblings(".inner")).find("tr input").prop("checked",!1)}),(t.find("td.sub-header").length?t.find("td.sub-header"):t.find("th div")).append(e),s.insertBefore(b(this).find(".inner"))});var o=b(".first-header");if(0!==o.length){var c,f="",f=o[0].firstElementChild.innerText;for(i=1;i *").css("display","none"),b("#process-state-change-bulk-wrapper .process-state-change-message").fadeIn(200),b.ajax({url:e,type:"POST",data:t.serialize(),success:function(){location.reload()}})}),b("#process-state-change-bulk-wrapper .btn-clear-checkboxes").click(function(){b(".assessment-status-td.enable-process-state-change input[name='process-state-change']").each(function(){b(this).prop("checked",!1)}),b("#process-state-change-bulk-wrapper").css("display","none"),b("#process-state-change-bulk-wrapper #form-process-state-change-bulk input[name='process-state-change']").remove()}),b(".assessment-status-td.enable-process-state-change").each(function(){var t=b(this),e=t.find(".assessment-status-wrapper form").last().attr("action");b("").attr("name","process-state-change").attr("value",e).appendTo(t).change(function(){var t,e,s=b(this).attr("value");b(this).is(":checked")?(0===b("#form-process-state-change-bulk").find("input[value='"+s+"' ]").length&&(console.log("this: ",b(this)),b(this).clone().attr("type","hidden").appendTo("#form-process-state-change-bulk")),(t=b(this).parent("td").find(".phase-selector").clone(!1).attr("id","process-state-bulk-select")).find(".select2-container").remove(),t.find("select").show().css("display",""),e=t.find("select").removeClass("select2-offscreen select2-hidden-accessible").removeAttr("data-select2-id").removeAttr("tabindex").removeAttr("aria-hidden").removeAttr("style"),b("#form-process-state-change-bulk .phase-selector").replaceWith(t),"function"==typeof e.select2&&e.select2({width:"250px",minimumResultsForSearch:-1}),b("#process-state-change-bulk-wrapper").css("display","block")):(b("#form-process-state-change-bulk").find("input[value='"+s+"' ]").remove(),0===b("#form-process-state-change-bulk").find("input[name='process-state-change']").length&&((e=b("#form-process-state-change-bulk .phase-selector select")).data("select2")&&e.select2("destroy"),e.remove(),b("#process-state-change-bulk-wrapper").css("display","none")))})})})})}(window,document,$); //# sourceMappingURL=compliance.js.map \ No newline at end of file diff --git a/src/wise/msfd/static/wise/dist/js/compliance.js.map b/src/wise/msfd/static/wise/dist/js/compliance.js.map index 8adacea8..e8f51bfa 100644 --- a/src/wise/msfd/static/wise/dist/js/compliance.js.map +++ b/src/wise/msfd/static/wise/dist/js/compliance.js.map @@ -1 +1 @@ -{"version":3,"file":"compliance.js","sources":["../../src/js/compliance.js"],"sourcesContent":["// if (!Array.prototype.last) {\n// Array.prototype.last = function () {\n// return this[this.length - 1];\n// };\n// }\n\n(function (window, document, $) {\n var selectorFormContainer = \".wise-search-form-container\";\n var exceptVal = [\"all\", \"none\", \"invert\", \"apply\"];\n /*\n * SELECT2 functions\n * */\n // TODO: please explain what this does and why it's needed\n // function setupSelects2(selector) {\n // var forbiddenIDs = [];\n // var selectorFormCont = selector || selectorFormContainer;\n\n // $(selectorFormCont + \" select\").each(function (ind, selectElement) {\n // var selectedElementID = $(selectElement).attr(\"id\");\n // if (forbiddenIDs.indexOf(selectedElementID) !== -1) {\n // return false;\n // }\n\n // $(selectElement).addClass(\"js-example-basic-single\");\n // var lessOptions = $(selectElement).find(\"option\").length < 10;\n\n // var options = {\n // placeholder: \"Select an option\",\n // closeOnSelect: true,\n // dropdownAutoWidth: true,\n // width: \"100%\",\n // theme: \"flat\",\n // };\n // if (lessOptions) options.minimumResultsForSearch = Infinity;\n\n // $(selectElement).select2(options);\n // });\n // }\n\n function initStyling() {\n // TODO: is this still needed? I don't think so\n //$(\"#form-buttons-continue\").hide(\"fast\");\n $(\".button-field\").addClass(\"btn\");\n\n // mobile hide .toggle-sidebar\n $(\".toggle-sidebar\").hide();\n }\n\n function setupTargetsWidth() {\n // Make targets extend on multiple rows when there are many targets\n // and the assessment-data-table is scrollable\n var $tableWrap = $(\".table-wrap\");\n var $assessmentTable = $(\n \"#container-assessment-data-2018 .assessment-data-table\",\n );\n if ($assessmentTable.width() <= $tableWrap.width()) {\n return;\n }\n\n $(\"div.gescomp\", $tableWrap).css({\n display: \"inline-table\",\n \"min-width\": \"inherit\",\n width: \"inherit\",\n });\n\n var maxGescompWidth = 0;\n $(\"div.gescomp\", $tableWrap).each(function () {\n var width = $(this).width();\n if (width > maxGescompWidth) {\n maxGescompWidth = width;\n }\n });\n\n $(\"div.gescomp\", $tableWrap).css({ width: maxGescompWidth });\n\n // $(window).on('resize', adjustTargetsWidth);\n }\n\n function setupScrollableTargets() {\n // NOT USED\n // create a clone of the assessment data 2018 table and overlap the original table\n // with fixed question and score columns\n $(\n \"#container-assessment-data-2018 .table.table-condensed.assessment-data-table\",\n )\n .clone(true)\n .appendTo(\"#container-assessment-data-2018\")\n .addClass(\"clone\");\n\n var $orig = $(\".table-wrap .table.table-condensed.assessment-data-table\");\n var $clone = $(\".table.table-condensed.assessment-data-table.clone\");\n var origLength = $orig.find(\"tr\").length;\n var origHeight, cloneHeight;\n\n for (var i = 0; i < origLength; i++) {\n var x = $clone.find(\"tr\")[i];\n cloneHeight = $(x).find(\".fixed-center\").innerHeight();\n origHeight = $($orig.find(\"tr\")[i]).innerHeight();\n\n if (origHeight > cloneHeight) {\n $(x).css(\"height\", origHeight + \"px\");\n } else {\n $($orig.find(\"tr\")[i]).css(\"height\", cloneHeight + \"px\");\n }\n }\n }\n\n function setupAssessmentStatusChange() {\n // Setup the process status change forms to make it possible\n // to change the assessment status on pages like\n // ./assessment-module/national-descriptors-assessments/fi/assessments\n // ./assessment-module/regional-descriptors-assessments/bal/assessments\n\n $(\".assessment-status-colorbar.show-assessment-wrapper\").hover(\n function () {\n $(this).siblings(\".assessment-status-wrapper\").css(\"display\", \"flex\");\n },\n function () {\n $(this).siblings(\".assessment-status-wrapper\").css(\"display\", \"none\");\n },\n );\n\n $(\".assessment-status-processstate\").each(function () {\n var $this = $(this);\n var $processState = $this.find(\".process-state\");\n\n $this.on(\"click\", function () {\n $this.toggleClass(\"active\");\n });\n });\n\n $(\n \".assessment-status-wrapper .assessment-status.process-state select\",\n ).change(function () {\n var $form = $(this).parents(\"form\");\n var $assessmentContainers = $(\".assessment-status-container2\");\n var url = $form[0].action;\n\n $(document.body).addClass(\"cursor-wait\");\n $form.addClass(\"cursor-wait\");\n $assessmentContainers.each(function () {\n $(this).addClass(\"cursor-wait\");\n });\n\n $.ajax({\n url: url,\n type: \"POST\",\n data: $form.serialize(),\n success: function () {\n location.reload();\n },\n });\n });\n }\n\n function setupProcessStateCheckboxes() {\n // setup submit button\n $(\"#process-state-change-bulk-wrapper .btn-submit-form\").click(function () {\n var $form = $(this).siblings(\"form#form-process-state-change-bulk\");\n var url = $form[0].action;\n\n $(document.body).addClass(\"cursor-wait\");\n $form.addClass(\"cursor-wait\");\n $(\"#process-state-change-bulk-wrapper\").addClass(\"change-initiated\");\n $(\"#process-state-change-bulk-wrapper > *\").css(\"display\", \"none\");\n $(\n \"#process-state-change-bulk-wrapper .process-state-change-message\",\n ).fadeIn(200);\n\n $.ajax({\n url: url,\n type: \"POST\",\n data: $form.serialize(),\n success: function () {\n location.reload();\n },\n });\n });\n\n // setup clear button, uncheck all checkboxes and clear the form\n $(\"#process-state-change-bulk-wrapper .btn-clear-checkboxes\").click(\n function () {\n $(\n \".assessment-status-td.enable-process-state-change input[name='process-state-change']\",\n ).each(function () {\n $(this).prop(\"checked\", false);\n });\n\n $(\"#process-state-change-bulk-wrapper\").css(\"display\", \"none\");\n\n $(\n \"#process-state-change-bulk-wrapper #form-process-state-change-bulk input[name='process-state-change']\",\n ).remove();\n },\n );\n\n // setup checkboxes\n $(\".assessment-status-td.enable-process-state-change\").each(function () {\n var $this = $(this);\n var action = $this\n .find(\".assessment-status-wrapper form\")\n .last()\n .attr(\"action\");\n\n var $inputCheckbox = $(\"\")\n .attr(\"name\", \"process-state-change\")\n .attr(\"value\", action)\n .appendTo($this);\n\n $inputCheckbox.change(function () {\n var value = $(this).attr(\"value\");\n var ischecked = $(this).is(\":checked\");\n\n if (ischecked) {\n // when the checkbox is checked\n var inputNotExists =\n $(\"#form-process-state-change-bulk\").find(\n \"input[value='\" + value + \"' ]\",\n ).length === 0;\n\n if (inputNotExists) {\n console.log(\"this: \", $(this));\n $(this)\n .clone()\n .attr(\"type\", \"hidden\")\n .appendTo(\"#form-process-state-change-bulk\");\n }\n\n // Find the original phase-selector\n var $originalPhaseSelector = $(this)\n .parent(\"td\")\n .find(\".phase-selector\");\n\n // Clone the entire phase-selector\n var $newPhaseSelector = $originalPhaseSelector\n .clone(false) // Don't clone event handlers\n .attr(\"id\", \"process-state-bulk-select\");\n\n // Remove all select2 generated elements from the clone\n $newPhaseSelector.find(\".select2-container\").remove();\n $newPhaseSelector.find(\"select\").show().css(\"display\", \"\");\n\n // Remove select2 classes and data attributes\n var $select = $newPhaseSelector\n .find(\"select\")\n .removeClass(\"select2-offscreen select2-hidden-accessible\")\n .removeAttr(\"data-select2-id\")\n .removeAttr(\"tabindex\")\n .removeAttr(\"aria-hidden\")\n .removeAttr(\"style\");\n\n $(\"#form-process-state-change-bulk .phase-selector\").replaceWith(\n $newPhaseSelector,\n );\n\n // Reinitialize Select2 v3 on the new select element\n if (typeof $select.select2 === \"function\") {\n $select.select2({\n width: \"250px\",\n minimumResultsForSearch: -1, // Hide search box\n });\n }\n\n $(\"#process-state-change-bulk-wrapper\").css(\"display\", \"block\");\n } else {\n // when the checkbox is unchecked\n $(\"#form-process-state-change-bulk\")\n .find(\"input[value='\" + value + \"' ]\")\n .remove();\n\n // if there are no checkboxes checked, remove the select box too\n if (\n $(\"#form-process-state-change-bulk\").find(\n \"input[name='process-state-change']\",\n ).length === 0\n ) {\n var $select = $(\n \"#form-process-state-change-bulk .phase-selector select\",\n );\n // Destroy Select2 v3\n if ($select.data(\"select2\")) {\n $select.select2(\"destroy\");\n }\n $select.remove();\n $(\"#process-state-change-bulk-wrapper\").css(\"display\", \"none\");\n }\n }\n });\n });\n }\n\n $.fn.fixTableHeaderAndCellsHeight = function () {\n // because the are position: absolute, they don't get the height of\n // the cells, and the other way around.\n\n this.each(function () {\n $(\"th\", this).each(function (index) {\n if ($(this).parents(\"table\").hasClass(\"skip-height-fix\")) {\n return;\n }\n\n var isSideBySideLeft = $(this)\n .parents(\".overflow-table\")\n .hasClass(\"side-by-side-table-left\");\n var isSideBySideRigth = $(this)\n .parents(\".overflow-table\")\n .hasClass(\"side-by-side-table-right\");\n\n if (isSideBySideRigth) {\n return;\n }\n\n var $th = $(this);\n // var $next = $('td:not(\".sub-header\")', $th.parent());\n var $next = $th.parent().children('td:not(\".sub-header\")');\n\n if (isSideBySideLeft) {\n var $nextSideBySide = $(\n $(this)\n .parents(\".overflow-table.side-by-side-table\")\n .siblings(\".overflow-table.side-by-side-table-right\")\n .find(\"tr\")[index],\n ).children();\n $next = $.merge($next, $nextSideBySide);\n }\n\n var $subheader = $(\"td.sub-header\", $th.parent());\n var tdHeights = [];\n\n $next.each(function () {\n var $this = $(this);\n if ($this.hasClass(\"translatable\")) {\n var hght = $this.find(\".tr-text\").height();\n tdHeights.push(hght);\n } else {\n tdHeights.push($this.height());\n }\n });\n\n var cells_max_height = Math.max.apply(Math, tdHeights);\n var height = Math.max(\n $th.height(),\n $subheader.height(),\n cells_max_height,\n );\n\n $th.height(height);\n $subheader.height(height);\n var thHeight = $th.height();\n var thInnerHeight = $th.innerHeight();\n\n if (thHeight >= cells_max_height) {\n $next.each(function () {\n if ($(this).hasClass(\"translatable\")) {\n $(this).height(thInnerHeight);\n } else {\n $(this).height(thHeight);\n }\n });\n //$next.height(thHeight);\n }\n\n $(\"div\", this).css(\"margin-top\", \"-4px\");\n });\n });\n\n // $('tr .lang-toolbar', this).each(function() {\n // console.log('fixing', this);\n // var $this = $(this);\n // var height = $this.parents('tr').height();\n // $this.css('height', height);\n // });\n };\n\n $.fn.fixTableHeaderHeight = function fixTableHeaderHeight() {\n // TODO not used anymore, replaced by fixTableHeaderAndCellsHeight\n\n // Because of the way the cells are positioned absolute, to be able to\n // keep them fixed, they are \"disconnected\" from the regular box sizing\n // layout algorithm. For this reason we have to recompute their height (to\n // make either the or the match same height\n this.each(function () {\n if ($(this).parents(\"table\").hasClass(\"skip-height-fix\")) {\n return;\n }\n\n $(\"th\", this).each(function (index) {\n var $th = $(this);\n var $next = $(\"td\", $th.parent());\n var tdHeights = [];\n var isSideBySideLeft = $(this)\n .parents(\".overflow-table\")\n .hasClass(\"side-by-side-table-left\");\n var isSideBySideRigth = $(this)\n .parents(\".overflow-table\")\n .hasClass(\"side-by-side-table-right\");\n\n if (isSideBySideRigth || isSideBySideLeft) {\n return;\n }\n\n if (isSideBySideLeft) {\n var $rowSideBySide = $(\n $(this)\n .parents(\".overflow-table.side-by-side-table\")\n .siblings(\".overflow-table.side-by-side-table-right\")\n .find(\"tr\")[index],\n );\n var $nextSideBySide = $rowSideBySide.children(\"td\");\n var $thSideBySide = $rowSideBySide.children(\"th\");\n $next = $.merge($next, $nextSideBySide);\n }\n\n $next.each(function () {\n var $this = $(this);\n if ($this.hasClass(\"translatable\")) {\n var hght = $this.find(\".tr-text\").height();\n tdHeights.push(hght);\n } else {\n tdHeights.push($this.height());\n }\n });\n\n var cells_max_height = Math.max.apply(Math, tdHeights);\n\n $th.height(cells_max_height);\n if (isSideBySideLeft) {\n $thSideBySide.height(cells_max_height);\n }\n });\n });\n };\n\n function mergeCellsInRow(row, cache) {\n /* This function visually groups and merges cells in table, to optimize\n * for reading information.\n *\n * It joins adjacent cells that have identical text, but uses group\n * definitions to establish \"limits\" on what it can merge. Finally, those\n * \"groups\" end cells are marked with special classes, to distinguish them\n * visually.\n */\n\n var sets = [];\n\n // get the appropriate limits from the cache, based on the current level\n var limits = [];\n var rowLevel = $(row).data(\"level\");\n rowLevel = rowLevel != undefined ? parseInt(rowLevel) : -1;\n $(cache.setlimits).each(function () {\n if (this.level == rowLevel) {\n limits = this.limits;\n return false;\n }\n });\n if (limits.length == 0) {\n limits = cache.setlimits[cache.setlimits.length - 1].limits;\n }\n\n // group cells by similarity\n $(\"td\", row)\n .not(\".sub-header\")\n .each(function (ix) {\n if (sets.length == 0 || limits.includes(ix)) {\n sets.push([this]);\n } else {\n var thisText = $(this).text().trim();\n var lastText = $(sets.last().last()).text().trim();\n\n if (thisText == lastText) {\n sets.last().push(this);\n } else {\n sets.push([this]);\n }\n }\n });\n\n // merge cells that are duplicated\n $(sets).each(function () {\n if (this.length > 1) {\n var colspan = this.length;\n $(this[0]).attr(\"colspan\", colspan); // .addClass('merged');\n $(this.slice(1)).each(function () {\n $(this).remove();\n });\n }\n });\n\n // compute new group limits\n if (rowLevel != -1) {\n limits = [];\n cache.curentLevel = rowLevel;\n\n $(sets).each(function () {\n var l = this.length;\n if (limits.length) {\n l += limits[limits.length - 1];\n }\n limits.push(l);\n });\n cache.setlimits.push({\n level: cache.curentLevel,\n limits: limits.slice(0), // makes a copy\n });\n }\n\n // apply special class to group end cells\n var cursor = 0;\n $(\"td\", row)\n .not(\".sub-header\")\n .each(function (iy) {\n var level = cache.curentLevel;\n var l;\n var prevset;\n\n var c = parseInt($(this).attr(\"colspan\") || \"1\");\n cursor += c;\n\n if (limits.includes(cursor)) {\n if (level > 0) {\n // traverse all previous limits to see which major one includes\n // this limit\n for (l = 0; l < cache.setlimits.length; l++) {\n prevset = cache.setlimits[l].limits;\n if (prevset.includes(cursor)) {\n level = cache.setlimits[l].level;\n break;\n }\n }\n }\n $(this).addClass(\"endgroup_\" + level);\n }\n });\n }\n\n $.fn.simplifyTable = function simplifyTable() {\n var $table = $(this);\n\n if (!$table.data(\"original\")) {\n $table.data(\"original\", $table.html());\n }\n\n var cache = {\n curentLevel: 0,\n setlimits: [\n {\n level: -1,\n limits: [],\n },\n ],\n };\n $(\"tr\", this).each(function () {\n mergeCellsInRow(this, cache);\n });\n\n // Laci disable\n // $table.fixTableHeaderHeight();\n // $table.fixTableHeaderAndCellsHeight();\n $table.data(\"simplified\", $table.html());\n };\n\n $.fn.toggleTable = function toggleTable(onoff) {\n var original = $(this).data(\"original\");\n var simplified = $(this).data(\"simplified\");\n\n if (onoff) {\n //$(this).simplifyTable();\n $(this).html(simplified);\n } else {\n $(this).hide();\n $(this).empty().html(original);\n $(this).show();\n //setupTranslateClickHandlers();\n //setupReadMoreModal();\n }\n setupReadMoreModal();\n setupTranslateClickHandlers();\n $(this).fixTableHeaderAndCellsHeight();\n };\n\n /* Used in report data table create a 'read more' modal if the cell content\n * is too long\n */\n window.setupReadMoreModal = function () {\n var $table = $(\".table-report\");\n var $modal = $(\"#read-more-modal\");\n var $modalContent = $(\".modal-content-wrapper\");\n var maxchars = 397;\n var sep = \"...\";\n var $cells = $table.find(\".tr-text\");\n $cells.each(function () {\n var t = $(this).text();\n var t_html = $(this).html();\n\n if (t_html.length > maxchars) {\n $(this).addClass(\"short\");\n var sh = t_html.substr(0, 0.75 * maxchars) + sep;\n $(this).html(sh);\n $(this).on(\"click\", function () {\n $modalContent.html(t_html);\n $modal.modal(\"show\");\n });\n }\n });\n\n $(\".btn-close-modal\").click(function () {\n $modalContent.empty();\n });\n\n // Laci disable\n // $table.fixTableHeaderAndCellsHeight();\n };\n\n function setupReportNavigation() {\n // This is a menu that is triggered from a button. When scrolling down, it\n // sticks to the top. Allows navigation between articles/years\n var $reportnav = $(\"#report-data-navigation\");\n $(\"button\", $reportnav).on(\"click\", function () {\n $(\".nav-body\", $reportnav).toggle();\n $(this)\n .children()\n .addClass(\"glyphicon\")\n .toggleClass(\"glyphicon-menu-hamburger glyphicon-remove-circle\");\n return false;\n });\n $(\".nav-body\", $reportnav).hide();\n\n // sticky report data navigation\n var $rn = $(\".report-nav\");\n var $title = $(\".report-title\");\n var $reportDataNav = $(\"#report-data-navigation\");\n\n if ($rn.length > 0) {\n var stickyOffset = $rn.offset().top;\n\n $(window).scroll(function () {\n var scroll = $(window).scrollTop();\n var fixElement = scroll >= stickyOffset;\n $reportDataNav.toggleClass(\"height-fix\", fixElement);\n $rn.toggleClass(\"sticky\", fixElement);\n $title.toggleClass(\"fixed-title\", fixElement);\n });\n }\n }\n\n function setupTableScrolling() {\n // TODO not used\n // When dealing with a really wide table, with wide cells, we want to keep\n // the text relatively narrow, but always keep in view that cell content\n var $ot = $(\".overflow-table table\");\n\n $ot.each(function () {\n var $tw = $(this);\n var $td = $tw.find(\"td\");\n\n if (!$td.length) {\n return;\n }\n\n // get table header cell right position\n var $th = $tw.find(\"th\");\n var thRight = $th.position().left + $th.outerWidth();\n\n $td.each(function () {\n var $this = $(this);\n var scrollTimer;\n\n $(\".report-page-view .overflow-table .inner\").scroll(function () {\n clearTimeout(scrollTimer);\n\n if ($this.attr(\"colspan\") > 1) {\n var tdText = $this.find(\".td-content\");\n var tdLeft = $this.position().left;\n var tdRight = tdLeft + $this.outerWidth(); // get table cell right position\n var tdTextWidth = $this.find(\".td-content\").width();\n var thAndCellWidth = tdTextWidth + thRight;\n\n $this.css(\"height\", $this.outerHeight());\n\n scrollTimer = setTimeout(afterScroll, 1);\n\n if (tdLeft < thRight) {\n tdText.addClass(\"td-scrolled\").css(\"left\", thRight + 5);\n } else {\n $this.css(\"height\", \"\");\n tdText.removeClass(\"td-scrolled\");\n }\n\n if (thAndCellWidth >= tdRight) {\n $this.addClass(\"td-relative\");\n } else {\n $this.removeClass(\"td-relative\");\n }\n }\n });\n\n function afterScroll() {\n // Tibi: temporarily disabled\n // $('.btn-translate').on('click', function() {\n // var $btn = $(this);\n // var transTextHeight = $btn.closest('.td-content').outerHeight();\n // var $td = $btn.closest('td.translatable');\n // var $th = $td.siblings('th');\n // $td.css({\n // 'height': transTextHeight,\n // 'padding': '0'\n // });\n // $btn.closest('.td-content').css('padding', '8px');\n // $th.css('height', transTextHeight);\n // });\n }\n });\n });\n }\n\n // check if element is in viewport\n $.fn.isInViewport = function () {\n var elementTop = $(this).offset().top;\n var elementBottom = elementTop + $(this).height();\n\n var viewportTop = $(window).scrollTop();\n var viewportBottom = viewportTop + $(window).height();\n\n return elementBottom > viewportTop && elementTop < viewportBottom;\n };\n\n function addCustomScroll() {\n var $cs = $(\n '
' +\n // ' ' +\n '
' +\n '
' +\n \"
\" +\n \"
\",\n );\n\n $cs.insertAfter($(\".overflow-table\").find(\".inner\"));\n }\n\n function setupCustomScroll() {\n // A fixed scrollbar at the bottom of the window for tables\n\n var $ot = $(\".overflow-table\");\n var $win = $(window);\n\n $ot.each(function () {\n var $t = $(this);\n // var $tParent = $t.parent();\n var $tParent = $t;\n var topScroll = $(\".top-scroll\", $tParent);\n var topScrollInner = topScroll.find(\".top-scroll-inner\");\n var tableScroll = $(\".inner\", $tParent);\n var tableWidth = $(\".table-report\", $tParent).outerWidth(\n (includeMargin = true),\n );\n var tableHeaderWidth = $(\"th\", $tParent).width();\n var tableAndHeaderWidth = tableWidth + tableHeaderWidth;\n var customScroll = $(\".scroll-wrapper\", $tParent);\n\n topScrollInner.width(tableWidth);\n\n topScroll.on(\"scroll\", function () {\n tableScroll.scrollLeft($(this).scrollLeft());\n });\n\n tableScroll.on(\"scroll\", function () {\n topScroll.scrollLeft($(this).scrollLeft());\n });\n\n if (tableAndHeaderWidth > $t.width()) {\n $win.on(\"resize scroll\", function () {\n var scroll = $win.scrollTop();\n\n if ($t.isInViewport()) {\n customScroll.addClass(\"fixed-scroll\");\n } else {\n customScroll.removeClass(\"fixed-scroll\");\n }\n\n // hide custom scrollbar when it reaches the bottom of the table\n if (\n scroll >=\n $t.offset().top + $t.outerHeight() - window.innerHeight\n ) {\n customScroll.hide();\n } else {\n customScroll.show();\n }\n });\n }\n });\n }\n\n function addFixedTable() {\n var $ot = $(\".overflow-table\");\n\n $ot.each(function () {\n var $table = $(this).find(\"table\");\n var $cb = $('');\n var $ft = $(\n '
' +\n '\" +\n '
' +\n '' +\n \"
\" +\n \"
\" +\n \"
\",\n );\n\n // Register click event for button to clear all pinned rows for the current table\n $ft.find(\"button.reset-pins\").click(function () {\n $ftw = $(this).closest(\".fixed-table-wrapper\");\n $ftw.removeClass(\"sticky-table\");\n $ftw.find(\"tr\").remove();\n\n $innerTable = $ftw.siblings(\".inner\");\n $innerTable.find(\"tr input\").prop(\"checked\", false);\n });\n\n if ($table.find(\"td.sub-header\").length) {\n // Regional descriptors\n $table.find(\"td.sub-header\").append($cb);\n } else {\n // National descriptors\n $table.find(\"th div\").append($cb);\n }\n\n $ft.insertBefore($(this).find(\".inner\"));\n });\n }\n\n $.fn.setupFixedTableRows = function () {\n // Allows report table rows to be fixed while scrolling\n // var $ot = $('.overflow-table');\n var $ot = $(this);\n\n // The .each is necessary, we can have more overflow-tables\n $ot.each(function () {\n var $t = $(this);\n var $fixedTable = $t.find(\".fixed-table-wrapper\");\n var $th = $(\"th\", $t.parent());\n var tableW = $(\".table-report\", $t).width();\n var tableScroll = $(\".inner\", $t);\n var fixedTableInner = $(\".fixed-table-inner\", $t);\n\n function toggleSyncScrolls(onoff) {\n function f1() {\n tableScroll.scrollLeft($(this).scrollLeft());\n }\n function f2() {\n fixedTableInner.scrollLeft($(this).scrollLeft());\n }\n if (onoff) {\n fixedTableInner.on(\"scroll\", f1);\n tableScroll.on(\"scroll\", f2);\n } else {\n fixedTableInner.off(\"scroll\", f1);\n tableScroll.off(\"scroll\", f2);\n }\n }\n toggleSyncScrolls(true);\n\n $t.find(\".fix-row\").each(function (i) {\n var val = \"cb\" + i++;\n // var checkBox = $(this).find('.fix-row');\n var checkBox = $(this);\n checkBox.val(val);\n });\n\n var checkBox = $t.find(\".fix-row\");\n checkBox.change(function () {\n var $this = $(this);\n var value = $this.val();\n var table = $this.closest(\".overflow-table\").find(\".fixed-table\");\n var tableWrapper = $this\n .closest(\".overflow-table\")\n .find(\".fixed-table-wrapper\");\n table.width(tableW);\n\n if ($this.is(\":checked\")) {\n tableWrapper.addClass(\"sticky-table\");\n\n //for other tables find the reset button and trigger the click event\n var $parentReportSection = $this.closest(\".report-section\");\n var $otherReportSections =\n $parentReportSection.siblings(\".report-section\");\n $otherReportSections.each(function () {\n $ftw = $(this).find(\".fixed-table-wrapper\");\n $ftw.find(\"button.reset-pins\").click();\n });\n\n // clone table row, but keep the width of the original table cells\n var target = $this.closest(\"tr\");\n var target_children = target.children(\"td\");\n var clone = target.clone();\n clone.children(\"td\").width(function (i, val) {\n return target_children.eq(i).outerWidth();\n });\n clone.appendTo(table).attr(\"data-row\", value);\n\n // disable for test\n //$t.find('.table').fixTableHeaderAndCellsHeight();\n // setupTableScrolling();\n } else {\n $fixedTable\n .find('tr[data-row=\"' + value + '\"]')\n .slideUp(\"fast\", function () {\n $(this).remove();\n });\n\n if (table.find(\"tr\").length === 1) {\n tableWrapper.removeClass(\"sticky-table\");\n }\n }\n\n var $cb = $fixedTable.find(\".fix-row\");\n $cb.change(function () {\n var $this = $(this);\n var value = $this.val();\n\n if ($this.closest(\"tr\").siblings().length === 0) {\n $this.closest(\".fixed-table-wrapper\").removeClass(\"sticky-table\");\n }\n\n $this.closest(\"tr\").remove();\n $('.fix-row[value=\"' + value + '\"]').prop(\"checked\", false);\n });\n\n toggleSyncScrolls(false);\n fixedTableInner.scrollLeft(tableScroll.scrollLeft());\n toggleSyncScrolls(true);\n });\n });\n\n $(window).on(\"resize scroll\", function () {\n if ($(\".report-nav.sticky\").length > 0) {\n $(\".fixed-table-wrapper\").each(function () {\n $(this).css(\"top\", \"56px\");\n });\n } else {\n $(\".fixed-table-wrapper\").each(function () {\n $(this).css(\"top\", \"0\");\n });\n }\n });\n };\n\n function setupResponsiveness() {\n // fire resize event after the browser window resizing it's completed\n var resizeTimer;\n $(window).resize(function () {\n clearTimeout(resizeTimer);\n resizeTimer = setTimeout(doneResizing, 500);\n });\n\n function doneResizing() {\n // $('.table-report').fixTableHeaderHeight();\n $(\".table-report\").each(function () {\n $(this).fixTableHeaderAndCellsHeight();\n });\n }\n\n if (window.matchMedia(\"(max-width: 768px)\").matches) {\n $(\".overflow-table h5\").width($(\".overflow-table table\").width());\n }\n\n // tibi: temporarily disabled. I don't know what td-content does\n // var $td = $('.overflow-table table td');\n // $td.children('div').wrapInner('
');\n }\n\n function setupSimplifiedTables() {\n $(\".simplify-form\")\n .next()\n .find(\".table-report\")\n .each(function () {\n $(this).simplifyTable();\n });\n\n $(\".simplify-form button\").on(\"click\", function () {\n var onoff = $(this).attr(\"aria-pressed\") == \"true\";\n $p = $(this).parent().next();\n $(\".table-report\", $p).toggleTable(!onoff);\n // Laci disable\n $p.setupFixedTableRows();\n setupCustomScroll();\n });\n }\n\n function regionalDescriptorsGroupTableHeaders() {\n var $headers = $(\".first-header\");\n if ($headers.length === 0) {\n return;\n }\n var compareText = \"\";\n var currentText = \"\";\n\n compareText = $headers[0].firstElementChild.innerText;\n\n for (i = 1; i < $headers.length; i++) {\n currentText = $headers[i].firstElementChild.innerText;\n\n if (compareText === currentText) {\n $headers[i].firstElementChild.innerText = \"\";\n $($headers[i - 1]).css(\"border-bottom\", \"0px\");\n } else {\n compareText = currentText;\n }\n\n //debugger;\n }\n }\n\n $.fn.setupStickyRows = function () {\n // make first th element(s) with 'sticky-col' class stick to the left of the\n // screen when scrolling horizontally\n $stickyTable = $(\".table-sticky-first-col\");\n $stickyTable.find(\"tr\").each(function () {\n $(this)\n .find(\"th.sticky-col\")\n .each(function () {\n $currentTh = $(this);\n $prevTh = $(this).prev(\".sticky-col\");\n\n if ($prevTh.hasClass(\"sticky-col\")) {\n prevWidth = $prevTh.outerWidth();\n prevLeft = parseInt($prevTh.css(\"left\"));\n $currentTh.css({ left: prevWidth + prevLeft });\n } else {\n $currentTh.css(\"left\", -1);\n }\n });\n });\n\n // Pin all rows with 'sticky-row' class\n $fixedTable = $(this).find(\".fixed-table\");\n var tableWrapper = $(this).find(\".fixed-table-wrapper\");\n tableWrapper.addClass(\"sticky-table\");\n\n if ($(this).find(\".inner table\").hasClass(\"table-sticky-first-col\")) {\n $fixedTable.addClass(\"table-sticky-first-col\");\n }\n\n $(this)\n .find(\"tr.sticky-row\")\n .each(function () {\n $(this)\n .children()\n .each(function () {\n var width = $(this).outerWidth();\n $(this).css(\"min-width\", width);\n $(this).css(\"width\", width);\n $(this).css(\"background-color\", $(this).css(\"background-color\"));\n $(this).css(\"color\", $(this).css(\"color\"));\n $(this).css(\"text-align\", $(this).css(\"text-align\"));\n });\n\n clone = $(this).clone();\n clone.appendTo($fixedTable);\n });\n\n // on scroll check if the all rows 'sticky-row' are displayed on screen\n // if not show the 'fixed-table' with the pinned rows\n $(window).on(\"resize scroll\", function () {\n $(\".overflow-table\").each(function () {\n var $ot = $(this);\n var tableWrapper = $ot.find(\".fixed-table-wrapper\");\n var stickyRowsInView = [];\n\n $ot.find(\".inner tr.sticky-row\").each(function () {\n var elementTop = $(this).offset().top;\n var viewportTop = parseInt($(window).scrollTop());\n // var viewportBottom = viewportTop + $(window).height();\n var $currentOT = $(this).parents(\".overflow-table\");\n var otTop = $currentOT.offset().top;\n var otBottom = otTop + $currentOT.outerHeight();\n var theadHeight = $(this).parents(\"thead\").outerHeight();\n\n // if this is false, we display the sticky bar on the top\n isInViewport =\n // $(this).isInViewport() ||\n // elementTop > viewportBottom\n elementTop > viewportTop || otBottom < viewportTop + theadHeight;\n\n stickyRowsInView.push(isInViewport);\n });\n\n if (stickyRowsInView.includes(false)) {\n $ot.removeClass(\"hidden-fixed-table\");\n } else {\n $ot.addClass(\"hidden-fixed-table\");\n }\n });\n });\n };\n\n $(document).ready(function ($) {\n setupReadMoreModal();\n initStyling();\n // setupSelects2();\n setupReportNavigation();\n // setupTableScrolling();\n setupResponsiveness();\n addCustomScroll();\n addFixedTable();\n regionalDescriptorsGroupTableHeaders();\n\n // $(\".pat-tooltip\").tooltip({\n // html: true,\n // title: $(this).attr(\"title\"),\n // });\n // $('[data-bs-toggle=\"tooltip\"]').tooltip({\n // html: true,\n // });\n // var popoverTriggerList = [].slice.call(\n // document.querySelectorAll('[data-bs-toggle=\"popover\"]'),\n // );\n // var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {\n // return new bootstrap.Popover(popoverTriggerEl);\n // });\n\n // Fix login url\n // $(\".pat-plone-modal\").attr(\"href\", \"/marine/assessment-module/login\");\n // Fix redirect on login\n // var _xhrOpen = XMLHttpRequest.prototype.open;\n // XMLHttpRequest.prototype.open = function (method, url) {\n // var self = this;\n // this.addEventListener(\"load\", function () {\n // if (\n // method === \"POST\" &&\n // url.indexOf(\"login\") !== -1 &&\n // self.responseURL.indexOf(\"login\") === -1\n // ) {\n // $(\".modal-wrapper\").hide();\n // window.location.href = self.responseURL;\n // }\n // });\n // _xhrOpen.apply(this, arguments);\n // };\n\n $(\".assessment-read-more\").click(function () {\n var $this = $(this);\n $this.text(function (a, b) {\n return b.startsWith(\"Show\")\n ? \"Hide reports\"\n : $(this).attr(\"display-text\");\n });\n $this.parents().siblings(\".assessment-dd-list\").fadeToggle();\n $this\n .parents()\n .siblings(\".text-reports-table\")\n .find(\".assessment-dd-list\")\n .fadeToggle();\n });\n\n var $scrollBtn = $(\".scroll-to-top\");\n $(window).scroll(function () {\n if ($(this).scrollTop() > 400) {\n $scrollBtn.fadeIn();\n } else {\n $scrollBtn.fadeOut();\n }\n });\n\n $scrollBtn.click(function () {\n $(\"html, body\").animate({ scrollTop: 0 }, 400);\n return false;\n });\n\n $(window).on(\"load\", function () {\n // setupReadMoreModal();\n setupSimplifiedTables();\n var $ot = $(\".overflow-table\");\n $ot.each(function () {\n $(this).setupFixedTableRows();\n $(this).find(\".table-report\").fixTableHeaderAndCellsHeight();\n // when loading the screen pin all rows marked with 'sticky-row' class\n // and display them if they are not in viewport\n $(this).setupStickyRows();\n });\n setupCustomScroll();\n\n // setupScrollableTargets();\n setupTargetsWidth();\n setupAssessmentStatusChange();\n\n setupProcessStateCheckboxes();\n });\n });\n})(window, document, $);\n"],"names":["window","document","$","setupCustomScroll","$ot","$win","each","$t","this","$tParent","topScroll","topScrollInner","find","tableScroll","tableWidth","outerWidth","includeMargin","tableAndHeaderWidth","width","customScroll","on","scrollLeft","scroll","scrollTop","isInViewport","addClass","removeClass","offset","top","outerHeight","innerHeight","hide","show","fn","fixTableHeaderAndCellsHeight","index","$th","$next","tdHeights","cells_max_height","height","thHeight","thInnerHeight","parents","hasClass","isSideBySideLeft","parent","children","$nextSideBySide","siblings","merge","$subheader","hght","$this","push","Math","max","apply","css","fixTableHeaderHeight","$thSideBySide","$rowSideBySide","simplifyTable","$table","cache","data","html","curentLevel","setlimits","level","limits","row","sets","rowLevel","cursor","undefined","parseInt","length","not","ix","includes","text","trim","last","colspan","attr","slice","remove","l","iy","c","toggleTable","onoff","original","simplified","empty","setupReadMoreModal","setupTranslateClickHandlers","$modal","$modalContent","sh","t_html","substr","modal","click","elementTop","elementBottom","viewportTop","viewportBottom","setupFixedTableRows","$fixedTable","tableW","fixedTableInner","toggleSyncScrolls","f1","f2","off","i","val","change","target_children","value","table","closest","tableWrapper","is","$ftw","target","clone","eq","appendTo","slideUp","prop","setupStickyRows","$stickyTable","$currentTh","$prevTh","prev","prevWidth","prevLeft","left","stickyRowsInView","$currentOT","otBottom","theadHeight","ready","stickyOffset","$reportnav","$rn","$title","$reportDataNav","resizeTimer","doneResizing","toggle","toggleClass","fixElement","resize","clearTimeout","setTimeout","matchMedia","matches","insertAfter","$cb","$ft","$innerTable","append","insertBefore","$headers","currentText","compareText","firstElementChild","innerText","a","b","startsWith","fadeToggle","$scrollBtn","fadeIn","fadeOut","animate","maxGescompWidth","$tableWrap","next","$p","display","min-width","hover","$form","$assessmentContainers","url","action","body","ajax","type","serialize","success","location","reload","$newPhaseSelector","$select","console","log","removeAttr","replaceWith","select2","minimumResultsForSearch"],"mappings":"CAMA,SAAWA,EAAQC,EAAUC,GA6tB3B,SAASC,IAGP,IAAIC,EAAMF,EAAE,mBACRG,EAAOH,EAAEF,GAEbI,EAAIE,KAAK,WACP,IAAIC,EAAKL,EAAEM,MAEPC,EAAWF,EACXG,EAAYR,EAAE,cAAeO,GAC7BE,EAAiBD,EAAUE,KAAK,qBACh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sCACAiE,UAME0H,EAJUrM,EACZ,2DAGU+D,KAAK,YACfsI,EAAQK,QAAQ,WAElBL,EAAQhH,SACRrF,EAAE,sCAAsCwD,IAAI,UAAW,kBAtRnE,CAiqCG1D,OAAQC,SAAUC"} \ No newline at end of file +{"version":3,"file":"compliance.js","sources":["../../src/js/compliance.js"],"sourcesContent":["// if (!Array.prototype.last) {\n// Array.prototype.last = function () {\n// return this[this.length - 1];\n// };\n// }\n\n(function (window, document, $) {\n var selectorFormContainer = \".wise-search-form-container\";\n var exceptVal = [\"all\", \"none\", \"invert\", \"apply\"];\n /*\n * SELECT2 functions\n * */\n // TODO: please explain what this does and why it's needed\n // function setupSelects2(selector) {\n // var forbiddenIDs = [];\n // var selectorFormCont = selector || selectorFormContainer;\n\n // $(selectorFormCont + \" select\").each(function (ind, selectElement) {\n // var selectedElementID = $(selectElement).attr(\"id\");\n // if (forbiddenIDs.indexOf(selectedElementID) !== -1) {\n // return false;\n // }\n\n // $(selectElement).addClass(\"js-example-basic-single\");\n // var lessOptions = $(selectElement).find(\"option\").length < 10;\n\n // var options = {\n // placeholder: \"Select an option\",\n // closeOnSelect: true,\n // dropdownAutoWidth: true,\n // width: \"100%\",\n // theme: \"flat\",\n // };\n // if (lessOptions) options.minimumResultsForSearch = Infinity;\n\n // $(selectElement).select2(options);\n // });\n // }\n\n function initStyling() {\n // TODO: is this still needed? I don't think so\n //$(\"#form-buttons-continue\").hide(\"fast\");\n $(\".button-field\").addClass(\"btn\");\n\n // mobile hide .toggle-sidebar\n $(\".toggle-sidebar\").hide();\n }\n\n function setupTargetsWidth() {\n // Make targets extend on multiple rows when there are many targets\n // and the assessment-data-table is scrollable\n var $tableWrap = $(\".table-wrap\");\n var $assessmentTable = $(\n \"#container-assessment-data-2018 .assessment-data-table\",\n );\n if ($assessmentTable.width() <= $tableWrap.width()) {\n return;\n }\n\n $(\"div.gescomp\", $tableWrap).css({\n display: \"inline-table\",\n \"min-width\": \"inherit\",\n width: \"inherit\",\n });\n\n var maxGescompWidth = 0;\n $(\"div.gescomp\", $tableWrap).each(function () {\n var width = $(this).width();\n if (width > maxGescompWidth) {\n maxGescompWidth = width;\n }\n });\n\n $(\"div.gescomp\", $tableWrap).css({ width: maxGescompWidth });\n\n // $(window).on('resize', adjustTargetsWidth);\n }\n\n function setupScrollableTargets() {\n // NOT USED\n // create a clone of the assessment data 2018 table and overlap the original table\n // with fixed question and score columns\n $(\n \"#container-assessment-data-2018 .table.table-condensed.assessment-data-table\",\n )\n .clone(true)\n .appendTo(\"#container-assessment-data-2018\")\n .addClass(\"clone\");\n\n var $orig = $(\".table-wrap .table.table-condensed.assessment-data-table\");\n var $clone = $(\".table.table-condensed.assessment-data-table.clone\");\n var origLength = $orig.find(\"tr\").length;\n var origHeight, cloneHeight;\n\n for (var i = 0; i < origLength; i++) {\n var x = $clone.find(\"tr\")[i];\n cloneHeight = $(x).find(\".fixed-center\").innerHeight();\n origHeight = $($orig.find(\"tr\")[i]).innerHeight();\n\n if (origHeight > cloneHeight) {\n $(x).css(\"height\", origHeight + \"px\");\n } else {\n $($orig.find(\"tr\")[i]).css(\"height\", cloneHeight + \"px\");\n }\n }\n }\n\n function setupAssessmentStatusChange() {\n // Setup the process status change forms to make it possible\n // to change the assessment status on pages like\n // ./assessment-module/national-descriptors-assessments/fi/assessments\n // ./assessment-module/regional-descriptors-assessments/bal/assessments\n\n $(\".assessment-status-colorbar.show-assessment-wrapper\").hover(\n function () {\n $(this).siblings(\".assessment-status-wrapper\").css(\"display\", \"flex\");\n },\n function () {\n $(this).siblings(\".assessment-status-wrapper\").css(\"display\", \"none\");\n },\n );\n\n $(\".assessment-status-processstate\").each(function () {\n var $this = $(this);\n var $processState = $this.find(\".process-state\");\n\n $this.on(\"click\", function () {\n $this.toggleClass(\"active\");\n });\n });\n\n $(\n \".assessment-status-wrapper .assessment-status.process-state select\",\n ).change(function () {\n var $form = $(this).parents(\"form\");\n var $assessmentContainers = $(\".assessment-status-container2\");\n var url = $form[0].action;\n\n $(document.body).addClass(\"cursor-wait\");\n $form.addClass(\"cursor-wait\");\n $assessmentContainers.each(function () {\n $(this).addClass(\"cursor-wait\");\n });\n\n $.ajax({\n url: url,\n type: \"POST\",\n data: $form.serialize(),\n success: function () {\n location.reload();\n },\n });\n });\n }\n\n function setupProcessStateCheckboxes() {\n // setup submit button\n $(\"#process-state-change-bulk-wrapper .btn-submit-form\").click(function () {\n var $form = $(this).siblings(\"form#form-process-state-change-bulk\");\n var url = $form[0].action;\n\n $(document.body).addClass(\"cursor-wait\");\n $form.addClass(\"cursor-wait\");\n $(\"#process-state-change-bulk-wrapper\").addClass(\"change-initiated\");\n $(\"#process-state-change-bulk-wrapper > *\").css(\"display\", \"none\");\n $(\n \"#process-state-change-bulk-wrapper .process-state-change-message\",\n ).fadeIn(200);\n\n $.ajax({\n url: url,\n type: \"POST\",\n data: $form.serialize(),\n success: function () {\n location.reload();\n },\n });\n });\n\n // setup clear button, uncheck all checkboxes and clear the form\n $(\"#process-state-change-bulk-wrapper .btn-clear-checkboxes\").click(\n function () {\n $(\n \".assessment-status-td.enable-process-state-change input[name='process-state-change']\",\n ).each(function () {\n $(this).prop(\"checked\", false);\n });\n\n $(\"#process-state-change-bulk-wrapper\").css(\"display\", \"none\");\n\n $(\n \"#process-state-change-bulk-wrapper #form-process-state-change-bulk input[name='process-state-change']\",\n ).remove();\n },\n );\n\n // setup checkboxes\n $(\".assessment-status-td.enable-process-state-change\").each(function () {\n var $this = $(this);\n var action = $this\n .find(\".assessment-status-wrapper form\")\n .last()\n .attr(\"action\");\n\n var $inputCheckbox = $(\"\")\n .attr(\"name\", \"process-state-change\")\n .attr(\"value\", action)\n .appendTo($this);\n\n $inputCheckbox.change(function () {\n var value = $(this).attr(\"value\");\n var ischecked = $(this).is(\":checked\");\n\n if (ischecked) {\n // when the checkbox is checked\n var inputNotExists =\n $(\"#form-process-state-change-bulk\").find(\n \"input[value='\" + value + \"' ]\",\n ).length === 0;\n\n if (inputNotExists) {\n console.log(\"this: \", $(this));\n $(this)\n .clone()\n .attr(\"type\", \"hidden\")\n .appendTo(\"#form-process-state-change-bulk\");\n }\n\n // Find the original phase-selector\n var $originalPhaseSelector = $(this)\n .parent(\"td\")\n .find(\".phase-selector\");\n\n // Clone the entire phase-selector\n var $newPhaseSelector = $originalPhaseSelector\n .clone(false) // Don't clone event handlers\n .attr(\"id\", \"process-state-bulk-select\");\n\n // Remove all select2 generated elements from the clone\n $newPhaseSelector.find(\".select2-container\").remove();\n $newPhaseSelector.find(\"select\").show().css(\"display\", \"\");\n\n // Remove select2 classes and data attributes\n var $select = $newPhaseSelector\n .find(\"select\")\n .removeClass(\"select2-offscreen select2-hidden-accessible\")\n .removeAttr(\"data-select2-id\")\n .removeAttr(\"tabindex\")\n .removeAttr(\"aria-hidden\")\n .removeAttr(\"style\");\n\n $(\"#form-process-state-change-bulk .phase-selector\").replaceWith(\n $newPhaseSelector,\n );\n\n // Reinitialize Select2 v3 on the new select element\n if (typeof $select.select2 === \"function\") {\n $select.select2({\n width: \"250px\",\n minimumResultsForSearch: -1, // Hide search box\n });\n }\n\n $(\"#process-state-change-bulk-wrapper\").css(\"display\", \"block\");\n } else {\n // when the checkbox is unchecked\n $(\"#form-process-state-change-bulk\")\n .find(\"input[value='\" + value + \"' ]\")\n .remove();\n\n // if there are no checkboxes checked, remove the select box too\n if (\n $(\"#form-process-state-change-bulk\").find(\n \"input[name='process-state-change']\",\n ).length === 0\n ) {\n var $select = $(\n \"#form-process-state-change-bulk .phase-selector select\",\n );\n // Destroy Select2 v3\n if ($select.data(\"select2\")) {\n $select.select2(\"destroy\");\n }\n $select.remove();\n $(\"#process-state-change-bulk-wrapper\").css(\"display\", \"none\");\n }\n }\n });\n });\n }\n\n $.fn.fixTableHeaderAndCellsHeight = function () {\n // because the are position: absolute, they don't get the height of\n // the cells, and the other way around.\n\n this.each(function () {\n $(\"th\", this).each(function (index) {\n if ($(this).parents(\"table\").hasClass(\"skip-height-fix\")) {\n return;\n }\n\n var isSideBySideLeft = $(this)\n .parents(\".overflow-table\")\n .hasClass(\"side-by-side-table-left\");\n var isSideBySideRigth = $(this)\n .parents(\".overflow-table\")\n .hasClass(\"side-by-side-table-right\");\n\n if (isSideBySideRigth) {\n return;\n }\n\n var $th = $(this);\n // var $next = $('td:not(\".sub-header\")', $th.parent());\n var $next = $th.parent().children('td:not(\".sub-header\")');\n\n if (isSideBySideLeft) {\n var $nextSideBySide = $(\n $(this)\n .parents(\".overflow-table.side-by-side-table\")\n .siblings(\".overflow-table.side-by-side-table-right\")\n .find(\"tr\")[index],\n ).children();\n $next = $.merge($next, $nextSideBySide);\n }\n\n var $subheader = $(\"td.sub-header\", $th.parent());\n var tdHeights = [];\n\n $next.each(function () {\n var $this = $(this);\n if ($this.hasClass(\"translatable\")) {\n var hght = $this.find(\".tr-text\").height();\n tdHeights.push(hght);\n } else {\n tdHeights.push($this.height());\n }\n });\n\n var cells_max_height = Math.max.apply(Math, tdHeights);\n var height = Math.max(\n $th.height(),\n $subheader.height(),\n cells_max_height,\n );\n\n $th.height(height);\n $subheader.height(height);\n var thHeight = $th.height();\n var thInnerHeight = $th.innerHeight();\n\n if (thHeight >= cells_max_height) {\n $next.each(function () {\n if ($(this).hasClass(\"translatable\")) {\n $(this).height(thInnerHeight);\n } else {\n $(this).height(thHeight);\n }\n });\n //$next.height(thHeight);\n }\n\n $(\"div\", this).css(\"margin-top\", \"-4px\");\n });\n });\n\n // $('tr .lang-toolbar', this).each(function() {\n // console.log('fixing', this);\n // var $this = $(this);\n // var height = $this.parents('tr').height();\n // $this.css('height', height);\n // });\n };\n\n $.fn.fixTableHeaderHeight = function fixTableHeaderHeight() {\n // TODO not used anymore, replaced by fixTableHeaderAndCellsHeight\n\n // Because of the way the cells are positioned absolute, to be able to\n // keep them fixed, they are \"disconnected\" from the regular box sizing\n // layout algorithm. For this reason we have to recompute their height (to\n // make either the or the match same height\n this.each(function () {\n if ($(this).parents(\"table\").hasClass(\"skip-height-fix\")) {\n return;\n }\n\n $(\"th\", this).each(function (index) {\n var $th = $(this);\n var $next = $(\"td\", $th.parent());\n var tdHeights = [];\n var isSideBySideLeft = $(this)\n .parents(\".overflow-table\")\n .hasClass(\"side-by-side-table-left\");\n var isSideBySideRigth = $(this)\n .parents(\".overflow-table\")\n .hasClass(\"side-by-side-table-right\");\n\n if (isSideBySideRigth || isSideBySideLeft) {\n return;\n }\n\n if (isSideBySideLeft) {\n var $rowSideBySide = $(\n $(this)\n .parents(\".overflow-table.side-by-side-table\")\n .siblings(\".overflow-table.side-by-side-table-right\")\n .find(\"tr\")[index],\n );\n var $nextSideBySide = $rowSideBySide.children(\"td\");\n var $thSideBySide = $rowSideBySide.children(\"th\");\n $next = $.merge($next, $nextSideBySide);\n }\n\n $next.each(function () {\n var $this = $(this);\n if ($this.hasClass(\"translatable\")) {\n var hght = $this.find(\".tr-text\").height();\n tdHeights.push(hght);\n } else {\n tdHeights.push($this.height());\n }\n });\n\n var cells_max_height = Math.max.apply(Math, tdHeights);\n\n $th.height(cells_max_height);\n if (isSideBySideLeft) {\n $thSideBySide.height(cells_max_height);\n }\n });\n });\n };\n\n function mergeCellsInRow(row, cache) {\n /* This function visually groups and merges cells in table, to optimize\n * for reading information.\n *\n * It joins adjacent cells that have identical text, but uses group\n * definitions to establish \"limits\" on what it can merge. Finally, those\n * \"groups\" end cells are marked with special classes, to distinguish them\n * visually.\n */\n\n var sets = [];\n\n // get the appropriate limits from the cache, based on the current level\n var limits = [];\n var rowLevel = $(row).data(\"level\");\n rowLevel = rowLevel != undefined ? parseInt(rowLevel) : -1;\n $(cache.setlimits).each(function () {\n if (this.level == rowLevel) {\n limits = this.limits;\n return false;\n }\n });\n if (limits.length == 0) {\n limits = cache.setlimits[cache.setlimits.length - 1].limits;\n }\n\n // group cells by similarity\n $(\"td\", row)\n .not(\".sub-header\")\n .each(function (ix) {\n if (sets.length == 0 || limits.includes(ix)) {\n sets.push([this]);\n } else {\n var thisText = $(this).text().trim();\n var lastText = $(sets.last().last()).text().trim();\n\n if (thisText == lastText) {\n sets.last().push(this);\n } else {\n sets.push([this]);\n }\n }\n });\n\n // merge cells that are duplicated\n $(sets).each(function () {\n if (this.length > 1) {\n var colspan = this.length;\n $(this[0]).attr(\"colspan\", colspan); // .addClass('merged');\n $(this.slice(1)).each(function () {\n $(this).remove();\n });\n }\n });\n\n // compute new group limits\n if (rowLevel != -1) {\n limits = [];\n cache.curentLevel = rowLevel;\n\n $(sets).each(function () {\n var l = this.length;\n if (limits.length) {\n l += limits[limits.length - 1];\n }\n limits.push(l);\n });\n cache.setlimits.push({\n level: cache.curentLevel,\n limits: limits.slice(0), // makes a copy\n });\n }\n\n // apply special class to group end cells\n var cursor = 0;\n $(\"td\", row)\n .not(\".sub-header\")\n .each(function (iy) {\n var level = cache.curentLevel;\n var l;\n var prevset;\n\n var c = parseInt($(this).attr(\"colspan\") || \"1\");\n cursor += c;\n\n if (limits.includes(cursor)) {\n if (level > 0) {\n // traverse all previous limits to see which major one includes\n // this limit\n for (l = 0; l < cache.setlimits.length; l++) {\n prevset = cache.setlimits[l].limits;\n if (prevset.includes(cursor)) {\n level = cache.setlimits[l].level;\n break;\n }\n }\n }\n $(this).addClass(\"endgroup_\" + level);\n }\n });\n }\n\n $.fn.simplifyTable = function simplifyTable() {\n if (!Array.prototype.last) {\n Array.prototype.last = function () {\n return this[this.length - 1];\n };\n }\n var $table = $(this);\n\n if (!$table.data(\"original\")) {\n $table.data(\"original\", $table.html());\n }\n\n var cache = {\n curentLevel: 0,\n setlimits: [\n {\n level: -1,\n limits: [],\n },\n ],\n };\n $(\"tr\", this).each(function () {\n mergeCellsInRow(this, cache);\n });\n\n // Laci disable\n // $table.fixTableHeaderHeight();\n // $table.fixTableHeaderAndCellsHeight();\n $table.data(\"simplified\", $table.html());\n };\n\n $.fn.toggleTable = function toggleTable(onoff) {\n var original = $(this).data(\"original\");\n var simplified = $(this).data(\"simplified\");\n\n if (onoff) {\n //$(this).simplifyTable();\n $(this).html(simplified);\n } else {\n $(this).hide();\n $(this).empty().html(original);\n $(this).show();\n //setupTranslateClickHandlers();\n //setupReadMoreModal();\n }\n setupReadMoreModal();\n setupTranslateClickHandlers();\n $(this).fixTableHeaderAndCellsHeight();\n };\n\n /* Used in report data table create a 'read more' modal if the cell content\n * is too long\n */\n window.setupReadMoreModal = function () {\n var $table = $(\".table-report\");\n var $modal = $(\"#read-more-modal\");\n var $modalContent = $(\".modal-content-wrapper\");\n var maxchars = 397;\n var sep = \"...\";\n var $cells = $table.find(\".tr-text\");\n $cells.each(function () {\n var t = $(this).text();\n var t_html = $(this).html();\n\n if (t_html.length > maxchars) {\n $(this).addClass(\"short\");\n var sh = t_html.substr(0, 0.75 * maxchars) + sep;\n $(this).html(sh);\n $(this).on(\"click\", function () {\n $modalContent.html(t_html);\n $modal.modal(\"show\");\n });\n }\n });\n\n $(\".btn-close-modal\").click(function () {\n $modalContent.empty();\n });\n\n // Laci disable\n // $table.fixTableHeaderAndCellsHeight();\n };\n\n function setupReportNavigation() {\n // This is a menu that is triggered from a button. When scrolling down, it\n // sticks to the top. Allows navigation between articles/years\n var $reportnav = $(\"#report-data-navigation\");\n $(\"button\", $reportnav).on(\"click\", function () {\n $(\".nav-body\", $reportnav).toggle();\n $(this)\n .children()\n .addClass(\"glyphicon\")\n .toggleClass(\"glyphicon-menu-hamburger glyphicon-remove-circle\");\n return false;\n });\n $(\".nav-body\", $reportnav).hide();\n\n // sticky report data navigation\n var $rn = $(\".report-nav\");\n var $title = $(\".report-title\");\n var $reportDataNav = $(\"#report-data-navigation\");\n\n if ($rn.length > 0) {\n var stickyOffset = $rn.offset().top;\n\n $(window).scroll(function () {\n var scroll = $(window).scrollTop();\n var fixElement = scroll >= stickyOffset;\n $reportDataNav.toggleClass(\"height-fix\", fixElement);\n $rn.toggleClass(\"sticky\", fixElement);\n $title.toggleClass(\"fixed-title\", fixElement);\n });\n }\n }\n\n function setupTableScrolling() {\n // TODO not used\n // When dealing with a really wide table, with wide cells, we want to keep\n // the text relatively narrow, but always keep in view that cell content\n var $ot = $(\".overflow-table table\");\n\n $ot.each(function () {\n var $tw = $(this);\n var $td = $tw.find(\"td\");\n\n if (!$td.length) {\n return;\n }\n\n // get table header cell right position\n var $th = $tw.find(\"th\");\n var thRight = $th.position().left + $th.outerWidth();\n\n $td.each(function () {\n var $this = $(this);\n var scrollTimer;\n\n $(\".report-page-view .overflow-table .inner\").scroll(function () {\n clearTimeout(scrollTimer);\n\n if ($this.attr(\"colspan\") > 1) {\n var tdText = $this.find(\".td-content\");\n var tdLeft = $this.position().left;\n var tdRight = tdLeft + $this.outerWidth(); // get table cell right position\n var tdTextWidth = $this.find(\".td-content\").width();\n var thAndCellWidth = tdTextWidth + thRight;\n\n $this.css(\"height\", $this.outerHeight());\n\n scrollTimer = setTimeout(afterScroll, 1);\n\n if (tdLeft < thRight) {\n tdText.addClass(\"td-scrolled\").css(\"left\", thRight + 5);\n } else {\n $this.css(\"height\", \"\");\n tdText.removeClass(\"td-scrolled\");\n }\n\n if (thAndCellWidth >= tdRight) {\n $this.addClass(\"td-relative\");\n } else {\n $this.removeClass(\"td-relative\");\n }\n }\n });\n\n function afterScroll() {\n // Tibi: temporarily disabled\n // $('.btn-translate').on('click', function() {\n // var $btn = $(this);\n // var transTextHeight = $btn.closest('.td-content').outerHeight();\n // var $td = $btn.closest('td.translatable');\n // var $th = $td.siblings('th');\n // $td.css({\n // 'height': transTextHeight,\n // 'padding': '0'\n // });\n // $btn.closest('.td-content').css('padding', '8px');\n // $th.css('height', transTextHeight);\n // });\n }\n });\n });\n }\n\n // check if element is in viewport\n $.fn.isInViewport = function () {\n var elementTop = $(this).offset().top;\n var elementBottom = elementTop + $(this).height();\n\n var viewportTop = $(window).scrollTop();\n var viewportBottom = viewportTop + $(window).height();\n\n return elementBottom > viewportTop && elementTop < viewportBottom;\n };\n\n function addCustomScroll() {\n var $cs = $(\n '
' +\n // ' ' +\n '
' +\n '
' +\n \"
\" +\n \"
\",\n );\n\n $cs.insertAfter($(\".overflow-table\").find(\".inner\"));\n }\n\n function setupCustomScroll() {\n // A fixed scrollbar at the bottom of the window for tables\n\n var $ot = $(\".overflow-table\");\n var $win = $(window);\n\n $ot.each(function () {\n var $t = $(this);\n // var $tParent = $t.parent();\n var $tParent = $t;\n var topScroll = $(\".top-scroll\", $tParent);\n var topScrollInner = topScroll.find(\".top-scroll-inner\");\n var tableScroll = $(\".inner\", $tParent);\n var tableWidth = $(\".table-report\", $tParent).outerWidth(\n (includeMargin = true),\n );\n var tableHeaderWidth = $(\"th\", $tParent).width();\n var tableAndHeaderWidth = tableWidth + tableHeaderWidth;\n var customScroll = $(\".scroll-wrapper\", $tParent);\n\n topScrollInner.width(tableWidth);\n\n topScroll.on(\"scroll\", function () {\n tableScroll.scrollLeft($(this).scrollLeft());\n });\n\n tableScroll.on(\"scroll\", function () {\n topScroll.scrollLeft($(this).scrollLeft());\n });\n\n if (tableAndHeaderWidth > $t.width()) {\n $win.on(\"resize scroll\", function () {\n var scroll = $win.scrollTop();\n\n if ($t.isInViewport()) {\n customScroll.addClass(\"fixed-scroll\");\n } else {\n customScroll.removeClass(\"fixed-scroll\");\n }\n\n // hide custom scrollbar when it reaches the bottom of the table\n if (\n scroll >=\n $t.offset().top + $t.outerHeight() - window.innerHeight\n ) {\n customScroll.hide();\n } else {\n customScroll.show();\n }\n });\n }\n });\n }\n\n function addFixedTable() {\n var $ot = $(\".overflow-table\");\n\n $ot.each(function () {\n var $table = $(this).find(\"table\");\n var $cb = $('');\n var $ft = $(\n '
' +\n '\" +\n '
' +\n '' +\n \"
\" +\n \"
\" +\n \"
\",\n );\n\n // Register click event for button to clear all pinned rows for the current table\n $ft.find(\"button.reset-pins\").click(function () {\n $ftw = $(this).closest(\".fixed-table-wrapper\");\n $ftw.removeClass(\"sticky-table\");\n $ftw.find(\"tr\").remove();\n\n $innerTable = $ftw.siblings(\".inner\");\n $innerTable.find(\"tr input\").prop(\"checked\", false);\n });\n\n if ($table.find(\"td.sub-header\").length) {\n // Regional descriptors\n $table.find(\"td.sub-header\").append($cb);\n } else {\n // National descriptors\n $table.find(\"th div\").append($cb);\n }\n\n $ft.insertBefore($(this).find(\".inner\"));\n });\n }\n\n $.fn.setupFixedTableRows = function () {\n // Allows report table rows to be fixed while scrolling\n // var $ot = $('.overflow-table');\n var $ot = $(this);\n\n // The .each is necessary, we can have more overflow-tables\n $ot.each(function () {\n var $t = $(this);\n var $fixedTable = $t.find(\".fixed-table-wrapper\");\n var $th = $(\"th\", $t.parent());\n var tableW = $(\".table-report\", $t).width();\n var tableScroll = $(\".inner\", $t);\n var fixedTableInner = $(\".fixed-table-inner\", $t);\n\n function toggleSyncScrolls(onoff) {\n function f1() {\n tableScroll.scrollLeft($(this).scrollLeft());\n }\n function f2() {\n fixedTableInner.scrollLeft($(this).scrollLeft());\n }\n if (onoff) {\n fixedTableInner.on(\"scroll\", f1);\n tableScroll.on(\"scroll\", f2);\n } else {\n fixedTableInner.off(\"scroll\", f1);\n tableScroll.off(\"scroll\", f2);\n }\n }\n toggleSyncScrolls(true);\n\n $t.find(\".fix-row\").each(function (i) {\n var val = \"cb\" + i++;\n // var checkBox = $(this).find('.fix-row');\n var checkBox = $(this);\n checkBox.val(val);\n });\n\n var checkBox = $t.find(\".fix-row\");\n checkBox.change(function () {\n var $this = $(this);\n var value = $this.val();\n var table = $this.closest(\".overflow-table\").find(\".fixed-table\");\n var tableWrapper = $this\n .closest(\".overflow-table\")\n .find(\".fixed-table-wrapper\");\n table.width(tableW);\n\n if ($this.is(\":checked\")) {\n tableWrapper.addClass(\"sticky-table\");\n\n //for other tables find the reset button and trigger the click event\n var $parentReportSection = $this.closest(\".report-section\");\n var $otherReportSections =\n $parentReportSection.siblings(\".report-section\");\n $otherReportSections.each(function () {\n $ftw = $(this).find(\".fixed-table-wrapper\");\n $ftw.find(\"button.reset-pins\").click();\n });\n\n // clone table row, but keep the width of the original table cells\n var target = $this.closest(\"tr\");\n var target_children = target.children(\"td\");\n var clone = target.clone();\n clone.children(\"td\").width(function (i, val) {\n return target_children.eq(i).outerWidth();\n });\n clone.appendTo(table).attr(\"data-row\", value);\n\n // disable for test\n //$t.find('.table').fixTableHeaderAndCellsHeight();\n // setupTableScrolling();\n } else {\n $fixedTable\n .find('tr[data-row=\"' + value + '\"]')\n .slideUp(\"fast\", function () {\n $(this).remove();\n });\n\n if (table.find(\"tr\").length === 1) {\n tableWrapper.removeClass(\"sticky-table\");\n }\n }\n\n var $cb = $fixedTable.find(\".fix-row\");\n $cb.change(function () {\n var $this = $(this);\n var value = $this.val();\n\n if ($this.closest(\"tr\").siblings().length === 0) {\n $this.closest(\".fixed-table-wrapper\").removeClass(\"sticky-table\");\n }\n\n $this.closest(\"tr\").remove();\n $('.fix-row[value=\"' + value + '\"]').prop(\"checked\", false);\n });\n\n toggleSyncScrolls(false);\n fixedTableInner.scrollLeft(tableScroll.scrollLeft());\n toggleSyncScrolls(true);\n });\n });\n\n $(window).on(\"resize scroll\", function () {\n if ($(\".report-nav.sticky\").length > 0) {\n $(\".fixed-table-wrapper\").each(function () {\n $(this).css(\"top\", \"56px\");\n });\n } else {\n $(\".fixed-table-wrapper\").each(function () {\n $(this).css(\"top\", \"0\");\n });\n }\n });\n };\n\n function setupResponsiveness() {\n // fire resize event after the browser window resizing it's completed\n var resizeTimer;\n $(window).resize(function () {\n clearTimeout(resizeTimer);\n resizeTimer = setTimeout(doneResizing, 500);\n });\n\n function doneResizing() {\n // $('.table-report').fixTableHeaderHeight();\n $(\".table-report\").each(function () {\n $(this).fixTableHeaderAndCellsHeight();\n });\n }\n\n if (window.matchMedia(\"(max-width: 768px)\").matches) {\n $(\".overflow-table h5\").width($(\".overflow-table table\").width());\n }\n\n // tibi: temporarily disabled. I don't know what td-content does\n // var $td = $('.overflow-table table td');\n // $td.children('div').wrapInner('
');\n }\n\n function setupSimplifiedTables() {\n $(\".simplify-form\")\n .next()\n .find(\".table-report\")\n .each(function () {\n $(this).simplifyTable();\n });\n\n $(\".simplify-form button\").on(\"click\", function () {\n var onoff = $(this).attr(\"aria-pressed\") == \"true\";\n $p = $(this).parent().next();\n $(\".table-report\", $p).toggleTable(!onoff);\n // Laci disable\n $p.setupFixedTableRows();\n setupCustomScroll();\n });\n }\n\n function regionalDescriptorsGroupTableHeaders() {\n var $headers = $(\".first-header\");\n if ($headers.length === 0) {\n return;\n }\n var compareText = \"\";\n var currentText = \"\";\n\n compareText = $headers[0].firstElementChild.innerText;\n\n for (i = 1; i < $headers.length; i++) {\n currentText = $headers[i].firstElementChild.innerText;\n\n if (compareText === currentText) {\n $headers[i].firstElementChild.innerText = \"\";\n $($headers[i - 1]).css(\"border-bottom\", \"0px\");\n } else {\n compareText = currentText;\n }\n\n //debugger;\n }\n }\n\n $.fn.setupStickyRows = function () {\n // make first th element(s) with 'sticky-col' class stick to the left of the\n // screen when scrolling horizontally\n $stickyTable = $(\".table-sticky-first-col\");\n $stickyTable.find(\"tr\").each(function () {\n $(this)\n .find(\"th.sticky-col\")\n .each(function () {\n $currentTh = $(this);\n $prevTh = $(this).prev(\".sticky-col\");\n\n if ($prevTh.hasClass(\"sticky-col\")) {\n prevWidth = $prevTh.outerWidth();\n prevLeft = parseInt($prevTh.css(\"left\"));\n $currentTh.css({ left: prevWidth + prevLeft });\n } else {\n $currentTh.css(\"left\", -1);\n }\n });\n });\n\n // Pin all rows with 'sticky-row' class\n $fixedTable = $(this).find(\".fixed-table\");\n var tableWrapper = $(this).find(\".fixed-table-wrapper\");\n tableWrapper.addClass(\"sticky-table\");\n\n if ($(this).find(\".inner table\").hasClass(\"table-sticky-first-col\")) {\n $fixedTable.addClass(\"table-sticky-first-col\");\n }\n\n $(this)\n .find(\"tr.sticky-row\")\n .each(function () {\n $(this)\n .children()\n .each(function () {\n var width = $(this).outerWidth();\n $(this).css(\"min-width\", width);\n $(this).css(\"width\", width);\n $(this).css(\"background-color\", $(this).css(\"background-color\"));\n $(this).css(\"color\", $(this).css(\"color\"));\n $(this).css(\"text-align\", $(this).css(\"text-align\"));\n });\n\n clone = $(this).clone();\n clone.appendTo($fixedTable);\n });\n\n // on scroll check if the all rows 'sticky-row' are displayed on screen\n // if not show the 'fixed-table' with the pinned rows\n $(window).on(\"resize scroll\", function () {\n $(\".overflow-table\").each(function () {\n var $ot = $(this);\n var tableWrapper = $ot.find(\".fixed-table-wrapper\");\n var stickyRowsInView = [];\n\n $ot.find(\".inner tr.sticky-row\").each(function () {\n var elementTop = $(this).offset().top;\n var viewportTop = parseInt($(window).scrollTop());\n // var viewportBottom = viewportTop + $(window).height();\n var $currentOT = $(this).parents(\".overflow-table\");\n var otTop = $currentOT.offset().top;\n var otBottom = otTop + $currentOT.outerHeight();\n var theadHeight = $(this).parents(\"thead\").outerHeight();\n\n // if this is false, we display the sticky bar on the top\n isInViewport =\n // $(this).isInViewport() ||\n // elementTop > viewportBottom\n elementTop > viewportTop || otBottom < viewportTop + theadHeight;\n\n stickyRowsInView.push(isInViewport);\n });\n\n if (stickyRowsInView.includes(false)) {\n $ot.removeClass(\"hidden-fixed-table\");\n } else {\n $ot.addClass(\"hidden-fixed-table\");\n }\n });\n });\n };\n\n $(document).ready(function ($) {\n setupReadMoreModal();\n initStyling();\n // setupSelects2();\n setupReportNavigation();\n // setupTableScrolling();\n setupResponsiveness();\n addCustomScroll();\n addFixedTable();\n regionalDescriptorsGroupTableHeaders();\n\n // $(\".pat-tooltip\").tooltip({\n // html: true,\n // title: $(this).attr(\"title\"),\n // });\n // $('[data-bs-toggle=\"tooltip\"]').tooltip({\n // html: true,\n // });\n // var popoverTriggerList = [].slice.call(\n // document.querySelectorAll('[data-bs-toggle=\"popover\"]'),\n // );\n // var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {\n // return new bootstrap.Popover(popoverTriggerEl);\n // });\n\n // Fix login url\n // $(\".pat-plone-modal\").attr(\"href\", \"/marine/assessment-module/login\");\n // Fix redirect on login\n // var _xhrOpen = XMLHttpRequest.prototype.open;\n // XMLHttpRequest.prototype.open = function (method, url) {\n // var self = this;\n // this.addEventListener(\"load\", function () {\n // if (\n // method === \"POST\" &&\n // url.indexOf(\"login\") !== -1 &&\n // self.responseURL.indexOf(\"login\") === -1\n // ) {\n // $(\".modal-wrapper\").hide();\n // window.location.href = self.responseURL;\n // }\n // });\n // _xhrOpen.apply(this, arguments);\n // };\n\n $(\".assessment-read-more\").click(function () {\n var $this = $(this);\n $this.text(function (a, b) {\n return b.startsWith(\"Show\")\n ? \"Hide reports\"\n : $(this).attr(\"display-text\");\n });\n $this.parents().siblings(\".assessment-dd-list\").fadeToggle();\n $this\n .parents()\n .siblings(\".text-reports-table\")\n .find(\".assessment-dd-list\")\n .fadeToggle();\n });\n\n var $scrollBtn = $(\".scroll-to-top\");\n $(window).scroll(function () {\n if ($(this).scrollTop() > 400) {\n $scrollBtn.fadeIn();\n } else {\n $scrollBtn.fadeOut();\n }\n });\n\n $scrollBtn.click(function () {\n $(\"html, body\").animate({ scrollTop: 0 }, 400);\n return false;\n });\n\n $(window).on(\"load\", function () {\n // setupReadMoreModal();\n setupSimplifiedTables();\n var $ot = $(\".overflow-table\");\n $ot.each(function () {\n $(this).setupFixedTableRows();\n $(this).find(\".table-report\").fixTableHeaderAndCellsHeight();\n // when loading the screen pin all rows marked with 'sticky-row' class\n // and display them if they are not in viewport\n $(this).setupStickyRows();\n });\n setupCustomScroll();\n\n // setupScrollableTargets();\n setupTargetsWidth();\n setupAssessmentStatusChange();\n\n setupProcessStateCheckboxes();\n });\n });\n})(window, document, $);\n"],"names":["window","document","$","setupCustomScroll","$ot","$win","each","$t","this","$tParent","topScroll","topScrollInner","find","tableScroll","tableWidth","outerWidth","includeMargin","tableAndHeaderWidth","width","customScroll","on","scrollLeft","scroll","scrollTop","isInViewport","addClass","removeClass","offset","top","outerHeight","innerHeight","hide","show","fn","fixTableHeaderAndCellsHeight","index","$th","$next","tdHeights","cells_max_height","height","thHeight","thInnerHeight","parents","hasClass","isSideBySideLeft","parent","children","$nextSideBySide","siblings","merge","$subheader","hght","$this","push","Math","max","apply","css","fixTableHeaderHeight","$thSideBySide","$rowSideBySide","simplifyTable","Array","prototype","last","length","$table","cache","data","html","curentLevel","setlimits","level","limits","row","sets","rowLevel","cursor","undefined","parseInt","not","ix","includes","text","trim","colspan","attr","slice","remove","l","iy","c","toggleTable","onoff","original","simplified","empty","setupReadMoreModal","setupTranslateClickHandlers","$modal","$modalContent","sh","t_html","substr","modal","click","elementTop","elementBottom","viewportTop","viewportBottom","setupFixedTableRows","$fixedTable","tableW","fixedTableInner","toggleSyncScrolls","f1","f2","off","i","val","change","target_children","value","table","closest","tableWrapper","is","$ftw","target","clone","eq","appendTo","slideUp","prop","setupStickyRows","$stickyTable","$currentTh","$prevTh","prev","prevWidth","prevLeft","left","stickyRowsInView","$currentOT","otBottom","theadHeight","ready","stickyOffset","$reportnav","$rn","$title","$reportDataNav","resizeTimer","doneResizing","toggle","toggleClass","fixElement","resize","clearTimeout","setTimeout","matchMedia","matches","insertAfter","$cb","$ft","$innerTable","append","insertBefore","$headers","currentText","compareText","firstElementChild","innerText","a","b","startsWith","fadeToggle","$scrollBtn","fadeIn","fadeOut","animate","maxGescompWidth","$tableWrap","next","$p","display","min-width","hover","$form","$assessmentContainers","url","action","body","ajax","type","serialize","success","location","reload","$newPhaseSelector","$select","console","log","removeAttr","replaceWith","select2","minimumResultsForSearch"],"mappings":"CAMA,SAAWA,EAAQC,EAAUC,GAkuB3B,SAASC,IAGP,IAAIC,EAAMF,EAAE,mBACRG,EAAOH,EAAEF,GAEbI,EAAIE,KAAK,WACP,IAAIC,EAAKL,EAAEM,MAEPC,EAAWF,EACXG,EAAYR,EAAE,cAAeO,GAC7BE,EAAiBD,EAAUE,KAAK,qBAChCC,EAAcX,EAAE,SAAUO,GAC1BK,EAAaZ,EAAE,gBAAiBO,GAAUM,WAC3CC,eAAgB,GAGfC,EAAsBH,EADHZ,EAAE,KAAMO,GAAUS,QAErCC,EAAejB,EAAE,kBAAmBO,GAExCE,EAAeO,MAAMJ,GAErBJ,EAAUU,GAAG,SAAU,WACrBP,EAAYQ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tRnE,CAsqCG1D,OAAQC,SAAUC"} \ No newline at end of file diff --git a/src/wise/msfd/static/wise/src/js/compliance.js b/src/wise/msfd/static/wise/src/js/compliance.js index d416ad7b..c7bf8526 100644 --- a/src/wise/msfd/static/wise/src/js/compliance.js +++ b/src/wise/msfd/static/wise/src/js/compliance.js @@ -534,6 +534,11 @@ } $.fn.simplifyTable = function simplifyTable() { + if (!Array.prototype.last) { + Array.prototype.last = function () { + return this[this.length - 1]; + }; + } var $table = $(this); if (!$table.data("original")) { From 696ab412ae51c843016dbd96c39e8556ea714bf4 Mon Sep 17 00:00:00 2001 From: laszlocseh Date: Wed, 1 Apr 2026 13:34:28 +0300 Subject: [PATCH 09/11] fix pylint --- src/wise/msfd/compliance/admin/migrate.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wise/msfd/compliance/admin/migrate.py b/src/wise/msfd/compliance/admin/migrate.py index ad5f0831..93bd2096 100644 --- a/src/wise/msfd/compliance/admin/migrate.py +++ b/src/wise/msfd/compliance/admin/migrate.py @@ -60,7 +60,8 @@ def migrate_local_roles(self, obj, principal_counts, portal_groups, for principal, roles in local_roles: if principal.startswith("extranet-"): - principal_counts[principal] = principal_counts.get(principal, 0) + 1 + principal_counts[principal] = principal_counts.get( + principal, 0) + 1 new_principal = principal.replace("extranet-", "local-") existing_roles = dict(local_roles).get(new_principal, []) @@ -139,7 +140,7 @@ def __call__(self): continue child_rel_path = ( - f"{current_rel_path}/{child_id}" + "{}/{}".format(current_rel_path, child_id) if current_rel_path else child_id ) stack.append((child, child_rel_path)) @@ -147,10 +148,11 @@ def __call__(self): if not dry_run: transaction.commit() - lines = [f"Migration finished.", f"Total objects processed: {total_objects}", ""] + lines = ["Migration finished.", + "Total objects processed: {}".format(total_objects), ""] for name in sorted(principal_counts): - lines.append(f"{name}: {principal_counts[name]} objects") + lines.append("{}: {} objects".format(name, principal_counts[name])) lines.append("") lines.append( From 31a5d2f06bdb99ab5c010b229476edb85cc50f69 Mon Sep 17 00:00:00 2001 From: EEA Jenkins Date: Wed, 1 Apr 2026 13:37:40 +0300 Subject: [PATCH 10/11] Updated version to 7.3 --- src/wise/msfd/version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wise/msfd/version.txt b/src/wise/msfd/version.txt index 95faf0b8..f9941623 100644 --- a/src/wise/msfd/version.txt +++ b/src/wise/msfd/version.txt @@ -1 +1 @@ -7.3-dev0 +7.3 From 0379397f8c76a54ed935c279a6ed696d945face0 Mon Sep 17 00:00:00 2001 From: EEA Jenkins Date: Wed, 1 Apr 2026 13:37:41 +0300 Subject: [PATCH 11/11] Updated changelog - removed develop information --- docs/HISTORY.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt index 48c52c5d..e991a6d4 100644 --- a/docs/HISTORY.txt +++ b/docs/HISTORY.txt @@ -1,8 +1,10 @@ Changelog ========= -7.3-dev0 - (unreleased) +7.3 - (2026-04-01) --------------------------- +* Change: Release + [laszlocseh] 7.2 - (2026-03-19) ---------------------------