All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Fix for YB6538
@ 2014-08-22  8:49 Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 1/9] error-report: add 'Submitted on' column Roxana Ciobanu
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit c1ee6cdfde5d1fe5f38a1e8eef5b7b0dd086df95:

  README: add required version for django-nvd3 (2014-03-06 13:43:30 +0200)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib roxana/YB6538
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=roxana/YB6538

Roxana Ciobanu (9):
  error-report: add 'Submitted on' column
  error-report: add 'Submitted on' detail
  error-report: add 'Submitter' column
  error-report: add 'Edit columns' menu
  jquery.cookie.js: add the Cookie Plugin
  error-report: remember state of the menu
  error-report: sort table by 'Submitted on' column
  error-report: add css customization
  error-report: add top 'Show rows' menu

 Post/createStatistics.py         |   4 +
 Post/getInfo.py                  |   3 +
 Post/parser.py                   |   3 +-
 Post/static/css/custom.css       |   8 ++
 Post/static/js/jquery.cookie.js  | 117 +++++++++++++++++++++++++
 Post/templatetags/__init__.py    |   0
 Post/templatetags/projecttags.py |  12 +++
 Post/views.py                    |  27 +++++-
 README                           |   2 +
 templates/base.html              |   2 +-
 templates/error-details.html     |   2 +
 templates/search-details.html    | 179 +++++++++++++++++++++++++++++++--------
 12 files changed, 322 insertions(+), 37 deletions(-)
 create mode 100644 Post/static/js/jquery.cookie.js
 create mode 100644 Post/templatetags/__init__.py
 create mode 100644 Post/templatetags/projecttags.py

-- 
1.9.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/9] error-report: add 'Submitted on' column
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 2/9] error-report: add 'Submitted on' detail Roxana Ciobanu
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

Show the submission date and time for an error in the
search results page

[YOCTO #6538]

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 Post/createStatistics.py      | 4 ++++
 Post/getInfo.py               | 3 +++
 Post/parser.py                | 3 ++-
 templates/search-details.html | 2 ++
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Post/createStatistics.py b/Post/createStatistics.py
index e4d9e3f..1df3e51 100644
--- a/Post/createStatistics.py
+++ b/Post/createStatistics.py
@@ -39,6 +39,10 @@ class Statistics:
     def chart_statistics(self, string):
         startdate = datetime.now()
         enddate = startdate - timedelta(days=30)
+        if string == "DATE":
+            date = Build.objects.filter(DATE__range=[enddate, startdate]).values('DATE').annotate(dcount=Count('DATE'))
+            items = list(date)
+            return self.create_statistic(items, "DATE")
         if string == "MACHINE":
             machines = Build.objects.filter(DATE__range=[enddate, startdate]).values('MACHINE').annotate(dcount=Count('MACHINE'))
             items = list(machines)
diff --git a/Post/getInfo.py b/Post/getInfo.py
index 3e9936d..5f0c3eb 100644
--- a/Post/getInfo.py
+++ b/Post/getInfo.py
@@ -68,6 +68,9 @@ class Info:
                 except:
                     pass
 
+            if category == "DATE":
+                build = Build.objects.filter(DATE__icontains = string)
+                results.append(self.getBuildFailures(build))
             if category == "MACHINE":
                 build = Build.objects.filter(MACHINE__icontains = string)
                 results.append(self.getBuildFailures(build))
diff --git a/Post/parser.py b/Post/parser.py
index 35325f1..fae9194 100644
--- a/Post/parser.py
+++ b/Post/parser.py
@@ -10,6 +10,7 @@
 import sys, os, json, re
 from Post.models import Build, BuildFailure
 from django.conf import settings
+from django.utils import timezone
 from datetime import datetime
 
 class Parser:
@@ -30,7 +31,7 @@ class Parser:
         NAME = str(jsondata['username'])
         EMAIL = str(jsondata['email'])
         g = re.match(r'(.*): (.*)', str(BRANCH_COMMIT))
-        b=Build(DATE = datetime.now(), MACHINE = MACHINE_NAME, BRANCH = g.group(1), COMMIT = str(g.group(2)), TARGET = COMPONENT, DISTRO = DISTRO, NATIVELSBSTRING = NATIVELSBSTRING, BUILD_SYS = BUILD_SYS, TARGET_SYS = TARGET_SYS, NAME = NAME, EMAIL = EMAIL)
+        b=Build(DATE = timezone.now(), MACHINE = MACHINE_NAME, BRANCH = g.group(1), COMMIT = str(g.group(2)), TARGET = COMPONENT, DISTRO = DISTRO, NATIVELSBSTRING = NATIVELSBSTRING, BUILD_SYS = BUILD_SYS, TARGET_SYS = TARGET_SYS, NAME = NAME, EMAIL = EMAIL)
         b.save()
         failures = jsondata['failures']
         for fail in failures:
diff --git a/templates/search-details.html b/templates/search-details.html
index cf57507..3941a1f 100644
--- a/templates/search-details.html
+++ b/templates/search-details.html
@@ -16,6 +16,7 @@
 					<table class="table table-bordered table-hover">
 						<thead>
 							<tr>
+								<th>Submitted on</th>
 								<th>Recipe</th>
 								<th>Recipe version</th>
 								<th>Task</th>
@@ -31,6 +32,7 @@
 						<tbody>
 							{%for detail in details %}
 								<tr>
+									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.DATE|date:"d/m/y H:i"}}</a></td>
 									<td><a href="{% url id detail.id details.number items d %}">{{ detail.RECIPE }}</a></td>
 									<td><a href="{% url id detail.id details.number items d %}">{{ detail.RECIPE_VERSION }}</a></td>
 									<td><a href="{% url id detail.id details.number items d %}">{{ detail.TASK }}</a></td>
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/9] error-report: add 'Submitted on' detail
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 1/9] error-report: add 'Submitted on' column Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 3/9] error-report: add 'Submitter' column Roxana Ciobanu
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

Show the submission date and time for an error in the
the error details page.

[YOCTO #6538]

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 templates/error-details.html | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/templates/error-details.html b/templates/error-details.html
index 0de5f46..f2dc010 100644
--- a/templates/error-details.html
+++ b/templates/error-details.html
@@ -21,6 +21,8 @@
 					<div class="well">
 						<h2>Error details</h2>
 						<dl class="dl-vertical">
+							<dt>Submitted on:</dt>
+							<dd>{{ detail.BUILD.DATE|date:"d/m/y H:i"}}</dd>
 							<dt>Task:</dt>
 							<dd>{{ detail.TASK }}</dd>
 							<dt>Recipe:</dt>
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/9] error-report: add 'Submitter' column
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 1/9] error-report: add 'Submitted on' column Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 2/9] error-report: add 'Submitted on' detail Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 4/9] error-report: add 'Edit columns' menu Roxana Ciobanu
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

Show the submitter in the search results page

[YOCTO #6538]

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 templates/search-details.html | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/templates/search-details.html b/templates/search-details.html
index 3941a1f..b6c2b7e 100644
--- a/templates/search-details.html
+++ b/templates/search-details.html
@@ -27,6 +27,7 @@
 								<th>Host distro</th>
 								<th>Branch</th>
 								<th>Commit</th>
+								<th>Submitter</th>
 							</tr>
 						</thead>
 						<tbody>
@@ -49,6 +50,7 @@
 												{{ detail.BUILD.COMMIT|truncatechars:10}}
 											</div>
 						            </td>
+									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.NAME }} </a></td>
 								</tr>
 							 {%endfor%}
 						</tbody>
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/9] error-report: add 'Edit columns' menu
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
                   ` (2 preceding siblings ...)
  2014-08-22  8:49 ` [PATCH 3/9] error-report: add 'Submitter' column Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 5/9] jquery.cookie.js: add the Cookie Plugin Roxana Ciobanu
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

Add 'Edit columns' menu.

[YOCTO #6538]

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 Post/templatetags/__init__.py    |   0
 Post/templatetags/projecttags.py |  12 +++++
 Post/views.py                    |  26 +++++++++-
 templates/search-details.html    | 105 ++++++++++++++++++++++++++-------------
 4 files changed, 108 insertions(+), 35 deletions(-)
 create mode 100644 Post/templatetags/__init__.py
 create mode 100644 Post/templatetags/projecttags.py

diff --git a/Post/templatetags/__init__.py b/Post/templatetags/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/Post/templatetags/projecttags.py b/Post/templatetags/projecttags.py
new file mode 100644
index 0000000..cd2e0bd
--- /dev/null
+++ b/Post/templatetags/projecttags.py
@@ -0,0 +1,12 @@
+from datetime import datetime, timedelta
+import re
+from django import template
+from django.utils import timezone
+from django.template.defaultfilters import filesizeformat
+
+register = template.Library()
+
+@register.filter(name = 'sortcols')
+def sortcols(tablecols):
+    return sorted(tablecols, key = lambda t: t['name'])
+
diff --git a/Post/views.py b/Post/views.py
index 02f80fc..f9c6655 100644
--- a/Post/views.py
+++ b/Post/views.py
@@ -84,7 +84,31 @@ def search(request, template_name, items = None, page = None, query = None):
     else:
         index = paginator.page_range.index(c.number) - 2
         end = index + 5
-    return render_to_response(template_name, {'details':c, 'd' : query, "no" : no, 'list' : paginator.page_range[index:end], 'items' : items}, RequestContext(request))
+
+    context = {
+        'details':c,
+        'd' : query,
+        "no" : no,
+        'list' : paginator.page_range[index:end],
+        'items' : items,
+        'objectname' : 'errors',
+        'tablecols' : [
+        {'name': 'Submitted on', 'clclass': 'submitted_on'},
+        {'name': 'Recipe'},
+        {'name': 'Recipe version', 'clclass': 'recipe_version'},
+        {'name': 'Task'},
+        {'name': 'Machine'},
+        {'name': 'Distro'},
+        {'name': 'Build system', 'clclass': 'build_sys', 'hidden': 1},
+        {'name': 'Target system', 'clclass': 'target_sys', 'hidden': 1},
+        {'name': 'Host distro', 'clclass': 'host_distro'},
+        {'name': 'Branch', 'clclass': 'branch'},
+        {'name': 'Commit', 'clclass': 'commit'},
+        {'name': 'Submitter', 'clclass': 'submitter','hidden': 1}],
+    }
+
+    return render_to_response(template_name, context, RequestContext(request))
+
 
 def searchDetails(request, template_name, pk, page = None, query = None, items = None):
     results=''
diff --git a/templates/search-details.html b/templates/search-details.html
index b6c2b7e..269aa62 100644
--- a/templates/search-details.html
+++ b/templates/search-details.html
@@ -1,58 +1,88 @@
 {% 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 );
+			}
+		}
+		</script>
+
 			<div class="row-fluid">
 				<div class="page-header">
 					{% if no %}
 						<h1>{{ no }} errors found for "{{ d }}"</h1>
 					{% endif %}
 				</div>
-				{% if details %}
+				<div class="navbar">
+					<div class="navbar-inner">
+						{% if tablecols %}
+							<div class="btn-group pull-right">
+								<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>
-								<th>Submitted on</th>
-								<th>Recipe</th>
-								<th>Recipe version</th>
-								<th>Task</th>
-								<th>Machine</th>
-								<th>Distro</th>
-								<th>Build system</th>
-								<th>Target system</th>
-								<th>Host distro</th>
-								<th>Branch</th>
-								<th>Commit</th>
-								<th>Submitter</th>
+								{% for i in tablecols %} <th class="{{i.dclass}} {{i.clclass}}"> {{i.name}} </th> {%endfor%}
 							</tr>
 						</thead>
 						<tbody>
 							{%for detail in details %}
-								<tr>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.DATE|date:"d/m/y H:i"}}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.RECIPE }}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.RECIPE_VERSION }}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.TASK }}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.MACHINE }}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.DISTRO }}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.BUILD_SYS }}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.TARGET_SYS }}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.NATIVELSBSTRING }}</a></td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.BRANCH }} </a></td>
+								<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}}
+											{{ detail.BUILD.COMMIT|truncatechars:10}}
 											</div>
-						            </td>
-									<td><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.NAME }} </a></td>
+									</td>
+									<td class="submitter"><a href="{% url id detail.id details.number items d %}">{{ detail.BUILD.NAME }} </a></td>
 								</tr>
-							 {%endfor%}
+							{%endfor%}
 						</tbody>
 					</table>
 						<div class="pagination pagination-centered">
@@ -130,11 +160,18 @@
 				           <h4>Nothing matches your search!</h4>
 				{% endif %}
 			</div>
-		    <script>
-		    $(document).ready(function() {
-		    	$('.commit > div').popover({placement:'left'})
-		    });
-		    </script>
+				<script>
+				$(document).ready(function() {
+					$('.commit > div').popover({placement:'left'})
+					$('.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>
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/9] jquery.cookie.js: add the Cookie Plugin
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
                   ` (3 preceding siblings ...)
  2014-08-22  8:49 ` [PATCH 4/9] error-report: add 'Edit columns' menu Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 6/9] error-report: remember state of the menu Roxana Ciobanu
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

Add the Cookie Plugin

[YOCTO #6538]

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 Post/static/js/jquery.cookie.js | 117 ++++++++++++++++++++++++++++++++++++++++
 README                          |   2 +
 2 files changed, 119 insertions(+)
 create mode 100644 Post/static/js/jquery.cookie.js

diff --git a/Post/static/js/jquery.cookie.js b/Post/static/js/jquery.cookie.js
new file mode 100644
index 0000000..9271900
--- /dev/null
+++ b/Post/static/js/jquery.cookie.js
@@ -0,0 +1,117 @@
+/*!
+ * jQuery Cookie Plugin v1.4.0
+ * https://github.com/carhartl/jquery-cookie
+ *
+ * Copyright 2013 Klaus Hartl
+ * Released under the MIT license
+ */
+(function (factory) {
+	if (typeof define === 'function' && define.amd) {
+		// AMD. Register as anonymous module.
+		define(['jquery'], factory);
+	} else {
+		// Browser globals.
+		factory(jQuery);
+	}
+}(function ($) {
+
+	var pluses = /\+/g;
+
+	function encode(s) {
+		return config.raw ? s : encodeURIComponent(s);
+	}
+
+	function decode(s) {
+		return config.raw ? s : decodeURIComponent(s);
+	}
+
+	function stringifyCookieValue(value) {
+		return encode(config.json ? JSON.stringify(value) : String(value));
+	}
+
+	function parseCookieValue(s) {
+		if (s.indexOf('"') === 0) {
+			// This is a quoted cookie as according to RFC2068, unescape...
+			s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
+		}
+
+		try {
+			// Replace server-side written pluses with spaces.
+			// If we can't decode the cookie, ignore it, it's unusable.
+			s = decodeURIComponent(s.replace(pluses, ' '));
+		} catch(e) {
+			return;
+		}
+
+		try {
+			// If we can't parse the cookie, ignore it, it's unusable.
+			return config.json ? JSON.parse(s) : s;
+		} catch(e) {}
+	}
+
+	function read(s, converter) {
+		var value = config.raw ? s : parseCookieValue(s);
+		return $.isFunction(converter) ? converter(value) : value;
+	}
+
+	var config = $.cookie = function (key, value, options) {
+
+		// Write
+		if (value !== undefined && !$.isFunction(value)) {
+			options = $.extend({}, config.defaults, options);
+
+			if (typeof options.expires === 'number') {
+				var days = options.expires, t = options.expires = new Date();
+				t.setDate(t.getDate() + days);
+			}
+
+			return (document.cookie = [
+				encode(key), '=', stringifyCookieValue(value),
+				options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
+				options.path    ? '; path=' + options.path : '',
+				options.domain  ? '; domain=' + options.domain : '',
+				options.secure  ? '; secure' : ''
+			].join(''));
+		}
+
+		// Read
+
+		var result = key ? undefined : {};
+
+		// To prevent the for loop in the first place assign an empty array
+		// in case there are no cookies at all. Also prevents odd result when
+		// calling $.cookie().
+		var cookies = document.cookie ? document.cookie.split('; ') : [];
+
+		for (var i = 0, l = cookies.length; i < l; i++) {
+			var parts = cookies[i].split('=');
+			var name = decode(parts.shift());
+			var cookie = parts.join('=');
+
+			if (key && key === name) {
+				// If second argument (value) is a function it's a converter...
+				result = read(cookie, value);
+				break;
+			}
+
+			// Prevent storing a cookie that we couldn't decode.
+			if (!key && (cookie = read(cookie)) !== undefined) {
+				result[name] = cookie;
+			}
+		}
+
+		return result;
+	};
+
+	config.defaults = {};
+
+	$.removeCookie = function (key, options) {
+		if ($.cookie(key) !== undefined) {
+			// Must not alter options, thus extending a fresh object...
+			$.cookie(key, '', $.extend({}, options, { expires: -1 }));
+			return true;
+		}
+		return false;
+	};
+
+}));
diff --git a/README b/README
index e912103..fcd6e53 100644
--- a/README
+++ b/README
@@ -50,6 +50,8 @@ the Apache License 2.0.
 
 Bundled jQuery is redistributed under the MIT license.
 
+Bundled jquery.cookie.js is redistributed under the MIT license.
+
 Bundled d3.js is redistributed under the BSD License.
 
 Bundled nvd3.js is redistributed under the Apache License 2.0.
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/9] error-report: remember state of the menu
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
                   ` (4 preceding siblings ...)
  2014-08-22  8:49 ` [PATCH 5/9] jquery.cookie.js: add the Cookie Plugin Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 7/9] error-report: sort table by 'Submitted on' column Roxana Ciobanu
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

