Skip to content

Commit

Permalink
style work form
Browse files Browse the repository at this point in the history
  • Loading branch information
goose-life committed Jan 9, 2024
1 parent 834ed40 commit ec60128
Show file tree
Hide file tree
Showing 4 changed files with 385 additions and 419 deletions.
35 changes: 17 additions & 18 deletions indigo_app/templates/indigo_api/_work_commencement_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class="form-group row">
<label class="col-2 col-form-label">{% trans 'Commenced by' %}</label>
<div class="col">
<div class="col-4">
<input type="hidden" id="{{ form.commencing_work.id_for_label }}" name="{{ form.commencing_work.html_name }}" value="{{ form.commencing_work.value|default:'' }}">
{% if commencing_work %}
<div class="mb-2">
Expand All @@ -15,33 +15,32 @@
<div>
{% url 'work_form_commencement' place.place_code as edit_url %}
<button
class="btn btn-outline-primary"
type="button"
hx-get="{% url 'place_work_chooser' place.place_code %}?submit={{ edit_url|urlencode }}&target={{ "#work-form-commencing-work"|urlencode }}&field=work-commencing_work"
hx-target="#work-commencing-work-modal"
hx-trigger="click"
data-toggle="modal"
data-target="#work-commencing-work-modal"
>{% trans 'Choose work' %}</button>
class="btn btn-outline-primary"
type="button"
hx-get="{% url 'place_work_chooser' place.place_code %}?submit={{ edit_url|urlencode }}&target={{ "#work-form-commencing-work"|urlencode }}&field=work-commencing_work"
hx-target="#work-commencing-work-modal"
hx-trigger="click"
data-toggle="modal"
data-target="#work-commencing-work-modal"
>{% trans 'Choose commencing work' %}</button>

{% if commencing_work %}
<button
class="btn btn-outline-danger ml-2"
hx-get="{{ edit_url }}"
hx-target="#work-form-commencing-work"
class="btn btn-outline-danger ml-2"
hx-get="{{ edit_url }}"
hx-target="#work-form-commencing-work"
>Clear</button>
{% endif %}
</div>

<div class="form-text text-muted">{% trans 'The work that gives the commencement date of this work.' %}</div>
</div>
<div class="col-6 form-text text-muted">{% trans 'The work that brings this work into force.' %}</div>
</div>

<div
id="work-commencing-work-modal"
class="modal modal-blur fade"
style="display: none"
tabindex="-1"
id="work-commencing-work-modal"
class="modal modal-blur fade"
style="display: none"
tabindex="-1"
>
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">Loading...</div>
Expand Down
39 changes: 19 additions & 20 deletions indigo_app/templates/indigo_api/_work_parent_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div class="form-group row">
<label class="col-2 col-form-label">{% trans 'Primary work' %}</label>
<div class="col">
<div class="col-4">
<input type="hidden" id="{{ form.parent_work.id_for_label }}" name="{{ form.parent_work.html_name }}" value="{{ form.parent_work.value|default:'' }}">
{% if work.parent_work %}
<div class="mb-2">
Expand All @@ -15,35 +15,34 @@
<div>
{% url 'work_form_parent' place.place_code as edit_url %}
<button
class="btn btn-outline-primary"
type="button"
hx-get="{% url 'place_work_chooser' place.place_code %}?submit={{ edit_url|urlencode }}&target={{ "#work-form-parent"|urlencode }}&field=work-parent_work"
hx-target="#work-parent-modal"
hx-trigger="click"
data-toggle="modal"
data-target="#work-parent-modal"
>{% trans 'Choose parent work' %}</button>
class="btn btn-outline-primary"
type="button"
hx-get="{% url 'place_work_chooser' place.place_code %}?submit={{ edit_url|urlencode }}&target={{ "#work-form-parent"|urlencode }}&field=work-parent_work"
hx-target="#work-parent-modal"
hx-trigger="click"
data-toggle="modal"
data-target="#work-parent-modal"
>{% trans 'Choose primary work' %}</button>

{% if work.parent_work %}
<button
class="btn btn-outline-danger ml-2"
hx-get="{{ edit_url }}"
hx-target="#work-form-parent"
class="btn btn-outline-danger ml-2"
hx-get="{{ edit_url }}"
hx-target="#work-form-parent"
>Clear</button>
{% endif %}
</div>
</div>
<div class="col-6 form-text text-muted">
{% trans 'The primary work for regulations is the Act in terms of which they were promulgated.' %}
</div>
</div>

<p class="form-text text-muted">
{% trans 'The primary work for regulations and notices is the primary Act.' %}
</p>

<div
id="work-parent-modal"
class="modal modal-blur fade"
style="display: none"
tabindex="-1"
id="work-parent-modal"
class="modal modal-blur fade"
style="display: none"
tabindex="-1"
>
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">Loading...</div>
Expand Down
33 changes: 18 additions & 15 deletions indigo_app/templates/indigo_api/_work_repeal_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
<div>
{% url 'work_form_repeal' place.place_code as edit_url %}
<button
class="btn btn-outline-primary"
type="button"
hx-get="{% url 'place_work_chooser' place.place_code %}?submit={{ edit_url|urlencode }}&target={{ "#work-form-repeal"|urlencode }}&field=work-repealed_by"
hx-target="#work-repeal-modal"
hx-trigger="click"
data-toggle="modal"
data-target="#work-repeal-modal"
class="btn btn-outline-primary"
type="button"
hx-get="{% url 'place_work_chooser' place.place_code %}?submit={{ edit_url|urlencode }}&target={{ "#work-form-repeal"|urlencode }}&field=work-repealed_by"
hx-target="#work-repeal-modal"
hx-trigger="click"
data-toggle="modal"
data-target="#work-repeal-modal"
>{% trans 'Choose repealing work' %}</button>

{% if work.repealed_by %}
<button
class="btn btn-outline-danger ml-2"
hx-get="{{ edit_url }}"
hx-target="#work-form-repeal"
class="btn btn-outline-danger ml-2"
hx-get="{{ edit_url }}"
hx-target="#work-form-repeal"
>Clear</button>
{% endif %}
</div>
Expand All @@ -38,20 +38,23 @@
{% if work.repealed_by %}
<div class="form-group row">
<label class="col-2 col-form-label required">{% trans 'Repeal date' %}</label>
<div class="col">
<div class="col-4">
<input type="date" class="form-control"
id="{{ form.repealed_date.id_for_label }}" name="{{ form.repealed_date.html_name }}"
required
value="{{ form.repealed_date.value|date:"Y-m-d"|default:'' }}">
</div>
<div class="col-6 form-text text-muted">
{% trans 'The default date of repeal is the date of commencement of the selected repealing work.' %}
</div>
</div>
{% endif %}

<div
id="work-repeal-modal"
class="modal modal-blur fade"
style="display: none"
tabindex="-1"
id="work-repeal-modal"
class="modal modal-blur fade"
style="display: none"
tabindex="-1"
>
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
<div class="modal-content">Loading...</div>
Expand Down
Loading

0 comments on commit ec60128

Please sign in to comment.