Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
771056d6
Commit
771056d6
authored
Jan 08, 2016
by
Skia
Browse files
Add a begining of API and CSS+JS (static files folder)
parent
f5b07887
Changes
8
Hide whitespace changes
Inline
Side-by-side
core/static/core/script.js
0 → 100644
View file @
771056d6
console
.
log
(
'
Guy
'
);
core/static/core/style.css
0 → 100644
View file @
771056d6
body
{
background
:
#EEE
;
}
core/templates/core/api/markdown.html
0 → 100644
View file @
771056d6
{% load renderer %}
{{ text|markdown }}
core/templates/core/base.html
View file @
771056d6
{% load staticfiles %}
<!DOCTYPE html>
<html
lang=
"fr"
>
<head>
<link
rel=
"stylesheet"
href=
"style.css"
/>
{% block head %}
<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>
<body>
...
...
core/templates/core/pagerev_edit.html
View file @
771056d6
{% extends "core/page.html" %}
{% block head %}
{{ block.super }}
{% endblock %}
{% block page %}
<h2>
Edit page
</h2>
<form
action=
"{% url 'core:page_edit' page_name=page.get_full_name %}"
method=
"post"
>
{% csrf_token %}
{{ 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>
</form>
{% endblock %}
...
...
core/urls.py
View file @
771056d6
...
...
@@ -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/\-_]*)/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'
),
# API
url
(
r
'^api/markdown$'
,
render_markdown
,
name
=
'api_markdown'
),
]
core/views/__init__.py
View file @
771056d6
...
...
@@ -62,4 +62,5 @@ from .user import *
from
.page
import
*
from
.site
import
*
from
.group
import
*
from
.api
import
*
core/views/api.py
0 → 100644
View file @
771056d6
from
django.shortcuts
import
render
def
render_markdown
(
request
):
return
render
(
request
,
'core/api/markdown.html'
,
context
=
{
'text'
:
request
.
GET
[
'text'
]})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment