mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
Add a begining of API and CSS+JS (static files folder)
This commit is contained in:
parent
f5b07887a5
commit
771056d6e4
1
core/static/core/script.js
Normal file
1
core/static/core/script.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
console.log('Guy');
|
3
core/static/core/style.css
Normal file
3
core/static/core/style.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
body {
|
||||||
|
background: #EEE;
|
||||||
|
}
|
4
core/templates/core/api/markdown.html
Normal file
4
core/templates/core/api/markdown.html
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{% load renderer %}
|
||||||
|
|
||||||
|
{{ text|markdown }}
|
||||||
|
|
@ -1,8 +1,12 @@
|
|||||||
|
{% 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>
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
{% 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 = [
|
|||||||
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 *
|
|||||||
from .page import *
|
from .page import *
|
||||||
from .site import *
|
from .site import *
|
||||||
from .group import *
|
from .group import *
|
||||||
|
from .api import *
|
||||||
|
|
||||||
|
4
core/views/api.py
Normal file
4
core/views/api.py
Normal file
@ -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']})
|
Loading…
Reference in New Issue
Block a user