Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ jobs:
- run: ls -laR evap/static/ts
- name: Check TypeScript formatting
run: npx prettier --list-different --log-level debug 'evap/static/ts/**/*.ts' 'evap/static/ts/eslint.config.js'
- name: Check HTML formatting
run: |
./manage.py format html
git diff --exit-code

backup-process:
runs-on: ubuntu-22.04
Expand Down
18 changes: 15 additions & 3 deletions evap/cms/templates/cms_course_link_badges.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@
<form reload-on-success method="POST" action="{% url 'cms:cms_course_link_update_activation' %}">
{% csrf_token %}
<input name="cms_course_link_id" type="hidden" value="{{ cms_course_link.id }}">
<input name="is_active" type="hidden" value="{% if cms_course_link.is_active %}false{% else %}true{% endif %}">
<button class="btn badge {% if cms_course_link.is_active %}bg-secondary-outline btn-outline-secondary{% else %}bg-warning{% endif %}{% if not forloop.last %} me-1{% endif %}" type="submit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{% if cms_course_link.is_active %}{% translate "Linked to CMS. Click to deactivate." %}{% else %}{% translate "Link to CMS inactive. Click to activate." %}{% endif %}">
<span class="fas {% if cms_course_link.is_active %}fa-link{% else %}fa-link-slash{% endif %}"></span> {{ cms_course_link.cms_id }}
<input
name="is_active"
type="hidden"
value="{% if cms_course_link.is_active %}false{% else %}true{% endif %}"
>
<button
class="btn badge {% if cms_course_link.is_active %}bg-secondary-outline btn-outline-secondary{% else %}bg-warning{% endif %}{% if not forloop.last %} me-1{% endif %}"
type="submit"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
title='{% if cms_course_link.is_active %}{% translate "Linked to CMS. Click to deactivate." %}{% else %}{% translate "Link to CMS inactive. Click to activate." %}{% endif %}'
>
<span
class="fas {% if cms_course_link.is_active %}fa-link{% else %}fa-link-slash{% endif %}"
></span> {{ cms_course_link.cms_id }}
</button>
</form>
{% endfor %}
Expand Down
14 changes: 12 additions & 2 deletions evap/cms/templates/cms_course_link_icons.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
{% load cms_filters %}

{% if course.cms_course_links.all|has_active_links %}
<span class="fas fa-link" data-bs-toggle="tooltip" data-bs-placement="right" title="{% translate 'Linked to CMS' %}"></span>
<span
class="fas fa-link"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="{% translate 'Linked to CMS' %}"
></span>
{% endif %}
{% if course.cms_course_links.all|has_inactive_links %}
<span class="fas fa-link-slash" data-bs-toggle="tooltip" data-bs-placement="right" title="{% translate 'Has inactive CMS links' %}"></span>
<span
class="fas fa-link-slash"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="{% translate 'Has inactive CMS links' %}"
></span>
{% endif %}
18 changes: 15 additions & 3 deletions evap/cms/templates/cms_evaluation_link_badges.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@
<form reload-on-success method="POST" action="{% url 'cms:cms_evaluation_link_update_activation' %}">
{% csrf_token %}
<input name="cms_evaluation_link_id" type="hidden" value="{{ cms_evaluation_link.id }}">
<input name="is_active" type="hidden" value="{% if cms_evaluation_link.is_active %}false{% else %}true{% endif %}">
<button class="btn badge {% if cms_evaluation_link.is_active %}bg-secondary-outline btn-outline-secondary{% else %}bg-warning{% endif %}{% if not forloop.last %} me-1{% endif %}" type="submit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{% if cms_evaluation_link.is_active %}{% translate "Linked to CMS. Click to deactivate." %}{% else %}{% translate "Link to CMS inactive. Click to activate." %}{% endif %}">
<span class="fas {% if cms_evaluation_link.is_active %}fa-link{% else %}fa-link-slash{% endif %}"></span> {{ cms_evaluation_link.cms_id }}
<input
name="is_active"
type="hidden"
value="{% if cms_evaluation_link.is_active %}false{% else %}true{% endif %}"
>
<button
class="btn badge {% if cms_evaluation_link.is_active %}bg-secondary-outline btn-outline-secondary{% else %}bg-warning{% endif %}{% if not forloop.last %} me-1{% endif %}"
type="submit"
data-bs-toggle="tooltip"
data-bs-placement="bottom"
title='{% if cms_evaluation_link.is_active %}{% translate "Linked to CMS. Click to deactivate." %}{% else %}{% translate "Link to CMS inactive. Click to activate." %}{% endif %}'
>
<span
class="fas {% if cms_evaluation_link.is_active %}fa-link{% else %}fa-link-slash{% endif %}"
></span> {{ cms_evaluation_link.cms_id }}
</button>
</form>
{% endfor %}
Expand Down
14 changes: 12 additions & 2 deletions evap/cms/templates/cms_evaluation_link_icons.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
{% load cms_filters %}

{% if evaluation.cms_evaluation_links.all|has_active_links %}
<span class="fas fa-link" data-bs-toggle="tooltip" data-bs-placement="right" title="{% translate 'Linked to CMS' %}"></span>
<span
class="fas fa-link"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="{% translate 'Linked to CMS' %}"
></span>
{% endif %}
{% if evaluation.cms_evaluation_links.all|has_inactive_links %}
<span class="fas fa-link-slash" data-bs-toggle="tooltip" data-bs-placement="right" title="{% translate 'Has inactive CMS links' %}"></span>
<span
class="fas fa-link-slash"
data-bs-toggle="tooltip"
data-bs-placement="right"
title="{% translate 'Has inactive CMS links' %}"
></span>
{% endif %}
4 changes: 3 additions & 1 deletion evap/cms/templates/cms_evaluation_merge_selection.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ <h3>{% translate 'Merge evaluations' %}</h3>
{% csrf_token %}
<div class="card mb-3">
<div class="card-body">
<p>{% translate 'Select the evaluations you want to merge. This will copy all participants and contributors, and will update the CMS links. Warning: This operation cannot be reverted in the UI.' %}</p>
<p>
{% translate 'Select the evaluations you want to merge. This will copy all participants and contributors, and will update the CMS links. Warning: This operation cannot be reverted in the UI.' %}
</p>
{% include 'bootstrap_form.html' with form=form %}
</div>
</div>
Expand Down
46 changes: 35 additions & 11 deletions evap/contributor/templates/contributor_evaluation_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@

<div class="callout callout-info small">
{% if editable %}
{% blocktranslate %}Please review the evaluation's details below, add all contributors and select suitable questionnaires. Once everything is okay, please approve the evaluation on the bottom of the page.{% endblocktranslate %}
{% blocktranslate %}Please review the evaluation's details below, add all contributors and select suitable

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we noticed these breaks in blocktranslates, we should probably add trimmed then; will look into contributing or reporting this to djangofmt

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richardebeling So there is a builtin lint that all blocktranslates should be trimmed which we can apply with djangofmt check . --fix. Not sure if that is what we want though, seems to add more noise. Maybe we should contribute a setting so that trimmed is only needed/added if the blocktranslate spans more than one line?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think always putting in trimmed is fine: We only use blocktranslate, if we expect the contents to be larger/more complex, and in those cases, trimmed is basically always appropriate.

We have 117 occurrences of blocktranslate, I think it would be manageable. We can do it separately (PR/commit).

