From 57838a2e98f7e80117448562865b09733a1637a9 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Wed, 10 Apr 2019 13:03:07 +0100 Subject: Initial work on some base templates --- pydis_site/apps/home/templatetags/__init__.py | 0 pydis_site/apps/home/templatetags/extra_filters.py | 8 + pydis_site/apps/home/urls.py | 2 +- pydis_site/static/assets/logo-banner.png | Bin 34789 -> 0 bytes pydis_site/static/assets/logo-banner.svg | 55 -- pydis_site/static/assets/logo-discord.png | Bin 63590 -> 0 bytes pydis_site/static/css/home/index.css | 18 + pydis_site/static/css/navbar.css | 4 - pydis_site/static/home/css/index.css | 30 - pydis_site/static/images/logo_site_banner.min.svg | 39 + pydis_site/static/images/logo_site_banner.png | Bin 0 -> 217061 bytes pydis_site/static/images/logo_site_banner.svg | 1041 ++++++++++++++++++++ pydis_site/static/images/sponsors/adafruit.png | Bin 0 -> 7605 bytes pydis_site/static/images/sponsors/jetbrains.png | Bin 0 -> 167813 bytes pydis_site/static/images/sponsors/jetbrains.svg | 66 ++ .../static/images/sponsors/linode-diagonal.png | Bin 0 -> 29104 bytes pydis_site/static/images/sponsors/linode.png | Bin 0 -> 30887 bytes pydis_site/templates/base.html | 22 - pydis_site/templates/base/base-hero.html | 50 + pydis_site/templates/base/base.html | 41 + pydis_site/templates/base/navbar.html | 110 +++ pydis_site/templates/home/index.html | 92 +- pydis_site/templates/navbar.html | 16 - 23 files changed, 1432 insertions(+), 162 deletions(-) create mode 100644 pydis_site/apps/home/templatetags/__init__.py create mode 100644 pydis_site/apps/home/templatetags/extra_filters.py delete mode 100644 pydis_site/static/assets/logo-banner.png delete mode 100644 pydis_site/static/assets/logo-banner.svg delete mode 100644 pydis_site/static/assets/logo-discord.png create mode 100644 pydis_site/static/css/home/index.css delete mode 100644 pydis_site/static/css/navbar.css delete mode 100644 pydis_site/static/home/css/index.css create mode 100644 pydis_site/static/images/logo_site_banner.min.svg create mode 100644 pydis_site/static/images/logo_site_banner.png create mode 100644 pydis_site/static/images/logo_site_banner.svg create mode 100644 pydis_site/static/images/sponsors/adafruit.png create mode 100644 pydis_site/static/images/sponsors/jetbrains.png create mode 100644 pydis_site/static/images/sponsors/jetbrains.svg create mode 100644 pydis_site/static/images/sponsors/linode-diagonal.png create mode 100644 pydis_site/static/images/sponsors/linode.png delete mode 100644 pydis_site/templates/base.html create mode 100644 pydis_site/templates/base/base-hero.html create mode 100644 pydis_site/templates/base/base.html create mode 100644 pydis_site/templates/base/navbar.html delete mode 100644 pydis_site/templates/navbar.html (limited to 'pydis_site') diff --git a/pydis_site/apps/home/templatetags/__init__.py b/pydis_site/apps/home/templatetags/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pydis_site/apps/home/templatetags/extra_filters.py b/pydis_site/apps/home/templatetags/extra_filters.py new file mode 100644 index 00000000..edffe9ac --- /dev/null +++ b/pydis_site/apps/home/templatetags/extra_filters.py @@ -0,0 +1,8 @@ +from django import template + +register = template.Library() + + +@register.filter +def starts_with(value: str, arg: str): + return value.startswith(arg) diff --git a/pydis_site/apps/home/urls.py b/pydis_site/apps/home/urls.py index a01e019e..56525af8 100644 --- a/pydis_site/apps/home/urls.py +++ b/pydis_site/apps/home/urls.py @@ -5,6 +5,6 @@ from django.views.generic import TemplateView app_name = 'home' urlpatterns = [ - path('', TemplateView.as_view(template_name='home/index.html'), name='index'), + path('', TemplateView.as_view(template_name='home/index.html'), name='home.index'), path('admin/', admin.site.urls) ] diff --git a/pydis_site/static/assets/logo-banner.png b/pydis_site/static/assets/logo-banner.png deleted file mode 100644 index 89aa9b5a..00000000 Binary files a/pydis_site/static/assets/logo-banner.png and /dev/null differ diff --git a/pydis_site/static/assets/logo-banner.svg b/pydis_site/static/assets/logo-banner.svg deleted file mode 100644 index ac04d699..00000000 --- a/pydis_site/static/assets/logo-banner.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pydis_site/static/assets/logo-discord.png b/pydis_site/static/assets/logo-discord.png deleted file mode 100644 index 2bf74ffd..00000000 Binary files a/pydis_site/static/assets/logo-discord.png and /dev/null differ diff --git a/pydis_site/static/css/home/index.css b/pydis_site/static/css/home/index.css new file mode 100644 index 00000000..2d744915 --- /dev/null +++ b/pydis_site/static/css/home/index.css @@ -0,0 +1,18 @@ +.discord-banner { + border-radius: 0.5rem; +} + +.hero-image { + width: 20rem; + margin: auto; +} + +.hero-body { + padding-top: 1rem; + padding-bottom: 1rem; +} + +.section-sp img { + height: 5rem; + margin-right: 2rem; +} diff --git a/pydis_site/static/css/navbar.css b/pydis_site/static/css/navbar.css deleted file mode 100644 index db4b85e7..00000000 --- a/pydis_site/static/css/navbar.css +++ /dev/null @@ -1,4 +0,0 @@ -.navbar-icon { - max-height: 3em; - margin: 0.5em 0 0.5em 2.5em; -} diff --git a/pydis_site/static/home/css/index.css b/pydis_site/static/home/css/index.css deleted file mode 100644 index 76653320..00000000 --- a/pydis_site/static/home/css/index.css +++ /dev/null @@ -1,30 +0,0 @@ -html { - background-color: #7289DA; -} - -.overview > h1 { - margin-top: 0.5em; - margin-bottom: -0.25em; -} - -.overview > p.is-size-7 { - margin-bottom: 2em; -} - -.overview > p.is-size-4 { - margin-bottom: 1em; -} - -.overview > p.is-size-6 { - margin-bottom: 1em; -} - -.overview > img { - border: 1px solid #6378BF; - margin-bottom: 1em; -} - -.overview > .divider { - letter-spacing: -3px; - margin-bottom: 1em; -} diff --git a/pydis_site/static/images/logo_site_banner.min.svg b/pydis_site/static/images/logo_site_banner.min.svg new file mode 100644 index 00000000..4d868d04 --- /dev/null +++ b/pydis_site/static/images/logo_site_banner.min.svg @@ -0,0 +1,39 @@ + + + + + +image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pydis_site/static/images/logo_site_banner.png b/pydis_site/static/images/logo_site_banner.png new file mode 100644 index 00000000..9ab656c0 Binary files /dev/null and b/pydis_site/static/images/logo_site_banner.png differ diff --git a/pydis_site/static/images/logo_site_banner.svg b/pydis_site/static/images/logo_site_banner.svg new file mode 100644 index 00000000..27132b12 --- /dev/null +++ b/pydis_site/static/images/logo_site_banner.svg @@ -0,0 +1,1041 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pydis_site/static/images/sponsors/adafruit.png b/pydis_site/static/images/sponsors/adafruit.png new file mode 100644 index 00000000..27cd9953 Binary files /dev/null and b/pydis_site/static/images/sponsors/adafruit.png differ diff --git a/pydis_site/static/images/sponsors/jetbrains.png b/pydis_site/static/images/sponsors/jetbrains.png new file mode 100644 index 00000000..ccceb958 Binary files /dev/null and b/pydis_site/static/images/sponsors/jetbrains.png differ diff --git a/pydis_site/static/images/sponsors/jetbrains.svg b/pydis_site/static/images/sponsors/jetbrains.svg new file mode 100644 index 00000000..75d4d217 --- /dev/null +++ b/pydis_site/static/images/sponsors/jetbrains.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pydis_site/static/images/sponsors/linode-diagonal.png b/pydis_site/static/images/sponsors/linode-diagonal.png new file mode 100644 index 00000000..4b38003b Binary files /dev/null and b/pydis_site/static/images/sponsors/linode-diagonal.png differ diff --git a/pydis_site/static/images/sponsors/linode.png b/pydis_site/static/images/sponsors/linode.png new file mode 100644 index 00000000..22daa661 Binary files /dev/null and b/pydis_site/static/images/sponsors/linode.png differ diff --git a/pydis_site/templates/base.html b/pydis_site/templates/base.html deleted file mode 100644 index 1dcdfdc4..00000000 --- a/pydis_site/templates/base.html +++ /dev/null @@ -1,22 +0,0 @@ -{# Base template, with a few basic style definitions. #} -{% load django_simple_bulma %} -{% load static %} - - - - - - Python Discord | {% block page_title %}Website{% endblock %} - - - {% bulma %} - {% font_awesome %} - {% block head %}{% endblock %} - - - {% block body %} - {% endblock %} - - - - diff --git a/pydis_site/templates/base/base-hero.html b/pydis_site/templates/base/base-hero.html new file mode 100644 index 00000000..40de6deb --- /dev/null +++ b/pydis_site/templates/base/base-hero.html @@ -0,0 +1,50 @@ +{% load django_simple_bulma %} +{% load static %} + + + + + + + + + Python Discord | {% block title %}Website{% endblock %} + + {% bulma %} + + {# Font-awesome here is defined explicitly so that we can have Pro #} + + + {% block head %}{% endblock %} + + + +
+
+ {% block hero-head %}{% endblock %} +
+
+ {% block hero-body %}{% endblock %} +
+
+ {% block hero-foot %}{% endblock %} + {% include "base/navbar.html" with active_item=False dropdowns=True icon_weight="fas" use_logo=False %} +
+
+ +{% block content %}{% endblock %} + + + + diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html new file mode 100644 index 00000000..a9edac49 --- /dev/null +++ b/pydis_site/templates/base/base.html @@ -0,0 +1,41 @@ +{# Base template, with a few basic style definitions. #} +{% load django_simple_bulma %} +{% load static %} + + + + + + + + + Python Discord | {% block title %}Website{% endblock %} + + {% bulma %} + + {# Font-awesome here is defined explicitly so that we can have Pro #} + + + {% block head %}{% endblock %} + + +{% include "base/navbar.html" with active_item=True dropdowns=True icon_weight="fal" use_logo=True %} +{% block content %}{% endblock %} + + + + + + + diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html new file mode 100644 index 00000000..88a13aeb --- /dev/null +++ b/pydis_site/templates/base/navbar.html @@ -0,0 +1,110 @@ +{% load extra_filters %} +{% load static %} + +{% comment %} +This template is responsible for rendering the main navigation on each page that uses it. +It requires two arguments to be set in the include: + +* `dropdown` (bool): True to render the dropdowns included, False to omit them +* `icon_weight` (str): Either "fas", "far" or "fal" to correspond with Font-Awesome's weight classes. + This will not affect branding icons, which have the "fab" class. +* use_logo (bool): True to render the navbar with the site logo on the left side, False to use an + icon with text instead + +For example, to use light icons and no dropdowns, you could use the following in your template: + +{% include "base/navbar.html" with icon_weight="fal" dropdowns=False %} +{% endcomment %} + + + + diff --git a/pydis_site/templates/home/index.html b/pydis_site/templates/home/index.html index cc99763b..c69f7bcd 100644 --- a/pydis_site/templates/home/index.html +++ b/pydis_site/templates/home/index.html @@ -1,42 +1,66 @@ -{% extends 'navbar.html' %} +{% extends 'base/base-hero.html' %} {% load static %} -{% block page_title %}Home{% endblock %} +{% block title %}Home{% endblock %} {% block head %} - {{ block.super }} - + {% endblock %} -{% block body %} - {{ block.super }} -
-

Python Discord

-

- The official Discord server of - r/Python -

- -

- We're a large, friendly community focused around the Python programming language, open to those - who wish to learn the language or improve their skills, as well as those looking to help others. -

- -

- We organise regular community events and have a dedicated staff of talented Python - developers available to assist around the clock. Whether you're looking to learn the - language or working on a complex project, we've got someone who can help you if you get stuck. -

- - - -

- ------------------------------------------------------------------------------------------------------------           O          ------------------------------------------------------------------------------------------------------------- -

- -

- Please note: this site is under construction. What you see now may be vastly different - from the final project state. Feel free to chat to us on Discord if you're curious! -

+ +{% block hero-body %} +
+ Python Discord logo +
+
+

+ The hottest Python community on the web +

{% endblock %} +{% block content %} +
+
+
+
+

+ We're a large, friendly community focused around the Python programming + language, open to those who wish to learn the language or improve their + skills, as well as those looking to help others. + +

+ + We organise regular community events and have a dedicated staff of + talented Python developers available to assist around the clock. + +

+ + Whether you're looking to learn the language or working on a complex project, + we've got someone who can help you if you get stuck. +

+
+
+

Join the community

+ + {# TODO: Fix URL #} + + Discord banner + +
+
+
+
+ +
+
+
+

+ Sponsors +

+ + + +
+
+
+{% endblock %} diff --git a/pydis_site/templates/navbar.html b/pydis_site/templates/navbar.html deleted file mode 100644 index 0efa51c2..00000000 --- a/pydis_site/templates/navbar.html +++ /dev/null @@ -1,16 +0,0 @@ -{% extends 'base.html' %} -{% load static %} - -{% block head %} - -{% endblock %} -{% block body %} - - {{ block.super }} -{% endblock %} - - -- cgit v1.2.3 From c72b83fa4ded6a99e7b66037fbbfee4214aa1df8 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Wed, 10 Apr 2019 13:21:35 +0100 Subject: Fix footer text colour --- pydis_site/templates/base/base-hero.html | 2 +- pydis_site/templates/base/base.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/base/base-hero.html b/pydis_site/templates/base/base-hero.html index 40de6deb..652662e0 100644 --- a/pydis_site/templates/base/base-hero.html +++ b/pydis_site/templates/base/base-hero.html @@ -39,7 +39,7 @@ {% block content %}{% endblock %} -
+

© 2019 Python Discord | Built with Django and Bulma diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index a9edac49..46a273ec 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -27,7 +27,7 @@ {% include "base/navbar.html" with active_item=True dropdowns=True icon_weight="fal" use_logo=True %} {% block content %}{% endblock %} -

+

© 2019 Python Discord | Built with Django and Bulma -- cgit v1.2.3 From 9091c85d6fe0dbf52bc9829dd661b748b9547e45 Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Wed, 10 Apr 2019 14:34:24 +0100 Subject: Navbar: No need for example content --- pydis_site/templates/base/navbar.html | 60 ++++------------------------------- 1 file changed, 6 insertions(+), 54 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index 88a13aeb..dd4559b0 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -14,6 +14,10 @@ It requires two arguments to be set in the include: For example, to use light icons and no dropdowns, you could use the following in your template: {% include "base/navbar.html" with icon_weight="fal" dropdowns=False %} + +This template is based on the navbar template found here: + https://github.com/gdude2002/gserv.me/blob/20f491836342925dc67b08e1bd0ea2ed29610da8/base/templates/base/navbar.html + {% endcomment %}

-- cgit v1.2.3 From e85d32920b64ce92ec2fe02d955157285b3504ee Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Wed, 10 Apr 2019 14:44:46 +0100 Subject: Single base template, no content in it --- pydis_site/templates/base/base-hero.html | 50 -------------------------------- pydis_site/templates/base/base.html | 14 +++------ pydis_site/templates/base/footer.html | 9 ++++++ pydis_site/templates/home/index.html | 29 +++++++++++------- 4 files changed, 31 insertions(+), 71 deletions(-) delete mode 100644 pydis_site/templates/base/base-hero.html create mode 100644 pydis_site/templates/base/footer.html (limited to 'pydis_site') diff --git a/pydis_site/templates/base/base-hero.html b/pydis_site/templates/base/base-hero.html deleted file mode 100644 index 652662e0..00000000 --- a/pydis_site/templates/base/base-hero.html +++ /dev/null @@ -1,50 +0,0 @@ -{% load django_simple_bulma %} -{% load static %} - - - - - - - - - Python Discord | {% block title %}Website{% endblock %} - - {% bulma %} - - {# Font-awesome here is defined explicitly so that we can have Pro #} - - - {% block head %}{% endblock %} - - - -
-
- {% block hero-head %}{% endblock %} -
-
- {% block hero-body %}{% endblock %} -
-
- {% block hero-foot %}{% endblock %} - {% include "base/navbar.html" with active_item=False dropdowns=True icon_weight="fas" use_logo=False %} -
-
- -{% block content %}{% endblock %} - -
-
-

- © 2019 Python Discord | Built with Django and Bulma -

-
-
- - diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index 46a273ec..e1cd0be2 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -24,16 +24,10 @@ {% block head %}{% endblock %} -{% include "base/navbar.html" with active_item=True dropdowns=True icon_weight="fal" use_logo=True %} -{% block content %}{% endblock %} - -
-
-

- © 2019 Python Discord | Built with Django and Bulma -

-
-
+ +{% block content %} + {{ block.super }} +{% endblock %} diff --git a/pydis_site/templates/base/footer.html b/pydis_site/templates/base/footer.html new file mode 100644 index 00000000..b14bd82c --- /dev/null +++ b/pydis_site/templates/base/footer.html @@ -0,0 +1,9 @@ +
+
+

+ © 2019 Python Discord | Built with Django and Bulma +

+
+
+ + diff --git a/pydis_site/templates/home/index.html b/pydis_site/templates/home/index.html index c69f7bcd..61b4b03e 100644 --- a/pydis_site/templates/home/index.html +++ b/pydis_site/templates/home/index.html @@ -1,4 +1,4 @@ -{% extends 'base/base-hero.html' %} +{% extends 'base/base.html' %} {% load static %} {% block title %}Home{% endblock %} @@ -6,17 +6,22 @@ {% endblock %} -{% block hero-body %} -
- Python Discord logo -
-
-

- The hottest Python community on the web -

-
-{% endblock %} {% block content %} +
+
+
+ Python Discord logo +
+
+

+ The hottest Python community on the web +

+
+
+
+ {% include "base/navbar.html" with active_item=False dropdowns=True icon_weight="fas" use_logo=False %} +
+
@@ -61,6 +66,8 @@
+ + {% include "base/footer.html" %} {% endblock %} -- cgit v1.2.3 From 5192dc2d1b2a1e246490f1d112865546369be2aa Mon Sep 17 00:00:00 2001 From: Gareth Coles Date: Wed, 10 Apr 2019 15:09:07 +0100 Subject: No more vim modelines --- pydis_site/templates/base/base.html | 2 -- pydis_site/templates/base/footer.html | 2 -- pydis_site/templates/base/navbar.html | 2 -- pydis_site/templates/home/index.html | 2 -- 4 files changed, 8 deletions(-) (limited to 'pydis_site') diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index e1cd0be2..5b124ded 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -31,5 +31,3 @@ - - diff --git a/pydis_site/templates/base/footer.html b/pydis_site/templates/base/footer.html index b14bd82c..ff868160 100644 --- a/pydis_site/templates/base/footer.html +++ b/pydis_site/templates/base/footer.html @@ -5,5 +5,3 @@

- - diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index dd4559b0..73e3917a 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -58,5 +58,3 @@ This template is based on the navbar template found here: - - diff --git a/pydis_site/templates/home/index.html b/pydis_site/templates/home/index.html index 61b4b03e..3d5f386e 100644 --- a/pydis_site/templates/home/index.html +++ b/pydis_site/templates/home/index.html @@ -69,5 +69,3 @@ {% include "base/footer.html" %} {% endblock %} - - -- cgit v1.2.3