mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2026-01-27 09:01:24 +01:00
Use a more modern version of Bootstrap and take the opportunity to upgrade jQuery to the latest version at the same time. This provides better browser compatibility, moves to MIT license, allows us to make the site more responsive for different devices in future, and provides theming capabilities for custom installs among other improvements. (I chose to upgrade to v3 for now rather than straight to v4 as it was easier to do this gradually.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
431 lines
20 KiB
HTML
431 lines
20 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n %}
|
|
{% load static %}
|
|
|
|
{% comment %}
|
|
|
|
layerindex-web - layer detail page template
|
|
|
|
Copyright (C) 2013 Intel Corporation
|
|
Licensed under the MIT license, see COPYING.MIT for details
|
|
|
|
{% endcomment %}
|
|
|
|
|
|
<!--
|
|
{% autoescape on %}
|
|
{% block title_append %} - {{ layeritem.name }}{% endblock %}
|
|
{% endautoescape %}
|
|
-->
|
|
|
|
{% block content %}
|
|
|
|
{% autoescape on %}
|
|
<ul class="breadcrumb">
|
|
<li><a href="{% url 'layer_list' url_branch %}">{{ layerbranch.branch.name }}</a></li>
|
|
<li class="active">{{ layeritem.name }}</li>
|
|
</ul>
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="page-header">
|
|
<h1>{{ layeritem.name }}
|
|
{% if layerbranch.yp_compatible_version %}
|
|
<a href="{{layerbranch.yp_compatible_version.link_url}}"><img src="{{layerbranch.yp_compatible_version.image_url}}" alt="{{layerbranch.yp_compatible_version.description}}" class="yp-icon" title="{{layerbranch.yp_compatible_version.description}}"></a>
|
|
{% endif %}
|
|
{% if layeritem.status == "N" %}
|
|
<span class="label label-warning">Unpublished</span>
|
|
{% endif %}
|
|
{% if user.is_authenticated %}
|
|
<span class="pull-right">
|
|
{% if perms.layerindex.publish_layer or useredit %}
|
|
<a href="{% url 'edit_layer' url_branch layeritem.name %}" class="btn btn-default">Edit layer</a>
|
|
{% if layeritem.layernote_set.count == 0 %}
|
|
<a href="{% url 'add_layernote' layeritem.name %}" class="btn btn-default">Add note</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
</span>
|
|
{% endif %}
|
|
</h1>
|
|
</div>
|
|
</div> <!-- end of row -->
|
|
</div> <!-- end of container-fluid -->
|
|
|
|
<div class="container-fluid">
|
|
{% if not layerbranch %}
|
|
<div class="row">
|
|
<div class="alert alert-danger">
|
|
This layer does not exist for branch {{ url_branch }}.
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
<div class="row">
|
|
{% for note in layeritem.layernote_set.all %}
|
|
<div class="alert alert-warning">
|
|
{{ note.text|urlize }}
|
|
{% if perms.layerindex.publish_layer or useredit %}
|
|
<br><br>
|
|
<p>
|
|
<a href="{% url 'edit_layernote' layeritem.name note.pk %}" class="btn btn-default">Edit note</a>
|
|
<a href="{% url 'delete_layernote' layeritem.name note.pk %}" class="btn btn-default">Delete note</a>
|
|
</p>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="description col-md-7">
|
|
<p style="white-space: pre-wrap">{{ layeritem.description }}</p>
|
|
<p>
|
|
{% if layeritem.usage_url %}
|
|
<span class="label label-info">
|
|
<a href="{{ layerbranch.get_usage_url }}">Setup information</a>
|
|
</span>
|
|
{% endif %}
|
|
{% if layeritem.mailing_list_url %}
|
|
<span class="label label-info">
|
|
<a href="{{ layeritem.mailing_list_url }}">Mailing list</a>
|
|
</span>
|
|
{% endif %}
|
|
</p>
|
|
|
|
<h3>Git repository</h3>
|
|
|
|
<p><span data-toggle="tooltip" title="Select URL"><i class="glyphicon glyphicon-circle-arrow-right selectallicon" for="vcs_url" id="vcs_url_select" aria-hidden="true"></i></span><span id="vcs_url" class="copyable">{{ layeritem.vcs_url }}</span>
|
|
{% if layeritem.vcs_web_url %}
|
|
<span class="label label-info">
|
|
<a href="{{ layeritem.vcs_web_url }}">web repo</a>
|
|
</span>
|
|
{% endif %}
|
|
</p>
|
|
|
|
{% if layerbranch.vcs_subdir %}
|
|
<h4>Subdirectory</h4>
|
|
<p><span data-toggle="tooltip" title="Select subdirectory"><i class="glyphicon glyphicon-circle-arrow-right selectallicon" for="vcs_subdir" id="vcs_subdir_select" aria-hidden="true"></i></span><span id="vcs_subdir" class="copyable">{{ layerbranch.vcs_subdir }}</span>
|
|
{% if layerbranch.tree_url %}
|
|
<span class="label label-info">
|
|
<a href="{{ layerbranch.tree_url }}">web subdirectory</a>
|
|
</span>
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% if layerbranch.vcs_last_commit %}
|
|
<p>
|
|
<span class="text-muted"><small>Last commit: {{ layerbranch.vcs_last_commit|timesince }} ago ({{ layerbranch.branch.name }} branch)</small></span>
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% if layerbranch.active_maintainers.count > 0 %}
|
|
<h3>{% if layerbranch.active_maintainers|length == 1 %}Maintainer{% else %}Maintainers{% endif %}</h3>
|
|
|
|
<ul>
|
|
{% for maintainer in layerbranch.active_maintainers %}
|
|
<li>
|
|
{{ maintainer.name }}
|
|
{% if maintainer.responsibility %}
|
|
<span>({{ maintainer.responsibility }})</span>
|
|
{% endif %}
|
|
|
|
<span class="label label-info">
|
|
<a href="mailto:{{ maintainer.email }}">email</a>
|
|
</span>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% if rrs_maintplans %}
|
|
<h3>{{ rrs_maintplans|pluralize:"Maintenance Plan,Maintenance Plans" }}</h3>
|
|
<ul>
|
|
{% for maintplan in rrs_maintplans %}
|
|
<li>
|
|
<a href="{% url 'rrs_maintplan' maintplan.name %}">{{ maintplan.name }}</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
|
|
</div> <!-- end of col-md-7 -->
|
|
|
|
<div class="col-md-4 pull-right description">
|
|
{% if layerbranch.dependencies_set.count > 0 %}
|
|
<div class="well dependency-well">
|
|
{% if layerbranch.get_required.count > 0 %}
|
|
<h3>Dependencies </h3>
|
|
<p>The {{ layeritem.name }} layer depends upon:</p>
|
|
<ul>
|
|
{% for dep in layerbranch.get_required %}
|
|
<li><a href="{% url 'layer_item' url_branch dep.dependency.name %}">{{ dep.dependency.name }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %} <!-- end of layerbranch.get_required.count -->
|
|
{% if layerbranch.get_recommends.count > 0 %}
|
|
<h3>Recommends </h3>
|
|
<p>The {{ layeritem.name }} layer recommends:</p>
|
|
<ul>
|
|
{% for rec in layerbranch.get_recommends %}
|
|
<li><a href="{% url 'layer_item' url_branch rec.dependency.name %}">{{ rec.dependency.name }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %} <!-- end of layerbranch.get_recommends.count -->
|
|
</div> <!-- end of well -->
|
|
{% endif %} <!-- end of layerbranch.dependencies_set.count -->
|
|
</div> <!-- end of col-md-4 -->
|
|
</div> <!-- end of row -->
|
|
</div> <!-- end of container-fluid -->
|
|
|
|
{% if not layerbranch.vcs_last_commit %}
|
|
<div class="alert alert-info">
|
|
<b>Note:</b> The content of this layer on branch {{ url_branch }} has not yet been indexed. Indexing should take place within a few hours.
|
|
</div>
|
|
{% endif %}
|
|
|
|
<ul class="nav nav-tabs" id="layertabbar">
|
|
{% if layerbranch.recipe_set.count > 0 %}
|
|
<li><a href="#recipes" data-toggle="tab">Recipes</a></li>
|
|
{% endif %}
|
|
{% if machines.count > 0 %}
|
|
<li><a href="#machines" data-toggle="tab">Machines</a></li>
|
|
{% endif %}
|
|
{% if appends.count > 0 %}
|
|
<li><a href="#appends" data-toggle="tab">Appends</a></li>
|
|
{% endif %}
|
|
{% if classes.count > 0 %}
|
|
<li><a href="#classes" data-toggle="tab">Classes</a></li>
|
|
{% endif %}
|
|
{% if distros.count > 0 %}
|
|
<li><a href="#distros" data-toggle="tab">Distros</a></li>
|
|
{% endif %}
|
|
{% if updates.count > 0 %}
|
|
<li><a href="#updates" data-toggle="tab">Updates</a></li>
|
|
{% endif %}
|
|
</ul>
|
|
|
|
<div class="tab-content">
|
|
{% if layerbranch.recipe_set.count > 0 %}
|
|
<div class="tab-pane" id="recipes">
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand">{{ layeritem.name }} recipes <span class="text-muted">({{ layerbranch.sorted_recipes.count }})</span></a>
|
|
</div>
|
|
|
|
<div class="navbar-right">
|
|
<a href="{% url 'layer_export_recipes_csv' layerbranch.branch.name layerbranch.layer.name %}" class="btn btn-default navbar-btn"><i class="glyphicon glyphicon-file" aria-hidden="true"></i> Export CSV</a>
|
|
|
|
<form action="" class="navbar-form pull-right" id="filter-form">
|
|
<input type="text" placeholder="Search recipes" class="form-control" id="filter">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<table class="table table-bordered recipestable">
|
|
<thead>
|
|
<tr>
|
|
<th>Recipe name</th>
|
|
<th>Version</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for recipe in layerbranch.sorted_recipes %}
|
|
<tr>
|
|
<td><a href="{% url 'recipe' recipe.id %}">{{ recipe.name }}</a>{% if 'image' in recipe.inherits.split %}<i class="glyphicon glyphicon-hdd"></i>{% endif %}{% if recipe.blacklisted %}<span class="label label-inverse" title="{{ recipe.blacklisted }}">blacklisted</span>{% endif %}</td>
|
|
<td>{{ recipe.pv }}</td>
|
|
<td class="col-md-8">{{ recipe.short_desc }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% if machines.count > 0 %}
|
|
<div class="tab-pane" id="machines">
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand">{{ layeritem.name }} machines <span class="text-muted">({{ machines.count }})</span></a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
{% for machine in machines %}
|
|
<tr>
|
|
<td><a href="{{ machine.vcs_web_url }}">{{ machine.name }}</a></td>
|
|
<td>{{ machine.description }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% if appends.count > 0 %}
|
|
<div class="tab-pane" id="appends">
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand">{{ layeritem.name }} bbappends <span class="text-muted">({{ appends.count }})</span></a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
{% for append in appends %}
|
|
<tr>
|
|
<td><a href="{{ append.vcs_web_url }}">{{ append.filename }}</a></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% if classes.count > 0 %}
|
|
<div class="tab-pane" id="classes">
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand">{{ layeritem.name }} classes <span class="text-muted">({{ classes.count }})</span></a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
{% for class in classes %}
|
|
<tr>
|
|
<td><a href="{{ class.vcs_web_url }}">{{ class.name }}</a></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% if distros.count > 0 %}
|
|
<div class="tab-pane" id="distros">
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand">{{ layeritem.name }} distros <span class="text-muted">({{ distros.count }})</span></a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<table class="table table-bordered">
|
|
<tbody>
|
|
{% for distro in distros %}
|
|
<tr>
|
|
<td><a href="{{ distro.vcs_web_url }}">{{ distro.name }}</a></td>
|
|
<td>{{ distro.description }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
{% if updates.count > 0 %}
|
|
<div class="tab-pane" id="updates">
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<div class="navbar-header">
|
|
<a class="navbar-brand">{{ layeritem.name }} updates</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Date/time</th>
|
|
<th>Errors</th>
|
|
<th>Warnings</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for update in updates %}
|
|
<tr>
|
|
<td>
|
|
{% if update.log %}
|
|
<a href="{% url 'layerupdate' update.id %}">{{ update.started }}{% if update.update.reload %} (reload){% endif%}</a>
|
|
{% else %}
|
|
<span class="text-muted">{{ update.started }}{% if update.update.reload %} (reload){% endif%}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{% if update.errors %}<span class="badge badge-important">{{ update.errors }}</span>{% endif %}</td>
|
|
<td>{% if update.warnings %}<span class="badge badge-warning">{{ update.warnings }}</span>{% endif %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
|
|
{% endautoescape %}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block scripts %}
|
|
<script src="{% static "js/uitablefilter.js" %}"></script>
|
|
|
|
<script>
|
|
// selectText plugin Borrowed from http://jsfiddle.net/edelman/KcX6A/1506/
|
|
jQuery.fn.selectText = function() {
|
|
var doc = document
|
|
, element = this[0]
|
|
, range, selection
|
|
;
|
|
if (doc.body.createTextRange) {
|
|
range = document.body.createTextRange();
|
|
range.moveToElementText(element);
|
|
range.select();
|
|
} else if (window.getSelection) {
|
|
selection = window.getSelection();
|
|
range = document.createRange();
|
|
range.selectNodeContents(element);
|
|
selection.removeAllRanges();
|
|
selection.addRange(range);
|
|
}
|
|
};
|
|
|
|
$(document).ready(function() {
|
|
|
|
$(function() {
|
|
var theTable = $('table.recipestable');
|
|
|
|
$("#filter").keyup(function() {
|
|
$.uiTableFilter( theTable, this.value );
|
|
})
|
|
|
|
$('#filter-form').submit(function(){
|
|
theTable.find("tbody > tr:visible > td:eq(1)").mousedown();
|
|
return false;
|
|
}).focus(); //Give focus to input field
|
|
|
|
$('.selectallicon').mouseup(function() {
|
|
$('#' + $(this).attr('for')).selectText();
|
|
});
|
|
|
|
$('#layertabbar a:first').tab('show');
|
|
$('#layertabbar a').click(function (e) {
|
|
e.preventDefault();
|
|
$(this).tab('show');
|
|
})
|
|
|
|
$('.glyphicon-hdd').tooltip({title:"Inherits image"});
|
|
$('.label-inverse').tooltip();
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|