77 Commits (4127f923aa174ecebed93898dd39c1b21b6b2605)

Author SHA1 Message Date
Aravinth Manivannan d948730110
feat: render markdown comments 1 year ago
Aravinth Manivannan 31f2c6960a
feat: render markdown files in gists 1 year ago
Aravinth Manivannan 8f2a8ed1a1
chore & fix: fix broken link 2 years ago
Aravinth Manivannan 2d06e7fa39
fix: delete all gist repositories when account is deleted 2 years ago
Aravinth Manivannan 1568e48eea
feat: raw and single page views for gist files 2 years ago
Aravinth Manivannan 13388326ef
chore & fix: modularize templates and fix multi-file gists for the final
time.
2 years ago
Aravinth Manivannan 5bdbdaf267
feat: display comments on gists 2 years ago
Aravinth Manivannan dbc233c1ed
feat: comment on gists 2 years ago
Aravinth Manivannan 95efab95da
feat: load comments in gists view route and comment form 2 years ago
Aravinth Manivannan 2323dbf82c
feat: gist view 2 years ago
Aravinth Manivannan 9fb203de32
feat: conditionally display profile link 2 years ago
Aravinth Manivannan 53cb808083
feat: demo user banner on login and register pages 2 years ago
Aravinth Manivannan 2db966c04a
feat: gist index view 2 years ago
Aravinth Manivannan edca78906e
feat: gist preview
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
2 years ago
Aravinth Manivannan 5791e829fd
feat: utility method to parse gist public ID from repo path 2 years ago
Aravinth Manivannan 375bdc1e6c
chore: use references to GistID whenever possible 2 years ago
Aravinth Manivannan 3a1666f23c
chore: gist creation test 2 years ago
Aravinth Manivannan b698884b49
feat: gist creation form 2 years ago
Aravinth Manivannan 92f48b7bfb
feat: add new gist form gets error handling and rendering with
user-provided values on error
2 years ago
Aravinth Manivannan 7fdf815a14
chore: clippy lints 2 years ago
Aravinth Manivannan 55f7b3c3a1
fix: non-authenticated requests to pages endpoint redirected to registration, now redirects to login page 2 years ago
Aravinth Manivannan 20d34867cf
feat: add more tests 2 years ago
Aravinth Manivannan 9e15e04ca5
feat: new gist page and extractors to handle new gist form payload
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.
2 years ago
Aravinth Manivannan f5a22a2916
fix: add validation to check for empty file array during gist creation 2 years ago
Aravinth Manivannan 0ba7559425
feat: view gist route and helper method to construct route from parts 2 years ago
Aravinth Manivannan 5ae12f98b3
fix: remove placeholder home route and save profile link in auth_ctx 2 years ago
Aravinth Manivannan 68fc93b33f
fix: login-register template name clash 2 years ago
Aravinth Manivannan 56ff863042
feat: add tests for HTML signout route 2 years ago
Aravinth Manivannan 371e56ab47
fix: set authentication session cookie and load middleware 2 years ago
Aravinth Manivannan 28b501810e
feat: separate navigation bars for logged and unauthenticated users
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.
2 years ago
Aravinth Manivannan 3d040ede86
feat: gist routes and methods to generate profile route from component 2 years ago
Aravinth Manivannan 1f4053f361
feat: load embedded templates 2 years ago
Aravinth Manivannan 551a48d0c5
feat: embed templates in binary 2 years ago
Aravinth Manivannan 78d24af48c
feat: convert empty emails to None in register form handler
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.
2 years ago
Aravinth Manivannan 3b6a5938d7
feat: login form submission 2 years ago
Aravinth Manivannan dba0834eff
feat: register form submission 2 years ago
Aravinth Manivannan 2a8df0ebb8
feat: register template renders errors 2 years ago
Aravinth Manivannan 5c9a96dfab
feat: add tests for login template 2 years ago
Aravinth Manivannan 2919611e00
feat: login template renders errors 2 years ago
Aravinth Manivannan 8901191549
feat: empty homepage placeholder 2 years ago
Aravinth Manivannan f03c052471
feat: implement HTML PageError
SUMMARY
    crate::errors::ServiceError is for JSON APIs.
    crate::page::errors::PageError is implemented for HTML pages. It
    takes a template and ServiceError instance to render given template
    with error message.

    If a user submits a form, which errors out, the user should be
    presented the same form, values filled but with error message
    included.

DESCRIPTION
    PageError::reason is human readable and friendly message
    explain what had happened.

    PageError::title is the name of the status code: HTTP "200: is "200
    OK"

    crate::page::errors::CtxError: trait all templates that can error
    should implement. It accepts an error and appends it to the
    templates context before rendering it.
2 years ago
Aravinth Manivannan 9fdd467fe9
feat: implement GetLoginRoute for crate::pages::route::Pages 2 years ago
Aravinth Manivannan 037b7f1b97
feat: HTTP signout route 2 years ago
Aravinth Manivannan 58fbe892b3
chore: separate API logout route 2 years ago
Aravinth Manivannan 34e8d8851f
feat: login and register HTML pages 2 years ago
Aravinth Manivannan 2cf064d565
feat: setup embedding static files in binary 2 years ago
Aravinth Manivannan 9dd7f2e1c7
chore: rm errors.rs from coverage report and cleanup protected_routes_work 2 years ago
Aravinth Manivannan 9249dc3567
feat: setup cache busting for static assets 2 years ago
Aravinth Manivannan fc40706ca9
feat: get admin_email in settings and validate admin_email and source_code
SUMMARY
    New field is added to settings to receive email of the admin of the
    instance. source_code is a link to the repository of the source code
    of a GitPad instance, set_source_code is defined to build a HTTP
    link to the exact commit from which the instance binary was built.

NOTE
    Current Settings::set_source_code assumes the provided HTTP link to
    point to a forge belonging to the GitHub-family(GitHub, Gitea and
    GitLab), provisions must be made to accommodate other forges as
    well.
2 years ago
Aravinth Manivannan b7fe7ea5d5
chore: rename gists to gitpad 2 years ago