Skip to content

Commit

Permalink
Merge pull request #688 from DH-IT-Portal-Development/feature/review_…
Browse files Browse the repository at this point in the history
…and_secretary_pages_redesign

Feature/review and secretary pages redesign
  • Loading branch information
EdoStorm96 authored Sep 23, 2024
2 parents aac644a + 97c953a commit a692b96
Show file tree
Hide file tree
Showing 21 changed files with 402 additions and 462 deletions.
18 changes: 11 additions & 7 deletions main/templates/base/fetc_form_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{# todo: responsive design #}
<div class="col-3">
{% block stepper %}
{% block sidebar %}
{% include stepper %}
{% endblock %}

Expand All @@ -33,14 +33,18 @@

{% block auto-form-render %}{{ form }}{% endblock %}

{% block form-buttons %}
{% block post-form-pre-buttons %}{% endblock %}
{% block post-form-pre-buttons %}{% endblock %}

<div class="uu-form-text-row">
<div class="uu-form-text">{% include "base/form_buttons.html" %}</div>
</div>
{% endblock %}
<div class="uu-form-text-row">
<div class="uu-form-text">
<div class="mt-4 mb-3 w-100 d-flex">
{% block form-buttons %}
{% include "base/form_buttons.html" %}
{% endblock %}

</div>
</div>
</div>
{# A block one can use to add stuff after the form, but still next to the stepper #}
{% block post-form %}
<div class="uu-form-text-row">
Expand Down
28 changes: 13 additions & 15 deletions main/templates/base/form_buttons.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{% load i18n %}

<div class="mt-4 mb-3 w-100 d-flex">
{% if not no_back %}
<input class="btn btn-secondary"
type="submit"
name="save_back"
value="{% trans '<< Opslaan en vorige stap' %}" />
{% endif %}
{% if not no_forward %}
{% trans 'Opslaan en volgende stap >>' as default_next_text %}
<input class="btn btn-primary continue-button ms-auto"
type="submit"
name="save_continue"
value="{{ next_text|default:default_next_text }}" />
{% endif %}
</div>
{% if not no_back %}
<input class="btn btn-secondary"
type="submit"
name="save_back"
value="{% trans '<< Opslaan en vorige stap' %}" />
{% endif %}
{% if not no_forward %}
{% trans 'Opslaan en volgende stap >>' as default_next_text %}
<input class="btn btn-primary continue-button ms-auto"
type="submit"
name="save_continue"
value="{{ next_text|default:default_next_text }}" />
{% endif %}
5 changes: 3 additions & 2 deletions proposals/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ class ProposalConfirmationForm(TemplatedModelForm):
class Meta:
model = Proposal
fields = ["date_confirmed", "confirmation_comments"]
widgets = {"date_confirmed": DateInput}


class WmoForm(SoftValidationMixin, ConditionalModelForm):
Expand Down Expand Up @@ -749,13 +750,13 @@ def clean(self):
)


class ProposalUpdateDataManagementForm(forms.ModelForm):
class ProposalUpdateDataManagementForm(TemplatedModelForm):
class Meta:
model = Proposal
fields = ["dmp_file"]


class ProposalUpdateDateStartForm(forms.ModelForm):
class ProposalUpdateDateStartForm(TemplatedModelForm):
date_start = DateField(label=_("Nieuwe beoogde startdatum"))

class Meta:
Expand Down
47 changes: 15 additions & 32 deletions proposals/templates/proposals/proposal_confirmation.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "base/fetc_base.html" %}
{% extends "base/fetc_form_base.html" %}

{% load static %}
{% load i18n %}
Expand All @@ -7,37 +7,20 @@
{% trans "Bevestigingsbrief versturen" %} - {{ block.super }}
{% endblock %}

{% block html_head %}
<script>
$(function () {
var date_format = '{{ LANGUAGE_CODE }}' === 'nl' ? 'dd-mm-yy' : 'mm/dd/yy';
$("#id_date_confirmed").datepicker({
dateFormat: date_format,
maxDate: 'now',
});
});
</script>
{% block sidebar %}<!--override the stepper-->{% endblock %}

{% block pre-form-text %}
<h2>{% trans "Bevestigingsbrief versturen" %}</h2>
<p>
{% blocktrans trimmed with title=review.proposal.title %}
Geef hieronder aan wanneer de bevestigingsbrief voor de aanvraag <em>{{ title }}</em> is verstuurd.
{% endblocktrans %}
</p>
{% endblock %}

