Commit 771056d6 authored by Skia's avatar Skia
Browse files

Add a begining of API and CSS+JS (static files folder)

parent f5b07887
console.log('Guy');
body {
background: #EEE;
}
{% load renderer %}
{{ text|markdown }}
{% load staticfiles %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="fr"> <html lang="fr">
<head> <head>
<link rel="stylesheet" href="style.css" /> {% block head %}
<title>{% block title %}Bienvenue sur le Sith de l'AE!{% endblock %}</title> <title>{% block title %}Bienvenue sur le Sith de l'AE!{% endblock %}</title>
<link rel="stylesheet" href="{% static 'core/style.css' %}">
<script src="{% static 'core/script.js' %}"></script>
{% endblock %}
</head> </head>
<body> <body>
......
{% extends "core/page.html" %} {% extends "core/page.html" %}
{% block head %}
{{ block.super }}
{% endblock %}
{% block page %} {% block page %}
<h2>Edit page</h2> <h2>Edit page</h2>
<form action="{% url 'core:page_edit' page_name=page.get_full_name %}" method="post"> <form action="{% url 'core:page_edit' page_name=page.get_full_name %}" method="post">
{% csrf_token %} {% csrf_token %}
{{ form.as_p }} {{ form.as_p }}
{# TODO: NOW THAT WE HAVE JAVASCRIPT, MAKE A PREVISUALISATION BUTTON USING api/markdown?text=guyguyguy #}
<p><input type="submit" value="Save!" /></p> <p><input type="submit" value="Save!" /></p>
</form> </form>
{% endblock %} {% endblock %}
......
...@@ -34,5 +34,8 @@ urlpatterns = [ ...@@ -34,5 +34,8 @@ urlpatterns = [
url(r'^page/(?P<page_name>[a-z0-9/\-_]*)/hist$', PageHistView.as_view(), name='page_hist'), url(r'^page/(?P<page_name>[a-z0-9/\-_]*)/hist$', PageHistView.as_view(), name='page_hist'),
url(r'^page/(?P<page_name>[a-z0-9/\-_]*)/rev/(?P<rev>[0-9]+)/', PageRevView.as_view(), name='page_rev'), url(r'^page/(?P<page_name>[a-z0-9/\-_]*)/rev/(?P<rev>[0-9]+)/', PageRevView.as_view(), name='page_rev'),
url(r'^page/(?P<page_name>[a-z0-9/\-_]*)/$', PageView.as_view(), name='page'), url(r'^page/(?P<page_name>[a-z0-9/\-_]*)/$', PageView.as_view(), name='page'),
# API
url(r'^api/markdown$', render_markdown, name='api_markdown'),
] ]
...@@ -62,4 +62,5 @@ from .user import * ...@@ -62,4 +62,5 @@ from .user import *
from .page import * from .page import *
from .site import * from .site import *
from .group import * from .group import *
from .api import *
from django.shortcuts import render
def render_markdown(request):
return render(request, 'core/api/markdown.html', context={'text': request.GET['text']})
Supports Markdown
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