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
No related branches found
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( ...@@ -561,8 +561,9 @@ class MainCareerPage(
form = None form = None
current_time = datetime.now() 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) form = CareerSubmissionForm(request.POST, request.FILES)
if form.is_valid(): if form.is_valid():
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
<main role="main"> <main role="main">
<section class="container--wide mb-4 xl:mb-20"> <section class="container--wide mb-4 xl:mb-20">
{% if page.closing_date <= current_date %} {% 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"> <div class="bg-red-400 border border-solid border-red-600 p-4 inline-block mb-6">
<strong>Přihlášky uzavřeny.</strong> <strong>Přihlášky uzavřeny.</strong>
</div> </div>
...@@ -49,12 +53,15 @@ ...@@ -49,12 +53,15 @@
</div> </div>
{% endif %} {% 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 %} {% include "styleguide2/includes/atoms/buttons/round_button.html" with text="Přihlásit se" show_arrow_on_hover=True %}
</div> </div>
{% endif %}
</section> </section>
</main> </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 micromodal-slide" id="modal-1" aria-hidden="true">
<div class="modal__overlay" tabindex="-1"> <div class="modal__overlay" tabindex="-1">
<form <form
...@@ -169,5 +176,6 @@ ...@@ -169,5 +176,6 @@
</form> </form>
</div> </div>
</div> </div>
{% endif %}
{% endblock %} {% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment