Make /activity client tab order be deterministic.

Use an array of tuples, not a dictionary, for the client tabs.

(imported from commit d0ef09bd7885fbb261227786b90ea2949cea7ab4)
This commit is contained in:
Steve Howell 2013-09-25 12:10:56 -04:00
parent 4d730c1691
commit b8f3b38524
2 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@
{% block content %}
<ul class="nav nav-tabs">
{% for name, activity in data.iteritems %}
{% for name, activity in data %}
<li {% if activity.default_tab %} class="active" {% endif %}>
<a href="#{{ name }}" data-toggle="tab">{{ name }}</a>
</li>
@ -27,7 +27,7 @@
<div class="tab-content">
{% for name, activity in data.iteritems %}
{% for name, activity in data %}
<div class="tab-pane {% if activity.default_tab %} active {% endif %}" id="{{ name }}">
<h2>{{ name }} usage</h2>

View File

@ -1847,13 +1847,13 @@ def get_activity(request):
)
return render_to_response('zerver/activity.html',
{ 'data': {
'Website': ActivityTable('website', web_queries, default_tab=True),
'Mirror': ActivityTable('zephyr_mirror', api_queries),
'API': ActivityTable('API', api_queries),
'Android': ActivityTable('Android', api_queries),
'iPhone': ActivityTable('iPhone', api_queries)
}}, context_instance=RequestContext(request))
{ 'data': [
('Website', ActivityTable('website', web_queries, default_tab=True)),
('Mirror', ActivityTable('zephyr_mirror', api_queries)),
('API', ActivityTable('API', api_queries)),
('Android', ActivityTable('Android', api_queries)),
('iPhone', ActivityTable('iPhone', api_queries))
]}, context_instance=RequestContext(request))
def get_status_list(requesting_user_profile):
return {'presences': get_status_dict(requesting_user_profile),