diff options
Diffstat (limited to 'pydis_site/templates/base')
-rw-r--r-- | pydis_site/templates/base/base.html | 2 | ||||
-rw-r--r-- | pydis_site/templates/base/navbar.html | 45 |
2 files changed, 42 insertions, 5 deletions
diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index a9b31c0f..70426dc1 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -28,6 +28,7 @@ {# Font-awesome here is defined explicitly so that we can have Pro #} <script src="https://kit.fontawesome.com/ae6a3152d8.js"></script> + <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" %}"> @@ -36,6 +37,7 @@ {% render_block "css" %} </head> <body class="site"> + <!-- Git hash for this release: {{ git_sha }} --> <main class="site-content"> {% if messages %} diff --git a/pydis_site/templates/base/navbar.html b/pydis_site/templates/base/navbar.html index 8cdac0de..c2915025 100644 --- a/pydis_site/templates/base/navbar.html +++ b/pydis_site/templates/base/navbar.html @@ -63,9 +63,9 @@ </a> <div class="navbar-dropdown"> <a class="navbar-item" href="{% url 'wiki:get' path="resources/" %}"> - Learning Resources + Resources </a> - <a class="navbar-item" href="{% url 'wiki:get' path="tools/" %}"> + <a class="navbar-item" href="{% url 'wiki:get' path="resources/tools/" %}"> Tools </a> <a class="navbar-item" href="{% url 'wiki:get' path="contributing/" %}"> @@ -84,8 +84,14 @@ Privacy </a> <hr class="navbar-divider"> - <a class="navbar-item" href="{% url 'wiki:get' path="code-jams/" %}"> - Code Jams + <div class="navbar-item"> + <strong>Events</strong> + </div> + <a class="navbar-item" href="{% url 'wiki:get' path="code-jams/code-jam-7/" %}"> + Most Recent: Code Jam 7 + </a> + <a class="navbar-item" href="{% url 'wiki:get' path="events/" %}"> + All events </a> <hr class="navbar-divider"> @@ -102,7 +108,15 @@ {% 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> + + <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 %} @@ -116,3 +130,24 @@ </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 %} |