This defroute doesn't change anything relevant in the Meilisearch DB so it
doesn't need updating. I've left a comment (mostly for future me) to remind me
not to think I've missed a defroute and try to integrate the Meilisearch stuff
into it.
The defroute to update the thumbnail doesn't need to change but I added a
comment to make it clear in the future -- I can see me forgetting it doesn't
need updating and try to add code which doesn't need to exist.
I, also, did a bit of updating to the layout of the code is parts -- mostly when
setting the alert message.
The re-direct to /search when the user has set /search as the site's home page
is part of a list of other hard-coded re-directs in this site's '/' defroute.
The site now deletes the Archive Entry from the Meilisearch database alongside
the files in the /storage directory and the nera database.
The site now populates the Meilisearch database when the user creates an archive
entry. The Meilisearch needs to be set-up manually at this moment in time so
expect this to break easily if you haven't got Meilisearch working.
The conditions are added to the 'Site Logo' and 'Favicon'
sections/defroutes. The checks are to make sure a user doesn't try to set an MP4
file as the site's favicon or site's logo.
When the user wants to delete their account they must now enter their
username as part of the form they submit. This is so they don't
accidently delete thier account.
I think I had a version of this route but I deleted it -- can't
remember if it wasn't needed or didn't work as intended at the
time. Anyway, this commit makes it part of the code-base (again).
The function provides the website to use the automatically generated
thumbnails -- when a user uploads the an image to /storage/media --
instead of the full-sized image. This should help reduce download
times if a list of uploaded image are several Mega Bytes and being
viewed at once -- like an index page for example.
The automatically generated thumbnails are no longer stored in the
database. They are created, updated and deleted alongside it's main accompanying
image -- as a file in the /storage/media directory.
The route in web.lisp calls the recently created 'get latest'
functions in the nera package. The code is web should be fine but the
dashboard.html stuff is buggy and so is the back-end routes for
uploading deleting file in the /storage section of the website. This
is an end-of-session commit, though, so the bugs will have to be fixed
at a later time.
I think I will need to swap out the string value 'success' with a
constant so things aren't as stringly-typed as this. With that said,
this is just a quick proof-of-concept. I can keep this around until I
build out this updated feature some more.
I hard-coded redirects to the pages which can't be deleted into the
site's index ('/' route). This allows them to be set as the home page
in the site's settings.
I, also, updated the data which is passed to
nera:update-nav-menu. This change is part of the Nav. Menu settings in
the site's settings.
The code now removes the old thumbnail file, stores the new one and
updates the database entry. I found it easier to keep track of the
changes whilst developing by doing this.
I added a new route to get files from the /archive directory but
needed to expand on the original /storage/view/:slug route so I could
seperate out the two (/storage/media and /storage/archive)
directories.
I added a check to make sure the archive entry
requested (/edit/archive/:slug) exists and return a 404 if it doesn't.
This is part of an end-of-session commit. I'm currently working on the
/create/archive-entry section (most the HTTP POST request). I still
need to start the view archive, edit archive and delete archive
parts. I've not even looked at the Meilisearch stuff. For now, the aim
is to get the website's main database (nera.db) working and then
integrate the Meilisearch stuff in after that.
When uploading a file, a thumbnail is made (if an image, using the
Image Magick program with Bash). This file is not stored in the
database. It is a file-system only thing. The reason for adding this
is some I can create HTML templates/defroutes which show a list of the
images in /storage/media without saturating the viewers bandwidth.
I need to work on this functionality a bit more. This is an end of
session commit. Started it and it works but needs expanding.
I could do with adding file-type checks and changing 'octet/stream' to
something like 'image/png' depending on the file-type (storage in
DB). This will stop the browser from downloading every file in
/storage/media and allow the files which can be viewed in the
browser (like images).
This is an end-of-session commit. I've got the route up and running
with the /user/storage HTML template rendering in the browser and
listing out the files in storage. I could do with adding a model and
storing the files meta-data in the database. This page could do with
rendering the images and placeholders (E.G.generic text file icon) for
non-image files.
This is work-in-progress for the site-settings section of the
website. These additional features in this commit focus on setting
home page and enabling/disabling the sign-up features.