Se modifico un poco el layout y la opcion de cambiar la categoria
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{% block title %}about{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>About This</h3>
|
||||
<h4>About This</h4>
|
||||
<p>This page is a simple static file server mainly for things that i want to link in my main webpage. If for some reason, one of the files uploaded here belongs to you, and you dont want it here, send me a message and I will contact you.</p>
|
||||
|
||||
{% for message in get_flashed_messages() %}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<body>
|
||||
<nav class="navbar">
|
||||
<div class="container">
|
||||
<a href="{{ url_for('index') }}" class="nav-brand">/files</a>
|
||||
<a href="{{ url_for('index') }}" class="h1 nav-brand">/files</a>
|
||||
<a href="{{ url_for('categories.index') }}" class="nav-link">/categories</a>
|
||||
<a href="{{ url_for('about') }}" class="nav-link">/about</a>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Categories{% endblock %}
|
||||
{% block title %}categories/create{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>Create a new Category</h3>
|
||||
<h3>Create category</h3>
|
||||
<form method="post">
|
||||
<label for="name">~/name</label>
|
||||
<input type="text" class="u-full-width" name="name" id="name">
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}category{% endblock %}
|
||||
{% block title %}categories{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h4>Categories</h4>
|
||||
<div class="grid">
|
||||
{% for category in categories %}
|
||||
<a href="{{ url_for('categories.view', id=category.id) }}">{{ category.name }}</a>
|
||||
@@ -10,4 +11,3 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
{% block title %}categories/view/{{ category.name }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h3>{{ category.name }}</h3>
|
||||
<h4>{{ category.name }}</h4>
|
||||
<div class="grid">
|
||||
{% for file in files %}
|
||||
<a href="{{ url_for('files.preview_file', id=file.id) }}">{{ file.filename }}</a>
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
{% block content %}
|
||||
<div class="grid">
|
||||
{% for file in files %}
|
||||
<a href="{{ url_for('files.preview_file', id=file.id) }}">{{ file.filename}}</a>
|
||||
<div>
|
||||
<a href="{{ url_for('files.preview_file', id=file.id) }}">{{ file.filename}}</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -9,16 +9,37 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
<h3 class="u-pull-left"><a href="{{ url_for('files.uploaded_file', filename=file.filename) }}">{{ file.filename }}</a></h3>
|
||||
<h4 class="u-pull-left">
|
||||
<a href="{{ url_for('files.uploaded_file', filename=file.filename) }}">{{ file.filename }}</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<img src="{{ url_for('files.uploaded_file', filename=file.filename) }}">
|
||||
<img class="preview" src="{{ url_for('files.uploaded_file', filename=file.filename) }}">
|
||||
|
||||
{% if g.user %}
|
||||
<form action="{{ url_for('files.rename_file', id=file.id) }}" method="post">
|
||||
<label for="new_name">~/rename</label>
|
||||
<input type="text" class="u-full-width" id="new_name" name="new_name" value="{{ file.filename }}">
|
||||
<input type="submit" class="button-primary u-pull-right" value="rename">
|
||||
<div class="row">
|
||||
<label for="new_name">~/rename</label>
|
||||
<div class="nine columns">
|
||||
<input type="text" class="u-full-width" id="new_name" name="new_name" value="{{ file.filename }}">
|
||||
</div>
|
||||
<div class="two columns">
|
||||
<input type="submit" class="button-primary" value="rename">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form action="{{ url_for('files.recategorize', id=file.id) }}" method="post">
|
||||
<label for="new_category">~/category</label>
|
||||
<div class="nine columns">
|
||||
<select class="u-full-width" name="new_category" id="new_category">
|
||||
{% for category in categories %}
|
||||
<option value="{{ category.id }}" {{ 'selected' if category.id == file.category_id }}>{{ category.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="two columns">
|
||||
<input type="submit" class="button-primary" value="change category">
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
{% block title %}upload{% endblock %}
|
||||
|
||||
{% 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">
|
||||
|
||||
Reference in New Issue
Block a user