From 565cba18e26fef82f723f6f80896d8bcd609a51f Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Sun, 12 Apr 2020 01:46:28 -0400 Subject: [PATCH] Add base dashboard view --- Pipfile | 3 +- Pipfile.lock | 32 +-- shynet/a17t/apps.py | 2 +- .../a17t/templates/a17t/includes/field.html | 21 +- .../a17t/templates/a17t/includes/label.html | 1 + shynet/a17t/templatetags/a17t_tags.py | 3 +- .../migrations/0003_auto_20200410_1325.py | 12 +- .../migrations/0004_auto_20200411_1541.py | 25 +- .../analytics/migrations/0005_hit_initial.py | 16 ++ .../migrations/0006_auto_20200412_0003.py | 29 +++ .../migrations/0007_auto_20200412_0010.py | 28 +++ .../migrations/0008_auto_20200412_0015.py | 16 ++ shynet/analytics/models.py | 25 +- shynet/analytics/tasks.py | 31 ++- shynet/core/forms.py | 24 ++ .../migrations/0002_service_anonymize_ips.py | 6 +- .../0003_remove_service_anonymize_ips.py | 14 ++ shynet/core/mixins.py | 36 +++ shynet/core/models.py | 93 +++++-- shynet/core/templates/base.html | 11 +- .../templates/core/includes/date_range.html | 33 +++ .../core/includes/service_overview.html | 39 +-- .../core/includes/sidebar_portal.html | 3 +- .../core/includes/stats_status_chip.html | 15 ++ .../core/templates/core/pages/dashboard.html | 11 +- shynet/core/templates/core/pages/service.html | 230 ++++++++++++++++++ .../templates/core/pages/service_create.html | 20 ++ .../templates/core/pages/service_update.html | 33 +++ shynet/core/templatetags/__init__.py | 0 shynet/core/templatetags/helpers.py | 27 ++ shynet/core/urls.py | 7 + shynet/core/views.py | 47 +++- shynet/shynet/settings.py | 11 +- tests/pixel.html | 8 - 34 files changed, 762 insertions(+), 150 deletions(-) create mode 100644 shynet/a17t/templates/a17t/includes/label.html create mode 100644 shynet/analytics/migrations/0005_hit_initial.py create mode 100644 shynet/analytics/migrations/0006_auto_20200412_0003.py create mode 100644 shynet/analytics/migrations/0007_auto_20200412_0010.py create mode 100644 shynet/analytics/migrations/0008_auto_20200412_0015.py create mode 100644 shynet/core/forms.py create mode 100644 shynet/core/migrations/0003_remove_service_anonymize_ips.py create mode 100644 shynet/core/mixins.py create mode 100644 shynet/core/templates/core/includes/date_range.html create mode 100644 shynet/core/templates/core/includes/stats_status_chip.html create mode 100644 shynet/core/templates/core/pages/service.html create mode 100644 shynet/core/templates/core/pages/service_create.html create mode 100644 shynet/core/templates/core/pages/service_update.html create mode 100644 shynet/core/templatetags/__init__.py create mode 100644 shynet/core/templatetags/helpers.py diff --git a/Pipfile b/Pipfile index f7468f9..41ae48a 100644 --- a/Pipfile +++ b/Pipfile @@ -15,8 +15,7 @@ django-ipware = "*" pyyaml = "*" ua-parser = "*" user-agents = "*" -django-humanize = "*" -anonymizeip = "*" +emoji-country-flag = "*" [requires] python_version = "3.6" diff --git a/Pipfile.lock b/Pipfile.lock index 2d9ba1f..b344009 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "5c4a63923138fea970c8851ac72d6d6a391db28090a02d738e675775d2c6f26b" + "sha256": "93fe2edcab5c588173dcaa4799fd66873e47014f417920ad5a969544a33e5cb5" }, "pipfile-spec": 6, "requires": { @@ -23,14 +23,6 @@ ], "version": "==2.5.2" }, - "anonymizeip": { - "hashes": [ - "sha256:491cb94a31bae23294c5b93a13dd5c9ed55be98003c622e76e2fe64d6a4f3e91", - "sha256:e0d446b06b2bbf236394a90b971de403f90f805d14db3a405f8731716acad1fe" - ], - "index": "pypi", - "version": "==1.0.0" - }, "asgiref": { "hashes": [ "sha256:8036f90603c54e93521e5777b2b9a39ba1bad05773fcf2d208f0299d1df58ce5", @@ -89,13 +81,6 @@ "index": "pypi", "version": "==0.41.0" }, - "django-humanize": { - "hashes": [ - "sha256:32491bf0209b89a277f7bfdab7fd6d4cc7944bb037f742d62e8e447a575c0028" - ], - "index": "pypi", - "version": "==0.1.2" - }, "django-ipware": { "hashes": [ "sha256:a7c7a8fd019dbdc9c357e6e582f65034e897572fc79a7e467674efa8aef9d00b" @@ -103,6 +88,14 @@ "index": "pypi", "version": "==2.1.0" }, + "emoji-country-flag": { + "hashes": [ + "sha256:67c0cb6a3765fb53f31b34160d6b1c8a5f44b297bc278d1835c6f2e5b0a9a592", + "sha256:ae7edb38077b0840210fa9e37673f481f2b9c032446e13ad6dab2b1108cd7ad6" + ], + "index": "pypi", + "version": "==1.2.1" + }, "geoip2": { "hashes": [ "sha256:5869e987bc54c0d707264fec4710661332cc38d2dca5a7f9bb5362d0308e2ce0", @@ -111,13 +104,6 @@ "index": "pypi", "version": "==3.0.0" }, - "humanize": { - "hashes": [ - "sha256:98b7ac9d1a70ad62175c8e0dd44beebbd92418727fc4e214468dfb2baa8ebfb5", - "sha256:bc2a1ff065977011de2bc36197a4b14730c54bfc46ab12a153376684573a2dab" - ], - "version": "==2.3.0" - }, "idna": { "hashes": [ "sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb", diff --git a/shynet/a17t/apps.py b/shynet/a17t/apps.py index 5a88f82..39f23f6 100644 --- a/shynet/a17t/apps.py +++ b/shynet/a17t/apps.py @@ -2,4 +2,4 @@ from django.apps import AppConfig class A17TConfig(AppConfig): - name = 'a17t' + name = "a17t" diff --git a/shynet/a17t/templates/a17t/includes/field.html b/shynet/a17t/templates/a17t/includes/field.html index 1f57247..3aed3e4 100644 --- a/shynet/a17t/templates/a17t/includes/field.html +++ b/shynet/a17t/templates/a17t/includes/field.html @@ -1,7 +1,6 @@ {% load a17t_tags %} - - + {% if field|is_checkbox %}