Youen
2 years ago
6 changed files with 75 additions and 6 deletions
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html> |
||||
<html lang="fr"> |
||||
|
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<title>Documentation (admin)</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<h1>Administration des documents</h1> |
||||
<a href="">Nouveau document...</a> |
||||
<h2>Liste des documents</h2> |
||||
<ul> |
||||
{% for doc in documents %} |
||||
{% if doc.valid %} |
||||
<li>{{ doc.doc_name }} / {{ doc.branch }} <a href="{{ doc.get_url() }}">Consulter</a></li> |
||||
{% else %} |
||||
<li>{{ doc.doc_name }} / {{ doc.branch }} (document invalide)</li> |
||||
{% endif %} |
||||
{% endfor %} |
||||
</ul> |
||||
|
||||
<script type="text/javascript" src="/static/index.js"></script> |
||||
</body> |
@ -0,0 +1,9 @@
|
||||
from flask import Blueprint, render_template |
||||
|
||||
from data.document import Document |
||||
|
||||
bp = Blueprint('web_admin', __name__, url_prefix='/admin') |
||||
|
||||
@bp.route('/') |
||||
def index(): |
||||
return render_template("index.html", documents=Document.list()) |
@ -0,0 +1,12 @@
|
||||
import os |
||||
from flask import Blueprint, render_template, send_from_directory |
||||
from data.document import get_document_root |
||||
|
||||
from data.document import Document |
||||
|
||||
bp = Blueprint('web_document', __name__, url_prefix='/doc') |
||||
|
||||
@bp.route('/<doc_name>/<branch>/<path:path>') |
||||
def index(doc_name, branch, path): |
||||
doc = Document(doc_name, branch) |
||||
return send_from_directory(doc.doc_path + "/build/html", path) |
Loading…
Reference in new issue