diff options
author | 2020-10-30 17:43:13 +0200 | |
---|---|---|
committer | 2020-10-30 17:43:13 +0200 | |
commit | 3fa3854eb192466ca59acb577bfe135b53c2da11 (patch) | |
tree | af5aa98d8d521f21f25c45528c89941ac23e77aa /pydis_site/templates | |
parent | Cover fetching article GitHub information with tests (diff) | |
parent | Merge pull request #395 from ks129/resources-home (diff) |
Merge remote-tracking branch 'up/dewikification' into guides-app
Diffstat (limited to 'pydis_site/templates')
-rw-r--r-- | pydis_site/templates/base/base.html | 13 | ||||
-rw-r--r-- | pydis_site/templates/base/navbar.html | 49 | ||||
-rw-r--r-- | pydis_site/templates/home/account/delete.html | 47 | ||||
-rw-r--r-- | pydis_site/templates/home/account/settings.html | 136 | ||||
-rw-r--r-- | pydis_site/templates/resources/resources.html | 90 |
5 files changed, 90 insertions, 245 deletions
diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index 905d408c..6fc0c6bb 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -30,7 +30,6 @@ <script src="{% static "js/base/modal.js" %}"></script> <link rel="stylesheet" href="{% static "css/base/base.css" %}"> - <link rel="stylesheet" href="{% static "css/base/notification.css" %}"> {% block head %}{% endblock %} </head> @@ -38,18 +37,6 @@ <!-- Git hash for this release: {{ git_sha }} --> <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 dd68949b..6c8d52a1 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -1,4 +1,3 @@ -{% load socialaccount %} {% load static %} <nav class="navbar is-primary" role="navigation" aria-label="main navigation"> @@ -93,33 +92,6 @@ <a class="navbar-item" href="#"> All events </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 %} - - <div class="field navbar-item is-paddingless is-fullwidth is-grouped"> - <button type="submit" class="button is-white is-inline is-fullwidth has-text-left is-size-navbar-menu has-text-grey-dark">Logout</button> - <a title="Settings" class="button is-white is-inline has-text-right is-size-navbar-menu has-text-grey-dark modal-button" data-target="account-modal"> - <span class="is-icon"> - <i class="fas fa-cog"></i> - </span> - </a> - </div> - </form> - {% endif %} - </div> </div> </div> @@ -130,24 +102,3 @@ </a> </div> </nav> - -{% if user.is_authenticated %} - <script defer type="text/javascript"> - // Script which loads and sets up the account settings modal. - // This script must be placed in a template, or rewritten to take the fetch - // URL as a function argument, in order to be used. - - "use strict"; - - // Create and prepend a new div for this modal - let element = document.createElement("div"); - document.body.prepend(element); - - fetch("{% url "account_settings" %}") // Fetch the URL - .then((response) => response.text()) // Read in the data stream as text - .then((text) => { - element.outerHTML = text; // Replace the div's HTML with the loaded modal HTML - setupModal(document.getElementById("account-modal")); // Set up the modal - }); - </script> -{% endif %} diff --git a/pydis_site/templates/home/account/delete.html b/pydis_site/templates/home/account/delete.html deleted file mode 100644 index 0d44e32a..00000000 --- a/pydis_site/templates/home/account/delete.html +++ /dev/null @@ -1,47 +0,0 @@ -{% extends 'base/base.html' %} -{% load static %} - -{% block title %}Delete Account{% endblock %} - -{% block content %} - {% include "base/navbar.html" %} - - <section class="section content"> - <div class="container"> - <h2 class="is-size-2 has-text-centered">Account Deletion</h2> - - <div class="columns is-centered"> - <div class="column is-half-desktop is-full-tablet is-full-mobile"> - - <article class="message is-danger"> - <div class="message-body"> - <p> - You have requested to delete the account with username - <strong><span class="has-text-dark is-family-monospace">{{ user.username }}</span></strong>. - </p> - - <p> - Please note that this <strong>cannot be undone</strong>. - </p> - - <p> - To verify that you'd like to remove your account, please type your username into the box below. - </p> - </div> - </article> - </div> - </div> - - <div class="columns is-centered"> - <div class="column is-half-desktop is-full-tablet is-full-mobile"> - <form method="post"> - {% csrf_token %} - <label for="id_username" class="label requiredField">Username</label> - <input id="id_username" class="input" type="text" required name="username"> - <input style="margin-top: 1em;" type="submit" value="I understand, delete my account" class="button is-primary"> - </form> - </div> - </div> - </div> - </section> -{% endblock %} diff --git a/pydis_site/templates/home/account/settings.html b/pydis_site/templates/home/account/settings.html deleted file mode 100644 index ed59b052..00000000 --- a/pydis_site/templates/home/account/settings.html +++ /dev/null @@ -1,136 +0,0 @@ -{% load socialaccount %} - -{# This template is just for a modal, which is actually inserted into the navbar #} -{# template. Take a look at `navbar.html` to see how it's inserted. #} - -<div class="modal" id="account-modal"> - <div class="modal-background"></div> - <div class="modal-card"> - <div class="modal-card-head"> - <div class="modal-card-title">Settings for {{ user.username }}</div> - - {% if groups %} - <div> - {% for group in groups %} - <span class="tag is-primary">{{ group.name }}</span> - {% endfor %} - </div> - {% else %} - <span class="tag is-dark">No groups</span> - {% endif %} - </div> - <div class="modal-card-body"> - <h3 class="title">Connections</h3> - <div class="columns"> - {% if discord_provider is not None %} - <div class="column"> - <div class="box"> - {% if not discord %} - <div class="media"> - <div class="media-left"> - <div class="image"> - <i class="fab fa-discord fa-3x has-text-primary"></i> - </div> - </div> - <div class="media-content"> - <div class="title is-5">Discord</div> - <div class="subtitle is-6">Not connected</div> - </div> - </div> - <div> - <br /> - <a class="button is-primary" href="{% provider_login_url "discord" process="connect" %}"> - <span class="icon"> - <i class="fad fa-link"></i> - </span> - <span>Connect</span> - </a> - </div> - {% else %} - <div class="media"> - <div class="media-left"> - <div class="image"> - <i class="fab fa-discord fa-3x has-text-primary"></i> - </div> - </div> - <div class="media-content"> - <div class="title is-5">Discord</div> - <div class="subtitle is-6">{{ user.username }}</div> - </div> - </div> - <div> - <br /> - <button class="button" disabled> - <span class="icon"> - <i class="fas fa-check"></i> - </span> - <span>Connected</span> - </button> - </div> - {% endif %} - </div> - </div> - {% endif %} - - {% if github_provider is not None %} - <div class="column"> - <div class="box"> - {% if not github %} - <div class="media"> - <div class="media-left"> - <div class="image"> - <i class="fab fa-github fa-3x"></i> - </div> - </div> - <div class="media-content"> - <div class="title is-5">GitHub</div> - <div class="subtitle is-6">Not connected</div> - </div> - </div> - <div> - <br /> - <a class="button is-primary" href="{% provider_login_url "github" process="connect" %}"> - <span class="icon"> - <i class="fad fa-link"></i> - </span> - <span>Connect</span> - </a> - </div> - {% else %} - <div class="media"> - <div class="media-left"> - <div class="image"> - <i class="fab fa-github fa-3x"></i> - </div> - </div> - <div class="media-content"> - <div class="title is-5">GitHub</div> - <div class="subtitle is-6">{{ github.extra_data.name }}</div> - </div> - </div> - <div> - <form method="post" action="{% url "account_settings" %}" type="submit"> - {% csrf_token %} - - <input type="hidden" name="provider" value="github" /> - - <br /> - <button type="submit" class="button is-danger"> - <span class="icon"> - <i class="fas fa-times"></i> - </span> - <span>Disconnect</span> - </button> - </form> - </div> - {% endif %} - </div> - </div> - {% endif %} - </div> - </div> - <div class="modal-card-foot"> - <a class="button is-danger" href="{% url "account_delete" %}">Delete Account</a> - </div> - </div> -</div> diff --git a/pydis_site/templates/resources/resources.html b/pydis_site/templates/resources/resources.html new file mode 100644 index 00000000..6eb32c97 --- /dev/null +++ b/pydis_site/templates/resources/resources.html @@ -0,0 +1,90 @@ +{% extends 'base/base.html' %} +{% load static %} + +{% block title %}Resources{% endblock %} +{% block head %} + <link rel="stylesheet" href="{% static "css/resources/resources.css" %}"> +{% endblock %} + +{% block content %} + {% include "base/navbar.html" %} + + <section class="section"> + <div class="container"> + <div class="content"> + <h1>Resources</h1> + + <div class="tile is-ancestor"> + <a class="tile is-parent" href="/articles/category/guides"> + <article class="tile is-child box hero is-primary is-bold"> + <p class="title is-size-1"><i class="fad fa-info-circle" aria-hidden="true"></i> Guides</p> + <p class="subtitle is-size-4">Made by us, for you</p> + </article> + </a> + + <div class="tile is-vertical is-9"> + <div class="tile"> + <a class="tile is-8 is-parent" href="/resources/reading/"> + <article class="tile is-child box hero is-black" id="readingBlock"> + <p class="title is-size-1"><i class="fad fa-book-alt" aria-hidden="true"></i> Read</p> + <p class="subtitle is-size-4">Lovingly curated books to explore</p> + </article> + </a> + + <div class="tile"> + <a class="tile is-parent" href="/resources/videos/"> + <article class="tile is-child box hero is-danger is-bold"> + <p class="title is-size-1"><i class="fad fa-video" aria-hidden="true"></i> Watch</p> + <p class="subtitle is-size-4">Visually engaging</p> + </article> + </a> + </div> + </div> + + <div class="tile"> + <a class="tile is-parent" href="/resources/interactive/"> + <article class="tile is-child box hero is-black" id="interactiveBlock"> + <p class="title is-size-1"><i class="fad fa-code" aria-hidden="true"></i> Try</p> + <p class="subtitle is-size-4">Interactively discover the possibilities</p> + </article> + </a> + <a class="tile is-8 is-parent" href="/resources/courses/"> + <article class="tile is-child box hero is-success is-bold"> + <p class="title is-size-1"><i class="fad fa-graduation-cap" aria-hidden="true"></i> Learn</p> + <p class="subtitle is-size-4">Structured courses with clear goals</p> + </article> + </a> + </div> + </div> + </div> + + <div class="tile is-ancestor"> + <div class="tile is-vertical is-9"> + <div class="tile"> + <a class="tile is-8 is-parent" href="/resources/communities/"> + <article class="tile is-child box hero is-black" id="communitiesBlock"> + <p class="title is-size-1"><i class="fad fa-users" aria-hidden="true"></i> Communities</p> + <p class="subtitle is-size-4">Some of our best friends</p> + </article> + </a> + <div class="tile"> + <a class="tile is-parent" href="/resources/podcasts/"> + <article class="tile is-child box hero is-black" id="podcastsBlock"> + <p class="title is-size-1"><i class="fad fa-podcast" aria-hidden="true"></i> Listen</p> + <p class="subtitle is-size-4">Regular podcasts to follow</p> + </article> + </a> + </div> + </div> + </div> + <a class="tile is-parent" href="/resources/tools/"> + <article class="tile is-child box hero is-dark"> + <p class="title is-size-1"><i class="fad fa-tools" aria-hidden="true"></i> Tools</p> + <p class="subtitle is-size-4">Things we love to use</p> + </article> + </a> + </div> + </div> + </div> + </section> +{% endblock %} |