diff options
author | 2019-04-10 23:17:08 +0100 | |
---|---|---|
committer | 2019-04-10 23:17:08 +0100 | |
commit | a880a3441100b387e1171c79cbeff36d3aa8d445 (patch) | |
tree | 7718666427599435219cbbf0aa49ab881c7ab9fb /pydis_site | |
parent | Merge branch 'django' into django+200/wiki (diff) |
Some initial work on updating the wiki templates for Bulma
Diffstat (limited to 'pydis_site')
-rw-r--r-- | pydis_site/settings.py | 1 | ||||
-rw-r--r-- | pydis_site/templates/wiki/base.html | 31 | ||||
-rw-r--r-- | pydis_site/templates/wiki/base_site.html | 14 | ||||
-rw-r--r-- | pydis_site/templates/wiki/create_root.html | 18 | ||||
-rw-r--r-- | pydis_site/templates/wiki/root_missing.html | 64 |
5 files changed, 76 insertions, 52 deletions
diff --git a/pydis_site/settings.py b/pydis_site/settings.py index e55b3132..6c9af3aa 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -272,6 +272,7 @@ BULMA_SETTINGS = { } # Required for the wiki +LOGIN_URL = "/admin/login" # TODO: Update this when the real login system is in place SITE_ID = 1 WIKI_ACCOUNT_HANDLING = False diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html index 5260bfcd..95b0186d 100644 --- a/pydis_site/templates/wiki/base.html +++ b/pydis_site/templates/wiki/base.html @@ -1,3 +1,30 @@ -{% extends "wiki/base_site.html" %} +{% extends "base/base.html" %} +{% load sekizai_tags i18n wiki_tags static %} -{# Intentionally empty, to allow easy customization with no copy-paste #} +{% block title %} + Wiki | {% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %}{% endblock %} +{% endblock %} + +{% block content %} + {% include "base/navbar.html" with active_item=True dropdowns=True icon_weight="far" use_logo=True %} + + {% block wiki_body %} + {% block wiki_navbar %} + + {% endblock %} + + <section class="section"> + <div class="container"> + {% wiki_messages %} + + {% block wiki_breadcrumbs %}{% endblock %} + + <div class="content"> + {% block wiki_contents %}{% endblock %} + </div> + </div> + </section> + {% endblock %} + + {% include "base/footer.html" %} +{% endblock %} diff --git a/pydis_site/templates/wiki/base_site.html b/pydis_site/templates/wiki/base_site.html index d025e53c..afa2b41d 100644 --- a/pydis_site/templates/wiki/base_site.html +++ b/pydis_site/templates/wiki/base_site.html @@ -1,8 +1,16 @@ -{% load sekizai_tags i18n wiki_tags static %}<!DOCTYPE html> +{% extends "base/base.html" %} +{% load sekizai_tags i18n wiki_tags static %} + +{# This template is no longer used - we can remove it later when the rest are done #} + +{% block title %} + {% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %} - django-\/\/ i K |{% endblock %} +{% endblock %} + <html lang="en"> <head> <meta charset="utf-8"> - <title>{% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %} - django-\/\/ i K |{% endblock %}</title> + <title>Wiki | {% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %}{% endblock %}</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" content=""> @@ -149,8 +157,6 @@ </footer> </div> - </div> <!-- /container --> - {% endblock %} <script src="{% static "wiki/js/jquery-3.3.1.min.js" %}"></script> diff --git a/pydis_site/templates/wiki/create_root.html b/pydis_site/templates/wiki/create_root.html index 73a14ae0..52f5ffb6 100644 --- a/pydis_site/templates/wiki/create_root.html +++ b/pydis_site/templates/wiki/create_root.html @@ -4,23 +4,9 @@ {% block wiki_pagetitle %}{% trans "Create root article" %}{% endblock %} {% block wiki_contents %} + <h1 class="title">{% trans "Congratulations!" %}</h1> - {% addtoblock "js" %} - {% for js in editor.Media.js %} - <script type="text/javascript" src="{% static js %}"></script> - {% endfor %} - {% endaddtoblock %} - - {% addtoblock "css" %} - {% for media, srcs in editor.Media.css.items %} - {% for src in srcs %} - <link rel="stylesheet" media="{{ media }}" href="{% static src %}" /> - {% endfor %} - {% endfor %} - {% endaddtoblock %} - - <h1>{% trans "Congratulations!" %}</h1> - <p class="lead"> + <p> {% trans "You have django-wiki installed... but there are no articles. So it's time to create the first one, the root article." %} {% trans "In the beginning, it will only be editable by administrators, but you can define permissions after." %} </p> diff --git a/pydis_site/templates/wiki/root_missing.html b/pydis_site/templates/wiki/root_missing.html index 0fb610ad..01efa4cb 100644 --- a/pydis_site/templates/wiki/root_missing.html +++ b/pydis_site/templates/wiki/root_missing.html @@ -2,36 +2,40 @@ {% load i18n wiki_tags %} {% block wiki_contents %} - -<div class="row"> - <div class="col-lg-2"></div> - <div class="col-lg-8"> - - <h1>{% trans "Congratulations!" %}</h1> - <p class="lead"> - {% trans "You have django-wiki installed and it seems to be working. But there are no articles yet." %} - </p> - - {% if not user.is_superuser %} - <p class="lead"> - {% trans "Not to worry! You simply have to login with a superuser account and create the first article in the root of the URL hierarchy." %} - </p> - {% login_url as wiki_login_url %} - {% if wiki_login_url %} - <a href="{{ wiki_login_url }}" class="btn btn-primary btn-lg">{% trans "Click here to login" %}</a> - {% endif %} - - {% else %} - - <p class="lead"> - {% trans "But since you're logged in as a superuser, we should really get started..." %} - </p> - <a href="{% url 'wiki:root_create' %}" class="btn btn-primary btn-lg">{% trans "Yes, I'll go and create the first article" %}</a> - <a href="http://django-wiki.readthedocs.org/" class="btn btn-default">{% trans "No thanks, I'd rather read the documentation" %}</a> - - {% endif %} + <div class="columns"> + <div class="column is-two-thirds is-offset-2"> + <article class="message is-primary"> + <div class="message-header"> + <p>Congratulations!</p> + </div> + <div class="message-body"> + <p> + {% trans "You have django-wiki installed and it seems to be working. But there are no articles yet." %} + </p> + + {% if not user.is_superuser %} + <p> + {% trans "Not to worry! You simply have to login with a superuser account and create the first article in the root of the URL hierarchy." %} + </p> + + {% login_url as wiki_login_url %} + + {% if wiki_login_url %} + <div class="has-text-centered"> + <a href="{{ wiki_login_url }}" class="button is-primary">{% trans "Click here to login" %}</a> + </div> + {% endif %} + {% else %} + <p> + {% trans "But since you're logged in as a superuser, we should really get started..." %} + </p> + + <a class="button is-primary" href="{% url 'wiki:root_create' %}">Create Article</a> + <a class="button is-info" href="http://django-wiki.readthedocs.org/">Documentation</a> + {% endif %} + </div> + </article> + </div> </div> - <div class="col-lg-2"></div> -</div> {% endblock %} |