Skip to content

Commit

Permalink
Encloses radio buttons in fieldset as indicated in ticket 544.
Browse files Browse the repository at this point in the history
  • Loading branch information
sfisher committed Dec 21, 2024
1 parent a604645 commit b393608
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 47 deletions.
4 changes: 2 additions & 2 deletions templates/create/_datacite_title.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
{% if forloop.counter == 1 %}
{% include "create/_datacite_inlinetext.html" with field=t_field reqd="true" %}
{% elif forloop.counter == 2 %}
<div class="fieldset-inline create__form-element-group" role="group" aria-labelledby="title-type-{{forloop.counter}}">
<fieldset class="fieldset-inline create__form-element-group" role="group" aria-labelledby="title-type-{{forloop.counter}}">
<span id="title-type-{{forloop.counter}}" class="fieldset-inline__legend create__inline-nested-legend">{{ t_field.label }}</span>
{% for radio in t_field %}
<label for="{{ radio.id_for_label }}" class="fcontrol__radio-label-inline">
{{ radio.tag }}
<span>{{ radio.choice_label }}</span>
</label>
{% endfor %}
</div>
</fieldset>
{% else %}
{% include "create/_datacite_inlinetext.html" with field=t_field %}
{% endif %}
Expand Down
40 changes: 20 additions & 20 deletions templates/includes/advanced_publish_id.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@

<div class="fieldset-stacked" role="group" aria-labelledby="fieldset-publish">
<div id="fieldset-publish" aria-label="{% trans "Step 3 - Publishing options" %}" class="fieldset-stacked__legend-number-3"><h2 class="fieldset__heading-2">{% trans "Decide" %}</h2></div>
<div class="fieldset-inline create__form-element-group" role="group" aria-labelledby="create__publish">
<span id="create__publish" class="fieldset-inline__legend create__inline-nested-legend">{% trans "Make this identifier" %}</span>
<label for="publish_true" class="fcontrol__radio-label-inline">
<input id="publish_true" class="fcontrol__radio-button-stacked" type="radio" value="True" name="publish"
{% if request.POST.publish != 'False' or request.GET.publish != 'False' %}
checked="checked"
{% endif %}
><span>{% trans "Public" %}</span>
</label>
<label for="publish_false" class="fcontrol__radio-label-inline">
<input id="publish_false" class="fcontrol__radio-button-stacked" type="radio" value="False" name="publish"
{% if request.POST.publish == 'False' or request.GET.publish == 'False' %}
checked="checked"
{% endif %}
><span>{% trans "Reserved" %}</span>
</label>
{% help_icon "decide_public" _("on making an identifier public or reserved") %}
</div>
<div id="harv_index" class="fieldset-inline create__form-element-group" role="group" aria-labelledby="fieldset-harvesting">
<fieldset class="fieldset-inline create__form-element-group" role="group" aria-labelledby="create__publish">
<span id="create__publish" class="fieldset-inline__legend create__inline-nested-legend">{% trans "Make this identifier" %}</span>
<label for="publish_true" class="fcontrol__radio-label-inline">
<input id="publish_true" class="fcontrol__radio-button-stacked" type="radio" value="True" name="publish"
{% if request.POST.publish != 'False' or request.GET.publish != 'False' %}
checked="checked"
{% endif %}
><span>{% trans "Public" %}</span>
</label>
<label for="publish_false" class="fcontrol__radio-label-inline">
<input id="publish_false" class="fcontrol__radio-button-stacked" type="radio" value="False" name="publish"
{% if request.POST.publish == 'False' or request.GET.publish == 'False' %}
checked="checked"
{% endif %}
><span>{% trans "Reserved" %}</span>
</label>
{% help_icon "decide_public" _("on making an identifier public or reserved") %}
</fieldset>
<fieldset1 id="harv_index" class="fieldset-inline create__form-element-group" role="group" aria-labelledby="fieldset-harvesting">
<span id="fieldset-harvesting" class="fieldset-inline__legend create__inline-nested-legend">{% trans "Allow harvesting/indexing?" %}</span>
<label for="export_yes" class="fcontrol__radio-label-inline">
<input id="export_yes" class="fcontrol__radio-button-stacked" type="radio" value="yes" name="export"
Expand All @@ -38,5 +38,5 @@
> <span>{% trans "No" %}</span>
</label>
{% help_icon "decide_export" _("on harvesting/indexing") %}
</div>
</fieldset1>
</div>
53 changes: 28 additions & 25 deletions templates/includes/simple_id_type.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
{% load layout_extras %}
{% load i18n %}