Remember the state of the menu, so that people are
not forced to customise the columns every
time they search.

[YOCTO #6538]

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 templates/base.html           |  2 +-
 templates/search-details.html | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/templates/base.html b/templates/base.html
index 01453c7..a6f0cf0 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -60,7 +60,7 @@
 		<script type = "text/javascript" src = "{% static "js/bootstrap.min.js" %}"></script>
 		<script type = "text/javascript" src = "{% static "js/d3.v2.js" %}"></script>
 		<script type = "text/javascript" src = "{% static "js/nv.d3.js" %}"></script>
-		
+	    <script type = "text/javascript" src = "{% static "js/jquery.cookie.js" %}"></script>
 		{% block content %}{% endblock %}
 	</body>
 </html>
diff --git a/templates/search-details.html b/templates/search-details.html
index 269aa62..fb1f3c1 100644
--- a/templates/search-details.html
+++ b/templates/search-details.html
@@ -14,6 +14,15 @@
 			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>
 
@@ -163,6 +172,25 @@
 				<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'))
 					});
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/9] error-report: sort table by 'Submitted on' column
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
                   ` (5 preceding siblings ...)
  2014-08-22  8:49 ` [PATCH 6/9] error-report: remember state of the menu Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 8/9] error-report: add css customization Roxana Ciobanu
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

The information in the table needs to be sorted by
"Submitted on", in inverse chronological order (the most
recent error on top).

[YOCTO #6538]

Signer-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 Post/views.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Post/views.py b/Post/views.py
index f9c6655..1844c87 100644
--- a/Post/views.py
+++ b/Post/views.py
@@ -61,6 +61,7 @@ def search(request, template_name, items = None, page = None, query = None):
     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))
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 8/9] error-report: add css customization
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
                   ` (6 preceding siblings ...)
  2014-08-22  8:49 ` [PATCH 7/9] error-report: sort table by 'Submitted on' column Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-22  8:49 ` [PATCH 9/9] error-report: add top 'Show rows' menu Roxana Ciobanu
  2014-08-24 15:40 ` [PATCH 0/9] Fix for YB6538 Paul Eggleton
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

Add css customization for navbar-inner and
dropdown-menu.

