[yocto] [PATCH 1/1] error-report-tool: apply changes to the landing page
Roxana Ciobanu
roxana.ciobanu at intel.com
Wed Sep 3 04:41:32 PDT 2014
* Reduce the time range from the last month to the last week
* Provide a list of the latest errors
* Provide a link to the list of errors generated by the autobuilder
[YOCTO #YB6537]
Signed-off-by: Roxana Ciobanu <roxana.ciobanu at intel.com>
---
Post/static/css/custom.css | 9 +-
Post/views.py | 15 +-
project/urls.py | 4 +-
templates/base.html | 6 +-
templates/error-page.html | 27 ++-
templates/home.html | 442 ++++++++++++++++++++++--------------------
templates/latest-errors.html | 239 +++++++++++++++++++++++
templates/search-details.html | 2 +-
8 files changed, 527 insertions(+), 217 deletions(-)
create mode 100644 templates/latest-errors.html
diff --git a/Post/static/css/custom.css b/Post/static/css/custom.css
index 16fe910..c274b67 100644
--- a/Post/static/css/custom.css
+++ b/Post/static/css/custom.css
@@ -6,8 +6,9 @@
*/
body {
- padding:50px;
+ padding: 70px 40px;
}
+
.logo img {
height: 25px;
width: auto !important;
@@ -56,7 +57,11 @@ td a:visited {
margin: 10px 0 0;
}
-.navbar-inner form {
+.navbar-inner .navbar-search {
+ margin-top: 7px;
+}
+
+.navbar-inner form, .pagination form {
margin: 5px 0 0;
}
diff --git a/Post/views.py b/Post/views.py
index 1844c87..79d688e 100644
--- a/Post/views.py
+++ b/Post/views.py
@@ -58,13 +58,26 @@ def search(request, template_name, items = None, page = None, query = None):
page = request.GET.get('page', '')
query = request.GET.get('query', '')
items = request.GET.get('items', '')
+
+ latest = False
+
+ if "latest" in query:
+ latest = True
+ query = query.replace("_latest", "")
+
if query == "" or query.isspace():
query = "all"
elems = Info().getSearchResult(query.strip())
elems.sort(key=lambda r : r.BUILD.DATE, reverse=True)
no = len(elems)
if no == 0:
- return render_to_response("error-page.html", {"query" : query}, RequestContext(request))
+ return render_to_response("error-page.html", {"latest" : latest, "query" : query}, RequestContext(request))
+
+ if latest is True:
+ if no > 150:
+ elems = elems[:150]
+ no = 150
+
paginator = Paginator(elems, items)
try:
c = paginator.page(page)
diff --git a/project/urls.py b/project/urls.py
index dbf2a3c..80d5d48 100644
--- a/project/urls.py
+++ b/project/urls.py
@@ -18,6 +18,7 @@ urlpatterns = patterns('',
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
#url(r'^accounts/', include('registration.backends.default.urls')),
+ url(r'^Errors/Search/Latest/$', 'Post.views.search', {'template_name' : 'latest-errors.html'}, name= "latest_errors"),
url(r'^Errors/Search/Args/$', 'Post.views.search', {'template_name' : 'search-details.html'}, name = "entry_args"),
url(r'^Errors/Search/(?P<items>\d+)/(?P<page>\d+)/(?P<query>\w+)/', 'Post.views.search', {'template_name' : 'search-details.html'}, name = "entry"),
url(r'^Errors/Search/(?P<page>\d+)/(?P<query>\d+)/', 'Post.views.viewEntry', {'template_name' : 'search-details.html'}),
@@ -27,5 +28,6 @@ urlpatterns = patterns('',
url(r'^Errors/ErrorPage/$', direct_to_template, {'template':"error-page.html"}, name = "errorpage"),
url(r'^ClientPost/', 'Post.views.addData'),
url(r'^Errors/', direct_to_template, {'template':"home.html"}, name = "main"),
- url(r'.*', redirect_to, {'url' : '/Errors/'}, name = "home"),
+ url(r'.*', redirect_to, {'url' : '/Errors/Search/Latest/?items=25&page=1&query=all_latest'}),
+
)
diff --git a/templates/base.html b/templates/base.html
index a6f0cf0..69e9871 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -21,8 +21,8 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
- <a class="brand logo" href="{% url main %}"><img src="{% static "img/logo.png" %}" /></a>
- <a class="brand" href={% url main%}>Error reports</a>
+ <a class="brand logo" href="{% url latest_errors %}?items=25&page=1&query=all_latest"><img src="{% static "img/logo.png" %}" /></a>
+ <a class="brand" href="{% url latest_errors %}?items=25&page=1&query=all_latest">Error reports</a>
{% comment %}
{% if user.is_authenticated %}
<div class="dropdown pull-right">
@@ -55,7 +55,7 @@
</div>
</div>
</div>
-
+
<script type = "text/javascript" src = "{% static "js/jquery.js" %}"></script>
<script type = "text/javascript" src = "{% static "js/bootstrap.min.js" %}"></script>
<script type = "text/javascript" src = "{% static "js/d3.v2.js" %}"></script>
diff --git a/templates/error-page.html b/templates/error-page.html
index fa16354..d811c77 100644
--- a/templates/error-page.html
+++ b/templates/error-page.html
@@ -6,10 +6,31 @@
<body>
{% block content %}
<div class="row-fluid">
+ {% if latest %}
+ <ul class="nav nav-pills">
+ <li> <a href="{% url latest_errors %}?items=25&page=1&query=all_latest" >Latest errors</a> </li>
+ <li class="active"> <a href="{% url latest_errors %}?items=25&page=1&query=autobuilder_latest" >Latest Autobuilder errors</a></li>
+ <li> <a href="{% url main %}" >Statistics </a> </li>
+ </ul>
+ <div class="alert">
+ {% ifequal query "autobuilder" %}
+ <h3>No Autobuilder errors found</h3>
+ {% else %}
+ <h3>No errors found</h3>
+ {% endifequal%}
+ <form class="no-results" action="{% url entry_args %}" method="GET">
+ <div class="input-append">
+ <input class="input-xxlarge" type="text" name="query" value="{{ query }}">
+ <input type="text" name="items" value=10 style="display: none;">
+ <input type="text" name="page" value=1 style="display: none;">
+ <button class="btn" type="submit" value = "Search">Search</button>
+ </div>
+ </form>
+ </div>
+ {% else %}
<div class="page-header">
<h1>No errors found</h1>
</div>
-
<div class="alert">
<form class="no-results" action="{% url entry_args %}" method="GET">
<div class="input-append">
@@ -17,10 +38,12 @@
<input type="text" name="items" value=10 style="display: none;">
<input type="text" name="page" value=1 style="display: none;">
<button class="btn" type="submit" value = "Search">Search</button>
- <a class="btn btn-link" href="/">Go to error dashboard</a>
+ <a class="btn btn-link" href="/">View latest errors</a>
</div>
</form>
</div>
+ {% endif %}
+ </div>
{% endblock %}
</body>
</html>
diff --git a/templates/home.html b/templates/home.html
index 6c8a1e7..7be605f 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -5,217 +5,245 @@
<html>
<body>
{% block content%}
+
+
<div class="row-fluid">
- <div class="page-header">
- <h1>Error dashboard</h1>
- </div>
- <p class="lead">Errors reported from 22nd June to 22nd July 2013</p>
- <ul class="thumbnails">
- <li class="span6">
- <h2>By machine</h2>
- <div class="thumbnail">
- <p style="display:none">{% load_chart charttype chartdata "m"%}</p>
- {% include_container "m" %}
+ <ul class="nav nav-pills">
+ <li><a href="{% url latest_errors %}?items=25&page=1&query=all_latest">Latest errors</a></li>
+ <li><a href="{% url latest_errors %}?items=25&page=1&query=autobuilder_latest">Latest Autobuilder errors</a></li>
+ <li class="active"> <a href="#stats" data-toggle="tab">Statistics </a> </li>
+ </ul>
+
+ <div class="tab-content">
+ <div class="tab-pane active" id="stats">
+
+ <p class="lead">Errors reported from 21st to 27th August 2014</p>
+ <div class="row-fluid">
+ <ul class="thumbnails">
+ <li class="span6">
+ <h2>By machine</h2>
+ <div class="thumbnail">
+ <p style="display:none">{% load_chart charttype chartdata "m"%}</p>
+ {% include_container "m" %}
+ </div>
+ </li>
+ <li class="span6">
+ <h2>By recipe</h2>
+ <div class="thumbnail">
+ <p style="display:none">{% load_chart charttype chartdata "r"%}</p>
+ {% include_container "r" %}
+ </div>
+ </li>
+ </ul>
</div>
- </li>
- <li class="span6">
- <h2>By recipe</h2>
- <div class="thumbnail">
- <p style="display:none">{% load_chart charttype chartdata "r"%}</p>
- {% include_container "r" %}
+ <div class="row-fluid">
+ <ul class="thumbnails">
+ <li class="span6">
+ <h2>By target</h2>
+ <div class="thumbnail">
+ <p style="display:none">{% load_chart charttype chartdata "t"%}</p>
+ {% include_container "t" %}
+ </div>
+ </li>
+ <li class="span6">
+ <h2>By distro</h2>
+ <div class="thumbnail">
+ <p style="display:none">{% load_chart charttype chartdata "d"%}</p>
+ {% include_container "d" %}
+ </div>
+ </li>
+ </ul>
</div>
- </li>
- </ul>
- </div>
- <div class="row-fluid">
- <ul class="thumbnails">
- <li class="span6">
- <h2>By target</h2>
- <div class="thumbnail">
- <p style="display:none">{% load_chart charttype chartdata "t"%}</p>
- {% include_container "t" %}
- </div>
- </li>
- <li class="span6">
- <h2>By distro</h2>
- <div class="thumbnail">
- <p style="display:none">{% load_chart charttype chartdata "d"%}</p>
- {% include_container "d" %}
- </div>
- </li>
- </ul>
- </div>
- <div class="row-fluid">
- <ul class="thumbnails">
- <li class="span6">
- <h2>By branch</h2>
- <div class="thumbnail">
- <p style="display:none">{% load_chart charttype chartdata "b"%}</p>
- {% include_container "b" %}
- </div>
- </li>
- <li class="span6">
- <h2>By commit</h2>
- <div class="thumbnail">
- <p style="display:none">{% load_chart charttype chartdata "c"%}</p>
- {% include_container "c" %}
- </div>
- </li>
- </ul>
- </div>
- <div class="row-fluid">
- <ul class="thumbnails">
- <li class="span6">
- <h2>By target system</h2>
- <div class="thumbnail">
- <p style="display:none">{% load_chart charttype chartdata "ts"%}</p>
- {% include_container "ts" %}
- </div>
- </li>
- <li class="span6">
- <h2>By host distro</h2>
- <div class="thumbnail">
- <p style="display:none">{% load_chart charttype chartdata "hd"%}</p>
- {% include_container "hd" %}
- </div>
- </li>
- </ul>
- </div>
- <script type="text/javascript">
- $(document).ready(function() {
- var month=new Array();
- month[0]="January";
- month[1]="February";
- month[2]="March";
- month[3]="April";
- month[4]="May";
- month[5]="June";
- month[6]="July";
- month[7]="August";
- month[8]="September";
- month[9]="October";
- month[10]="November";
- month[11]="December";
-
- var today = new Date();
- var dd = today.getDate();
- var mm = today.getMonth();
- var yyyy = today.getFullYear();
- var currentm = month[mm];
- var ind = "";
-
- if (mm == 0){
- var lastm = month[11];
- }
- else {
- var lastm = month[mm-1];
- }
- if (dd > 9){
- var lastd = dd % 10;
- }
- else {
- var lastd=dd;
- }
- if (dd == 11 || dd == 12 || dd == 13){
- ind = 'th'}
- else if (lastd == 1){
- ind = 'st'}
- else if (lastd == 2){
- ind = 'nd'}
- else if (lastd == 3){
- ind = 'rd'}
- else if (ind == ""){
- ind ='th'}
- var today = dd + ind +" " + currentm + " " + yyyy;
- if (dd>28){
- dd = 28;
- ind = 'th'
- }
- var last = dd + ind + " " +lastm;
- var text = "Errors reported from " +last + " to " +today;
- $("p").text(text);
-
- function modify_chart(data, type, div){
- var start = '<script type="text/javascript">'
- var end='</li>'
- var current_index = data.indexOf(type)
- var current_part = data.substr(current_index)
- current_part = current_part.replace('width:600px;', '')
- var i = current_part.indexOf(start)
- var current_part = current_part.substr(i)
- var i = current_part.indexOf(start)
- var current_part = current_part.substr(i)
- var j = current_part.indexOf(end)
- var draw = current_part.substr(i, j)
- draw=draw.replace('<div id="m"', '<div id="' + div + '"')
- draw=draw.replace("('#m svg')", "('#" + div + " svg')")
- draw = draw.replace("chart.xAxis", "chart.xAxis.tickFormat(function(d){ if (d.length <= 9) return String(d); else return String(d.substring(0,8) + '...'); });")
- draw = draw.replace("chart.yAxis", "chart.yAxis.tickFormat(d3.format('%'));")
- draw = draw.replace("String(graph.point.y)", "String(graph.point.y*100)")
- draw = draw.replace("'<center><b>'+key+'</b></center>' + y + ' at '", "parseInt(graph.point.y*100)+'% '")
- draw = draw.replace("return tooltip_str;", "d3.selectAll('.discreteBar').on('click', function(){ if(String(graph.point.x) != 'others') window.location.href='{% url entry_args %}?items=10&page=1&query='+String(graph.point.x) }); \n return tooltip_str;\n")
- draw = draw.replace("return chart;", "nv.utils.windowResize(chart.update); \n return chart;\n")
- return draw;
- }
-
-
- if ($("#m").text() == ""){
- $.get('{% url statistics "MACHINE" %}', function(data){
- draw = modify_chart(data, "By machine", "m");
- $("#m").html(draw);
- })
- }
- if ($("#r").text() == ""){
-
- $.get('{% url statistics "RECIPE" %}', function(data){
- draw = modify_chart(data, "By recipe", "r");
- $("#r").html(draw)
- })
- }
- if ($("#t").text() == ""){
-
- $.get('{% url statistics "TARGET" %}', function(data){
- draw = modify_chart(data, "By target", "t");
- $("#t").html(draw)
- })
- }
- if ($("#d").text() == ""){
-
- $.get('{% url statistics "DISTRO" %}', function(data){
- draw = modify_chart(data, "By distro", "d");
- $("#d").html(draw)
- })
- }
- if ($("#b").text() == ""){
-
- $.get('{% url statistics "BRANCH" %}', function(data){
- draw = modify_chart(data, "By branch", "b");
- $("#b").html(draw)
- })
- }
- if ($("#c").text() == ""){
-
- $.get('{% url statistics "COMMIT" %}', function(data){
- draw = modify_chart(data, "By commit", "c");
- $("#c").html(draw)
- })
- }
- if ($("#ts").text() == ""){
-
- $.get('{% url statistics "TARGET_SYS" %}', function(data){
- draw = modify_chart(data, "By target system", "ts");
- $("#ts").html(draw)
- })
- }
- if ($("#hd").text() == ""){
-
- $.get('{% url statistics "NATIVELSBSTRING" %}', function(data){
- draw = modify_chart(data, "By host distro", "hd");
- $("#hd").html(draw)
+ <div class="row-fluid">
+ <ul class="thumbnails">
+ <li class="span6">
+ <h2>By branch</h2>
+ <div class="thumbnail">
+ <p style="display:none">{% load_chart charttype chartdata "b"%}</p>
+ {% include_container "b" %}
+ </div>
+ </li>
+ <li class="span6">
+ <h2>By commit</h2>
+ <div class="thumbnail">
+ <p style="display:none">{% load_chart charttype chartdata "c"%}</p>
+ {% include_container "c" %}
+ </div>
+ </li>
+ </ul>
+ </div>
+ <div class="row-fluid">
+ <ul class="thumbnails">
+ <li class="span6">
+ <h2>By target system</h2>
+ <div class="thumbnail">
+ <p style="display:none">{% load_chart charttype chartdata "ts"%}</p>
+ {% include_container "ts" %}
+ </div>
+ </li>
+ <li class="span6">
+ <h2>By host distro</h2>
+ <div class="thumbnail">
+ <p style="display:none">{% load_chart charttype chartdata "hd"%}</p>
+ {% include_container "hd" %}
+ </div>
+ </li>
+ </ul>
+ </div>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ var month=new Array();
+ month[0]="January";
+ month[1]="February";
+ month[2]="March";
+ month[3]="April";
+ month[4]="May";
+ month[5]="June";
+ month[6]="July";
+ month[7]="August";
+ month[8]="September";
+ month[9]="October";
+ month[10]="November";
+ month[11]="December";
+
+ var today = new Date();
+ var dd = today.getDate();
+ var mm = today.getMonth();
+ var yyyy = today.getFullYear();
+ var currentm = month[mm];
+ var ind = "";
+
+ if (mm == 0){
+ var lastm = month[11];
+ }
+ else {
+ var lastm = month[mm-1];
+ }
+ if (dd > 9){
+ var lastd = dd % 10;
+ }
+ else {
+ var lastd=dd;
+ }
+ if (dd == 11 || dd == 12 || dd == 13){
+ ind = 'th'}
+ else if (lastd == 1){
+ ind = 'st'}
+ else if (lastd == 2){
+ ind = 'nd'}
+ else if (lastd == 3){
+ ind = 'rd'}
+ else if (ind == ""){
+ ind ='th'}
+ var today = dd + ind +" " + currentm + " " + yyyy;
+
+ dd -= 7;
+
+ if (dd <= 0) {
+ dd = 28;
+ ind = 'th' + ' ' + lastm;
+ } else {
+ if (dd == 11 || dd == 12 || dd == 13){
+ ind = 'th'}
+ else if (lastd == 1){
+ ind = 'st'}
+ else if (lastd == 2){
+ ind = 'nd'}
+ else if (lastd == 3){
+ ind = 'rd'}
+ else if (ind == ""){
+ ind ='th'}
+ }
+
+ var last = dd + ind;
+ var text = "Errors reported from " + last + " to " +today;
+ $("p").text(text);
+
+ function modify_chart(data, type, div){
+ var start = '<script type="text/javascript">'
+ var end='</li>'
+ var current_index = data.indexOf(type)
+ var current_part = data.substr(current_index)
+ current_part = current_part.replace('width:600px;', '')
+ var i = current_part.indexOf(start)
+ var current_part = current_part.substr(i)
+ var i = current_part.indexOf(start)
+ var current_part = current_part.substr(i)
+ var j = current_part.indexOf(end)
+ var draw = current_part.substr(i, j)
+ draw=draw.replace('<div id="m"', '<div id="' + div + '"')
+ draw=draw.replace("('#m svg')", "('#" + div + " svg')")
+ draw = draw.replace("chart.xAxis", "chart.xAxis.tickFormat(function(d){ if (d.length <= 9) return String(d); else return String(d.substring(0,8) + '...'); });")
+ draw = draw.replace("chart.yAxis", "chart.yAxis.tickFormat(d3.format('%'));")
+ draw = draw.replace("String(graph.point.y)", "String(graph.point.y*100)")
+ draw = draw.replace("'<center><b>'+key+'</b></center>' + y + ' at '", "parseInt(graph.point.y*100)+'% '")
+ draw = draw.replace("return tooltip_str;", "d3.selectAll('.discreteBar').on('click', function(){ if(String(graph.point.x) != 'others') window.location.href='{% url entry_args %}?items=10&page=1&query='+String(graph.point.x) }); \n return tooltip_str;\n")
+ draw = draw.replace("return chart;", "nv.utils.windowResize(chart.update); \n return chart;\n")
+ return draw;
+ }
+
+ if ($("#m").text() == ""){
+ $.get('{% url statistics "MACHINE" %}', function(data){
+ draw = modify_chart(data, "By machine", "m");
+ $("#m").html(draw);
+ })
+ }
+ if ($("#r").text() == ""){
+
+ $.get('{% url statistics "RECIPE" %}', function(data){
+ draw = modify_chart(data, "By recipe", "r");
+ $("#r").html(draw)
+ })
+ }
+ if ($("#t").text() == ""){
+
+ $.get('{% url statistics "TARGET" %}', function(data){
+ draw = modify_chart(data, "By target", "t");
+ $("#t").html(draw)
+ })
+ }
+ if ($("#d").text() == ""){
+
+ $.get('{% url statistics "DISTRO" %}', function(data){
+ draw = modify_chart(data, "By distro", "d");
+ $("#d").html(draw)
+ })
+ }
+ if ($("#b").text() == ""){
+
+ $.get('{% url statistics "BRANCH" %}', function(data){
+ draw = modify_chart(data, "By branch", "b");
+ $("#b").html(draw)
+ })
+ }
+ if ($("#c").text() == ""){
+
+ $.get('{% url statistics "COMMIT" %}', function(data){
+ draw = modify_chart(data, "By commit", "c");
+ $("#c").html(draw)
+ })
+ }
+ if ($("#ts").text() == ""){
+
+ $.get('{% url statistics "TARGET_SYS" %}', function(data){
+ draw = modify_chart(data, "By target system", "ts");
+ $("#ts").html(draw)
+ })
+ }
+ if ($("#hd").text() == ""){
+
+ $.get('{% url statistics "NATIVELSBSTRING" %}', function(data){
+ draw = modify_chart(data, "By host distro", "hd");
+ $("#hd").html(draw)
+ })
+ }
})
- }
- })
- </script>
+ </script>
+
+ </div>
+ </div> <!-- end of tab-content -->
+
+ </div> <!-- end of row-fluid -->
{% endblock %}
</body>
</html>
diff --git a/templates/latest-errors.html b/templates/latest-errors.html
new file mode 100644
index 0000000..3927100
--- /dev/null
+++ b/templates/latest-errors.html
@@ -0,0 +1,239 @@
+{% extends "base.html" %}
+{% load i18n %}
+{% load staticfiles %}
+{% load projecttags %}
+<!DOCTYPE html>
+<html>
+ <body>
+ {% block content %}
+ <script>$
+ function showhideTableColumn( clname, sh) {
+ if ( sh ) {
+ $('.' + clname ).show( 100 );
+ }
+ else {
+ $('.' + clname ).hide( 100 );
+ }
+ // save cookie for all checkboxes$
+ save = '';
+ $( '.chbxtoggle' ).each(function( ) {
+ if ( $( this ).attr( 'id' ) != undefined ) {
+ save += ';' + $( this ).attr( 'id' ) +':'+ $( this ).is( ':checked' )
+ }
+ });
+ $.cookie( '_displaycols_{{objectname}}', save );
+ save = '';
+ }
+ </script>
+
+ <div class="row-fluid">
+ <ul class="nav nav-pills">
+ {% ifequal d 'autobuilder' %}
+ <li> <a href="{% url latest_errors %}?items=25&page=1&query=all_latest" >Latest errors</a> </li>
+ <li class="active"> <a href="{% url latest_errors %}?items=25&page=1&query=autobuilder_latest" >Latest Autobuilder errors</a></li>
+ {% else %}
+ <li class="active"> <a href="{% url latest_errors %}?items=25&page=1&query=all_latest" >Latest errors</a> </li>
+ <li> <a href="{% url latest_errors %}?items=25&page=1&query=autobuilder_latest" >Latest Autobuilder errors</a></li>
+ {% endifequal %}
+ <li> <a href="{% url main %}" >Statistics </a> </li>
+ </ul>
+ <div class="navbar">
+ <div class="navbar-inner">
+ {% if no > 10 %}
+ <form class="form-inline pull-right">
+ <label>Show latest:</label>
+ <select class="paginationLimit input-mini" onchange="javascript:window.open('{% url latest_errors %}?items='+this.value+'&page={{ details.number }}', '_self')">
+ {% ifequal items "10" %}
+ <option selected="selected" value = "10">10</option>
+ <option value = "25">25</option>
+ <option value = "50">50</option>
+ <option value = "100">100</option>
+ <option value = "150">150</option>
+ {%endifequal%}
+ {% ifequal items "25"%}
+ <option value = "10">10</option>
+ <option selected="selected" value = "25">25</option>
+ <option value = "50">50</option>
+ <option value = "100">100</option>
+ <option value = "150">150</option>
+ {%endifequal%}
+ {% ifequal items "50"%}
+ <option value = "10">10</option>
+ <option value = "25">25</option>
+ <option selected="selected" value = "50">50</option>
+ <option value = "100">100</option>
+ <option value = "150">150</option>
+ {%endifequal%}
+ {% ifequal items "100"%}
+ <option value = "10">10</option>
+ <option value = "25">25</option>
+ <option value = "50">50</option>
+ <option selected="selected" value = "100">100</option>
+ <option value = "150">150</option>
+ {%endifequal%}
+ {% ifequal items "150"%}
+ <option value = "10">10</option>
+ <option value = "25">25</option>
+ <option value = "50">50</option>
+ <option value = "100">100</option>
+ <option selected="selected" value = "150">150</option>
+ {%endifequal%}
+ </select>
+ </form>
+ <span class="divider-vertical pull-right"></span>
+ {% endif %}
+ <div class="btn-group pull-right">
+ {% ifequal d "autobuilder" %}
+ <form style="display:inline" action="{% url entry_args %}" method="GET">
+ <div class="input-append">
+ <input type="text" name="items" value=10 style="display: none;">
+ <input type="text" name="page" value=1 style="display: none;">
+ <input type="text" name="query" value=autobuilder style="display: none;">
+ </div>
+ <button type="submit" value="View All" class="btn dropdown-toggle">View all Autobuilder errors </button>
+ </form>
+ {% endifequal %}
+ {% if tablecols %}
+ <button class="btn dropdown-toggle" data-toggle="dropdown">Edit columns
+ <span class="caret"></span>
+ </button>
+ <ul id='editcol' class="dropdown-menu">
+ {% for i in tablecols|sortcols %}
+ <li>
+ <label {% if not i.clclass %} class="checkbox muted" {%else%} class="checkbox" {%endif%}>
+ <input type="checkbox" class="chbxtoggle"
+ {% if i.clclass %}
+ id="{{i.clclass}}"
+ value="ct{{i.name}}"
+ {% if not i.hidden %}
+ checked="checked"
+ {%endif%}
+ onclick="showhideTableColumn($(this).attr('id'), $(this).is(':checked'))"
+ {%else%}
+ checked disabled
+ {% endif %}/> {{i.name}}
+ </label>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ </div>
+ </div> <!-- navbar-inner -->
+ </div>
+ {% if details %}
+ <table class="table table-bordered table-hover">
+ <thead>
+ <tr>
+ {% for i in tablecols %} <th class="{{i.dclass}} {{i.clclass}}"> {{i.name}} </th> {%endfor%}
+ </tr>
+ </thead>
+ <tbody>
+ {%for detail in details %}
+ <tr class="data">
+ <td class="submitted_on"> <a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.DATE|date:"d/m/y H:i"}}</a></td>
+ <td class="recipe"><a href="{% url id detail.id details.number items d %}">{{ detail.RECIPE }}</a></td>
+ <td class="recipe_version"><a href="{% url id detail.id details.number items d %}">{{ detail.RECIPE_VERSION }}</a></td>
+ <td class="task"><a href="{% url id detail.id details.number items d %}">{{ detail.TASK }}</a></td>
+ <td class="machine"><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.MACHINE }}</a></td>
+ <td class="distro"><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.DISTRO }}</a></td>
+ <td class="build_sys"><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.BUILD_SYS }}</a></td>
+ <td class="target_sys"><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.TARGET_SYS }}</a></td>
+ <td class="host_distro"><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.NATIVELSBSTRING }}</a></td>
+ <td class="branch"><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.BRANCH }} </a></td>
+ <td class="commit">
+ {% autoescape off %}
+ <div class="btn" rel="popover" data-content= {{ detail.BUILD.COMMIT|escape}} title="">
+ {% endautoescape %}
+ {{ detail.BUILD.COMMIT|truncatechars:10}}
+ </div>
+ </td>
+ <td class="submitter"><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.NAME }} </a></td>
+ </tr>
+ {%endfor%}
+ </tbody>
+ </table>
+ <div class="pagination pagination-centered">
+ <form class="form-inline pull-right">
+ {% if no > 10 %}
+ <label>Show latest:</label>
+ <form>
+ <select class="paginationLimit input-mini" onchange="javascript:window.open('{% url latest_errors %}?items='+this.value+'&page={{details.number}}', '_self')">
+ {% ifequal items "10" %}
+ <option selected="selected" value = "10">10</option>
+ <option value = "25">25</option>
+ <option value = "50">50</option>
+ <option value = "100">100</option>
+ <option value = "150">150</option>
+ {%endifequal%}
+ {% ifequal items "25"%}
+ <option value = "10">10</option>
+ <option selected="selected" value = "25">25</option>
+ <option value = "50">50</option>
+ <option value = "100">100</option>
+ <option value = "150">150</option>
+ {%endifequal%}
+ {% ifequal items "50"%}
+ <option value = "10">10</option>
+ <option value = "25">25</option>
+ <option selected="selected" value = "50">50</option>
+ <option value = "100">100</option>
+ <option value = "150">150</option>
+ {%endifequal%}
+ {% ifequal items "100"%}
+ <option value = "10">10</option>
+ <option value = "25">25</option>
+ <option value = "50">50</option>
+ <option selected="selected" value = "100">100</option>
+ <option value = "150">150</option>
+ {%endifequal%}
+ {% ifequal items "150"%}
+ <option value = "10">10</option>
+ <option value = "25">25</option>
+ <option value = "50">50</option>
+ <option value = "100">100</option>
+ <option selected="selected" value = "150">150</option>
+ {%endifequal%}
+ </select>
+ </form>
+ </form>
+ {% endif %}
+ </div>
+ {% endif %}
+ {% if result %}
+ <h4>Nothing matches your search!</h4>
+ {% endif %}
+ </div> <!-- row-fluid -->
+ <script>
+ $(document).ready(function() {
+ $('.commit > div').popover({placement:'left'})
+
+ // we load cookies for the column display$
+ save = $.cookie('_displaycols_{{objectname}}');
+ if (save != undefined) {
+ setting = save.split(';');
+ for ( i = 0; i < setting.length; i++) {
+ if (setting[i].length > 0) {
+ splitlist = setting[i].split(':');
+ id = splitlist[0], v = splitlist[1];
+ if (v == 'true') {
+ $('.chbxtoggle#'+id).prop('checked', true);
+ }
+ else {
+ $('.chbxtoggle#'+id).prop('checked', false);
+ }
+ }
+ }
+ }
+
+ $('.chbxtoggle').each(function () {
+ showhideTableColumn($(this).attr('id'), $(this).is(':checked'))
+ });
+ //turn edit columns dropdown into a multi-select menu$
+ $('.dropdown-menu input, .dropdown-menu label').click(function(e) {
+ e.stopPropagation();
+ });$
+ });
+ </script>
+ {% endblock %}
+ </body>
+</html>
diff --git a/templates/search-details.html b/templates/search-details.html
index ca428d0..ef586cd 100644
--- a/templates/search-details.html
+++ b/templates/search-details.html
@@ -37,7 +37,7 @@
<form class="form-inline pull-right">
{% if no > 10 %}
<label>Show rows:</label>
- <select class="paginationLimit input-mini" onchange="javascript:window.open('{% url entry_args %}?items='+this.value+'&page={{ details.number }}&query={{ d }}', '_self')">
+ <select class="paginationLimit input-mini" style="margin-top:5px;margin-bottom:0px;width:60px;" onchange="javascript:window.open('{% url entry_args %}?items='+this.value+'&page={{ details.number }}&query={{ d }}', '_self')">
{% ifequal items "10" %}
<option selected="selected" value = "10">10</option>
<option value = "25">25</option>
--
1.9.1
More information about the yocto
mailing list