From b36f9c05071ea549ed59e703270fcf223b60df03 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 9 Apr 2017 09:02:09 +0200 Subject: Major rewrite to use jab/oauth. Highlights: - Uses the oauth branch of jab. - Changed design to use bootstrap. - Some minor changes to functionality in file uploading and listing. - API is currently disabled and incomplete. --- templates/__init__.py | 9 --------- templates/base.tmpl | 48 ----------------------------------------------- templates/changepass.tmpl | 16 ---------------- templates/delete.tmpl | 9 --------- templates/help.tmpl | 20 -------------------- templates/images.tmpl | 28 --------------------------- templates/login.tmpl | 24 ------------------------ templates/my.tmpl | 14 -------------- templates/register.tmpl | 16 ---------------- templates/upload.tmpl | 23 ----------------------- templates/uploaded.tmpl | 16 ---------------- 11 files changed, 223 deletions(-) delete mode 100644 templates/__init__.py delete mode 100644 templates/base.tmpl delete mode 100644 templates/changepass.tmpl delete mode 100644 templates/delete.tmpl delete mode 100644 templates/help.tmpl delete mode 100644 templates/images.tmpl delete mode 100644 templates/login.tmpl delete mode 100644 templates/my.tmpl delete mode 100644 templates/register.tmpl delete mode 100644 templates/upload.tmpl delete mode 100644 templates/uploaded.tmpl (limited to 'templates') diff --git a/templates/__init__.py b/templates/__init__.py deleted file mode 100644 index a8a47b8..0000000 --- a/templates/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -from upload import upload -from uploaded import uploaded -from help import help -from login import login -from my import my -from images import images -from register import register -from changepass import changepass -from delete import delete diff --git a/templates/base.tmpl b/templates/base.tmpl deleted file mode 100644 index 76d9c99..0000000 --- a/templates/base.tmpl +++ /dev/null @@ -1,48 +0,0 @@ - - - - - $title - - -#block head -#end block - - -
- - -
-#block content -#end block -
-
- - diff --git a/templates/changepass.tmpl b/templates/changepass.tmpl deleted file mode 100644 index a66c7f3..0000000 --- a/templates/changepass.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -#def title: changepass -#def header: changepass -#extends templates.base -#def content -#set error = $error or '' -
$error
-
-

current password

-

-

new password

-

-

repeat new password

-

-

-
-#end def diff --git a/templates/delete.tmpl b/templates/delete.tmpl deleted file mode 100644 index a3ed7be..0000000 --- a/templates/delete.tmpl +++ /dev/null @@ -1,9 +0,0 @@ -#def title: delete -#def header: delete -#extends templates.base -#def content -
-

Are you sure you want to delete the file $filename?

-

-
-#end def diff --git a/templates/help.tmpl b/templates/help.tmpl deleted file mode 100644 index d33ca77..0000000 --- a/templates/help.tmpl +++ /dev/null @@ -1,20 +0,0 @@ -#def title: help -#def header: help -#extends templates.base -#def content -

Usage: POST to $scheme://${host}${settings.virtual_root}u with filedata given to "file" and original filename to "filename". Login is done by generating a login token and sending it as the cookie "token".

-

cURL examples, get_token: -

$ curl $scheme://${host}${settings.virtual_root}a?method=get_token -F username=foo -F password=bar
-{"status": true, "message": null, "method": "get_token", "token": "cb42eb38eb516d9dfcaaa742d1da0b3ad454b2bd05a8b4daa6d01e9587d7c759"}
- Upload using the token: -
$ curl -b 'token=cb42eb38eb516d9dfcaaa742d1da0b3ad454b2bd05a8b4daa6d01e9587d7c759' -F 'file=@image.png' -F 'filename=image.png' -F 'api=1' $scheme://${host}${settings.virtual_root}u
-OK sjLUD
- To expire the current token: -
$ curl $scheme://${host}${settings.virtual_root}a?method=expire_token -F token=cb42eb38eb516d9dfcaaa742d1da0b3ad454b2bd05a8b4daa6d01e9587d7c759
-{"status": true, "message": null, "method": "expire_token"}
- If you get HTTP 417 responses, try adding:-H 'Expect:'.

-

By adding the key-value pair "api=1" you will get machine-readable responses in the form: response result where response is either ERROR or OK, - and result is the file hash in the case of OK, or an error message in the case of ERROR (see example above). - The hash can be used to construct URLs in which the paths begin with /f/hash where hash is the hash received.

-

Any file extension an be appended to the hash, and for convenience the original filename (or whatever filename you prefer) can be appended after an additional slash after the hash.

-#end def diff --git a/templates/images.tmpl b/templates/images.tmpl deleted file mode 100644 index 4dee28f..0000000 --- a/templates/images.tmpl +++ /dev/null @@ -1,28 +0,0 @@ -#def title: images -#def header: images -#extends templates.base -#def head - - - -#end def -#def content -

You have $len($files) uploaded images totaling $total_size.

-#if len($files) -
-#for file in $files -
$file.filename
-#end for -
-#else -
(No image uploads yet.)
-#end if -#end def diff --git a/templates/login.tmpl b/templates/login.tmpl deleted file mode 100644 index 505a885..0000000 --- a/templates/login.tmpl +++ /dev/null @@ -1,24 +0,0 @@ -#def title: login -#def header: login -#extends templates.base -#def content -#set error = $error or '' -
$error
-#if $loggedin -

You are now logged in as $user.username. - To change your session settings, please use the form below. - Or return to the upload page. -

-#end if -#if $user -
-#if next - -#end if -

-

-

-

-
-#end if -#end def diff --git a/templates/my.tmpl b/templates/my.tmpl deleted file mode 100644 index 7e6e242..0000000 --- a/templates/my.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -#def title: myfiles -#def header: myfiles -#extends templates.base -#def content -

You have $len($files) uploaded files totaling $total_size.

- -#end def diff --git a/templates/register.tmpl b/templates/register.tmpl deleted file mode 100644 index 4d2bc2a..0000000 --- a/templates/register.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -#def title: register -#def header: register -#extends templates.base -#def content -#set error = $error or '' -
$error
-
-

username

-

-

password

-

-

repeat password

-

-

-
-#end def diff --git a/templates/upload.tmpl b/templates/upload.tmpl deleted file mode 100644 index 87f50ea..0000000 --- a/templates/upload.tmpl +++ /dev/null @@ -1,23 +0,0 @@ -#def title: upload -#def header: upload -#extends templates.base -#def head - -#end def -#def content -
- -

-

-
-#end def diff --git a/templates/uploaded.tmpl b/templates/uploaded.tmpl deleted file mode 100644 index 019160f..0000000 --- a/templates/uploaded.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -#def title: upload -#def header: upload -#extends templates.base -#def content -

Your file has been uploaded: -

-#if $user -

Your file will also appear in your file list.

-#else -

If you were registered and logged in, your file would also appear in your file list.

-#end if -#end def -- cgit v1.2.3