<div class="fieldset-stacked" role="group" aria-labelledby="create__fieldset1">
<div id="create__fieldset1" aria-label="{% trans "Step 1 - Choose an identifier type" %}" class="fieldset-stacked__legend-number-1"><h2 class="fieldset__heading-2">{% trans "Choose an identifier type" %}</h2>
{% if calling_page == 'demo' %}
{% help_icon "choose_id_demo" _("on choosing the type of identifier") %}
<div class="fieldset-stacked" role="group" aria-labelledby="create__fieldset1">
<fieldset>
<div id="create__fieldset1" aria-label="{% trans "Step 1 - Choose an identifier type" %}" class="fieldset-stacked__legend-number-1">
<h2 class="fieldset__heading-2">{% trans "Choose an identifier type" %}</h2>
{% if calling_page == 'demo' %}
{% help_icon "choose_id_demo" _("on choosing the type of identifier") %}
{% else %}
{% help_icon "choose_id" _("on choosing the type of identifier") %}
{% endif %}
</div>
{% if prefixes|duplicate_id_types %}
{% comment %}
class 'ays-ignore' is used by 'are-you-sure.js' which prevents users from accidentally leaving
a form they are working on. In this case, we will allow users to choose between shoulder types.
Although it's best we map already filled in fields over to next profile, which is something we should implement.
{% endcomment %}
{% for p in prefixes %}
<label for="{{p.prefix}}" class="fcontrol__radio-label-stacked create__radio-button">
<input id="{{p.prefix}}" class="fcontrol__radio-button-stacked ays-ignore" type="radio" value="{{p.prefix}}" name="shoulder" {% selected_radio "shoulder" forloop.counter p.prefix %} /> <span>{% shoulder_display p "False" testPrefixes "False" %}</span>
</label>
{% endfor %}
{% else %}
{% help_icon "choose_id" _("on choosing the type of identifier") %}
{% for p in prefixes %}
<label for="{{p.prefix}}" class="fcontrol__radio-label-stacked create__radio-button">
<input id="{{p.prefix}}" class="fcontrol__radio-button-stacked ays-ignore" type="radio" value="{{p.prefix}}" name="shoulder" {% selected_radio "shoulder" forloop.counter p.prefix %} /> <span>{% shoulder_display p "False" testPrefixes "True" %}</span>
</label>
{% endfor %}
{% endif %}
</div>
{% if prefixes|duplicate_id_types %}
{% comment %}
class 'ays-ignore' is used by 'are-you-sure.js' which prevents users from accidentally leaving
a form they are working on. In this case, we will allow users to choose between shoulder types.
Although it's best we map already filled in fields over to next profile, which is something we should implement.
{% endcomment %}
{% for p in prefixes %}
<label for="{{p.prefix}}" class="fcontrol__radio-label-stacked create__radio-button">
<input id="{{p.prefix}}" class="fcontrol__radio-button-stacked ays-ignore" type="radio" value="{{p.prefix}}" name="shoulder" {% selected_radio "shoulder" forloop.counter p.prefix %} /> <span>{% shoulder_display p "False" testPrefixes "False" %}</span>
</label>
{% endfor %}
{% else %}
{% for p in prefixes %}
<label for="{{p.prefix}}" class="fcontrol__radio-label-stacked create__radio-button">
<input id="{{p.prefix}}" class="fcontrol__radio-button-stacked ays-ignore" type="radio" value="{{p.prefix}}" name="shoulder" {% selected_radio "shoulder" forloop.counter p.prefix %} /> <span>{% shoulder_display p "False" testPrefixes "True" %}</span>
</label>
{% endfor %}
{% endif %}
</div>
</fieldset>
</div>

0 comments on commit b393608

Please sign in to comment.