@ -737,7 +737,7 @@
( progn ( utils:set-alert "You are not authorised to delete page." )
( redirect "/login" ) ) ) ) ) ) )
( defroute ( "/storage/view/:slug" :method :GET ) ( &key slug )
( defroute ( "/storage/view/media/ :slug" :method :GET ) ( &key slug )
( if ( storage:file-exists-p "" "media" slug )
` ( 200 ( :content-type
, ( files::file-type-of
@ -745,7 +745,16 @@
, ( storage:open-binary-file "" "media" slug ) )
( on-exception *web* 404 ) ) )
( defroute ( "/storage/thumb/:slug" :method :GET ) ( &key slug )
( defroute ( "/storage/thumb/archive/:slug" :method :GET ) ( &key slug )
( if ( nera:get-archive-entry :slug slug )
( let ( ( archive-entry ( nera:get-archive-entry :slug slug ) ) )
( format t "[THUMBNAIL] ~A~%" ( archive::thumbnail-file-type-of archive-entry ) )
` ( 200 ( :content-type , ( archive::thumbnail-file-type-of archive-entry ) )
, ( storage:open-binary-file
"" "archive" ( archive::thumbnail-slug-of archive-entry ) ) ) )
( on-exception *web* 404 ) ) )
( defroute ( "/storage/thumb/page/:slug" :method :GET ) ( &key slug )
( if ( storage:file-exists-p "" "media" slug )
` ( 200 ( :content-type
, ( files::file-type-of
@ -1029,30 +1038,40 @@
( redirect "/login" ) ) ) ) ) ) )
( defroute ( "/edit/archive/:slug" :method :GET ) ( &key slug )
( hermetic:auth ( :logged-in )
;; Authorised
( let ( ( alert ( utils:get-and-reset-alert ) ) )
( render "/user/edit-archive.html"
( append ( auth:auth-user-data )
` ( :alert , alert
:system-data , ( nera:system-data )
:db-data , ( nera:get-archive-entry :slug slug )
:data , ( storage:open-text-file
"" "archive" slug ) ) ) ) )
;; Not Authorised
( progn
( utils:set-alert "You are not logged in." )
( redirect "/login" ) ) ) )
( if ( nera:get-archive-entry :slug slug )
( progn
( hermetic:auth ( :logged-in )
;; Authorised
( let ( ( alert ( utils:get-and-reset-alert ) ) )
( render "/user/edit-archive.html"
( append ( auth:auth-user-data )
` ( :alert , alert
:system-data , ( nera:system-data )
:db-data , ( nera:get-archive-entry :slug slug )
:data , ( storage:open-text-file
"" "archive" slug ) ) ) ) )
;; Not Authorised
( progn
( utils:set-alert "You are not logged in." )
( redirect "/login" ) ) ) )
( on-exception *web* 404 ) ) )
( defroute ( "/edit/archive-thumbnail" :method :POST ) ( )
( utils:set-alert "ROUTE NOT IMPLEMENTED" )
( redirect "/user/archive" ) )
( defroute ( "/rename/archive-entry" :method :POST )
( format nil "ROUTE NOT IMPLEMENTED" ) )
( defroute ( "/rename/archive-entry" :method :POST ) ( )
( utils:set-alert "ROUTE NOT IMPLEMENTED" )
( redirect "/user/archive" ) )
( defroute ( "/edit/archive" :method :POST )
( format nil "ROUTE NOT IMPLEMENTED" ) )
( defroute ( "/edit/archive" :method :POST ) ( )
( utils:set-alert "ROUTE NOT IMPLEMENTED" )
( redirect "/user/archive" ) )
( defroute ( "/edit/archive-thumbnail" :method :POST )
( format nil "ROUTE NOT IMPLEMENTED" ) )
( defroute ( "/edit/archive-thumbnail" :method :POST ) ( )
( utils:set-alert "ROUTE NOT IMPLEMENTED" )
( redirect "/user/archive" ) )
( defroute ( "/archive/delete/entry" :method :POST ) ( )
( destructuring-bind