Skip to content
Snippets Groups Projects
Commit 9548a1ab authored by Alexa Valentová's avatar Alexa Valentová
Browse files

validate submission end dates, show/dont show button

parent b4759df7
Branches
No related tags found
2 merge requests!1208Release,!1206validate submission end dates, show/dont show button
Pipeline #20432 passed
......@@ -561,8 +561,9 @@ class MainCareerPage(
form = None
current_time = datetime.now()
current_date = current_time.date()
if request.method == "POST":
if request.method == "POST" and self.closing_date > current_date and self.submission_end_date > current_date:
form = CareerSubmissionForm(request.POST, request.FILES)
if form.is_valid():
......
......@@ -13,6 +13,10 @@
<main role="main">
<section class="container--wide mb-4 xl:mb-20">
{% if page.closing_date <= current_date %}
<div class="bg-red-400 border border-solid border-red-600 p-4 inline-block mb-6">
<strong>Výběrové řízení uzavřeno.</strong>
</div>
{% elif page.submission_end_date <= current_date %}
<div class="bg-red-400 border border-solid border-red-600 p-4 inline-block mb-6">
<strong>Přihlášky uzavřeny.</strong>
</div>
......@@ -49,12 +53,15 @@
</div>
{% endif %}
<div data-micromodal-trigger="modal-1" class="lg:mb-3 mb-12">
{% if page.closing_date > current_date and page.submission_end_date > current_date %}
<div data-micromodal-trigger="modal-1" class="lg:mb-3 mb-12 inline-block">
{% include "styleguide2/includes/atoms/buttons/round_button.html" with text="Přihlásit se" show_arrow_on_hover=True %}
</div>
{% endif %}
</section>
</main>
{% if page.closing_date > current_date and page.submission_end_date > current_date %}
<div class="modal micromodal-slide" id="modal-1" aria-hidden="true">
<div class="modal__overlay" tabindex="-1">
<form
......@@ -169,5 +176,6 @@
</form>
</div>
</div>
{% endif %}
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment