Creado panel de administracion

En el, el administrador puede
    -subir un nuevo archivo
    -crear una categorio
    -renombrar una categoria
    - eliminar una categoria

A medida que me valla naciendo ire haciendo mas controles
This commit is contained in:
Daniel Cortes
2019-03-12 18:26:55 -03:00
parent 7b7fd0301d
commit 6437ea151e
8 changed files with 119 additions and 64 deletions

View File

@@ -3,5 +3,18 @@
{% block title %}admin{% endblock %}
{% block content %}
<h4>Hi!</h4>
<h3>Admin Panel</h3>
<hr>
<h4>Files</h4>
{% include 'files/upload.html' %}
<hr>
<h4>Categories</h4>
{% include 'categories/create.html' %}
{% include 'categories/rename.html' %}
{% include 'categories/delete.html' %}
{% endblock %}

View File

@@ -1,12 +1,6 @@
{% extends 'base.html' %}
{% block title %}categories/create{% endblock %}
{% block content %}
<h3>Create category</h3>
<form method="post">
<label for="name">~/name</label>
<input type="text" class="u-full-width" name="name" id="name">
<input type="submit" class="button-primary" value="create">
</form>
{% endblock %}
<h5>Create category</h5>
<form action="{{ url_for('categories.create') }}" method="post">
<label for="category.create.name">~/name</label>
<input type="text" class="u-full-width" name="category.create.name" id="category.create.name">
<input type="submit" class="button-primary" value="create">
</form>

View File

@@ -0,0 +1,10 @@
<h5>Delete category</h5>
<form action="{{ url_for('categories.delete') }}" method="post">
<label for="category">~/category</label>
<select class="u-full-width" name="category.rename.category" id="category.rename.category">
{% for category in categories %}
<option value="{{ category.id }}">{{ category.name }}</option>
{% endfor %}
</select>
<input type="submit" class="button-primary" value="Delete">
</form>

View File

@@ -0,0 +1,12 @@
<h5>Rename category</h5>
<form action="{{ url_for('categories.rename') }}" method="post">
<label for="category">~/category</label>
<select class="u-full-width" name="category.rename.category" id="category.rename.category">
{% for category in categories %}
<option value="{{ category.id }}">{{ category.name }}</option>
{% endfor %}
</select>
<label for="category.rename.name">~/name</label>
<input type="text" class="u-full-width" name="category.rename.name" id="category.rename.name">
<input type="submit" class="button-primary" value="Rename">
</form>

View File

@@ -1,31 +1,25 @@
{% extends 'base.html' %}
<h5>Upload File</h5>
{% block title %}upload{% endblock %}
<form action="{{ url_for('files.upload_file' )}}" method="post" enctype="multipart/form-data">
<label for="file.upload.file">~/file</label>
<input type="file" class="u-full-width" name="file.upload.file" id="file.upload.file">
<label for="file.upload.category">~/category</label>
<select class="u-full-width" name="file.upload.category" id="file.upload.category">
{% for category in categories %}
<option value="{{ category.id }}">{{ category.name }}</option>
{% endfor %}
</select>
<label for="file.upload.file_type">~/file-type</label>
<select class="u-full-width" name="file.upload.file_type" id="file.upload.file_type">
{% for file_type in file_types %}
<option value="{{ file_type.id }}">{{ file_type.name }}</option>
{% endfor %}
</select>
<label for="file.upload.private">~/private</label>
<label>
<input type="checkbox" name="file.upload.private" id="file.upload.private">
</label>
{% block content %}
<h4>Upload</h4>
<form method="post" enctype="multipart/form-data">
<label for="file">~/file</label>
<input type="file" class="u-full-width" name="file" id="file">
<label for="category">~/category</label>
<select class="u-full-width" name="category" id="category">
{% for category in categories %}
<option value="{{ category.id }}">{{ category.name }}</option>
{% endfor %}
</select>
<label for="file_type">~/file-type</label>
<select class="u-full-width" name="file_type" id="file_type">
{% for file_type in file_types %}
<option value="{{ file_type.id }}">{{ file_type.name }}</option>
{% endfor %}
</select>
<label for="private">~/private</label>
<label>
<input type="checkbox" name="private" id="private">
</label>
<input type="submit" class="button-primary" value="upload">
</form>
{% endblock %}
<input type="submit" class="button-primary" value="upload">
</form>