Skip to content

Commit

Permalink
Icon + tekst for edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
anneschuth committed Oct 21, 2024
1 parent f54590c commit 07401a3
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 64 deletions.
7 changes: 4 additions & 3 deletions amt/locale/base.pot
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,18 @@ msgstr ""
msgid "Algorithmic Management Toolkit (AMT)"
msgstr ""

#: amt/site/templates/macros/editable.html.j2:21
#: amt/site/templates/macros/editable.html.j2:23
#: amt/site/templates/macros/editable.html.j2:26
#: amt/site/templates/projects/details_requirements.html.j2:55
msgid "Edit"
msgstr ""

#: amt/site/templates/macros/editable.html.j2:58
#: amt/site/templates/macros/editable.html.j2:62
#: amt/site/templates/projects/details_measure_modal.html.j2:84
msgid "Save"
msgstr ""

#: amt/site/templates/macros/editable.html.j2:63
#: amt/site/templates/macros/editable.html.j2:67
#: amt/site/templates/projects/details_measure_modal.html.j2:88
msgid "Cancel"
msgstr ""
Expand Down
Binary file modified amt/locale/en_US/LC_MESSAGES/messages.mo
Binary file not shown.
7 changes: 4 additions & 3 deletions amt/locale/en_US/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,18 @@ msgstr ""
msgid "Algorithmic Management Toolkit (AMT)"
msgstr ""

#: amt/site/templates/macros/editable.html.j2:21
#: amt/site/templates/macros/editable.html.j2:23
#: amt/site/templates/macros/editable.html.j2:26
#: amt/site/templates/projects/details_requirements.html.j2:55
msgid "Edit"
msgstr ""

#: amt/site/templates/macros/editable.html.j2:58
#: amt/site/templates/macros/editable.html.j2:62
#: amt/site/templates/projects/details_measure_modal.html.j2:84
msgid "Save"
msgstr ""

#: amt/site/templates/macros/editable.html.j2:63
#: amt/site/templates/macros/editable.html.j2:67
#: amt/site/templates/projects/details_measure_modal.html.j2:88
msgid "Cancel"
msgstr ""
Expand Down
Binary file modified amt/locale/nl_NL/LC_MESSAGES/messages.mo
Binary file not shown.
13 changes: 7 additions & 6 deletions amt/locale/nl_NL/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,18 @@ msgstr "Er is een fout opgetreden. Probeer het later opnieuw."
msgid "Algorithmic Management Toolkit (AMT)"
msgstr "Algoritme Management Toolkit (AMT)"

#: amt/site/templates/macros/editable.html.j2:21
#: amt/site/templates/macros/editable.html.j2:23
#: amt/site/templates/macros/editable.html.j2:26
#: amt/site/templates/projects/details_requirements.html.j2:55
msgid "Edit"
msgstr "Bewerken"
msgstr "Bewerk"

#: amt/site/templates/macros/editable.html.j2:58
#: amt/site/templates/macros/editable.html.j2:62
#: amt/site/templates/projects/details_measure_modal.html.j2:84
msgid "Save"
msgstr "Opslaan"

#: amt/site/templates/macros/editable.html.j2:63
#: amt/site/templates/macros/editable.html.j2:67
#: amt/site/templates/projects/details_measure_modal.html.j2:88
msgid "Cancel"
msgstr "Annuleren"
Expand Down Expand Up @@ -619,11 +620,11 @@ msgstr "Creëer een Algoritme Systeem"

#: amt/site/templates/projects/new.html.j2:23
msgid "Algorithm System name"
msgstr "Algoritmekader"
msgstr "Naam algoritme systeem"

#: amt/site/templates/projects/new.html.j2:26
msgid "Your algorithm system name here"
msgstr "Jouw algoritme systeem naam hier"
msgstr "Naam van het algoritme systeem"