questionnaires. Once everything is okay, please approve the evaluation on the bottom of the
page.{% endblocktranslate %}
{% else %}
{% blocktranslate %}You cannot edit this evaluation because it has already been approved.{% endblocktranslate %}
{% blocktranslate %}You cannot edit this evaluation because it has already been
approved.{% endblocktranslate %}
{% endif %}
</div>
<h3>
Expand Down Expand Up @@ -90,28 +93,45 @@ <h5 class="card-title me-auto">{% translate 'Evaluation data' %}</h5>
<div class="card card-submit-area card-submit-area-3 text-center mb-3">
<div class="card-body">
{% if editable %}
<button name="operation" value="preview" type="submit" class="btn btn-light">{% translate 'Preview' %}</button>
<button name="operation" value="save" type="submit" class="btn btn-primary">{% translate 'Save' %}</button>
<button name="operation" value="preview" type="submit" class="btn btn-light">
{% translate 'Preview' %}
</button>
<button name="operation" value="save" type="submit" class="btn btn-primary">
{% translate 'Save' %}
</button>

<confirmation-modal type="submit" name="operation" value="approve">
<span slot="title">{% translate 'Approve evaluation' %}</span>
<span slot="action-text">{% translate 'Approve evaluation' %}</span>
<span slot="question">
{% blocktranslate trimmed %}
Do you want to approve this evaluation? This will allow the evaluation team to proceed with the preparation, but you won't be able to make any further changes.
Do you want to approve this evaluation? This will allow the evaluation team to proceed
with the preparation, but you won't be able to make any further changes.
{% endblocktranslate %}
</span>

<button slot="show-button" type="button" class="btn btn-success">{% translate 'Save and approve' %}</button>
<button slot="show-button" type="button" class="btn btn-success">
{% translate 'Save and approve' %}
</button>
</confirmation-modal>
{% endif %}
<a href="{% url 'contributor:index' %}" class="btn btn-light">{% if edit %}{% translate 'Cancel' %}{% else %}{% translate 'Back' %}{% endif %}</a>
<a
href="{% url 'contributor:index' %}"
class="btn btn-light"
>{% if edit %}{% translate 'Cancel' %}{% else %}{% translate 'Back' %}{% endif %}</a>
</div>
</div>
</form>

{% if preview_html %}
<div class="modal fade" id="previewModal" tabindex="-1" role="dialog" aria-labelledby="previewModalLabel" aria-hidden="true">
<div
class="modal fade"
id="previewModal"
tabindex="-1"
role="dialog"
aria-labelledby="previewModalLabel"
aria-hidden="true"
>
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
Expand All @@ -122,7 +142,9 @@ <h5 class="modal-title" id="previewModalLabel">{% translate 'Preview' %}</h5>
{{ preview_html }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-light" data-bs-dismiss="modal">{% translate 'Close' %}</button>
<button type="button" class="btn btn-light" data-bs-dismiss="modal">
{% translate 'Close' %}
</button>
</div>
</div>
</div>
Expand All @@ -133,11 +155,13 @@ <h5 class="modal-title" id="previewModalLabel">{% translate 'Preview' %}</h5>
{% block modals %}
{{ block.super }}

{% blocktranslate asvar title with evaluation_name=evaluation.full_name %}Request account creation for {{ evaluation_name }}{% endblocktranslate %}
{% blocktranslate asvar title with evaluation_name=evaluation.full_name %}Request account creation for
{{ evaluation_name }}{% endblocktranslate %}
{% translate 'Please tell us which new account we should create. We need the name and email for all new accounts.' as teaser %}
{% include 'contact_modal.html' with modal_id='createAccountRequestModal' user=request.user title=title teaser=teaser %}

{% blocktranslate asvar title with evaluation_name=evaluation.full_name %}Request evaluation changes for {{ evaluation_name }}{% endblocktranslate %}
{% blocktranslate asvar title with evaluation_name=evaluation.full_name %}Request evaluation changes for
{{ evaluation_name }}{% endblocktranslate %}
{% translate 'Please tell us what changes to the evaluation we should make.' as teaser %}
{% include 'contact_modal.html' with modal_id='changeEvaluationRequestModal' user=request.user title=title teaser=teaser %}
{% endblock %}
Expand Down
Loading