Commit 2a3dfb11 by alexandre

Flat pages help

parent ecb1b411
......@@ -26,6 +26,8 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.flatpages',
'guardian',
'adminsortable2',
......@@ -47,6 +49,8 @@ INSTALLED_APPS = [
'compressor',
'playground',
'ckeditor',
]
MIDDLEWARE = [
......@@ -152,6 +156,30 @@ COMPRESS_CSS_FILTERS = [
ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL = "/compte"
CKEDITOR_CONFIGS = {
'default': {
'extraPlugins': ','.join([
'codesnippet',
]),
'toolbar': 'Custom',
'toolbar_Custom': [
['Format'],
# ['Pull-out', 'Sidebar', 'Footer'],
['Bold', 'Italic', '-', 'Subscript', 'Superscript'],
['CodeSnippet'],
['BulletedList', 'NumberedList', '-', 'Outdent', 'Indent', '-', ''],
['Link', 'Unlink', 'Image'],
['RemoveFormat', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'],
['Find', 'Replace', 'SpecialChar'],
['Source', 'Maximize'
# ,'Footnotes'
#'Filer Image'
],
],
},
}
try:
LOCAL_SETTINGS
except NameError:
......
{% load static compress %}
<!DOCTYPE html>
<html>
<head>
<title>{{ flatpage.title }}</title>
<link rel="stylesheet" href="{% static 'playground/vendors/reset.css' %}">
<link rel="stylesheet" type="text/css" href="{% static 'playground/css/styles.css' %}">
{% compress css %}
{% endcompress %}
</head>
<body class="help__content">
{% load flatpages %}
{% get_flatpages as flatpages %}
<ul>
{% for page in flatpages|dictsort:"title" %}
<li><a href="/pages/{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
</ul>
{{ flatpage.content }}
</body>
</html>
......@@ -41,5 +41,7 @@ urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + [
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
url(r'^rest-auth/', include('rest_auth.urls')),
url(r'pages/', include('django.contrib.flatpages.urls')),
url(r'^', include('playground.urls')),
]
......@@ -20,3 +20,18 @@ class ScoreAdmin(GuardedModelAdmin):
admin.site.register(FeaturedScore, FeaturedScoreAdmin)
admin.site.register(Attachment, AttachmentAdmin)
admin.site.register(Score, ScoreAdmin)
from django.contrib.flatpages.admin import FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
from django.db import models
from ckeditor.widgets import CKEditorWidget
class FlatPageCustom(FlatPageAdmin):
formfield_overrides = {
models.TextField: {'widget': CKEditorWidget}
}
admin.site.unregister(FlatPage)
admin.site.register(FlatPage, FlatPageCustom)
......@@ -991,14 +991,26 @@ li li li li li li li li li li li li li li form { color: var(--color-14); }
background-color: darkgray;
}
.help__content {
.help__frame {
overflow: auto;
width: 500px;
padding: 30px;
height: 100%;
}
#help.is-collapsed .help__content { display: none; }
#help.is-collapsed .help__frame { display: none; }
.help__content {
padding: 30px;
color: #173a42;
background-color: white;
}
.help__content h2 { margin-top: 28pt; text-align: center; margin-bottom: 14pt; }
.help__content p + p { margin-top: 14pt; }
.help__content li:before { content: "– "; }
......
......@@ -10,3 +10,4 @@ django-taggit-serializer
django-admin-sortable2
django-guardian
django-allauth
django-ckeditor
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment