diff --git a/contracts/admin.py b/contracts/admin.py index c94b2bb52c748e1743736755bd2698941648e0ed..c8346d4deb2e80750276341c50d4387b83b23b52 100644 --- a/contracts/admin.py +++ b/contracts/admin.py @@ -71,6 +71,7 @@ class ContractAdmin(MarkdownxGuardedModelAdmin): "summary", "public_state", "publishing_rejection_comment", + "legal_state", "primary_contract", ] } @@ -85,10 +86,9 @@ class ContractAdmin(MarkdownxGuardedModelAdmin): } ), ( - "Administrativa", + "Fyzický dokument", { "fields": [ - "legal_state", "paper_form_state", "filing_area", ] @@ -125,7 +125,7 @@ class ContractAdmin(MarkdownxGuardedModelAdmin): if request.user.is_superuser or request.user.has_perm("approve", self): fieldsets[0][1]["fields"].insert( - fieldsets[0][1]["fields"].index("publishing_rejection_comment"), + fieldsets[0][1]["fields"].index("primary_contract"), "approval_state", ) diff --git a/contracts/templates/contracts/includes/tag.html b/contracts/templates/contracts/includes/tag.html new file mode 100644 index 0000000000000000000000000000000000000000..94012ee5632cee98e0c93a7c8130e35d10c42348 --- /dev/null +++ b/contracts/templates/contracts/includes/tag.html @@ -0,0 +1,4 @@ +<a + class="p-1.5 rounded-sm text-ellipsis bg-gray-200 duration-100 hover:bg-gray-300 hover:no-underline" + href="{{ url }}" +>{% if icon %}<i class="{{ icon }} mr-2"></i>{% endif %}{{ content }}</a> diff --git a/contracts/templates/contracts/index.html b/contracts/templates/contracts/index.html index a9a20c147e20bf7df51bcbf60c274aac1d74fa4e..060643933cfcdbaefa00299a68366b5b729b1628 100644 --- a/contracts/templates/contracts/index.html +++ b/contracts/templates/contracts/index.html @@ -43,9 +43,9 @@ <td> <ul class="flex flex-wrap gap-1.5"> {% for signature in contract.signee_signatures.all %} - <li - class="p-1.5 rounded-sm whitespace-nowrap cursor-pointer bg-gray-200 duration-100 hover:bg-gray-300" - >{{ signature.signee.name }}</li> + <li class="flex"> + {% include "contracts/includes/tag.html" with url="#TODO" content=signature.signee.name %} + </li> {% endfor %} </ul> </td> diff --git a/contracts/templates/contracts/view_contract.html b/contracts/templates/contracts/view_contract.html index a0981050b8ea8674a09cd0e54723dd8f05fe3704..eb475dea3bcb73fbeda876f9e52e928359e4e7bf 100644 --- a/contracts/templates/contracts/view_contract.html +++ b/contracts/templates/contracts/view_contract.html @@ -4,13 +4,14 @@ {% block content %} <h1 class="head-alt-lg mb-10">{{ contract.name }}</h1> - <table class="table table-auto w-full table--striped table--bordered mb-10"> + <table class="table table-auto w-full table--striped table--bordered mb-7"> <tbody> <tr> <td colspan="2" class="text-lg font-bold"> <i class="ico--info mr-3"></i>Základní informace </td> </tr> + {% if contract.id_number %} <tr> <td class="w-1/5 !p-2.5">Identifikační číslo</td> @@ -23,10 +24,7 @@ <ul class="flex flex-wrap gap-1.5"> {% for type in contract.types.all %} <li class="flex"> - <a - class="p-1.5 rounded-sm whitespace-nowrap bg-gray-200 duration-100 hover:bg-gray-300 hover:no-underline" - href="#TODO" - >{{ type.name }}</a> + {% include "contracts/includes/tag.html" with url="#TODO" content=type.name %} </li> {% endfor %} </ul> @@ -46,6 +44,39 @@ <td class="w-1/5 !p-2.5">Souhrn</td> <td class="w-4/5 !p-2.5">{{ contract.summary }}</td> </tr> + <tr> + <td class="w-1/5 !p-2.5">Právní stav</td> + <td class="w-4/5 !p-2.5">{{ contract.get_legal_state_display }}</td> + </tr> + <tr> + <td class="w-1/5 !p-2.5">Soubory</td> + <td class="w-4/5 !p-2.5"> + {% with contract.files.all as files %} + {% if files|length != 0 %} + <ul class="flex gap-2"> + {% for file in files %} + <li class="flex"> + {% include "contracts/includes/tag.html" with url=file.file.url icon="ico--attachment" content=file.name %} + </li> + {% endfor %} + </ul> + {% else %} + <span class="text-grey-200">Žádné</span> + {% endif %} + {% endwith %} + </td> + </tr> + </tbody> + <table> + + <table class="table table-auto w-full table--striped table--bordered mb-7"> + <tbody> + <tr> + <td colspan="2" class="text-lg font-bold"> + <i class="ico--clock mr-3"></i>Data + </td> + </tr> + <tr> <td class="w-1/5 !p-2.5">Začátek účinnosti</td> <td class="w-4/5 !p-2.5">{{ contract.valid_start_date }}</td> @@ -54,14 +85,32 @@ <td class="w-1/5 !p-2.5">Konec účinnosti</td> <td class="w-4/5 !p-2.5">{{ contract.valid_end_date }}</td> </tr> + </tbody> + </table> + + <table class="table table-auto w-full table--striped table--bordered mb-7"> + <tbody> <tr> - <td class="w-1/5 !p-2.5">Právní stav</td> - <td class="w-4/5 !p-2.5">{{ contract.get_legal_state_display }}</td> + <td colspan="2" class="text-lg font-bold"> + <i class="ico--file-pdf mr-3"></i>Fyzický dokument + </td> </tr> + <tr> - <td class="w-1/5 !p-2.5">Stav papírové verze</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> </tr> + </tbody> + </table> + + <table class="table table-auto w-full table--striped table--bordered mb-7"> + <tbody> + <tr> + <td colspan="2" class="text-lg font-bold"> + <i class="ico--link mr-3"></i>Odkazy + </td> + </tr> + <tr> <td class="w-1/5 !p-2.5">Výběrové řízení</td> <td class="w-4/5 !p-2.5"> @@ -96,10 +145,7 @@ <ul class="flex gap-2"> {% for intent in intents %} <li class="flex"> - <a - class="p-1.5 rounded-sm text-ellipsis bg-gray-200 duration-100 hover:bg-gray-300 hover:no-underline" - href="{{ intent.url }}" - ><i class="ico--link mr-2"></i>{{ intent.name }}</a> + {% include "contracts/includes/tag.html" with url=intent.url icon="ico--link" content=intent.name %} </li> {% endfor %} </ul> @@ -109,23 +155,17 @@ {% endwith %} </td> </tr> - <tr> - <td class="w-1/5 !p-2.5">Poznámky</td> - <td class="w-4/5 !p-2.5"> - {% with contract.issues.all as issues %} - {% if issues|length != 0 %} - <ul class="flex gap-2"> - {% for issue in issues %} - <li class="p-1.5 rounded-sm bg-gray-200">{{ issue.name }}</li> - {% endfor %} - </ul> - {% else %} - <span class="text-grey-200">Žádné</span> - {% endif %} - {% endwith %} - </td> - </tr> - {% if contract.cost_amount %} + </tbody> + </table> + + {% if contract.cost_amount %} + <table class="table table-auto w-full table--striped table--bordered mb-7"> + <tbody> + <tr> + <td colspan="2" class="text-lg font-bold"> + <i class="ico--calculator mr-3"></i>Finance + </td> + </tr> <tr> <td class="w-1/5 !p-2.5">Náklady</td> <td class="w-4/5 !p-2.5"> @@ -137,30 +177,36 @@ {% endif %} </td> </tr> - {% endif %} - <tr> - <td class="w-1/5 !p-2.5">Soubory</td> - <td class="w-4/5 !p-2.5"> - {% with contract.files.all as files %} - {% if files|length != 0 %} + </tbody> + </table> + {% endif %} + + {% with contract.issues.all as issues %} + {% if issues|length != 0 %} + <table class="table table-auto w-full table--striped table--bordered mb-10"> + <tbody> + <tr> + <td colspan="2" class="text-lg font-bold"> + <i class="ico--question mr-3"></i>Doplňující informace + </td> + </tr> + + <tr> + <td class="w-1/5 !p-2.5">Poznámky</td> + <td class="w-4/5 !p-2.5"> <ul class="flex gap-2"> - {% for file in files %} + {% for issue in issues %} <li class="flex"> - <a - class="p-1.5 rounded-sm bg-gray-200 duration-100 hover:bg-gray-300 hover:no-underline" - href="{{ file.file.url }}" - ><i class="ico--attachment mr-2"></i>{{ file.name }}</a> + {% include "contracts/includes/tag.html" with url="#TODO" content=issue.name %} </li> {% endfor %} </ul> - {% else %} - <span class="text-grey-200">Žádné</span> - {% endif %} - {% endwith %} - </td> - </tr> - </tbody> - </table> + </td> + </tr> + </tbody> + </table> + {% endif %} + {% endwith %} <h2 class="text-xl font-bold mb-5"><i class="ico--pencil mr-3"></i>Podpisy</h2>