-
+
-
-
{$MENU}
+
{/ifacl2}
diff --git a/lizmap/modules/admin/templates/project_list_help.tpl b/lizmap/modules/admin/templates/project_list_help.tpl
new file mode 100644
index 0000000000..f9aacfa20c
--- /dev/null
+++ b/lizmap/modules/admin/templates/project_list_help.tpl
@@ -0,0 +1,71 @@
+
{/if}
-{if $hasSomeProjectsNotDisplayed}
-
-${col.title}
+ `;
+ let originalTd = project_table.cell(rowIdx, col.columnIndex).node();
+
+ // Get the used class and title
+ let originalTdClass = originalTd.getAttribute('class');
+ let colClass = (originalTdClass !== null) ? originalTdClass : '';
+ let originalTdTitle = originalTd.getAttribute('title');
+ let colTitle = (originalTdTitle !== null) ? originalTdTitle : '';
+
+ // Create the dd for the given column
+ let colData = (col.data) ? col.data : '-';
+ colHtml += `
+ ${colData}
+ `;
+
+ if (col.hidden) hiddenColumns.push(col.title);
+
+ // Return the column hidden by datatable responsive extension
+ return (col.hidden && col.data) ? colHtml : '';
+
+ }).join('');
+
+ // Display a full block only if there is some data to display
+ // Else display a sentence
+ if (childrenContent) {
+ html = `
+ t.width?-1:0}),this._classLogic(),this._resizeAuto(),this.c.details);!1!==e.type&&(s._detailsInit(),i.on("column-visibility.dtr",function(){s._timer&&clearTimeout(s._timer),s._timer=setTimeout(function(){s._timer=null,s._classLogic(),s._resizeAuto(),s._resize(!0),s._redrawChildren()},100)}),i.on("draw.dtr",function(){s._redrawChildren()}),f(i.table().node()).addClass("dtr-"+e.type)),i.on("column-reorder.dtr",function(e,t,n){s._classLogic(),s._resizeAuto(),s._resize(!0)}),i.on("column-sizing.dtr",function(){s._resizeAuto(),s._resize()}),i.on("column-calc.dt",function(e,t){for(var n=s.s.current,i=0;i=r&&u(e,l[s].name);else if("not-"===n)for(s=0,o=l.length;s ").append(r).appendTo(i)),f(" ").append(n).appendTo(t),"inline"===this.c.details.type&&f(e).addClass("dtr-inline collapsed"),f(e).find("[name]").removeAttr("name"),f(e).css("position","relative"),(r=f("").css({width:1,height:1,overflow:"hidden",clear:"both"}).append(e)).insertBefore(s.table().node()),n.each(function(e){e=s.column.index("fromVisible",e);o[e].minWidth=this.offsetWidth||0}),r.remove())},_responsiveOnlyHidden:function(){var n=this.s.dt;return f.map(this.s.current,function(e,t){return!1===n.column(t).visible()||e})},_setColumnVis:function(e,t){var n=this,i=this.s.dt,r=t?"":"none";f(i.column(e).header()).css("display",r).toggleClass("dtr-hidden",!t),f(i.column(e).footer()).css("display",r).toggleClass("dtr-hidden",!t),i.column(e).nodes().to$().css("display",r).toggleClass("dtr-hidden",!t),f.isEmptyObject(this.s.childNodeStore)||i.cells(null,e).indexes().each(function(e){n._childNodesRestore(i,e.row,e.column)})},_tabIndexes:function(){var e=this.s.dt,t=e.cells({page:"current"}).nodes().to$(),n=e.settings()[0],i=this.c.details.target;t.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]"),("number"==typeof i?e.cells(null,i,{page:"current"}).nodes().to$():f(i="td:first-child, th:first-child"===i?">td:first-child, >th:first-child":i,e.rows({page:"current"}).nodes())).attr("tabIndex",n.iTabIndex).data("dtr-keyboard",1)}}),a.defaults={breakpoints:a.breakpoints=[{name:"desktop",width:1/0},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}],auto:!0,details:{display:(a.display={childRow:function(e,t,n){return t?f(e.node()).hasClass("parent")?(e.child(n(),"child").show(),!0):void 0:e.child.isShown()?(e.child(!1),!1):(e.child(n(),"child").show(),!0)},childRowImmediate:function(e,t,n){return!t&&e.child.isShown()||!e.responsive.hasHidden()?(e.child(!1),!1):(e.child(n(),"child").show(),!0)},modal:function(o){return function(e,t,n,i){if(t){if(!(s=f("div.dtr-modal-content")).length||e.index()!==s.data("dtr-row-idx"))return null;s.empty().append(n())}else{var r=function(){s.remove(),f(d).off("keypress.dtr"),f(e.node()).removeClass("parent"),i()},s=f('').append(f('').append(f('').data("dtr-row-idx",e.index()).append(n())).append(f(''+t.title+" ").append(f('').append(r._childNodes(i,t.rowIndex,t.columnIndex))).appendTo(s),o=!0)});return!!o&&s}},listHidden:function(){return function(e,t,n){n=f.map(n,function(e){var t=e.className?'class="'+e.className+'"':"";return e.hidden?"'+e.title+' '+e.data+" ":""}).join("");return!!n&&f(''+e.title+": "+e.data+" "}).join("");return f('
').append(n)}}}).listHidden(),target:0,type:"inline"},orthogonal:"display"},f.fn.dataTable.Api);return e.register("responsive()",function(){return this}),e.register("responsive.index()",function(e){return{column:(e=f(e)).data("dtr-index"),row:e.parent().data("dtr-index")}}),e.register("responsive.rebuild()",function(){return this.iterator("table",function(e){e._responsive&&e._responsive._classLogic()})}),e.register("responsive.recalc()",function(){return this.iterator("table",function(e){e._responsive&&(e._responsive._resizeAuto(),e._responsive._resize())})}),e.register("responsive.hasHidden()",function(){var e=this.context[0];return!!e._responsive&&-1!==f.inArray(!1,e._responsive._responsiveOnlyHidden())}),e.registerPlural("columns().responsiveHidden()","column().responsiveHidden()",function(){return this.iterator("column",function(e,t){return!!e._responsive&&e._responsive._responsiveOnlyHidden()[t]},1)}),a.version="2.5.0",f.fn.dataTable.Responsive=a,f.fn.DataTable.Responsive=a,f(d).on("preInit.dt.dtr",function(e,t,n){"dt"===e.namespace&&(f(t.nTable).hasClass("responsive")||f(t.nTable).hasClass("dt-responsive")||t.oInit.responsive||r.defaults.responsive)&&!1!==(e=t.oInit.responsive)&&new a(t,f.isPlainObject(e)?e:{})}),r});
\ No newline at end of file
{jmessage_bootstrap}
{$MAIN}
diff --git a/lizmap/modules/admin/locales/en_US/admin.UTF-8.properties b/lizmap/modules/admin/locales/en_US/admin.UTF-8.properties
index 30c82ea4c6..2e0fe29d12 100644
--- a/lizmap/modules/admin/locales/en_US/admin.UTF-8.properties
+++ b/lizmap/modules/admin/locales/en_US/admin.UTF-8.properties
@@ -283,7 +283,8 @@ server.information.qgis.unknown=QGIS server minimum %s and Lizmap QGIS server pl
server.information.error=Before checking your projects, you must check your QGIS server settings in the "Server information" menu. The configuration of QGIS Server is currently not correct.
-project.not.displayed=Some projects, listed below, can not be displayed in the main web interface because they need an update from the GIS administrator. Please read the guidelines about colours under this table.
+project.error.some.projects.not.displayed=Some projects, listed below, can not be displayed in the main web interface because they need an update from the GIS administrator. \
+Please read the guidelines about colours by clicking on the button "%s".
project.rules.list.introduction=Explanation about colours used in the table above
project.rules.list.description.html=Given your current Lizmap Web Client version %s and QGIS Server version %s, there are some rules about the table above :
project.rules.list.warnings.html=Warnings, projects are still visible, but you should have a look to these projects :
@@ -303,6 +304,7 @@ project.rules.list.blocking.description=Some projects are not visible anymore wi
project.rules.list.blocking.target.html=The project is designed for Lizmap Web Client version equal or less than %s.
project.list.column.repository.label=Repository
project.list.column.project.label=Project
+project.list.column.inspection.file.time.label=Inspection time
project.list.column.project.abstract.label=Abstract
project.list.column.project.has.log.label=QGIS Server logs
project.list.column.project.qgis.log.label=QGIS Server logs
@@ -337,6 +339,7 @@ project.list.column.invalid.layers.count.label=Invalid layers
project.list.column.invalid.layers.list.label=List of invalid layers
project.list.column.invalid.layers.count.error.label=Some layers cannot be read by QGIS. Please check that the server can access the layer data. \n* For file based layers, the path must be accessible.\n* For PostgreSQL layers, the Lizmap server must be able to connect to the database server.
project.list.column.layout.count.label=Layouts
-
-menu.lizmap.project.sidebar.title.label=Project details
-menu.lizmap.project.image.label=Image
+project.list.column.show.line.hidden.columns=Show/Hide the hidden columns
+project.modal.title=Table legend
+project.modal.button.close=Close
+project.list.no.hidden.column.content=No extra content for this project in the following hidden table columns
diff --git a/lizmap/modules/admin/templates/project_list.tpl b/lizmap/modules/admin/templates/project_list.tpl
index 9bb5ecdf7a..09858ee751 100644
--- a/lizmap/modules/admin/templates/project_list.tpl
+++ b/lizmap/modules/admin/templates/project_list.tpl
@@ -6,23 +6,6 @@
{$projectList}
-
-
{@admin.menu.lizmap.project.sidebar.title.label@}
-
-
- -
-
- {@admin.menu.lizmap.project.image.label@} - -
- {@admin.project.list.column.project.label@} - -
- {@admin.project.list.column.project.abstract.label@} - -
- {@admin.project.list.column.invalid.layers.list.label@} - -
- {@admin.project.list.column.project.qgis.log.label@} - -
+
diff --git a/lizmap/modules/admin/templates/project_list_zone.tpl b/lizmap/modules/admin/templates/project_list_zone.tpl
index af296c8901..0f503e3fd2 100644
--- a/lizmap/modules/admin/templates/project_list_zone.tpl
+++ b/lizmap/modules/admin/templates/project_list_zone.tpl
@@ -1,7 +1,10 @@
{meta_html css $basePath.'assets/css/dataTables.bootstrap.min.css'}
+{meta_html css $basePath.'assets/css/responsive.dataTables.min.css'}
{meta_html js $basePath.'assets/js/jquery.dataTables.min.js'}
+{meta_html js $basePath.'assets/js/dataTables.responsive.min.js'}
{meta_html js $basePath.'assets/js/admin/activate_datatable.js'}
+
{assign $tableClass=''}
{if $hasInspectionData}
{assign $tableClass='has_inspection_data'}
@@ -15,35 +18,43 @@
+
+
+ {@admin.project.modal.title@}
+
+
+ + {jlocale "admin.project.rules.list.description.html", array($lizmapVersion, + ($serverVersions['qgis_server_version_human_readable']))} +
+ +-
+
- {@admin.project.rules.list.blocking.html@} +
- {jlocale "admin.project.rules.list.blocking.target.html", + array($minimumLizmapTargetVersionRequired - 0.1)} +
- {@admin.project.rules.list.warnings.html@} +
- {@admin.project.list.column.qgis.desktop.version.label@} +
- {jlocale "admin.project.rules.list.qgis.version.warning.html", + array($serverVersions['qgis_server_version_old'])} +
- {jlocale "admin.project.rules.list.qgis.version.error.html", array( + $serverVersions['qgis_server_version_next'])} +
- {@admin.project.list.column.target.lizmap.version.label.longer@} +
- {jlocale "admin.project.rules.list.target.version.html", + array($minimumLizmapTargetVersionRequired)} +
- {@admin.project.list.column.layers.count.label.longer@} +
- {jlocale "admin.project.rules.list.important.count.layers.html", + array($warningLayerCount)} +
- {jlocale "admin.project.rules.list.very.important.count.layers.html", + array(($errorLayerCount))} +
- {@admin.project.list.column.crs.label@} +
- {@admin.project.rules.list.custom.projection@} +
- {@admin.project.list.column.invalid.layers.count.label@} +
- {@admin.project.rules.list.invalid.datasource.html@} +
- {@admin.project.list.column.loading.time.label.alt@} +
- {jlocale "admin.project.rules.list.warning.loading.html", + array($warningLoadingTime)} +
- {jlocale "admin.project.rules.list.error.loading.html", array($errorLoadingTime)} + +
- {@admin.project.list.column.memory.usage.label.alt@} +
- {jlocale "admin.project.rules.list.warning.memory.html", array($warningMemory)} + +
- {jlocale "admin.project.rules.list.error.memory.html", array($errorMemory)} +
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
- {@admin.project.not.displayed@}
-
-{/if}
+
+{@admin.project.modal.title@}
+
+
+
+{@admin.project.list.no.hidden.column.content@}
+
+
{@admin.project.list.column.repository.label@} | {@admin.project.list.column.project.label@} | -{@admin.project.list.column.project.abstract.label@} | -{@admin.menu.lizmap.project.image.label@} | {@admin.project.list.column.layers.count.label@} | {if $hasInspectionData}{@admin.project.list.column.invalid.layers.count.label@} | -{@admin.project.list.column.invalid.layers.list.label@} | {@admin.project.list.column.project.has.log.label@} | -{@admin.project.list.column.project.qgis.log.label@} | {@admin.project.list.column.loading.time.label@} | {@admin.project.list.column.memory.usage.label@} | {/if}{@admin.project.list.column.qgis.desktop.version.label@} | -{@admin.project.list.column.lizmap.plugin.version.label@} | {@admin.project.list.column.target.lizmap.version.label@} | -{@admin.project.list.column.authorized.groups.label@} | +{@admin.project.list.column.hidden.project.label@} | +{@admin.project.list.column.authorized.groups.label@} | {@admin.project.list.column.project.file.time.label@} | + {if $hasInspectionData} +{@admin.project.list.column.inspection.file.time.label@} | + {/if}{@admin.project.list.column.crs.label@} | + {if $hasInspectionData} +{@admin.project.list.column.invalid.layers.list.label@} | +{@admin.project.list.column.project.qgis.log.label@} | + {/if}|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ | + -+ | {$mi->id} | -+ | {$p['id']} | - -{$p['abstract']|strip_tags|eschtml:ENT_QUOTES} | - - -{$p['image']} | - - {assign $style = ''} + {assign $class = ''} {assign $title = ''} {if $p['layer_count'] > $warningLayerCount} - {assign $style = 'background-color: '.$colors['warning'].';'} + {assign $class = 'liz-warning'} {assign $title = @admin.project.list.column.layers.count.warning.label@} {/if} {if $p['layer_count'] > $errorLayerCount} - {assign $style = 'background-color: '.$colors['error'].';'} + {assign $class = 'liz-error'} {assign $title = @admin.project.list.column.layers.count.error.label@} {/if} -+ | {$p['layer_count']} | {if $hasInspectionData} - {assign $style = ''} + {assign $class = ''} {assign $title = ''} {if $p['invalid_layers_count'] > 0} - {assign $style = 'background-color: '.$colors['error'].';'} + {assign $class = 'liz-error'} {assign $title = @admin.project.list.column.invalid.layers.count.error.label@} {/if} -+ | {$p['invalid_layers_count']} | - - {if $p['invalid_layers_count'] > 0} -
-
|
- {else}
- - {/if} - - - | {if !empty(trim($p['qgis_log']))}🔴{/if} | - - -{$p['qgis_log']|strip_tags|eschtml:ENT_QUOTES|nl2br} | +{if !empty($p['qgis_log']) && !empty(trim($p['qgis_log']))}🔴{/if} | - {assign $style = ''} + {assign $class = ''} {assign $title = ''} {if $p['loading_time'] > $warningLoadingTime} - {assign $style = 'background-color: '.$colors['warning'].';'} + {assign $class = 'liz-warning'} {assign $title = @admin.project.list.column.loading.time.warning.label@} {/if} {if $p['loading_time'] > $errorLoadingTime} - {assign $style = 'background-color: '.$colors['error'].';'} + {assign $class = 'liz-error'} {assign $title = @admin.project.list.column.loading.time.error.label@} {/if} -+ | + {if !empty($p['loading_time'])} {$p['loading_time']|number_format:2:'.':' '} + {/if} | - {assign $style = ''} + {assign $class = ''} {assign $title = ''} {if $p['memory_usage'] > $warningMemory } - {assign $style = 'background-color: '.$colors['warning'].';'} + {assign $class = 'liz-warning'} {assign $title = @admin.project.list.column.memory.usage.warning.label@} {/if} {if $p['memory_usage'] > $errorMemory } - {assign $style = 'background-color: '.$colors['error'].';'} + {assign $class = 'liz-error'} {assign $title = @admin.project.list.column.memory.usage.error.label@} {/if} -+ | + {if !empty($p['memory_usage'])} {$p['memory_usage']|number_format:2:'.':' '} + {/if} | {/if} - {assign $style = ''} + {assign $class = ''} {assign $title = ''} {if $serverVersions['qgis_server_version_int'] && $serverVersions['qgis_server_version_int'] - $p['qgis_version_int'] > $oldQgisVersionDiff } - {assign $style = 'background-color: '.$colors['warning'].';'} + {assign $class = 'liz-warning'} {assign $title = @admin.project.list.column.qgis.desktop.version.too.old@.' ('.@admin.form.admin_services.qgisServerVersion.label@.': '.$serverVersions['qgis_server_version'].')'} {/if} {if $serverVersions['qgis_server_version_int'] && $p['qgis_version_int'] > $serverVersions['qgis_server_version_int']} - {assign $style = 'background-color: '.$colors['error'].';'} + {assign $class = 'liz-error'} {assign $title = @admin.project.list.column.qgis.desktop.version.above.server@ .' ('.$serverVersions['qgis_server_version'].')'} {/if} -+ | {$p['qgis_version']} | - -- {$p['lizmap_plugin_version']} - | - - {assign $style = ''} + {assign $class = ''} {assign $title = ''} {if $p['needs_update_error']} - {assign $style = 'background-color: '.$colors['blocker'].';'} + {assign $class = 'liz-blocker'} {assign $title = @admin.project.list.column.update.in.qgis.desktop@} {/if} {if $p['needs_update_warning']} - {assign $style = 'background-color: '.$colors['warning'].';'} + {assign $class = 'liz-warning'} {assign $title = @admin.project.list.column.update.soon.in.qgis.desktop@} {/if} -+ | {$p['lizmap_web_client_target_version_display']} | - -- {$p['acl_groups']|strip_tags|eschtml:ENT_QUOTES} - | + + + +@@ -211,21 +201,65 @@ {/if} | + ++ {if !empty($p['acl_groups'])} + {$p['acl_groups']|strip_tags|eschtml} + {/if} + | +{$p['file_time']|jdatetime:'timestamp':'Y-m-d H:i:s'} | + {if $hasInspectionData} + ++ {if !empty($p['inspection_timestamp'])} + {$p['inspection_timestamp']|jdatetime:'timestamp':'Y-m-d H:i:s'} + {/if} + | + {/if} + - {assign $style = ''} + {assign $class = ''} {assign $title = ''} {if substr($p['projection'], 0, 4) == 'USER'} - {assign $style = 'background-color: '.$colors['warning'].';'} + {assign $class = 'liz-warning'} {assign $title = @admin.project.list.column.crs.user.warning.label@} {/if} -- {$p['projection']|strip_tags|eschtml:ENT_QUOTES} + | + {if !empty($p['projection'])} + {$p['projection']|strip_tags|eschtml} + {/if} + | + + {if $hasInspectionData} + + {if $p['invalid_layers_count'] > 0} +
+
|
+ {else}
+ + {/if} + + + |
+ {if !empty($p['qgis_log'])}
+ + {$p['qgis_log']|strip_tags|eschtml|nl2br} ++ {/if} |
+ {/if}
-
- {@admin.project.rules.list.introduction@} -
+
+{include 'admin~project_list_help'}
diff --git a/lizmap/modules/admin/zones/project_list.zone.php b/lizmap/modules/admin/zones/project_list.zone.php
index 656e547369..85268b0bf4 100644
--- a/lizmap/modules/admin/zones/project_list.zone.php
+++ b/lizmap/modules/admin/zones/project_list.zone.php
@@ -72,7 +72,17 @@ protected function _prepareTpl()
$this->_tpl->assign('mapItems', $maps);
$this->_tpl->assign('hasInspectionData', $hasInspectionData);
$this->_tpl->assign('minimumLizmapTargetVersionRequired', $humanLizmapTargetVersion);
- $this->_tpl->assign('hasSomeProjectsNotDisplayed', $hasSomeProjectsNotDisplayed);
+
+ // Add an warning message when some projects cannot be displayed in LWC
+ if ($hasSomeProjectsNotDisplayed) {
+ \jMessage::add(
+ jLocale::get(
+ 'admin~admin.project.error.some.projects.not.displayed',
+ array(jLocale::get('admin~admin.project.modal.title'))
+ ),
+ 'warning'
+ );
+ }
// Get the server metadata
$server = new \Lizmap\Server\Server();
@@ -150,10 +160,6 @@ private function getProjectListItem($inspectionDirectoryPath, $projectMetadata)
'view~map:index',
array('repository' => $projectMetadata->getRepository(), 'project' => $projectMetadata->getId())
),
- 'image' => jUrl::get(
- 'view~media:illustration',
- array('repository' => $projectMetadata->getRepository(), 'project' => $projectMetadata->getId())
- ),
'lizmap_web_client_target_version' => $projectMetadata->getLizmapWebClientTargetVersion(),
// convert int to string orderable
'lizmap_plugin_version' => $this->pluginIntVersionToSortableString($projectMetadata->getLizmapPluginVersion()),
@@ -215,6 +221,7 @@ private function getProjectInspection($inspectionDirectoryPath, $projectRelative
{
// Default empty values
$inspectionData = array(
+ 'inspection_timestamp' => null,
'has_inspection_data' => false,
'loading_time' => 0,
'memory_usage' => null,
@@ -251,8 +258,10 @@ private function getProjectInspection($inspectionDirectoryPath, $projectRelative
return $inspectionData;
}
- // Add the information
+ // Add inspection data
$inspectionData['has_inspection_data'] = true;
+
+ $inspectionData['inspection_timestamp'] = filemtime($jsonPath);
if (property_exists($inspection, 'loading_infos')) {
$inspectionData['loading_time'] = $inspection->loading_infos->loading_time_ms / 1000;
$inspectionData['memory_usage'] = $inspection->loading_infos->memory_footprint / 1024 / 2024;
diff --git a/lizmap/www/assets/css/admin.css b/lizmap/www/assets/css/admin.css
index dd9942dd86..6ee4c7b7b2 100644
--- a/lizmap/www/assets/css/admin.css
+++ b/lizmap/www/assets/css/admin.css
@@ -89,65 +89,120 @@ fieldset {
}
}
-/* Admin QGIS project lists */
+
+/*
+======
+Admin QGIS project lists
+======
+*/
div#lizmap_project_list_container {
- display: flex;
- flex-wrap: wrap;
height: 80%;
width: 100%;
margin: auto;
+
+ /* Colors */
+ --warning-bg-color: lightyellow;
+ --error-bg-color: lightcoral;
+ --blocker-bg-color: red;
+ --highlighted-line-bg-color: #0088cc;
}
#lizmap_project_list {
- flex-basis: 0;
- flex-grow: 999;
min-inline-size: 60%;
border: 1px solid lightgray;
padding: 5px;
}
-#lizmap_project_list_sidebar {
+div.lizmap_project_list_details {
background-color: lightgray;
padding: 5px;
- flex-basis: 30%;
- flex-grow: 1;
-}
-#lizmap_project_list_sidebar.collapsed {
- display: none;
}
+
+/* Cursor pointer only if the table has hidden columns (responsive datatable extension) */
table.lizmap_project_list tr {
+ cursor: default;
+}
+table.lizmap_project_list tr.has_hidden_columns {
cursor: pointer;
}
-table.lizmap_project_list tr.selected {
- background-color: lightskyblue;
+
+/* hovered line */
+/* Blue left border when hovering a line */
+table.lizmap_project_list tr td:first-child {
+ border-left: 3px solid transparent;
+}
+table.lizmap_project_list tr:not(.child):hover td:first-child
+{
+ border-left: 3px solid var(--highlighted-line-bg-color);
+}
+
+table.lizmap_project_list tr .liz-warning{
+ background-color: var(--warning-bg-color);
+}
+table.lizmap_project_list tr .liz-error{
+ background-color: var(--error-bg-color);
}
-table.lizmap_project_list tr.active a,
-table.lizmap_project_list tr.active a:hover,
-table.lizmap_project_list tr.selected a,
-table.lizmap_project_list tr.selected a:hover{
- color: white;
- text-decoration: underline dotted;
+table.lizmap_project_list tr .liz-blocker{
+ background-color: var(--blocker-bg-color);
}
-#lizmap_project_list_sidebar dt {
+/* When the width of the window is not big enough, some columns are hidden
+by the responsive extension of datatable.
+Style the div which will contain the details */
+div.lizmap_project_list_details dt {
margin-top: 5px;
}
-#lizmap_project_list_sidebar dd {
+div.lizmap_project_list_details dd {
padding: 5px;
max-height: 250px;
overflow: auto;
background-color: #efefef;
}
-dd#dd_image_value {
- background-color: transparent;
-}
-dd#dd_image_value img {
- height: 150px;
+table.lizmap_project_list tr dd.lizmap-project-qgis-log pre {
+ font-size: 0.9em;
+ line-height: 10px;
}
-dd#dd_qgis_logs_value {
+table.lizmap_project_list tr td.lizmap-project-qgis-log pre {
font-size: 0.8em;
- line-height: 15px;
+ line-height: 10px;
+ max-height: 80px;
+ max-width: 300px;
+ overflow: auto;
+}
+/* End of project list page */
+
+/* Project list help with colours and legend */
+#lizmap_project_list_help div.modal-body {
+ background-color: rgb(239, 239, 239);
+}
+#lizmap_project_list_help ul ul li {
+ font-weight: bold;
+}
+#lizmap_project_list_help ul ul ul.rules li {
+ font-weight: normal;
+}
+#lizmap_project_list_help ul > .rules {
+ list-style: none;
+}
+#lizmap_project_list_help ul > .rules li::before {
+ content: 'â– ';
+ font-weight: bold;
+ display: inline-block;
+ width: 1em;
+ margin-left: -1em;
+ font-size: 2.5em;
+}
+#lizmap_project_list_help .warning::before {
+ color: var(--warning-bg-color);
}
+#lizmap_project_list_help .error::before {
+ color: var(--error-bg-color);
+}
+#lizmap_project_list_help .blocker::before {
+ color: var(--blocker-bg-color);
+}
+
+/* List of users and groups */
.jacl2-list.jacl2-list-sticky-heads thead,
.jacl2-list-user.jacl2-list-sticky-heads thead
{
diff --git a/lizmap/www/assets/css/responsive.dataTables.min.css b/lizmap/www/assets/css/responsive.dataTables.min.css
new file mode 100644
index 0000000000..88adaea8c6
--- /dev/null
+++ b/lizmap/www/assets/css/responsive.dataTables.min.css
@@ -0,0 +1 @@
+table.dataTable.dtr-inline.collapsed>tbody>tr>td.child,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty{cursor:default !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty:before{display:none !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control,table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control{cursor:pointer}table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before{margin-right:.5em;display:inline-block;color:rgba(0, 0, 0, 0.5);content:"â–º"}table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control.arrow-right::before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control.arrow-right::before{content:"â—„"}table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td.dtr-control:before,table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th.dtr-control:before{content:"â–¼"}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td.dtr-control,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th.dtr-control{padding-left:.333em}table.dataTable.dtr-column>tbody>tr>td.dtr-control,table.dataTable.dtr-column>tbody>tr>th.dtr-control,table.dataTable.dtr-column>tbody>tr>td.control,table.dataTable.dtr-column>tbody>tr>th.control{cursor:pointer}table.dataTable.dtr-column>tbody>tr>td.dtr-control:before,table.dataTable.dtr-column>tbody>tr>th.dtr-control:before,table.dataTable.dtr-column>tbody>tr>td.control:before,table.dataTable.dtr-column>tbody>tr>th.control:before{display:inline-block;color:rgba(0, 0, 0, 0.5);content:"â–º"}table.dataTable.dtr-column>tbody>tr>td.dtr-control.arrow-right::before,table.dataTable.dtr-column>tbody>tr>th.dtr-control.arrow-right::before,table.dataTable.dtr-column>tbody>tr>td.control.arrow-right::before,table.dataTable.dtr-column>tbody>tr>th.control.arrow-right::before{content:"â—„"}table.dataTable.dtr-column>tbody>tr.parent td.dtr-control:before,table.dataTable.dtr-column>tbody>tr.parent th.dtr-control:before,table.dataTable.dtr-column>tbody>tr.parent td.control:before,table.dataTable.dtr-column>tbody>tr.parent th.control:before{content:"â–¼"}table.dataTable>tbody>tr.child{padding:.5em 1em}table.dataTable>tbody>tr.child:hover{background:transparent !important}table.dataTable>tbody>tr.child ul.dtr-details{display:inline-block;list-style-type:none;margin:0;padding:0}table.dataTable>tbody>tr.child ul.dtr-details>li{border-bottom:1px solid #efefef;padding:.5em 0}table.dataTable>tbody>tr.child ul.dtr-details>li:first-child{padding-top:0}table.dataTable>tbody>tr.child ul.dtr-details>li:last-child{padding-bottom:0;border-bottom:none}table.dataTable>tbody>tr.child span.dtr-title{display:inline-block;min-width:75px;font-weight:bold}div.dtr-modal{position:fixed;box-sizing:border-box;top:0;left:0;height:100%;width:100%;z-index:100;padding:10em 1em}div.dtr-modal div.dtr-modal-display{position:absolute;top:0;left:0;bottom:0;right:0;width:50%;height:fit-content;max-height:75%;overflow:auto;margin:auto;z-index:102;overflow:auto;background-color:#f5f5f7;border:1px solid black;border-radius:.5em;box-shadow:0 12px 30px rgba(0, 0, 0, 0.6)}div.dtr-modal div.dtr-modal-content{position:relative;padding:2.5em}div.dtr-modal div.dtr-modal-content h2{margin-top:0}div.dtr-modal div.dtr-modal-close{position:absolute;top:6px;right:6px;width:22px;height:22px;text-align:center;border-radius:3px;cursor:pointer;z-index:12}div.dtr-modal div.dtr-modal-background{position:fixed;top:0;left:0;right:0;bottom:0;z-index:101;background:rgba(0, 0, 0, 0.6)}@media screen and (max-width: 767px){div.dtr-modal div.dtr-modal-display{width:95%}}html.dark table.dataTable>tbody>tr>td.dtr-control:before{color:rgba(255, 255, 255, 0.5) !important}html.dark table.dataTable>tbody>tr.child ul.dtr-details>li{border-bottom-color:rgb(64, 67, 70)}html.dark div.dtr-modal div.dtr-modal-display{background-color:rgb(33, 37, 41);border:1px solid rgba(255, 255, 255, 0.15)}
diff --git a/lizmap/www/assets/js/admin/activate_datatable.js b/lizmap/www/assets/js/admin/activate_datatable.js
index c3593b4cde..3a112c3a85 100644
--- a/lizmap/www/assets/js/admin/activate_datatable.js
+++ b/lizmap/www/assets/js/admin/activate_datatable.js
@@ -3,34 +3,37 @@ $(document).ready(function () {
// Activate datatable for the project list table
if ($('table.lizmap_project_list').length) {
+ let has_inspection_data = false;
+ if ($('table.lizmap_project_list').hasClass('has_inspection_data')) {
+ has_inspection_data = true;
+ }
- // Activate the datatable functionality
- // for the projet list table
+ // Configure the rendering of some columns
var columnDefs = [
+ // Change lizmap plugin version display
{
- "targets": [2, 3],
- "visible": false,
- "searchable": false
- },{
- "targets": 'lzmplugv',
- "render": function ( data, type, row, meta ) {
+ "targets": 'lizmap_plugin_version',
+ "render": function (data, type, row, meta) {
if (type == 'display') {
- return data.replace(/\.0/g,'.').replace(/^0/,'');
+ return data.replace(/\.0/g, '.').replace(/^0/, '');
}
return data;
}
}
];
- if ($('table.lizmap_project_list').hasClass('has_inspection_data')) {
+ if (has_inspection_data) {
+ // Hide some columns but keep them to keep the data accessible
columnDefs.push(
{
- "targets": [6, 8],
+ // "targets": [columnIndexes['invalid_layers_list'], columnIndexes['qgis_log']],
+ "targets": [],
"visible": false,
"searchable": false
}
);
}
+ // Activate datatable on the project list table
var project_table = $('table.lizmap_project_list').DataTable({
"paging": false,
'autoWidth': true,
@@ -38,78 +41,99 @@ $(document).ready(function () {
'scrollY': '65vh',
'scrollCollapse': true,
"info": true,
- "columnDefs": columnDefs
- });
-
- /**
- * Display the project detail in the right sidebar
- *
- * @param {Array} data The project data
- * @param {Boolean} has_inspection_data If the project has inspection data
- */
- function displayProjectDetail(data, has_inspection_data) {
- // Project title
- let title = data[1] ? data[1] : null;
- $('#dd_title_value').html(title);
-
- // Project abstract
- let abstract = data[2] ? data[2] : null;
- $('#dd_abstract_value').html(abstract);
-
- // Project image
- $('#dd_image_value').html(
- ''
- );
-
- // Invalid layers
- var invalid_layers = null;
- if (has_inspection_data) {
- invalid_layers = data[6] ? data[6] : null;
+ "columnDefs": columnDefs,
+ // Configure the responsive tool with a full customized display
+ responsive: {
+ details: {
+ type: 'column',
+ target: 'tr',
+ renderer: function (api, rowIdx, columns) {
+ let html = '';
+ let hiddenColumns = [];
+ let childrenContent = columns.map((col, i) => {
+ // Find the original table column
+ let colHtml = `
+ - {@admin.project.rules.list.introduction@} -
- {jlocale "admin.project.rules.list.description.html", array($lizmapVersion, ($serverVersions['qgis_server_version_human_readable']))} -
- --
-
- {@admin.project.rules.list.warnings.html@} -
- {@admin.project.list.column.qgis.desktop.version.label@} -
- {jlocale "admin.project.rules.list.qgis.version.warning.html", array($serverVersions['qgis_server_version_old'])} -
- {jlocale "admin.project.rules.list.qgis.version.error.html", array( $serverVersions['qgis_server_version_next'])} -
- {@admin.project.list.column.target.lizmap.version.label.longer@} -
- {jlocale "admin.project.rules.list.target.version.html", array($minimumLizmapTargetVersionRequired)} -
- {@admin.project.list.column.layers.count.label.longer@} -
- {jlocale "admin.project.rules.list.important.count.layers.html", array($warningLayerCount)} -
- {jlocale "admin.project.rules.list.very.important.count.layers.html", array(($errorLayerCount))} -
- {@admin.project.list.column.crs.label@} -
- {@admin.project.rules.list.custom.projection@} -
- {@admin.project.list.column.invalid.layers.count.label@} -
- {@admin.project.rules.list.invalid.datasource.html@} -
- {@admin.project.list.column.loading.time.label.alt@} -
- {jlocale "admin.project.rules.list.warning.loading.html", array($warningLoadingTime)} -
- {jlocale "admin.project.rules.list.error.loading.html", array($errorLoadingTime)} -
- {@admin.project.list.column.memory.usage.label.alt@} -
- {jlocale "admin.project.rules.list.warning.memory.html", array($warningMemory)} -
- {jlocale "admin.project.rules.list.error.memory.html", array($errorMemory)} -
- {@admin.project.rules.list.blocking.html@} -
- {jlocale "admin.project.rules.list.blocking.target.html", array($minimumLizmapTargetVersionRequired - 0.1)} -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ ${childrenContent}
+
×
').click(function(){r()}))).append(f('').click(function(){r()})).appendTo("body");f(e.node()).addClass("parent"),f(d).on("keyup.dtr",function(e){27===e.keyCode&&(e.stopPropagation(),r())})}return o&&o.header&&f("div.dtr-modal-content").prepend("