Skip to content
Snippets Groups Projects
Commit c127e36d authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

UI - shorten names by default

parent 2217aa49
No related branches found
No related tags found
No related merge requests found
Pipeline #13733 passed
...@@ -200,6 +200,13 @@ class Signee( ...@@ -200,6 +200,13 @@ class Signee(
def url(self) -> str: def url(self) -> str:
return reverse("contracts:view_signee", args=(self.id,)) return reverse("contracts:view_signee", args=(self.id,))
@property
def shortened_name(self) -> str:
if len(self.name) > 25:
return self.name[:22] + "..."
return self.name
@property @property
def entity_has_public_address(self) -> bool: def entity_has_public_address(self) -> bool:
return self.entity_type in ( return self.entity_type in (
...@@ -355,6 +362,13 @@ class Contractee( ...@@ -355,6 +362,13 @@ class Contractee(
def url(self) -> str: def url(self) -> str:
return reverse("contracts:view_contractee", args=(self.id,)) return reverse("contracts:view_contractee", args=(self.id,))
@property
def shortened_name(self) -> str:
if len(self.name) > 25:
return self.name[:22] + "..."
return self.name
def __str__(self) -> str: def __str__(self) -> str:
result = str(self.name) result = str(self.name)
......
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
{% for signature in contract.signee_signatures.all %} {% for signature in contract.signee_signatures.all %}
<li class="flex"> <li class="flex">
{% if signature.signee.entity_type == signature.signee.EntityTypes.LEGAL_ENTITY or signature.signee.entity_type == signature.signee.EntityTypes.OTHER %} {% if signature.signee.entity_type == signature.signee.EntityTypes.LEGAL_ENTITY or signature.signee.entity_type == signature.signee.EntityTypes.OTHER %}
{% include "contracts/includes/tag.html" with url=signature.signee.url icon="ico--office" content=signature.signee.name public=contract.is_public %} {% include "contracts/includes/tag.html" with url=signature.signee.url icon="ico--office" content=signature.signee.shortened_name public=contract.is_public %}
{% else %} {% else %}
{% include "contracts/includes/tag.html" with url=signature.signee.url icon="ico--user" content=signature.signee.name public=contract.is_public %} {% include "contracts/includes/tag.html" with url=signature.signee.url icon="ico--user" content=signature.signee.shortened_name public=contract.is_public %}
{% endif %} {% endif %}
</li> </li>
{% endfor %} {% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment