Use <h1> for headers in analytics panes instead of <a>

Fixed the padding in the analytics panes.
Don't load the status phrases in the control panel as they're not really needed there.
This commit is contained in:
Azareal 2019-04-28 12:57:25 +10:00
parent e50366ce60
commit c1e74f9af6
21 changed files with 132 additions and 137 deletions

1
.gitignore vendored
View File

@ -28,3 +28,4 @@ Patcher
Gosora
Installer
template_*.go
template_*.jgo

View File

@ -180,8 +180,8 @@ function initPhrases(loggedIn, panel = false) {
let e = "";
if(loggedIn && !panel) e = ",topic_list,topic";
else if(panel) e = ",analytics,panel"; // TODO: Request phrases for just one section of the control panel?
else e = ",topic_list";
fetchPhrases("status,alerts,paginator"+e) // TODO: Break this up?
else e = ",status,topic_list";
fetchPhrases("alerts,paginator"+e) // TODO: Break this up?
}
function fetchPhrases(plist) {

View File

@ -7,7 +7,7 @@
{{range .Header.PreScriptsAsync}}
<script async type="text/javascript" src="/static/{{.}}"></script>{{end}}
<meta property="x-loggedin" content="{{.CurrentUser.Loggedin}}" />
<script type="text/javascript" src="/static/init.js?i=4"></script>
<script type="text/javascript" src="/static/init.js?i=5"></script>
{{range .Header.ScriptsAsync}}
<script async type="text/javascript" src="/static/{{.}}"></script>{{end}}
<script type="text/javascript" src="/static/jquery-3.1.1.min.js"></script>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/agent/{{.Agent}}" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/agent/{{.Agent}}" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{.FriendlyAgent}}{{lang "panel_statistics_views_head_suffix"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{.FriendlyAgent}}{{lang "panel_statistics_views_head_suffix"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_views" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/agents/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/agents/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{lang "panel_statistics_user_agents_head"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_user_agents_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_agents_chart" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/forum/{{.Agent}}" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/forum/{{.Agent}}" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{.FriendlyAgent}}{{lang "panel_statistics_views_head_suffix"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{.FriendlyAgent}}{{lang "panel_statistics_views_head_suffix"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_views" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/forums/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/forums/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{lang "panel_statistics_forums_head"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_forums_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_forums_chart" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/lang/{{.Agent}}" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/lang/{{.Agent}}" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{.FriendlyAgent}}{{lang "panel_statistics_views_head_suffix"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{.FriendlyAgent}}{{lang "panel_statistics_views_head_suffix"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_langs" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/langs/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/langs/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{lang "panel_statistics_languages_head"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_languages_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_langs_chart" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/posts/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/posts/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{lang "panel_statistics_post_counts_head"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_post_counts_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_posts" class="colstack_graph_holder">
<div class="ct_chart" aria-label="{{lang "panel_statistics_post_counts_chart_aria"}}"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/referrer/{{.Agent}}" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/referrer/{{.Agent}}" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{.Agent}}{{lang "panel_statistics_views_head_suffix"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{.Agent}}{{lang "panel_statistics_views_head_suffix"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_referrers" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/referrers/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/referrers/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{lang "panel_statistics_referrers_head"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_referrers_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_referrers" class="colstack_item rowlist">
{{range .ItemList}}
<div class="rowitem panel_compactrow editable_parent">

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/route/{{.Route}}" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/route/{{.Route}}" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{.Route}}{{lang "panel_statistics_views_head_suffix"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{.Route}}{{lang "panel_statistics_views_head_suffix"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_views" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/routes/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/routes/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{lang "panel_statistics_routes_head"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_routes_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_routes_chart" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/system/{{.Agent}}" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/system/{{.Agent}}" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{.FriendlyAgent}}{{lang "panel_statistics_views_head_suffix"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{.FriendlyAgent}}{{lang "panel_statistics_views_head_suffix"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_systems" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/systems/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/systems/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{lang "panel_statistics_operating_systems_head"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_operating_systems_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_systems_chart" class="colstack_graph_holder">
<div class="ct_chart"></div>
</div>

View File

@ -1,4 +1,4 @@
<select class="timeRangeSelector to_right" name="timeRange">
<select form="timeRangeForm" class="timeRangeSelector to_right" name="timeRange">
<option val="one-year"{{if eq .TimeRange "one-year"}} selected{{end}}>{{lang "panel_statistics_time_range_one_year"}}</option>
<option val="three-months"{{if eq .TimeRange "three-months"}} selected{{end}}>{{lang "panel_statistics_time_range_three_months"}}</option>
<option val="one-month"{{if eq .TimeRange "one-month"}} selected{{end}}>{{lang "panel_statistics_time_range_one_month"}}</option>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/topics/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/topics/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<a>{{lang "panel_statistics_topic_counts_head"}}</a>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_topic_counts_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_topics" class="colstack_graph_holder">
<div class="ct_chart" aria-label="{{lang "panel_statistics_topic_counts_chart_aria"}}"></div>
</div>

View File

@ -1,16 +1,15 @@
{{template "header.html" . }}
<div class="colstack panel_stack">
{{template "panel_menu.html" . }}
<main id="panel_analytics_right" class="colstack_right">
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/views/" method="get"></form>
<main id="panel_analytics_right" class="colstack_right analytics">
{{template "panel_before_head.html" . }}
<form id="timeRangeForm" name="timeRangeForm" action="/panel/analytics/views/" method="get">
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_requests_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
<div class="colstack_item colstack_head">
<div class="rowitem">
<h1>{{lang "panel_statistics_requests_head"}}</h1>
{{template "panel_analytics_time_range.html" . }}
</div>
</form>
</div>
<div id="panel_analytics_views" class="colstack_graph_holder">
<div class="ct_chart" aria-label="{{lang "panel_statistics_requests_chart_aria"}}"></div>
</div>

View File

@ -304,6 +304,12 @@
.timeRangeSelector {
margin-top: -5px;
}
.colstack_graph_holder + .rowlist {
margin-top: 8px;
}
.analytics .colstack_head h1 {
margin-top: 2px;
}
/* Experimental header tweaks */
.colstack_head a {

View File

@ -20,6 +20,9 @@
margin-left: 2px;
}
.analytics .colstack_head:first-child {
padding-bottom: 4px;
}
.timeRangeSelector {
padding: 2px;
margin-top: -3px;