These functions haven't not been used much so I don't know how
reliable they are in their current forms. Expect some work needed on
them in the future.
I move the alert section to the /layouts/header.html template because
it was easier to get it to render between the logged-in user's site
header and the site's 'normal' header.
The site's side-menu (for logged-in users) still needs stuff adding to
it -- and tweaking -- but the base style, layout and whatnot is in
place.
I've moved/changed how I was using the /static directory (site-wide
snippet) so I can start adding in images and what have you again. I
didn't realise I had set Git to ignore the how /static directory.
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 function now loops through the values passes to it and sets the
'enable-nav-menu- column in the database for the currently selected
page in the loop.
The nav. menu section sends a hidden value if a check box isn't
selected. This is in preparation for implementing the back-end part of
this feature.
I, also, removed the if-statements when selecting the home page in the
'Home Page' settings. Again, this in preparation for adjusting the
back-end functionality for this feature.
I'm changing the snippet to be stored as HTML instead of
JavaScript. I'm, also, storing the snippet in /storage/snippets
instead of /static. This makes it easier to hook it up to my Umami
instance in the future if Nic wants to do that.
From an end-user perspective, I don't think Nic will care about the
difference. She'll want the easiest option and uploading a single file
via the multi-upload form -- with no file name input -- is the easiest
way to go about this. I say this without actually speaking to her
about this so I might be wrong on this and need to go back in and
change things.
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.