#: amt/site/templates/projects/new.html.j2:39
msgid "Select the lifecycle your algorithm system is currently in."
Expand Down
106 changes: 55 additions & 51 deletions amt/site/templates/macros/editable.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,61 @@
{{ value }}
{% endif %}
{% endif %}
<span class="utrecht-icon rvo-icon rvo-icon-bewerken rvo-icon--sm"
hx-get="edit/{{ field_path | replace('.', '/') }}"
<span hx-get="edit/{{ field_path | replace('.', '/') }}"
hx-swap="outerHTML"
role="img"
aria-label="{% trans %}Edit{% endtrans %}"
style="cursor: pointer"></span>
</span>
{% endmacro %}
{% macro edit(obj, field_path) %}
<span hx-target="this">
<form hx-put="update/{{ field_path | replace('.', '/') }}"
hx-ext="json-enc"
hx-headers='{"X-CSRF-Token": "{{ csrftoken }}"}'
hx-swap="outerHTML">
<div class="rvo-layout-grid-container">
<div class="rvo-layout-grid rvo-layout-gap--md rvo-layout-grid-columns--two rvo-layout-grid-layout--1fr">
<div>
{% set value = nested_value(obj, field_path) %}
{% if is_nested_enum(obj, field_path) %}
<div class="rvo-select-wrapper">
<select id="field"
name="value"
class="utrecht-select utrecht-select--html-select">
{% for e in nested_enum(obj, field_path, language) %}
<option value="{{ e.value }}"
{% if e.value == value %}selected="selected"{% endif %}>
{{ e.display_value }}
</option>
{% endfor %}
</select>
</div>
{% else %}
<input type="text"
name="value"
value="{{ value }}"
class="utrecht-textbox utrecht-textbox--html-input" />
{% endif %}
</div>
<div>
<button type="submit"
class="utrecht-button utrecht-button--primary-action utrecht-button--rvo-md">
{% trans %}Save{% endtrans %}
</button>
<button hx-get="cancel/{{ field_path | replace('.', '/') }}"
hx-swap="outerHTML"
class="utrecht-button utrecht-button--secondary-action utrecht-button-group__align-right utrecht-button--rvo-md">
{% trans %}Cancel{% endtrans %}
</button>
style="cursor: pointer;
float:right">
<span class="utrecht-icon rvo-icon rvo-icon-bewerken rvo-icon--sm rvo-icon--hemelblauw"
role="img"
aria-label="{% trans %}Edit{% endtrans %}"></span> <a class="rvo-link"
href="#"
style="font-size: 14px !important;
color: rgb(0, 123, 199) !important">{% trans %}Edit{% endtrans %}</a>
</span>
{% endmacro %}
{% macro edit(obj, field_path) %}
<span hx-target="this">
<form hx-put="update/{{ field_path | replace('.', '/') }}"
hx-ext="json-enc"
hx-headers='{"X-CSRF-Token": "{{ csrftoken }}"}'
hx-swap="outerHTML">
<div class="rvo-layout-grid-container">
<div class="rvo-layout-grid rvo-layout-gap--md rvo-layout-grid-columns--two rvo-layout-grid-layout--1fr">
<div>
{% set value = nested_value(obj, field_path) %}
{% if is_nested_enum(obj, field_path) %}
<div class="rvo-select-wrapper">
<select id="field"
name="value"
class="utrecht-select utrecht-select--html-select">
{% for e in nested_enum(obj, field_path, language) %}
<option value="{{ e.value }}"
{% if e.value == value %}selected="selected"{% endif %}>
{{ e.display_value }}
</option>
{% endfor %}
</select>
</div>
{% else %}
<input type="text"
name="value"
value="{{ value }}"
class="utrecht-textbox utrecht-textbox--html-input" />
{% endif %}
</div>
<div>
<button type="submit"
class="utrecht-button utrecht-button--primary-action utrecht-button--rvo-md">
{% trans %}Save{% endtrans %}
</button>
<button hx-get="cancel/{{ field_path | replace('.', '/') }}"
hx-swap="outerHTML"
class="utrecht-button utrecht-button--secondary-action utrecht-button-group__align-right utrecht-button--rvo-md">
{% trans %}Cancel{% endtrans %}
</button>
</div>
</div>
</div>
</div>
</form>
</span>
{% endmacro %}
</form>
</span>
{% endmacro %}
2 changes: 1 addition & 1 deletion amt/site/templates/projects/details_base.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
<div class="rvo-max-width-layout rvo-max-width-layout--md rvo-max-width-layout-inline-padding--none">
<div class="rvo-content">
<h1 class="utrecht-heading-1">{{ project.name }}</h1>
<h1 class="utrecht-heading-1">{{ editable(project, "name") }}</h1>
</div>
<!-- Requirements Widget -->
<div class="rvo-layout-grid-container">
Expand Down

0 comments on commit 07401a3

Please sign in to comment.