pupupu

simple static CMS for crappy servers
git clone https://git.ce9e.org/pupupu.git

commit
dc9bdc8c52a1755be3fd4bf4ac21ba424905b57e
parent
566ae7c5a0c50dfafc6f5b31f9d704c97ad85f92
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2018-10-19 10:48
style upload file list

Diffstat

M static/main.scss 34 ++++++++++++++++++++++++++++++++++
M templates/uploads.html 17 +++++++++--------

2 files changed, 43 insertions, 8 deletions


diff --git a/static/main.scss b/static/main.scss

@@ -13,6 +13,16 @@ textarea {
   13    13 	@include button-color(red, white, darkred);
   14    14 }
   15    15 
   -1    16 .button--small {
   -1    17 	line-height: 1.5;
   -1    18 	padding: 0 0.3em;
   -1    19 }
   -1    20 
   -1    21 .input--invisible {
   -1    22 	padding: 0;
   -1    23 	border: 0;
   -1    24 }
   -1    25 
   16    26 .CodeMirror-scroll,
   17    27 textarea {
   18    28 	max-height: 60vh;
@@ -37,3 +47,27 @@ header form {
   37    47 	justify-content: space-between;
   38    48 	margin-bottom: $spacer;
   39    49 }
   -1    50 
   -1    51 .file-list {
   -1    52 	list-style: none;
   -1    53 	margin: 0;
   -1    54 	padding: 0;
   -1    55 	margin-bottom: $spacer;
   -1    56 
   -1    57 	li {
   -1    58 		border-bottom: 1px solid $color-border;
   -1    59 		padding: ($padding / 2) $padding;
   -1    60 		display: flex;
   -1    61 		align-items: center;
   -1    62 	}
   -1    63 
   -1    64 	.flex-ignore {
   -1    65 		display: flex;
   -1    66 		flex: 1 1 auto;
   -1    67 		align-items: center;
   -1    68 	}
   -1    69 
   -1    70 	.file-list__main {
   -1    71 		flex: 1 1 auto;
   -1    72 	}
   -1    73 }

diff --git a/templates/uploads.html b/templates/uploads.html

@@ -1,20 +1,21 @@
    1     1 {% extends 'base.html' %}
    2     2 
    3     3 {% block main %}
    4    -1     <ul>
   -1     4     <ul class="file-list">
    5     5         {% for name, url in files %}
    6     6             <li>
    7    -1                 <a href="{{ url }}" target="_blank">{{ name }}</a>
   -1     7                 <a href="{{ url }}" target="_blank" class="file-list__main">{{ name }}</a>
    8     8                 <form method="post">
    9     9                     <input type="hidden" name="name" value="{{ name }}">
   10    -1                     <button class="button--danger" name="delete">Delete</button>
   -1    10                     <button class="button--danger button--small" name="delete">Delete</button>
   11    11                 </form>
   12    12             </li>
   13    13         {% endfor %}
   -1    14         <li>
   -1    15             <form method="post" enctype="multipart/form-data" class="flex-ignore">
   -1    16                 <input type="file" name="file" class="input--invisible file-list__main">
   -1    17                 <input type="submit" value="Upload" class="button--small">
   -1    18             </form>
   -1    19         </li>
   14    20     </ul>
   15    -1 
   16    -1     <form method="post" enctype="multipart/form-data">
   17    -1         <input type="file" name="file">
   18    -1         <input type="submit" value="Save">
   19    -1     </form>
   20    21 {% endblock %}