{% block content %}
<div class="uu-container">
<div class="col-12">
<h2>{% trans "Bevestigingsbrief versturen" %}</h2>
<p>
{% blocktrans trimmed with title=review.proposal.title %}
Geef hieronder aan wanneer de bevestigingsbrief voor de aanvraag <em>{{ title }}</em> is verstuurd.
{% endblocktrans %}
</p>
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<a class="btn btn-secondary" href="javascript:history.go(-1);">{% trans "Terug naar de vorige pagina" %}</a>
<input class="btn btn-secondary"
type="submit"
value="{% trans 'Bevestigingsbrief verstuurd' %}" />
</form>
</div>
</div>
{% block form-buttons %}
<a class="btn btn-secondary" href="javascript:history.go(-1);">{% trans "Terug naar de vorige pagina" %}</a>
<input class="btn btn-primary ms-auto"
type="submit"
value="{% trans 'Bevestigingsbrief verstuurd' %}" />
{% endblock %}
61 changes: 33 additions & 28 deletions proposals/templates/proposals/proposal_export_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,47 @@

{% load static %}
{% load i18n %}
{% load datatables %}

{% block header_title %}Goedgekeurde aanvragen - {{ block.super }}{% endblock %}

{% block content %}
<div class="uu-container">
<div class="col-12">
<h2>Approved proposals</h2>
<table class="display exportTable w-100">
<tr>
{# No translations here, as the table should be in English #}
<th>Reference Number</th>
<th>Title</th>
<th>Applicant</th>
<th>Researcher with final responsibility</th>
<th>Approval Date</th>
<th>FEtC-H chamber</th>
</tr>
{% for proposal in proposals %}
<h2 class="mb-3">Approved proposals</h2>
<table class="dt w-100" data-language="{% datatables_lang %}">
<thead>
<tr>
<td>{{ proposal.reference_number }}</td>
<td>{{ proposal.title }}</td>
<td>{{ proposal.created_by.get_full_name }}</td>
<td>
{% if proposal.supervisor %}{{ proposal.supervisor.get_full_name }}{% endif %}
</td>
<td>{{ proposal.date_confirmed|date:"d M Y" }}</td>
<td>
{# Bad translation hack #}
{% if proposal.reviewing_committee.name == "AK" %}
GC
{% else %}
LC
{% endif %}
</td>
{# No translations here, as the table should be in English #}
<th>Reference Number</th>
<th>Title</th>
<th>Applicant</th>
<th>Researcher with final responsibility</th>
<th>Approval Date</th>
<th>FEtC-H chamber</th>
</tr>
{% endfor %}
</thead>
<tbody>
{% for proposal in proposals %}
<tr>
<td>{{ proposal.reference_number }}</td>
<td>{{ proposal.title }}</td>
<td>{{ proposal.created_by.get_full_name }}</td>
<td>
{% if proposal.supervisor %}{{ proposal.supervisor.get_full_name }}{% endif %}
</td>
<td>{{ proposal.date_confirmed|date:"d M Y" }}</td>
<td>
{# Bad translation hack #}
{% if proposal.reviewing_committee.name == "AK" %}
GC
{% else %}
LC
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<br />
</div>
Expand Down
30 changes: 13 additions & 17 deletions proposals/templates/proposals/proposal_submit.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,17 @@ <h5>{% trans "Controleer uw beoogde startdatum" %}</h5>
{% endblock %}

{% block form-buttons %}
<div class="uu-form-text-row">
<div class="uu-form-text">
{% if troublesome_pages or is_practice %}
{% include "base/form_buttons.html" with no_forward=1 %}
{% else %}
{% if proposal.is_pre_assessment %}
{% include "base/form_buttons.html" with next_text=_("Aanvraag voor voortoetsing versturen") %}
{% elif is_supervisor_edit_phase and is_supervisor %}
{% include "base/form_buttons.html" with next_text=_("Terug naar beoordeling >>") %}
{% elif proposal.relation.needs_supervisor %}
{% include "base/form_buttons.html" with next_text=_("Concept-aanmelding versturen") %}
{% else %}
{% include "base/form_buttons.html" with next_text=_("Aanmelding versturen") %}
{% endif %}
{% endif %}
</div>
</div>
{% if troublesome_pages or is_practice %}
{% include "base/form_buttons.html" with no_forward=1 %}
{% else %}
{% if proposal.is_pre_assessment %}
{% include "base/form_buttons.html" with next_text=_("Aanvraag voor voortoetsing versturen") %}
{% elif is_supervisor_edit_phase and is_supervisor %}
{% include "base/form_buttons.html" with next_text=_("Terug naar beoordeling >>") %}
{% elif proposal.relation.needs_supervisor %}
{% include "base/form_buttons.html" with next_text=_("Concept-aanmelding versturen") %}
{% else %}
{% include "base/form_buttons.html" with next_text=_("Aanmelding versturen") %}
{% endif %}
{% endif %}
{% endblock %}
33 changes: 0 additions & 33 deletions proposals/templates/proposals/proposal_update_attachments.html

This file was deleted.

50 changes: 22 additions & 28 deletions proposals/templates/proposals/proposal_update_date_start.html
Original file line number Diff line number Diff line change
@@ -1,36 +1,30 @@
{% extends "base/fetc_base.html" %}
{% extends "base/fetc_form_base.html" %}

{% load static %}
{% load i18n %}

{% block header_title %}
{% trans "Formulieren aanpassen" %} - {{ block.super }}
{% trans "Formulieren aanpassen" %}
{% endblock %}

{% block content %}
<div class="uu-container">
<div class="col-12">
<h2>{% trans "Startdatum aanpassen" %}</h2>
<p>
{% blocktrans trimmed with title=proposal.title ref_number=proposal.reference_number %}
Op deze pagina kan de startdatum worden aangepast van de aanvraag {{ title }}
(referentienummer <em>{{ ref_number }}</em>). <b>Let op!</b> Als de review al is afgerond,
wordt de nieuwe startdatum niet automatisch weergegeven in de PDF. Mocht je de PDF
opnieuw willen genereren, neem hierover dan contact op met
{% endblocktrans %}
<a href="mailto:[email protected]">[email protected]</a>.
</p>
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<input type="hidden" name="next" value="{{ request.META.HTTP_REFERER }}">
<input class="btn btn-primary"
type="submit"
value="{% trans 'Startdatum aanpassen' %}" />
<a class="btn btn-secondary" href="javascript:history.go(-1);">{% trans "Terug naar de vorige pagina" %}</a>
</form>
</div>
</div>
{% block sidebar %}<!--Empty to override stepper-->{% endblock %}

{% block pre-form-text %}
<h2>{% trans "Startdatum aanpassen" %}</h2>
<p>
{% blocktrans trimmed with title=proposal.title ref_number=proposal.reference_number %}
Op deze pagina kan de startdatum worden aangepast van de aanvraag {{ title }}
(referentienummer <em>{{ ref_number }}</em>). <b>Let op!</b> Als de review al is afgerond,
wordt de nieuwe startdatum niet automatisch weergegeven in de PDF. Mocht je de PDF
opnieuw willen genereren, neem hierover dan contact op met
{% endblocktrans %}
<a href="mailto:[email protected]">[email protected]</a>.
</p>
{% endblock %}

{% block form-buttons %}
<a class="btn btn-secondary" href="javascript:history.go(-1);">{% trans "Terug naar de vorige pagina" %}</a>
<input class="btn btn-primary ms-auto"
type="submit"
value="{% trans 'Startdatum aanpassen' %}" />
{% endblock %}
27 changes: 27 additions & 0 deletions proposals/templates/proposals/proposal_update_dmp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{% extends "base/fetc_form_base.html" %}

{% load static %}
{% load i18n %}

{% block header_title %}
{% trans "Formulieren aanpassen" %} - {{ block.super }}
{% endblock %}

{% block sidebar %}<!--Override stepper-->{% endblock %}

{% block pre-form-text %}
<h2>{% trans "Formulieren aanpassen" %}</h2>
<p>
{% blocktrans trimmed with title=proposal.title ref_number=proposal.reference_number %}
Op deze pagina kan je de formulieren aanpassen behorende bij de aanvraag {{ title }}
(referentienummer <em>{{ ref_number }}</em>).
{% endblocktrans %}
</p>
{% endblock %}

{% block form-buttons %}
<a class="btn btn-secondary" href="javascript:history.go(-1);">{% trans "Terug naar de vorige pagina" %}</a>
<input class="btn btn-primary ms-auto"
type="submit"
value="{% trans 'Formulieren aanpassen' %}" />
{% endblock %}
2 changes: 1 addition & 1 deletion proposals/views/proposal_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class ProposalUpdateDataManagement(GroupRequiredMixin, generic.UpdateView):
"""

model = Proposal
template_name = "proposals/proposal_update_attachments.html"
template_name = "proposals/proposal_update_dmp.html"
form_class = ProposalUpdateDataManagementForm
group_required = settings.GROUP_SECRETARY

Expand Down
Loading

0 comments on commit a692b96

Please sign in to comment.