Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
mdouchin committed Aug 4, 2023
1 parent 7148f7f commit 8c55ccf
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 64 deletions.
5 changes: 3 additions & 2 deletions lizmap/modules/admin/locales/en_US/admin.UTF-8.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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 <strong>%s</strong> and QGIS Server version <strong>%s</strong>, there are some rules about the table above :
project.rules.list.warnings.html=<strong>Warnings</strong>, projects are still visible, but you should have a look to these projects :
Expand Down Expand Up @@ -341,4 +342,4 @@ project.list.column.layout.count.label=Layouts
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 hidden table columns
project.list.no.hidden.column.content=No extra content for this project in the following hidden table columns
43 changes: 7 additions & 36 deletions lizmap/modules/admin/templates/project_list_help.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,19 @@
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>{@admin.project.modal.title@}</h3>
</div>
<div class="modal-body" style="background-color: rgb(239, 239, 239);">
<style type="text/css" scoped>
{literal}
ul ul li {
font-weight: bold;
}
ul ul ul.rules li {
font-weight: normal;
}
ul > .rules {
list-style: none;
}
ul > .rules li::before {
content: '';
font-weight: bold;
display: inline-block;
width: 1em;
margin-left: -1em;
font-size: 2.5em;
}
.warning::before {
color: var(--warning-bg-color);
}
.error::before {
color: var(--error-bg-color);
}
.blocker::before {
color: var(--blocker-bg-color);
}
{/literal}
</style>
<div class="modal-body">
<p>
{jlocale "admin.project.rules.list.description.html", array($lizmapVersion,
($serverVersions['qgis_server_version_human_readable']))}
</p>

<ul>
<li>{@admin.project.rules.list.blocking.html@}</li>
<ul class="rules">
<li class="blocker">{jlocale "admin.project.rules.list.blocking.target.html",
array($minimumLizmapTargetVersionRequired - 0.1)}</li>
</ul>

<li>{@admin.project.rules.list.warnings.html@}</li>
<ul>
<li>{@admin.project.list.column.qgis.desktop.version.label@}</li>
Expand Down Expand Up @@ -87,11 +63,6 @@
{/if}

