aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/templates
diff options
context:
space:
mode:
Diffstat (limited to 'pydis_site/templates')
-rw-r--r--pydis_site/templates/base/base.html24
-rw-r--r--pydis_site/templates/base/navbar.html23
-rw-r--r--pydis_site/templates/home/index.html49
-rw-r--r--pydis_site/templates/wiki/base.html3
-rw-r--r--pydis_site/templates/wiki/includes/breadcrumbs.html112
-rw-r--r--pydis_site/templates/wiki/includes/messages.html11
6 files changed, 136 insertions, 86 deletions
diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html
index a419521c..a9b31c0f 100644
--- a/pydis_site/templates/base/base.html
+++ b/pydis_site/templates/base/base.html
@@ -11,6 +11,17 @@
<meta name="description"
content="{% block meta-description %}We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.{% endblock %}">
+ {# Generated with https://realfavicongenerator.net/ #}
+ <link rel="apple-touch-icon" sizes="180x180" href="/static/favicons/apple-touch-icon.png?v=9B9vkE5q7O">
+ <link rel="icon" type="image/png" sizes="32x32" href="/static/favicons/favicon-32x32.png?v=9B9vkE5q7O">
+ <link rel="icon" type="image/png" sizes="16x16" href="/static/favicons/favicon-16x16.png?v=9B9vkE5q7O">
+ <link rel="manifest" href="/static/favicons/site.webmanifest?v=9B9vkE5q7O">
+ <link rel="mask-icon" href="/static/favicons/safari-pinned-tab.svg?v=9B9vkE5q7O" color="#7289da">
+ <link rel="shortcut icon" href="/static/favicons/favicon.ico?v=9B9vkE5q7O">
+ <meta name="msapplication-TileColor" content="#7289da">
+ <meta name="msapplication-config" content="/static/favicons/browserconfig.xml?v=9B9vkE5q7O">
+ <meta name="theme-color" content="#7289da">
+
<title>Python Discord | {% block title %}Website{% endblock %}</title>
{% bulma %}
@@ -19,6 +30,7 @@
<script src="https://kit.fontawesome.com/ae6a3152d8.js"></script>
<link rel="stylesheet" href="{% static "css/base/base.css" %}">
+ <link rel="stylesheet" href="{% static "css/base/notification.css" %}">
{% block head %}{% endblock %}
{% render_block "css" %}
@@ -26,6 +38,18 @@
<body class="site">
<main class="site-content">
+ {% if messages %}
+ <div class="messages">
+ {% for message in messages %}
+ <div class="notification {% if message.tags %}is-{{ message.tags }}{% endif %}">
+ <button class="delete"></button>
+
+ {{ message }}
+ </div>
+ {% endfor %}
+ </div>
+ {% endif %}
+
{% block content %}
{{ block.super }}
{% endblock %}
diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html
index ee68852a..8cdac0de 100644
--- a/pydis_site/templates/base/navbar.html
+++ b/pydis_site/templates/base/navbar.html
@@ -1,3 +1,4 @@
+{% load socialaccount %}
{% load static %}
<nav class="navbar is-primary" role="navigation" aria-label="main navigation">
@@ -76,6 +77,9 @@
<a class="navbar-item" href="{% url 'wiki:get' path="rules/" %}">
Rules
</a>
+ <a class="navbar-item" href="{% url 'wiki:get' path="code-of-conduct/" %}">
+ Code of Conduct
+ </a>
<a class="navbar-item" href="{% url 'wiki:get' path="privacy/" %}">
Privacy
</a>
@@ -83,6 +87,25 @@
<a class="navbar-item" href="{% url 'wiki:get' path="code-jams/" %}">
Code Jams
</a>
+ <hr class="navbar-divider">
+
+ {% if not user.is_authenticated %}
+ {% get_providers as socialaccount_providers %}
+
+ {% for provider in socialaccount_providers %}
+ {% if provider.id == "discord" %}
+ <a class="navbar-item"
+ href="{% provider_login_url provider.id process="login" scope=scope auth_params=auth_params %}"
+ >Login with {{ provider.name }}</a>
+ {% endif %}
+ {% endfor %}
+ {% else %}
+ <form method="post" action="{% url 'logout' %}">
+ {% csrf_token %}
+ <button type="submit" class="navbar-item button is-white is-inline is-fullwidth has-text-left is-size-navbar-menu has-text-grey-dark">Logout</button>
+ </form>
+ {% endif %}
+
</div>
</div>
</div>
diff --git a/pydis_site/templates/home/index.html b/pydis_site/templates/home/index.html
index 205e92ff..0fa2f67c 100644
--- a/pydis_site/templates/home/index.html
+++ b/pydis_site/templates/home/index.html
@@ -15,32 +15,30 @@
<div class="container is-spaced">
<h1 class="is-size-1">Who are we?</h1>
<br>
- <div class="columns">
- <div class="column is-half">
+ <div class="columns is-desktop">
+ <div class="column is-half-desktop">
<p>
We're a large community focused around the Python programming language.
- We believe anyone can learn programming, and are very dedicated to helping
- novice developers take their first steps into the world of code. We also
+ We believe anyone can learn to code, and are very dedicated to helping
+ novice developers take their first steps into the world of programming. We also
attract a lot of expert developers who are seeking friendships, collaborators,
- or looking to hone their craft by teaching and getting involved in the community.
-
- <br/><br/>
-
- We organise regular community events like code jams, open source hackathons,
- seasonal events and community challenges. Through our sponsorships and with
- help from donations, we are even able to award prizes to the winners of our events.
-
- <br/><br/>
-
+ and who wish to hone their craft by teaching and getting involved in the community.
+ </p>
+ <p>
+ We organise regular community events such as code jams, open-source hackathons,
+ seasonal events, and community challenges. Through our sponsorships and donations,
+ many of our events even have prizes to win!
+ </p>
+ <p>
You can find help with most Python-related problems in one of our help channels.
- Our staff of nearly 50 dedicated expert Helpers are available around the clock
+ Our staff of over 50 dedicated expert Helpers are available around the clock
in every timezone. 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.
</p>
</div>
{# Intro video #}
- <div class="column is-half video-container">
+ <div class="column is-half-desktop video-container">
<iframe src="https://www.youtube.com/embed/DIBXg8Qh7bA" frameborder="0"
allow="accelerometer; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>
@@ -50,11 +48,11 @@
{# Projects #}
<h1 class="is-size-1">Projects</h1>
<br>
- <div class="columns is-multiline">
+ <div class="columns is-multiline is-tablet">
{# Display projects from HomeView.repos #}
{% for repo in repo_data %}
- <div class="column is-one-third">
+ <div class="column is-one-third-desktop is-half-tablet">
<div class="card has-equal-height github-card">
<div class="card-content">
<div class="repo-headline">
@@ -84,11 +82,20 @@
<h1 class="title is-6 has-text-grey">
Sponsors
</h1>
- <a href="https://linode.com"><img src="{% static "images/sponsors/linode.png" %}" alt="Linode"/></a>
- <a href="https://jetbrains.com"><img src="{% static "images/sponsors/jetbrains.png" %}" alt="JetBrains"/></a>
- <a href="https://adafruit.com"><img src="{% static "images/sponsors/adafruit.png" %}" alt="Adafruit"/></a>
+ <div class="columns is-mobile is-multiline">
+ <a href="https://linode.com" class="column is-narrow">
+ <img src="{% static "images/sponsors/linode.png" %}" alt="Linode"/>
+ </a>
+ <a href="https://jetbrains.com" class="column is-narrow">
+ <img src="{% static "images/sponsors/jetbrains.png" %}" alt="JetBrains"/>
+ </a>
+ <a href="https://adafruit.com" class="column is-narrow">
+ <img src="{% static "images/sponsors/adafruit.png" %}" alt="Adafruit"/>
+ </a>
+ </div>
</div>
</div>
</section>
{% endblock %}
+
diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html
index da4d5de1..9f904324 100644
--- a/pydis_site/templates/wiki/base.html
+++ b/pydis_site/templates/wiki/base.html
@@ -15,6 +15,7 @@
<link rel="stylesheet" href="{% static "css/wiki/simplemde-fixes.css" %}">
<link rel="stylesheet" href="{% static "css/wiki/style.css" %}">
<link rel="stylesheet" href="{% static "css/pygments/darcula.css" %}">
+ <link rel="stylesheet" href="{% static "css/base/notification.css" %}">
{% endblock %}
{% block content %}
@@ -31,8 +32,6 @@
{% block wiki_body %}
<section class="section">
<div class="container">
- {% wiki_messages %}
-
<div class="content">
{% block wiki_contents %}{% endblock %}
</div>
diff --git a/pydis_site/templates/wiki/includes/breadcrumbs.html b/pydis_site/templates/wiki/includes/breadcrumbs.html
index a2359f39..791beb90 100644
--- a/pydis_site/templates/wiki/includes/breadcrumbs.html
+++ b/pydis_site/templates/wiki/includes/breadcrumbs.html
@@ -1,12 +1,18 @@
-{% if urlpath and article and not user.is_anonymous %}
+{% load wiki_tags %}
+
+{% if urlpath and article %}
<section class="breadcrumb-section section">
<div class="container">
<nav class="breadcrumb is-pulled-left" aria-label="breadcrumbs">
<ul>
{% for ancestor in urlpath.cached_ancestors %}
- <li>
- <a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title|truncatechars:25 }}</a>
- </li>
+ {% if forloop.first and not article|can_write:user %}
+ {# Continue, we don't want to show the root element #}
+ {% else %}
+ <li>
+ <a href="{% url 'wiki:get' path=ancestor.path %}">{{ ancestor.article.current_revision.title|truncatechars:25 }}</a>
+ </li>
+ {% endif %}
{% endfor %}
<li class="is-active">
@@ -15,71 +21,73 @@
</ul>
</nav>
- <div class="dropdown is-pulled-right is-right">
- <div class="dropdown-trigger">
- <a aria-haspopup="true" aria-controls="sub-article-dropdown">
- <span>Sub-Articles</span>
- <span class="icon">
- <i class="fas fa-angle-down"></i>
- </span>
- </a>
- </div>
- <div class="dropdown-menu" id="sub-article-dropdown" role="menu">
- <div class="dropdown-content">
- {% if children_slice %}
- {% for child in children_slice %}
- <a class="dropdown-item" href="{% url 'wiki:get' path=child.path %}">
- {{ child.article.current_revision.title }}
- </a>
- {% endfor %}
-
- {% if children_slice_more %}
- <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}">
- ...and more.
- </a>
- {% endif %}
-
- <hr class="dropdown-divider">
- {% endif %}
-
- <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}">
- Browse other articles
- </a>
- </div>
- </div>
- </div>
-
- {% if request.user.is_authenticated %}
+ {% if article|can_write:user %}
<div class="dropdown is-pulled-right is-right">
<div class="dropdown-trigger">
<a aria-haspopup="true" aria-controls="sub-article-dropdown">
- <span>Create Article</span>
+ <span>Sub-Articles</span>
<span class="icon">
<i class="fas fa-angle-down"></i>
</span>
- &nbsp;
</a>
</div>
<div class="dropdown-menu" id="sub-article-dropdown" role="menu">
<div class="dropdown-content">
- {% if urlpath.parent %}
- <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.parent.path %}">
- <span class="icon">
- <i class="fas fa-arrow-right"></i>
- </span>
- <span>At current level</span>
- </a>
+ {% if children_slice %}
+ {% for child in children_slice %}
+ <a class="dropdown-item" href="{% url 'wiki:get' path=child.path %}">
+ {{ child.article.current_revision.title }}
+ </a>
+ {% endfor %}
+
+ {% if children_slice_more %}
+ <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}">
+ ...and more.
+ </a>
+ {% endif %}
+
+ <hr class="dropdown-divider">
{% endif %}
- <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.path %}">
+ <a class="dropdown-item" href="{% url 'wiki:dir' path=urlpath.path %}">
+ Browse other articles
+ </a>
+ </div>
+ </div>
+ </div>
+
+ {% if request.user.is_authenticated %}
+ <div class="dropdown is-pulled-right is-right">
+ <div class="dropdown-trigger">
+ <a aria-haspopup="true" aria-controls="sub-article-dropdown">
+ <span>Create Article</span>
<span class="icon">
- <i class="fas fa-arrow-down"></i>
+ <i class="fas fa-angle-down"></i>
</span>
- <span>Below current level</span>
+ &nbsp;
</a>
</div>
+ <div class="dropdown-menu" id="sub-article-dropdown" role="menu">
+ <div class="dropdown-content">
+ {% if urlpath.parent %}
+ <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.parent.path %}">
+ <span class="icon">
+ <i class="fas fa-arrow-right"></i>
+ </span>
+ <span>At current level</span>
+ </a>
+ {% endif %}
+
+ <a class="dropdown-item" href="{% url 'wiki:create' path=urlpath.path %}">
+ <span class="icon">
+ <i class="fas fa-arrow-down"></i>
+ </span>
+ <span>Below current level</span>
+ </a>
+ </div>
+ </div>
</div>
- </div>
+ {% endif %}
{% endif %}
</div>
diff --git a/pydis_site/templates/wiki/includes/messages.html b/pydis_site/templates/wiki/includes/messages.html
index cdf58d87..e69de29b 100644
--- a/pydis_site/templates/wiki/includes/messages.html
+++ b/pydis_site/templates/wiki/includes/messages.html
@@ -1,11 +0,0 @@
-{% if messages %}
- <!-- Messages for this instance -->
- {% for message in messages %}
- <article class="message {{ message.css_class }}">
- <div class="message-body">
- {{ message }}
- </div>
- </article>
-
- {% endfor %}
-{% endif %}