mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00

On the machines/distros/classes pages, if you type a keyword and then click "search", and there are no matches, then you click on "browse", there shouldn't be any search text in the box anymore because you're viewing all items, so use a bit of javascript to ensure that. While I'm at it, set reasonable ids for the search field on each page (including the recipes page, although there is no browse button there so that is just for consistency). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
93 lines
3.0 KiB
HTML
93 lines
3.0 KiB
HTML
{% extends "base_toplevel.html" %}
|
|
{% load i18n %}
|
|
|
|
{% comment %}
|
|
|
|
layerindex-web - class index page template
|
|
|
|
Copyright (C) 2013, 2017 Intel Corporation
|
|
Copyright (C) 2016 Wind River Systems
|
|
Licensed under the MIT license, see COPYING.MIT for details
|
|
|
|
{% endcomment %}
|
|
|
|
|
|
<!--
|
|
{% block title_append %} - classes{% endblock %}
|
|
-->
|
|
|
|
{% block navs %}
|
|
{% autoescape on %}
|
|
<li><a href="{% url 'layer_list' url_branch %}">Layers</a></li>
|
|
<li><a href="{% url 'recipe_search' url_branch %}">Recipes</a></li>
|
|
<li><a href="{% url 'machine_search' url_branch %}">Machines</a></li>
|
|
<li class="active"><a href="{% url 'class_search' url_branch %}">Classes</a></li>
|
|
<li><a href="{% url 'distro_search' url_branch %}">Distros</a></li>
|
|
{% endautoescape %}
|
|
{% endblock %}
|
|
|
|
|
|
{% block content_inner %}
|
|
{% autoescape on %}
|
|
|
|
<div class="bottom-margin">
|
|
<form id="filter-form" action="{% url 'class_search' url_branch %}" method="get">
|
|
<div class="input-group col-md-6">
|
|
<input type="text" class="form-control" id="id_search_text" placeholder="Search classes" name="q" value="{{ search_keyword }}" />
|
|
<div class="input-group-btn">
|
|
<button class="btn btn-default" type="submit" name="search" value="1">search</button>
|
|
<button class="btn btn-default" type="submit" name="browse" value="1" id="id_browse_btn">browse</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
{% if class_list %}
|
|
<table class="table table-striped table-bordered classestable">
|
|
<thead>
|
|
<tr>
|
|
<th>Class Name</th>
|
|
<th>Layer</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
{% for class in class_list %}
|
|
<tr>
|
|
<td><a href="{{ class.vcs_web_url }}">{{ class.name }}</a></td>
|
|
<td><a href="{% url 'layer_item' url_branch class.layerbranch.layer.name %}">{{ class.layerbranch.layer.name }}</a></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
{% if is_paginated %}
|
|
{% load pagination %}
|
|
{% pagination page_obj %}
|
|
{% endif %}
|
|
{% else %}
|
|
{% if search_keyword %}
|
|
<p>No matching classes in database.</p>
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
|
|
{% endautoescape %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
{% block scripts %}
|
|
<script>
|
|
{% if not class_list %}
|
|
$(document).ready(function() {
|
|
$("#filter-form input:text").first().select().focus();
|
|
});
|
|
{% endif %}
|
|
|
|
$("#id_browse_btn").click(function() {
|
|
$("#id_search_text").val("");
|
|
});
|
|
</script>
|
|
{% endblock %}
|