[YOCTO #6538]

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 Post/static/css/custom.css | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Post/static/css/custom.css b/Post/static/css/custom.css
index c5cb593..16fe910 100644
--- a/Post/static/css/custom.css
+++ b/Post/static/css/custom.css
@@ -55,3 +55,11 @@ td a:visited {
 .no-results {
 	margin: 10px 0 0;
 }
+
+.navbar-inner form {
+	margin: 5px 0 0;
+}
+
+.dropdown-menu {
+	padding: 10px;
+}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 9/9] error-report: add top 'Show rows' menu
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
                   ` (7 preceding siblings ...)
  2014-08-22  8:49 ` [PATCH 8/9] error-report: add css customization Roxana Ciobanu
@ 2014-08-22  8:49 ` Roxana Ciobanu
  2014-08-24 15:40 ` [PATCH 0/9] Fix for YB6538 Paul Eggleton
  9 siblings, 0 replies; 11+ messages in thread
From: Roxana Ciobanu @ 2014-08-22  8:49 UTC (permalink / raw)
  To: openembedded-core

[YOCTO #6538]

Signed-off-by: Roxana Ciobanu <roxana.ciobanu@intel.com>
---
 templates/search-details.html | 50 +++++++++++++++++++++++++++++++++++++++----
 1 file changed, 46 insertions(+), 4 deletions(-)

diff --git a/templates/search-details.html b/templates/search-details.html
index fb1f3c1..ca428d0 100644
--- a/templates/search-details.html
+++ b/templates/search-details.html
@@ -34,6 +34,49 @@
 				</div>
 				<div class="navbar">
 					<div class="navbar-inner">
+						<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')">
+										{% 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 %}
 						{% if tablecols %}
 							<div class="btn-group pull-right">
 								<button class="btn dropdown-toggle" data-toggle="dropdown">Edit columns
@@ -95,9 +138,9 @@
 						</tbody>
 					</table>
 						<div class="pagination pagination-centered">
+							<form class="form-inline pull-right">
 							{% if no > 10 %}
-							<div class="pull-right">
-								<span class="help-inline">Show rows:</span>
+							<label>Show rows:</label>
 									<form>
 										<select class="paginationLimit" 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" %}
@@ -137,8 +180,7 @@
 											{%endifequal%}
 										</select>
 									</form>
-								</span>
-							</div>
+							</form>
 							{% endif %}
 							 <ul>
 								{% if details.has_previous %}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/9] Fix for YB6538
  2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
                   ` (8 preceding siblings ...)
  2014-08-22  8:49 ` [PATCH 9/9] error-report: add top 'Show rows' menu Roxana Ciobanu
@ 2014-08-24 15:40 ` Paul Eggleton
  9 siblings, 0 replies; 11+ messages in thread
From: Paul Eggleton @ 2014-08-24 15:40 UTC (permalink / raw)
  To: Roxana Ciobanu; +Cc: openembedded-core

Hi Roxana,

On Friday 22 August 2014 11:49:36 Roxana Ciobanu wrote:
> The following changes since commit c1ee6cdfde5d1fe5f38a1e8eef5b7b0dd086df95:
> 
>   README: add required version for django-nvd3 (2014-03-06 13:43:30 +0200)
> 
> are available in the git repository at:
> 
>   git://git.yoctoproject.org/poky-contrib roxana/YB6538
>   http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=roxana/YB6538
> 
> Roxana Ciobanu (9):
>   error-report: add 'Submitted on' column
>   error-report: add 'Submitted on' detail
>   error-report: add 'Submitter' column
>   error-report: add 'Edit columns' menu
>   jquery.cookie.js: add the Cookie Plugin
>   error-report: remember state of the menu
>   error-report: sort table by 'Submitted on' column
>   error-report: add css customization
>   error-report: add top 'Show rows' menu

Merged, thanks. In future if you could send patches to the 
yocto@yoctoproject.org mailing list rather than this one that would be great 
(I noticed this wasn't mentioned in the README file so I've just added it.)

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-08-24 15:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22  8:49 [PATCH 0/9] Fix for YB6538 Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 1/9] error-report: add 'Submitted on' column Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 2/9] error-report: add 'Submitted on' detail Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 3/9] error-report: add 'Submitter' column Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 4/9] error-report: add 'Edit columns' menu Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 5/9] jquery.cookie.js: add the Cookie Plugin Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 6/9] error-report: remember state of the menu Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 7/9] error-report: sort table by 'Submitted on' column Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 8/9] error-report: add css customization Roxana Ciobanu
2014-08-22  8:49 ` [PATCH 9/9] error-report: add top 'Show rows' menu Roxana Ciobanu
2014-08-24 15:40 ` [PATCH 0/9] Fix for YB6538 Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.