Added 'list uploaded files' page, only accessible if logged in.

This commit is contained in:
Simon Brooke 2020-02-07 19:01:30 +00:00
parent 84360110fc
commit da3bde16d0
8 changed files with 138 additions and 22 deletions

View file

@ -83,6 +83,8 @@
:file-upload-title "Upload a file" ;; title for the file upload page
:is-admin-prompt "Is administrator?"
:here "here" ;; used in sanity check report
:history-link "History" ;; text of the history link on the content frame
:history-title-prefix "History of" ;; prefix of the title on the history page
:home-link "Home" ;; text of the home link on the menu
:is-not-directory "is not a directory"
;; (of a file or directory) used in sanity check report
@ -90,6 +92,8 @@
;; (of a file or directory) used in sanity check report
:is-not-writable "is not writable"
;; (of a file or directory) used in sanity check report
:list-files "List uploaded files"
;; title of the 'List uploaded Files' page
:login-label "Log in!" ;; text of the login widget on the login page
:login-link "Log in" ;; text of the login link on the menu
:login-prompt "To edit this wiki"
@ -98,8 +102,7 @@
:logout-link "Log out" ;; text of the logout link on the menu
:logged-in-as "You are logged in as"
;; text of the 'logged in as' label on the menu
:history-link "History" ;; text of the history link on the content frame
:history-title-prefix "History of" ;; prefix of the title on the history page
:matching "matching" ;; 'matching' in e.g. 'list files matching fred'
:new-pass-prompt "New password" ;; text of the new password widget prompt on the change
;; password and edit user pages
:no-admin-users "There are no users in the 'passwd' file with administrative privileges"

View file

@ -10,4 +10,6 @@
+ \*\***bold**\*\*
+ \__italic_\_
More documentation [here](http://daringfireball.net/projects/markdown/syntax)
More documentation [here](http://daringfireball.net/projects/markdown/syntax)
Your <a href="list-uploads">uploaded files are listed here</a>.

View file

@ -0,0 +1,34 @@
{% extends "templates/base.html" %}
{% block content %}
<div id="content" class="list-uploads">
<form action="list-uploads" method="post">
{% csrf-field %}
<p class="widget">
<label for="search">{% i18n matching %}</label>
<input name="search" id="search" type="text" value="{{search}}" required/>
</p>
</form>
<table>
<tr>
<th>Name</th>
<th>Uploaded</th>
<th>Type this</th>
<th>To get this</th>
</tr>
{% for entry in files %}
<tr>
<th>{{entry.base-name}}</th>
<td>{{entry.modified}}</td>
<td>
{% if entry.is-image %} ![{{entry.name|capitalize}}](uploads/{{entry.base-name}}) {% else %} [{{entry.name|capitalize}}](uploads/{{entry.base-name}}) {% endif %}
</td>
<td>
{% if entry.is-image %} <img src="uploads/{{entry.base-name}}" alt="{{entry.name|capitalize}}"/> {% else %} <a href="uploads/{{entry.base-name}}">link</a> {% endif %}
</td>
</tr>
{% endfor %}
</table>
</div>
{% endblock %}

View file

@ -34,5 +34,8 @@
</p>
</form>
{% endif %}
<p>
Your <a href="list-uploads">uploaded files are listed here</a>.
</p>
</div>
{% endblock %}