mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-28 19:02:16 +00:00
Made a nice new UI for autocompleting
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
{{ object.pk }}{% endif %}{% else %}New Event{% endif %}{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
<link href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"/>
|
||||
<link rel="stylesheet" href="{% static "css/bootstrap-select.min.css" %}"/>
|
||||
<link rel="stylesheet" href="{% static "css/ajax-bootstrap-select.css" %}"/>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
@@ -14,6 +15,9 @@
|
||||
<script src="{% static "js/interaction.js" %}"></script>
|
||||
<script src="{% static "js/modal.js" %}"></script>
|
||||
|
||||
<script src="{% static "js/bootstrap-select.js" %}"></script>
|
||||
<script src="{% static "js/ajax-bootstrap-select.js" %}"></script>
|
||||
|
||||
<script src="{% static "js/autocompleter.js" %}"></script>
|
||||
|
||||
<script>
|
||||
@@ -123,15 +127,12 @@
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="row">
|
||||
<input type="hidden" id="{{ form.person.id_for_label }}" name="{{ form.person.name }}"
|
||||
value="{{ form.person.value|default_if_none:"" }}"/>
|
||||
|
||||
<div class="col-sm-9 col-md-7 col-lg-8">
|
||||
<input type="text" id="{{ form.person.id_for_label }}-input"
|
||||
class="form-control autocomplete-json autocomplete-update"
|
||||
value="{{ person|default_if_none:"" }}"
|
||||
data-sourceurl="{% url 'api_secure' model='person' %}"
|
||||
data-target="{{ form.person.id_for_label }}"/>
|
||||
<select id="{{ form.person.id_for_label }}" name="{{ form.person.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='person' %}">
|
||||
{% if person %}
|
||||
<option value="{{form.person.value}}" selected="selected" data-update_url="{% url 'person_update' form.person.value %}">{{ person }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
||||
<div class="btn-group">
|
||||
@@ -139,7 +140,7 @@
|
||||
data-target="#{{ form.person.id_for_label }}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
<a href="{% if form.person.value %}{% url 'person_update' form.person.value %}{% endif %}" class="btn btn-default modal-href" id="{{ form.person.id_for_label }}-update">
|
||||
<a href="{% if form.person.value %}{% url 'person_update' form.person.value %}{% endif %}" class="btn btn-default modal-href" id="{{ form.person.id_for_label }}-update" data-target="#{{ form.person.id_for_label }}">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
</div>
|
||||
@@ -153,16 +154,12 @@
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="row">
|
||||
<input type="hidden" id="{{ form.organisation.id_for_label }}"
|
||||
name="{{ form.organisation.name }}"
|
||||
value="{{ form.organisation.value|default_if_none:"" }}"/>
|
||||
|
||||
<div class="col-sm-9 col-md-7 col-lg-8">
|
||||
<input type="text" id="{{ form.organisation.id_for_label }}-input"
|
||||
class="form-control autocomplete-json autocomplete-update"
|
||||
value="{{ organisation|default_if_none:"" }}"
|
||||
data-sourceurl="{% url 'api_secure' model='organisation' %}"
|
||||
data-target="{{ form.organisation.id_for_label }}"/>
|
||||
<select id="{{ form.organisation.id_for_label }}" name="{{ form.organisation.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='organisation' %}">
|
||||
{% if organisation %}
|
||||
<option value="{{form.organisation.value}}" selected="selected" data-update_url="{% url 'organisation_update' form.organisation.value %}">{{ organisation }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
||||
<div class="btn-group">
|
||||
@@ -170,7 +167,7 @@
|
||||
data-target="#{{ form.organisation.id_for_label }}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
<a href="{% if form.organisation.value %}{% url 'organisation_update' form.organisation.value %}{% endif %}" class="btn btn-default modal-href" id="{{ form.organisation.id_for_label }}-update">
|
||||
<a href="{% if form.organisation.value %}{% url 'organisation_update' form.organisation.value %}{% endif %}" class="btn btn-default modal-href" id="{{ form.organisation.id_for_label }}-update" data-target="#{{ form.organisation.id_for_label }}">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
</div>
|
||||
@@ -216,15 +213,12 @@
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="row">
|
||||
<input type="hidden" id="{{ form.venue.id_for_label }}" name="{{ form.venue.name }}"
|
||||
value="{{ form.venue.value|default_if_none:"" }}"/>
|
||||
|
||||
<div class="col-sm-9 col-md-7 col-lg-8">
|
||||
<input type="text" id="{{ form.venue.id_for_label }}-input"
|
||||
class="form-control autocomplete-json autocomplete-update"
|
||||
value="{{ venue|default_if_none:"" }}"
|
||||
data-sourceurl="{% url 'api_secure' model='venue' %}"
|
||||
data-target="{{ form.venue.id_for_label }}"/>
|
||||
<select id="{{ form.venue.id_for_label }}" name="{{ form.venue.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='venue' %}">
|
||||
{% if venue %}
|
||||
<option value="{{form.venue.value}}" selected="selected" data-update_url="{% url 'venue_update' form.venue.value %}">{{ venue }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3 col-md-5 col-lg-4 align-right">
|
||||
<div class="btn-group">
|
||||
@@ -232,7 +226,7 @@
|
||||
data-target="#{{ form.venue.id_for_label }}">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
<a href="{% if object.venue %}{% url 'venue_update' object.venue.pk %}{% endif %}" class="btn btn-default modal-href" id="{{ form.venue.id_for_label }}-update">
|
||||
<a href="{% if object.venue %}{% url 'venue_update' object.venue.pk %}{% endif %}" class="btn btn-default modal-href" id="{{ form.venue.id_for_label }}-update" data-target="#{{ form.venue.id_for_label }}">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
</div>
|
||||
@@ -325,14 +319,11 @@
|
||||
class="col-sm-4 control-label">{{ form.mic.label }}</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="{{ form.mic.id_for_label }}" name="{{ form.mic.name }}"
|
||||
value="{{ form.mic.value|default_if_none:"" }}"/>
|
||||
|
||||
<input type="text" id="{{ form.mic.id_for_label }}-input"
|
||||
class="form-control autocomplete-json"
|
||||
data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials"
|
||||
data-target="{{ form.mic.id_for_label }}"
|
||||
value="{{ mic.name|default_if_none:"" }}"/>
|
||||
<select id="{{ form.mic.id_for_label }}" name="{{ form.mic.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials">
|
||||
{% if mic %}
|
||||
<option value="{{form.mic.value}}" selected="selected" >{{ mic.name }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -342,15 +333,11 @@
|
||||
class="col-sm-4 control-label">{{ form.checked_in_by.label }}</label>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="{{ form.checked_in_by.id_for_label }}"
|
||||
name="{{ form.checked_in_by.name }}"
|
||||
value="{{ form.checked_in_by.value|default_if_none:"" }}"/>
|
||||
|
||||
<input type="text" id="{{ form.checked_in_by.id_for_label }}-input"
|
||||
class="form-control autocomplete-json"
|
||||
data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials"
|
||||
data-target="{{ form.checked_in_by.id_for_label }}"
|
||||
value="{{ checked_in_by.name|default_if_none:"" }}"/>
|
||||
<select id="{{ form.checked_in_by.id_for_label }}" name="{{ form.checked_in_by.name }}" class="form-control selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='profile' %}?fields=first_name,last_name,initials">
|
||||
{% if checked_in_by %}
|
||||
<option value="{{form.checked_in_by.value}}" selected="selected" >{{ checked_in_by.name }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user