SUMMARY
crate::data::Data::gist_preview fetches gist metadata from DB and
retrieves contents of all the files(see notes #1) stored in the
repository
NOTES
1) Data::gist_preview uses Data::read_file under the hood, which
currently reads subdirectories up to level 1 depth. Decision has
to be made regarding what to do with level 2 and below
subdirectories. TODO
SUMMARY
REST API for gist creation uses JSON for payload format, which
supports array. Form doesn't so gist file field names(filename and
content) follow {KNOWN_PREFIX}{index} semantics, which can be parsed
while processing request.
SUMMARY
Authenticated and unauthenticated users have different requirements.
Links to profile and settings are irrelevant for unauthenticated
users. So separate navigation bars.
USAGE
crate::pages::auth_ctx
Authenticated user context should be supplied on every
authenticated route template render. Authenticated navigation
bar depends on "loggedin_user" to render profile link.
AUTH_NAV("auth_nav")
Should only be used in authenticated routes. Depends on
"loggedin_user" authenticated user context, which can't be
supplied in unauthenticated routes.
NOTES
Currently, there's (template)code
duplication, when inheritance for "include" templates are
implemented in Tera crate, navigation bars implementations should be
refactored to avoid duplication.
SUMMARY
Browsers send empty strings for empty fields in form submissions.
Email is optional in registration process but empty field fails
validation for email and results in 400 bad request. Converting
empty strings to None fixes this.