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

add person responsible for shredding etc.

parent 3fc50f39
No related branches found
No related tags found
1 merge request!7Release
Pipeline #13149 passed
...@@ -240,6 +240,7 @@ class ContractAdmin( ...@@ -240,6 +240,7 @@ class ContractAdmin(
{ {
"fields": [ "fields": [
"paper_form_state", "paper_form_state",
"paper_form_person_responsible",
"filing_area", "filing_area",
] ]
}, },
......
# Generated by Django 4.1.4 on 2023-06-06 17:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contracts', '0061_alter_contract_id_number'),
]
operations = [
migrations.AddField(
model_name='contract',
name='paper_form_person_responsible',
field=models.CharField(blank=True, max_length=256, null=True, verbose_name='Osoba zodpovědná za doručení'),
),
]
...@@ -592,6 +592,13 @@ class Contract(NameStrMixin, models.Model): ...@@ -592,6 +592,13 @@ class Contract(NameStrMixin, models.Model):
verbose_name="Stav fyzického dokumentu", verbose_name="Stav fyzického dokumentu",
) )
paper_form_person_responsible = models.CharField(
max_length=256,
blank=True,
null=True,
verbose_name="Osoba zodpovědná za doručení",
)
tender_url = SubdomainValidatedURLField( tender_url = SubdomainValidatedURLField(
max_length=256, max_length=256,
blank=True, blank=True,
......
...@@ -173,7 +173,13 @@ ...@@ -173,7 +173,13 @@
<tr> <tr>
<td class="w-1/5 !p-2.5">Stav</td> <td class="w-1/5 !p-2.5">Stav</td>
<td class="w-4/5 !p-2.5">{{ contract.get_paper_form_state_display }}</td> <td class="w-4/5 !p-2.5">
{{ contract.get_paper_form_state_display }}
{% if contract.paper_form_person_responsible %}
(zodpovídá {{ contract.paper_form_person_responsible }})
{% endif %}
</td>
</tr> </tr>
<tr> <tr>
<td class="w-1/5 !p-2.5">Spisovna</td> <td class="w-1/5 !p-2.5">Spisovna</td>
......
...@@ -16,7 +16,6 @@ import pathlib ...@@ -16,7 +16,6 @@ import pathlib
import dj_database_url import dj_database_url
import environ import environ
import sentry_sdk import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.integrations.django import DjangoIntegration
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
......
...@@ -36,7 +36,21 @@ $(window).ready( ...@@ -36,7 +36,21 @@ $(window).ready(
($("#id_cost_unit").find(":selected").val() === "other") ? ($("#id_cost_unit").find(":selected").val() === "other") ?
"block": "none" "block": "none"
) )
) );
$(".field-paper_form_person_responsible").
css(
"display",
(
(
!["stored", "shredded"].includes(
$("#id_paper_form_state").find(":selected").val()
)
) ?
"block" : "none"
)
);
$("#id_cost_unit").on( $("#id_cost_unit").on(
"change", "change",
...@@ -55,5 +69,29 @@ $(window).ready( ...@@ -55,5 +69,29 @@ $(window).ready(
if (!otherIsSelected) $(".field-cost_unit_other").val(""); if (!otherIsSelected) $(".field-cost_unit_other").val("");
} }
); );
$("#id_paper_form_state").on(
"change",
event => {
const notStoredOrShredded = (
!["stored", "shredded", "lost"].includes(
$(event.target).find(":selected").val()
)
);
$(".field-paper_form_person_responsible").
css(
"display",
(
(notStoredOrShredded) ?
"block" : "none"
)
);
if (!notStoredOrShredded) {
$("#id_paper_form_person_responsible").val("");
}
}
);
} }
); );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment