From 97bcfbdbb8c21c2c5a537a4883c171eb87fcd6de Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 5 Dec 2012 11:57:12 -0500 Subject: [PATCH] activity: Put the three tables into Bootstrap tabs (imported from commit 508c4b15a82df969b08b430ad892c4b13ed68092) --- templates/zephyr/activity.html | 14 ++++++++++++++ zephyr/views.py | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/templates/zephyr/activity.html b/templates/zephyr/activity.html index b47d6c272b..3a8653a5e1 100644 --- a/templates/zephyr/activity.html +++ b/templates/zephyr/activity.html @@ -4,8 +4,19 @@ {% block content %} + + +
+ {% for name, activity in data.iteritems %} +

{{ name }} usage

@@ -35,9 +46,12 @@ {% endfor %}
+
{% endfor %} +
+ diff --git a/zephyr/views.py b/zephyr/views.py index 70bbaaa9d0..f42e47c2f9 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -969,7 +969,8 @@ def json_fetch_api_key(request, user_profile, password=POST): return json_success({"api_key": user_profile.api_key}) class ActivityTable(object): - def __init__(self, client_name, queries): + def __init__(self, client_name, queries, default_tab=False): + self.default_tab = default_tab self.has_pointer = False self.rows = {} for url, query_name in queries: @@ -1014,7 +1015,7 @@ def get_activity(request): return render_to_response('zephyr/activity.html', { 'data': { - 'Website': ActivityTable('website', web_queries), + 'Website': ActivityTable('website', web_queries, default_tab=True), 'Mirror': ActivityTable('zephyr_mirror', api_queries), 'API': ActivityTable('API', api_queries) }}, context_instance=RequestContext(request))