# 86 Comment field length
* removes comment field length limit * adds improvements for rendering large comments
This commit is contained in:
parent
d5e23b420e
commit
77b59db56f
@ -346,10 +346,9 @@ class NewActionModalForm(BaseModalForm):
|
|||||||
)
|
)
|
||||||
comment = forms.CharField(
|
comment = forms.CharField(
|
||||||
required=False,
|
required=False,
|
||||||
max_length=200,
|
|
||||||
label=_("Comment"),
|
label=_("Comment"),
|
||||||
label_suffix=_(""),
|
label_suffix=_(""),
|
||||||
help_text=_("Additional comment, maximum {} letters").format(200),
|
help_text=_("Additional comment"),
|
||||||
widget=forms.Textarea(
|
widget=forms.Textarea(
|
||||||
attrs={
|
attrs={
|
||||||
"rows": 5,
|
"rows": 5,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{% load i18n l10n fontawesome_5 humanize %}
|
{% load i18n l10n fontawesome_5 humanize ksp_filters %}
|
||||||
|
|
||||||
<div id="actions" class="card">
|
<div id="actions" class="card">
|
||||||
<div class="card-header rlp-r">
|
<div class="card-header rlp-r">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -55,7 +56,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
|
<td class="align-middle">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
|
||||||
<td class="align-middle">{{ action.comment|default_if_none:"" }}</td>
|
<td class="align-middle">
|
||||||
|
<div class="scroll-150">
|
||||||
|
{{ action.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'compensation:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
|
<button data-form-url="{% url 'compensation:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
|
||||||
|
@ -47,7 +47,11 @@
|
|||||||
{% trans deadline.type_humanized %}
|
{% trans deadline.type_humanized %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ deadline.date|default_if_none:"---" }}</td>
|
<td class="align-middle">{{ deadline.date|default_if_none:"---" }}</td>
|
||||||
<td class="align-middle">{{ deadline.comment }}</td>
|
<td class="align-middle">
|
||||||
|
<div class="scroll-150">
|
||||||
|
{{ deadline.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'compensation:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
<button data-form-url="{% url 'compensation:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
||||||
|
@ -45,8 +45,12 @@
|
|||||||
{{ doc.title }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ doc.comment }}</td>
|
<td class="align-middle">
|
||||||
<td>
|
<div class="scroll-150">
|
||||||
|
{{ doc.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'compensation:remove-doc' doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
|
<button data-form-url="{% url 'compensation:remove-doc' doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% load i18n l10n fontawesome_5 humanize %}
|
{% load i18n l10n fontawesome_5 humanize ksp_filters %}
|
||||||
<div id="actions" class="card">
|
<div id="actions" class="card">
|
||||||
<div class="card-header rlp-r">
|
<div class="card-header rlp-r">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Comment' %}
|
{% trans 'Comment' %}
|
||||||
</th>
|
</th>
|
||||||
{% if default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<th scope="col">
|
<th scope="col">
|
||||||
{% trans 'Action' %}
|
{% trans 'Action' %}
|
||||||
</th>
|
</th>
|
||||||
@ -55,7 +55,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
|
<td class="align-middle">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
|
||||||
<td class="align-middle">{{ action.comment|default_if_none:"" }}</td>
|
<td class="align-middle">
|
||||||
|
<div class="scroll-150">
|
||||||
|
{{ action.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'compensation:acc:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
|
<button data-form-url="{% url 'compensation:acc:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
|
||||||
|
@ -45,8 +45,12 @@
|
|||||||
{% trans deadline.type_humanized %}
|
{% trans deadline.type_humanized %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ deadline.date|default_if_none:"---" }}</td>
|
<td class="align-middle">{{ deadline.date|default_if_none:"---" }}</td>
|
||||||
<td class="align-middle">{{ deadline.comment }}</td>
|
<td class="align-middle">
|
||||||
<td>
|
<div class="scroll-150">
|
||||||
|
{{ deadline.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'compensation:acc:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
<button data-form-url="{% url 'compensation:acc:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
|
@ -43,8 +43,12 @@
|
|||||||
{{ doc.title }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ doc.comment }}</td>
|
<td class="align-middle">
|
||||||
<td>
|
<div class="scroll-150">
|
||||||
|
{{ doc.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'compensation:acc:remove-doc' doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
|
<button data-form-url="{% url 'compensation:acc:remove-doc' doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{% load i18n l10n fontawesome_5 humanize %}
|
{% load i18n l10n fontawesome_5 humanize ksp_filters %}
|
||||||
<div id="actions" class="card">
|
<div id="actions" class="card">
|
||||||
<div class="card-header rlp-r">
|
<div class="card-header rlp-r">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -53,7 +53,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
|
<td class="align-middle">{{ action.amount|floatformat:2|intcomma }} {{ action.unit_humanize }}</td>
|
||||||
<td class="align-middle">{{ action.comment|default_if_none:"" }}</td>
|
<td class="align-middle">
|
||||||
|
<div class="scroll-150">
|
||||||
|
{{ action.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td class="align-middle">
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'ema:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
|
<button data-form-url="{% url 'ema:action-remove' obj.id action.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove action' %}">
|
||||||
|
@ -45,8 +45,12 @@
|
|||||||
{% trans deadline.type_humanized %}
|
{% trans deadline.type_humanized %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ deadline.date|default_if_none:"---" }}</td>
|
<td class="align-middle">{{ deadline.date|default_if_none:"---" }}</td>
|
||||||
<td class="align-middle">{{ deadline.comment }}</td>
|
<td class="align-middle">
|
||||||
<td>
|
<div class="scroll-150">
|
||||||
|
{{ deadline.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'ema:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
<button data-form-url="{% url 'ema:deadline-remove' obj.id deadline.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove deadline' %}">
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
|
@ -43,8 +43,12 @@
|
|||||||
{{ doc.title }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ doc.comment }}</td>
|
<td class="align-middle">
|
||||||
<td>
|
<div class="scroll-150">
|
||||||
|
{{ doc.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'ema:remove-doc' doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
|
<button data-form-url="{% url 'ema:remove-doc' doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
|
@ -45,8 +45,12 @@
|
|||||||
{{ doc.title }}
|
{{ doc.title }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ doc.comment }}</td>
|
<td class="align-middle">
|
||||||
<td>
|
<div class="scroll-150">
|
||||||
|
{{ doc.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'intervention:remove-doc' doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
|
<button data-form-url="{% url 'intervention:remove-doc' doc.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove document' %}">
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
|
@ -47,8 +47,12 @@
|
|||||||
{{ pay.amount|floatformat:2 }} €
|
{{ pay.amount|floatformat:2 }} €
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ pay.due_on|default_if_none:"---" }}</td>
|
<td class="align-middle">{{ pay.due_on|default_if_none:"---" }}</td>
|
||||||
<td class="align-middle">{{ pay.comment }}</td>
|
<td class="align-middle">
|
||||||
<td>
|
<div class="scroll-150">
|
||||||
|
{{ pay.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'compensation:pay:remove' pay.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove payment' %}">
|
<button data-form-url="{% url 'compensation:pay:remove' pay.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove payment' %}">
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
|
@ -56,8 +56,12 @@
|
|||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-middle">{{ rev.comment }}</td>
|
<td class="align-middle">
|
||||||
<td>
|
<div class="scroll-150">
|
||||||
|
{{ rev.comment }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="align-middle">
|
||||||
{% if is_default_member and has_access %}
|
{% if is_default_member and has_access %}
|
||||||
<button data-form-url="{% url 'intervention:remove-revocation' rev.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove revocation' %}">
|
<button data-form-url="{% url 'intervention:remove-revocation' rev.id %}" class="btn btn-default btn-modal" title="{% trans 'Remove revocation' %}">
|
||||||
{% fa5_icon 'trash' %}
|
{% fa5_icon 'trash' %}
|
||||||
|
@ -52,3 +52,19 @@ def default_if_zero(val1, val2):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
return val1 if val1 > 0 else val2
|
return val1 if val1 > 0 else val2
|
||||||
|
|
||||||
|
|
||||||
|
@register.filter("shorten")
|
||||||
|
def shorten(val, length):
|
||||||
|
""" Returns val shortened to the first number of length character
|
||||||
|
|
||||||
|
Args:
|
||||||
|
val (str): The value
|
||||||
|
length (int): The number of characters left
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
|
||||||
|
"""
|
||||||
|
if val is not None and len(val) > length:
|
||||||
|
val = f"{val[:length]}..."
|
||||||
|
return val
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
{% include 'navbars/navbar.html' %}
|
{% include 'navbars/navbar.html' %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</header>
|
</header>
|
||||||
<div class="container-fluid mt-3 px-5">
|
<div class="container-fluid mt-3">
|
||||||
<div class="">
|
<div class="">
|
||||||
{% for message in messages %}
|
{% for message in messages %}
|
||||||
<div class="row alert alert-{{ message.tags }}">
|
<div class="row alert alert-{{ message.tags }}">
|
||||||
|
Loading…
Reference in New Issue
Block a user