Skip to content
Snippets Groups Projects
Verified Commit a8b649b3 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'master' into 108-add-licence-information-page

parents c82e52ff 1c5ed5ea
No related branches found
No related tags found
1 merge request!146Resolve "Add licence information page"
Pipeline #1482 failed
...@@ -8,8 +8,13 @@ ...@@ -8,8 +8,13 @@
ignore = untracked ignore = untracked
[submodule "apps/official/AlekSIS-App-DashboardFeeds"] [submodule "apps/official/AlekSIS-App-DashboardFeeds"]
path = apps/official/AlekSIS-App-DashboardFeeds path = apps/official/AlekSIS-App-DashboardFeeds
url = https://edugit.org/AlekSIS/Official/AlekSIS-App-DashboardFeeds.git url = https://edugit.org/AlekSIS/Official/AlekSIS-App-DashboardFeeds
ignore = untracked ignore = untracked
[submodule "apps/official/AlekSIS-App-LDAP"] [submodule "apps/official/AlekSIS-App-LDAP"]
path = apps/official/AlekSIS-App-LDAP path = apps/official/AlekSIS-App-LDAP
url = https://edugit.org/AlekSIS/official/AlekSIS-App-LDAP url = https://edugit.org/AlekSIS/official/AlekSIS-App-LDAP
ignore = untracked
[submodule "apps/official/AlekSIS-App-Untis"]
path = apps/official/AlekSIS-App-Untis
url = https://edugit.org/AlekSIS/official/AlekSIS-App-Untis
ignore = untracked
...@@ -66,7 +66,7 @@ $(document).ready( function () { ...@@ -66,7 +66,7 @@ $(document).ready( function () {
}); });
// Initialise auto-completion for search bar // Initialise auto-completion for search bar
window.autocomplete = new Autocomplete({}); window.autocomplete = new Autocomplete({minimum_length: 2});
window.autocomplete.setup(); window.autocomplete.setup();
// Initialize text collapsibles [MAT, own work] // Initialize text collapsibles [MAT, own work]
......
...@@ -35,9 +35,20 @@ Autocomplete.prototype.setup = function () { ...@@ -35,9 +35,20 @@ Autocomplete.prototype.setup = function () {
self.query_box.trigger("keydown"); self.query_box.trigger("keydown");
}); });
this.query_box.keyup(function () {
var query = self.query_box.val();
if (query.length < self.minimum_length) {
$("#search-results").remove();
return true;
}
self.fetch(query);
return true;
});
// Watch the input box. // Watch the input box.
this.query_box.keydown(function (e) { this.query_box.keydown(function (e) {
var query = self.query_box.val();
if (e.which === 38) { // Keypress Up if (e.which === 38) { // Keypress Up
if (!self.selected_element) { if (!self.selected_element) {
...@@ -69,14 +80,6 @@ Autocomplete.prototype.setup = function () { ...@@ -69,14 +80,6 @@ Autocomplete.prototype.setup = function () {
e.preventDefault(); e.preventDefault();
window.location.href = self.selected_element.attr("href"); window.location.href = self.selected_element.attr("href");
} }
if (query.length < self.minimum_length) {
$("#search-results").remove();
return true;
}
self.fetch(query);
return true;
}); });
// // On selecting a result, remove result box // // On selecting a result, remove result box
......
...@@ -189,6 +189,7 @@ a.collection-item.search-item { ...@@ -189,6 +189,7 @@ a.collection-item.search-item {
div#search-results { div#search-results {
position: absolute; position: absolute;
margin-top: -10px;
width: 100%; width: 100%;
} }
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
<input type="text" name="{{ form.q.name }}" id="{{ form.q.id }}" value="{% firstof form.q.value "" %}" <input type="text" name="{{ form.q.name }}" id="{{ form.q.id }}" value="{% firstof form.q.value "" %}"
placeholder="{% trans "Search Term" %}"> placeholder="{% trans "Search Term" %}">
<h6>{{ form.models.label }}</h6>
<div> <div>
{% for group, items in form.models|select_options %} {% for group, items in form.models|select_options %}
{% for choice, value, selected in items %} {% for choice, value, selected in items %}
...@@ -28,10 +27,12 @@ ...@@ -28,10 +27,12 @@
{% endfor %} {% endfor %}
</div> </div>
<button type="submit" class="btn waves-effect waves-light green"> <p>
<i class="material-icons left">search</i> <button type="submit" class="btn waves-effect waves-light green">
{% blocktrans %}Search{% endblocktrans %} <i class="material-icons left">search</i>
</button> {% blocktrans %}Search{% endblocktrans %}
</button>
</p>
<h5>{% trans "Results" %}</h5> <h5>{% trans "Results" %}</h5>
...@@ -44,7 +45,9 @@ ...@@ -44,7 +45,9 @@
</a> </a>
{% empty %} {% empty %}
<li class="collection-item"> <li class="collection-item">
{% trans "No search results could be found to your search" %} <p class="flow-text">
{% trans "No search results could be found to your search." %}
</p>
</li> </li>
{% endfor %} {% endfor %}
</div> </div>
...@@ -81,11 +84,13 @@ ...@@ -81,11 +84,13 @@
</ul> </ul>
{% endif %} {% endif %}
{% else %} {% else %}
<div class="collection"> <ul class="collection">
<li class="collection-item"> <li class="collection-item">
{% trans "Please enter a search term above" %} <p class="flow-text">
{% trans "Please enter a search term above." %}
</p>
</li> </li>
</div> </ul>
{% endif %} {% endif %}
......
Subproject commit b46a822b8d554fea59da85d825e414663ccce346
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment