Initial commit
This commit is contained in:
8
templates/add_article.html
Normal file
8
templates/add_article.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<form action="/article/add/{{ blog_id }}" method="post">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="add" value="Add" /><input type="submit" name="preview" value="Preview" /><input type="submit" name="cancel" value="Cancel" />
|
||||
</form>
|
||||
{% endblock %}
|
9
templates/add_blog.html
Normal file
9
templates/add_blog.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<form action="/blog/add" method="post">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="add" value="Add" />
|
||||
<input type="submit" name="cancel" value="Cancel" />
|
||||
</form>
|
||||
{% endblock %}
|
9
templates/add_category.html
Normal file
9
templates/add_category.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<form action="/category/add" method="post">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="add" value="Add" />
|
||||
<input type="submit" name="cancel" value="Cancel" />
|
||||
</form>
|
||||
{% endblock %}
|
9
templates/add_user.html
Normal file
9
templates/add_user.html
Normal file
@@ -0,0 +1,9 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<form action="/user/add" method="post">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="add" value="Add" />
|
||||
<input type="submit" name="cancel" value="Cancel" />
|
||||
</form>
|
||||
{% endblock %}
|
9
templates/base.html
Normal file
9
templates/base.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Dynastie</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="/user">Users</a> <a href="/blog">Blogs</a> <a href="/category">Categories</a> <a href="/disconnect">Disconnect</a><br/><br/>
|
||||
{% block content %} {% endblock %}
|
||||
</body>
|
||||
</html>
|
14
templates/blog.html
Normal file
14
templates/blog.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% if blogs|length == 0 %}
|
||||
<b>Any blog available</b><br/><br/>
|
||||
{% else %}
|
||||
{% for blog in blogs %}
|
||||
<li><a href="/blog/{{ blog.id }}">{{ blog.name }} : {{ blog.title }}</a></li>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if user.is_superuser %}
|
||||
<li><a href="/blog/add">Add a blog</a></li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
16
templates/category.html
Normal file
16
templates/category.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<table>
|
||||
{% if categories|length == 0 %}
|
||||
<b>Any category available</b><br/><br/>
|
||||
{% else %}
|
||||
{% for category in categories %}
|
||||
<hr><hl>{{ category.id }}</hl><hl>{{ category.name }}</hl><hl><a href="/category/edit/{{ category.id }}">Edit</a></hl>{% if user.is_superuser %}<hl><a href="/category/delete/{{ category.id }}">Delete</a></hl>{% endif %}</hr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if user.is_superuser %}
|
||||
<li><a href="/category/add">Add a category</a></li>
|
||||
{% endif %}
|
||||
</table>
|
||||
{% endblock %}
|
8
templates/edit_article.html
Normal file
8
templates/edit_article.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<form action="/article/edit/{{ article_id }}" method="post">{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="edit" value="Edit" /><input type="submit" name="cancel" value="Cancel" />
|
||||
</form>
|
||||
{% endblock %}
|
13
templates/edit_category.html
Normal file
13
templates/edit_category.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<form action="/category/edit/{{ category.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
{% if user.is_superuser %}
|
||||
<input type="submit" name="edit" value="Edit" />
|
||||
{% else %}
|
||||
<input type="submit" name="cancel" value="Cancel" />
|
||||
{% endif %}
|
||||
</form>
|
||||
{% endblock %}
|
13
templates/edit_user.html
Normal file
13
templates/edit_user.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% if user.is_superuser or user.id == user_to_edit.id %}
|
||||
<form action="/user/edit/{{ user_to_edit.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="edit" value="Edit" /><input type="submit" name="cancel" value="Cancel" />
|
||||
</form>
|
||||
{% else %}
|
||||
{{ form.as_p }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
2
templates/footer.html
Normal file
2
templates/footer.html
Normal file
@@ -0,0 +1,2 @@
|
||||
</body>
|
||||
</html>
|
6
templates/header.html
Normal file
6
templates/header.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Dynastie</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="/users">Users</a> <a href="/blog">Blogs</a> <a href="/disconnect">Disconnect</a><br/><br/>
|
18
templates/index.html
Normal file
18
templates/index.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<html xmlns:dyn="http://indefero.soutade.fr/p/dynastie">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="robots" content="index, follow"/>
|
||||
<meta name="keywords" content="blog, gregory, soutade, grégory, soutadé, Grégory, Soutadé"/>
|
||||
<meta name="description" content="Bolg de Grégory Soutadé"/>
|
||||
<meta name="generator" content="Joomla! 1.5 - Open Source Content Management"/>
|
||||
<title>Blog de Grégory Soutadé</title>
|
||||
</head>
|
||||
<body>
|
||||
<dyn:title/>
|
||||
<dyn:author/>
|
||||
<dyn:date/>
|
||||
<dyn:content/>
|
||||
<title>Another title</title>
|
||||
</body>
|
||||
</html>
|
57
templates/login.html
Normal file
57
templates/login.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Dynastie</title>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/jsaes.js"></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/sha256.js"/></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}js/base64.js"/></script>
|
||||
<script type="text/javascript" language="javascript">
|
||||
<!--
|
||||
function encryptPassword()
|
||||
{
|
||||
var password = "{{ auth_key }};
|
||||
var plaintext = Sha256.hash(document.getElementById("password").value, false);
|
||||
//AES_Init();
|
||||
//AES_ExpandKey(password);
|
||||
//AES_Encrypt(plaintext, password);
|
||||
document.getElementById("password").value = Base64.encode(plaintext);
|
||||
//AES_Done();
|
||||
document.forms[0].submit();
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
<style type="text/css">
|
||||
div.logo {
|
||||
margin-top:2%;
|
||||
margin-bottom:5%;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
div.form {
|
||||
margin-left:40%;
|
||||
}
|
||||
|
||||
#login_failed {
|
||||
color:red;
|
||||
font-weight:bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="logo">
|
||||
<img src="{{ STATIC_URL }}images/logo.png"/>
|
||||
</div>
|
||||
<div class="form">
|
||||
<form method="post" action="/index" onSubmit="encryptPassword()">
|
||||
{% csrf_token %}
|
||||
{% if login_failed %} <p id="login_failed">Login or password is invalid</p> {% endif %}
|
||||
<table>
|
||||
<tr><td>Login</td><td><input type="text" name="login"/></td></tr>
|
||||
<tr><td>Password</td><td><input id="password" type="password" name="password"/></td></tr>
|
||||
<tr><td/><td><input type="submit" value="Connect"/></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
18
templates/user.html
Normal file
18
templates/user.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% if users|length == 0 %}
|
||||
<b>Any user available</b><br/><br/>
|
||||
{% else %}
|
||||
{% for user in users %}
|
||||
{% if user.first_name|length != 0 or user.last_name|length != 0%}
|
||||
<li><a href="/user/{{ user.id }}">{{ user.first_name }} {{ user.last_name }}</a></li>
|
||||
{% else %}
|
||||
<li><a href="/user/{{ user.id }}">{{ user.login }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if user.is_superuser %}
|
||||
<li><a href="/user/add">Add a user</a></li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
23
templates/view_blog.html
Normal file
23
templates/view_blog.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{% if user.is_superuser %}
|
||||
<form action="/blog/edit/{{ blog.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
{{ form.as_p }}
|
||||
<input type="submit" name="edit" value="Edit" /><input type="submit" name="delete" value="Delete" />
|
||||
</form>
|
||||
{% endif %}
|
||||
<br/><br/>
|
||||
<a href="/article/add/{{ blog.id }}">Add an article</a>
|
||||
{% if articles|length == 0 %}
|
||||
<br/><br/>
|
||||
<b>Any article available</b><br/><br/>
|
||||
{% else %}
|
||||
<table>
|
||||
{% for article in articles %}
|
||||
<hr><hl><a href="/article/edit/{{ article.id }}">{{ article.id }}</a></hl><hl>{{ article.title }}</hl><hl>{{ article.category.name }}</hl><hl>{{ article.creation_date }}</hl><hl>{{ article.published }}</hl><hl>{{ article.front_page }}</hl><hl><a href="/article/delete/{{ article.id }}">Delete</a></hl></hr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</table>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user