From 3a746ea7f10f72286070283fc057284c3be58e4c Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 9 Aug 2017 09:35:03 +0200 Subject: [PATCH] firmware: unify styling in bold rows and status indication --- .../mvc/app/views/OPNsense/Core/firmware.volt | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt b/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt index 12e0d096e..2e037fd46 100644 --- a/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt +++ b/src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt @@ -376,18 +376,20 @@ POSSIBILITY OF SUCH DAMAGE. if (row['provided'] == "1") { plugin_count += 1; } - orphaned_text = ''; - if (row['provided'] == "0") { - orphaned_text = ' ({{ lang._('orphaned') }})'; - } + status_text = ''; bold_on = ''; bold_off = ''; if (row['installed'] == "1") { + status_text = ' ({{ lang._('installed') }})'; bold_on = ''; bold_off = ''; } + if (row['provided'] == "0") { + // this state overwrites installed on purpose + status_text = ' ({{ lang._('orphaned') }})'; + } $('#pluginlist').append( - '' + '' + bold_on + row['name'] + orphaned_text + bold_off + '' + + '' + '' + bold_on + row['name'] + status_text + bold_off + '' + '' + bold_on + row['version'] + bold_off + '' + '' + bold_on + row['flatsize'] + bold_off + '' + '' + bold_on + row['comment'] + bold_off + '' + @@ -424,14 +426,19 @@ POSSIBILITY OF SUCH DAMAGE. $.each(data['changelog'], function(index, row) { changelog_count += 1; - installed_text = ''; + status_text = ''; + bold_on = ''; + bold_off = ''; + if (installed_version == row['version']) { - installed_text = ' ({{ lang._('installed') }})'; + status_text = ' ({{ lang._('installed') }})'; + bold_on = ''; + bold_off = ''; } $('#updatelist').append( ' changelog_max ? ' class="changelog-hidden" style="display: none;" ' : '' ) + - '>' + row['version'] + installed_text + '' + row['date'] + '' + + '>' + bold_on + row['version'] + status_text + bold_off + '' + bold_on + row['date'] + bold_off + '' + ''