From 9b042c3be5e52da3d6231d7fd551b6eede429b3a Mon Sep 17 00:00:00 2001
From: Gareth Coles
Date: Mon, 8 Apr 2019 11:47:36 +0100
Subject: Add django-wiki, and downgrade to Django 2.1
Downgrade required by django-wiki for now
---
Pipfile | 3 +-
Pipfile.lock | 176 ++++++++++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 141 insertions(+), 38 deletions(-)
diff --git a/Pipfile b/Pipfile
index 932746d2..1fd34c35 100644
--- a/Pipfile
+++ b/Pipfile
@@ -16,7 +16,7 @@ coverage = "~=4.5.3"
unittest-xml-reporting = "~=2.5.1"
[packages]
-django = "~=2.2"
+django = "~=2.1"
django-crispy-forms = "~=1.7.2"
django-environ = "~=0.4.5"
django-filter = "~=2.1.0"
@@ -27,6 +27,7 @@ uwsgi = "~=2.0.18"
psycopg2-binary = "~=2.8"
django-simple-bulma = ">=1.1.6,<2.0"
django-crispy-bulma = ">=0.1.2,<2.0"
+wiki = "~=0.4.4"
[requires]
python_version = "3.7"
diff --git a/Pipfile.lock b/Pipfile.lock
index c574a6f1..a908b8c7 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "e7a956892e9d18b6ac8ab13fe8e139d29196e236fbb194f4cb8b37308ea91c6e"
+ "sha256": "a63ccdec81594bd69f4af503e5a62fe01a74adfd6daaaa0fb9be08b25631cb84"
},
"pipfile-spec": 6,
"requires": {
@@ -16,13 +16,27 @@
]
},
"default": {
+ "bleach": {
+ "hashes": [
+ "sha256:0ee95f6167129859c5dce9b1ca291ebdb5d8cd7e382ca0e237dfd0dad63f63d8",
+ "sha256:24754b9a7d530bf30ce7cbc805bc6cce785660b4a10ff3a43633728438c105ab"
+ ],
+ "version": "==2.1.4"
+ },
"django": {
"hashes": [
- "sha256:7c3543e4fb070d14e10926189a7fcf42ba919263b7473dceaefce34d54e8a119",
- "sha256:a2814bffd1f007805b19194eb0b9a331933b82bd5da1c3ba3d7b7ba16e06dc4b"
+ "sha256:0fd54e4f27bc3e0b7054a11e6b3a18fa53f2373f6b2df8a22e8eadfe018970a5",
+ "sha256:f3b28084101d516f56104856761bc247f85a2a5bbd9da39d9f6197ff461b3ee4"
],
"index": "pypi",
- "version": "==2.2"
+ "version": "==2.1.8"
+ },
+ "django-classy-tags": {
+ "hashes": [
+ "sha256:792f9161d0e22d55b4fab6fc297bab8ab072ffaa3075b227613a6d8473624db8",
+ "sha256:f6d12f5a4df3e387795a0d9ef2836af389cae9a1fbebda035dac043d4722b1f7"
+ ],
+ "version": "==0.8.0"
},
"django-crispy-bulma": {
"hashes": [
@@ -64,6 +78,34 @@
"index": "pypi",
"version": "==3.0"
},
+ "django-js-asset": {
+ "hashes": [
+ "sha256:8ec12017f26eec524cab436c64ae73033368a372970af4cf42d9354fcb166bdd",
+ "sha256:c163ae80d2e0b22d8fb598047cd0dcef31f81830e127cfecae278ad574167260"
+ ],
+ "version": "==1.2.2"
+ },
+ "django-mptt": {
+ "hashes": [
+ "sha256:18a41d1b56ca7c02a5b04d246e33ee2d18f6ee5459c02ed1d945f5abdef23a2e",
+ "sha256:689a04cce0981671d6061a9928c33a16b47abb0d4cd43cf7dec31ae284fdae9d"
+ ],
+ "version": "==0.9.1"
+ },
+ "django-nyt": {
+ "hashes": [
+ "sha256:02c828e483606addbaeea8c08d4c7301be6fdba5e00f03b7a984b4cbae353e21",
+ "sha256:bf65e3d7e138b3c00879b6a7420c1f4f897e6bd6a9d2f09d7cd7ac5f623d8448"
+ ],
+ "version": "==1.1.2"
+ },
+ "django-sekizai": {
+ "hashes": [
+ "sha256:39c5d16ad694aa78278ca84fdc7b9f953ebcf94e2fc95b68c875d02014303260",
+ "sha256:cbd48e7be29e8cc4108476b9420d7c391fc509a504bc20b60616b116ba6ea51e"
+ ],
+ "version": "==0.10.0"
+ },
"django-simple-bulma": {
"hashes": [
"sha256:420042e26dd4bc70b148fc721bd77a48130b62b3d91b977e56f8232a4cfac555",
@@ -87,6 +129,13 @@
"index": "pypi",
"version": "==0.2.1"
},
+ "html5lib": {
+ "hashes": [
+ "sha256:20b159aa3badc9d5ee8f5c647e5efd02ed2a66ab8d354930bd9ff139fc1dc0a3",
+ "sha256:66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736"
+ ],
+ "version": "==1.0.1"
+ },
"libsass": {
"hashes": [
"sha256:2ae3b061a7d250fb47e5fdad1a8191600ca15dc604e76b109b6d3bf8e08fd2ed",
@@ -108,39 +157,77 @@
],
"version": "==0.18.0"
},
+ "markdown": {
+ "hashes": [
+ "sha256:9ba587db9daee7ec761cfc656272be6aabe2ed300fece21208e4aab2e457bc8f",
+ "sha256:a856869c7ff079ad84a3e19cd87a64998350c2b94e9e08e44270faef33400f81"
+ ],
+ "version": "==2.6.11"
+ },
+ "pillow": {
+ "hashes": [
+ "sha256:15c056bfa284c30a7f265a41ac4cbbc93bdbfc0dfe0613b9cb8a8581b51a9e55",
+ "sha256:1a4e06ba4f74494ea0c58c24de2bb752818e9d504474ec95b0aa94f6b0a7e479",
+ "sha256:1c3c707c76be43c9e99cb7e3d5f1bee1c8e5be8b8a2a5eeee665efbf8ddde91a",
+ "sha256:1fd0b290203e3b0882d9605d807b03c0f47e3440f97824586c173eca0aadd99d",
+ "sha256:24114e4a6e1870c5a24b1da8f60d0ba77a0b4027907860188ea82bd3508c80eb",
+ "sha256:258d886a49b6b058cd7abb0ab4b2b85ce78669a857398e83e8b8e28b317b5abb",
+ "sha256:33c79b6dd6bc7f65079ab9ca5bebffb5f5d1141c689c9c6a7855776d1b09b7e8",
+ "sha256:367385fc797b2c31564c427430c7a8630db1a00bd040555dfc1d5c52e39fcd72",
+ "sha256:3c1884ff078fb8bf5f63d7d86921838b82ed4a7d0c027add773c2f38b3168754",
+ "sha256:44e5240e8f4f8861d748f2a58b3f04daadab5e22bfec896bf5434745f788f33f",
+ "sha256:46aa988e15f3ea72dddd81afe3839437b755fffddb5e173886f11460be909dce",
+ "sha256:74d90d499c9c736d52dd6d9b7221af5665b9c04f1767e35f5dd8694324bd4601",
+ "sha256:809c0a2ce9032cbcd7b5313f71af4bdc5c8c771cb86eb7559afd954cab82ebb5",
+ "sha256:85d1ef2cdafd5507c4221d201aaf62fc9276f8b0f71bd3933363e62a33abc734",
+ "sha256:8c3889c7681af77ecfa4431cd42a2885d093ecb811e81fbe5e203abc07e0995b",
+ "sha256:9218d81b9fca98d2c47d35d688a0cea0c42fd473159dfd5612dcb0483c63e40b",
+ "sha256:9aa4f3827992288edd37c9df345783a69ef58bd20cc02e64b36e44bcd157bbf1",
+ "sha256:9d80f44137a70b6f84c750d11019a3419f409c944526a95219bea0ac31f4dd91",
+ "sha256:b7ebd36128a2fe93991293f997e44be9286503c7530ace6a55b938b20be288d8",
+ "sha256:c4c78e2c71c257c136cdd43869fd3d5e34fc2162dc22e4a5406b0ebe86958239",
+ "sha256:c6a842537f887be1fe115d8abb5daa9bc8cc124e455ff995830cc785624a97af",
+ "sha256:cf0a2e040fdf5a6d95f4c286c6ef1df6b36c218b528c8a9158ec2452a804b9b8",
+ "sha256:cfd28aad6fc61f7a5d4ee556a997dc6e5555d9381d1390c00ecaf984d57e4232",
+ "sha256:dca5660e25932771460d4688ccbb515677caaf8595f3f3240ec16c117deff89a",
+ "sha256:de7aedc85918c2f887886442e50f52c1b93545606317956d65f342bd81cb4fc3",
+ "sha256:e6c0bbf8e277b74196e3140c35f9a1ae3eafd818f7f2d3a15819c49135d6c062"
+ ],
+ "version": "==6.0.0"
+ },
"psycopg2-binary": {
"hashes": [
- "sha256:0c8cb1b93e25eaf1dfedbcb4cee4ce3860035ce216b71590bda5f8dc99128526",
- "sha256:1c2eeb074d2be404f22a14c4c71eeaa1a855c940abedf6f726158348e9c83dd6",
- "sha256:1d879395a5d0dfe191dcfc622dce8b0a5e4fb76d089c903f18a4913e5fbc79c7",
- "sha256:20d47c61bc9d6a431039f6ceb3b9a34a952a1562cf718054f64c524526fb8ed8",
- "sha256:39fc9323f065361b99fca7758ac723d7e66bbc7e6ec9c90e398857af0ef61404",
- "sha256:3c5b7579f3075f19b0b54495d28105049d44564d67b817eef2fa561b2bcf532b",
- "sha256:3f811db92e30ea2412dfba8e64b18102017646969b5f436138d7b2b38a0e8966",
- "sha256:41d60c8610a70b6666641b662379ef3b847ad2acd38303d4c8e34efd0f782403",
- "sha256:45979c708536a3132398863579280657c6bc77e9b9be8b05ba0dae9013b5a0a8",
- "sha256:4aaa54574b52b85223d3d950b2fc77bd672e6fbb324bb99f834eacbedc4545f7",
- "sha256:50647aa5f7171153a5f7fa667f99f55468b9b663b997927e4d2e83955b21aa9f",
- "sha256:528175ab1f12131bb5ea0df64fc524a4c6c51c197dc68d2a9e646029890d4d0f",
- "sha256:5cbb49cc1c3c4c69ba09a7e18452bd44371b6adad0c9636f117a7554660af529",
- "sha256:6e2f69635b548147e9b9298f5b67155d212f742683e51d78d24ceec4a3f5464d",
- "sha256:7994d43431f1b9eba5daa1bdb8f626482cf01e379c00967092c6ebb3e4d3235f",
- "sha256:86ec556a75f7e0124581100f2c4c8f9c8d67fc6254af4ce500633a77a4ca3207",
- "sha256:9c32635fca3c250f5a3d2e424819419cd4a0f277c1a383b20fdd95e799d1da7c",
- "sha256:9e19396065fdbbbc7c0b288a4e70694e1e63593388020fdb86076b12c315bda5",
- "sha256:a9e7606233fa6c559491758cb319fab6cec25d931cdb5db670c434dde44ab56b",
- "sha256:c914312ad7c923ac154821fbd591e8482ab03cdb190e14b05e30bf856f69e98c",
- "sha256:d354ebb06f851f5f2cbc675bbb1369f71091aec6a894986d68341cbca59e7e56",
- "sha256:d35a25989112c07a994070f1b3c711b19a14209c7608802eced3bcbf07c375bb",
- "sha256:d71c128151c2d93fab36d7273b6a6696a63e0aa03ba3f7b1b0abb862c2344765",
- "sha256:d77e4cbecc30f3a8406873c83075c5dae9dcd2ba1c0ffb088edd29372d3df84c",
- "sha256:dd0b68d212d0992e2a906c6c34a1ef3f82b3dba74ff99744c77f390ffecb0cca",
- "sha256:f0f97d3e0ab12456733687fc99d05e4de67f12d48a57c3baf1f5a1c6cd76c876",
- "sha256:f7b72646a5a50aed8535d8cd2d7e915238f389c181d20143f67c2c6527ca5d0e",
- "sha256:fd06663aa38b2b7b1f71017329545e17f2a583b127de4eeaabdc4cb16cf3a942"
+ "sha256:163d3ee445a0b4c0109877da9e46271aacf4e5e3d60ae7368669555c30f13e7c",
+ "sha256:1af0bfe7b0c13a0e613a27311fd4f9c5d024e8fc0f4b3d284e7df02a58a11fc0",
+ "sha256:2169c3a1bf52d5b30cc98625b5919a964c571a32e8646be20be6c7e3e82079de",
+ "sha256:218f079fa48e2ef812dc3d3ce6ec2f67ac56427ba4b038d5d6331f2cceb489c2",
+ "sha256:26a958930687e94c4c6c73c171e4d4783b82ae4e16aa3424e6bcd4529bceedf0",
+ "sha256:2c7c195aef3acdbc853942bc674844031a732890d2fee88a324298ed376b6c2b",
+ "sha256:2ecdbfed7004669472bfa27c8d51012c717c241c7154ae17e4c8f93024043525",
+ "sha256:345fc31b71a90ada1b51826537917b19a1af685a91c0f066787069c184d7d00f",
+ "sha256:378a06649503f548be5f1e9eec2e94cc1d6138250b82a08dcc6151bca8cec107",
+ "sha256:3f300bf2930e501dde09605de85cb2b84c2638e2c954be02a3c86f28176d3525",
+ "sha256:6c2f66c653ce8bbd7e789d0f7f92c3f9fea881b55226f0ae5ee550cce9e3cf0e",
+ "sha256:6fccbac2633831b877a8fbf865f7082d34895e82a015795a9f80f99a2efe2576",
+ "sha256:7a166f8ccb6888358d3e67795b057540ea7caa71ab9e089b0cb0097f01088965",
+ "sha256:8f6b84f887ec6fef6c1796779f8ec2603dc7e9ef52bc9269de719d4bcbdaebbb",
+ "sha256:92cf3ceb7bb90cf35b8bd993c640b15d4832ba0e142a3b9da5006ef217da595d",
+ "sha256:a20dfdf73f56da674926a3811929cff9fd23b9af90be9a6c36ac246a3486eef3",
+ "sha256:a84415df4689251556c961e4fe3b25d30e32f00faa8064ce0909458dbe0d67b2",
+ "sha256:ab1aa1cd50df3860f624c9713ee9e690eefd4e049d3a4d86577bab6e741e9616",
+ "sha256:abc9dcf85e75a8687f2a6d560c0c1a2593e8e34ba6f9ad6721f8212c5de179a2",
+ "sha256:c10454710a81a2f4b1ff4d1c83ac2cec63e0e55845a56324991514af5b1299d0",
+ "sha256:c38f80719e4dfae7a6311a4f091f07f4fb2fb5d602352015d5639f63f8fabb68",
+ "sha256:d75cf00605630b2cfefa5c62373c605dcda1cc0d607902847dbb8e8e9b67c1ce",
+ "sha256:dce15cb6ef604c9e38fdaa848f58f83153ade9f4aa5e4cf5812aa27163561750",
+ "sha256:e7e0db4311bb76bf3f6e0380f71912cfa6d0be7cc635e3772476050b0dabdabd",
+ "sha256:eac59cae78dfe3fbf7ece25c170d7a152f88df7643381aa5e7344c2028a8d8d4",
+ "sha256:ead7b3e1567bd14cacd44279c5e42cd19f54b9feed39180220253f4fbe3abd56",
+ "sha256:ed772a5e8e7e5dd6bede960a86940c17cf653c7f158dafa5d52e919b676f10ba",
+ "sha256:f2d73131acb94afa45de8b6b8a4bfb21bbe3736633d6478e53247f19dd8c299c"
],
"index": "pypi",
- "version": "==2.8"
+ "version": "==2.8.1"
},
"pytz": {
"hashes": [
@@ -156,12 +243,12 @@
],
"version": "==1.12.0"
},
- "sqlparse": {
+ "sorl-thumbnail": {
"hashes": [
- "sha256:40afe6b8d4b1117e7dff5504d7a8ce07d9a1b15aeeade8a2d10f130a834f8177",
- "sha256:7c3dca29c022744e95b547e867cee89f4fce4373f3549ccd8797d8eb52cdb873"
+ "sha256:8dfe5fda91a5047d1d35a0b9effe7b000764a01d648e15ca076f44e9c34b6dbd",
+ "sha256:d9e3f018d19293824803e4ffead96b19dfcd44fa7987cea392f50436817bef34"
],
- "version": "==0.3.0"
+ "version": "==12.5.0"
},
"uwsgi": {
"hashes": [
@@ -169,6 +256,21 @@
],
"index": "pypi",
"version": "==2.0.18"
+ },
+ "webencodings": {
+ "hashes": [
+ "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78",
+ "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"
+ ],
+ "version": "==0.5.1"
+ },
+ "wiki": {
+ "hashes": [
+ "sha256:8a3130c50aa6e92a579968d154ce7e66dda85d0b10358d479066ed957f6f4dfc",
+ "sha256:df9c73d4185433d9f375c1646b7c08e099e86172faf93d6afc16389db075440a"
+ ],
+ "index": "pypi",
+ "version": "==0.4.4"
}
},
"develop": {
--
cgit v1.2.3
From 3d868521f60b1b8d5d1106e4b8cd089a018328e3 Mon Sep 17 00:00:00 2001
From: Gareth Coles
Date: Mon, 8 Apr 2019 12:48:53 +0100
Subject: First attempt at getting the wiki up
---
pydis_site/apps/wiki/__init__.py | 0
pydis_site/apps/wiki/admin.py | 3 ---
pydis_site/apps/wiki/apps.py | 5 -----
pydis_site/apps/wiki/migrations/__init__.py | 0
pydis_site/apps/wiki/models.py | 3 ---
pydis_site/apps/wiki/tests.py | 3 ---
pydis_site/apps/wiki/views.py | 3 ---
pydis_site/apps/wiki_container/__init__.py | 0
pydis_site/apps/wiki_container/apps.py | 6 ++++++
pydis_site/apps/wiki_container/urls.py | 6 ++++++
pydis_site/hosts.py | 1 +
pydis_site/settings.py | 26 +++++++++++++++++++++++---
pydis_site/sites.py | 5 +++++
13 files changed, 41 insertions(+), 20 deletions(-)
delete mode 100644 pydis_site/apps/wiki/__init__.py
delete mode 100644 pydis_site/apps/wiki/admin.py
delete mode 100644 pydis_site/apps/wiki/apps.py
delete mode 100644 pydis_site/apps/wiki/migrations/__init__.py
delete mode 100644 pydis_site/apps/wiki/models.py
delete mode 100644 pydis_site/apps/wiki/tests.py
delete mode 100644 pydis_site/apps/wiki/views.py
create mode 100644 pydis_site/apps/wiki_container/__init__.py
create mode 100644 pydis_site/apps/wiki_container/apps.py
create mode 100644 pydis_site/apps/wiki_container/urls.py
create mode 100644 pydis_site/sites.py
diff --git a/pydis_site/apps/wiki/__init__.py b/pydis_site/apps/wiki/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/pydis_site/apps/wiki/admin.py b/pydis_site/apps/wiki/admin.py
deleted file mode 100644
index 4185d360..00000000
--- a/pydis_site/apps/wiki/admin.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# from django.contrib import admin
-
-# Register your models here.
diff --git a/pydis_site/apps/wiki/apps.py b/pydis_site/apps/wiki/apps.py
deleted file mode 100644
index fce4708e..00000000
--- a/pydis_site/apps/wiki/apps.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from django.apps import AppConfig
-
-
-class WikiConfig(AppConfig):
- name = 'wiki'
diff --git a/pydis_site/apps/wiki/migrations/__init__.py b/pydis_site/apps/wiki/migrations/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/pydis_site/apps/wiki/models.py b/pydis_site/apps/wiki/models.py
deleted file mode 100644
index 0b4331b3..00000000
--- a/pydis_site/apps/wiki/models.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# from django.db import models
-
-# Create your models here.
diff --git a/pydis_site/apps/wiki/tests.py b/pydis_site/apps/wiki/tests.py
deleted file mode 100644
index a79ca8be..00000000
--- a/pydis_site/apps/wiki/tests.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# from django.test import TestCase
-
-# Create your tests here.
diff --git a/pydis_site/apps/wiki/views.py b/pydis_site/apps/wiki/views.py
deleted file mode 100644
index fd0e0449..00000000
--- a/pydis_site/apps/wiki/views.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# from django.shortcuts import render
-
-# Create your views here.
diff --git a/pydis_site/apps/wiki_container/__init__.py b/pydis_site/apps/wiki_container/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/pydis_site/apps/wiki_container/apps.py b/pydis_site/apps/wiki_container/apps.py
new file mode 100644
index 00000000..874ae8e4
--- /dev/null
+++ b/pydis_site/apps/wiki_container/apps.py
@@ -0,0 +1,6 @@
+from wiki.apps import WikiConfig
+
+
+class WikiContainerConfig(WikiConfig):
+ name = 'wiki_container'
+ default_site = 'pydis_site.sites.PyDisWikiSite'
diff --git a/pydis_site/apps/wiki_container/urls.py b/pydis_site/apps/wiki_container/urls.py
new file mode 100644
index 00000000..1537fe8c
--- /dev/null
+++ b/pydis_site/apps/wiki_container/urls.py
@@ -0,0 +1,6 @@
+from django.urls import path, include
+
+urlpatterns = [
+ path('notifications/', include('django_nyt.urls')),
+ path('', include('wiki.urls'))
+]
diff --git a/pydis_site/hosts.py b/pydis_site/hosts.py
index 34acfd09..fc43d0eb 100644
--- a/pydis_site/hosts.py
+++ b/pydis_site/hosts.py
@@ -4,6 +4,7 @@ from django_hosts import host, patterns
host_patterns = patterns(
'',
# host(r"subdomain pattern", "URLs module", "host entry name")
+ host(r'wiki', 'pydis_site.apps.wiki_container.urls', name="wiki"),
host(r'admin', 'pydis_site.apps.admin.urls', name="admin"),
host(r'api', 'pydis_site.apps.api.urls', name='api'),
host(r'.*', 'pydis_site.apps.home.urls', name=settings.DEFAULT_HOST)
diff --git a/pydis_site/settings.py b/pydis_site/settings.py
index e8355918..2212da21 100644
--- a/pydis_site/settings.py
+++ b/pydis_site/settings.py
@@ -64,22 +64,34 @@ else:
INSTALLED_APPS = [
'pydis_site.apps.api',
'pydis_site.apps.home',
- 'pydis_site.apps.wiki',
+ 'pydis_site.apps.wiki_container',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
+ 'django.contrib.humanize.apps.HumanizeConfig',
'django.contrib.sessions',
'django.contrib.messages',
+ 'django.contrib.sites.apps.SitesConfig',
'django.contrib.staticfiles',
'crispy_forms',
+ 'django_crispy_bulma',
'django_hosts',
'django_filters',
- 'django_crispy_bulma',
+ 'django_nyt.apps.DjangoNytConfig',
'django_simple_bulma',
+ 'mptt',
'rest_framework',
- 'rest_framework.authtoken'
+ 'rest_framework.authtoken',
+ 'sekizai',
+ 'sorl.thumbnail',
+
+ 'wiki.apps.WikiConfig',
+ 'wiki.plugins.attachments.apps.AttachmentsConfig',
+ 'wiki.plugins.notifications.apps.NotificationsConfig',
+ 'wiki.plugins.images.apps.ImagesConfig',
+ 'wiki.plugins.macros.apps.MacrosConfig',
]
MIDDLEWARE = [
@@ -112,6 +124,8 @@ TEMPLATES = [
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
+
+ "sekizai.context_processors.sekizai",
],
},
},
@@ -257,3 +271,9 @@ BULMA_SETTINGS = {
"link": "$primary",
}
}
+
+# Required for the wiki
+SITE_ID = 1
+
+WIKI_ACCOUNT_HANDLING = False
+WIKI_ACCOUNT_SIGNUP_ALLOWED = False
diff --git a/pydis_site/sites.py b/pydis_site/sites.py
new file mode 100644
index 00000000..b3370049
--- /dev/null
+++ b/pydis_site/sites.py
@@ -0,0 +1,5 @@
+from wiki.sites import WikiSite
+
+
+class PyDisWikiSite(WikiSite):
+ pass
--
cgit v1.2.3
From 4dc58e6e14702989f7419d6bfc4ca589898f2e56 Mon Sep 17 00:00:00 2001
From: Gareth Coles
Date: Mon, 8 Apr 2019 14:05:50 +0100
Subject: Remove wiki host, use /wiki - Also some wiki config
I've included the monokai pygments theme, but we can change it later
---
.dockerignore | 2 -
Pipfile | 1 +
Pipfile.lock | 10 ++++-
pydis_site/apps/home/urls.py | 7 +--
pydis_site/apps/wiki_container/__init__.py | 0
pydis_site/apps/wiki_container/apps.py | 6 ---
pydis_site/apps/wiki_container/urls.py | 6 ---
pydis_site/hosts.py | 3 +-
pydis_site/settings.py | 29 ++++++++++++-
pydis_site/static/css/pygments.css | 70 ++++++++++++++++++++++++++++++
10 files changed, 113 insertions(+), 21 deletions(-)
delete mode 100644 pydis_site/apps/wiki_container/__init__.py
delete mode 100644 pydis_site/apps/wiki_container/apps.py
delete mode 100644 pydis_site/apps/wiki_container/urls.py
create mode 100644 pydis_site/static/css/pygments.css
diff --git a/.dockerignore b/.dockerignore
index ca6ba308..4ad7c8a7 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -31,5 +31,3 @@ README.md
scripts
Vagrantfile
venv
-pydis_site/apps/wiki/tests
-pydis_site/apps/wiki/tests.py
diff --git a/Pipfile b/Pipfile
index 1fd34c35..c6f210ab 100644
--- a/Pipfile
+++ b/Pipfile
@@ -28,6 +28,7 @@ psycopg2-binary = "~=2.8"
django-simple-bulma = ">=1.1.6,<2.0"
django-crispy-bulma = ">=0.1.2,<2.0"
wiki = "~=0.4.4"
+pygments = "~=2.3.1"
[requires]
python_version = "3.7"
diff --git a/Pipfile.lock b/Pipfile.lock
index a908b8c7..777dbd38 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "a63ccdec81594bd69f4af503e5a62fe01a74adfd6daaaa0fb9be08b25631cb84"
+ "sha256": "d6bbf11476ca021d14ef03475ef6154b148d75a3ceada522194a56e80a27ccf1"
},
"pipfile-spec": 6,
"requires": {
@@ -229,6 +229,14 @@
"index": "pypi",
"version": "==2.8.1"
},
+ "pygments": {
+ "hashes": [
+ "sha256:5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a",
+ "sha256:e8218dd399a61674745138520d0d4cf2621d7e032439341bc3f647bff125818d"
+ ],
+ "index": "pypi",
+ "version": "==2.3.1"
+ },
"pytz": {
"hashes": [
"sha256:32b0891edff07e28efe91284ed9c31e123d84bea3fd98e1f72be2508f43ef8d9",
diff --git a/pydis_site/apps/home/urls.py b/pydis_site/apps/home/urls.py
index a01e019e..ede0531e 100644
--- a/pydis_site/apps/home/urls.py
+++ b/pydis_site/apps/home/urls.py
@@ -1,10 +1,11 @@
from django.contrib import admin
-from django.urls import path
+from django.urls import path, include
from django.views.generic import TemplateView
app_name = 'home'
urlpatterns = [
- path('', TemplateView.as_view(template_name='home/index.html'), name='index'),
- path('admin/', admin.site.urls)
+ path('admin/', admin.site.urls),
+ path('wiki/', include('wiki.urls')),
+ path('/', TemplateView.as_view(template_name='home/index.html'), name='index'),
]
diff --git a/pydis_site/apps/wiki_container/__init__.py b/pydis_site/apps/wiki_container/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/pydis_site/apps/wiki_container/apps.py b/pydis_site/apps/wiki_container/apps.py
deleted file mode 100644
index 874ae8e4..00000000
--- a/pydis_site/apps/wiki_container/apps.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from wiki.apps import WikiConfig
-
-
-class WikiContainerConfig(WikiConfig):
- name = 'wiki_container'
- default_site = 'pydis_site.sites.PyDisWikiSite'
diff --git a/pydis_site/apps/wiki_container/urls.py b/pydis_site/apps/wiki_container/urls.py
deleted file mode 100644
index 1537fe8c..00000000
--- a/pydis_site/apps/wiki_container/urls.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from django.urls import path, include
-
-urlpatterns = [
- path('notifications/', include('django_nyt.urls')),
- path('', include('wiki.urls'))
-]
diff --git a/pydis_site/hosts.py b/pydis_site/hosts.py
index fc43d0eb..25220ee0 100644
--- a/pydis_site/hosts.py
+++ b/pydis_site/hosts.py
@@ -3,8 +3,7 @@ from django_hosts import host, patterns
host_patterns = patterns(
'',
- # host(r"subdomain pattern", "URLs module", "host entry name")
- host(r'wiki', 'pydis_site.apps.wiki_container.urls', name="wiki"),
+ # host(r"subdomain pattern", "URLs module", "host entry name"),
host(r'admin', 'pydis_site.apps.admin.urls', name="admin"),
host(r'api', 'pydis_site.apps.api.urls', name='api'),
host(r'.*', 'pydis_site.apps.home.urls', name=settings.DEFAULT_HOST)
diff --git a/pydis_site/settings.py b/pydis_site/settings.py
index 2212da21..e55b3132 100644
--- a/pydis_site/settings.py
+++ b/pydis_site/settings.py
@@ -64,7 +64,6 @@ else:
INSTALLED_APPS = [
'pydis_site.apps.api',
'pydis_site.apps.home',
- 'pydis_site.apps.wiki_container',
'django.contrib.admin',
'django.contrib.auth',
@@ -277,3 +276,31 @@ SITE_ID = 1
WIKI_ACCOUNT_HANDLING = False
WIKI_ACCOUNT_SIGNUP_ALLOWED = False
+
+WIKI_ANONYMOUS = True
+WIKI_ANONYMOUS_CREATE = DEBUG
+WIKI_ANONYMOUS_UPLOAD = DEBUG
+WIKI_ANONYMOUS_WRITE = DEBUG
+
+WIKI_MARKDOWN_KWARGS = {
+ "extension_configs": {
+ "wiki.plugins.macros.mdx.toc": {
+ "title": "Contents"
+ }
+ }, "extensions": [
+ "markdown.extensions.abbr",
+ "markdown.extensions.attr_list",
+ "markdown.extensions.extra",
+ "markdown.extensions.fenced_code",
+ "markdown.extensions.footnotes",
+ "markdown.extensions.nl2br",
+ "markdown.extensions.sane_lists",
+
+ "wiki.core.markdown.mdx.codehilite",
+ "wiki.core.markdown.mdx.previewlinks",
+ "wiki.core.markdown.mdx.responsivetable",
+ "wiki.plugins.macros.mdx.macro",
+ "wiki.plugins.macros.mdx.toc",
+ "wiki.plugins.macros.mdx.wikilinks",
+ ]
+}
diff --git a/pydis_site/static/css/pygments.css b/pydis_site/static/css/pygments.css
new file mode 100644
index 00000000..d2e9fc72
--- /dev/null
+++ b/pydis_site/static/css/pygments.css
@@ -0,0 +1,70 @@
+.codehilite .hll { background-color: #49483e }
+.codehilite { background: #272822; color: #f8f8f2 }
+.codehilite .c { color: #75715e } /* Comment */
+.codehilite .err { color: #960050; background-color: #1e0010 } /* Error */
+.codehilite .k { color: #66d9ef } /* Keyword */
+.codehilite .l { color: #ae81ff } /* Literal */
+.codehilite .n { color: #f8f8f2 } /* Name */
+.codehilite .o { color: #f92672 } /* Operator */
+.codehilite .p { color: #f8f8f2 } /* Punctuation */
+.codehilite .ch { color: #75715e } /* Comment.Hashbang */
+.codehilite .cm { color: #75715e } /* Comment.Multiline */
+.codehilite .cp { color: #75715e } /* Comment.Preproc */
+.codehilite .cpf { color: #75715e } /* Comment.PreprocFile */
+.codehilite .c1 { color: #75715e } /* Comment.Single */
+.codehilite .cs { color: #75715e } /* Comment.Special */
+.codehilite .gd { color: #f92672 } /* Generic.Deleted */
+.codehilite .ge { font-style: italic } /* Generic.Emph */
+.codehilite .gi { color: #a6e22e } /* Generic.Inserted */
+.codehilite .gs { font-weight: bold } /* Generic.Strong */
+.codehilite .gu { color: #75715e } /* Generic.Subheading */
+.codehilite .kc { color: #66d9ef } /* Keyword.Constant */
+.codehilite .kd { color: #66d9ef } /* Keyword.Declaration */
+.codehilite .kn { color: #f92672 } /* Keyword.Namespace */
+.codehilite .kp { color: #66d9ef } /* Keyword.Pseudo */
+.codehilite .kr { color: #66d9ef } /* Keyword.Reserved */
+.codehilite .kt { color: #66d9ef } /* Keyword.Type */
+.codehilite .ld { color: #e6db74 } /* Literal.Date */
+.codehilite .m { color: #ae81ff } /* Literal.Number */
+.codehilite .s { color: #e6db74 } /* Literal.String */
+.codehilite .na { color: #a6e22e } /* Name.Attribute */
+.codehilite .nb { color: #f8f8f2 } /* Name.Builtin */
+.codehilite .nc { color: #a6e22e } /* Name.Class */
+.codehilite .no { color: #66d9ef } /* Name.Constant */
+.codehilite .nd { color: #a6e22e } /* Name.Decorator */
+.codehilite .ni { color: #f8f8f2 } /* Name.Entity */
+.codehilite .ne { color: #a6e22e } /* Name.Exception */
+.codehilite .nf { color: #a6e22e } /* Name.Function */
+.codehilite .nl { color: #f8f8f2 } /* Name.Label */
+.codehilite .nn { color: #f8f8f2 } /* Name.Namespace */
+.codehilite .nx { color: #a6e22e } /* Name.Other */
+.codehilite .py { color: #f8f8f2 } /* Name.Property */
+.codehilite .nt { color: #f92672 } /* Name.Tag */
+.codehilite .nv { color: #f8f8f2 } /* Name.Variable */
+.codehilite .ow { color: #f92672 } /* Operator.Word */
+.codehilite .w { color: #f8f8f2 } /* Text.Whitespace */
+.codehilite .mb { color: #ae81ff } /* Literal.Number.Bin */
+.codehilite .mf { color: #ae81ff } /* Literal.Number.Float */
+.codehilite .mh { color: #ae81ff } /* Literal.Number.Hex */
+.codehilite .mi { color: #ae81ff } /* Literal.Number.Integer */
+.codehilite .mo { color: #ae81ff } /* Literal.Number.Oct */
+.codehilite .sa { color: #e6db74 } /* Literal.String.Affix */
+.codehilite .sb { color: #e6db74 } /* Literal.String.Backtick */
+.codehilite .sc { color: #e6db74 } /* Literal.String.Char */
+.codehilite .dl { color: #e6db74 } /* Literal.String.Delimiter */
+.codehilite .sd { color: #e6db74 } /* Literal.String.Doc */
+.codehilite .s2 { color: #e6db74 } /* Literal.String.Double */
+.codehilite .se { color: #ae81ff } /* Literal.String.Escape */
+.codehilite .sh { color: #e6db74 } /* Literal.String.Heredoc */
+.codehilite .si { color: #e6db74 } /* Literal.String.Interpol */
+.codehilite .sx { color: #e6db74 } /* Literal.String.Other */
+.codehilite .sr { color: #e6db74 } /* Literal.String.Regex */
+.codehilite .s1 { color: #e6db74 } /* Literal.String.Single */
+.codehilite .ss { color: #e6db74 } /* Literal.String.Symbol */
+.codehilite .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
+.codehilite .fm { color: #a6e22e } /* Name.Function.Magic */
+.codehilite .vc { color: #f8f8f2 } /* Name.Variable.Class */
+.codehilite .vg { color: #f8f8f2 } /* Name.Variable.Global */
+.codehilite .vi { color: #f8f8f2 } /* Name.Variable.Instance */
+.codehilite .vm { color: #f8f8f2 } /* Name.Variable.Magic */
+.codehilite .il { color: #ae81ff } /* Literal.Number.Integer.Long */
--
cgit v1.2.3
From 027475779bfa7db50a1c1ff9935bcb546b33f961 Mon Sep 17 00:00:00 2001
From: Gareth Coles
Date: Mon, 8 Apr 2019 14:06:11 +0100
Subject: Add base templates for django-wiki, as provided
---
.../templates/wiki/accounts/account_settings.html | 14 ++
pydis_site/templates/wiki/accounts/login.html | 38 ++++
pydis_site/templates/wiki/accounts/signup.html | 27 +++
pydis_site/templates/wiki/article.html | 40 ++++
pydis_site/templates/wiki/base.html | 3 +
pydis_site/templates/wiki/base_site.html | 164 +++++++++++++++++
pydis_site/templates/wiki/create.html | 50 +++++
pydis_site/templates/wiki/create_root.html | 40 ++++
pydis_site/templates/wiki/delete.html | 67 +++++++
pydis_site/templates/wiki/deleted.html | 56 ++++++
pydis_site/templates/wiki/deleted_list.html | 33 ++++
pydis_site/templates/wiki/dir.html | 82 +++++++++
pydis_site/templates/wiki/edit.html | 139 ++++++++++++++
pydis_site/templates/wiki/error.html | 45 +++++
.../templates/wiki/forms/markitup-admin.html | 1 +
pydis_site/templates/wiki/forms/markitup.html | 1 +
pydis_site/templates/wiki/forms/select.html | 15 ++
pydis_site/templates/wiki/forms/select_option.html | 1 +
pydis_site/templates/wiki/forms/text.html | 1 +
pydis_site/templates/wiki/history.html | 202 +++++++++++++++++++++
.../templates/wiki/includes/anonymous_blocked.html | 13 ++
.../templates/wiki/includes/article_menu.html | 53 ++++++
.../templates/wiki/includes/breadcrumbs.html | 61 +++++++
pydis_site/templates/wiki/includes/editor.html | 11 ++
.../templates/wiki/includes/editor_sidebar.html | 42 +++++
.../templates/wiki/includes/editormedia.html | 15 ++
pydis_site/templates/wiki/includes/form.html | 17 ++
pydis_site/templates/wiki/includes/formerrors.html | 8 +
pydis_site/templates/wiki/includes/formfield.html | 25 +++
pydis_site/templates/wiki/includes/messages.html | 9 +
pydis_site/templates/wiki/includes/modals.html | 31 ++++
pydis_site/templates/wiki/includes/move_tree.html | 16 ++
pydis_site/templates/wiki/includes/pagination.html | 24 +++
pydis_site/templates/wiki/includes/render.html | 26 +++
.../templates/wiki/includes/revision_info.html | 25 +++
.../templates/wiki/includes/searchresult.html | 22 +++
pydis_site/templates/wiki/move.html | 66 +++++++
pydis_site/templates/wiki/permission_denied.html | 32 ++++
pydis_site/templates/wiki/preview_inline.html | 55 ++++++
pydis_site/templates/wiki/root_missing.html | 37 ++++
pydis_site/templates/wiki/search.html | 53 ++++++
pydis_site/templates/wiki/settings.html | 24 +++
pydis_site/templates/wiki/source.html | 17 ++
pydis_site/templates/wiki/view.html | 9 +
44 files changed, 1710 insertions(+)
create mode 100644 pydis_site/templates/wiki/accounts/account_settings.html
create mode 100644 pydis_site/templates/wiki/accounts/login.html
create mode 100644 pydis_site/templates/wiki/accounts/signup.html
create mode 100644 pydis_site/templates/wiki/article.html
create mode 100644 pydis_site/templates/wiki/base.html
create mode 100644 pydis_site/templates/wiki/base_site.html
create mode 100644 pydis_site/templates/wiki/create.html
create mode 100644 pydis_site/templates/wiki/create_root.html
create mode 100644 pydis_site/templates/wiki/delete.html
create mode 100644 pydis_site/templates/wiki/deleted.html
create mode 100644 pydis_site/templates/wiki/deleted_list.html
create mode 100644 pydis_site/templates/wiki/dir.html
create mode 100644 pydis_site/templates/wiki/edit.html
create mode 100644 pydis_site/templates/wiki/error.html
create mode 100644 pydis_site/templates/wiki/forms/markitup-admin.html
create mode 100644 pydis_site/templates/wiki/forms/markitup.html
create mode 100644 pydis_site/templates/wiki/forms/select.html
create mode 100644 pydis_site/templates/wiki/forms/select_option.html
create mode 100644 pydis_site/templates/wiki/forms/text.html
create mode 100644 pydis_site/templates/wiki/history.html
create mode 100644 pydis_site/templates/wiki/includes/anonymous_blocked.html
create mode 100644 pydis_site/templates/wiki/includes/article_menu.html
create mode 100644 pydis_site/templates/wiki/includes/breadcrumbs.html
create mode 100644 pydis_site/templates/wiki/includes/editor.html
create mode 100644 pydis_site/templates/wiki/includes/editor_sidebar.html
create mode 100644 pydis_site/templates/wiki/includes/editormedia.html
create mode 100644 pydis_site/templates/wiki/includes/form.html
create mode 100644 pydis_site/templates/wiki/includes/formerrors.html
create mode 100644 pydis_site/templates/wiki/includes/formfield.html
create mode 100644 pydis_site/templates/wiki/includes/messages.html
create mode 100644 pydis_site/templates/wiki/includes/modals.html
create mode 100644 pydis_site/templates/wiki/includes/move_tree.html
create mode 100644 pydis_site/templates/wiki/includes/pagination.html
create mode 100644 pydis_site/templates/wiki/includes/render.html
create mode 100644 pydis_site/templates/wiki/includes/revision_info.html
create mode 100644 pydis_site/templates/wiki/includes/searchresult.html
create mode 100644 pydis_site/templates/wiki/move.html
create mode 100644 pydis_site/templates/wiki/permission_denied.html
create mode 100644 pydis_site/templates/wiki/preview_inline.html
create mode 100644 pydis_site/templates/wiki/root_missing.html
create mode 100644 pydis_site/templates/wiki/search.html
create mode 100644 pydis_site/templates/wiki/settings.html
create mode 100644 pydis_site/templates/wiki/source.html
create mode 100644 pydis_site/templates/wiki/view.html
diff --git a/pydis_site/templates/wiki/accounts/account_settings.html b/pydis_site/templates/wiki/accounts/account_settings.html
new file mode 100644
index 00000000..ecff4376
--- /dev/null
+++ b/pydis_site/templates/wiki/accounts/account_settings.html
@@ -0,0 +1,14 @@
+{% extends "wiki/base.html" %}
+{% load i18n wiki_tags sekizai_tags %}
+
+{% block wiki_pagetitle %}{% trans "Account Settings" %}{% endblock %}
+
+{% block wiki_contents %}
+
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/accounts/login.html b/pydis_site/templates/wiki/accounts/login.html
new file mode 100644
index 00000000..082d47bd
--- /dev/null
+++ b/pydis_site/templates/wiki/accounts/login.html
@@ -0,0 +1,38 @@
+{% extends "wiki/base.html" %}
+{% load i18n wiki_tags sekizai_tags %}
+
+{% block wiki_pagetitle %}{% trans "Log in" %}{% endblock %}
+
+{% block wiki_contents %}
+
+
+{% addtoblock "js" %}
+
+{% endaddtoblock %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/accounts/signup.html b/pydis_site/templates/wiki/accounts/signup.html
new file mode 100644
index 00000000..6db65d3d
--- /dev/null
+++ b/pydis_site/templates/wiki/accounts/signup.html
@@ -0,0 +1,27 @@
+{% extends "wiki/base.html" %}
+{% load i18n wiki_tags sekizai_tags %}
+{% block wiki_pagetitle %}{% trans "Sign up" %}{% endblock %}
+
+{% block wiki_contents %}
+
+
+{% addtoblock "js" %}
+
+{% endaddtoblock %}
+{% endblock %}
diff --git a/pydis_site/templates/wiki/article.html b/pydis_site/templates/wiki/article.html
new file mode 100644
index 00000000..65877068
--- /dev/null
+++ b/pydis_site/templates/wiki/article.html
@@ -0,0 +1,40 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n sekizai_tags %}
+
+
+{% block wiki_pagetitle %}{{ article.current_revision.title }}{% endblock %}
+
+{% block wiki_breadcrumbs %}
+{% include "wiki/includes/breadcrumbs.html" %}
+{% endblock %}
+
+{% block wiki_contents %}
+
+
+
+
+
+ {{ article.current_revision.title }}
+
+ {% if urlpath.parent %}
+ {{ urlpath.slug }}
+ {% endif %}
+ {% if article.current_revision.locked %}
+ {% trans "locked" %}
+ {% endif %}
+
+
+
+ {% include "wiki/includes/article_menu.html" %}
+
+
+ {% block wiki_contents_tab %}
+ {% endblock %}
+
+
+
+{% endblock %}
+
+{% block wiki_footer_prepend %}
+ {% trans "This article was last modified:" %} {{ article.current_revision.modified }}
+{% endblock %}
diff --git a/pydis_site/templates/wiki/base.html b/pydis_site/templates/wiki/base.html
new file mode 100644
index 00000000..5260bfcd
--- /dev/null
+++ b/pydis_site/templates/wiki/base.html
@@ -0,0 +1,3 @@
+{% extends "wiki/base_site.html" %}
+
+{# Intentionally empty, to allow easy customization with no copy-paste #}
diff --git a/pydis_site/templates/wiki/base_site.html b/pydis_site/templates/wiki/base_site.html
new file mode 100644
index 00000000..d025e53c
--- /dev/null
+++ b/pydis_site/templates/wiki/base_site.html
@@ -0,0 +1,164 @@
+{% load sekizai_tags i18n wiki_tags static %}
+
+
+
+ {% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %} - django-\/\/ i K |{% endblock %}
+
+
+
+
+
+
+
+
+ {% render_block "css" %}
+
+
+
+
+
+
+
+
+ {% block wiki_body %}
+
+ {% block wiki_navbar %}
+
+
+
+
+
+
+ {% if user.is_authenticated %}
+
+ {% else %}
+
+ {% endif %}
+
+ {% block wiki_header_navlinks %}
+
+ {% endblock %}
+
+
+
+ {% endblock %}
+
+
+
+ {% wiki_messages %}
+
+
+ {% block wiki_breadcrumbs %}{% endblock %}
+
+
+ {% block wiki_contents %}{% endblock %}
+
+
+
+
+
+
+ {% endblock %}
+
+
+
+
+
+
+ {% render_block "js" %}
+
+
+
diff --git a/pydis_site/templates/wiki/create.html b/pydis_site/templates/wiki/create.html
new file mode 100644
index 00000000..669a5ac4
--- /dev/null
+++ b/pydis_site/templates/wiki/create.html
@@ -0,0 +1,50 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n sekizai_tags static %}
+
+
+{% block wiki_pagetitle %}{% trans "Add new article" %}{% endblock %}
+
+{% block wiki_contents %}
+
+ {% addtoblock "js" %}
+
+
+ {% endaddtoblock %}
+
+ {% include "wiki/includes/editormedia.html" %}
+
+
+
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/create_root.html b/pydis_site/templates/wiki/create_root.html
new file mode 100644
index 00000000..73a14ae0
--- /dev/null
+++ b/pydis_site/templates/wiki/create_root.html
@@ -0,0 +1,40 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n sekizai_tags static %}
+
+{% block wiki_pagetitle %}{% trans "Create root article" %}{% endblock %}
+
+{% block wiki_contents %}
+
+ {% addtoblock "js" %}
+ {% for js in editor.Media.js %}
+
+ {% endfor %}
+ {% endaddtoblock %}
+
+ {% addtoblock "css" %}
+ {% for media, srcs in editor.Media.css.items %}
+ {% for src in srcs %}
+
+ {% endfor %}
+ {% endfor %}
+ {% endaddtoblock %}
+
+ {% trans "Congratulations!" %}
+
+ {% 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." %}
+
+
+
+
+
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/delete.html b/pydis_site/templates/wiki/delete.html
new file mode 100644
index 00000000..afb4140d
--- /dev/null
+++ b/pydis_site/templates/wiki/delete.html
@@ -0,0 +1,67 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n sekizai_tags %}
+
+
+{% block wiki_pagetitle %}{% trans "Delete article" %}{% endblock %}
+
+{% block wiki_contents %}
+
+
+ {% if cannot_delete_root %}
+ {% trans "You cannot delete a root article." %}
+ {% trans "Go back" %}
+ {% else %}
+
+ {% if cannot_delete_children %}
+
+ {% trans "You cannot delete this article because you do not have permission to delete articles with children. Try to remove the children manually one-by-one." %}
+
+ {% endif %}
+
+ {% if delete_children %}
+
+ {% trans "You are deleting an article. This means that its children will be deleted as well. If you choose to purge, children will also be purged!" %}
+
+ {% trans "Articles that will be deleted" %}
+
+
+ {% for child in delete_children %}
+ {{ child.article }}
+ {% if delete_children_more %}
+ {% trans "...and more!" %}
+ {% endif %}
+ {% endfor %}
+
+
+ {% endif %}
+
+ {% if not cannot_delete_children %}
+ {% trans "You are deleting an article. Please confirm." %}
+
+
+ {% endif %}
+
+ {% endif %}
+
+{% addtoblock "js" %}
+
+{% endaddtoblock %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/deleted.html b/pydis_site/templates/wiki/deleted.html
new file mode 100644
index 00000000..55ce2b46
--- /dev/null
+++ b/pydis_site/templates/wiki/deleted.html
@@ -0,0 +1,56 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n sekizai_tags %}
+
+
+{% block wiki_pagetitle %}{% trans "Article deleted" %}{% endblock %}
+
+{% block wiki_contents %}
+
+
+
+
+ {% trans "The article you were looking for has been deleted." %}
+
+
+
+
+ {% if not article.current_revision.locked or article|can_delete:user %}
+
+
+
{% trans "Restore" %}
+
{% trans "You may restore this article and its children by clicking restore." %}
+
+
+
+ {% trans "Restore" %}
+
+
+
+
+ {% endif %}
+
+ {% if article|can_moderate:user %}
+
+
+
{% trans "Purge deletion" %}
+
{% trans "You may remove this article and any children permanently and free their slugs by clicking the below button. This action cannot be undone." %}
+
+
+
+ {% endif %}
+
+
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/deleted_list.html b/pydis_site/templates/wiki/deleted_list.html
new file mode 100644
index 00000000..d0d72824
--- /dev/null
+++ b/pydis_site/templates/wiki/deleted_list.html
@@ -0,0 +1,33 @@
+{% extends "wiki/base.html" %}
+{% load i18n wiki_tags sekizai_tags %}
+
+{% block wiki_pagetitle %}{% trans "Admin Panel" %}{% endblock %}
+
+{% block wiki_contents %}
+
+
+{% if deleted_articles %}
+
+
+
+ {% trans "Page Title" %}
+ {% trans "Date Deleted" %}
+ {% trans "Restore Article" %}
+
+
+
+ {% for article in deleted_articles %}
+
+ {{ article }}
+ {{article.modified}}
+
+ {% trans "Restore" %}
+
+ {% endfor %}
+
+
+{% else %}
+ {% trans "No deleted articles to display" %}
+{% endif %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/dir.html b/pydis_site/templates/wiki/dir.html
new file mode 100644
index 00000000..86b04c85
--- /dev/null
+++ b/pydis_site/templates/wiki/dir.html
@@ -0,0 +1,82 @@
+{% extends "wiki/article.html" %}
+{% load wiki_tags i18n humanize %}
+
+
+{% block wiki_pagetitle %}{% trans "Listing articles in" %} {{ article.current_revision.title }}{% endblock %}
+
+{% block wiki_contents_tab %}
+
+{% url 'wiki:dir' urlpath.path as self_url %}
+
+
+
+
+ {% with paginator.object_list.count as cnt %}
+ {% blocktrans with urlpath.path as path and cnt|pluralize:_("article,articles") as articles_plur and cnt|pluralize:_("is,are") as articles_plur_verb trimmed %}
+ Browsing /{{ path }} . There {{ articles_plur_verb }} {{ cnt }} {{ articles_plur }} in this level.
+ {% endblocktrans %}
+ {% endwith %}
+
+
+
+
+ {% trans "Title" %}
+ {% trans "Slug" %}
+ {% trans "Last modified" %}
+
+ {% for urlpath in directory %}
+
+
+ {{ urlpath.article.current_revision.title }}
+ ›
+ {% if urlpath.article.current_revision.deleted %}
+
+ {% endif %}
+ {% if urlpath.article.current_revision.locked %}
+
+ {% endif %}
+
+
+ {{ urlpath.slug }}
+
+
+ {{ urlpath.article.current_revision.created|naturaltime }}
+
+
+ {% empty%}
+
+
+ {% trans "There are no articles in this level" %}
+
+
+ {% endfor %}
+
+
+{% include "wiki/includes/pagination.html" %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/edit.html b/pydis_site/templates/wiki/edit.html
new file mode 100644
index 00000000..aa9ee032
--- /dev/null
+++ b/pydis_site/templates/wiki/edit.html
@@ -0,0 +1,139 @@
+{% extends "wiki/article.html" %}
+{% load wiki_tags i18n sekizai_tags %}
+
+
+{% block wiki_pagetitle %}{% trans "Edit" %}: {{ article.current_revision.title }}{% endblock %}
+
+{% block wiki_contents_tab %}
+
+{% if not user.is_authenticated %}
+
+{% trans "Warning: You are not logged in. Your IP address will be logged." %}
+{% trans "Click here to log in" %} »
+
+{% endif %}
+
+
+
+
+
+{% include "wiki/includes/modals.html" %}
+
+
+
+{% addtoblock "js" %}
+
+{% endaddtoblock %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/error.html b/pydis_site/templates/wiki/error.html
new file mode 100644
index 00000000..b54c8cff
--- /dev/null
+++ b/pydis_site/templates/wiki/error.html
@@ -0,0 +1,45 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n %}
+
+
+{% block wiki_pagetitle %}{% if article %}{{ article.current_revision.title }}{% else %}{% trans "Error" %}{% endif %}{% endblock %}
+
+{% block wiki_breadcrumbs %}
+{% include "wiki/includes/breadcrumbs.html" %}
+{% endblock %}
+
+{% block wiki_contents %}
+
+{% if error_type == "ancestors_missing" %}
+
+
+
+
+
+{% else %}
+
+
+
+
+ {% if not error_msg %}
+
{% trans "There was some sort of error accessing this page. Sorry!" %}
+ {% else %}
+
{{ error_msg }}
+ {% endif %}
+
+
+ {% if article %}
+
+ {% trans "Back to" %} {{ article.current_revision.title }}
+
+ {% endif %}
+
+
+{% endif %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/forms/markitup-admin.html b/pydis_site/templates/wiki/forms/markitup-admin.html
new file mode 100644
index 00000000..d35bedb5
--- /dev/null
+++ b/pydis_site/templates/wiki/forms/markitup-admin.html
@@ -0,0 +1 @@
+
diff --git a/pydis_site/templates/wiki/forms/markitup.html b/pydis_site/templates/wiki/forms/markitup.html
new file mode 100644
index 00000000..87337e67
--- /dev/null
+++ b/pydis_site/templates/wiki/forms/markitup.html
@@ -0,0 +1 @@
+
diff --git a/pydis_site/templates/wiki/forms/select.html b/pydis_site/templates/wiki/forms/select.html
new file mode 100644
index 00000000..95bb06ed
--- /dev/null
+++ b/pydis_site/templates/wiki/forms/select.html
@@ -0,0 +1,15 @@
+
+ {{ label }}
+
+
+
+
+
+
+{{ noscript }}
diff --git a/pydis_site/templates/wiki/forms/select_option.html b/pydis_site/templates/wiki/forms/select_option.html
new file mode 100644
index 00000000..30ff9787
--- /dev/null
+++ b/pydis_site/templates/wiki/forms/select_option.html
@@ -0,0 +1 @@
+{{ widget.label }}
diff --git a/pydis_site/templates/wiki/forms/text.html b/pydis_site/templates/wiki/forms/text.html
new file mode 100644
index 00000000..23246aa8
--- /dev/null
+++ b/pydis_site/templates/wiki/forms/text.html
@@ -0,0 +1 @@
+{{ prepend }} {% include "django/forms/widgets/input.html" %}
diff --git a/pydis_site/templates/wiki/history.html b/pydis_site/templates/wiki/history.html
new file mode 100644
index 00000000..d7a3a4da
--- /dev/null
+++ b/pydis_site/templates/wiki/history.html
@@ -0,0 +1,202 @@
+{% extends "wiki/article.html" %}
+{% load wiki_tags i18n sekizai_tags static %}
+
+
+{% block wiki_pagetitle %}{% trans "History" %}: {{ article.current_revision.title }}{% endblock %}
+
+{% block wiki_contents_tab %}
+
+{% include "wiki/includes/modals.html" %}
+
+{% addtoblock "js" %}
+
+
+{% endaddtoblock %}
+{% addtoblock "css" %}
+
+{% endaddtoblock %}
+
+
+ {% trans "Click each revision to see a list of edited lines. Click the Preview button to see how the article looked at this stage. At the bottom of this page, you can change to a particular revision or merge an old revision with the current one." %}
+
+
+
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/includes/anonymous_blocked.html b/pydis_site/templates/wiki/includes/anonymous_blocked.html
new file mode 100644
index 00000000..5e1d3dac
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/anonymous_blocked.html
@@ -0,0 +1,13 @@
+{% load i18n %}
+
+
+{% url 'wiki:signup' as signup_url %}
+{% url 'wiki:login' as login_url %}
+{% if login_url and signup_url %}
+ {% blocktrans trimmed %}
+ You need to log in or sign up to use this function.
+ {% endblocktrans %}
+{% else %}
+ {% trans "You need to log in or sign up to use this function." %}
+{% endif %}
+
diff --git a/pydis_site/templates/wiki/includes/article_menu.html b/pydis_site/templates/wiki/includes/article_menu.html
new file mode 100644
index 00000000..9a83327b
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/article_menu.html
@@ -0,0 +1,53 @@
+{% load i18n wiki_tags %}
+
+{% with selected_tab as selected %}
+
+
+ {% if not user.is_anonymous %}
+
+
+ {% trans "Settings" %}
+
+ {% endif %}
+
+
+{% for plugin in article_tabs %}
+
+
+
+ {{ plugin.article_tab.0 }}
+
+
+{% endfor %}
+
+
+
+
+ {% trans "Changes" %}
+
+
+
+{% if article|can_write:user and not article.current_revision.locked %}
+
+
+
+ {% trans "Edit" %}
+
+
+{% else %}
+
+
+
+ {% trans "View Source" %}
+
+
+{% endif %}
+
+
+
+
+ {% trans "View" %}
+
+
+
+{% endwith %}
diff --git a/pydis_site/templates/wiki/includes/breadcrumbs.html b/pydis_site/templates/wiki/includes/breadcrumbs.html
new file mode 100644
index 00000000..b7a8aeae
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/breadcrumbs.html
@@ -0,0 +1,61 @@
+{% load i18n %}
+{% if urlpath %}
+
+{% endif %}
diff --git a/pydis_site/templates/wiki/includes/editor.html b/pydis_site/templates/wiki/includes/editor.html
new file mode 100644
index 00000000..6686d8dd
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/editor.html
@@ -0,0 +1,11 @@
+{% load wiki_tags i18n sekizai_tags %}
+{% include "wiki/includes/editormedia.html" %}
+
+{% wiki_form form %}
+{% addtoblock "js" %}
+
+{% endaddtoblock %}
diff --git a/pydis_site/templates/wiki/includes/editor_sidebar.html b/pydis_site/templates/wiki/includes/editor_sidebar.html
new file mode 100644
index 00000000..480dc239
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/editor_sidebar.html
@@ -0,0 +1,42 @@
+{% load i18n sekizai_tags %}
+{% addtoblock "js" %}
+
+{% endaddtoblock %}
+
+
+
+{% for plugin, plugin_form in sidebar %}
+
+
+{% endfor %}
+
diff --git a/pydis_site/templates/wiki/includes/editormedia.html b/pydis_site/templates/wiki/includes/editormedia.html
new file mode 100644
index 00000000..307a3078
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/editormedia.html
@@ -0,0 +1,15 @@
+{% load sekizai_tags static %}
+{% addtoblock "js" %}
+
+{% for js in editor.Media.js %}
+
+{% endfor %}
+{% endaddtoblock %}
+
+{% addtoblock "css" %}
+{% for media, srcs in editor.Media.css.items %}
+ {% for src in srcs %}
+
+ {% endfor %}
+{% endfor %}
+{% endaddtoblock %}
diff --git a/pydis_site/templates/wiki/includes/form.html b/pydis_site/templates/wiki/includes/form.html
new file mode 100644
index 00000000..3e1abb67
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/form.html
@@ -0,0 +1,17 @@
+{% csrf_token %}{% load sekizai_tags %}
+
+{% include "wiki/includes/formerrors.html" %}
+
+{% addtoblock "js" %}
+{{ form.media.js }}
+{% endaddtoblock %}
+
+{% addtoblock "css" %}
+{{ form.media.css }}
+{% endaddtoblock %}
+
+{% for field in form %}
+
+ {% include "wiki/includes/formfield.html" %}
+
+{% endfor %}
diff --git a/pydis_site/templates/wiki/includes/formerrors.html b/pydis_site/templates/wiki/includes/formerrors.html
new file mode 100644
index 00000000..72d3c539
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/formerrors.html
@@ -0,0 +1,8 @@
+{% if form.non_field_errors %}
+ {% if form_error_title %}{{ form_error_title }} {% endif %}
+ {% for error_message in form.non_field_errors %}
+
+ {{ error_message }}
+
+ {% endfor %}
+{% endif %}
diff --git a/pydis_site/templates/wiki/includes/formfield.html b/pydis_site/templates/wiki/includes/formfield.html
new file mode 100644
index 00000000..db6725a9
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/formfield.html
@@ -0,0 +1,25 @@
+{% if field.is_hidden %}
+ {{ field }}
+{% else %}
+
+
+{% endif %}
diff --git a/pydis_site/templates/wiki/includes/messages.html b/pydis_site/templates/wiki/includes/messages.html
new file mode 100644
index 00000000..f8362829
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/messages.html
@@ -0,0 +1,9 @@
+{% if messages %}
+
+ {% for message in messages %}
+
+ {% endfor %}
+{% endif %}
diff --git a/pydis_site/templates/wiki/includes/modals.html b/pydis_site/templates/wiki/includes/modals.html
new file mode 100644
index 00000000..b86d4f65
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/modals.html
@@ -0,0 +1,31 @@
+{% load sekizai_tags static %}
+{% addtoblock "js" %}
+
+
+{% endaddtoblock %}
+{% addtoblock "css" %}
+
+{% endaddtoblock %}
diff --git a/pydis_site/templates/wiki/includes/move_tree.html b/pydis_site/templates/wiki/includes/move_tree.html
new file mode 100644
index 00000000..af7e422b
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/move_tree.html
@@ -0,0 +1,16 @@
+{% load wiki_tags %}
+
+
diff --git a/pydis_site/templates/wiki/includes/pagination.html b/pydis_site/templates/wiki/includes/pagination.html
new file mode 100644
index 00000000..6e7ec608
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/pagination.html
@@ -0,0 +1,24 @@
+{% load i18n %}
+{% if is_paginated %}
+
+{% endif %}
diff --git a/pydis_site/templates/wiki/includes/render.html b/pydis_site/templates/wiki/includes/render.html
new file mode 100644
index 00000000..28ab76c9
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/render.html
@@ -0,0 +1,26 @@
+{% load wiki_tags i18n cache sekizai_tags static %}
+
+{% addtoblock "js" %}
+
+{% endaddtoblock %}
+
+
+ {{ content|default:"" }}
+
+
+{% for plugin in plugins %}
+ {% if plugin.RenderMedia.css %}
+ {% addtoblock "css" %}
+ {% for media, url in plugin.RenderMedia.css.items %}
+
+ {% endfor %}
+ {% endaddtoblock %}
+ {% endif %}
+ {% if plugin.RenderMedia.js %}
+ {% addtoblock "js" %}
+ {% for url in plugin.RenderMedia.js %}
+
+ {% endfor %}
+ {% endaddtoblock %}
+ {% endif %}
+{% endfor %}
diff --git a/pydis_site/templates/wiki/includes/revision_info.html b/pydis_site/templates/wiki/includes/revision_info.html
new file mode 100644
index 00000000..95b01baf
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/revision_info.html
@@ -0,0 +1,25 @@
+{% comment %}
+
+ This reusable code is shared between different templates and different inheritors of
+ BaseRevision.
+
+{% endcomment %}
+
+
+{% load wiki_tags i18n %}
+{% if not hidedate %}{{ revision.created }}{% endif %} {% if not hidenumber %}(#{{ revision.revision_number }}) {% trans "by" %}{% endif %} {% if revision.user %}{{ revision.user }}{% else %}{% if article|can_moderate:user %}{{ revision.ip_address|default:"anonymous (IP not logged)" }}{% else %}{% trans "anonymous (IP logged)" %}{% endif %}{% endif %}
+{% if revision == current_revision %}
+ *
+{% endif %}
+{% if revision.deleted %}
+{% trans "deleted" %}
+{% endif %}
+{% if revision.previous_revision.deleted and not revision.deleted %}
+{% trans "restored" %}
+{% endif %}
+{% if revision.locked %}
+{% trans "locked" %}
+{% endif %}
+{% if revision.previous_revision.locked and not revision.locked %}
+{% trans "unlocked" %}
+{% endif %}
diff --git a/pydis_site/templates/wiki/includes/searchresult.html b/pydis_site/templates/wiki/includes/searchresult.html
new file mode 100644
index 00000000..f6dd7a09
--- /dev/null
+++ b/pydis_site/templates/wiki/includes/searchresult.html
@@ -0,0 +1,22 @@
+{% load wiki_tags i18n humanize %}
+
+
+
+
+ {% for urlpath in article.urlpath_set.all %}
+ {{ article.current_revision.title }}/{{ urlpath.path }}
+ {% empty %}
+ {{ article.current_revision.title }}
+ {% endfor %}
+ {% if article.current_revision.deleted %}
+
+ {% endif %}
+ {% if article.current_revision.locked %}
+
+ {% endif %}
+ {{ article.render|get_content_snippet:search_query }}
+
+
+ {{ article.current_revision.created|naturaltime }}
+
+
diff --git a/pydis_site/templates/wiki/move.html b/pydis_site/templates/wiki/move.html
new file mode 100644
index 00000000..d93a3675
--- /dev/null
+++ b/pydis_site/templates/wiki/move.html
@@ -0,0 +1,66 @@
+{% extends "wiki/article.html" %}
+{% load wiki_tags i18n sekizai_tags %}
+
+{% block wiki_pagetitle %}{% trans "Move" %}: {{ article.current_revision.title }}{% endblock %}
+
+{% block wiki_contents_tab %}
+
+
+
+{% addtoblock "js" %}
+
+
+
+{% endaddtoblock %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/permission_denied.html b/pydis_site/templates/wiki/permission_denied.html
new file mode 100644
index 00000000..06afbbda
--- /dev/null
+++ b/pydis_site/templates/wiki/permission_denied.html
@@ -0,0 +1,32 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n %}
+
+
+{% block wiki_pagetitle %}Permission Denied{% endblock %}
+
+{% block wiki_contents %}
+
+
+
+ {% trans "Sorry, you don't have permission to access this page." %}
+
+ {% if article.current_revision.locked %}
+
+
+ {% trans "This article is locked for editing." %}
+
+ {% endif %}
+
+
+ {% if not read_denied %}
+
+ {% trans "Back to article" %}
+
+ {% elif urlpath.parent %}
+
+ {% trans "Back to article" %}
+
+ {% endif %}
+
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/preview_inline.html b/pydis_site/templates/wiki/preview_inline.html
new file mode 100644
index 00000000..77232753
--- /dev/null
+++ b/pydis_site/templates/wiki/preview_inline.html
@@ -0,0 +1,55 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n sekizai_tags static %}
+
+{% block wiki_body %}
+
+ {% if revision %}
+
+ {% trans "Previewing revision" %}:
+ {% include "wiki/includes/revision_info.html" %}
+
+ {% endif %}
+
+ {% if merge %}
+
+ {% trans "Previewing merge between" %}:
+ {% include "wiki/includes/revision_info.html" with revision=merge1 %}
+ {% trans "and" %}
+ {% include "wiki/includes/revision_info.html" with revision=merge2 %}
+
+ {% if merge1.deleted %}
+
+ {% trans "You cannot merge with a deleted revision" %}
+
+ {% endif %}
+ {% endif %}
+
+
+
+ {% if revision and revision.deleted %}
+
+
{% trans "This revision has been deleted." %}
+
{% trans "Restoring to this revision will mark the article as deleted." %}
+
+ {% else %}
+
+ {% wiki_render article content %}
+ {% for plugin in plugins %}
+ {% if plugin.RenderMedia.css %}
+ {% addtoblock "css" %}
+ {% for media, url in plugin.RenderMedia.css.items %}
+
+ {% endfor %}
+ {% endaddtoblock %}
+ {% endif %}
+ {% if plugin.RenderMedia.js %}
+ {% addtoblock "js" %}
+ {% for url in plugin.RenderMedia.js %}
+
+ {% endfor %}
+ {% endaddtoblock %}
+ {% endif %}
+ {% endfor %}
+ {% endif %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/root_missing.html b/pydis_site/templates/wiki/root_missing.html
new file mode 100644
index 00000000..0fb610ad
--- /dev/null
+++ b/pydis_site/templates/wiki/root_missing.html
@@ -0,0 +1,37 @@
+{% extends "wiki/create_root.html" %}
+{% load i18n wiki_tags %}
+
+{% block wiki_contents %}
+
+
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/search.html b/pydis_site/templates/wiki/search.html
new file mode 100644
index 00000000..080cf40d
--- /dev/null
+++ b/pydis_site/templates/wiki/search.html
@@ -0,0 +1,53 @@
+{% extends "wiki/base.html" %}
+{% load wiki_tags i18n humanize %}
+
+
+{% block wiki_pagetitle %}{% trans "Search results for:" %} {{ search_query }}{% endblock %}
+
+{% block wiki_contents %}
+
+
+
+
+
+
+
+
+ {% trans "Title" %}
+ {% trans "Last modified" %}
+
+ {% for article in articles %}
+ {% block wiki_search_loop %}
+ {% include "wiki/includes/searchresult.html" %}
+ {% endblock %}
+ {% empty%}
+
+
+ {% trans "There are no articles in this level" %}
+
+
+ {% endfor %}
+
+
+{% include "wiki/includes/pagination.html" %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/settings.html b/pydis_site/templates/wiki/settings.html
new file mode 100644
index 00000000..6d6c0f49
--- /dev/null
+++ b/pydis_site/templates/wiki/settings.html
@@ -0,0 +1,24 @@
+{% extends "wiki/article.html" %}
+{% load wiki_tags i18n %}
+
+
+{% block wiki_pagetitle %}{% trans "Settings" %}: {{ article.current_revision.title }}{% endblock %}
+
+{% block wiki_contents_tab %}
+
+ {% for form in forms %}
+
+ {% endfor %}
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/source.html b/pydis_site/templates/wiki/source.html
new file mode 100644
index 00000000..0c610208
--- /dev/null
+++ b/pydis_site/templates/wiki/source.html
@@ -0,0 +1,17 @@
+{% extends "wiki/article.html" %}
+{% load wiki_tags i18n humanize %}
+
+
+{% block wiki_pagetitle %}{% trans "Source of" %} {{ article.current_revision.title }}{% endblock %}
+
+{% block wiki_contents_tab %}
+
+{% if article.current_revision.locked %}
+{% trans "This article is currently locked for editing." %}
+{% endif %}
+
+
+ {{ article.current_revision.content }}
+
+
+{% endblock %}
diff --git a/pydis_site/templates/wiki/view.html b/pydis_site/templates/wiki/view.html
new file mode 100644
index 00000000..2becdaae
--- /dev/null
+++ b/pydis_site/templates/wiki/view.html
@@ -0,0 +1,9 @@
+{% extends "wiki/article.html" %}
+{% load wiki_tags i18n sekizai_tags %}
+
+
+{% block wiki_contents_tab %}
+
+ {% wiki_render article %}
+
+{% endblock %}
--
cgit v1.2.3
From 911f37e04c33c3b42c95da195b53f933c9c367f6 Mon Sep 17 00:00:00 2001
From: Gareth Coles
Date: Mon, 8 Apr 2019 15:45:14 +0100
Subject: Pushing before work is over
---
pydis_site/apps/home/urls.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pydis_site/apps/home/urls.py b/pydis_site/apps/home/urls.py
index ede0531e..4ed95651 100644
--- a/pydis_site/apps/home/urls.py
+++ b/pydis_site/apps/home/urls.py
@@ -7,5 +7,5 @@ app_name = 'home'
urlpatterns = [
path('admin/', admin.site.urls),
path('wiki/', include('wiki.urls')),
- path('/', TemplateView.as_view(template_name='home/index.html'), name='index'),
+ path('', TemplateView.as_view(template_name='home/index.html'), name='index'),
]
--
cgit v1.2.3
From a880a3441100b387e1171c79cbeff36d3aa8d445 Mon Sep 17 00:00:00 2001
From: Gareth Coles
Date: Wed, 10 Apr 2019 23:17:08 +0100
Subject: Some initial work on updating the wiki templates for Bulma
---
pydis_site/settings.py | 1 +
pydis_site/templates/wiki/base.html | 31 +++++++++++++-
pydis_site/templates/wiki/base_site.html | 14 +++++--
pydis_site/templates/wiki/create_root.html | 18 +-------
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 %}
+
+
+
+ {% wiki_messages %}
+
+ {% block wiki_breadcrumbs %}{% endblock %}
+
+
+ {% block wiki_contents %}{% endblock %}
+
+
+
+ {% 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 %}
+{% 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 %}
+
- {% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %} - django-\/\/ i K |{% endblock %}
+ Wiki | {% block wiki_pagetitle %}{% endblock %}{% block wiki_site_title %}{% endblock %}
@@ -149,8 +157,6 @@
-
-
{% endblock %}
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 %}
+ {% trans "Congratulations!" %}
- {% addtoblock "js" %}
- {% for js in editor.Media.js %}
-
- {% endfor %}
- {% endaddtoblock %}
-
- {% addtoblock "css" %}
- {% for media, srcs in editor.Media.css.items %}
- {% for src in srcs %}
-
- {% endfor %}
- {% endfor %}
- {% endaddtoblock %}
-
- {% trans "Congratulations!" %}
-
+
{% 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." %}
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 %}
-
-
-
-
-
-
{% trans "Congratulations!" %}
-
- {% trans "You have django-wiki installed and it seems to be working. But there are no articles yet." %}
-
-
- {% if not user.is_superuser %}
-
- {% 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." %}
-
- {% login_url as wiki_login_url %}
- {% if wiki_login_url %}
-
{% trans "Click here to login" %}
- {% endif %}
-
- {% else %}
-
-
- {% trans "But since you're logged in as a superuser, we should really get started..." %}
-
-
{% trans "Yes, I'll go and create the first article" %}
-
{% trans "No thanks, I'd rather read the documentation" %}
-
- {% endif %}
+
+
+
+
+
+
+ {% trans "You have django-wiki installed and it seems to be working. But there are no articles yet." %}
+
+
+ {% if not user.is_superuser %}
+
+ {% 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." %}
+
+
+ {% login_url as wiki_login_url %}
+
+ {% if wiki_login_url %}
+
+ {% endif %}
+ {% else %}
+
+ {% trans "But since you're logged in as a superuser, we should really get started..." %}
+
+
+
Create Article
+
Documentation
+ {% endif %}
+
+
+
-
-
{% endblock %}
--
cgit v1.2.3
From d44d5fcb91acbdb8e1d0684f223c9d6324a0c944 Mon Sep 17 00:00:00 2001
From: Gareth Coles
Date: Thu, 11 Apr 2019 19:32:21 +0100
Subject: Some work towards initial pages and forms
There's tons more to do here, ultimately
---
pydis_site/templates/wiki/create_root.html | 42 ++++++++++----
pydis_site/templates/wiki/includes/formfield.html | 67 ++++++++++++++++-------
pydis_site/templates/wiki/root_missing.html | 11 ++--
3 files changed, 84 insertions(+), 36 deletions(-)
diff --git a/pydis_site/templates/wiki/create_root.html b/pydis_site/templates/wiki/create_root.html
index 52f5ffb6..7b677d47 100644
--- a/pydis_site/templates/wiki/create_root.html
+++ b/pydis_site/templates/wiki/create_root.html
@@ -1,24 +1,42 @@
{% extends "wiki/base.html" %}
-{% load wiki_tags i18n sekizai_tags static %}
+{% load wiki_tags crispy_forms_tags i18n sekizai_tags static %}
{% block wiki_pagetitle %}{% trans "Create root article" %}{% endblock %}
{% block wiki_contents %}
- {% trans "Congratulations!" %}
-
-
- {% 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." %}
-
+
+
+
+
+
+
+ Please create the root article. This article will be available at the root of your wiki,
+ so consider creating a landing page here.
+
+
+ Please note that, to begin with, this article may only be modified by wiki administrators.
+ Once it's been created, you may edit the permissions and set up plugins, metadata, and so on.
+
+
+
+
+
-
+ {% trans "Root article" %}
diff --git a/pydis_site/templates/wiki/forms/fields/in_place_render.html b/pydis_site/templates/wiki/forms/fields/in_place_render.html
new file mode 100644
index 00000000..47e115fe
--- /dev/null
+++ b/pydis_site/templates/wiki/forms/fields/in_place_render.html
@@ -0,0 +1,31 @@
+
+
+ {% if field.label %}
+
+ IN PLACE RENDER: {{ field.label | safe }} {% if field.field.required %}* {% endif %}
+
+ {% endif %}
+
+ {% if field.help_text %}
+
+ {{ field.help_text|safe }}
+
+ {% endif %}
+
+
+
+
+
+ {{ field }}
+
+
+ {% if field.errors %}
+
+ {% for error in field.errors %}
+ {{ error }}
+ {% endfor %}
+
+ {% endif %}
+
+
+
diff --git a/pydis_site/templates/wiki/forms/fields/model_choice.html b/pydis_site/templates/wiki/forms/fields/model_choice.html
new file mode 100644
index 00000000..f1104b98
--- /dev/null
+++ b/pydis_site/templates/wiki/forms/fields/model_choice.html
@@ -0,0 +1,31 @@
+
+
+ {% if field.label %}
+
+ MODEL CHOICE: {{ field.label | safe }} {% if field.field.required %}* {% endif %}
+
+ {% endif %}
+
+ {% if field.help_text %}
+
+ {{ field.help_text|safe }}
+
+ {% endif %}
+
+
+
+
+
+ {{ field }}
+
+
+ {% if field.errors %}
+
+ {% for error in field.errors %}
+ {{ error }}
+ {% endfor %}
+
+ {% endif %}
+
+
+
diff --git a/pydis_site/templates/wiki/includes/formfield.html b/pydis_site/templates/wiki/includes/formfield.html
index 9f68fb26..c466719b 100644
--- a/pydis_site/templates/wiki/includes/formfield.html
+++ b/pydis_site/templates/wiki/includes/formfield.html
@@ -3,35 +3,5 @@
{% if field.is_hidden %}
{{ field }}
{% else %}
-
-
- {% if field.label %}
-
- {{ field.label | safe }} {% if field.field.required %}* {% endif %}
-
- {% endif %}
-
- {% if field.help_text %}
-
- {{ field.help_text|safe }}
-
- {% endif %}
-
-
-
-
-
- {% render_field field %}
-
-
- {% if field.errors %}
-
- {% for error in field.errors %}
- {{ error }}
- {% endfor %}
-
- {% endif %}
-
-
-
+ {% render_field field %}
{% endif %}
--
cgit v1.2.3
From a0ff872429a0a61239b78ecd9ed80bb3b12bae98 Mon Sep 17 00:00:00 2001
From: Gareth Coles
Date: Fri, 12 Apr 2019 16:00:03 +0100
Subject: Mostly-working model choice stuff
---
pydis_site/apps/home/templatetags/wiki_extra.py | 13 +++++++
.../templates/wiki/forms/fields/model_choice.html | 42 ++++++++++++++++++++--
pydis_site/templates/wiki/settings.html | 17 +++++----
3 files changed, 63 insertions(+), 9 deletions(-)
diff --git a/pydis_site/apps/home/templatetags/wiki_extra.py b/pydis_site/apps/home/templatetags/wiki_extra.py
index 03ca8210..6d693b96 100644
--- a/pydis_site/apps/home/templatetags/wiki_extra.py
+++ b/pydis_site/apps/home/templatetags/wiki_extra.py
@@ -75,3 +75,16 @@ def render_field(field: Field):
context = {"field": field, "is_markitup": is_markitup}
return mark_safe(template_obj.render(context))
+
+
+@register.simple_tag(takes_context=True)
+def get_field_options(context, field: BoundField):
+ widget = field.field.widget
+
+ if field.value() is None:
+ value = []
+ else:
+ value = [str(field.value())]
+
+ context["options"] = widget.optgroups(field.name, value)
+ return ""
diff --git a/pydis_site/templates/wiki/forms/fields/model_choice.html b/pydis_site/templates/wiki/forms/fields/model_choice.html
index f1104b98..c6cd53ab 100644
--- a/pydis_site/templates/wiki/forms/fields/model_choice.html
+++ b/pydis_site/templates/wiki/forms/fields/model_choice.html
@@ -1,8 +1,10 @@
+{% load wiki_extra %}
+
{% if field.label %}
- MODEL CHOICE: {{ field.label | safe }} {% if field.field.required %}* {% endif %}
+ {{ field.label | safe }} {% if field.field.required %}* {% endif %}
{% endif %}
@@ -16,7 +18,43 @@
- {{ field }}
+
+ {% get_field_options field %}
+
+
+ {% if options %}
+ {% for group_name, group_choices, group_index in options %}
+ {% if group_name %}
+
+ {% endif %}
+ {% for option in group_choices %}
+
+ {{ option.label }}
+
+ {% endfor %}
+ {% if group_name %}
+
+ {% endif %}
+ {% endfor %}
+ {% else %}
+
+ {% if field.field.empty_label %}
+ {{ field.field.empty_label }}
+ {% else %}
+ N/A
+ {% endif %}
+
+ {% endif %}
+
+
+
{% if field.errors %}
diff --git a/pydis_site/templates/wiki/settings.html b/pydis_site/templates/wiki/settings.html
index 6d6c0f49..3e8c8dab 100644
--- a/pydis_site/templates/wiki/settings.html
+++ b/pydis_site/templates/wiki/settings.html
@@ -7,15 +7,18 @@
{% block wiki_contents_tab %}
{% for form in forms %}
-
+
{% wiki_form form %}
-