diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e07966a3..569ca7a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,14 +17,14 @@ repos: - id: check-toml - id: detect-private-key - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.21 + rev: v0.15.22 hooks: - id: ruff args: [--config, pyproject.toml] - id: ruff-format args: [--config, pyproject.toml] - repo: https://github.com/djlint/djLint - rev: v1.40.6 + rev: v1.42.0 hooks: - id: djlint-reformat-jinja - repo: local diff --git a/amt/site/templates/algorithms/ai_act_changes_modal.html.j2 b/amt/site/templates/algorithms/ai_act_changes_modal.html.j2 index 4f6e6a87..a5675894 100644 --- a/amt/site/templates/algorithms/ai_act_changes_modal.html.j2 +++ b/amt/site/templates/algorithms/ai_act_changes_modal.html.j2 @@ -1,62 +1,62 @@

{% trans %}Update requirements and measures{% endtrans %}

- {% trans %}Changing the AI-Act profile will lead to the following changes in requirements and measures.{% endtrans %} + {% trans %}Changing the AI-Act profile will lead to the following changes in requirements and measures.{% endtrans %}

{% if added_requirements|length > 0 %} -

{% trans %}New requirements{% endtrans %}

- {% endif %} {% if removed_requirements|length > 0 %} -

{% trans %}Removed requirements{% endtrans %}

- {% endif %} {% if added_measures|length > 0 %} -

{% trans %}New measures{% endtrans %}

- {% endif %} {% if removed_measures|length > 0 %} -

{% trans %}Removed measures{% endtrans %}

- {% endif %}
- +
diff --git a/amt/site/templates/algorithms/details_base.html.j2 b/amt/site/templates/algorithms/details_base.html.j2 index 0a141d56..5b2a0edb 100644 --- a/amt/site/templates/algorithms/details_base.html.j2 +++ b/amt/site/templates/algorithms/details_base.html.j2 @@ -3,54 +3,54 @@ {% import "macros/tabs.html.j2" as tabs with context %} {% block title %}{{ algorithm.name }} | AMT{% endblock %} {% block content %} - {% endblock %} diff --git a/amt/site/templates/algorithms/details_compliance.html.j2 b/amt/site/templates/algorithms/details_compliance.html.j2 index 381508cb..f2b513c8 100644 --- a/amt/site/templates/algorithms/details_compliance.html.j2 +++ b/amt/site/templates/algorithms/details_compliance.html.j2 @@ -1,75 +1,75 @@ {% extends 'algorithms/details_base.html.j2' %} {% import "macros/form_macros.html.j2" as macros with context %} {% block detail_content %} -
- {% for (requirement, completed_measures_count, measures) in requirements_and_measures %} -
- -

- - - {{ requirement.name }} -

