diff --git a/core/static/core/script.js b/core/static/core/script.js new file mode 100644 index 00000000..78828edb --- /dev/null +++ b/core/static/core/script.js @@ -0,0 +1 @@ +console.log('Guy'); diff --git a/core/static/core/style.css b/core/static/core/style.css new file mode 100644 index 00000000..5be8aa85 --- /dev/null +++ b/core/static/core/style.css @@ -0,0 +1,3 @@ +body { + background: #EEE; +} diff --git a/core/templates/core/api/markdown.html b/core/templates/core/api/markdown.html new file mode 100644 index 00000000..fafcdb01 --- /dev/null +++ b/core/templates/core/api/markdown.html @@ -0,0 +1,4 @@ +{% load renderer %} + +{{ text|markdown }} + diff --git a/core/templates/core/base.html b/core/templates/core/base.html index eeec42e9..2045959e 100644 --- a/core/templates/core/base.html +++ b/core/templates/core/base.html @@ -1,8 +1,12 @@ +{% load staticfiles %} - + {% block head %} {% block title %}Bienvenue sur le Sith de l'AE!{% endblock %} + + + {% endblock %} diff --git a/core/templates/core/pagerev_edit.html b/core/templates/core/pagerev_edit.html index fa0f8bc4..679e3e17 100644 --- a/core/templates/core/pagerev_edit.html +++ b/core/templates/core/pagerev_edit.html @@ -1,10 +1,15 @@ {% extends "core/page.html" %} +{% block head %} +{{ block.super }} +{% endblock %} + {% block page %}

Edit page

{% csrf_token %} {{ form.as_p }} + {# TODO: NOW THAT WE HAVE JAVASCRIPT, MAKE A PREVISUALISATION BUTTON USING api/markdown?text=guyguyguy #}

{% endblock %} diff --git a/core/urls.py b/core/urls.py index d65a8716..73a8a5ad 100644 --- a/core/urls.py +++ b/core/urls.py @@ -34,5 +34,8 @@ urlpatterns = [ url(r'^page/(?P[a-z0-9/\-_]*)/hist$', PageHistView.as_view(), name='page_hist'), url(r'^page/(?P[a-z0-9/\-_]*)/rev/(?P[0-9]+)/', PageRevView.as_view(), name='page_rev'), url(r'^page/(?P[a-z0-9/\-_]*)/$', PageView.as_view(), name='page'), + + # API + url(r'^api/markdown$', render_markdown, name='api_markdown'), ] diff --git a/core/views/__init__.py b/core/views/__init__.py index 14870a2b..b249f1ae 100644 --- a/core/views/__init__.py +++ b/core/views/__init__.py @@ -62,4 +62,5 @@ from .user import * from .page import * from .site import * from .group import * +from .api import * diff --git a/core/views/api.py b/core/views/api.py new file mode 100644 index 00000000..c7a9d8b2 --- /dev/null +++ b/core/views/api.py @@ -0,0 +1,4 @@ +from django.shortcuts import render + +def render_markdown(request): + return render(request, 'core/api/markdown.html', context={'text': request.GET['text']})