Improve service page when no hits are recorded
This commit is contained in:
parent
4afeced7d3
commit
4a76ab32fc
@ -13,15 +13,12 @@
|
|||||||
{% block service_content %}
|
{% block service_content %}
|
||||||
{% if not stats.has_hits %}
|
{% if not stats.has_hits %}
|
||||||
<div class="content mb-6">
|
<div class="content mb-6">
|
||||||
<h5>Get started</h5>
|
|
||||||
<p>
|
<p>
|
||||||
It seems that you have not recorded any data yet!
|
This service hasn't collected any data yet. To get started, place the following code snippet at the end of the <code><body></code> tag on any page you'd like to track.
|
||||||
<br>
|
|
||||||
Get started by placing the following snippet at the end of the <code><body></code> tag on any page you'd like to track.
|
|
||||||
</p>
|
</p>
|
||||||
{% include 'dashboard/includes/service_snippet.html' %}
|
{% include 'dashboard/includes/service_snippet.html' %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% else %}
|
||||||
<div class="grid grid-cols-2 gap-6 md:flex justify-between mb-6 card ~neutral !high px-6" id="stats">
|
<div class="grid grid-cols-2 gap-6 md:flex justify-between mb-6 card ~neutral !high px-6" id="stats">
|
||||||
{% with classes="text-sm font-semibold" good_classes="text-positive-400" bad_classes="text-critical-400" neutral_classes="text-gray-400" %}
|
{% with classes="text-sm font-semibold" good_classes="text-positive-400" bad_classes="text-critical-400" neutral_classes="text-gray-400" %}
|
||||||
<article class="">
|
<article class="">
|
||||||
@ -96,6 +93,7 @@
|
|||||||
</article>
|
</article>
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
<div class="card ~neutral !low py-0 mb-6">
|
<div class="card ~neutral !low py-0 mb-6">
|
||||||
{% include 'dashboard/includes/time_chart.html' with data=stats.session_chart_data %}
|
{% include 'dashboard/includes/time_chart.html' with data=stats.session_chart_data %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -66,6 +66,7 @@ class ServiceView(
|
|||||||
|
|
||||||
def get_context_data(self, **kwargs):
|
def get_context_data(self, **kwargs):
|
||||||
data = super().get_context_data(**kwargs)
|
data = super().get_context_data(**kwargs)
|
||||||
|
data["script_protocol"] = "https://" if settings.SCRIPT_USE_HTTPS else "http://"
|
||||||
data["stats"] = self.object.get_core_stats(data["start_date"], data["end_date"])
|
data["stats"] = self.object.get_core_stats(data["start_date"], data["end_date"])
|
||||||
data["object_list"] = Session.objects.filter(
|
data["object_list"] = Session.objects.filter(
|
||||||
service=self.get_object(),
|
service=self.get_object(),
|
||||||
|
Loading…
Reference in New Issue
Block a user