From b64dd31c3cf70a1c74c3f29bcac793f7fc669c67 Mon Sep 17 00:00:00 2001 From: "phoglund@webrtc.org" Date: Fri, 10 Aug 2012 08:57:39 +0000 Subject: [PATCH] Split bot status list in two rows so it fits better on the screen. BUG= Review URL: https://webrtc-codereview.appspot.com/709009 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2590 4adac7df-926f-26a2-2b94-8c16560cd09d --- tools/quality_tracking/dashboard/dashboard.py | 8 ++++++++ .../dashboard/templates/dashboard_template.html | 17 +++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/tools/quality_tracking/dashboard/dashboard.py b/tools/quality_tracking/dashboard/dashboard.py index 3b067ab813..d18d75cd40 100644 --- a/tools/quality_tracking/dashboard/dashboard.py +++ b/tools/quality_tracking/dashboard/dashboard.py @@ -12,6 +12,8 @@ __author__ = 'phoglund@webrtc.org (Patrik Höglund)' +import math + from google.appengine.ext.webapp import template import webapp2 @@ -28,7 +30,13 @@ class ShowDashboard(webapp2.RequestHandler): def get(self): build_status_loader = load_build_status.BuildStatusLoader() + + # Split the build status data in two rows to fit them on the page. build_status_data = build_status_loader.load_build_status_data() + split_point = int(math.ceil(len(build_status_data) / 2.0)) + build_status_data_row_1 = build_status_data[:split_point] + build_status_data_row_2 = build_status_data[split_point:] + last_updated_at = build_status_loader.load_last_modified_at() if last_updated_at is None: self._show_error_page("No data has yet been uploaded to the dashboard.") diff --git a/tools/quality_tracking/dashboard/templates/dashboard_template.html b/tools/quality_tracking/dashboard/templates/dashboard_template.html index 70cf6e5832..419116f197 100644 --- a/tools/quality_tracking/dashboard/templates/dashboard_template.html +++ b/tools/quality_tracking/dashboard/templates/dashboard_template.html @@ -67,12 +67,25 @@
(as of {{ last_updated_at }} UTC)
- {% for entry in build_status_data %} + {% for entry in build_status_data_row_1 %} {% endfor %} - {% for entry in build_status_data %} + {% for entry in build_status_data_row_1 %} + + {% endfor %} + + + {% for entry in build_status_data_row_2 %} + + {% endfor %} + + + {% for entry in build_status_data_row_2 %}
{{ entry.bot_name }}
+ {{entry.status}} +
{{ entry.bot_name }}
{{entry.status}}