|
@@ -1,31 +1,28 @@
|
|
|
{% extends "layout/backend.j2" %}
|
|
|
{% block content %}
|
|
|
-<h1>Edit: {{ page.title }}</h1>
|
|
|
-<form method="post">
|
|
|
- <div class="form-group">
|
|
|
- <label class="text-normal text-dark">title</label>
|
|
|
- <input type="text" class="form-control" name="title" placeholder="title" value="{{ page.title }}">
|
|
|
+<h1>Edit: {{ file.title }}</h1>
|
|
|
+<div class="row">
|
|
|
+ <div class="col-sm">
|
|
|
+ <form method="post" enctype="multipart/form-data">
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="text-normal text-dark">Title</label>
|
|
|
+ <input type="text" class="form-control" name="title" placeholder="title" value="{{ file.title }}">
|
|
|
+ </div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label class="text-normal text-dark">File</label>
|
|
|
+ <input type="file" class="form-control-file" name="file">
|
|
|
+ </div>
|
|
|
+ <div class="form-group float-right">
|
|
|
+ <button class="btn btn-primary">Save</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
</div>
|
|
|
- <div class="form-group">
|
|
|
- <label class="text-normal text-dark">Source</label>
|
|
|
- <textarea class="form-control" name="source">{{ page.source }}</textarea>
|
|
|
+ <div class="col-sm">
|
|
|
+ {% if file.is_image() %}
|
|
|
+ <img src="/static/uploads/{{ file.path }}" alt="{{ file.title }}" class="img-thumbnail">
|
|
|
+ {% else %}
|
|
|
+ <a href="/static/uploads/{{ file.path }}">{{ file.title }}</a>
|
|
|
+ {% endif %}
|
|
|
</div>
|
|
|
- <div class="form-group">
|
|
|
- <label class="text-normal text-dark">Parent</label>
|
|
|
- <select class="form-control" name="parent_id">
|
|
|
- <option></option>
|
|
|
- {% for parent_page in pages %}
|
|
|
- {% if parent_page.id == page.parent_id %}
|
|
|
- <option value="{{ parent_page.id }}" selected>{{ parent_page.title }}</option>
|
|
|
- {% else %}
|
|
|
- <option value="{{ parent_page.id }}">{{ parent_page.title }}</option>
|
|
|
- {% endif %}
|
|
|
- {% endfor %}
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="form-group pull-right">
|
|
|
- <button class="btn btn-primary">Save</button>
|
|
|
- </div>
|
|
|
-</form>
|
|
|
-<p>{{ page.content() }}</p>
|
|
|
+</div>
|
|
|
{% endblock %}
|