Just display the signature type to conserve UI space.
This commit is contained in:
@@ -82,31 +82,18 @@ class DocumentSignaturesApp(MayanAppConfig):
|
||||
source=SignatureBaseModel, label=_('Date'), attribute='date'
|
||||
)
|
||||
SourceColumn(
|
||||
source=SignatureBaseModel, label=_('Key ID'), attribute='key_id'
|
||||
source=SignatureBaseModel, label=_('Key ID'),
|
||||
attribute='get_key_id'
|
||||
)
|
||||
SourceColumn(
|
||||
source=SignatureBaseModel, label=_('Signature ID'),
|
||||
func=lambda context: context['object'].signature_id or _('None')
|
||||
)
|
||||
SourceColumn(
|
||||
source=SignatureBaseModel, label=_('Public key fingerprint'),
|
||||
func=lambda context: context['object'].public_key_fingerprint or _('None')
|
||||
)
|
||||
SourceColumn(
|
||||
source=SignatureBaseModel, label=_('Is embedded?'),
|
||||
func=lambda context: two_state_template(
|
||||
SignatureBaseModel.objects.get_subclass(
|
||||
func=lambda context: SignatureBaseModel.objects.get_subclass(
|
||||
pk=context['object'].pk
|
||||
).is_embedded
|
||||
)
|
||||
)
|
||||
SourceColumn(
|
||||
source=SignatureBaseModel, label=_('Is detached?'),
|
||||
func=lambda context: two_state_template(
|
||||
SignatureBaseModel.objects.get_subclass(
|
||||
pk=context['object'].pk
|
||||
).is_detached
|
||||
)
|
||||
).get_signature_type_display()
|
||||
)
|
||||
|
||||
app.conf.CELERY_QUEUES.append(
|
||||
|
||||
@@ -60,6 +60,18 @@ class SignatureBaseModel(models.Model):
|
||||
args=(self.pk,)
|
||||
)
|
||||
|
||||
def get_key_id(self):
|
||||
if self.public_key_fingerprint:
|
||||
return self.public_key_fingerprint[-16:]
|
||||
else:
|
||||
return self.key_id
|
||||
|
||||
def get_signature_type_display(self):
|
||||
if self.is_detached:
|
||||
return _('Detached')
|
||||
else:
|
||||
return _('Embedded')
|
||||
|
||||
@property
|
||||
def is_detached(self):
|
||||
return hasattr(self, 'signature_file')
|
||||
|
||||
Reference in New Issue
Block a user