layerindex-web/templates/layerindex/duplicates.html
Paul Eggleton 61e9b04859 Fix drop-down alignment on duplicates page
Hack the dropdown HTML to fix the dropdown menu appearing at the bottom
of the "Duplicate recipes" section (which may be below the bottom of the
browser window). This is probably not the correct fix, but it works.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2018-11-20 11:58:42 +13:00

225 lines
9.2 KiB
HTML

{% extends "base_toplevel.html" %}
{% load i18n %}
{% load static %}
{% comment %}
layerindex-web - duplicates page template
Copyright (C) 2013-2014 Intel Corporation
Licensed under the MIT license, see COPYING.MIT for details
{% endcomment %}
<!--
{% block title_append %} - duplicates{% endblock %}
-->
{% block content %}
{% autoescape on %}
<div class="row">
<div class="col-md-12">
<div class="pull-right dropdown">
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Branch: <b>{{ url_branch }}</b>
<b class="caret"></b>
</button>
<ul class="dropdown-menu" style="right: auto;">
{% for branch in all_branches %}
<li><a href="{% url this_url_name branch.name %}">
{% if branch.name == url_branch %}<b>{% endif %}
{{ branch.name }}
{% if branch.short_description %}
({{ branch.short_description }})
{% endif %}
{% if branch.name == url_branch %}</b>{% endif %}
</a></li>
{% endfor %}
</ul>
<div id="layerDialog" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="layerDialogLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 id="layerDialogLabel">Select layers to include</h3>
</div>
<form action="" method="get">
<div class="modal-body">
<div class="form-group has-feedback has-clear">
<input type="text" class="form-control" id="layersearchtext" placeholder="search layers">
<a class="glyphicon glyphicon-remove-sign form-control-feedback form-control-clear" id="layersearchclear" style="pointer-events: auto; text-decoration: none;cursor: pointer;"></a>
</div>
<div class="scrolling">
<table class="layerstable"><tbody>
{% for layerbranch in layers %}
<tr>
<td class="checkboxtd"><input
type="checkbox"
class="filterlayercheckbox"
name="l"
value="{{ layerbranch.layer.id }}" id="id_layer_{{layerbranch.layer.id}}"
{% if showlayers and layerbranch.layer.id in showlayers %}
checked
{% endif %}
/>
</td>
<td><label for="id_layer_{{layerbranch.layer.id}}">{{ layerbranch.layer.name }}</label></td>
</tr>
{% endfor %}
</tbody></table>
</div>
<div class="buttonblock">
<button type="button" class="btn btn-default" id="id_select_all">Select all</button>
<button type="button" class="btn btn-default buttonblock-btn" id="id_select_none">Select none</button>
</div>
</div>
<div class="modal-footer">
<input type="submit" value="Filter" class="btn btn-primary" />
<button class="btn btn-default" id="id_cancel" data-dismiss="modal">Cancel</button>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
<a href="#layerDialog" role="button" class="btn btn-default nav-spacer" data-toggle="modal">Filter layers {% if showlayers %}<span class="badge badge-success">{{ showlayers|length }}</span>{% endif %}</a>
</div>
<h2>Duplicate recipes</h2>
{% if recipes %}
<p>Recipes with the same name in different layers:</p>
<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 recipes %}
<tr {% if recipe.preferred_count > 0 %}class="text-muted"{% endif %}>
<td><a href="{% url 'recipe' recipe.id %}">{{ recipe.name }}</a></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>
{% else %}
<p>No matching duplicate recipes in database.</p>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Duplicate classes</h2>
{% if classes %}
<p>Classes with the same name in different layers:</p>
<table class="table table-striped table-bordered recipestable">
<thead>
<tr>
<th>Class name</th>
<th>Layer</th>
</tr>
</thead>
<tbody>
{% for class in classes %}
<tr>
<td><a href="{{ class.vcs_web_url }}">{{ class.name }}</a></td>
<td><a href="{% url 'layer_item' 'master' class.layerbranch.layer.name %}">{{ class.layerbranch.layer.name }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No matching duplicate classes in database.</p>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-md-12">
<h2>Duplicate include files</h2>
{% if incfiles %}
<p>Include files with the same name in different layers:</p>
<table class="table table-striped table-bordered recipestable">
<thead>
<tr>
<th>Include file</th>
<th>Layer</th>
</tr>
</thead>
<tbody>
{% for incfile in incfiles %}
<tr>
<td><a href="{{ incfile.vcs_web_url }}">{{ incfile.path }}</a></td>
<td><a href="{% url 'layer_item' 'master' incfile.layerbranch.layer.name %}">{{ incfile.layerbranch.layer.name }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>No matching duplicate include files in database.</p>
{% endif %}
</div>
</div>
{% endautoescape %}
{% endblock %}
{% block scripts %}
<script>
$(document).ready(function() {
firstfield = $("#filter-form input:text").first()
if( ! firstfield.val() )
firstfield.focus()
});
$('#id_select_all').click(function (e) {
$('.layerstable').find('tr:visible').find('.filterlayercheckbox').prop('checked', true);
});
$('#id_select_none').click(function (e) {
$('.layerstable').find('tr:visible').find('.filterlayercheckbox').prop('checked', false);
});
function clearLayerSearch() {
$("#layersearchtext").val('');
$(".layerstable > tbody > tr").show();
}
$('#id_cancel').click(function (e) {
$('.filterlayercheckbox').prop('checked', false);
showlayers = {{ showlayers }}
for(i in showlayers) {
$('#id_layer_' + showlayers[i]).prop('checked', true);
}
clearLayerSearch();
});
$("#layersearchtext").on("input", function() {
var value = $(this).val().toLowerCase();
$(".layerstable > tbody > tr").filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
$("#layersearchclear").click(function(){
clearLayerSearch();
$("#layersearchtext").focus();
});
</script>
{% endblock %}