show sign state with colors

This commit is contained in:
Matthias 2021-09-23 00:59:33 +02:00
parent 680a7071e5
commit 0bbe1f7687
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 8 additions and 2 deletions

View File

@ -165,6 +165,7 @@ class IntegrationPlugin(MixinBase, plugin.InvenTreePlugin):
def __init__(self): def __init__(self):
self.add_mixin('base') self.add_mixin('base')
self.commit = self.get_plugin_commit() self.commit = self.get_plugin_commit()
self.sign_state = 0
def mixin(self, key): def mixin(self, key):
return key in self._mixins return key in self._mixins

View File

@ -37,12 +37,17 @@
<td><span class='fas fa-envelope'></span></td> <td><span class='fas fa-envelope'></span></td>
<td>{% trans "Commit Message" %}</td><td>{{ plugin.commit.message }}{% include "clip.html" %}</td> <td>{% trans "Commit Message" %}</td><td>{{ plugin.commit.message }}{% include "clip.html" %}</td>
</tr> </tr>
{% if plugin.sign_state == 0 %}
{% define 'text-success' as sign_color %}
{% else %}
{% define 'text-danger' as sign_color %}
{% endif %}
<tr> <tr>
<td><span class='fas fa-check'></span></td> <td><span class='{{sign_color}} fas fa-check'></span></td>
<td>{% trans "Commit verified" %}</td><td>{{ plugin.commit.verified }}</td> <td>{% trans "Commit verified" %}</td><td>{{ plugin.commit.verified }}</td>
</tr> </tr>
<tr> <tr>
<td><span class='fas fa-key'></span></td> <td><span class='{{sign_color}} fas fa-key'></span></td>
<td>{% trans "Commit Sign Key" %}</td><td>{{ plugin.commit.key }}{% include "clip.html" %}</td> <td>{% trans "Commit Sign Key" %}</td><td>{{ plugin.commit.key }}{% include "clip.html" %}</td>
</tr> </tr>
</table> </table>