mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-02-21 05:49:41 +00:00
Hotfix: Unable to add training item in requirements form
This commit is contained in:
@@ -32,11 +32,7 @@
|
||||
{% endif %}
|
||||
<form id="requirement-form" action="{{ form.action|default:request.path }}" method="post">{% csrf_token %}
|
||||
{% render_field form.level|attr:'hidden' value=form.level.initial %}
|
||||
<div class="form-group form-row">
|
||||
<label for="item_id" class="col-sm-2 col-form-label">Item</label>
|
||||
<select name="item" id="item_id" class="form-control selectpicker custom-select col-sm-10" data-live-search="true" data-sourceurl="{% url 'api_secure' model='training_item' %}" required>
|
||||
</select>
|
||||
</div>
|
||||
{% include 'partials/item_field.html' %}
|
||||
<div class="form-group form-row">
|
||||
<label for="depth" class="col-sm-2 col-form-label">Depth</label>
|
||||
{% render_field form.depth|add_class:'form-control col-sm'|attr:'required' %}
|
||||
|
||||
@@ -28,14 +28,7 @@
|
||||
{% include 'form_errors.html' %}
|
||||
{% csrf_token %}
|
||||
{% render_field form.trainee|attr:'hidden' value=form.trainee.initial %}
|
||||
<div class="form-group form-row">
|
||||
<label for="item_id" class="col col-form-label">Item</label>
|
||||
<select name="item" id="item_id" class="selectpicker col-sm-10 px-0" data-live-search="true" data-sourceurl="{% url 'api_secure' model='training_item' %}?fields=display_id,description&filters=active" required>
|
||||
{% if object.item %}
|
||||
<option value="{{object.item.pk}}" selected>{{object.item}}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
{% include 'partials/item_field.html' %}
|
||||
<div class="form-group form-row">
|
||||
<label for="depth" class="col-sm-2 col-form-label">Depth</label>
|
||||
{% render_field form.depth|add_class:'form-control custom-select col-sm-8' %}
|
||||
|
||||
8
training/templates/partials/item_field.html
Normal file
8
training/templates/partials/item_field.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="form-group form-row">
|
||||
<label for="item_id" class="col col-form-label">Item</label>
|
||||
<select name="item" id="item_id" class="selectpicker col-sm-10 px-0" data-live-search="true" data-sourceurl="{% url 'api_secure' model='training_item' %}?fields=display_id,description&filters=active" required>
|
||||
{% if item %}
|
||||
<option value="{{form.item.pk}}" selected>{{item}}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
Reference in New Issue
Block a user