Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

analytics: Use flexbox for charts in stats page.

Lauryn Menard06445dc5e133
diff --git a/static/styles/portico/stats.css b/static/styles/portico/stats.css
index 415a0899f7a..8c874b392c8 100644
--- a/static/styles/portico/stats.css
+++ b/static/styles/portico/stats.css
@@ -22,16 +22,21 @@ p {
}
.center-charts {
- margin: 30px auto;
- width: 790px; /* chart = 750px + 20px padding */
+ margin: 30px;
}
-.stats-page .alert {
+.stats-page .alert,
+.analytics-page-header {
text-align: center;
}
+.flex-container {
+ display: flex;
+ flex-flow: wrap;
+ justify-content: space-around;
+}
+
.chart-container {
- display: inline-block;
vertical-align: top;
margin: 10px 0;
padding: 20px;
@@ -224,19 +229,3 @@ p {
transform: rotate(360deg);
}
}
-
-@media (width >= 1680px) {
- .center-charts {
- width: calc(
- 816px * 2
- ); /* 790px + 4px for borders + 2px for il-block + 20px margins */
-
- .left,
- .right {
- display: inline-block;
- vertical-align: top;
- margin: 0 10px;
- width: 790px;
- }
- }
-}
diff --git a/templates/analytics/stats.html b/templates/analytics/stats.html
index 2b95f009121..7ab843bb156 100644
--- a/templates/analytics/stats.html
+++ b/templates/analytics/stats.html
@@ -21,49 +21,7 @@
<div id="id_stats_errors" class="alert alert-error"></div>
<div class="center-charts">
<h1 class="analytics-page-header">{% trans %}Zulip analytics for {{ target_name }}{% endtrans %}</h1>
-
- <div class="left">
- <div class="chart-container">
- <h1>{{ _("Messages sent over time") }}</h1>
- <div class="button-container">
- <label>{{ _("Aggregation") }}</label>
- <div class="buttons">
- <button class="button" type="button" id='daily_button'>{{ _("Daily") }} </button>
- <button class="button" type="button" id='weekly_button'>{{ _("Weekly") }} </button>
- <button class="button" type="button" id='cumulative_button'>{{ _("Cumulative") }} </button>
- </div>
- </div>
- <div id="id_messages_sent_over_time">
- <div class="spinner"></div>
- </div>
- <div id="hoverinfo">
- <span id="hover_date"></span>
- <span id="hover_me">{{ _("Me") }}:</span>
- <span id="hover_me_value"></span>
- <b id="hover_human">{{ _("Humans") }}:</b>
- <span id="hover_human_value"></span>
- <b id="hover_bot">{{ _("Bots") }}:</b>
- <span id="hover_bot_value"></span>
- </div>
- </div>
-
- <div class="chart-container pie-chart">
- <div id="pie_messages_sent_by_client">
- <h1>{{ _("Messages sent by client") }}</h1>
- <div id="id_messages_sent_by_client" class="number-stat">
- <div class="spinner"></div>
- </div>
- <div class="buttons">
- <button class="button" type="button" data-user="user">{{ _("Me") }}</button>
- <button class="button selected" type="button" data-user="everyone">{{ _("Everyone") }}</button>
- <button class="button" type="button" data-time="week">{{ _("Last week") }}</button>
- <button class="button selected" type="button" data-time="month">{{ _("Last month") }}</button>
- <button class="button" type="button" data-time="year">{{ _("Last year") }}</button>
- <button class="button" type="button" data-time="cumulative">{{ _("All time") }}</button>
- </div>
- </div>
- </div>
-
+ <div class="flex-container">
<div class="chart-container">
<h1>{{ _("Active users") }}</h1>
<div class="button-container">
@@ -84,9 +42,6 @@
<span id="users_hover_all_time_value"></span>
</div>
</div>
- </div>
-
- <div class="right">
<div class="chart-container pie-chart">
<div id="pie_messages_sent_by_type">
<h1>{{ _("Messages sent by recipient type") }}</h1>
@@ -104,6 +59,29 @@
</div>
</div>
</div>
+ <div class="chart-container">
+ <h1>{{ _("Messages sent over time") }}</h1>
+ <div class="button-container">
+ <label>{{ _("Aggregation") }}</label>
+ <div class="buttons">
+ <button class="button" type="button" id='daily_button'>{{ _("Daily") }} </button>
+ <button class="button" type="button" id='weekly_button'>{{ _("Weekly") }} </button>
+ <button class="button" type="button" id='cumulative_button'>{{ _("Cumulative") }} </button>
+ </div>
+ </div>
+ <div id="id_messages_sent_over_time">
+ <div class="spinner"></div>
+ </div>
+ <div id="hoverinfo">
+ <span id="hover_date"></span>
+ <span id="hover_me">{{ _("Me") }}:</span>
+ <span id="hover_me_value"></span>
+ <b id="hover_human">{{ _("Humans") }}:</b>
+ <span id="hover_human_value"></span>
+ <b id="hover_bot">{{ _("Bots") }}:</b>
+ <span id="hover_bot_value"></span>
+ </div>
+ </div>
<div class="chart-container">
<h1>{{ _("Messages read over time") }}</h1>
<div class="button-container">
@@ -125,6 +103,22 @@
<span id="read_hover_everyone_value"></span>
</div>
</div>
+ <div class="chart-container pie-chart">
+ <div id="pie_messages_sent_by_client">
+ <h1>{{ _("Messages sent by client") }}</h1>
+ <div id="id_messages_sent_by_client">
+ <div class="spinner"></div>
+ </div>
+ <div class="buttons">
+ <button class="button" type="button" data-user="user">{{ _("Me") }}</button>
+ <button class="button selected" type="button" data-user="everyone">{{ _("Everyone") }}</button>
+ <button class="button" type="button" data-time="week">{{ _("Last week") }}</button>
+ <button class="button selected" type="button" data-time="month">{{ _("Last month") }}</button>
+ <button class="button" type="button" data-time="year">{{ _("Last year") }}</button>
+ <button class="button" type="button" data-time="cumulative">{{ _("All time") }}</button>
+ </div>
+ </div>
+ </div>
</div>
</div>