From 8edf9a70345f0b4e45bb55de040f4da6d56aa6c2 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Sat, 7 May 2016 16:25:27 +0200 Subject: [PATCH] Redesign empty statistics page --- .../pretixplugins/statistics/index.html | 64 +++++++++++-------- src/pretix/plugins/statistics/views.py | 2 + src/static/pretixcontrol/scss/main.scss | 5 ++ 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/src/pretix/plugins/statistics/templates/pretixplugins/statistics/index.html b/src/pretix/plugins/statistics/templates/pretixplugins/statistics/index.html index e8dc9fb350..24f476118a 100644 --- a/src/pretix/plugins/statistics/templates/pretixplugins/statistics/index.html +++ b/src/pretix/plugins/statistics/templates/pretixplugins/statistics/index.html @@ -5,34 +5,48 @@ {% block title %}{% trans "Statistics" %}{% endblock %} {% block content %}

{% trans "Statistics" %}

-
-
-

{% trans "Orders by day" %}

+ {% if has_orders %} +
+
+

{% trans "Orders by day" %}

+
+
+
+
-
-
+
+
+

{% trans "Revenue over time" %}

+
+
+
+
-
-
-
-

{% trans "Revenue over time" %}

+
+
+

{% trans "Orders by product" %}

+
+
+
+
-
-
+ + + + + + {% else %} +
+

+ +

+

+ {% blocktrans trimmed %} + We will show you a variety of statistics about your sales right here, as soon as the first orders + are submitted! + {% endblocktrans %} +

-
-
-
-

{% trans "Orders by product" %}

-
-
-
-
-
- - - - - + {% endif %} {% endblock %} diff --git a/src/pretix/plugins/statistics/views.py b/src/pretix/plugins/statistics/views.py index 6cd4f6ee61..524061f109 100644 --- a/src/pretix/plugins/statistics/views.py +++ b/src/pretix/plugins/statistics/views.py @@ -114,4 +114,6 @@ class IndexView(EventPermissionRequiredMixin, TemplateView): ctx['rev_data'] = json.dumps(data) cache.set('statistics_rev_data', ctx['rev_data']) + ctx['has_orders'] = self.request.event.orders.exists() + return ctx diff --git a/src/static/pretixcontrol/scss/main.scss b/src/static/pretixcontrol/scss/main.scss index ff384797f9..f5afd374bf 100644 --- a/src/static/pretixcontrol/scss/main.scss +++ b/src/static/pretixcontrol/scss/main.scss @@ -106,4 +106,9 @@ h1 .btn-sm { p { font-size: 24px; } + + .big-grey-icon { + font-size: 200px; + color: #ccc; + } } \ No newline at end of file