Skip to content

Commit

Permalink
Merge pull request #4798 from Gustry/use-badge
Browse files Browse the repository at this point in the history
Use a badge for Lizmap server update instead of adding a new column
  • Loading branch information
Gustry authored Sep 26, 2024
2 parents e81203c + c3b32f7 commit f1ca9f7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,14 @@ public function index()
jLog::log($updateQgisServer, 'lizmapadmin');
}

$displayPluginActionColumn = false;
$lizmapQgisServerNeedsUpdate = $server->pluginServerNeedsUpdate(
$currentLizmapVersion,
$lizmapPluginMinimumVersionRequired
);
$updateLizmapPlugin = jLocale::get('admin.server.information.plugin.update', array('lizmap_server'));
$updateLizmapPlugin = jLocale::get('admin.server.information.plugin.update');
if (!is_null($currentQgisVersion) && $lizmapQgisServerNeedsUpdate) {
// lizmap_server is required to use LWC
jLog::log($updateLizmapPlugin, 'lizmapadmin');
$displayPluginActionColumn = true;
}

// Set the HTML content
Expand All @@ -78,7 +76,6 @@ public function index()
'baseUrlApplication' => \jServer::getServerURI().\jApp::urlBasePath(),
'qgisServerNeedsUpdate' => $qgisServerNeedsUpdate,
'updateQgisServer' => $updateQgisServer,
'displayPluginActionColumn' => $displayPluginActionColumn,
'lizmapQgisServerNeedsUpdate' => $lizmapQgisServerNeedsUpdate,
'lizmapPluginUpdate' => $updateLizmapPlugin,
'minimumQgisVersion' => $qgisMinimumVersionRequired,
Expand Down
3 changes: 1 addition & 2 deletions lizmap/modules/admin/locales/en_US/admin.UTF-8.properties
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ server.information.qgis.plugins=Plugins
server.information.qgis.plugins.version=Version number
server.information.qgis.plugin=Plugin
server.information.qgis.plugin.version=Version
server.information.qgis.plugin.action=Action
server.information.qgis.test.ok=QGIS Server is correctly installed and returns the expected response for OGC requests.
server.information.qgis.test.error=QGIS Server is not correctly installed in your server or the URL for OGC requests given in Lizmap configuration is not correct.
Expand All @@ -292,7 +291,7 @@ You might need to increase debug level.
server.information.qgis.error.fetching.information.detail.NO_ACCESS=You don't have access to information about QGIS Server
server.information.qgis.error.fetching.information.detail.HTTP_ERROR=QGIS Server returns an HTTP error about the Lizmap plugin:
server.information.qgis.update=QGIS Server needs to be updated at least to version %s for this version of Lizmap Web Client.
server.information.plugin.update=The %s plugin needs to be updated.
server.information.plugin.update=The plugin must be updated.
server.information.qgis.unknown=QGIS server minimum %s and Lizmap QGIS server plugin minimum %s need to be installed and configured correctly. \
Your QGIS server couldn't be reached correctly with the given URL "%s".
Expand Down
11 changes: 2 additions & 9 deletions lizmap/modules/admin/templates/server_information.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@
<tr>
<th style="width:20%;">{@admin.server.information.qgis.plugin@}</th>
<th style="width:20%;">{@admin.server.information.qgis.plugin.version@}</th>
{if $displayPluginActionColumn }
<th>{@admin.server.information.qgis.plugin.action@}</th>
{/if}
</tr>
{foreach $data['qgis_server_info']['plugins'] as $name=>$version}
<tr>
Expand All @@ -164,14 +161,10 @@
{else}
{$version['version']}
{/if}
</td>
{if $displayPluginActionColumn }
{if $name == 'lizmap_server' && $lizmapQgisServerNeedsUpdate}
<td style="background-color:lightcoral;"><strong>{$lizmapPluginUpdate}</strong></td>
{else}
<td></td>
<span class='badge badge-important'>{$lizmapPluginUpdate}</span>
{/if}
{/if}
</td>
</tr>
{/foreach}
</table>
Expand Down

0 comments on commit f1ca9f7

Please sign in to comment.