14-cleanup #15
| @ -4,6 +4,7 @@ import ( | |||||||
| 	"errors" | 	"errors" | ||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"net/http" | 	"net/http" | ||||||
|  | 	"time" | ||||||
| 
 | 
 | ||||||
| 	"git.32bit.cafe/32bitcafe/guestbook/internal/forms" | 	"git.32bit.cafe/32bitcafe/guestbook/internal/forms" | ||||||
| 	"git.32bit.cafe/32bitcafe/guestbook/internal/models" | 	"git.32bit.cafe/32bitcafe/guestbook/internal/models" | ||||||
| @ -129,7 +130,7 @@ func (app *application) getCommentQueue(w http.ResponseWriter, r *http.Request) | |||||||
| 		return | 		return | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	comments, err := app.guestbookComments.GetQueue(website.Guestbook.ID) | 	comments, err := app.guestbookComments.GetUnpublished(website.Guestbook.ID) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		if errors.Is(err, models.ErrNoRecord) { | 		if errors.Is(err, models.ErrNoRecord) { | ||||||
| 			http.NotFound(w, r) | 			http.NotFound(w, r) | ||||||
| @ -143,9 +144,71 @@ func (app *application) getCommentQueue(w http.ResponseWriter, r *http.Request) | |||||||
| 	views.GuestbookDashboardCommentsView("Message Queue", data, website, website.Guestbook, comments).Render(r.Context(), w) | 	views.GuestbookDashboardCommentsView("Message Queue", data, website, website.Guestbook, comments).Render(r.Context(), w) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | func (app *application) getCommentTrash(w http.ResponseWriter, r *http.Request) { | ||||||
|  | 	slug := r.PathValue("id") | ||||||
|  | 	website, err := app.websites.Get(slugToShortId(slug)) | ||||||
|  | 	if err != nil { | ||||||
|  | 		if errors.Is(err, models.ErrNoRecord) { | ||||||
|  | 			http.NotFound(w, r) | ||||||
|  | 		} else { | ||||||
|  | 			app.serverError(w, r, err) | ||||||
|  | 		} | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	comments, err := app.guestbookComments.GetDeleted(website.Guestbook.ID) | ||||||
|  | 	if err != nil { | ||||||
|  | 		if errors.Is(err, models.ErrNoRecord) { | ||||||
|  | 			http.NotFound(w, r) | ||||||
|  | 		} else { | ||||||
|  | 			app.serverError(w, r, err) | ||||||
|  | 		} | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	data := app.newCommonData(r) | ||||||
|  | 	views.GuestbookDashboardCommentsView("Trash", data, website, website.Guestbook, comments).Render(r.Context(), w) | ||||||
|  | } | ||||||
|  | 
 | ||||||
| func (app *application) putHideGuestbookComment(w http.ResponseWriter, r *http.Request) { | func (app *application) putHideGuestbookComment(w http.ResponseWriter, r *http.Request) { | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (app *application) putDeleteGuestbookComment(w http.ResponseWriter, r *http.Request) { | func (app *application) deleteGuestbookComment(w http.ResponseWriter, r *http.Request) { | ||||||
|  | 	user := app.getCurrentUser(r) | ||||||
|  | 	wSlug := r.PathValue("id") | ||||||
|  | 	website, err := app.websites.Get(slugToShortId(wSlug)) | ||||||
|  | 	if err != nil { | ||||||
|  | 		app.logger.Info("website 404") | ||||||
|  | 		if errors.Is(err, models.ErrNoRecord) { | ||||||
|  | 			http.NotFound(w, r) | ||||||
|  | 		} else { | ||||||
|  | 			app.serverError(w, r, err) | ||||||
|  | 		} | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	if user.ID != website.UserId { | ||||||
|  | 		app.clientError(w, http.StatusUnauthorized) | ||||||
|  | 	} | ||||||
|  | 	cSlug := r.PathValue("commentId") | ||||||
|  | 	comment, err := app.guestbookComments.Get(slugToShortId(cSlug)) | ||||||
|  | 	if err != nil { | ||||||
|  | 		app.logger.Info("comment 404") | ||||||
|  | 		if errors.Is(err, models.ErrNoRecord) { | ||||||
|  | 			http.NotFound(w, r) | ||||||
|  | 		} else { | ||||||
|  | 			app.serverError(w, r, err) | ||||||
|  | 		} | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 	comment.Deleted = time.Now().UTC() | ||||||
|  | 	err = app.guestbookComments.UpdateComment(&comment) | ||||||
|  | 	if err != nil { | ||||||
|  | 		app.serverError(w, r, err) | ||||||
|  | 	} | ||||||
|  | 	comments, err := app.guestbookComments.GetAll(website.Guestbook.ID) | ||||||
|  | 	if err != nil { | ||||||
|  | 		app.serverError(w, r, err) | ||||||
|  | 	} | ||||||
|  | 	views.GuestbookCommentList(comments).Render(r.Context(), w) | ||||||
| } | } | ||||||
|  | |||||||
| @ -5,6 +5,7 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"math" | 	"math" | ||||||
| 	"net/http" | 	"net/http" | ||||||
|  | 	"runtime/debug" | ||||||
| 	"strconv" | 	"strconv" | ||||||
| 	"time" | 	"time" | ||||||
| 
 | 
 | ||||||
| @ -21,6 +22,10 @@ func (app *application) serverError(w http.ResponseWriter, r *http.Request, err | |||||||
| 	) | 	) | ||||||
| 
 | 
 | ||||||
| 	app.logger.Error(err.Error(), "method", method, "uri", uri) | 	app.logger.Error(err.Error(), "method", method, "uri", uri) | ||||||
|  | 	if app.debug { | ||||||
|  | 		http.Error(w, string(debug.Stack()), http.StatusInternalServerError) | ||||||
|  | 		app.logger.Error(err.Error(), "method", method, "uri", uri, "stack", string(debug.Stack())) | ||||||
|  | 	} | ||||||
| 	http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) | 	http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -25,11 +25,13 @@ type application struct { | |||||||
| 	guestbookComments *models.GuestbookCommentModel | 	guestbookComments *models.GuestbookCommentModel | ||||||
| 	sessionManager    *scs.SessionManager | 	sessionManager    *scs.SessionManager | ||||||
| 	formDecoder       *schema.Decoder | 	formDecoder       *schema.Decoder | ||||||
|  | 	debug             bool | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func main() { | func main() { | ||||||
| 	addr := flag.String("addr", ":3000", "HTTP network address") | 	addr := flag.String("addr", ":3000", "HTTP network address") | ||||||
| 	dsn := flag.String("dsn", "guestbook.db", "data source name") | 	dsn := flag.String("dsn", "guestbook.db", "data source name") | ||||||
|  | 	debug := flag.Bool("debug", false, "enable debug mode") | ||||||
| 	flag.Parse() | 	flag.Parse() | ||||||
| 
 | 
 | ||||||
| 	logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug})) | 	logger := slog.New(slog.NewTextHandler(os.Stdout, &slog.HandlerOptions{Level: slog.LevelDebug})) | ||||||
| @ -57,6 +59,7 @@ func main() { | |||||||
| 		users:             &models.UserModel{DB: db}, | 		users:             &models.UserModel{DB: db}, | ||||||
| 		guestbookComments: &models.GuestbookCommentModel{DB: db}, | 		guestbookComments: &models.GuestbookCommentModel{DB: db}, | ||||||
| 		formDecoder:       formDecoder, | 		formDecoder:       formDecoder, | ||||||
|  | 		debug:             *debug, | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	tlsConfig := &tls.Config{ | 	tlsConfig := &tls.Config{ | ||||||
|  | |||||||
| @ -37,8 +37,9 @@ func (app *application) routes() http.Handler { | |||||||
| 	mux.Handle("GET /websites/{id}/dashboard", protected.ThenFunc(app.getWebsiteDashboard)) | 	mux.Handle("GET /websites/{id}/dashboard", protected.ThenFunc(app.getWebsiteDashboard)) | ||||||
| 	mux.Handle("GET /websites/{id}/dashboard/guestbook/comments", protected.ThenFunc(app.getGuestbookComments)) | 	mux.Handle("GET /websites/{id}/dashboard/guestbook/comments", protected.ThenFunc(app.getGuestbookComments)) | ||||||
| 	mux.Handle("GET /websites/{id}/dashboard/guestbook/comments/queue", protected.ThenFunc(app.getCommentQueue)) | 	mux.Handle("GET /websites/{id}/dashboard/guestbook/comments/queue", protected.ThenFunc(app.getCommentQueue)) | ||||||
|  | 	mux.Handle("DELETE /websites/{id}/dashboard/guestbook/comments/{commentId}", protected.ThenFunc(app.deleteGuestbookComment)) | ||||||
| 	mux.Handle("GET /websites/{id}/dashboard/guestbook/blocklist", protected.ThenFunc(app.getComingSoon)) | 	mux.Handle("GET /websites/{id}/dashboard/guestbook/blocklist", protected.ThenFunc(app.getComingSoon)) | ||||||
| 	mux.Handle("GET /websites/{id}/dashboard/guestbook/comments/trash", protected.ThenFunc(app.getComingSoon)) | 	mux.Handle("GET /websites/{id}/dashboard/guestbook/comments/trash", protected.ThenFunc(app.getCommentTrash)) | ||||||
| 	mux.Handle("GET /websites/{id}/dashboard/guestbook/themes", protected.ThenFunc(app.getComingSoon)) | 	mux.Handle("GET /websites/{id}/dashboard/guestbook/themes", protected.ThenFunc(app.getComingSoon)) | ||||||
| 	mux.Handle("GET /websites/{id}/dashboard/guestbook/customize", protected.ThenFunc(app.getComingSoon)) | 	mux.Handle("GET /websites/{id}/dashboard/guestbook/customize", protected.ThenFunc(app.getComingSoon)) | ||||||
| 	mux.Handle("GET /websites/{id}/guestbook/comments/create", protected.ThenFunc(app.getGuestbookCommentCreate)) | 	mux.Handle("GET /websites/{id}/guestbook/comments/create", protected.ThenFunc(app.getGuestbookCommentCreate)) | ||||||
|  | |||||||
| @ -29,7 +29,7 @@ CREATE TABLE guestbooks ( | |||||||
|     WebsiteId integer UNIQUE NOT NULL, |     WebsiteId integer UNIQUE NOT NULL, | ||||||
|     UserId integer NOT NULL, |     UserId integer NOT NULL, | ||||||
|     Created datetime NOT NULL, |     Created datetime NOT NULL, | ||||||
|     IsDeleted boolean NOT NULL DEFAULT FALSE, |     Deleted datetime, | ||||||
|     IsActive boolean NOT NULL DEFAULT TRUE, |     IsActive boolean NOT NULL DEFAULT TRUE, | ||||||
|     FOREIGN KEY (UserId) REFERENCES users(Id) |     FOREIGN KEY (UserId) REFERENCES users(Id) | ||||||
|         ON DELETE RESTRICT |         ON DELETE RESTRICT | ||||||
| @ -51,7 +51,7 @@ CREATE TABLE guestbook_comments ( | |||||||
|     PageUrl varchar(256), |     PageUrl varchar(256), | ||||||
|     Created datetime NOT NULL, |     Created datetime NOT NULL, | ||||||
|     IsPublished boolean NOT NULL DEFAULT TRUE, |     IsPublished boolean NOT NULL DEFAULT TRUE, | ||||||
|     IsDeleted boolean NOT NULL DEFAULT FALSE, |     Deleted datetime, | ||||||
|     FOREIGN KEY (GuestbookId)  |     FOREIGN KEY (GuestbookId)  | ||||||
|         REFERENCES guestbooks(Id) |         REFERENCES guestbooks(Id) | ||||||
|         ON DELETE RESTRICT |         ON DELETE RESTRICT | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ type Guestbook struct { | |||||||
| 	UserId    int64 | 	UserId    int64 | ||||||
| 	WebsiteId int64 | 	WebsiteId int64 | ||||||
| 	Created   time.Time | 	Created   time.Time | ||||||
| 	IsDeleted bool | 	Deleted   time.Time | ||||||
| 	IsActive  bool | 	IsActive  bool | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -20,8 +20,8 @@ type GuestbookModel struct { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *GuestbookModel) Insert(shortId uint64, userId int64, websiteId int64) (int64, error) { | func (m *GuestbookModel) Insert(shortId uint64, userId int64, websiteId int64) (int64, error) { | ||||||
| 	stmt := `INSERT INTO guestbooks (ShortId, UserId, WebsiteId, Created, IsDeleted, IsActive) | 	stmt := `INSERT INTO guestbooks (ShortId, UserId, WebsiteId, Created, IsActive) | ||||||
|     VALUES(?, ?, ?, ?, FALSE, TRUE)` |     VALUES(?, ?, ?, ?, TRUE)` | ||||||
| 	result, err := m.DB.Exec(stmt, shortId, userId, websiteId, time.Now().UTC()) | 	result, err := m.DB.Exec(stmt, shortId, userId, websiteId, time.Now().UTC()) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return -1, err | 		return -1, err | ||||||
| @ -34,21 +34,24 @@ func (m *GuestbookModel) Insert(shortId uint64, userId int64, websiteId int64) ( | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *GuestbookModel) Get(shortId uint64) (Guestbook, error) { | func (m *GuestbookModel) Get(shortId uint64) (Guestbook, error) { | ||||||
| 	stmt := `SELECT Id, ShortId, UserId, WebsiteId, Created, IsDeleted, IsActive FROM guestbooks | 	stmt := `SELECT Id, ShortId, UserId, WebsiteId, Created, Deleted, IsActive FROM guestbooks | ||||||
|     WHERE ShortId = ?` |     WHERE ShortId = ?` | ||||||
| 	row := m.DB.QueryRow(stmt, shortId) | 	row := m.DB.QueryRow(stmt, shortId) | ||||||
| 	var g Guestbook | 	var g Guestbook | ||||||
| 	err := row.Scan(&g.ID, &g.ShortId, &g.UserId, &g.WebsiteId, &g.Created, &g.IsDeleted, &g.IsActive) | 	var t sql.NullTime | ||||||
|  | 	err := row.Scan(&g.ID, &g.ShortId, &g.UserId, &g.WebsiteId, &g.Created, &t, &g.IsActive) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return Guestbook{}, err | 		return Guestbook{}, err | ||||||
| 	} | 	} | ||||||
| 
 | 	if t.Valid { | ||||||
|  | 		g.Deleted = t.Time | ||||||
|  | 	} | ||||||
| 	return g, nil | 	return g, nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *GuestbookModel) GetAll(userId int64) ([]Guestbook, error) { | func (m *GuestbookModel) GetAll(userId int64) ([]Guestbook, error) { | ||||||
| 	stmt := `SELECT Id, ShortId, UserId, WebsiteId, Created, IsDeleted, IsActive FROM guestbooks | 	stmt := `SELECT Id, ShortId, UserId, WebsiteId, Created, IsActive FROM guestbooks | ||||||
|     WHERE UserId = ?` |     WHERE UserId = ? AND DELETED IS NULL` | ||||||
| 	rows, err := m.DB.Query(stmt, userId) | 	rows, err := m.DB.Query(stmt, userId) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return nil, err | 		return nil, err | ||||||
| @ -56,7 +59,7 @@ func (m *GuestbookModel) GetAll(userId int64) ([]Guestbook, error) { | |||||||
| 	var guestbooks []Guestbook | 	var guestbooks []Guestbook | ||||||
| 	for rows.Next() { | 	for rows.Next() { | ||||||
| 		var g Guestbook | 		var g Guestbook | ||||||
| 		err = rows.Scan(&g.ID, &g.ShortId, &g.UserId, &g.WebsiteId, &g.Created, &g.IsDeleted, &g.IsActive) | 		err = rows.Scan(&g.ID, &g.ShortId, &g.UserId, &g.WebsiteId, &g.Created, &g.IsActive) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, err | 			return nil, err | ||||||
| 		} | 		} | ||||||
|  | |||||||
| @ -16,8 +16,8 @@ type GuestbookComment struct { | |||||||
| 	CommentText string | 	CommentText string | ||||||
| 	PageUrl     string | 	PageUrl     string | ||||||
| 	Created     time.Time | 	Created     time.Time | ||||||
|  | 	Deleted     time.Time | ||||||
| 	IsPublished bool | 	IsPublished bool | ||||||
| 	IsDeleted   bool |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| type GuestbookCommentModel struct { | type GuestbookCommentModel struct { | ||||||
| @ -27,8 +27,8 @@ type GuestbookCommentModel struct { | |||||||
| func (m *GuestbookCommentModel) Insert(shortId uint64, guestbookId, parentId int64, authorName, | func (m *GuestbookCommentModel) Insert(shortId uint64, guestbookId, parentId int64, authorName, | ||||||
| 	authorEmail, authorSite, commentText, pageUrl string, isPublished bool) (int64, error) { | 	authorEmail, authorSite, commentText, pageUrl string, isPublished bool) (int64, error) { | ||||||
| 	stmt := `INSERT INTO guestbook_comments (ShortId, GuestbookId, ParentId, AuthorName, | 	stmt := `INSERT INTO guestbook_comments (ShortId, GuestbookId, ParentId, AuthorName, | ||||||
|     AuthorEmail, AuthorSite, CommentText, PageUrl, Created, IsPublished, IsDeleted) |     AuthorEmail, AuthorSite, CommentText, PageUrl, Created, IsPublished) | ||||||
|     VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, FALSE)` |     VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)` | ||||||
| 	result, err := m.DB.Exec(stmt, shortId, guestbookId, parentId, authorName, authorEmail, | 	result, err := m.DB.Exec(stmt, shortId, guestbookId, parentId, authorName, authorEmail, | ||||||
| 		authorSite, commentText, pageUrl, time.Now().UTC(), isPublished) | 		authorSite, commentText, pageUrl, time.Now().UTC(), isPublished) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| @ -43,21 +43,26 @@ func (m *GuestbookCommentModel) Insert(shortId uint64, guestbookId, parentId int | |||||||
| 
 | 
 | ||||||
| func (m *GuestbookCommentModel) Get(shortId uint64) (GuestbookComment, error) { | func (m *GuestbookCommentModel) Get(shortId uint64) (GuestbookComment, error) { | ||||||
| 	stmt := `SELECT Id, ShortId, GuestbookId, ParentId, AuthorName, AuthorEmail, AuthorSite, | 	stmt := `SELECT Id, ShortId, GuestbookId, ParentId, AuthorName, AuthorEmail, AuthorSite, | ||||||
|     CommentText, PageUrl, Created, IsPublished, IsDeleted FROM guestbook_comments WHERE ShortId = ?` |     CommentText, PageUrl, Created, IsPublished, Deleted FROM guestbook_comments WHERE ShortId = ?` | ||||||
| 	row := m.DB.QueryRow(stmt, shortId) | 	row := m.DB.QueryRow(stmt, shortId) | ||||||
| 	var c GuestbookComment | 	var c GuestbookComment | ||||||
| 	err := row.Scan(&c.ID, &c.ShortId, &c.GuestbookId, &c.ParentId, &c.AuthorName, &c.AuthorEmail, &c.AuthorSite, &c.CommentText, &c.PageUrl, &c.Created, &c.IsPublished, &c.IsDeleted) | 	var t sql.NullTime | ||||||
|  | 	err := row.Scan(&c.ID, &c.ShortId, &c.GuestbookId, &c.ParentId, &c.AuthorName, &c.AuthorEmail, &c.AuthorSite, | ||||||
|  | 		&c.CommentText, &c.PageUrl, &c.Created, &c.IsPublished, &t) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return GuestbookComment{}, err | 		return GuestbookComment{}, err | ||||||
| 	} | 	} | ||||||
|  | 	if t.Valid { | ||||||
|  | 		c.Deleted = t.Time | ||||||
|  | 	} | ||||||
| 	return c, nil | 	return c, nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *GuestbookCommentModel) GetAll(guestbookId int64) ([]GuestbookComment, error) { | func (m *GuestbookCommentModel) GetAll(guestbookId int64) ([]GuestbookComment, error) { | ||||||
| 	stmt := `SELECT Id, ShortId, GuestbookId, ParentId, AuthorName, AuthorEmail, AuthorSite, | 	stmt := `SELECT Id, ShortId, GuestbookId, ParentId, AuthorName, AuthorEmail, AuthorSite, | ||||||
|     CommentText, PageUrl, Created, IsPublished, IsDeleted  |     CommentText, PageUrl, Created, IsPublished  | ||||||
| 	    FROM guestbook_comments  | 	    FROM guestbook_comments  | ||||||
| 	    WHERE GuestbookId = ? AND IsDeleted = FALSE AND IsPublished = TRUE | 	    WHERE GuestbookId = ? AND IsPublished = TRUE AND DELETED IS NULL | ||||||
| 	    ORDER BY Created DESC` | 	    ORDER BY Created DESC` | ||||||
| 	rows, err := m.DB.Query(stmt, guestbookId) | 	rows, err := m.DB.Query(stmt, guestbookId) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| @ -66,7 +71,8 @@ func (m *GuestbookCommentModel) GetAll(guestbookId int64) ([]GuestbookComment, e | |||||||
| 	var comments []GuestbookComment | 	var comments []GuestbookComment | ||||||
| 	for rows.Next() { | 	for rows.Next() { | ||||||
| 		var c GuestbookComment | 		var c GuestbookComment | ||||||
| 		err = rows.Scan(&c.ID, &c.ShortId, &c.GuestbookId, &c.ParentId, &c.AuthorName, &c.AuthorEmail, &c.AuthorSite, &c.CommentText, &c.PageUrl, &c.Created, &c.IsPublished, &c.IsDeleted) | 		err = rows.Scan(&c.ID, &c.ShortId, &c.GuestbookId, &c.ParentId, &c.AuthorName, &c.AuthorEmail, &c.AuthorSite, | ||||||
|  | 			&c.CommentText, &c.PageUrl, &c.Created, &c.IsPublished) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, err | 			return nil, err | ||||||
| 		} | 		} | ||||||
| @ -78,11 +84,11 @@ func (m *GuestbookCommentModel) GetAll(guestbookId int64) ([]GuestbookComment, e | |||||||
| 	return comments, nil | 	return comments, nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *GuestbookCommentModel) GetQueue(guestbookId int64) ([]GuestbookComment, error) { | func (m *GuestbookCommentModel) GetDeleted(guestbookId int64) ([]GuestbookComment, error) { | ||||||
| 	stmt := `SELECT Id, ShortId, GuestbookId, ParentId, AuthorName, AuthorEmail, AuthorSite, | 	stmt := `SELECT Id, ShortId, GuestbookId, ParentId, AuthorName, AuthorEmail, AuthorSite, | ||||||
|     CommentText, PageUrl, Created, IsPublished, IsDeleted  |     CommentText, PageUrl, Created, IsPublished, Deleted | ||||||
| 	    FROM guestbook_comments  | 	    FROM guestbook_comments  | ||||||
| 	    WHERE GuestbookId = ? AND IsDeleted = FALSE AND IsPublished = FALSE | 	    WHERE GuestbookId = ? AND Deleted IS NOT NULL | ||||||
| 	    ORDER BY Created DESC` | 	    ORDER BY Created DESC` | ||||||
| 	rows, err := m.DB.Query(stmt, guestbookId) | 	rows, err := m.DB.Query(stmt, guestbookId) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| @ -91,7 +97,38 @@ func (m *GuestbookCommentModel) GetQueue(guestbookId int64) ([]GuestbookComment, | |||||||
| 	var comments []GuestbookComment | 	var comments []GuestbookComment | ||||||
| 	for rows.Next() { | 	for rows.Next() { | ||||||
| 		var c GuestbookComment | 		var c GuestbookComment | ||||||
| 		err = rows.Scan(&c.ID, &c.ShortId, &c.GuestbookId, &c.ParentId, &c.AuthorName, &c.AuthorEmail, &c.AuthorSite, &c.CommentText, &c.PageUrl, &c.Created, &c.IsPublished, &c.IsDeleted) | 		var t sql.NullTime | ||||||
|  | 		err = rows.Scan(&c.ID, &c.ShortId, &c.GuestbookId, &c.ParentId, &c.AuthorName, &c.AuthorEmail, &c.AuthorSite, | ||||||
|  | 			&c.CommentText, &c.PageUrl, &c.Created, &c.IsPublished, &t) | ||||||
|  | 		if err != nil { | ||||||
|  | 			return nil, err | ||||||
|  | 		} | ||||||
|  | 		if t.Valid { | ||||||
|  | 			c.Deleted = t.Time | ||||||
|  | 		} | ||||||
|  | 		comments = append(comments, c) | ||||||
|  | 	} | ||||||
|  | 	if err = rows.Err(); err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  | 	return comments, nil | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | func (m *GuestbookCommentModel) GetUnpublished(guestbookId int64) ([]GuestbookComment, error) { | ||||||
|  | 	stmt := `SELECT Id, ShortId, GuestbookId, ParentId, AuthorName, AuthorEmail, AuthorSite, | ||||||
|  |     CommentText, PageUrl, Created, IsPublished  | ||||||
|  | 	    FROM guestbook_comments  | ||||||
|  | 	    WHERE GuestbookId = ? AND IsDeleted IS NULL AND IsPublished = FALSE | ||||||
|  | 	    ORDER BY Created DESC` | ||||||
|  | 	rows, err := m.DB.Query(stmt, guestbookId) | ||||||
|  | 	if err != nil { | ||||||
|  | 		return nil, err | ||||||
|  | 	} | ||||||
|  | 	var comments []GuestbookComment | ||||||
|  | 	for rows.Next() { | ||||||
|  | 		var c GuestbookComment | ||||||
|  | 		err = rows.Scan(&c.ID, &c.ShortId, &c.GuestbookId, &c.ParentId, &c.AuthorName, &c.AuthorEmail, &c.AuthorSite, | ||||||
|  | 			&c.CommentText, &c.PageUrl, &c.Created, &c.IsPublished) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, err | 			return nil, err | ||||||
| 		} | 		} | ||||||
| @ -104,10 +141,13 @@ func (m *GuestbookCommentModel) GetQueue(guestbookId int64) ([]GuestbookComment, | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *GuestbookCommentModel) UpdateComment(comment *GuestbookComment) error { | func (m *GuestbookCommentModel) UpdateComment(comment *GuestbookComment) error { | ||||||
| 	stmt := `UPDATE guestbook_comments (CommentText, PageUrl, IsPublished, IsDeleted) | 	stmt := `UPDATE guestbook_comments | ||||||
| 		VALUES (?, ?, ?, ?) | 			SET CommentText = ?, | ||||||
|  | 				PageUrl = ?, | ||||||
|  | 				IsPublished = ?, | ||||||
|  | 				Deleted = ? | ||||||
| 		WHERE Id = ?` | 		WHERE Id = ?` | ||||||
| 	_, err := m.DB.Exec(stmt, comment.CommentText, comment.PageUrl, comment.IsPublished, comment.IsDeleted, comment.ID) | 	_, err := m.DB.Exec(stmt, comment.CommentText, comment.PageUrl, comment.IsPublished, comment.Deleted, comment.ID) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return err | 		return err | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -36,48 +36,38 @@ func (m *WebsiteModel) Insert(shortId uint64, userId int64, siteName, siteUrl, a | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *WebsiteModel) Get(shortId uint64) (Website, error) { | func (m *WebsiteModel) Get(shortId uint64) (Website, error) { | ||||||
| 	stmt := `SELECT w.Id, w.ShortId, w.Name, w.SiteUrl, w.AuthorName, w.UserId, w.Created, w.Deleted, | 	stmt := `SELECT w.Id, w.ShortId, w.Name, w.SiteUrl, w.AuthorName, w.UserId, w.Created, | ||||||
| 	g.Id, g.ShortId, g.Created, g.IsDeleted, g.IsActive | 	g.Id, g.ShortId, g.Created, g.IsActive | ||||||
| 	FROM websites AS w INNER JOIN guestbooks AS g ON w.Id = g.WebsiteId | 	FROM websites AS w INNER JOIN guestbooks AS g ON w.Id = g.WebsiteId | ||||||
| 	WHERE w.ShortId = ?` | 	WHERE w.ShortId = ? AND w.DELETED IS NULL` | ||||||
| 	row := m.DB.QueryRow(stmt, shortId) | 	row := m.DB.QueryRow(stmt, shortId) | ||||||
| 	var t sql.NullTime |  | ||||||
| 	var w Website | 	var w Website | ||||||
| 	err := row.Scan(&w.ID, &w.ShortId, &w.Name, &w.SiteUrl, &w.AuthorName, &w.UserId, &w.Created, &t, | 	err := row.Scan(&w.ID, &w.ShortId, &w.Name, &w.SiteUrl, &w.AuthorName, &w.UserId, &w.Created, | ||||||
| 		&w.Guestbook.ID, &w.Guestbook.ShortId, &w.Guestbook.Created, &w.Guestbook.IsDeleted, &w.Guestbook.IsActive) | 		&w.Guestbook.ID, &w.Guestbook.ShortId, &w.Guestbook.Created, &w.Guestbook.IsActive) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return Website{}, err | 		return Website{}, err | ||||||
| 	} | 	} | ||||||
| 	// handle if Deleted is null |  | ||||||
| 	if t.Valid { |  | ||||||
| 		w.Deleted = t.Time |  | ||||||
| 	} |  | ||||||
| 	return w, nil | 	return w, nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *WebsiteModel) GetById(id int64) (Website, error) { | func (m *WebsiteModel) GetById(id int64) (Website, error) { | ||||||
| 	stmt := `SELECT w.Id, w.ShortId, w.Name, w.SiteUrl, w.AuthorName, w.UserId, w.Created, w.Deleted, | 	stmt := `SELECT w.Id, w.ShortId, w.Name, w.SiteUrl, w.AuthorName, w.UserId, w.Created, | ||||||
| 	g.Id, g.ShortId, g.Created, g.IsDeleted, g.IsActive | 	g.Id, g.ShortId, g.Created, g.IsActive | ||||||
| 	FROM websites AS w INNER JOIN guestbooks AS g ON w.Id = g.WebsiteId | 	FROM websites AS w INNER JOIN guestbooks AS g ON w.Id = g.WebsiteId | ||||||
| 	WHERE w.Id = ?` | 	WHERE w.Id = ? AND w.DELETED IS NULL` | ||||||
| 	row := m.DB.QueryRow(stmt, id) | 	row := m.DB.QueryRow(stmt, id) | ||||||
| 	var t sql.NullTime |  | ||||||
| 	var w Website | 	var w Website | ||||||
| 	err := row.Scan(&w.ID, &w.ShortId, &w.Name, &w.SiteUrl, &w.AuthorName, &w.UserId, &w.Created, &t, | 	err := row.Scan(&w.ID, &w.ShortId, &w.Name, &w.SiteUrl, &w.AuthorName, &w.UserId, &w.Created, | ||||||
| 		&w.Guestbook.ID, &w.Guestbook.ShortId, &w.Guestbook.Created, &w.Guestbook.IsDeleted, &w.Guestbook.IsActive) | 		&w.Guestbook.ID, &w.Guestbook.ShortId, &w.Guestbook.Created, &w.Guestbook.IsActive) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return Website{}, err | 		return Website{}, err | ||||||
| 	} | 	} | ||||||
| 	// handle if Deleted is null |  | ||||||
| 	if t.Valid { |  | ||||||
| 		w.Deleted = t.Time |  | ||||||
| 	} |  | ||||||
| 	return w, nil | 	return w, nil | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (m *WebsiteModel) GetAll(userId int64) ([]Website, error) { | func (m *WebsiteModel) GetAll(userId int64) ([]Website, error) { | ||||||
| 	stmt := `SELECT w.Id, w.ShortId, w.Name, w.SiteUrl, w.AuthorName, w.UserId, w.Created, w.Deleted, | 	stmt := `SELECT w.Id, w.ShortId, w.Name, w.SiteUrl, w.AuthorName, w.UserId, w.Created,  | ||||||
| 	g.Id, g.ShortId, g.Created, g.IsDeleted, g.IsActive | 	g.Id, g.ShortId, g.Created, g.IsActive | ||||||
| 	FROM websites AS w INNER JOIN guestbooks AS g ON w.Id = g.WebsiteId | 	FROM websites AS w INNER JOIN guestbooks AS g ON w.Id = g.WebsiteId | ||||||
| 	WHERE w.UserId = ?` | 	WHERE w.UserId = ?` | ||||||
| 	rows, err := m.DB.Query(stmt, userId) | 	rows, err := m.DB.Query(stmt, userId) | ||||||
| @ -86,10 +76,9 @@ func (m *WebsiteModel) GetAll(userId int64) ([]Website, error) { | |||||||
| 	} | 	} | ||||||
| 	var websites []Website | 	var websites []Website | ||||||
| 	for rows.Next() { | 	for rows.Next() { | ||||||
| 		var t sql.NullTime |  | ||||||
| 		var w Website | 		var w Website | ||||||
| 		err := rows.Scan(&w.ID, &w.ShortId, &w.Name, &w.SiteUrl, &w.AuthorName, &w.UserId, &w.Created, &t, | 		err := rows.Scan(&w.ID, &w.ShortId, &w.Name, &w.SiteUrl, &w.AuthorName, &w.UserId, &w.Created, | ||||||
| 			&w.Guestbook.ID, &w.Guestbook.ShortId, &w.Guestbook.Created, &w.Guestbook.IsDeleted, &w.Guestbook.IsActive) | 			&w.Guestbook.ID, &w.Guestbook.ShortId, &w.Guestbook.Created, &w.Guestbook.IsActive) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			return nil, err | 			return nil, err | ||||||
| 		} | 		} | ||||||
|  | |||||||
| @ -28,6 +28,12 @@ templ GuestbookDashboardCommentsView(title string, data CommonData, website mode | |||||||
|                     <div> |                     <div> | ||||||
|                         <strong>{ c.AuthorName }</strong> |                         <strong>{ c.AuthorName }</strong> | ||||||
|                         { c.Created.Format("01-02-2006 03:04PM") } |                         { c.Created.Format("01-02-2006 03:04PM") } | ||||||
|  |                         if c.Deleted.IsZero() { | ||||||
|  |                             {{ commentUrl := fmt.Sprintf("%s/dashboard/guestbook/comments/%s", wUrl(website), shortIdToSlug(c.ShortId)) }} | ||||||
|  |                             {{ hxHeaders := fmt.Sprintf("{\"X-CSRF-Token\": \"%s\"}", data.CSRFToken) }} | ||||||
|  |                             <a href="#" hx-delete={ commentUrl } hx-target="closest div" hx-headers={ hxHeaders }>Delete</a> | ||||||
|  |                         } | ||||||
|  |                          | ||||||
|                         <p> |                         <p> | ||||||
|                             { c.CommentText } |                             { c.CommentText } | ||||||
|                         </p> |                         </p> | ||||||
| @ -96,18 +102,25 @@ templ GuestbookView(title string, data CommonData, website models.Website, guest | |||||||
|     if data.IsHtmx { |     if data.IsHtmx { | ||||||
|         @commentForm(form) |         @commentForm(form) | ||||||
|     } else { |     } else { | ||||||
|         <div id="main"> |         <html> | ||||||
|             <div> |             <head> | ||||||
|                 <h1>Guestbook for { website.SiteUrl }</h1> |             <title>{ title }</title> | ||||||
|                 <form action={ templ.URL(postUrl) } method="post"> |             </head> | ||||||
|                     <input type="hidden" name="csrf_token" value={data.CSRFToken}> |             <body> | ||||||
|                     @commentForm(form) |                 <main> | ||||||
|                 </form> |                     <div> | ||||||
|             </div> |                         <h1>Guestbook for { website.SiteUrl }</h1> | ||||||
|             <div id="comments"> |                         <form action={ templ.URL(postUrl) } method="post"> | ||||||
|                 @GuestbookCommentList(comments) |                             <input type="hidden" name="csrf_token" value={data.CSRFToken}> | ||||||
|             </div> |                             @commentForm(form) | ||||||
|         </div> |                         </form> | ||||||
|  |                     </div> | ||||||
|  |                     <div id="comments"> | ||||||
|  |                         @GuestbookCommentList(comments) | ||||||
|  |                     </div> | ||||||
|  |                 </main> | ||||||
|  |             </body> | ||||||
|  |         </html> | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -149,25 +149,63 @@ func GuestbookDashboardCommentsView(title string, data CommonData, website model | |||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<p>") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, " ") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				var templ_7745c5c3_Var8 string | 				if c.Deleted.IsZero() { | ||||||
| 				templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.CommentText) | 					commentUrl := fmt.Sprintf("%s/dashboard/guestbook/comments/%s", wUrl(website), shortIdToSlug(c.ShortId)) | ||||||
| 				if templ_7745c5c3_Err != nil { | 					hxHeaders := fmt.Sprintf("{\"X-CSRF-Token\": \"%s\"}", data.CSRFToken) | ||||||
| 					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 32, Col: 43} | 					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "<a href=\"#\" hx-delete=\"") | ||||||
|  | 					if templ_7745c5c3_Err != nil { | ||||||
|  | 						return templ_7745c5c3_Err | ||||||
|  | 					} | ||||||
|  | 					var templ_7745c5c3_Var8 string | ||||||
|  | 					templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(commentUrl) | ||||||
|  | 					if templ_7745c5c3_Err != nil { | ||||||
|  | 						return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 34, Col: 62} | ||||||
|  | 					} | ||||||
|  | 					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) | ||||||
|  | 					if templ_7745c5c3_Err != nil { | ||||||
|  | 						return templ_7745c5c3_Err | ||||||
|  | 					} | ||||||
|  | 					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\" hx-target=\"closest div\" hx-headers=\"") | ||||||
|  | 					if templ_7745c5c3_Err != nil { | ||||||
|  | 						return templ_7745c5c3_Err | ||||||
|  | 					} | ||||||
|  | 					var templ_7745c5c3_Var9 string | ||||||
|  | 					templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxHeaders) | ||||||
|  | 					if templ_7745c5c3_Err != nil { | ||||||
|  | 						return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 34, Col: 111} | ||||||
|  | 					} | ||||||
|  | 					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) | ||||||
|  | 					if templ_7745c5c3_Err != nil { | ||||||
|  | 						return templ_7745c5c3_Err | ||||||
|  | 					} | ||||||
|  | 					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\">Delete</a>") | ||||||
|  | 					if templ_7745c5c3_Err != nil { | ||||||
|  | 						return templ_7745c5c3_Err | ||||||
|  | 					} | ||||||
| 				} | 				} | ||||||
| 				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<p>") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</p></div>") | 				var templ_7745c5c3_Var10 string | ||||||
|  | 				templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(c.CommentText) | ||||||
|  | 				if templ_7745c5c3_Err != nil { | ||||||
|  | 					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 38, Col: 43} | ||||||
|  | 				} | ||||||
|  | 				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) | ||||||
|  | 				if templ_7745c5c3_Err != nil { | ||||||
|  | 					return templ_7745c5c3_Err | ||||||
|  | 				} | ||||||
|  | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</p></div>") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</div></div>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</div></div>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -197,108 +235,108 @@ func commentForm(form forms.CommentCreateForm) templ.Component { | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var9 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var11 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var9 == nil { | 		if templ_7745c5c3_Var11 == nil { | ||||||
| 			templ_7745c5c3_Var9 = templ.NopComponent | 			templ_7745c5c3_Var11 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<div><label for=\"authorname\">Name: </label>") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<div><label for=\"authorname\">Name: </label>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		error, exists := form.FieldErrors["authorName"] | 		error, exists := form.FieldErrors["authorName"] | ||||||
| 		if exists { | 		if exists { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<label class=\"error\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<label class=\"error\">") | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			var templ_7745c5c3_Var10 string |  | ||||||
| 			templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(error) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 46, Col: 36} |  | ||||||
| 			} |  | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "</label> ") |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<input type=\"text\" name=\"authorname\" id=\"authorname\"></div><div><label for=\"authoremail\">Email: </label>") |  | ||||||
| 		if templ_7745c5c3_Err != nil { |  | ||||||
| 			return templ_7745c5c3_Err |  | ||||||
| 		} |  | ||||||
| 		error, exists = form.FieldErrors["authorEmail"] |  | ||||||
| 		if exists { |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<label class=\"error\">") |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			var templ_7745c5c3_Var11 string |  | ||||||
| 			templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(error) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 54, Col: 36} |  | ||||||
| 			} |  | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</label> ") |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<input type=\"text\" name=\"authoremail\" id=\"authoremail\"></div><div><label for=\"authorsite\">Site Url: </label>") |  | ||||||
| 		if templ_7745c5c3_Err != nil { |  | ||||||
| 			return templ_7745c5c3_Err |  | ||||||
| 		} |  | ||||||
| 		error, exists = form.FieldErrors["authorSite"] |  | ||||||
| 		if exists { |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<label class=\"error\">") |  | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var12 string | 			var templ_7745c5c3_Var12 string | ||||||
| 			templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(error) | 			templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(error) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 62, Col: 36} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 52, Col: 36} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "</label> ") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</label> ") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<input type=\"text\" name=\"authorsite\" id=\"authorsite\"></div><div><label for=\"content\">Comment: </label>") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<input type=\"text\" name=\"authorname\" id=\"authorname\"></div><div><label for=\"authoremail\">Email: </label>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		error, exists = form.FieldErrors["content"] | 		error, exists = form.FieldErrors["authorEmail"] | ||||||
| 		if exists { | 		if exists { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<label class=\"error\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<label class=\"error\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var13 string | 			var templ_7745c5c3_Var13 string | ||||||
| 			templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(error) | 			templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(error) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 70, Col: 36} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 60, Col: 36} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "</label> ") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</label> ") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<textarea name=\"content\" id=\"content\"></textarea></div><div><input type=\"submit\" value=\"Submit\"></div>") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<input type=\"text\" name=\"authoremail\" id=\"authoremail\"></div><div><label for=\"authorsite\">Site Url: </label>") | ||||||
|  | 		if templ_7745c5c3_Err != nil { | ||||||
|  | 			return templ_7745c5c3_Err | ||||||
|  | 		} | ||||||
|  | 		error, exists = form.FieldErrors["authorSite"] | ||||||
|  | 		if exists { | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<label class=\"error\">") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			var templ_7745c5c3_Var14 string | ||||||
|  | 			templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(error) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 68, Col: 36} | ||||||
|  | 			} | ||||||
|  | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "</label> ") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<input type=\"text\" name=\"authorsite\" id=\"authorsite\"></div><div><label for=\"content\">Comment: </label>") | ||||||
|  | 		if templ_7745c5c3_Err != nil { | ||||||
|  | 			return templ_7745c5c3_Err | ||||||
|  | 		} | ||||||
|  | 		error, exists = form.FieldErrors["content"] | ||||||
|  | 		if exists { | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<label class=\"error\">") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			var templ_7745c5c3_Var15 string | ||||||
|  | 			templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(error) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 76, Col: 36} | ||||||
|  | 			} | ||||||
|  | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</label> ") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<textarea name=\"content\" id=\"content\"></textarea></div><div><input type=\"submit\" value=\"Submit\"></div>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| @ -322,58 +360,58 @@ func GuestbookCommentList(comments []models.GuestbookComment) templ.Component { | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var14 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var16 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var14 == nil { | 		if templ_7745c5c3_Var16 == nil { | ||||||
| 			templ_7745c5c3_Var14 = templ.NopComponent | 			templ_7745c5c3_Var16 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		if len(comments) == 0 { | 		if len(comments) == 0 { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<p>No comments yet!</p>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<p>No comments yet!</p>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		for _, c := range comments { | 		for _, c := range comments { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<div><strong>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<div><strong>") | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			var templ_7745c5c3_Var15 string |  | ||||||
| 			templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(c.AuthorName) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 85, Col: 34} |  | ||||||
| 			} |  | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "</strong> ") |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			var templ_7745c5c3_Var16 string |  | ||||||
| 			templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(c.Created.Format("01-02-2006 03:04PM")) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 86, Col: 52} |  | ||||||
| 			} |  | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<p>") |  | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var17 string | 			var templ_7745c5c3_Var17 string | ||||||
| 			templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(c.CommentText) | 			templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(c.AuthorName) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 88, Col: 31} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 91, Col: 34} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</p></div>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</strong> ") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			var templ_7745c5c3_Var18 string | ||||||
|  | 			templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(c.Created.Format("01-02-2006 03:04PM")) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 92, Col: 52} | ||||||
|  | 			} | ||||||
|  | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "<p>") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			var templ_7745c5c3_Var19 string | ||||||
|  | 			templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(c.CommentText) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 94, Col: 31} | ||||||
|  | 			} | ||||||
|  | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</p></div>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -398,9 +436,9 @@ func GuestbookView(title string, data CommonData, website models.Website, guestb | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var18 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var20 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var18 == nil { | 		if templ_7745c5c3_Var20 == nil { | ||||||
| 			templ_7745c5c3_Var18 = templ.NopComponent | 			templ_7745c5c3_Var20 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		postUrl := fmt.Sprintf("/websites/%s/guestbook/comments/create", shortIdToSlug(website.ShortId)) | 		postUrl := fmt.Sprintf("/websites/%s/guestbook/comments/create", shortIdToSlug(website.ShortId)) | ||||||
| @ -410,42 +448,55 @@ func GuestbookView(title string, data CommonData, website models.Website, guestb | |||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<div id=\"main\"><div><h1>Guestbook for ") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "<html><head><title>") | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			var templ_7745c5c3_Var19 string |  | ||||||
| 			templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(website.SiteUrl) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 101, Col: 51} |  | ||||||
| 			} |  | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "</h1><form action=\"") |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			var templ_7745c5c3_Var20 templ.SafeURL = templ.URL(postUrl) |  | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var20))) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "\" method=\"post\"><input type=\"hidden\" name=\"csrf_token\" value=\"") |  | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var21 string | 			var templ_7745c5c3_Var21 string | ||||||
| 			templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(data.CSRFToken) | 			templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(title) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 103, Col: 80} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 107, Col: 26} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</title></head><body><main><div><h1>Guestbook for ") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			var templ_7745c5c3_Var22 string | ||||||
|  | 			templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(website.SiteUrl) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 112, Col: 59} | ||||||
|  | 			} | ||||||
|  | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "</h1><form action=\"") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			var templ_7745c5c3_Var23 templ.SafeURL = templ.URL(postUrl) | ||||||
|  | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var23))) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "\" method=\"post\"><input type=\"hidden\" name=\"csrf_token\" value=\"") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			var templ_7745c5c3_Var24 string | ||||||
|  | 			templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(data.CSRFToken) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 114, Col: 88} | ||||||
|  | 			} | ||||||
|  | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -453,7 +504,7 @@ func GuestbookView(title string, data CommonData, website models.Website, guestb | |||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</form></div><div id=\"comments\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</form></div><div id=\"comments\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -461,7 +512,7 @@ func GuestbookView(title string, data CommonData, website models.Website, guestb | |||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</div></div>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</div></main></body></html>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -486,27 +537,27 @@ func CreateGuestbookComment(title string, data CommonData, website models.Websit | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var22 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var25 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var22 == nil { | 		if templ_7745c5c3_Var25 == nil { | ||||||
| 			templ_7745c5c3_Var22 = templ.NopComponent | 			templ_7745c5c3_Var25 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		postUrl := fmt.Sprintf("/websites/%s/guestbook/comments/create", shortIdToSlug(website.ShortId)) | 		postUrl := fmt.Sprintf("/websites/%s/guestbook/comments/create", shortIdToSlug(website.ShortId)) | ||||||
| 		if data.IsHtmx { | 		if data.IsHtmx { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<form hx-post=\"") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<form hx-post=\"") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var23 string | 			var templ_7745c5c3_Var26 string | ||||||
| 			templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(postUrl) | 			templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(postUrl) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 117, Col: 31} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/guestbooks.templ`, Line: 130, Col: 31} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "\" hx-target=\"closest div\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "\" hx-target=\"closest div\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -514,12 +565,12 @@ func CreateGuestbookComment(title string, data CommonData, website models.Websit | |||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</form>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</form>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			templ_7745c5c3_Var24 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | 			templ_7745c5c3_Var27 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | ||||||
| 				templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | 				templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | ||||||
| 				templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | 				templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | ||||||
| 				if !templ_7745c5c3_IsBuffer { | 				if !templ_7745c5c3_IsBuffer { | ||||||
| @ -531,16 +582,16 @@ func CreateGuestbookComment(title string, data CommonData, website models.Websit | |||||||
| 					}() | 					}() | ||||||
| 				} | 				} | ||||||
| 				ctx = templ.InitializeContext(ctx) | 				ctx = templ.InitializeContext(ctx) | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<form action=\"") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<form action=\"") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				var templ_7745c5c3_Var25 templ.SafeURL = templ.URL(postUrl) | 				var templ_7745c5c3_Var28 templ.SafeURL = templ.URL(postUrl) | ||||||
| 				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var25))) | 				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var28))) | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "\" method=\"post\">") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "\" method=\"post\">") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| @ -548,13 +599,13 @@ func CreateGuestbookComment(title string, data CommonData, website models.Websit | |||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</form>") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</form>") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				return nil | 				return nil | ||||||
| 			}) | 			}) | ||||||
| 			templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var24), templ_7745c5c3_Buffer) | 			templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var27), templ_7745c5c3_Buffer) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
|  | |||||||
| @ -6,6 +6,10 @@ | |||||||
| <p>No comments yet!</p> | <p>No comments yet!</p> | ||||||
| <div><strong> | <div><strong> | ||||||
| </strong>  | </strong>  | ||||||
|  |   | ||||||
|  | <a href=\"#\" hx-delete=\" | ||||||
|  | \" hx-target=\"closest div\" hx-headers=\" | ||||||
|  | \">Delete</a> | ||||||
| <p> | <p> | ||||||
| </p></div> | </p></div> | ||||||
| </div></div> | </div></div> | ||||||
| @ -27,12 +31,13 @@ | |||||||
| </strong>  | </strong>  | ||||||
| <p> | <p> | ||||||
| </p></div> | </p></div> | ||||||
| <div id=\"main\"><div><h1>Guestbook for  | <html><head><title> | ||||||
|  | </title></head><body><main><div><h1>Guestbook for  | ||||||
| </h1><form action=\" | </h1><form action=\" | ||||||
| \" method=\"post\"><input type=\"hidden\" name=\"csrf_token\" value=\" | \" method=\"post\"><input type=\"hidden\" name=\"csrf_token\" value=\" | ||||||
| \"> | \"> | ||||||
| </form></div><div id=\"comments\"> | </form></div><div id=\"comments\"> | ||||||
| </div></div> | </div></main></body></html> | ||||||
| <form hx-post=\" | <form hx-post=\" | ||||||
| \" hx-target=\"closest div\"> | \" hx-target=\"closest div\"> | ||||||
| </form> | </form> | ||||||
|  | |||||||
| @ -6,6 +6,9 @@ templ Home(title string, data CommonData) { | |||||||
|         <p> |         <p> | ||||||
|             Welcome to webweav.ing, a collection of webmastery tools created by the <a href="https://32bit.cafe">32-Bit Cafe</a>. |             Welcome to webweav.ing, a collection of webmastery tools created by the <a href="https://32bit.cafe">32-Bit Cafe</a>. | ||||||
|         </p> |         </p> | ||||||
|  |         <p> | ||||||
|  |             Note this service is in a pre-alpha state. Your account and data can disappear at any time.  | ||||||
|  |         </p> | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -41,7 +41,7 @@ func Home(title string, data CommonData) templ.Component { | |||||||
| 				}() | 				}() | ||||||
| 			} | 			} | ||||||
| 			ctx = templ.InitializeContext(ctx) | 			ctx = templ.InitializeContext(ctx) | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<h2>Welcome</h2><p>Welcome to webweav.ing, a collection of webmastery tools created by the <a href=\"https://32bit.cafe\">32-Bit Cafe</a>.</p>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<h2>Welcome</h2><p>Welcome to webweav.ing, a collection of webmastery tools created by the <a href=\"https://32bit.cafe\">32-Bit Cafe</a>.</p><p>Note this service is in a pre-alpha state. Your account and data can disappear at any time. </p>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
|  | |||||||
| @ -1,2 +1,2 @@ | |||||||
| <h2>Welcome</h2><p>Welcome to webweav.ing, a collection of webmastery tools created by the <a href=\"https://32bit.cafe\">32-Bit Cafe</a>.</p> | <h2>Welcome</h2><p>Welcome to webweav.ing, a collection of webmastery tools created by the <a href=\"https://32bit.cafe\">32-Bit Cafe</a>.</p><p>Note this service is in a pre-alpha state. Your account and data can disappear at any time. </p> | ||||||
| <h2>Coming Soon</h2> | <h2>Coming Soon</h2> | ||||||
| @ -13,6 +13,7 @@ templ wSidebar(website models.Website) { | |||||||
|     {{ gbUrl := wUrl(website) + "/guestbook" }} |     {{ gbUrl := wUrl(website) + "/guestbook" }} | ||||||
|     <nav> |     <nav> | ||||||
|         <div> |         <div> | ||||||
|  |             <h2>{ website.Name}</h2> | ||||||
|             <ul> |             <ul> | ||||||
|                 <li><a href={ templ.URL(dashUrl) }>Dashboard</a></li> |                 <li><a href={ templ.URL(dashUrl) }>Dashboard</a></li> | ||||||
|                 <li><a href={ templ.URL(website.SiteUrl) }>View Website</a></li> |                 <li><a href={ templ.URL(website.SiteUrl) }>View Website</a></li> | ||||||
|  | |||||||
| @ -39,88 +39,101 @@ func wSidebar(website models.Website) templ.Component { | |||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		dashUrl := wUrl(website) + "/dashboard" | 		dashUrl := wUrl(website) + "/dashboard" | ||||||
| 		gbUrl := wUrl(website) + "/guestbook" | 		gbUrl := wUrl(website) + "/guestbook" | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<nav><div><ul><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<nav><div><h2>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var2 templ.SafeURL = templ.URL(dashUrl) | 		var templ_7745c5c3_Var2 string | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var2))) | 		templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(website.Name) | ||||||
|  | 		if templ_7745c5c3_Err != nil { | ||||||
|  | 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 16, Col: 30} | ||||||
|  | 		} | ||||||
|  | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\">Dashboard</a></li><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "</h2><ul><li><a href=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var3 templ.SafeURL = templ.URL(website.SiteUrl) | 		var templ_7745c5c3_Var3 templ.SafeURL = templ.URL(dashUrl) | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var3))) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var3))) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\">View Website</a></li></ul><h3>Guestbook</h3><ul><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\">Dashboard</a></li><li><a href=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var4 templ.SafeURL = templ.URL(gbUrl) | 		var templ_7745c5c3_Var4 templ.SafeURL = templ.URL(website.SiteUrl) | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var4))) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var4))) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" target=\"_blank\">View Guestbook</a></li></ul><ul><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\">View Website</a></li></ul><h3>Guestbook</h3><ul><li><a href=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var5 templ.SafeURL = templ.URL(dashUrl + "/guestbook/comments") | 		var templ_7745c5c3_Var5 templ.SafeURL = templ.URL(gbUrl) | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var5))) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var5))) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\">Manage messages</a></li><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" target=\"_blank\">View Guestbook</a></li></ul><ul><li><a href=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var6 templ.SafeURL = templ.URL(dashUrl + "/guestbook/comments/queue") | 		var templ_7745c5c3_Var6 templ.SafeURL = templ.URL(dashUrl + "/guestbook/comments") | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var6))) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var6))) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\">Review message queue</a></li><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\">Manage messages</a></li><li><a href=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var7 templ.SafeURL = templ.URL(dashUrl + "/guestbook/blocklist") | 		var templ_7745c5c3_Var7 templ.SafeURL = templ.URL(dashUrl + "/guestbook/comments/queue") | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var7))) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var7))) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\">Block users</a></li><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\">Review message queue</a></li><li><a href=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var8 templ.SafeURL = templ.URL(dashUrl + "/guestbook/comments/trash") | 		var templ_7745c5c3_Var8 templ.SafeURL = templ.URL(dashUrl + "/guestbook/blocklist") | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var8))) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var8))) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\">Trash</a></li></ul><ul><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\">Block users</a></li><li><a href=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var9 templ.SafeURL = templ.URL(dashUrl + "/guestbook/themes") | 		var templ_7745c5c3_Var9 templ.SafeURL = templ.URL(dashUrl + "/guestbook/comments/trash") | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var9))) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var9))) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\">Themes</a></li><li><a href=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\">Trash</a></li></ul><ul><li><a href=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var10 templ.SafeURL = templ.URL(dashUrl + "/guestbook/customize") | 		var templ_7745c5c3_Var10 templ.SafeURL = templ.URL(dashUrl + "/guestbook/themes") | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var10))) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var10))) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\">Custom CSS</a></li></ul></div><div><h3>Feeds</h3><p>Coming Soon</p></div><div><h3>Account</h3><ul><li><a href=\"/users/settings\">Settings</a></li><li><a href=\"/users/privacy\">Privacy</a></li><li><a href=\"/help\">Help</a></li></ul></div></nav>") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\">Themes</a></li><li><a href=\"") | ||||||
|  | 		if templ_7745c5c3_Err != nil { | ||||||
|  | 			return templ_7745c5c3_Err | ||||||
|  | 		} | ||||||
|  | 		var templ_7745c5c3_Var11 templ.SafeURL = templ.URL(dashUrl + "/guestbook/customize") | ||||||
|  | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var11))) | ||||||
|  | 		if templ_7745c5c3_Err != nil { | ||||||
|  | 			return templ_7745c5c3_Err | ||||||
|  | 		} | ||||||
|  | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\">Custom CSS</a></li></ul></div><div><h3>Feeds</h3><p>Coming Soon</p></div><div><h3>Account</h3><ul><li><a href=\"/users/settings\">Settings</a></li><li><a href=\"/users/privacy\">Privacy</a></li><li><a href=\"/help\">Help</a></li></ul></div></nav>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| @ -144,50 +157,50 @@ func displayWebsites(websites []models.Website) templ.Component { | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var11 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var12 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var11 == nil { | 		if templ_7745c5c3_Var12 == nil { | ||||||
| 			templ_7745c5c3_Var11 = templ.NopComponent | 			templ_7745c5c3_Var12 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		if len(websites) == 0 { | 		if len(websites) == 0 { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "<p>No Websites yet. <a href=\"\">Register a website.</a></p>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<p>No Websites yet. <a href=\"\">Register a website.</a></p>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "<ul id=\"websites\" hx-get=\"/websites\" hx-trigger=\"newWebsite from:body\" hx-swap=\"outerHTML\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<ul id=\"websites\" hx-get=\"/websites\" hx-trigger=\"newWebsite from:body\" hx-swap=\"outerHTML\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			for _, w := range websites { | 			for _, w := range websites { | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<li><a href=\"") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "<li><a href=\"") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				var templ_7745c5c3_Var12 templ.SafeURL = templ.URL(wUrl(w) + "/dashboard") | 				var templ_7745c5c3_Var13 templ.SafeURL = templ.URL(wUrl(w) + "/dashboard") | ||||||
| 				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var12))) | 				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var13))) | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\">") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\">") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				var templ_7745c5c3_Var13 string | 				var templ_7745c5c3_Var14 string | ||||||
| 				templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(w.Name) | 				templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(w.Name) | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 57, Col: 73} | 					return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 58, Col: 73} | ||||||
| 				} | 				} | ||||||
| 				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) | 				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "</a></li>") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</a></li>") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</ul>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</ul>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -212,109 +225,109 @@ func websiteCreateForm(csrfToken string, form forms.WebsiteCreateForm) templ.Com | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var14 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var15 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var14 == nil { | 		if templ_7745c5c3_Var15 == nil { | ||||||
| 			templ_7745c5c3_Var14 = templ.NopComponent | 			templ_7745c5c3_Var15 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "<input type=\"hidden\" name=\"csrf_token\" value=\"") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<input type=\"hidden\" name=\"csrf_token\" value=\"") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		var templ_7745c5c3_Var15 string | 		var templ_7745c5c3_Var16 string | ||||||
| 		templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(csrfToken) | 		templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(csrfToken) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 65, Col: 59} | 			return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 66, Col: 59} | ||||||
| 		} | 		} | ||||||
| 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) | 		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\"><div>") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "\"><div>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		err, exists := form.FieldErrors["sitename"] | 		err, exists := form.FieldErrors["sitename"] | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<label for=\"sitename\">Site Name: </label> ") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<label for=\"sitename\">Site Name: </label> ") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		if exists { | 		if exists { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "<label class=\"error\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<label class=\"error\">") | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			var templ_7745c5c3_Var16 string |  | ||||||
| 			templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(err) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 70, Col: 38} |  | ||||||
| 			} |  | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "</label> ") |  | ||||||
| 			if templ_7745c5c3_Err != nil { |  | ||||||
| 				return templ_7745c5c3_Err |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<input type=\"text\" name=\"sitename\" id=\"sitename\" required></div><div>") |  | ||||||
| 		if templ_7745c5c3_Err != nil { |  | ||||||
| 			return templ_7745c5c3_Err |  | ||||||
| 		} |  | ||||||
| 		err, exists = form.FieldErrors["siteurl"] |  | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<label for=\"siteurl\">Site URL: </label> ") |  | ||||||
| 		if templ_7745c5c3_Err != nil { |  | ||||||
| 			return templ_7745c5c3_Err |  | ||||||
| 		} |  | ||||||
| 		if exists { |  | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<label class=\"error\">") |  | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var17 string | 			var templ_7745c5c3_Var17 string | ||||||
| 			templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(err) | 			templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(err) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 78, Col: 38} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 71, Col: 38} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "</label> ") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</label> ") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "<input type=\"text\" name=\"siteurl\" id=\"siteurl\" required></div><div>") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<input type=\"text\" name=\"sitename\" id=\"sitename\" required></div><div>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		err, exists = form.FieldErrors["authorname"] | 		err, exists = form.FieldErrors["siteurl"] | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "<label for=\"authorname\">Site Author: </label> ") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "<label for=\"siteurl\">Site URL: </label> ") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| 		if exists { | 		if exists { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<label class=\"error\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<label class=\"error\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var18 string | 			var templ_7745c5c3_Var18 string | ||||||
| 			templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(err) | 			templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(err) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 86, Col: 38} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 79, Col: 38} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</label> ") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "</label> ") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "<input type=\"text\" name=\"authorname\" id=\"authorname\" required></div><div><button type=\"submit\">Submit</button></div>") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "<input type=\"text\" name=\"siteurl\" id=\"siteurl\" required></div><div>") | ||||||
|  | 		if templ_7745c5c3_Err != nil { | ||||||
|  | 			return templ_7745c5c3_Err | ||||||
|  | 		} | ||||||
|  | 		err, exists = form.FieldErrors["authorname"] | ||||||
|  | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "<label for=\"authorname\">Site Author: </label> ") | ||||||
|  | 		if templ_7745c5c3_Err != nil { | ||||||
|  | 			return templ_7745c5c3_Err | ||||||
|  | 		} | ||||||
|  | 		if exists { | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "<label class=\"error\">") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			var templ_7745c5c3_Var19 string | ||||||
|  | 			templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(err) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 87, Col: 38} | ||||||
|  | 			} | ||||||
|  | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</label> ") | ||||||
|  | 			if templ_7745c5c3_Err != nil { | ||||||
|  | 				return templ_7745c5c3_Err | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<input type=\"text\" name=\"authorname\" id=\"authorname\" required></div><div><button type=\"submit\">Submit</button></div>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| @ -338,12 +351,12 @@ func WebsiteCreateButton() templ.Component { | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var19 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var20 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var19 == nil { | 		if templ_7745c5c3_Var20 == nil { | ||||||
| 			templ_7745c5c3_Var19 = templ.NopComponent | 			templ_7745c5c3_Var20 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "<button hx-get=\"/websites/create\" hx-target=\"closest div\">Add Website</button>") | 		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "<button hx-get=\"/websites/create\" hx-target=\"closest div\">Add Website</button>") | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| @ -367,9 +380,9 @@ func WebsiteList(title string, data CommonData, websites []models.Website) templ | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var20 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var21 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var20 == nil { | 		if templ_7745c5c3_Var21 == nil { | ||||||
| 			templ_7745c5c3_Var20 = templ.NopComponent | 			templ_7745c5c3_Var21 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		if data.IsHtmx { | 		if data.IsHtmx { | ||||||
| @ -378,7 +391,7 @@ func WebsiteList(title string, data CommonData, websites []models.Website) templ | |||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			templ_7745c5c3_Var21 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | 			templ_7745c5c3_Var22 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | ||||||
| 				templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | 				templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | ||||||
| 				templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | 				templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | ||||||
| 				if !templ_7745c5c3_IsBuffer { | 				if !templ_7745c5c3_IsBuffer { | ||||||
| @ -390,7 +403,7 @@ func WebsiteList(title string, data CommonData, websites []models.Website) templ | |||||||
| 					}() | 					}() | ||||||
| 				} | 				} | ||||||
| 				ctx = templ.InitializeContext(ctx) | 				ctx = templ.InitializeContext(ctx) | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "<h1>My Websites</h1><div>") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "<h1>My Websites</h1><div>") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| @ -398,7 +411,7 @@ func WebsiteList(title string, data CommonData, websites []models.Website) templ | |||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</div><div>") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</div><div>") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| @ -406,13 +419,13 @@ func WebsiteList(title string, data CommonData, websites []models.Website) templ | |||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</div>") | 				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "</div>") | ||||||
| 				if templ_7745c5c3_Err != nil { | 				if templ_7745c5c3_Err != nil { | ||||||
| 					return templ_7745c5c3_Err | 					return templ_7745c5c3_Err | ||||||
| 				} | 				} | ||||||
| 				return nil | 				return nil | ||||||
| 			}) | 			}) | ||||||
| 			templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer) | 			templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var22), templ_7745c5c3_Buffer) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -437,12 +450,12 @@ func WebsiteDashboard(title string, data CommonData, website models.Website) tem | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var22 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var23 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var22 == nil { | 		if templ_7745c5c3_Var23 == nil { | ||||||
| 			templ_7745c5c3_Var22 = templ.NopComponent | 			templ_7745c5c3_Var23 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		templ_7745c5c3_Var23 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | 		templ_7745c5c3_Var24 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | ||||||
| 			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | 			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | ||||||
| 			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | 			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | ||||||
| 			if !templ_7745c5c3_IsBuffer { | 			if !templ_7745c5c3_IsBuffer { | ||||||
| @ -454,7 +467,7 @@ func WebsiteDashboard(title string, data CommonData, website models.Website) tem | |||||||
| 				}() | 				}() | ||||||
| 			} | 			} | ||||||
| 			ctx = templ.InitializeContext(ctx) | 			ctx = templ.InitializeContext(ctx) | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<div id=\"dashboard\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<div id=\"dashboard\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -462,26 +475,26 @@ func WebsiteDashboard(title string, data CommonData, website models.Website) tem | |||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "<div><h1>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "<div><h1>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var24 string | 			var templ_7745c5c3_Var25 string | ||||||
| 			templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(website.Name) | 			templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(website.Name) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 120, Col: 34} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 121, Col: 34} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "</h1><p>Stats and stuff will go here.</p></div></div>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</h1><p>Stats and stuff will go here.</p></div></div>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			return nil | 			return nil | ||||||
| 		}) | 		}) | ||||||
| 		templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var23), templ_7745c5c3_Buffer) | 		templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var24), templ_7745c5c3_Buffer) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| @ -505,12 +518,12 @@ func WebsiteDashboardComingSoon(title string, data CommonData, website models.We | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var25 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var26 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var25 == nil { | 		if templ_7745c5c3_Var26 == nil { | ||||||
| 			templ_7745c5c3_Var25 = templ.NopComponent | 			templ_7745c5c3_Var26 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		templ_7745c5c3_Var26 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | 		templ_7745c5c3_Var27 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { | ||||||
| 			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | 			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context | ||||||
| 			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | 			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) | ||||||
| 			if !templ_7745c5c3_IsBuffer { | 			if !templ_7745c5c3_IsBuffer { | ||||||
| @ -522,7 +535,7 @@ func WebsiteDashboardComingSoon(title string, data CommonData, website models.We | |||||||
| 				}() | 				}() | ||||||
| 			} | 			} | ||||||
| 			ctx = templ.InitializeContext(ctx) | 			ctx = templ.InitializeContext(ctx) | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "<div id=\"dashboard\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<div id=\"dashboard\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -530,26 +543,26 @@ func WebsiteDashboardComingSoon(title string, data CommonData, website models.We | |||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "<div><h1>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "<div><h1>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			var templ_7745c5c3_Var27 string | 			var templ_7745c5c3_Var28 string | ||||||
| 			templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(website.Name) | 			templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(website.Name) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 134, Col: 34} | 				return templ.Error{Err: templ_7745c5c3_Err, FileName: `ui/views/websites.templ`, Line: 135, Col: 34} | ||||||
| 			} | 			} | ||||||
| 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) | 			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</h1><p>Coming Soon</p></div></div>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "</h1><p>Coming Soon</p></div></div>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			return nil | 			return nil | ||||||
| 		}) | 		}) | ||||||
| 		templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var26), templ_7745c5c3_Buffer) | 		templ_7745c5c3_Err = base(title, data).Render(templ.WithChildren(ctx, templ_7745c5c3_Var27), templ_7745c5c3_Buffer) | ||||||
| 		if templ_7745c5c3_Err != nil { | 		if templ_7745c5c3_Err != nil { | ||||||
| 			return templ_7745c5c3_Err | 			return templ_7745c5c3_Err | ||||||
| 		} | 		} | ||||||
| @ -573,13 +586,13 @@ func WebsiteCreate(title string, data CommonData, form forms.WebsiteCreateForm) | |||||||
| 			}() | 			}() | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.InitializeContext(ctx) | 		ctx = templ.InitializeContext(ctx) | ||||||
| 		templ_7745c5c3_Var28 := templ.GetChildren(ctx) | 		templ_7745c5c3_Var29 := templ.GetChildren(ctx) | ||||||
| 		if templ_7745c5c3_Var28 == nil { | 		if templ_7745c5c3_Var29 == nil { | ||||||
| 			templ_7745c5c3_Var28 = templ.NopComponent | 			templ_7745c5c3_Var29 = templ.NopComponent | ||||||
| 		} | 		} | ||||||
| 		ctx = templ.ClearChildren(ctx) | 		ctx = templ.ClearChildren(ctx) | ||||||
| 		if data.IsHtmx { | 		if data.IsHtmx { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<form hx-post=\"/websites/create\" hx-target=\"closest div\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<form hx-post=\"/websites/create\" hx-target=\"closest div\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -587,12 +600,12 @@ func WebsiteCreate(title string, data CommonData, form forms.WebsiteCreateForm) | |||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "</form>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "</form>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 		} else { | 		} else { | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "<form action=\"/websites/create\" method=\"post\">") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<form action=\"/websites/create\" method=\"post\">") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| @ -600,7 +613,7 @@ func WebsiteCreate(title string, data CommonData, form forms.WebsiteCreateForm) | |||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
| 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "</form>") | 			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "</form>") | ||||||
| 			if templ_7745c5c3_Err != nil { | 			if templ_7745c5c3_Err != nil { | ||||||
| 				return templ_7745c5c3_Err | 				return templ_7745c5c3_Err | ||||||
| 			} | 			} | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| <nav><div><ul><li><a href=\" | <nav><div><h2> | ||||||
|  | </h2><ul><li><a href=\" | ||||||
| \">Dashboard</a></li><li><a href=\" | \">Dashboard</a></li><li><a href=\" | ||||||
| \">View Website</a></li></ul><h3>Guestbook</h3><ul><li><a href=\" | \">View Website</a></li></ul><h3>Guestbook</h3><ul><li><a href=\" | ||||||
| \" target=\"_blank\">View Guestbook</a></li></ul><ul><li><a href=\" | \" target=\"_blank\">View Guestbook</a></li></ul><ul><li><a href=\" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user