Skip to content

Commit

Permalink
Merge pull request #833 from DH-IT-Portal-Development/fix/textual_bugs
Browse files Browse the repository at this point in the history
Fix/textual bugs
  • Loading branch information
EdoStorm96 authored Jan 7, 2025
2 parents 303c3e1 + 7e0b1b1 commit c4ef888
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
16 changes: 11 additions & 5 deletions main/templates/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,21 @@ <h3>{% trans 'Resources' %}</h3>
{# What should this be in dutch tho? #}
<ul>
<li>
{% trans "<a href='http://fetc-gw.wp.hum.uu.nl/' target='_blank'>FETC-GW website</a>" %}
{% blocktrans trimmed %}
<a href='http://fetc-gw.wp.hum.uu.nl/' target='_blank'>FETC-GW website</a>
{% endblocktrans %}
</li>
<li>
{% trans "<a href='https://fetc-gw.wp.hum.uu.nl/reglement-fetc-gw/'
target='_blank'>Reglement van de FETC-GW</a>" %}
{% blocktrans trimmed %}
<a href='https://fetc-gw.wp.hum.uu.nl/reglement-fetc-gw/'
target='_blank'>Reglement van de FETC-GW</a>
{% endblocktrans %}
</li>
<li>
{% trans "<a href='https://intranet.uu.nl/documenten-ethische-toetsingscommissie-gw'
target='_blank'>Voorbeelddocumenten</a>" %}
{% blocktrans trimmed %}
<a href='https://intranet.uu.nl/documenten-ethische-toetsingscommissie-gw'
target='_blank'>Voorbeelddocumenten</a>
{% endblocktrans %}
</li>
<li>
<a href="{% url 'faqs:list' %}">{% trans "Veelgestelde vragen m.b.t. dit portal" %}</a>
Expand Down
34 changes: 26 additions & 8 deletions proposals/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,9 @@ def __init__(self, *args, **kwargs):

applicants = get_user_model().objects.all()

self.fields["other_stakeholders"].label = mark_safe(
self.fields["other_stakeholders"].label
)
self.fields["other_stakeholders"].label = self.fields[
"other_stakeholders"
].label

self.fields["applicants"].choices = get_users_as_list(applicants)

Expand Down Expand Up @@ -795,6 +795,26 @@ class ProposalSubmitForm(
class Meta:
model = Proposal
fields = ["comments", "inform_local_staff", "embargo", "embargo_end_date"]
labels = {
"inform_local_staff": mark_safe_lazy(
_(
"<p>Je hebt aangegeven dat je gebruik wilt gaan maken van één "
"van de faciliteiten van het ILS, namelijk de database, Zep software "
"en/of het ILS lab. Het lab supportteam van het ILS zou graag op "
"de hoogte willen worden gesteld van aankomende onderzoeken. "
"Daarom vragen wij hier jouw toestemming om delen van deze aanvraag door te "
"sturen naar het lab supportteam.</p> "
"<p>Vind je het goed dat de volgende delen uit de aanvraag "
"worden doorgestuurd:</p> "
"- Jouw naam en de namen van de andere betrokkenen <br/> "
"- De eindverantwoordelijke van het onderzoek <br/> "
"- De titel van het onderzoek <br/> "
"- De beoogde startdatum <br/> "
"- Van welke faciliteiten je gebruik wil maken (database, lab, "
"Zep software)"
),
),
}
widgets = {
"inform_local_staff": BootstrapRadioSelect(choices=YES_NO),
"embargo": BootstrapRadioSelect(choices=YES_NO),
Expand All @@ -816,11 +836,9 @@ def __init__(self, *args, **kwargs):

super(ProposalSubmitForm, self).__init__(*args, **kwargs)

self.fields["inform_local_staff"].label_suffix = ""

self.fields["inform_local_staff"].label = mark_safe(
self.fields["inform_local_staff"].label
)
self.fields["inform_local_staff"].label = self.fields[
"inform_local_staff"
].label

if not check_local_facilities(self.proposal):
del self.fields["inform_local_staff"]
Expand Down
3 changes: 2 additions & 1 deletion proposals/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class PracticeReasons(models.IntegerChoices):
)

inform_local_staff = models.BooleanField(
mark_safe(
mark_safe_lazy(
_(
"<p>Je hebt aangegeven dat je gebruik wilt gaan maken van één "
"van de faciliteiten van het ILS, namelijk de database, Zep software "
Expand All @@ -322,6 +322,7 @@ class PracticeReasons(models.IntegerChoices):
"Zep software)"
),
),
# NOTE: lables with html are hardcoded in form Meta class!
default=None,
blank=True,
null=True,
Expand Down

0 comments on commit c4ef888

Please sign in to comment.