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
This commit is contained in:
phoglund@webrtc.org 2012-08-10 08:57:39 +00:00
parent 3c286747ce
commit b64dd31c3c
2 changed files with 23 additions and 2 deletions

View File

@ -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.")

View File

@ -67,12 +67,25 @@
<div>(as of {{ last_updated_at }} UTC)</div>
<table>
<tr>
{% for entry in build_status_data %}
{% for entry in build_status_data_row_1 %}
<th class="status_cell">{{ entry.bot_name }}</th>
{% endfor %}
</tr>
<tr>
{% for entry in build_status_data %}
{% for entry in build_status_data_row_1 %}
<td title="Last built revision {{ entry.revision }}"
class="status_cell status_{{entry.status}}">
{{entry.status}}
</td>
{% endfor %}
</tr>
<tr>
{% for entry in build_status_data_row_2 %}
<th class="status_cell">{{ entry.bot_name }}</th>
{% endfor %}
</tr>
<tr>
{% for entry in build_status_data_row_2 %}
<td title="Last built revision {{ entry.revision }}"
class="status_cell status_{{entry.status}}">
{{entry.status}}