layerindex-web/templates/layerindex/recipes.html
Tim Orling bd58fbe7df bootstrap_pagination: disable via comment
Wrap the is_pagination usage of bootstrap_pagination with comment/endcomment
to avoid incompatible module.

We will need to re-write the pagination code.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
2023-10-05 20:09:12 -07:00

135 lines
5.6 KiB
HTML

{% extends "base_toplevel.html" %}
{% load i18n %}
{% comment %}
layerindex-web - recipe index page template
Copyright (C) 2013 Intel Corporation
Licensed under the MIT license, see COPYING.MIT for details
{% endcomment %}
<!--
{% block title_append %} - recipes{% endblock %}
-->
{% block navs %}
{% autoescape on %}
<li><a href="{% url 'layer_list' url_branch %}">Layers</a></li>
<li class="active"><a href="{% url 'recipe_search' url_branch %}">Recipes</a></li>
<li><a href="{% url 'machine_search' url_branch %}">Machines</a></li>
<li><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 'recipe_search' url_branch %}" method="get" onsubmit="return validate()">
<div class="form-group" id="searchfield">
<div class="controls">
<div class="input-group col-md-6">
<input type="text" class="form-control" id="id_search_text" placeholder="Search recipes" name="q" value="{{ search_keyword }}" />
<div class="input-group-btn">
<button class="btn btn-default" type="submit">search</button>
<a class="btn btn-link" id="helplink" role="button"
data-toggle="popover"
data-html="true"
title="Searching"
data-placement="bottom"
data-content="
<p>Enter terms to search for, separating multiple terms with spaces. Double quotes can be used to enclose phrases containing spaces.</p>
<p>By default, recipe name, summary and description fields will be searched (with preference given to recipe name matches).</p>
<p><b>Advanced query terms</b></p>
<ul>
<li><b>pn:</b><i>example</i> - match recipes whose name is exactly <i>example</i></li>
<li><b>depends:</b><i>other</i> - match recipes that depend on <i>other</i> (i.e. with <i>other</i> in <code>DEPENDS</code>)</li>
<li><b>inherits:</b><i>class</i> - match recipes that inherit the specified <i>class</i></li>
<li><b>layer:</b><i>layer</i> - match recipes from the specified <i>layer</i></li>
</ul>
<p><b>Note:</b> do not use spaces when using the advanced query terms above.</p>
">
<span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> help
</a>
</div>
</div>
<span class="help-block" id="errortext"></span>
</div>
</div>
</form>
</div>
<div id="error"> </div>
{% if recipe_list %}
<table class="table table-striped table-bordered recipestable">
<thead>
<tr>
<th>Recipe name</th>
<th>Version</th>
<th class="col-md-9">Description</th>
<th>Layer</th>
</tr>
</thead>
<tbody>
{% for recipe in recipe_list %}
<tr {% if recipe.preferred_count > 0 %}class="text-muted"{% endif %}>
<td><a href="{% url 'recipe' recipe.id %}">{{ recipe.name }}</a>{% if 'image' in recipe.inherits.split %} <i class="glyphicon glyphicon-hdd" aria-hidden="true"></i>{% endif %}{% if recipe.blacklisted %}<span class="label label-inverse" title="{{ recipe.blacklisted }}">blacklisted</span>{% endif %}</td>
<td>{{ recipe.pv }}</td>
<td>{{ recipe.short_desc }}</td>
<td><a href="{% url 'layer_item' url_branch recipe.layerbranch.layer.name %}">{{ recipe.layerbranch.layer.name }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% if is_paginated %}
{% comment %}
{% load bootstrap_pagination %}
<div class="text-center">
{% bootstrap_paginate page_obj range=10 show_prev_next="false" show_first_last="true" %}
</div>
{% endcomment %}
{% endif %}
{% else %}
{% if search_keyword %}
<p>No matching recipes in database.</p>
{% endif %}
{% endif %}
{% endautoescape %}
{% endblock %}
{% block scripts %}
<script>
$(document).ready(function() {
firstfield = $("#filter-form input:text").first()
if( ! firstfield.val() )
firstfield.focus()
$('.glyphicon-hdd').tooltip({title:"Inherits image"});
$('.label-inverse').tooltip();
$('[data-toggle="popover"]').popover({
container: 'body'
});
});
function validate(){
if (!$("#id_search_text").val()){
$("#errortext").html("<p>Please specify search text</p>");
$("#searchfield").addClass("has-error");
return false;
}
}
</script>
{% endblock %}