mirror of
https://github.com/zulip/zulip.git
synced 2025-11-23 16:01:24 +00:00
Eliminate the default_tab attribute in ActivityTable.
(Just have the template automatically select the first tab.) (imported from commit 4a1877c8d3d6215f8e8ad6a184c79bf4eb001001)
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
{% for name, activity in data %}
|
||||
<li {% if activity.default_tab %} class="active" {% endif %}>
|
||||
<li {% if forloop.first %} class="active" {% endif %}>
|
||||
<a href="#{{ name }}" data-toggle="tab">{{ name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
{% for name, activity in data %}
|
||||
|
||||
<div class="tab-pane {% if activity.default_tab %} active {% endif %}" id="{{ name }}">
|
||||
<div class="tab-pane {% if forloop.first %} active {% endif %}" id="{{ name }}">
|
||||
<h2>{{ name }} usage</h2>
|
||||
<table class="table sortable table-striped table-bordered">
|
||||
|
||||
|
||||
@@ -1752,9 +1752,8 @@ def json_fetch_api_key(request, user_profile, password=REQ):
|
||||
return json_success({"api_key": user_profile.api_key})
|
||||
|
||||
class ActivityTable(object):
|
||||
def __init__(self, realm, client_name, queries, default_tab=False):
|
||||
def __init__(self, realm, client_name, queries):
|
||||
self.realm = realm
|
||||
self.default_tab = default_tab
|
||||
self.has_pointer = False
|
||||
self.rows = {}
|
||||
|
||||
@@ -1853,7 +1852,7 @@ def get_activity(request, realm=REQ(default=None)):
|
||||
|
||||
return render_to_response('zerver/activity.html',
|
||||
{ 'data': [
|
||||
('Website', ActivityTable(realm, 'website', web_queries, default_tab=True)),
|
||||
('Website', ActivityTable(realm, 'website', web_queries)),
|
||||
('Mirror', ActivityTable(realm, 'zephyr_mirror', api_queries)),
|
||||
('Desktop', ActivityTable(realm, 'desktop', api_queries)),
|
||||
('API', ActivityTable(realm, 'API', api_queries)),
|
||||
|
||||
Reference in New Issue
Block a user