diff options
author | romangraef <roman.graef@gmail.com> | 2018-06-01 15:49:55 +0200 |
---|---|---|
committer | romangraef <roman.graef@gmail.com> | 2018-06-01 15:49:55 +0200 |
commit | 7bed1685b66f126b7130e43304ad8f53f69a3aff (patch) | |
tree | f7a12a3f722bc48d0e03f08aa574b4966ba960f4 /templates | |
parent | a4717724853ce92888c8aa6c082a25428e00720b (diff) | |
download | my-website-7bed1685b66f126b7130e43304ad8f53f69a3aff.tar.gz my-website-7bed1685b66f126b7130e43304ad8f53f69a3aff.tar.bz2 my-website-7bed1685b66f126b7130e43304ad8f53f69a3aff.zip |
Enhanced editing and a bnit of more admin links.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.html | 14 | ||||
-rw-r--r-- | templates/delete.html | 12 | ||||
-rw-r--r-- | templates/edit_project.html | 3 | ||||
-rw-r--r-- | templates/gallery.html | 9 | ||||
-rw-r--r-- | templates/login.html | 2 | ||||
-rw-r--r-- | templates/new.html | 1 | ||||
-rw-r--r-- | templates/project.html | 6 | ||||
-rw-r--r-- | templates/project_fields.html | 1 |
8 files changed, 42 insertions, 6 deletions
diff --git a/templates/base.html b/templates/base.html index 99a419b..9f45c87 100644 --- a/templates/base.html +++ b/templates/base.html @@ -16,5 +16,19 @@ No content found. THIS IS AN ERROR {% endblock %} </div> +<div class="footer"> + <a href="/">Home</a> + • + {% if admin %} + <a href="{{ url_for('logout') }}">Admin logout</a> + • + <a href="{{ url_for('new_project_form') }}">New Project</a> + {% block admin_footer %}{% endblock %} + {% else %} + <a href="{{ url_for('login') }}">Admin login</a> + {% endif %} + {% block footer %} + {% endblock %} +</div> </body> </html>
\ No newline at end of file diff --git a/templates/delete.html b/templates/delete.html new file mode 100644 index 0000000..2641260 --- /dev/null +++ b/templates/delete.html @@ -0,0 +1,12 @@ +{% extends"base.html" %} +{% block body %} + <p>Do you really want to delete the project <b>{{ project.name }}</b></p> + <form action="." method="post"> + <p> + <a href="{{ url_for('projects', project_name=project.id) }}"> + No + </a> + <input style="color: red;" type="submit" value="Yes"> + </p> + </form> +{% endblock %}
\ No newline at end of file diff --git a/templates/edit_project.html b/templates/edit_project.html index fbbafdc..dc2d78e 100644 --- a/templates/edit_project.html +++ b/templates/edit_project.html @@ -7,3 +7,6 @@ </p> <script src="{{ url_for('static', filename="edit.js") }}"></script> {% endblock %} +{% block footer %} + • <a href="{{ url_for('projects', project_name=project.id) }}">Back to project</a> +{% endblock %} diff --git a/templates/gallery.html b/templates/gallery.html index 6f6b013..590b38b 100644 --- a/templates/gallery.html +++ b/templates/gallery.html @@ -1,13 +1,14 @@ <div class="gallery"> {% for project in projects %} - <a href="{{ url_for("projects", project_name=project.id) }}"> - <div class="gallery-element"> + <a class="gallery-element" href="{{ url_for("projects", project_name=project.id) }}"> + <div> + <b>{{ project.name }}</b><br/> {{ project.summary }} </div> </a> {% endfor %} - <a href="https://github.com/romangraef"> - <div class="gallery-element"> + <a class="gallery-element" href="https://github.com/romangraef"> + <div> And many more on Github </div> </a> diff --git a/templates/login.html b/templates/login.html index 118bf99..32059c6 100644 --- a/templates/login.html +++ b/templates/login.html @@ -8,7 +8,7 @@ </p> <p> <label for="pass">Password</label> - <input id="pass" name="pass" placeholder="Password"> + <input id="pass" name="pass" type="password" placeholder="Password"> </p> <p> <input type="submit" value="Login"> diff --git a/templates/new.html b/templates/new.html index 32e0eff..79df385 100644 --- a/templates/new.html +++ b/templates/new.html @@ -2,6 +2,7 @@ {% block body %} <form id="form" action="{{ url_for('new_project') }}" method="post"> {% set id_disabled = False %} + {% set project = empty_project %} {% include "project_fields.html" %} <input type="submit" value="Create"> </form> diff --git a/templates/project.html b/templates/project.html index 076e0a2..e4fcfc8 100644 --- a/templates/project.html +++ b/templates/project.html @@ -2,5 +2,11 @@ {% block body %} <h1>{{ project.name }}</h1> <p>{{ project.description }}</p> + <p class="spacer"></p> <p><a href="{{ project.link }}">Link</a></p> {% endblock %} +{% block admin_footer %} + • <a href="{{ url_for('edit_project', project_name=project.id) }}">Edit</a> + • <a href="{{ url_for('delete_project', project_name=project.id) }}" style="color:red;">Delete</a> +{% endblock %} + diff --git a/templates/project_fields.html b/templates/project_fields.html index 50472c1..c128fd5 100644 --- a/templates/project_fields.html +++ b/templates/project_fields.html @@ -1,4 +1,3 @@ -{% set project = empty_project %} <p> <label for="id">Id</label><input name="id" id="id" value="{{ project.id }}" {% if id_disabled %} |