-
-
{{ requirement.description }}
-
- {% if completed_measures_count == 0 %} -
- {% elif completed_measures_count < measures | length %} -
- {% else %} -
- {% endif %} - {{ completed_measures_count }} / {{ measures | length }} {% trans %}measure executed{% endtrans %} -
-
-
- {% for measure in measures %} -
-
- {% if measure.state == "to do" %} -
- {% elif measure.state == "in progress" %} -
- {% elif measure.state == "in review" %} -
- {% elif measure.state == "done" %} -
- {% elif measure.state == "not implemented" %} -
- {% else %} - {# This should not happen, red could be for overdue.#} -
- {% endif %} -
-

{{ loop.index }}. {{ measure.name }}

-

{{ measure.value }}

- {% if permission(permission_path, 'Update', permissions) == True %} - - - {% trans %}Edit{% endtrans %} - - {% endif %} -
{{ macros.user_avatars(measure_task_functions[measure.urn]) }}
-
-
+
+ {% for (requirement, completed_measures_count, measures) in requirements_and_measures %} +
+ +

+ + + {{ requirement.name }} +

+
+
{{ requirement.description }}
+
+ {% if completed_measures_count == 0 %} +
+ {% elif completed_measures_count < measures | length %} +
+ {% else %} +
+ {% endif %} + {{ completed_measures_count }} / {{ measures | length }} {% trans %}measure executed{% endtrans %}
+
+
+ {% for measure in measures %} +
+
+ {% if measure.state == "to do" %} +
+ {% elif measure.state == "in progress" %} +
+ {% elif measure.state == "in review" %} +
+ {% elif measure.state == "done" %} +
+ {% elif measure.state == "not implemented" %} +
+ {% else %} + {# This should not happen, red could be for overdue.#} +
+ {% endif %} +
+

{{ loop.index }}. {{ measure.name }}

+

{{ measure.value }}

+ {% if permission(permission_path, 'Update', permissions) == True %} + + + {% trans %}Edit{% endtrans %} + + {% endif %} +
{{ macros.user_avatars(measure_task_functions[measure.urn]) }}
+
+
+
{% endfor %} -
-{% endfor %} -
- +
+ {% endfor %} +
+ {% endblock %} diff --git a/amt/site/templates/algorithms/details_info.html.j2 b/amt/site/templates/algorithms/details_info.html.j2 index 60b09ec8..2b70bb4e 100644 --- a/amt/site/templates/algorithms/details_info.html.j2 +++ b/amt/site/templates/algorithms/details_info.html.j2 @@ -1,130 +1,130 @@ {% extends 'algorithms/details_base.html.j2' %} {% from "macros/editable_macros.html.j2" import editable with context %} {% block detail_content %} - -
-
-
-
- - {{ requirements_state.count_0 }}/{{ requirements_state.count_1 }} - {% trans %}Done{% endtrans %} + +
+
+
+
+ + {{ requirements_state.count_0 }}/{{ requirements_state.count_1 }} + {% trans %}Done{% endtrans %}
    - {% for requirement in requirements_state.states %} - {# Only show the first 3 elements of the instruments_state#} - {% if loop.index <= 3 %} -
  • -
    -
    - {% if requirement.state == "to do" or requirement.state == "" %} -
    - {% elif requirement.state == "in progress" %} -
    - {% else %} -
    - {% endif %} - {{ requirement.name }} -
    -
    - - {% if requirement.state == "to do" or requirement.state == "" %} - {% trans %}To do{% endtrans %} - {% elif requirement.state == "in progress" %} - {% trans %}In progress{% endtrans %} - {% elif requirement.state == "done" %} - {% trans %}Done{% endtrans %} - {% else %} - {{ requirement.state }} - {% endif %} + {% for requirement in requirements_state.states %} + {# Only show the first 3 elements of the instruments_state#} + {% if loop.index <= 3 %} +
  • +
    +
    + {% if requirement.state == "to do" or requirement.state == "" %} +
    + {% elif requirement.state == "in progress" %} +
    + {% else %} +
    + {% endif %} + {{ requirement.name }} +
    +
    + + {% if requirement.state == "to do" or requirement.state == "" %} + {% trans %}To do{% endtrans %} + {% elif requirement.state == "in progress" %} + {% trans %}In progress{% endtrans %} + {% elif requirement.state == "done" %} + {% trans %}Done{% endtrans %} + {% else %} + {{ requirement.state }} + {% endif %} +
    -
- - {% endif %} -{% endfor %} - - - - {% trans %}Go to all requirements{% endtrans %} - -
-
-
- -
+ + {% endif %} + {% endfor %} + + + + {% trans %}Go to all requirements{% endtrans %} + +
+
+
+ +
{% set has_permission = permission("algorithm/" ~ algorithm_id ~ "/systemcard", 'Update', permissions) %} - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% trans %}Name{% endtrans %} - {{ editable(algorithm, "name", "algorithm/" + algorithm_id|string + "/name", None, has_permission) }} -
{% trans %}Name{% endtrans %} + {{ editable(algorithm, "name", "algorithm/" + algorithm_id|string + "/name", None, has_permission) }} +
{% trans %}Organization{% endtrans %} - {{ editable(algorithm, "organization.name", "algorithm/" + algorithm_id|string + "/organization", None, has_permission) }} -
{% trans %}Description{% endtrans %} - {{ editable(algorithm, "system_card.description", "algorithm/" + algorithm_id|string + "/system_card/description", None, has_permission) }} -
{% trans %}Repository{% endtrans %} - {{ editable(algorithm, "system_card.provenance.uri", "algorithm/" + algorithm_id|string + "/systemcard/provenance/uri", None, has_permission) }} -
{% trans %}Lifecycle{% endtrans %} - {{ editable(algorithm, "lifecycle", "algorithm/" + algorithm_id|string + "/lifecycle", None, has_permission) }} -
{% trans %}Last updated{% endtrans %}{{ last_edited|format_datetime(language) }}
{% trans %}Labels{% endtrans %} - {% for label in system_card.labels %} - {{ label.name }} - {% endfor %} -
{% trans %}References{% endtrans %} -
- {% for reference in system_card.references %} - {{ editable(algorithm, "system_card.references[" + (loop.index-1) |string + "]", "algorithm/" + algorithm_id|string + "/system_card/references[" + (loop.index-1)|string + "]", None, has_permission) }} - {% endfor %} -
-
-
+ {% trans %}Organization{% endtrans %} + + {{ editable(algorithm, "organization.name", "algorithm/" + algorithm_id|string + "/organization", None, has_permission) }} + + + + {% trans %}Description{% endtrans %} + + {{ editable(algorithm, "system_card.description", "algorithm/" + algorithm_id|string + "/system_card/description", None, has_permission) }} + + + + {% trans %}Repository{% endtrans %} + + {{ editable(algorithm, "system_card.provenance.uri", "algorithm/" + algorithm_id|string + "/systemcard/provenance/uri", None, has_permission) }} + + + + {% trans %}Lifecycle{% endtrans %} + + {{ editable(algorithm, "lifecycle", "algorithm/" + algorithm_id|string + "/lifecycle", None, has_permission) }} + + + + {% trans %}Last updated{% endtrans %} + {{ last_edited|format_datetime(language) }} + + + {% trans %}Labels{% endtrans %} + + {% for label in system_card.labels %} + {{ label.name }} + {% endfor %} + + + + {% trans %}References{% endtrans %} + +
+ {% for reference in system_card.references %} + {{ editable(algorithm, "system_card.references[" + (loop.index-1) |string + "]", "algorithm/" + algorithm_id|string + "/system_card/references[" + (loop.index-1)|string + "]", None, has_permission) }} + {% endfor %} +
+ + + + +
{% endblock %} diff --git a/amt/site/templates/algorithms/details_instruments.html.j2 b/amt/site/templates/algorithms/details_instruments.html.j2 index a325d056..4bb383ff 100644 --- a/amt/site/templates/algorithms/details_instruments.html.j2 +++ b/amt/site/templates/algorithms/details_instruments.html.j2 @@ -1,4 +1,4 @@ {% extends 'algorithms/details_base.html.j2' %} {% block detail_content %} -
{% trans %}To be implemented{% endtrans %}
+
{% trans %}To be implemented{% endtrans %}
{% endblock %} diff --git a/amt/site/templates/algorithms/details_measure_modal.html.j2 b/amt/site/templates/algorithms/details_measure_modal.html.j2 index f154bb1b..84825ddf 100644 --- a/amt/site/templates/algorithms/details_measure_modal.html.j2 +++ b/amt/site/templates/algorithms/details_measure_modal.html.j2 @@ -1,79 +1,77 @@ {% import "macros/form_macros.html.j2" as macros with context %}
-
-

{{ measure.name }}

-
-
-
-
-
-
-
-
-
-
- -
{{ measure.description }}
-
- +
+

{{ measure.name }}

+
+
+ +
+
+
+
+
+
+
+ +
{{ measure.description }}
+
+ +
+ {% for form_field in form.fields %} + {# Place the measure_state on the side in the modal #} + {% if form_field.name != "measure_state" %} + {# The functions have a specific ordering in horizontal fashion #} + {% if form_field.name == "measure_responsible" %} +
+ {{ macros.form_field(form.id, form_field) }} + {% elif form_field.name == "measure_accountable" %} + {{ macros.form_field(form.id, form_field) }}
- {% for form_field in form.fields %} - {# Place the measure_state on the side in the modal #} - {% if form_field.name != "measure_state" %} - {# The functions have a specific ordering in horizontal fashion #} - {% if form_field.name == "measure_responsible" %} -
- {{ macros.form_field(form.id, form_field) }} - {% elif form_field.name == "measure_accountable" %} - {{ macros.form_field(form.id, form_field) }} -
- {% else %} - {{ macros.form_field(form.id, form_field) }} - {% endif %} - {% endif %} - {% endfor %} -
-
-

- + {% else %} + {{ macros.form_field(form.id, form_field) }} + {% endif %} + {% endif %} + {% endfor %} +

+
+

+ -

-
-
-
- {% for form_field in form.fields %} - {% if form_field.name == "measure_state" %}{{ macros.form_field(form.id, form_field) }}{% endif %} - {% endfor %} -
-
-
+

+
+ +
+ {% for form_field in form.fields %} + {% if form_field.name == "measure_state" %}{{ macros.form_field(form.id, form_field) }}{% endif %} + {% endfor %} +
+ + diff --git a/amt/site/templates/algorithms/index.html.j2 b/amt/site/templates/algorithms/index.html.j2 index d95ac7e1..48234fb3 100644 --- a/amt/site/templates/algorithms/index.html.j2 +++ b/amt/site/templates/algorithms/index.html.j2 @@ -1,6 +1,6 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
-
{% include 'parts/algorithm_search.html.j2' %}
-
+
+
{% include 'parts/algorithm_search.html.j2' %}
+
{% endblock %} diff --git a/amt/site/templates/algorithms/new.html.j2 b/amt/site/templates/algorithms/new.html.j2 index d3e1735f..2e7d6386 100644 --- a/amt/site/templates/algorithms/new.html.j2 +++ b/amt/site/templates/algorithms/new.html.j2 @@ -1,188 +1,188 @@ {% import "macros/form_macros.html.j2" as macros with context %} {% extends "layouts/base.html.j2" %} {% block content %} -
-
-
-
-

{% trans %}Add an algorithm{% endtrans %}

-
-
- - -
-
-
-
- -
-
- +
+
+
+
+

{% trans %}Add an algorithm{% endtrans %}

+
+ + + +
+
+
+
+ +
+
+ +
+
+
+ +
+

+ {% trans %}Select the lifecycle your algorithm is currently in.{% endtrans %} + {% trans %}For more information on lifecycle, read the{% endtrans %} + {% trans %}Algorithm Framework{% endtrans %}. +

+ {% for lifecycle in lifecycles %} +
+ +
+ {% endfor %} +
+ {{ macros.form_field(form.id, form.fields[0]) }} +
+
+

{% trans %}AI Act Profile{% endtrans %}

+

+ {% trans %}The AI Act profile provides insight into, among other things, the type of AI system and the associated obligations from the European AI Act. If you already know the type of AI system you can fill in the below fields. Otherwise, you can find your AI Act Profile with the AI Act Support Tool.{% endtrans %} +

+
+ +
+ {% for item in ai_act_profile.multiple_select %}
-
- -
-

- {% trans %}Select the lifecycle your algorithm is currently in.{% endtrans %} - {% trans %}For more information on lifecycle, read the{% endtrans %} - {% trans %}Algorithm Framework{% endtrans %}. -

-
- {% for lifecycle in lifecycles %} -
- -
- {% endfor %} -
-{{ macros.form_field(form.id, form.fields[0]) }} -
-
-

{% trans %}AI Act Profile{% endtrans %}

-

- {% trans %}The AI Act profile provides insight into, among other things, the type of AI system and the associated obligations from the European AI Act. If you already know the type of AI system you can fill in the below fields. Otherwise, you can find your AI Act Profile with the AI Act Support Tool.{% endtrans %} -

-
- -
- {% for item in ai_act_profile.multiple_select %} -
-
- -
- {% for option in item.options %} -
-
+ {% endfor %} + {% for item in ai_act_profile.dropdown_select %} +
+
+ +
+
+ +
+
+ {% endfor %} + {% for item in ai_act_profile.radio_select %} +
+
+ +
+ {% for option in item.options %} +
+ +
+ {% endfor %} +
+ {% endfor %} + {% for item in ai_act_profile.binary_select %} +
+
+ +
+
+ +
+
+ +
- {% endfor %} -
- {% endfor %} - {% for item in ai_act_profile.dropdown_select %} -
-
- -
-
- -
-
-{% endfor %} -{% for item in ai_act_profile.radio_select %} -
-
- -
- {% for option in item.options %} -
- -
- {% endfor %} -
-{% endfor %} -{% for item in ai_act_profile.binary_select %} -
-
- -
-
- + {% endfor %} +
+
+
+

+ +

+ +
-
- -
-
-{% endfor %} -
-
-
-

- -

- -
-
-
- + + {% endblock content %} diff --git a/amt/site/templates/algorithms/tasks.html.j2 b/amt/site/templates/algorithms/tasks.html.j2 index ca310289..619f4b3c 100644 --- a/amt/site/templates/algorithms/tasks.html.j2 +++ b/amt/site/templates/algorithms/tasks.html.j2 @@ -1,6 +1,6 @@ {% extends 'algorithms/details_base.html.j2' %} {% block detail_content %} -
-
{% include 'parts/tasks_search.html.j2' %}
-
+
+
{% include 'parts/tasks_search.html.j2' %}
+
{% endblock %} diff --git a/amt/site/templates/auth/profile.html.j2 b/amt/site/templates/auth/profile.html.j2 index c85f54d6..1885f133 100644 --- a/amt/site/templates/auth/profile.html.j2 +++ b/amt/site/templates/auth/profile.html.j2 @@ -1,119 +1,119 @@ {% extends 'layouts/base.html.j2' %} {% block content %} - {% set language_mappings = {"nl": "Nederlands", "en": "English"} %} -
-
-
-

- {% trans %}Overview{% endtrans %} {% trans %}of{% endtrans %} {{ user['name'] }} + {% set language_mappings = {"nl": "Nederlands", "en": "English"} %} +
+
+
+

+ {% trans %}Overview{% endtrans %} {% trans %}of{% endtrans %} {{ user['name'] }}

- - -
- -
    -
  • - {% trans %}Name{% endtrans %}{{ user['name'] }} -
  • -
  • - {% trans %}Email{% endtrans %}{{ user['email'] }} -
  • -
  • - -
    -
    - -
    -
    - -
    -
    -
  • -
-

{% trans %}Organizations{% endtrans %}

- - - + + + + +
    +
  • + {% trans %}Name{% endtrans %}{{ user['name'] }} +
  • +
  • + {% trans %}Email{% endtrans %}{{ user['email'] }} +
  • +
  • + +
    +
    + +
    +
    + +
    +
    +
  • +
+

{% trans %}Organizations{% endtrans %}

+
+ + - - - - - {% for user, authorization, role, organization in organizations %} - - + + + + {% for user, authorization, role, organization in organizations %} + + - - -{% endfor %} - -
{% trans %}Name{% endtrans %}{% trans %}Role{% endtrans %}
+ {% trans %}Role{% endtrans %}
{% if organization %} - {{ organization.name }} + {{ organization.name }} {% else %} - {% trans %}Unknown{% endtrans %} - {% endif %} - {{ ExternalFieldsTranslations.translate(role.name, request) }}
-

{% trans %}Algorithms{% endtrans %}

- - - + {% trans %}Unknown{% endtrans %} + {% endif %} + + + + {% endfor %} + +
{{ ExternalFieldsTranslations.translate(role.name, request) }}
+

{% trans %}Algorithms{% endtrans %}

+ + + - - - - - {% for user, authorization, role, algorithm in algorithms %} - - + + + + {% for user, authorization, role, algorithm in algorithms %} + + - - -{% endfor %} - -
{% trans %}Name{% endtrans %}{% trans %}Role{% endtrans %}
+ {% trans %}Role{% endtrans %}
{% if algorithm %} - {{ algorithm.name }} + {{ algorithm.name }} {% else %} - {% trans %}Unknown{% endtrans %} - {% endif %} - {{ ExternalFieldsTranslations.translate(role.name, request) }}
-
-
+ {% trans %}Unknown{% endtrans %} + {% endif %} + + {{ ExternalFieldsTranslations.translate(role.name, request) }} + + {% endfor %} + + +

+
{% endblock %} diff --git a/amt/site/templates/errors/AMTAuthorizationError_401.html.j2 b/amt/site/templates/errors/AMTAuthorizationError_401.html.j2 index 266603ff..8a13a2ad 100644 --- a/amt/site/templates/errors/AMTAuthorizationError_401.html.j2 +++ b/amt/site/templates/errors/AMTAuthorizationError_401.html.j2 @@ -1,16 +1,16 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
-
-

{% trans %}Not logged in{% endtrans %}

-

- {% trans %}Please login to view this page{% endtrans %}. +

-
+ +

+
+
{% endblock %} diff --git a/amt/site/templates/errors/AMTNotFound_404.html.j2 b/amt/site/templates/errors/AMTNotFound_404.html.j2 index 2f4aca32..004d9298 100644 --- a/amt/site/templates/errors/AMTNotFound_404.html.j2 +++ b/amt/site/templates/errors/AMTNotFound_404.html.j2 @@ -1,6 +1,6 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
-
{% include 'errors/_404_Exception.html.j2' %}
-
+
+
{% include 'errors/_404_Exception.html.j2' %}
+
{% endblock %} diff --git a/amt/site/templates/errors/AMTPermissionDenied_404.html.j2 b/amt/site/templates/errors/AMTPermissionDenied_404.html.j2 index 2f4aca32..004d9298 100644 --- a/amt/site/templates/errors/AMTPermissionDenied_404.html.j2 +++ b/amt/site/templates/errors/AMTPermissionDenied_404.html.j2 @@ -1,6 +1,6 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
-
{% include 'errors/_404_Exception.html.j2' %}
-
+
+
{% include 'errors/_404_Exception.html.j2' %}
+
{% endblock %} diff --git a/amt/site/templates/errors/Exception.html.j2 b/amt/site/templates/errors/Exception.html.j2 index 2562eec8..0370924c 100644 --- a/amt/site/templates/errors/Exception.html.j2 +++ b/amt/site/templates/errors/Exception.html.j2 @@ -1,9 +1,9 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
-
-

{% trans %}An error occurred{% endtrans %}

- {% include 'errors/_Exception.html.j2' %} +
+
+

{% trans %}An error occurred{% endtrans %}

+ {% include 'errors/_Exception.html.j2' %}
-
+
{% endblock %} diff --git a/amt/site/templates/errors/HTTPException_404.html.j2 b/amt/site/templates/errors/HTTPException_404.html.j2 index 2f4aca32..004d9298 100644 --- a/amt/site/templates/errors/HTTPException_404.html.j2 +++ b/amt/site/templates/errors/HTTPException_404.html.j2 @@ -1,6 +1,6 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
-
{% include 'errors/_404_Exception.html.j2' %}
-
+
+
{% include 'errors/_404_Exception.html.j2' %}
+
{% endblock %} diff --git a/amt/site/templates/errors/RequestValidationError_400.html.j2 b/amt/site/templates/errors/RequestValidationError_400.html.j2 index f0c06261..44941e61 100644 --- a/amt/site/templates/errors/RequestValidationError_400.html.j2 +++ b/amt/site/templates/errors/RequestValidationError_400.html.j2 @@ -1,9 +1,9 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
-
-

{% trans %}An error occurred{% endtrans %}

- {% include 'errors/_RequestValidationError_400.html.j2' %} +
+
+

{% trans %}An error occurred{% endtrans %}

+ {% include 'errors/_RequestValidationError_400.html.j2' %}
-
+
{% endblock %} diff --git a/amt/site/templates/errors/_404_Exception.html.j2 b/amt/site/templates/errors/_404_Exception.html.j2 index e798dfcc..32f5c421 100644 --- a/amt/site/templates/errors/_404_Exception.html.j2 +++ b/amt/site/templates/errors/_404_Exception.html.j2 @@ -1,17 +1,17 @@

{% trans %}An error occurred{% endtrans %}

- {% trans %}We couldn't find what you were looking for. This might be because:{% endtrans %} + {% trans %}We couldn't find what you were looking for. This might be because:{% endtrans %}

{% trans %}What now?{% endtrans %}

diff --git a/amt/site/templates/errors/_AMTCSRFProtectError_401.html.j2 b/amt/site/templates/errors/_AMTCSRFProtectError_401.html.j2 index 105db49f..1c0e839a 100644 --- a/amt/site/templates/errors/_AMTCSRFProtectError_401.html.j2 +++ b/amt/site/templates/errors/_AMTCSRFProtectError_401.html.j2 @@ -1,26 +1,26 @@
- -
-
- {% if message is defined and message is not none %} - {{ message }} - {% else %} - {% trans %}An error occurred. Please try again later{% endtrans %} - {% endif %} + +
+
+ {% if message is defined and message is not none %} + {{ message }} + {% else %} + {% trans %}An error occurred. Please try again later{% endtrans %} + {% endif %}
-
-
+ - +
diff --git a/amt/site/templates/errors/_Exception.html.j2 b/amt/site/templates/errors/_Exception.html.j2 index 3dff6246..bcf87b21 100644 --- a/amt/site/templates/errors/_Exception.html.j2 +++ b/amt/site/templates/errors/_Exception.html.j2 @@ -1,7 +1,7 @@

- {% if message is defined and message is not none %} - {{ message }} - {% else %} - {% trans %}An error occurred. Please try again later{% endtrans %} -{% endif %} + {% if message is defined and message is not none %} + {{ message }} + {% else %} + {% trans %}An error occurred. Please try again later{% endtrans %} + {% endif %}

diff --git a/amt/site/templates/errors/_RequestValidationError_400.html.j2 b/amt/site/templates/errors/_RequestValidationError_400.html.j2 index c5aa0c5a..e745696a 100644 --- a/amt/site/templates/errors/_RequestValidationError_400.html.j2 +++ b/amt/site/templates/errors/_RequestValidationError_400.html.j2 @@ -1,28 +1,28 @@
- {% if message|length > 1 %} -

{% trans %}There are some errors{% endtrans %}

-{% else %} + {% if message|length > 1 %} +

{% trans %}There are some errors{% endtrans %}

+ {% else %}

{% trans %}There is an error{% endtrans %}

-{% endif %} -{% for msg in message %} + {% endif %} + {% for msg in message %}
- {# {{ msg['loc'][-1] | capitalize }}:#} - - {{ msg['msg'] }} + {# {{ msg['loc'][-1] | capitalize }}:#} + + {{ msg['msg'] }}
-{% endfor %} + {% endfor %}
{% if request.state.htmx is defined and request.state.htmx %} - {% for msg in message %} - - {% endfor %} + {% for msg in message %} + + {% endfor %} {% endif %} diff --git a/amt/site/templates/macros/algorithm_systems_grid.html.j2 b/amt/site/templates/macros/algorithm_systems_grid.html.j2 index 5d1b1ad8..b7435a0d 100644 --- a/amt/site/templates/macros/algorithm_systems_grid.html.j2 +++ b/amt/site/templates/macros/algorithm_systems_grid.html.j2 @@ -1,47 +1,47 @@ {% import 'macros/table_row.html.j2' as table_row with context %} {% macro row(algorithms, lifecycle) -%} - {% if algorithms | length > 0 %} -
- {% else %} -
- {% endif %} -
- -
-
-
- {% if algorithms | length > 0 %} -

- - - {% else %} -

- - {% endif %} - {{ lifecycle.display_value | safe }} ({{ algorithms | length }}) -

-
-
-
-
-
- - - - - - - - {% for algorithm in algorithms %}{{ table_row.item(loop, algorithm, false) }}{% endfor %} -
-
-
+ {% if algorithms | length > 0 %} +
+ {% else %} +
+ {% endif %} +
+ +
+
+
+ {% if algorithms | length > 0 %} +

+ + + {% else %} +

+ + {% endif %} + {{ lifecycle.display_value | safe }} ({{ algorithms | length }}) +

- {% endmacro -%} +
+
+
+
+ + + + + + + + {% for algorithm in algorithms %}{{ table_row.item(loop, algorithm, false) }}{% endfor %} +
+
+
+
+{% endmacro -%} diff --git a/amt/site/templates/macros/cards.html.j2 b/amt/site/templates/macros/cards.html.j2 index 8a0b332d..4304df3d 100644 --- a/amt/site/templates/macros/cards.html.j2 +++ b/amt/site/templates/macros/cards.html.j2 @@ -1,71 +1,71 @@ {% from "macros/editable_macros.html.j2" import editable with context %} {% macro render_include_path(path) -%} - {{ path.urlpath.split("/")[-1] .split(".")[0] }} + {{ path.urlpath.split("/")[-1] .split(".")[0] }} {%- endmacro %} {% macro render_attribute(attribute) -%} - {{ attribute.capitalize().replace("_", " ") }} + {{ attribute.capitalize().replace("_", " ") }} {%- endmacro %} {% macro render_value(key, value, depth, base_resource_path, path) -%} - {% set has_permission = permission(permission_path, 'Update', permissions) %} - {% if key is defined and key != "" %} - {% set relative_resource_path = path + "/" + key %} + {% set has_permission = permission(permission_path, 'Update', permissions) %} + {% if key is defined and key != "" %} + {% set relative_resource_path = path + "/" + key %} + {% else %} + {% set relative_resource_path = path %} + {% endif %} + {% set full_resource_path = base_resource_path + relative_resource_path %} + {% if isinstance(value, 'IterMixin') or isinstance(value, 'dict') %} +
+ {% if is_editable_resource(full_resource_path, editables) %} + {{ editable(algorithm, relative_resource_path, full_resource_path, None, has_permission) }} + {% else %} + {% if value.__class__.__name__ == 'dict' %} + {% set value = value.items() %} + {% endif %} + {% for subkey, subvalue in value %} + {{ render_attribute(subkey) }}: + {% if is_editable_resource(full_resource_path + "/" + subkey, editables) %} + {{ editable(algorithm, relative_resource_path + "/" + subkey, full_resource_path + "/" + subkey, None, has_permission) }} + {% else %} + {{ render_value(subkey, subvalue, depth+1, base_resource_path, path) }} + {% endif %} + {% if not loop.last %}
{% endif %} + {% endfor %} + {% endif %} +
+ {% elif isinstance(value, 'list') %} + {% if key == "assessments" %} + + {% elif key == "models" %} + {% for model in value %}{{ model["name"] }}{% endfor %} {% else %} - {% set relative_resource_path = path %} - {% endif %} - {% set full_resource_path = base_resource_path + relative_resource_path %} - {% if isinstance(value, 'IterMixin') or isinstance(value, 'dict') %} -
- {% if is_editable_resource(full_resource_path, editables) %} - {{ editable(algorithm, relative_resource_path, full_resource_path, None, has_permission) }} - {% else %} - {% if value.__class__.__name__ == 'dict' %} - {% set value = value.items() %} - {% endif %} - {% for subkey, subvalue in value %} - {{ render_attribute(subkey) }}: - {% if is_editable_resource(full_resource_path + "/" + subkey, editables) %} - {{ editable(algorithm, relative_resource_path + "/" + subkey, full_resource_path + "/" + subkey, None, has_permission) }} - {% else %} - {{ render_value(subkey, subvalue, depth+1, base_resource_path, path) }} - {% endif %} - {% if not loop.last %}
{% endif %} - {% endfor %} - {% endif %} + {% if is_editable_resource(full_resource_path + "[*]", editables) %} +
+ {% for item in value %} + {{ editable(algorithm, relative_resource_path + "[" + (loop.index-1) | string + "]", full_resource_path + "[" + (loop.index-1) | string + "]", None, has_permission) }} + {% endfor %}
- {% elif isinstance(value, 'list') %} - {% if key == "assessments" %} - - {% elif key == "models" %} - {% for model in value %}{{ model["name"] }}{% endfor %} - {% else %} - {% if is_editable_resource(full_resource_path + "[*]", editables) %} -
- {% for item in value %} - {{ editable(algorithm, relative_resource_path + "[" + (loop.index-1) | string + "]", full_resource_path + "[" + (loop.index-1) | string + "]", None, has_permission) }} - {% endfor %} -
- {% else %} -
- {% for item in value %} - {{ render_value("", item, depth+1, base_resource_path, path + "/" + key + "[" + (loop.index-1) |string + "]") }} - {% endfor %} -
- {% endif %} - {% endif %} + {% else %} +
+ {% for item in value %} + {{ render_value("", item, depth+1, base_resource_path, path + "/" + key + "[" + (loop.index-1) |string + "]") }} + {% endfor %} +
+ {% endif %} + {% endif %} + {% else %} + {% if is_editable_resource(full_resource_path, editables) %} + {{ editable(algorithm, relative_resource_path, full_resource_path, None, has_permission) }} {% else %} - {% if is_editable_resource(full_resource_path, editables) %} - {{ editable(algorithm, relative_resource_path, full_resource_path, None, has_permission) }} - {% else %} - {{ value }} - {% endif %} + {{ value }} {% endif %} + {% endif %} {%- endmacro %} diff --git a/amt/site/templates/macros/editable_macros.html.j2 b/amt/site/templates/macros/editable_macros.html.j2 index acf24d70..aca0cac3 100644 --- a/amt/site/templates/macros/editable_macros.html.j2 +++ b/amt/site/templates/macros/editable_macros.html.j2 @@ -1,259 +1,259 @@ {% macro render_attribute(attribute) -%} - {{ attribute.capitalize().replace("_", " ") }} + {{ attribute.capitalize().replace("_", " ") }} {%- endmacro %} {% macro show_ai_act_button() %} - + {% endmacro %} {% macro editable_from_path(full_resource_path, context_variables, has_permission) %} - {% set editable_object = resolve_editable_from_path(full_resource_path, context_variables, request) %} - {{ editable(none, editable_object.relative_resource_path, editable_object.full_resource_path, editable_object, has_permission) }} + {% set editable_object = resolve_editable_from_path(full_resource_path, context_variables, request) %} + {{ editable(none, editable_object.relative_resource_path, editable_object.full_resource_path, editable_object, has_permission) }} {% endmacro %} {% macro editable(obj, relative_resource_path, full_resource_path, editable_object, has_permission) %} - {% if is_parent_editable(editables, full_resource_path) %} - {% if editable_object is none %} - {% set editable_object = editables[replace_digits_in_brackets(full_resource_path)] %} - {% endif %} - {% if has_permission %} -
- {% else %} -
- {% endif %} - {% if editable_object.children is not none and editable_object.children | length > 0 %} - {% for child_editable in editable_object.children %} - {{ render_attribute(child_editable.last_path_item() ) }}: - {{ display_value(child_editable.last_path_item() , nested_value(obj, resolve_resource_list_path(full_resource_path, child_editable.relative_resource_path))) }} - {% if not loop.last %}
{% endif %} - {% endfor %} - {% else %} - {{ nested_value(obj, relative_resource_path) | safe }} - {% endif %} - {% if has_permission %}{{ edit_link(base_href, full_resource_path) }}{% endif %} -
- {% else %} - {% if has_permission %} -
- {% else %} -
- {% endif %} - {% if editable_object is not none %} - {% set value = editable_object.value %} - {% else %} - {% set value = nested_value(obj, relative_resource_path) %} - {% endif %} - {% set key = relative_resource_path.split("/")[-1] %} - {% if is_nested_enum(obj, relative_resource_path) %} - - - {{ nested_enum_value(obj, relative_resource_path, language).display_value | safe }} - - {% if has_permission %}{{ edit_link(base_href, full_resource_path) }}{% endif %} - {% else %} - {{ display_value(key, value) }} - {% if has_permission %}{{ edit_link(base_href, full_resource_path) }}{% endif %} - {% endif %} -
- {% endif %} - {% endmacro %} - {% macro display_value(key, value) %} - {% if isinstance(value, 'WebFormOption') %} - {% set value = value.display_value %} - {% endif %} - {% if key == "uri" or key == "link" or key == "upl" %} - {{ value }} - {% elif key == "oin" %} - {{ value }} - {% elif key == "email" %} - {{ value }} - {% elif key == "urn" %} - {{ value }} - {% elif value is string and value.startswith('http') %} - {{ value }} - {% elif value is iterable and value is not string %} - {{ value|join(", ") }} - {% else %} - {{ value }} - {% endif %} - {% endmacro %} - {% macro edit_link(base_href, full_resource_path) %} - - - {% trans %}Edit{% endtrans %} - + {% if is_parent_editable(editables, full_resource_path) %} + {% if editable_object is none %} + {% set editable_object = editables[replace_digits_in_brackets(full_resource_path)] %} + {% endif %} + {% if has_permission %} +
+ {% else %} +
+ {% endif %} + {% if editable_object.children is not none and editable_object.children | length > 0 %} + {% for child_editable in editable_object.children %} + {{ render_attribute(child_editable.last_path_item()) }}: + {{ display_value(child_editable.last_path_item() , nested_value(obj, resolve_resource_list_path(full_resource_path, child_editable.relative_resource_path))) }} + {% if not loop.last %}
{% endif %} + {% endfor %} + {% else %} + {{ nested_value(obj, relative_resource_path) | safe }} + {% endif %} + {% if has_permission %}{{ edit_link(base_href, full_resource_path) }}{% endif %} +
+ {% else %} + {% if has_permission %} +
+ {% else %} +
+ {% endif %} + {% if editable_object is not none %} + {% set value = editable_object.value %} + {% else %} + {% set value = nested_value(obj, relative_resource_path) %} + {% endif %} + {% set key = relative_resource_path.split("/")[-1] %} + {% if is_nested_enum(obj, relative_resource_path) %} + + + {{ nested_enum_value(obj, relative_resource_path, language).display_value | safe }} + + {% if has_permission %}{{ edit_link(base_href, full_resource_path) }}{% endif %} + {% else %} + {{ display_value(key, value) }} + {% if has_permission %}{{ edit_link(base_href, full_resource_path) }}{% endif %} + {% endif %} +
+ {% endif %} +{% endmacro %} +{% macro display_value(key, value) %} + {% if isinstance(value, 'WebFormOption') %} + {% set value = value.display_value %} + {% endif %} + {% if key == "uri" or key == "link" or key == "upl" %} + {{ value }} + {% elif key == "oin" %} + {{ value }} + {% elif key == "email" %} + {{ value }} + {% elif key == "urn" %} + {{ value }} + {% elif value is string and value.startswith('http') %} + {{ value }} + {% elif value is iterable and value is not string %} + {{ value|join(", ") }} + {% else %} + {{ value }} + {% endif %} +{% endmacro %} +{% macro edit_link(base_href, full_resource_path) %} + + + {% trans %}Edit{% endtrans %} + {% endmacro %} {% macro edit(editable_object) %} - -
- -
- {% if editable_object.implementation_type.type is none %} - {# TODO: hardcoded check could be made more elegant #} - {% if editable_object.last_path_item() == "ai_act_profile" %}{{ show_ai_act_button() }}{% endif %} -
- {% for child_editable in editable_object.children %} -
-
- {{ render_attribute(child_editable.last_path_item() ) }}: -
- {{ inline_editor_form_field(child_editable) }} -
- {% endfor %} -
-
- {{ inline_editor_form_buttons(editable_object.full_resource_path) }} -
- {% elif editable_object.implementation_type.type == WebFormFieldType.TEXTAREA %} -
- {{ inline_editor_form_field(editable_object) }} -
- {{ inline_editor_form_buttons(editable_object.full_resource_path) }} -
- {% else %} -
- {# #TODO: figure out how to display fields inline or block-wise #} - {% if editable_object.relative_resource_path == "role_id" %} -
{{ inline_editor_form_field(editable_object) }}
-
{{ inline_editor_form_buttons(editable_object.full_resource_path) }}
- {% else %} -
- {{ inline_editor_form_field(editable_object) }} -
{{ inline_editor_form_buttons(editable_object.full_resource_path) }}
-
- {% endif %} - {% endif %} + + + +
+ {% if editable_object.implementation_type.type is none %} + {# TODO: hardcoded check could be made more elegant #} + {% if editable_object.last_path_item() == "ai_act_profile" %}{{ show_ai_act_button() }}{% endif %} +
+ {% for child_editable in editable_object.children %} +
+
+ {{ render_attribute(child_editable.last_path_item()) }}: +
+ {{ inline_editor_form_field(child_editable) }} +
+ {% endfor %} +
+
+ {{ inline_editor_form_buttons(editable_object.full_resource_path) }} +
+ {% elif editable_object.implementation_type.type == WebFormFieldType.TEXTAREA %} +
+ {{ inline_editor_form_field(editable_object) }} +
+ {{ inline_editor_form_buttons(editable_object.full_resource_path) }} +
+ {% else %} +
+ {# #TODO: figure out how to display fields inline or block-wise #} + {% if editable_object.relative_resource_path == "role_id" %} +
{{ inline_editor_form_field(editable_object) }}
+
{{ inline_editor_form_buttons(editable_object.full_resource_path) }}
+ {% else %} +
+ {{ inline_editor_form_field(editable_object) }} +
{{ inline_editor_form_buttons(editable_object.full_resource_path) }}
- - {# we need the errorContainer to keep htmx happy, but we hide the contents #} - - + {% endif %} + {% endif %} +
+ + {# we need the errorContainer to keep htmx happy, but we hide the contents #} + +
{% endmacro %} {% macro inline_editor_form_field(editable_object, field_prefix = None) %} - {% if field_prefix is not none %} - {% set field_name = field_prefix + "[" + editable_object.last_path_item() + "]" %} - {% else %} - {% set field_name = editable_object.last_path_item() %} - {% endif %} - {% if editable_object.implementation_type.type != WebFormFieldType.HIDDEN %} -
- {% endif %} - {% if editable_object.implementation_type.type == WebFormFieldType.TEXTAREA %} - - - {% elif editable_object.implementation_type.type == WebFormFieldType.SELECT %} -
- -
- {% elif is_nested_enum(editable_object.resource_object, editable_object.relative_resource_path) %} - {% set value = nested_value(editable_object.resource_object, editable_object.relative_resource_path) %} -
- -
- {% elif editable_object.implementation_type.type == WebFormFieldType.DATE %} - - {% elif editable_object.implementation_type.type == WebFormFieldType.CHECKBOX_MULTIPLE %} -
- {% set value = nested_value(editable_object.resource_object, editable_object.relative_resource_path) %} - {% for option in editable_object.form_options %} -
- -
- {% endfor %} -
- {% elif editable_object.implementation_type.type == WebFormFieldType.PRE_CHOSEN %} -
- {{ editable_object.value.display_value }} - -
- {% elif editable_object.implementation_type.type == WebFormFieldType.HIDDEN %} - - {% else %} - + {% endif %} + {% if editable_object.implementation_type.type == WebFormFieldType.TEXTAREA %} + + + {% elif editable_object.implementation_type.type == WebFormFieldType.SELECT %} +
+ +
+ {% elif is_nested_enum(editable_object.resource_object, editable_object.relative_resource_path) %} + {% set value = nested_value(editable_object.resource_object, editable_object.relative_resource_path) %} +
+ +
+ {% elif editable_object.implementation_type.type == WebFormFieldType.DATE %} + + {% elif editable_object.implementation_type.type == WebFormFieldType.CHECKBOX_MULTIPLE %} +
+ {% set value = nested_value(editable_object.resource_object, editable_object.relative_resource_path) %} + {% for option in editable_object.form_options %} +
+
{% endif %} + class="rvo-checkbox__input" + type="checkbox" + {% if option.value is equal_or_includes(value) %}checked="checked"{% endif %} + value="{{ option.value }}" /> + {{ option.display_value | safe }} + +
+ {% endfor %} +
+ {% elif editable_object.implementation_type.type == WebFormFieldType.PRE_CHOSEN %} +
+ {{ editable_object.value.display_value }} + +
+ {% elif editable_object.implementation_type.type == WebFormFieldType.HIDDEN %} + + {% else %} + + {% endif %} + {% if editable_object.implementation_type.type != WebFormFieldType.HIDDEN %}
{% endif %} {% endmacro %} {% macro inline_editor_form_buttons(full_resource_path) %} - - + + {% endmacro %} diff --git a/amt/site/templates/macros/form_macros.html.j2 b/amt/site/templates/macros/form_macros.html.j2 index d791795d..475b031f 100644 --- a/amt/site/templates/macros/form_macros.html.j2 +++ b/amt/site/templates/macros/form_macros.html.j2 @@ -1,495 +1,449 @@ {% import "macros/editable_macros.html.j2" as editable_macro with context %} {% macro user_avatars(users) %} - {% if users|length > 0 %} -
- {# this solution is not very elegant, a limit and count query would be better #} - {% for user in users[0:5] %} - - User icon {{ user.name }} - {{ user.name }} - - {% endfor %} - {% if users|length > 5 %} - - +{{ users|length - 5 }} - - {% endif %} -
- {% endif %} + {% if users|length > 0 %} +
+ {# this solution is not very elegant, a limit and count query would be better #} + {% for user in users[0:5] %} + + User icon {{ user.name }} + {{ user.name }} + + {% endfor %} + {% if users|length > 5 %} + + +{{ users|length - 5 }} + + {% endif %} +
+ {% endif %} {% endmacro %} {% macro form_field(form, field) %} - {% if field.type == WebFormFieldType.TEXT %} - {{ form_field_text(form, field) }} - {% elif field.type == WebFormFieldType.FILE %} - {{ form_field_file(form, field) }} - {% elif field.type == WebFormFieldType.TEXT_CLONEABLE %} - {{ form_field_text_cloneable(form, field) }} - {% elif field.type == WebFormFieldType.TEXTAREA %} - {{ form_field_textarea(form, field) }} - {% elif field.type == WebFormFieldType.SELECT %} - {{ form_field_select(form, field) }} - {% elif field.type == WebFormFieldType.SEARCH_SELECT %} - {{ form_field_search(form, field) }} - {% elif field.type == WebFormFieldType.SUBMIT %} - {{ form_field_submit(form, field) }} - {% else %} - Unknown field {{ field.type }} - {% endif %} + {% if field.type == WebFormFieldType.TEXT %} + {{ form_field_text(form, field) }} + {% elif field.type == WebFormFieldType.FILE %} + {{ form_field_file(form, field) }} + {% elif field.type == WebFormFieldType.TEXT_CLONEABLE %} + {{ form_field_text_cloneable(form, field) }} + {% elif field.type == WebFormFieldType.TEXTAREA %} + {{ form_field_textarea(form, field) }} + {% elif field.type == WebFormFieldType.SELECT %} + {{ form_field_select(form, field) }} + {% elif field.type == WebFormFieldType.SEARCH_SELECT %} + {{ form_field_search(form, field) }} + {% elif field.type == WebFormFieldType.SUBMIT %} + {{ form_field_submit(form, field) }} + {% else %} + Unknown field {{ field.type }} + {% endif %} {% endmacro %} {% macro overview_table_row(loop, organization) -%} - - - {{ organization.name }} - - {{ user_avatars(organization.users) }} - {{ organization.modified_at | time_ago(language) }} - + + + {{ organization.name }} + + {{ user_avatars(organization.users) }} + {{ organization.modified_at | time_ago(language) }} + {% endmacro %} {% macro overview_table_row_member(loop, user, authorization, role, permission_path) -%} - - - - User icon {{ user.name }} - - {{ user.name }} - - - {% if permission(permission_path, 'Update', permissions) == True %} - {{ editable_macro.editable_from_path("authorization/" + authorization.id|string + "/role_id", {"authorization_id": authorization.id}, True) }} - {% else %} - {{ ExternalFieldsTranslations.translate(role.name, request) }} - {% endif %} - - {% if permission(permission_path, 'Update', permissions) == True %} - - - - {% trans %}Delete{% endtrans %} - - -{% endif %} - + + + + User icon {{ user.name }} + + {{ user.name }} + + + {% if permission(permission_path, 'Update', permissions) == True %} + {{ editable_macro.editable_from_path("authorization/" + authorization.id|string + "/role_id", {"authorization_id": authorization.id}, True) }} + {% else %} + {{ ExternalFieldsTranslations.translate(role.name, request) }} + {% endif %} + + {% if permission(permission_path, 'Update', permissions) == True %} + + + + {% trans %}Delete{% endtrans %} + + + {% endif %} + {% endmacro %} {% macro render_form_field_search_result(editable_object) -%} - {% set list_result = render_form_field_list_result(editable_object) %} - {% set value = editable_object.children[0].value.value %} - {% set display_value = editable_object.children[0].value.display_value %} -
  • - {{ display_value }} -
  • + {% set list_result = render_form_field_list_result(editable_object) %} + {% set value = editable_object.children[0].value.value %} + {% set display_value = editable_object.children[0].value.display_value %} +
  • + {{ display_value }} +
  • {% endmacro %} {% macro render_form_field_list_result(editable_object) -%} - - {% set field_prefix = editable_object.first_path_item() + "[" + get_random_number() + "]" %} - {% for child_editable in editable_object.children %} - {% if child_editable.implementation_type.type != WebFormFieldType.HIDDEN %} - {{ editable_macro.inline_editor_form_field(child_editable, field_prefix) }} - {% else %} - {{ editable_macro.inline_editor_form_field(child_editable, field_prefix) }} - {% endif %} - {% endfor %} - - - - {% trans %}Delete{% endtrans %} - - - + + {% set field_prefix = editable_object.first_path_item() + "[" + get_random_number() + "]" %} + {% for child_editable in editable_object.children %} + {% if child_editable.implementation_type.type != WebFormFieldType.HIDDEN %} + {{ editable_macro.inline_editor_form_field(child_editable, field_prefix) }} + {% else %} + {{ editable_macro.inline_editor_form_field(child_editable, field_prefix) }} + {% endif %} + {% endfor %} + + + + {% trans %}Delete{% endtrans %} + + + {% endmacro %} {% macro form_field_select(prefix, field) %} -
    -
    - - {% if field.description %} -
    {{ field.description }}
    - {% endif %} -
    -
    - {% if field.options | length == 1 and field.no_options_msg %} -
    {{ show_form_warning(field.no_options_msg) }}
    - {% endif %} -
    - -
    +
    +
    + + {% if field.description %} +
    {{ field.description }}
    + {% endif %} +
    +
    + {% if field.options | length == 1 and field.no_options_msg %} +
    {{ show_form_warning(field.no_options_msg) }}
    + {% endif %} +
    +
    +
    {% endmacro %} {% macro show_form_warning(msg) %} - {% endmacro %} {% macro form_field_file(prefix, field) %} -
    +
    +
    + + {% if field.description %}
    {{ field.description }}
    {% endif %} +
    +
    + + {% if field.default_value %} +
    - - {% if field.description %}
    {{ field.description }}
    {% endif %} -
    -
    - - {% if field.default_value %} -
    -
    -
      - {% for ulid, file in field.default_value %} -
    -
    -
    -{% endif %} -
    + +
    +
    + {% endif %} +
    {% endmacro %} {% macro form_field_text(prefix, field) %} -
    -
    - - {% if field.description %}
    {{ field.description }}
    {% endif %} -
    -
    - +
    +
    + + {% if field.description %}
    {{ field.description }}
    {% endif %}
    +
    + +
    {% endmacro %} {% macro form_field_text_cloneable(prefix, field) %} -
    -
    - - {% if field.description %}
    {{ field.description }}
    {% endif %} -
    -
    -
    - {% if isinstance(field.default_value, 'list') and field.default_value %} - {% for value in field.default_value %} -
    -
    - - - - -
    -
    - {% endfor %} - {% else %} -
    -
    - - - - -
    -
    - {% endif %} - +
    +
    + + {% if field.description %}
    {{ field.description }}
    {% endif %} +
    +
    +
    + {% if isinstance(field.default_value, 'list') and field.default_value %} + {% for value in field.default_value %} +
    +
    + + + + +
    +
    + {% endfor %} + {% else %} +
    +
    + + + + +
    -
    - - {{ field.clone_button_name }} + {% endif %} + +
    +
    + + {{ field.clone_button_name }}
    +
    {% endmacro %} {% macro form_field_textarea(prefix, field) %} -
    -
    - - {% if field.description %}
    {{ field.description }}
    {% endif %} -
    -
    -
    - - {# TODO: Fix when we upgrade to higher @nl-rvo npm package #} - {# {% trans %}Still{% endtrans %} 300 {% trans %}Characters remaining{% endtrans %}#} -
    -
    +
    +
    + + {% if field.description %}
    {{ field.description }}
    {% endif %} +
    +
    +
    + + {# TODO: Fix when we upgrade to higher @nl-rvo npm package #} + {# {% trans %}Still{% endtrans %} 300 {% trans %}Characters remaining{% endtrans %}#} +
    +
    {% endmacro %} {% macro form_field_search(prefix, field) %} -
    -
    - - {% if field.description %}
    {{ field.description }}
    {% endif %} -
    -
    -
    - - -
    - - - - - - - - - - {% if field.default_value %}{{ render_form_field_list_result(field.default_value) }}{% endif %} - -
    {% trans %}Name{% endtrans %}{% trans %}Role{% endtrans %}{% trans %}Options{% endtrans %}
    -
    +
    +
    + + {% if field.description %}
    {{ field.description }}
    {% endif %} +
    +
    +
    + + +
    + + + + + + + + + + {% if field.default_value %}{{ render_form_field_list_result(field.default_value) }}{% endif %} + +
    {% trans %}Name{% endtrans %}{% trans %}Role{% endtrans %}{% trans %}Options{% endtrans %}
    +
    {% endmacro %} {% macro form_field_submit(form, field) %} -
    -

    - -

    +
    +

    + +

    {% endmacro %} {% macro add_form(form) %} -
    - {% set vars = {'last_group': '', 'fieldset_closed': False} %} - {% for field in form.fields %} - {% if vars.last_group != "" and vars.last_group != field.group %} - {% if vars.update({'fieldset_closed': True}) %}{% endif %} - + + {% set vars = {'last_group': '', 'fieldset_closed': False} %} + {% for field in form.fields %} + {% if vars.last_group != "" and vars.last_group != field.group %} + {% if vars.update({'fieldset_closed': True}) %}{% endif %} +
    - {% endif %} - {% if vars.last_group == "" or vars.last_group != field.group %} + {% endif %} + {% if vars.last_group == "" or vars.last_group != field.group %} {% if vars.update({'fieldset_closed': False}) %}{% endif %}
    -
    - {% if form.legend %} - {{ form.legend }} - {% endif %} +
    + {% if form.legend %} + {{ form.legend }} {% endif %} - {{ form_field(form.id, field) }} - {% if vars.update({'last_group': field.group}) %}{% endif %} - {% endfor %} - {% if not vars.fieldset_closed %} -
    -
    -{% endif %} - + {% endif %} + {{ form_field(form.id, field) }} + {% if vars.update({'last_group': field.group}) %}{% endif %} + {% endfor %} + {% if not vars.fieldset_closed %} + +
    + {% endif %} + {% endmacro %} diff --git a/amt/site/templates/macros/table_row.html.j2 b/amt/site/templates/macros/table_row.html.j2 index b5bea78c..0a4f72cd 100644 --- a/amt/site/templates/macros/table_row.html.j2 +++ b/amt/site/templates/macros/table_row.html.j2 @@ -1,45 +1,45 @@ {% macro item(loop, algorithm, show_lifecycles) -%} - - {% if show_lifecycles %} - - {% else %} - - {% endif %} - {{ algorithm.name }} - - {% if show_lifecycles %} - - {{ algorithm.lifecycle.display_value | safe }} - - {% endif %} - - {{ algorithm.last_edited | time_ago(language) }} - {% trans %} ago{% endtrans %} - - + + {% if show_lifecycles %} + + {% else %} + + {% endif %} + {{ algorithm.name }} + + {% if show_lifecycles %} + + {{ algorithm.lifecycle.display_value | safe }} + + {% endif %} + + {{ algorithm.last_edited | time_ago(language) }} + {% trans %} ago{% endtrans %} + + {% endmacro %} {% macro sort_button(field_name, sort_by, base_url) %} - {% if field_name in sort_by and sort_by[field_name] == "ascending" or (not field_name in sort_by) %} - - {% elif field_name in sort_by and sort_by[field_name] == "descending" %} - - {% endif %} + {% if field_name in sort_by and sort_by[field_name] == "ascending" or (not field_name in sort_by) %} + + {% elif field_name in sort_by and sort_by[field_name] == "descending" %} + + {% endif %} {% endmacro %} diff --git a/amt/site/templates/macros/tabs.html.j2 b/amt/site/templates/macros/tabs.html.j2 index 05789d20..94c499d0 100644 --- a/amt/site/templates/macros/tabs.html.j2 +++ b/amt/site/templates/macros/tabs.html.j2 @@ -1,46 +1,46 @@ {% macro show_tabs(tab_items) %} -
    - -
    +
    + +
    {% endmacro %} {% macro show_algorithm_header() %} -
    -
    -

    {{ algorithm.name }}

    -
    - - {% if permission("algorithm/" ~ algorithm.id, 'Delete', permissions) == True %} - - - - {% endif %} +
    +
    +

    {{ algorithm.name }}

    +
    + + {% if permission("algorithm/" ~ algorithm.id, 'Delete', permissions) == True %} + + + + {% endif %} +
    -
    +
    {% endmacro %} diff --git a/amt/site/templates/macros/tasks.html.j2 b/amt/site/templates/macros/tasks.html.j2 index 9453d1c3..7b58b3f0 100644 --- a/amt/site/templates/macros/tasks.html.j2 +++ b/amt/site/templates/macros/tasks.html.j2 @@ -1,113 +1,113 @@ {% import "macros/form_macros.html.j2" as macros with context %} {% macro column(algorithm, status, translations, tasks_service) -%} -
    -
    - {# code below is not nice, sorry, there doesn't seem to be a better way though #} - {% if status == 1 %} - - {% elif status == 2 %} -
    - - {% trans %}In progress{% endtrans %} +
    +
    + {# code below is not nice, sorry, there doesn't seem to be a better way though #} + {% if status == 1 %} + - {% elif status == 3 %} + {% elif status == 2 %} -{% elif status == 4 %} - -{% elif status == 5 %} - -{% else %} -{% trans %}Unknown{% endtrans %} -{% endif %} -
    -{% if permission(permission_path, 'Update', permissions) == True %} - {% set column_class = "progress-cards-container sortable" %} -{% else %} - {% set column_class = "progress-cards-container" %} -{% endif %} -
    - {% if algorithm is defined %} - {% for task in tasks_by_status[status] %}{{ render_task_card_full(task) }}{% endfor %} + + {% trans %}In progress{% endtrans %} +
    + {% elif status == 3 %} + + {% elif status == 4 %} + + {% elif status == 5 %} + + {% else %} + {% trans %}Unknown{% endtrans %} + {% endif %} +
    + {% if permission(permission_path, 'Update', permissions) == True %} + {% set column_class = "progress-cards-container sortable" %} {% else %} - {% for task in tasks_by_status[status] %}{{ render_task_card_full(task) }}{% endfor %} + {% set column_class = "progress-cards-container" %} {% endif %} -
    -
    +
    + {% if algorithm is defined %} + {% for task in tasks_by_status[status] %}{{ render_task_card_full(task) }}{% endfor %} + {% else %} + {% for task in tasks_by_status[status] %}{{ render_task_card_full(task) }}{% endfor %} + {% endif %} +
    +
    {% endmacro -%} {% macro render_task_card_full(task) -%} -
    {{ render_task_card_content(algorithm_id, task) }}
    +
    {{ render_task_card_content(algorithm_id, task) }}
    {% endmacro %} {% macro render_task_card_content(algorithm_id, task) -%} -
    -
    - {{ task.title | truncate(100) }} - {% if hasattr(task, "type_object") and task.type == "measure" %} -
    -
    - {% for lifecycle in task.type_object.lifecycle %} - - - {{ get_localized_value("lifecycle", lifecycle, request).display_value | safe }} - - {% endfor %} -
    -
    - {% if hasattr(task, "type_object.users") and task.type_object.users | length > 0 %} - {{ macros.user_avatars(task.type_object.users) }} - {% endif %} - {% if permission(permission_path, 'Update', permissions) == True %} -
    - - - -
    - {% endif %} -
    +
    +
    + {{ task.title | truncate(100) }} + {% if hasattr(task, "type_object") and task.type == "measure" %} +
    +
    + {% for lifecycle in task.type_object.lifecycle %} + + + {{ get_localized_value("lifecycle", lifecycle, request).display_value | safe }} + + {% endfor %} +
    +
    + {% if hasattr(task, "type_object.users") and task.type_object.users | length > 0 %} + {{ macros.user_avatars(task.type_object.users) }} + {% endif %} + {% if permission(permission_path, 'Update', permissions) == True %} +
    + + + +
    + {% endif %} +
    - {% endif %} -
    -
    + {% endif %} +
    +
    {% endmacro %} diff --git a/amt/site/templates/organizations/algorithms.html.j2 b/amt/site/templates/organizations/algorithms.html.j2 index 6a34d000..78cbcdc0 100644 --- a/amt/site/templates/organizations/algorithms.html.j2 +++ b/amt/site/templates/organizations/algorithms.html.j2 @@ -2,9 +2,9 @@ {% import "macros/tabs.html.j2" as tabs with context %} {% extends "layouts/base.html.j2" %} {% block content %} -
    - {{ tabs.show_tabs(tab_items) }} -
    {% include 'parts/algorithm_search.html.j2' %}
    -
    +
    + {{ tabs.show_tabs(tab_items) }} +
    {% include 'parts/algorithm_search.html.j2' %}
    +
    {% endblock content %} diff --git a/amt/site/templates/organizations/home.html.j2 b/amt/site/templates/organizations/home.html.j2 index d5ce495b..82b46d0f 100644 --- a/amt/site/templates/organizations/home.html.j2 +++ b/amt/site/templates/organizations/home.html.j2 @@ -3,43 +3,43 @@ {% import "macros/form_macros.html.j2" as macros with context %} {% import "macros/tabs.html.j2" as tabs with context %} {% block content %} -
    - {{ tabs.show_tabs(tab_items) }} -

    {% trans %}Info{% endtrans %}

    +
    + {{ tabs.show_tabs(tab_items) }} +

    {% trans %}Info{% endtrans %}

    {% set has_permission = permission("organization/" ~ organization_id, 'Update', permissions) %}
    - - - - - - - - +
    {% trans %}Name{% endtrans %} - {{ editable(organization, "name", "organization/" + organization_id|string + "/name", None, has_permission) }} -
    {% trans %}Slug{% endtrans %}
    + + + - - + + + + + + - - - - - - - - - - - - - - - -
    {% trans %}Name{% endtrans %} - {{ editable(organization, "slug", "organization/" + organization_id|string + "/slug", None, has_permission) }} + {{ editable(organization, "name", "organization/" + organization_id|string + "/name", None, has_permission) }}
    {% trans %}Slug{% endtrans %} + {{ editable(organization, "slug", "organization/" + organization_id|string + "/slug", None, has_permission) }} +
    {% trans %}Created at{% endtrans %}{{ organization.created_at|format_datetime(language) }}
    {% trans %}Created by{% endtrans %}{{ organization.created_by.name }}
    {% trans %}Modified at{% endtrans %}{{ organization.modified_at|format_datetime(language) }}
    {% trans %}Members{% endtrans %}{{ macros.user_avatars(organization.users) }}
    -
    -
    + {{ organization.created_at|format_datetime(language) }} + + + {% trans %}Created by{% endtrans %} + {{ organization.created_by.name }} + + + {% trans %}Modified at{% endtrans %} + {{ organization.modified_at|format_datetime(language) }} + + + {% trans %}Members{% endtrans %} + {{ macros.user_avatars(organization.users) }} + + + +
    +
    {% endblock %} diff --git a/amt/site/templates/organizations/index.html.j2 b/amt/site/templates/organizations/index.html.j2 index 2600a39f..b5c3d768 100644 --- a/amt/site/templates/organizations/index.html.j2 +++ b/amt/site/templates/organizations/index.html.j2 @@ -1,8 +1,8 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
    -
    - {% include 'organizations/parts/overview_results.html.j2' %} -
    +
    +
    + {% include 'organizations/parts/overview_results.html.j2' %}
    +
    {% endblock %} diff --git a/amt/site/templates/organizations/members.html.j2 b/amt/site/templates/organizations/members.html.j2 index 0d367690..fe6bb62d 100644 --- a/amt/site/templates/organizations/members.html.j2 +++ b/amt/site/templates/organizations/members.html.j2 @@ -2,43 +2,43 @@ {% import "macros/tabs.html.j2" as tabs with context %} {% extends "layouts/base.html.j2" %} {% block content %} -
    - {% if algorithm is defined %}{{ tabs.show_algorithm_header() }}{% endif %} - {{ tabs.show_tabs(tab_items) }} -
    - {% include 'organizations/parts/members_results.html.j2' %} -
    +
    + {% if algorithm is defined %}{{ tabs.show_algorithm_header() }}{% endif %} + {{ tabs.show_tabs(tab_items) }} +
    + {% include 'organizations/parts/members_results.html.j2' %}
    - {% endblock content %} diff --git a/amt/site/templates/organizations/new.html.j2 b/amt/site/templates/organizations/new.html.j2 index e114b54c..28bb88c5 100644 --- a/amt/site/templates/organizations/new.html.j2 +++ b/amt/site/templates/organizations/new.html.j2 @@ -1,14 +1,14 @@ {% import "macros/form_macros.html.j2" as macros with context %} {% extends "layouts/base.html.j2" %} {% block content %} -
    -
    -
    -
    -

    {% trans %}Create an organization{% endtrans %}

    -
    - {{ macros.add_form(form) }} +
    +
    +
    +
    +

    {% trans %}Create an organization{% endtrans %}

    + {{ macros.add_form(form) }} +
    -
    +
    {% endblock content %} diff --git a/amt/site/templates/organizations/parts/add_members_modal.html.j2 b/amt/site/templates/organizations/parts/add_members_modal.html.j2 index 49ed45ff..3a294b57 100644 --- a/amt/site/templates/organizations/parts/add_members_modal.html.j2 +++ b/amt/site/templates/organizations/parts/add_members_modal.html.j2 @@ -1,29 +1,29 @@ {% import "macros/form_macros.html.j2" as macros with context %}
    -
    -

    {% trans %}Add members{% endtrans %}

    -
    - -
    +
    +

    {% trans %}Add members{% endtrans %}

    +
    + +
    {{ macros.form_field(form.id, form.fields[2]) }}

    - - -

    -
    + + +

    +
    diff --git a/amt/site/templates/organizations/parts/members_results.html.j2 b/amt/site/templates/organizations/parts/members_results.html.j2 index 0b78ea84..d829896c 100644 --- a/amt/site/templates/organizations/parts/members_results.html.j2 +++ b/amt/site/templates/organizations/parts/members_results.html.j2 @@ -1,150 +1,150 @@ {% import "macros/table_row.html.j2" as table_row with context %} {% import "macros/form_macros.html.j2" as macros with context %} {% if include_filters %} -
    -
    -

    {% trans %}Members{% endtrans %}

    +
    +
    +

    {% trans %}Members{% endtrans %}

    {% if permission(permission_path, 'Update', permissions) == True %} -
    - +
    + {% endif %} -
    -
    -{% if 1 == 0 %} +
    +
    + {% if 1 == 0 %} {# disabled search on request from Ruben #}
    -
    -
    -
    -
    -
    -
    -
    {% trans %}Search{% endtrans %}
    -
    - - -
    -
    -
    +
    +
    +
    +
    +
    +
    +
    {% trans %}Search{% endtrans %}
    +
    + + +
    +
    +
    -
    - -{% endif %} +
    + + {% endif %} {% endif %} {% if start > 0 %} - {% for user, authorization, role, _ in members %} - {{ macros.overview_table_row_member(loop, user, authorization, role, permission_path) }} - {% endfor %} + {% for user, authorization, role, _ in members %} + {{ macros.overview_table_row_member(loop, user, authorization, role, permission_path) }} + {% endfor %} {% else %} -
    -
    -
    - - {% trans members_length %}{{ members_length }} result - {% pluralize %} - {{ members_length }} results{% endtrans %} - - {% if search or filters %} - {% trans %}for{% endtrans %} - {% if search %}'{{ search }}'{% endif %} - {% endif %} -
    - - {% for key, localized_value in filters.items() %} - - - {{ localized_value.display_value | safe }} - - - {% endfor %} -
    -
    -
    -
    +
    +
    +
    + + {% trans members_length %}{{ members_length }} result +{% pluralize %} + {{ members_length }} results{% endtrans %} + + {% if search or filters %} + {% trans %}for{% endtrans %} + {% if search %}'{{ search }}'{% endif %} + {% endif %} + {% for key, localized_value in filters.items() %} + + + {{ localized_value.display_value | safe }} + + {% endfor %} + +
    +
    +
    + + {% for key, localized_value in filters.items() %} + {% endfor %} {% if members|length > 0 %} - - - {% if permission(permission_path, 'Update', permissions) == True %} - - - - {% else %} - - - {% endif %} - - - - - +
    - {% trans %}Name{% endtrans %} - {{ table_row.sort_button('name', sort_by, base_href + "/members") }} - {% trans %}Role{% endtrans %}
    + + {% if permission(permission_path, 'Update', permissions) == True %} + + + + {% else %} + + + {% endif %} + + + + + {% if permission(permission_path, 'Update', permissions) == True %} - - {% endif %} - - - - {% for user, authorization, role, _ in members %} - {{ macros.overview_table_row_member(loop, user, authorization, role, permission_path) }} - {% endfor %} - -
    + {% trans %}Name{% endtrans %} + {{ table_row.sort_button('name', sort_by, base_href + "/members") }} + {% trans %}Role{% endtrans %}{# {% trans %}Action{% endtrans %}#}
    -{% endif %} -
    -
    + {# {% trans %}Action{% endtrans %}#} + {% endif %} + + + + {% for user, authorization, role, _ in members %} + {{ macros.overview_table_row_member(loop, user, authorization, role, permission_path) }} + {% endfor %} + + + {% endif %} + +
    {% endif %} diff --git a/amt/site/templates/organizations/parts/overview_results.html.j2 b/amt/site/templates/organizations/parts/overview_results.html.j2 index 01b856f3..46dfcf29 100644 --- a/amt/site/templates/organizations/parts/overview_results.html.j2 +++ b/amt/site/templates/organizations/parts/overview_results.html.j2 @@ -1,142 +1,140 @@ {% import "macros/table_row.html.j2" as table_row with context %} {% import "macros/form_macros.html.j2" as macros with context %} {% if include_filters %} -
    -
    -

    {% trans %}Organizations{% endtrans %}

    +
    +
    +

    {% trans %}Organizations{% endtrans %}

    -
    -
    + + + +
    +
    +
    -
    -
    -
    -
    -
    -
    {% trans %}Search{% endtrans %}
    -
    - - -
    -
    -
    -
    {% trans %}Organisation Type{% endtrans %}
    -
    - -
    +
    +
    +
    +
    +
    +
    {% trans %}Search{% endtrans %}
    +
    + + +
    +
    +
    +
    {% trans %}Organisation Type{% endtrans %}
    +
    +
    +
    +
    +
    -
    -
    - + {% endif %} {% if start > 0 %} - {% for organization in organizations %}{{ macros.overview_table_row(loop, organization) }}{% endfor %} + {% for organization in organizations %}{{ macros.overview_table_row(loop, organization) }}{% endfor %} {% else %} -
    -
    -
    - - {% trans organizations_length %}{{ organizations_length }} result - {% pluralize %} - {{ organizations_length }} results{% endtrans %} - - {% if search or filters %} - {% trans %}for{% endtrans %} - {% if search %}'{{ search }}'{% endif %} - {% endif %} -
    - - {% for key, localized_value in filters.items() %} - - - {{ localized_value.display_value | safe }} - - - {% endfor %} -
    -
    -
    -
    +
    +
    +
    + + {% trans organizations_length %}{{ organizations_length }} result +{% pluralize %} + {{ organizations_length }} results{% endtrans %} + + {% if search or filters %} + {% trans %}for{% endtrans %} + {% if search %}'{{ search }}'{% endif %} + {% endif %} + {% for key, localized_value in filters.items() %} + + + {{ localized_value.display_value | safe }} + + {% endfor %} + +
    +
    +
    + + {% for key, localized_value in filters.items() %} + {% endfor %} - - - - - + + + + - - -{% for organization in organizations %}{{ macros.overview_table_row(loop, organization) }}{% endfor %} -
    - {% trans %}Organization name{% endtrans %} - {{ table_row.sort_button('name', sort_by, "/organizations/") }} - {% trans %}Members{% endtrans %} +
    + {% trans %}Organization name{% endtrans %} + {{ table_row.sort_button('name', sort_by, "/organizations/") }} + {% trans %}Members{% endtrans %} {% trans %}Last updated{% endtrans %} - {{ table_row.sort_button('last_update', sort_by, "/organizations/") }} -
    -
    -
    + {{ table_row.sort_button('last_update', sort_by, "/organizations/") }} + + + + {% for organization in organizations %}{{ macros.overview_table_row(loop, organization) }}{% endfor %} + + +
    {% endif %} diff --git a/amt/site/templates/organizations/parts/search_select_field.html.j2 b/amt/site/templates/organizations/parts/search_select_field.html.j2 index bbda4213..513813a0 100644 --- a/amt/site/templates/organizations/parts/search_select_field.html.j2 +++ b/amt/site/templates/organizations/parts/search_select_field.html.j2 @@ -3,5 +3,5 @@
    - {% trans %}No persons found...{% endtrans %} + {% trans %}No persons found...{% endtrans %}
    diff --git a/amt/site/templates/pages/assessment_card.html.j2 b/amt/site/templates/pages/assessment_card.html.j2 index 9bfa7838..40a267dc 100644 --- a/amt/site/templates/pages/assessment_card.html.j2 +++ b/amt/site/templates/pages/assessment_card.html.j2 @@ -1,63 +1,63 @@ {% extends 'layouts/base.html.j2' %} {% import 'macros/cards.html.j2' as render with context %} {% block content %} -
    -
    -

    Assessment card

    - {% trans %}Last updated{% endtrans %}: {{ last_edited | time_ago(language) }} {% trans %}ago{% endtrans %} -
    +
    +
    +

    Assessment card

    + {% trans %}Last updated{% endtrans %}: {{ last_edited | time_ago(language) }} {% trans %}ago{% endtrans %} +
    - - - - - - - {% for key, value in assessment_card %} - {% if key != "contents" %} - + + + + + + + {% for key, value in assessment_card %} + {% if key != "contents" %} + - - + + {% endif %} - {% endfor %} - -
    {% trans %}Attribute{% endtrans %}{% trans %}Value{% endtrans %}
    {% trans %}Attribute{% endtrans %}{% trans %}Value{% endtrans %}
    - {{ key.capitalize().replace("_", " ") }} - - {{ render.render_value(key, value, 0, "algorithm/" + algorithm_id|string, "/system_card/assessments/FIXME") }} - + {{ key.capitalize().replace("_", " ") }} + + {{ render.render_value(key, value, 0, "algorithm/" + algorithm_id|string, "/system_card/assessments/FIXME") }} +
    -
    -

    Content

    -
    - + {% endfor %} + +
    +
    +

    Content

    +
    + - - + + - - -{% for content in assessment_card["contents"] %} - - - + + {% for content in assessment_card["contents"] %} + + + - + - - {% endfor %} - -
    {% trans %}Question{% endtrans %}
    {% trans %}Question{% endtrans %} {% trans %}Answer{% endtrans %}
    +
    {{ content["question"] }} - + {{ content["answer"] }} {% set keys = ["urn", "remarks", "authors", "timestamp"] %} {% set metadata = {} %} {% for key in keys %} - {% set _x = metadata.__setitem__(key, content[key]) %} + {% set _x = metadata.__setitem__(key, content[key]) %} {% endfor %} {{ render.render_value("",metadata,0, "algorithm/" + algorithm_id|string + "/FIXME", "/system_card/assessments/FIXME") }} -
    -
    -
    -
    + + + {% endfor %} + + +
    +
    +
    {% endblock %} diff --git a/amt/site/templates/pages/index.html.j2 b/amt/site/templates/pages/index.html.j2 index 9225515f..bd3b745f 100644 --- a/amt/site/templates/pages/index.html.j2 +++ b/amt/site/templates/pages/index.html.j2 @@ -1,12 +1,12 @@ {% extends "layouts/base.html.j2" %} {% block title %} - {% trans %}AMT Placeholder information pages{% endtrans %} + {% trans %}AMT Placeholder information pages{% endtrans %} {% endblock title %} {% block content %} -
    -
    -

    Pagina's

    -

    Op dit pad / in deze folder komen de informatieve pagina's zoals contact, disclaimer etc.

    -
    +
    +
    +

    Pagina's

    +

    Op dit pad / in deze folder komen de informatieve pagina's zoals contact, disclaimer etc.

    +
    {% endblock content %} diff --git a/amt/site/templates/pages/landingpage.html.j2 b/amt/site/templates/pages/landingpage.html.j2 index 97fe5eb0..457cd7eb 100644 --- a/amt/site/templates/pages/landingpage.html.j2 +++ b/amt/site/templates/pages/landingpage.html.j2 @@ -1,148 +1,148 @@ {% extends 'layouts/base.html.j2' %} {% block content %} -
    -
    - Hero image for Algorithm Management Toolkit -
    -
    -

    - {% trans %}Algorithm Management Toolkit{% endtrans %} -

    - {% trans %}Built for government, by government.{% endtrans %} - + -
    + +
    +
    +
    -
    -
    -
    -
    -

    - {% trans %}Get a grip on algorithms with the Algorithm Management Toolkit{% endtrans %} -

    -
    +
    +
    +
    +
    +

    + {% trans %}Get a grip on algorithms with the Algorithm Management Toolkit{% endtrans %} +

    -
    -
    - -
    -
    -
    - {% trans %}Risk management{% endtrans %} - - {% trans %}Identify, classify and manage risks of algorithms. Prevent unwanted outcomes and increase the reliability of AI applications in your organization.{% endtrans %} - -
    +
    +
    +
    + +
    +
    +
    + {% trans %}Risk management{% endtrans %} + + {% trans %}Identify, classify and manage risks of algorithms. Prevent unwanted outcomes and increase the reliability of AI applications in your organization.{% endtrans %} + +
    -
    - -
    +
    + +
    +
    +
    + {% trans %}Standardization & collaboration{% endtrans %} + + {% trans %}Work with standardized formats that prevent duplicate work and inefficiency. Bring data scientists, governance officers and policy together in one clear structure.{% endtrans %} + +
    +
    +
    + +
    +
    +
    + {% trans %}Everything in one place{% endtrans %} + + {% trans %}Manage, document and control all your algorithms centrally. No more scattered Excel files or loose notes. An overview for audits, accountability and collaboration.{% endtrans %} + +
    +
    +
    + +
    +
    +
    + {% trans %}Stepwise compliance with legislation{% endtrans %} + + {% trans %}Ensure compliance with AI laws like the AI Act and{% endtrans %} Algoritmekader. {% trans %} Quickly check which legal frameworks apply to you.{% endtrans %} + +
    +
    +
    + +
    + Placeholder afbeelding +
    + +
    +
    +
    + {% trans %}Transparency & accountability{% endtrans %} + + {% trans %}Easily meet internal requirements and legislation such as the Algorithm Framework and the AI Act. Generate uniform reports for auditors and administrators.{% endtrans %} + +
    +
    +
    + +
    -
    - {% trans %}Standardization & collaboration{% endtrans %} +
    + {% trans %}Document algorithms{% endtrans %} - {% trans %}Work with standardized formats that prevent duplicate work and inefficiency. Bring data scientists, governance officers and policy together in one clear structure.{% endtrans %} - + {% trans %}Record metadata, context and risks for each algorithm.{% endtrans %} + +
    +
    +
    +
    +
    - -
    -
    -
    - {% trans %}Everything in one place{% endtrans %} - - {% trans %}Manage, document and control all your algorithms centrally. No more scattered Excel files or loose notes. An overview for audits, accountability and collaboration.{% endtrans %} - -
    -
    -
    - -
    -
    -
    - {% trans %}Stepwise compliance with legislation{% endtrans %} - - {% trans %}Ensure compliance with AI laws like the AI Act and{% endtrans %} Algoritmekader. {% trans %} Quickly check which legal frameworks apply to you.{% endtrans %} - -
    -
    -
    - -
    - Placeholder afbeelding -
    - -
    -
    -
    - {% trans %}Transparency & accountability{% endtrans %} - - {% trans %}Easily meet internal requirements and legislation such as the Algorithm Framework and the AI Act. Generate uniform reports for auditors and administrators.{% endtrans %} - -
    -
    -
    - -
    -
    -
    - {% trans %}Document algorithms{% endtrans %} - - {% trans %}Record metadata, context and risks for each algorithm.{% endtrans %} - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +

    {% trans %}Start documenting your algorithms today{% endtrans %}

    -
    - +
    + {% trans %}Get started in 5 minutes with direct access via Single Sign On Rijk, Github or email{% endtrans %} - - - - {% trans %}Personal demo available{% endtrans %} - - - - {% trans %}Mail us:{% endtrans %} ai-validatie@minbzk.nl - - - - {% trans %}Checkout the user manual{% endtrans %} + + + {% trans %}Personal demo available{% endtrans %} + + + + {% trans %}Mail us:{% endtrans %} ai-validatie@minbzk.nl + + + + {% trans %}Checkout the user manual{% endtrans %} (PDF {% trans %}in Dutch{% endtrans %}) - -
    -
    -
    -
    + +
    +
    +
    +
    {% endblock %} diff --git a/amt/site/templates/pages/model_card.html.j2 b/amt/site/templates/pages/model_card.html.j2 index e01ca2f1..7d623b00 100644 --- a/amt/site/templates/pages/model_card.html.j2 +++ b/amt/site/templates/pages/model_card.html.j2 @@ -1,61 +1,61 @@ {% extends 'algorithms/details_base.html.j2' %} {% import 'macros/cards.html.j2' as render with context %} {% block detail_content %} -
    -

    Model card

    - {% trans %}Last updated{% endtrans %}: {{ last_edited | time_ago(language) }} +
    +

    Model card

    + {% trans %}Last updated{% endtrans %}: {{ last_edited | time_ago(language) }} {% trans %}ago{% endtrans %} -
    - +
    +
    - - + + - - -{% for key, value in model_card %} - {% if key != "model_index" %} - - + + + {% for key, value in model_card %} + {% if key != "model_index" %} + + {# TODO: the base path should be the name of the assessment probably.. like system_card/assessments/iama #} - - {% endif %} - {% endfor %} - -
    {% trans %}Attribute{% endtrans %}
    {% trans %}Attribute{% endtrans %} {% trans %}Value{% endtrans %}
    - {{ key.capitalize().replace("_", " ") }} + {{ key.capitalize().replace("_", " ") }} - {{ render.render_value(key, value, 0, "algorithm/" + algorithm_id|string + "/FIXME", "/system_card") }} + {{ render.render_value(key, value, 0, "algorithm/" + algorithm_id|string + "/FIXME", "/system_card") }}
    -
    -{% for model in model_card["model_index"] %} + + {% endif %} + {% endfor %} + + +
    + {% for model in model_card["model_index"] %}

    {{ model["name"] }}

    - - - - - - - - {% for key, value in model %} - {% if key != "name" %} +
    {% trans %}Attribute{% endtrans %}{% trans %}Value{% endtrans %}
    + + + + + + + {% for key, value in model %} + {% if key != "name" %} - - - - - {% endif %} + + + + + {% endif %} {% endfor %} - -
    {% trans %}Attribute{% endtrans %}{% trans %}Value{% endtrans %}
    - {{ key.capitalize().replace("_", " ") }} - - {{ render.render_value(key, value, 0, "algorithm/" + algorithm_id|string + "/FIXME", "/system_card/models/FIXME") }} -
    + {{ key.capitalize().replace("_", " ") }} + + {{ render.render_value(key, value, 0, "algorithm/" + algorithm_id|string + "/FIXME", "/system_card/models/FIXME") }} +
    -
    -
    -{% endfor %} + + +
    +
    + {% endfor %} {% endblock %} diff --git a/amt/site/templates/pages/system_card.html.j2 b/amt/site/templates/pages/system_card.html.j2 index 82e5baf8..1b54fddb 100644 --- a/amt/site/templates/pages/system_card.html.j2 +++ b/amt/site/templates/pages/system_card.html.j2 @@ -2,68 +2,68 @@ {% import 'macros/cards.html.j2' as render with context %} {% from "macros/editable_macros.html.j2" import editable with context %} {% block detail_content %} - {% trans %}Last updated{% endtrans %}: {{ last_edited | time_ago(language) }} -{% trans %}ago{% endtrans %} -
    + {% trans %}Last updated{% endtrans %}: {{ last_edited | time_ago(language) }} + {% trans %}ago{% endtrans %} +
    {% if "DISABLED" == "FOR NOW" and system_card.assessments is defined and system_card.assessments|length > 0 %} -
    -

    {% trans %}Assessment cards {% endtrans %}

    +
    +

    {% trans %}Assessment cards {% endtrans %}

    -
    -{% endif %} -{% if "DISABLED" == "FOR NOW" and system_card.models is defined and system_card.models|length > 0 %} -
    +
    + {% endif %} + {% if "DISABLED" == "FOR NOW" and system_card.models is defined and system_card.models|length > 0 %} +

    {% trans %}Model cards{% endtrans %}

    -
    -{% endif %} -
    -
    + {% endfor %} + +
    + {% endif %} +
    +
    - - - - - - -{% for key, value in system_card %} - {% if key not in ["status", "requirements","measures", "assessments", "models", "instruments"] %} - + + + + + + + {% for key, value in system_card %} + {% if key not in ["status", "requirements","measures", "assessments", "models", "instruments"] %} + - - + + {% endif %} - {% endfor %} - -
    {% trans %}Attribute{% endtrans %}{% trans %}Value{% endtrans %}
    {% trans %}Attribute{% endtrans %}{% trans %}Value{% endtrans %}
    - {{ key.capitalize().replace("_", " ") }} - - {{ render.render_value(key, value, 0, "algorithm/" + algorithm_id|string, "/system_card") }} - + {{ key.capitalize().replace("_", " ") }} + + {{ render.render_value(key, value, 0, "algorithm/" + algorithm_id|string, "/system_card") }} +
    -
    + {% endfor %} + + +
    {% endblock %} diff --git a/amt/site/templates/pages/under_construction.html.j2 b/amt/site/templates/pages/under_construction.html.j2 index 2942bdfd..f17edf4c 100644 --- a/amt/site/templates/pages/under_construction.html.j2 +++ b/amt/site/templates/pages/under_construction.html.j2 @@ -1,12 +1,12 @@ {% extends "layouts/base.html.j2" %} {% block title %} - {% trans %}AMT Placeholder information pages{% endtrans %} + {% trans %}AMT Placeholder information pages{% endtrans %} {% endblock title %} {% block content %} -
    -
    -

    {% trans %}Under construction{% endtrans %}

    -

    {% trans %}This page is yet to be build.{% endtrans %}

    -
    -
    +
    +
    +

    {% trans %}Under construction{% endtrans %}

    +

    {% trans %}This page is yet to be build.{% endtrans %}

    +
    +
    {% endblock content %} diff --git a/amt/site/templates/parts/algorithm_search.html.j2 b/amt/site/templates/parts/algorithm_search.html.j2 index baf65da1..97aee16a 100644 --- a/amt/site/templates/parts/algorithm_search.html.j2 +++ b/amt/site/templates/parts/algorithm_search.html.j2 @@ -4,97 +4,97 @@ hx-trigger="change" hx-include="this" hx-swap="innerHTML"> -
    -
    -

    {% trans %}Algorithms{% endtrans %}

    +
    +
    +

    {% trans %}Algorithms{% endtrans %}

    {% if permission(permission_path, 'Create', permissions) == True %} - -
    +
    + {% endif %} +
    +
    -
    -
    -
    -
    -
    {% trans %}Search{% endtrans %}
    -
    - - -
    -
    -
    -
    {% trans %}Lifecycle{% endtrans %}
    -
    - -
    +
    +
    +
    +
    +
    {% trans %}Search{% endtrans %}
    +
    + + +
    +
    +
    +
    {% trans %}Lifecycle{% endtrans %}
    +
    + +
    -
    {% trans %}Category{% endtrans %}
    -
    +
    {% trans %}Category{% endtrans %}
    +
    +
    +
    -
    -
    -
    -
    -
    -
    +
    +
    +
    +
    {% trans %}Group by{% endtrans %}
    -
    - {% for group_by_category in group_by_categories %} - + {% endfor %} - -
    -
    + +
    +
    {#53px = 45px (from the select wrapper) + an xs rvo alert padding of 8px#}
    {% include 'parts/filter_list.html.j2' %}
    diff --git a/amt/site/templates/parts/filter_list.html.j2 b/amt/site/templates/parts/filter_list.html.j2 index d191d675..135239fb 100644 --- a/amt/site/templates/parts/filter_list.html.j2 +++ b/amt/site/templates/parts/filter_list.html.j2 @@ -1,119 +1,119 @@ {% import 'macros/table_row.html.j2' as table_row with context %} {% import 'macros/algorithm_systems_grid.html.j2' as render with context %} {% if start > 0 %} - {% for algorithm in algorithms %}{{ table_row.item(loop, algorithm, true) }}{% endfor %} + {% for algorithm in algorithms %}{{ table_row.item(loop, algorithm, true) }}{% endfor %} {% else %} -
    -
    - - {% trans amount_algorithm_systems %} - {{ amount_algorithm_systems }} result - {% pluralize %} - {{ amount_algorithm_systems }} results - {% endtrans %} - - {% if search or filters %} - {% trans %}for{% endtrans %} - {% if search %}'{{ search }}'{% endif %} - {% endif %} -
    - - {% for key, localized_value in filters.items() %} - - - {{ localized_value.display_value | safe }} - - - {% endfor %} -
    -
    -
    -{% if algorithms|length == 0 %} +
    +
    + + {% trans amount_algorithm_systems %} + {{ amount_algorithm_systems }} result +{% pluralize %} + {{ amount_algorithm_systems }} results + {% endtrans %} + + {% if search or filters %} + {% trans %}for{% endtrans %} + {% if search %}'{{ search }}'{% endif %} + {% endif %} +
    + + {% for key, localized_value in filters.items() %} + + + {{ localized_value.display_value | safe }} + + + {% endfor %} +
    +
    +
    + {% if algorithms|length == 0 %}
    - {% trans %}No Algorithm match your selected filters. Try adjusting your filters or clearing them to - see more - algorithms.{% endtrans %} -
    -{% else %} -{% if display_type == "" %} -
    + {% trans %}No Algorithm match your selected filters. Try adjusting your filters or clearing them to + see more + algorithms.{% endtrans %} +
    + {% else %} + {% if display_type == "" %} + {% for key, localized_value in filters.items() %} - + {% endfor %} - - - - + + + - + - - -{% for algorithm in algorithms %}{{ table_row.item(loop, algorithm, true) }}{% endfor %} -
    - {% trans %}Algorithm name{% endtrans %} - {{ table_row.sort_button('name', sort_by, base_href) }} - - {% trans %}Lifecycle{% endtrans %} +
    + {% trans %}Algorithm name{% endtrans %} + {{ table_row.sort_button('name', sort_by, base_href) }} + + {% trans %}Lifecycle{% endtrans %} {{ table_row.sort_button('lifecycle', sort_by, base_href) }} - + {% trans %}Last updated{% endtrans %} - {{ table_row.sort_button('last_update', sort_by, base_href) }} -
    - -{% elif display_type == "LIFECYCLE" %} - - - + {{ table_row.sort_button('last_update', sort_by, base_href) }} + + + + {% for algorithm in algorithms %}{{ table_row.item(loop, algorithm, true) }}{% endfor %} +
    + + {% elif display_type == "LIFECYCLE" %} + + + - - - -
    {% trans %}Algorithm name{% endtrans %}{% trans %}Last updated{% endtrans %}
    -
    - - {% for key, localized_value in filters.items() %} - - {% endfor %} -
    - {% for lifecycle in lifecycles %}{{ render.row(algorithms[lifecycle.value], lifecycle) }}{% endfor %} -
    -
    -{% else %} -{% trans %}Does not exist{% endtrans %} -{% endif %} -{% endif %} + {% trans %}Last updated{% endtrans %} + + + +
    + + {% for key, localized_value in filters.items() %} + + {% endfor %} +
    + {% for lifecycle in lifecycles %}{{ render.row(algorithms[lifecycle.value], lifecycle) }}{% endfor %} +
    +
    + {% else %} + {% trans %}Does not exist{% endtrans %} + {% endif %} + {% endif %} {% endif %} diff --git a/amt/site/templates/parts/header.html.j2 b/amt/site/templates/parts/header.html.j2 index 29d31bc8..8c8c617f 100644 --- a/amt/site/templates/parts/header.html.j2 +++ b/amt/site/templates/parts/header.html.j2 @@ -1,219 +1,219 @@ -{% trans %}Beta Version{% endtrans %} {{ version }} {% trans %} | This website is under development | All versions are created in an open manner.{% endtrans %} + {% trans %}Beta Version{% endtrans %} {{ version }} {% trans %} | This website is under development | All versions are created in an open manner.{% endtrans %}
    -
    -
    {% set language_mappings = {"nl": "Nederlands", "en": "English"} %}
    -
    -
    - +
    +
    {% if sub_menu_items is defined and sub_menu_items|length > 0 %} -
    -
    - -
    +
    +
    +
    +
    {% endif %}
    {% if breadcrumbs is defined %} -
    - -
    -
      - {% for breadcrumb in breadcrumbs %} - {% if loop.first %} -
    1. - {{ breadcrumb.display_text }} -
    2. - {% elif loop.last %} -
    3. - - {{ breadcrumb.display_text }} -
    4. - {% else %} -
    5. - - {{ breadcrumb.display_text }} -
    6. - {% endif %} - {% endfor %} -
    -
    +
    + +
    +
      + {% for breadcrumb in breadcrumbs %} + {% if loop.first %} +
    1. + {{ breadcrumb.display_text }} +
    2. + {% elif loop.last %} +
    3. + + {{ breadcrumb.display_text }} +
    4. + {% else %} +
    5. + + {{ breadcrumb.display_text }} +
    6. + {% endif %} + {% endfor %} +
    +
    {% endif %} diff --git a/amt/site/templates/parts/tasks_board.html.j2 b/amt/site/templates/parts/tasks_board.html.j2 index eceafd19..1c4da128 100644 --- a/amt/site/templates/parts/tasks_board.html.j2 +++ b/amt/site/templates/parts/tasks_board.html.j2 @@ -1,57 +1,57 @@ {% import 'macros/tasks.html.j2' as render with context %} {% if search or filters %} -
    -
    - {% trans %}Results for{% endtrans %} - {% if search %}'{{ search }}'{% endif %} -
    - - {% for key, localized_value in filters.items() %} - - - {{ localized_value.display_value | safe }} - - - {% endfor %} -
    +
    +
    + {% trans %}Results for{% endtrans %} + {% if search %}'{{ search }}'{% endif %} +
    + + {% for key, localized_value in filters.items() %} + + + {{ localized_value.display_value | safe }} + + + {% endfor %} +
    -
    +
    {% endif %}
    -
    - - - - -
    -
    -
    -
    - {% for status in statuses %}{{ render.column(algorithm, status, translations, tasks_by_status) }}{% endfor %} -
    +
    + + + + +
    +
    +
    +
    + {% for status in statuses %}{{ render.column(algorithm, status, translations, tasks_by_status) }}{% endfor %}
    +
    diff --git a/amt/site/templates/parts/tasks_search.html.j2 b/amt/site/templates/parts/tasks_search.html.j2 index d6197497..9821c690 100644 --- a/amt/site/templates/parts/tasks_search.html.j2 +++ b/amt/site/templates/parts/tasks_search.html.j2 @@ -4,67 +4,67 @@ hx-trigger="change" hx-include="this" hx-swap="innerHTML"> -
    -
    -
    -
    -
    -
    -
    {% trans %}Search{% endtrans %}
    -
    - - -
    -
    -
    -
    {% trans %}Lifecycle{% endtrans %}
    -
    - -
    -
    -
    -
    {% trans %}Assignee{% endtrans %}
    -
    - -
    +
    +
    +
    +
    +
    +
    +
    {% trans %}Search{% endtrans %}
    +
    + + +
    +
    +
    {% trans %}Lifecycle{% endtrans %}
    +
    + +
    +
    +
    +
    {% trans %}Assignee{% endtrans %}
    +
    + +
    +
    +
    -
    -
    -
    -
    +
    + +
    {% include 'parts/tasks_board.html.j2' %}
    diff --git a/amt/site/templates/publish/parts/ar_login_form.html.j2 b/amt/site/templates/publish/parts/ar_login_form.html.j2 index 196fee92..aacd2610 100644 --- a/amt/site/templates/publish/parts/ar_login_form.html.j2 +++ b/amt/site/templates/publish/parts/ar_login_form.html.j2 @@ -1,33 +1,47 @@ {% if login_error is defined and login_error %} - + {% trans %}A connection could not be established with the Algorithm Register.{% endtrans %} - -{% trans %}Check the entered data and try again.{% endtrans %} - + + {% trans %}Check the entered data and try again.{% endtrans %} + {% endif %} - -{% trans %}The Algorithm Register is not part of AMT and to submit an algorithm or check the status, logging in to the register is required.{% endtrans %} -{% trans %}Read more about registration here{% endtrans %} - - - - -
    -
    + + {% trans %}The Algorithm Register is not part of AMT and to submit an algorithm or check the status, logging in to the register is required.{% endtrans %} + {% trans %}Read more about registration here{% endtrans %} + + + + + +
    -
    - - - -{% trans %}Login to Algorithm Register{% endtrans %} - - -
    +
    + + + + {% trans %}Login to Algorithm Register{% endtrans %} + + +
    diff --git a/amt/site/templates/publish/parts/ar_login_success.html.j2 b/amt/site/templates/publish/parts/ar_login_success.html.j2 index 16ea4536..87cdba5e 100644 --- a/amt/site/templates/publish/parts/ar_login_success.html.j2 +++ b/amt/site/templates/publish/parts/ar_login_success.html.j2 @@ -1,11 +1,14 @@ - -{% trans %}The connection to the Algorithm Register was successful.{% endtrans %} + + {% trans %}The connection to the Algorithm Register was successful.{% endtrans %}
    {% include "publish/parts/ar_organization_selector.html.j2" %}
    {% if selected_org_id %} - {% trans %}Continue{% endtrans %} + {% trans %}Continue{% endtrans %} {% else %} -{% trans %}Continue{% endtrans %} + {% trans %}Continue{% endtrans %} {% endif %} diff --git a/amt/site/templates/publish/parts/ar_organization_selector.html.j2 b/amt/site/templates/publish/parts/ar_organization_selector.html.j2 index ebc4b112..97cbcd1a 100644 --- a/amt/site/templates/publish/parts/ar_organization_selector.html.j2 +++ b/amt/site/templates/publish/parts/ar_organization_selector.html.j2 @@ -1,41 +1,59 @@
    - {% if selected_org_id %} - - {% trans %}You are publishing to organization:{% endtrans %} {{ selected_org_name or selected_org_id }} -{% if organisations | length != 1 %} -
    - {% trans %}Change organization{% endtrans %} -{% endif %} -
    -
    -{% else %} - -{% trans %}Select an organization{% endtrans %} -{% if organisations | length > 1 %} - {% trans %}Under which organization should this algorithm be published?{% endtrans %} -
    - - - -{% if errors is defined and errors.get('organization_id') %} - -{% endif %} -{% trans %}Confirm{% endtrans %} -
    -{% else %} -{% trans %}Enter the organization details you want to publish with.{% endtrans %} -
    - - -{% trans %}Confirm{% endtrans %} - -{% endif %} -
    -{% endif %} + {% if selected_org_id %} + + {% trans %}You are publishing to organization:{% endtrans %} {{ selected_org_name or selected_org_id }} + {% if organisations | length != 1 %} +
    + {% trans %}Change organization{% endtrans %} + {% endif %} +
    +
    + {% else %} + + {% trans %}Select an organization{% endtrans %} + {% if organisations | length > 1 %} + {% trans %}Under which organization should this algorithm be published?{% endtrans %} +
    + + + + {% if errors is defined and errors.get('organization_id') %} + + {% endif %} + {% trans %}Confirm{% endtrans %} +
    + {% else %} + {% trans %}Enter the organization details you want to publish with.{% endtrans %} +
    + + + {% trans %}Confirm{% endtrans %} + + {% endif %} +
    + {% endif %}
    diff --git a/amt/site/templates/publish/publish_confirm.html.j2 b/amt/site/templates/publish/publish_confirm.html.j2 index 5d95cbe4..32c68d7b 100644 --- a/amt/site/templates/publish/publish_confirm.html.j2 +++ b/amt/site/templates/publish/publish_confirm.html.j2 @@ -1,39 +1,53 @@ {% extends 'algorithms/details_base.html.j2' %} {% from "macros/editable_macros.html.j2" import editable with context %} {% block detail_content %} - + - -
    + +
    {% trans %}Publish{% endtrans %} -
    - - - {% trans %}You are about to permanently publish the algorithm{% endtrans %} - {{ algorithm.name }} - {% trans %}in the Algorithm Register.{% endtrans %} - - -{% trans %}What happens now?{% endtrans %} - - - -{% trans %}After your confirmation, the publication will be released.{% endtrans %} -{% trans %}The submission will be manually reviewed.{% endtrans %} -{% trans %}The publication will be visible in the Algorithm Register within a maximum of 1 business day.{% endtrans %} - - - -{% trans %}The responsibility for the accuracy of the data always remains with your organization.{% endtrans %} - - -{% trans %}Publish{% endtrans %} -{% trans %}Publish and release{% endtrans %} - - -
    -{% trans %}Previous step{% endtrans %} -
    - - +
    + + + {% trans %}You are about to permanently publish the algorithm{% endtrans %} + + {{ algorithm.name }} + + {% trans %}in the Algorithm Register.{% endtrans %} + + + {% trans %}What happens now?{% endtrans %} + + + + {% trans %}After your confirmation, the publication will be released.{% endtrans %} + {% trans %}The submission will be manually reviewed.{% endtrans %} + {% trans %}The publication will be visible in the Algorithm Register within a maximum of 1 business day.{% endtrans %} + + + + {% trans %}The responsibility for the accuracy of the data always remains with your organization.{% endtrans %} + + + {% trans %}Publish{% endtrans %} + {% trans %}Publish and release{% endtrans %} + + +
    + {% trans %}Previous step{% endtrans %} +
    +
    +
    {% endblock %} diff --git a/amt/site/templates/publish/publish_connection.html.j2 b/amt/site/templates/publish/publish_connection.html.j2 index 145a4b87..44a9ece8 100644 --- a/amt/site/templates/publish/publish_connection.html.j2 +++ b/amt/site/templates/publish/publish_connection.html.j2 @@ -1,12 +1,12 @@ {% extends 'algorithms/details_base.html.j2' %} {% from "macros/editable_macros.html.j2" import editable with context %} {% block detail_content %} - {% trans %}Login to Algorithm Register{% endtrans %} -
    + {% trans %}Login to Algorithm Register{% endtrans %} +
    {% if is_ar_logged_in %} - {% include "publish/parts/ar_login_success.html.j2" %} + {% include "publish/parts/ar_login_success.html.j2" %} {% else %} - {% include "publish/parts/ar_login_form.html.j2" %} + {% include "publish/parts/ar_login_form.html.j2" %} {% endif %} -
    +
    {% endblock %} diff --git a/amt/site/templates/publish/publish_explanation.html.j2 b/amt/site/templates/publish/publish_explanation.html.j2 index 2efcca7d..03668d5b 100644 --- a/amt/site/templates/publish/publish_explanation.html.j2 +++ b/amt/site/templates/publish/publish_explanation.html.j2 @@ -1,22 +1,26 @@ {% extends 'algorithms/details_base.html.j2' %} {% from "macros/editable_macros.html.j2" import editable with context %} {% block detail_content %} - - -{% trans %}In the central algorithm register of the Dutch government, government agencies publish information about their algorithms in one place, making it searchable for everyone.{% endtrans %} -{% trans %}Via AMT an algorithm can be submitted to the algorithm register.{% endtrans %} -{% trans %}The algorithm register is not part of AMT and to submit an algorithm, registration with the register is required.{% endtrans %} -{% trans %}Submitting an algorithm is only possible if you already have registration credentials for the register.{% endtrans %} - - -{% trans %}Read more about the Algorithm Register here{% endtrans %} - - - -{% if not is_ar_logged_in %} - {% trans %}Login to Algorithm Register{% endtrans %} -{% else %} -{% trans %}Continue{% endtrans %} -{% endif %} - + + + {% trans %}In the central algorithm register of the Dutch government, government agencies publish information about their algorithms in one place, making it searchable for everyone.{% endtrans %} + {% trans %}Via AMT an algorithm can be submitted to the algorithm register.{% endtrans %} + {% trans %}The algorithm register is not part of AMT and to submit an algorithm, registration with the register is required.{% endtrans %} + {% trans %}Submitting an algorithm is only possible if you already have registration credentials for the register.{% endtrans %} + + + {% trans %}Read more about the Algorithm Register here{% endtrans %} + + + + {% if not is_ar_logged_in %} + {% trans %}Login to Algorithm Register{% endtrans %} + {% else %} + {% trans %}Continue{% endtrans %} + {% endif %} + {% endblock %} diff --git a/amt/site/templates/publish/publish_prepare.html.j2 b/amt/site/templates/publish/publish_prepare.html.j2 index b6b62962..2ae103f1 100644 --- a/amt/site/templates/publish/publish_prepare.html.j2 +++ b/amt/site/templates/publish/publish_prepare.html.j2 @@ -1,45 +1,55 @@ {% extends 'algorithms/details_base.html.j2' %} {% from "macros/editable_macros.html.j2" import editable with context %} {% block detail_content %} - + - -
    + +
    {% trans %}Prepare publication{% endtrans %} - - - {% trans %}What is important when publishing?{% endtrans %} - - -{% trans %}Before you continue with publishing your algorithm, it is important to know what criteria your algorithm must meet. Publication in the Algorithm Register contributes to transparency and accountability regarding the use of algorithms within the government.{% endtrans %} - - -{% trans %}Pay attention to the following points:{% endtrans %} - - - - -{% trans %}Completeness of data:{% endtrans %} -{% trans %}Ensure that all relevant metadata, such as purpose, operation, data used and impact assessments, are fully and accurately filled in your algorithm description. Incomplete information can lead to delay or rejection of publication.{% endtrans %} - - - - -{% trans %}Necessity of publication:{% endtrans %} -{% trans %}Determine whether your algorithm falls under the publication obligation, for example because it is a high-risk algorithm according to the European AI regulation, or has a direct impact on citizens. Make sure you have all this information at hand or have already filled it in on the previous tabs.{% endtrans %} - - - - - -{% if has_publication %} - {% trans %}Show status{% endtrans %} -{% else %} -{% trans %}Previous step{% endtrans %} -{% endif %} -{% trans %}Next step{% endtrans %} - -
    - - + + + {% trans %}What is important when publishing?{% endtrans %} + + + {% trans %}Before you continue with publishing your algorithm, it is important to know what criteria your algorithm must meet. Publication in the Algorithm Register contributes to transparency and accountability regarding the use of algorithms within the government.{% endtrans %} + + + {% trans %}Pay attention to the following points:{% endtrans %} + + + + + {% trans %}Completeness of data:{% endtrans %} + {% trans %}Ensure that all relevant metadata, such as purpose, operation, data used and impact assessments, are fully and accurately filled in your algorithm description. Incomplete information can lead to delay or rejection of publication.{% endtrans %} + + + + + {% trans %}Necessity of publication:{% endtrans %} + {% trans %}Determine whether your algorithm falls under the publication obligation, for example because it is a high-risk algorithm according to the European AI regulation, or has a direct impact on citizens. Make sure you have all this information at hand or have already filled it in on the previous tabs.{% endtrans %} + + + + + + {% if has_publication %} + {% trans %}Show status{% endtrans %} + {% else %} + {% trans %}Previous step{% endtrans %} + {% endif %} + {% trans %}Next step{% endtrans %} + +
    +
    +
    {% endblock %} diff --git a/amt/site/templates/publish/publish_preview.html.j2 b/amt/site/templates/publish/publish_preview.html.j2 index ebf94070..4da3b1ff 100644 --- a/amt/site/templates/publish/publish_preview.html.j2 +++ b/amt/site/templates/publish/publish_preview.html.j2 @@ -1,261 +1,325 @@ {% extends 'algorithms/details_base.html.j2' %} {% from "macros/editable_macros.html.j2" import editable with context %} {% block detail_content %} - + - -
    + +
    {% trans %}Preview & verify{% endtrans %} - - - {% trans %}Below you can see the complete preview of the publication.{% endtrans %} - - -{% trans %}Pay attention to the following points:{% endtrans %} - - - - -{% trans %}Completeness{% endtrans %} -{% trans %}: Fill in as many fields as possible. Empty fields are generally not shown on the website.{% endtrans %} - - - - -{% trans %}Accessible language{% endtrans %} -{% trans %}: Use understandable language where possible (aim is B1 level), especially in the general descriptions.{% endtrans %} - - - - -{% trans %}If you want to change data, you can use the details page.{% endtrans %} - - - - -{{ publication_model.name }} - - -
    - {{ publication_model.organization }} - - {{ publication_model.description_short }} - -
    -
    - {% trans %}Publication category{% endtrans %} -{{ publication_model.publication_category.value }} -{% trans %}Impact assessments{% endtrans %} -{{ publication_model.impacttoetsen_grouping | map(attribute='title') | join(', ') }} -{% trans %}Status{% endtrans %} -{{ publication_model.status.value }} -
    -
    -
    - - - - - -
    -
    - - - - - - - - {% trans %}Theme{% endtrans %} - - {{ publication_model.category if publication_model.category else '-' }} - - - {% trans %}Start date{% endtrans %} -{{ publication_model.begin_date or '-' }} - - -{% trans %}End date{% endtrans %} -{{ publication_model.end_date or '-' }} - - -{% trans %}Contact details{% endtrans %} -{{ publication_model.contact_email or '-' }} - - -{% trans %}Website{% endtrans %} - -{% if publication_model.website %} - {{ publication_model.website }} -{% else %} - - -{% endif %} - - - -{% trans %}URL{% endtrans %} - -{% if publication_model.url %} - {{ publication_model.url }} -{% else %} - - -{% endif %} - - - -
    - - -
    - -{% trans %}Previous step{% endtrans %} - -{% trans %}Next step{% endtrans %} - -
    - - + + + {% trans %}Below you can see the complete preview of the publication.{% endtrans %} + + + {% trans %}Pay attention to the following points:{% endtrans %} + + + + + {% trans %}Completeness{% endtrans %} + {% trans %}: Fill in as many fields as possible. Empty fields are generally not shown on the website.{% endtrans %} + + + + + {% trans %}Accessible language{% endtrans %} + {% trans %}: Use understandable language where possible (aim is B1 level), especially in the general descriptions.{% endtrans %} + + + + + {% trans %}If you want to change data, you can use the details page.{% endtrans %} + + + + + {{ publication_model.name }} + + +
    + + {{ publication_model.organization }} + + + {{ publication_model.description_short }} + +
    +
    + {% trans %}Publication category{% endtrans %} + + {{ publication_model.publication_category.value }} + + {% trans %}Impact assessments{% endtrans %} + + {{ publication_model.impacttoetsen_grouping | map(attribute='title') | join(', ') }} + + {% trans %}Status{% endtrans %} + + {{ publication_model.status.value }} + +
    +
    +
    + + + + + +
    +
    + + + + + + + + {% trans %}Theme{% endtrans %} + + + {{ publication_model.category if publication_model.category else '-' }} + + + + {% trans %}Start date{% endtrans %} + + {{ publication_model.begin_date or '-' }} + + + + {% trans %}End date{% endtrans %} + + {{ publication_model.end_date or '-' }} + + + + {% trans %}Contact details{% endtrans %} + + {{ publication_model.contact_email or '-' }} + + + + {% trans %}Website{% endtrans %} + + {% if publication_model.website %} + + {{ publication_model.website }} + + {% else %} + - + {% endif %} + + + + {% trans %}URL{% endtrans %} + + {% if publication_model.url %} + + {{ publication_model.url }} + + {% else %} + - + {% endif %} + + + +
    + + +
    + + {% trans %}Previous step{% endtrans %} + + {% trans %}Next step{% endtrans %} + +
    +
    +
    {% endblock %} diff --git a/amt/site/templates/publish/publish_status.html.j2 b/amt/site/templates/publish/publish_status.html.j2 index 5109195b..f8be4a8b 100644 --- a/amt/site/templates/publish/publish_status.html.j2 +++ b/amt/site/templates/publish/publish_status.html.j2 @@ -1,83 +1,96 @@ {% extends 'algorithms/details_base.html.j2' %} {% from "macros/editable_macros.html.j2" import editable with context %} {% block detail_content %} - {% set status_types = { - PublicationStatuses.PUBLISHED: 'success', - PublicationStatuses.STATE_2: 'info', - PublicationStatuses.STATE_1: 'warning' - } %} - {% trans %}Publication status{% endtrans %} -{% if publication_missing_in_register %} + {% set status_types = { + PublicationStatuses.PUBLISHED: 'success', + PublicationStatuses.STATE_2: 'info', + PublicationStatuses.STATE_1: 'warning' + } %} + {% trans %}Publication status{% endtrans %} + {% if publication_missing_in_register %} - {% trans %}The algorithm cannot be found in the register but was previously published via AMT. It may have been removed from the register.{% endtrans %} -{% trans %}The publication has now also been removed from AMT.{% endtrans %} -{% trans %}Publish again{% endtrans %} - -{% endif %} - -{% trans %}Publication status{% endtrans %} - - -
    - - {% if publication and publication.last_updated %} - {% trans %}Last published on{% endtrans %} {{ publication.last_updated|format_datetime(language, 'long') }} -{% endif %} -
    -
    - {% if not publication %} - {% trans %}No publication information is available yet.{% endtrans %} -{% elif publication_url is defined and publication_url %} - {% trans %}Link to your publication{% endtrans %} -
    -{% else %} - -{% trans %}View publication preview{% endtrans %} - -{% endif %} -{% if algorithm_summary and algorithm_summary.published and ((algorithm_summary.current_version_released and not algorithm_summary.current_version_published) or (not algorithm_summary.current_version_released and not algorithm_summary.current_version_published)) %} - - {% trans %}View publication preview{% endtrans %} - -{% endif %} -
    -
    - - -{% if PublicationStatuses.STATE_1 == publication_status or (algorithm_summary and not algorithm_summary.current_version_released and not algorithm_summary.current_version_published) %} - + {% trans %}The algorithm cannot be found in the register but was previously published via AMT. It may have been removed from the register.{% endtrans %} + {% trans %}The publication has now also been removed from AMT.{% endtrans %} + {% trans %}Publish again{% endtrans %} + + {% endif %} + + {% trans %}Publication status{% endtrans %} - {% if (algorithm_summary and algorithm_summary.published and not algorithm_summary.current_version_released) %} - - {% trans %}A newer version of the algorithm has been successfully submitted, but not yet released. Only after release will the approval process start and publication can take place.{% endtrans %} - -{% else %} - - {% trans %}The algorithm has been successfully submitted, but not yet released. Only after release will the approval process start and publication can take place.{% endtrans %} - -{% endif %} - -{% trans %}Release publication{% endtrans %} - - -
    -{% elif PublicationStatuses.STATE_2 == publication_status %} - -{% trans %}The algorithm has been submitted to the Algorithm Register and released. It still needs to be definitively published by the Algorithm Register.{% endtrans %} - -{% elif (algorithm_summary and not algorithm_summary.current_version_published) %} - -{% trans %}A new version of the algorithm has been submitted to the Algorithm Register and released. It still needs to be definitively published by the Algorithm Register.{% endtrans %} - -{% elif not publication %} -{% trans %}Start publishing{% endtrans %} -{% endif %} -{% if publication %} -
    - {% trans %}Modify publication{% endtrans %} -
    -{% endif %} - - - + +
    + + + {% if publication and publication.last_updated %} + {% trans %}Last published on{% endtrans %} {{ publication.last_updated|format_datetime(language, 'long') }} + {% endif %} +
    +
    + {% if not publication %} + {% trans %}No publication information is available yet.{% endtrans %} + {% elif publication_url is defined and publication_url %} + {% trans %}Link to your publication{% endtrans %} +
    + {% else %} + + {% trans %}View publication preview{% endtrans %} + + {% endif %} + {% if algorithm_summary and algorithm_summary.published and ((algorithm_summary.current_version_released and not algorithm_summary.current_version_published) or (not algorithm_summary.current_version_released and not algorithm_summary.current_version_published)) %} + + {% trans %}View publication preview{% endtrans %} + + {% endif %} +
    +
    + + + {% if PublicationStatuses.STATE_1 == publication_status or (algorithm_summary and not algorithm_summary.current_version_released and not algorithm_summary.current_version_published) %} + + + {% if (algorithm_summary and algorithm_summary.published and not algorithm_summary.current_version_released) %} + + {% trans %}A newer version of the algorithm has been successfully submitted, but not yet released. Only after release will the approval process start and publication can take place.{% endtrans %} + + {% else %} + + {% trans %}The algorithm has been successfully submitted, but not yet released. Only after release will the approval process start and publication can take place.{% endtrans %} + + {% endif %} + + {% trans %}Release publication{% endtrans %} + + + + {% elif PublicationStatuses.STATE_2 == publication_status %} + + {% trans %}The algorithm has been submitted to the Algorithm Register and released. It still needs to be definitively published by the Algorithm Register.{% endtrans %} + + {% elif (algorithm_summary and not algorithm_summary.current_version_published) %} + + {% trans %}A new version of the algorithm has been submitted to the Algorithm Register and released. It still needs to be definitively published by the Algorithm Register.{% endtrans %} + + {% elif not publication %} + {% trans %}Start publishing{% endtrans %} + {% endif %} + {% if publication %} +
    + {% trans %}Modify publication{% endtrans %} +
    + {% endif %} +
    + + {% endblock %} diff --git a/tests/site/static/templates/permission_example.html.j2 b/tests/site/static/templates/permission_example.html.j2 index ce99f435..0fd4f1da 100644 --- a/tests/site/static/templates/permission_example.html.j2 +++ b/tests/site/static/templates/permission_example.html.j2 @@ -1,5 +1,5 @@ {% if permission('organization/1', 'Create', permissions) == True %} - User Authorized + User Authorized {% else %} - User UnAuthorized + User UnAuthorized {% endif %}