</ul>
<li>{@admin.project.rules.list.blocking.html@}</li>
<ul class="rules">
<li class="blocker">{jlocale "admin.project.rules.list.blocking.target.html",
array($minimumLizmapTargetVersionRequired - 0.1)}</li>
</ul>
</ul>
</div>
<div class="modal-footer">
Expand Down
35 changes: 20 additions & 15 deletions lizmap/modules/admin/templates/project_list_zone.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{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'}
Expand All @@ -17,12 +18,16 @@
</div>
{/if}

<span id="lizmap_project_list_no_data_label" style="display: none;">{@admin.project.list.no.hidden.column.content@}</span>

<!-- Help button about the colours used in the table -->
<a href="#lizmap_project_list_help" role="button" class="btn pull-right" data-toggle="modal">{@admin.project.modal.title@}</a>
<!-- The modal div code is at the bottom of this file -->

<!-- Sentence displayed when the user clicks on a line of the projects table
to view the hidden columns data and when there is no data for these columns -->
<span id="lizmap_project_list_no_data_label" style="display: none;">{@admin.project.list.no.hidden.column.content@}</span>

<!-- The table contains the projects data. Datatables is used to improve the UX -->
<table class="lizmap_project_list table table-condensed table-bordered {$tableClass}" style="width:100%">
<thead>
<tr>
Expand All @@ -38,7 +43,7 @@
{/if}
<th>{@admin.project.list.column.qgis.desktop.version.label@}</th>
<th>{@admin.project.list.column.target.lizmap.version.label@}</th>
<th class='lizmap_plugin_version'>{@admin.project.list.column.lizmap.plugin.version.label@}</th>
<!-- <th class='lizmap_plugin_version'>{@admin.project.list.column.lizmap.plugin.version.label@}</th> -->
<th>{@admin.project.list.column.hidden.project.label@}</th>
<th>{@admin.project.list.column.authorized.groups.label@}</th>
<th>{@admin.project.list.column.project.file.time.label@}</th>
Expand Down Expand Up @@ -73,13 +78,13 @@
</td>

<!-- repository -->
<td title="{if !empty($mi->title)}{$mi->title|strip_tags|eschtml:ENT_QUOTES}{/if}">
<td title="{if !empty($mi->title)}{$mi->title|strip_tags|eschtml}{/if}">
{$mi->id}
</td>

<!-- project - KEEP the line break after the title to improve the tooltip readability-->
<td title="{if !empty($p['title'])}{$p['title']|strip_tags|eschtml:ENT_QUOTES}{/if}
{if !empty($p['abstract'])}{$p['abstract']|strip_tags|eschtml:ENT_QUOTES|truncate:150}{/if}">
<td title="{if !empty($p['title'])}{$p['title']|strip_tags|eschtml}{/if}
{if !empty($p['abstract'])}{$p['abstract']|strip_tags|eschtml|truncate:150}{/if}">
<a target="_blank" href="{$p['url']}">{$p['id']}</a>
</td>

Expand Down Expand Up @@ -182,9 +187,9 @@


<!-- Version of Lizmap plugin for QGIS Desktop -->
<td>
<!-- <td>
{$p['lizmap_plugin_version']}
</td>
</td> -->


<!-- Project hidden -->
Expand All @@ -199,7 +204,7 @@
<!-- Authorized groups -->
<td>
{if !empty($p['acl_groups'])}
{$p['acl_groups']|strip_tags|eschtml:ENT_QUOTES}
{$p['acl_groups']|strip_tags|eschtml}
{/if}
</td>

Expand All @@ -226,17 +231,17 @@
{/if}
<td title="{$title}" class="{$class}">
{if !empty($p['projection'])}
{$p['projection']|strip_tags|eschtml:ENT_QUOTES}
{$p['projection']|strip_tags|eschtml}
{/if}
</td>

{if $hasInspectionData}
<!-- Hidden invalid layers list -->
<!-- List of invalid layers -->
{if $p['invalid_layers_count'] > 0}
<td>
<ul>
{foreach $p['invalid_layers'] as $id=>$properties}
<li style="cursor: help;" title="{$properties['source']|strip_tags|escxml:ENT_QUOTES}">
<li style="cursor: help;" title="{$properties['source']|strip_tags|escxml}">
{$properties['name']}
</li>
{/foreach}
Expand All @@ -246,12 +251,12 @@
<td></td>
{/if}

<!-- Hidden QGIS logs -->
<!-- QGIS logs -->
<td class="lizmap-project-qgis-log">
{if !empty($p['qgis_log'])}
<div>
{$p['qgis_log']|strip_tags|eschtml:ENT_QUOTES|nl2br}
</div>
<pre>
{$p['qgis_log']|strip_tags|eschtml|nl2br}
</pre>
{/if}
</td>
{/if}
Expand Down
12 changes: 11 additions & 1 deletion lizmap/modules/admin/zones/project_list.zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
51 changes: 43 additions & 8 deletions lizmap/www/assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ Admin QGIS project lists
======
*/
div#lizmap_project_list_container {
/* display: flex;
flex-wrap: wrap; */
height: 80%;
width: 100%;
margin: auto;
Expand All @@ -119,9 +117,14 @@ div.lizmap_project_list_details {
padding: 5px;
}

/* 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;
}

/* hovered line */
/* Blue left border when hovering a line */
table.lizmap_project_list tr td:first-child {
Expand Down Expand Up @@ -154,18 +157,50 @@ div.lizmap_project_list_details dd {
overflow: auto;
background-color: #efefef;
}
table.lizmap_project_list tr dd.lizmap-project-qgis-log {
font-size: 0.8em;
line-height: 15px;
table.lizmap_project_list tr dd.lizmap-project-qgis-log pre {
font-size: 0.9em;
line-height: 10px;
}
table.lizmap_project_list tr td.lizmap-project-qgis-log div {
table.lizmap_project_list tr td.lizmap-project-qgis-log pre {
font-size: 0.8em;
line-height: 15px;
max-height: 50px;
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,
Expand Down
27 changes: 25 additions & 2 deletions lizmap/www/assets/js/admin/activate_datatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ $(document).ready(function () {
`;
} else {
noDataSentence = document.getElementById('lizmap_project_list_no_data_label').innerText;
noDataSentence += ` : ${hiddenColumns.join(', ')}`;
noDataSentence += ` : "${hiddenColumns.join('", "')}"`;
html = noDataSentence;
}

Expand All @@ -110,7 +110,30 @@ $(document).ready(function () {
});
});

// Adjust header
// Adjust the table header at startupt
project_table.tables().columns.adjust();

// Adjust it when the size has changed
project_table.on('responsive-resize', function (e, datatable, row, showHide, update) {
// Adjust header
project_table.tables().columns.adjust();

// Toggle the cursor pointer on the lines
document.querySelectorAll('table.lizmap_project_list tr').forEach((element) => {
element.classList.toggle(
'has_hidden_columns',
project_table.responsive.hasHidden()
);
});
});

// Change Tr cursor depending of the state hidden columns
document.querySelectorAll('table.lizmap_project_list tr').forEach((element) => {
element.classList.toggle(
'has_hidden_columns',
project_table.responsive.hasHidden()
);
});

}
});

0 comments on commit 8c55ccf

Please sign in to comment.