Changed layout to have dynamic page title

This commit is contained in:
2025-03-01 21:27:23 +11:00
parent 141b541e98
commit 9e12f946b3
10 changed files with 11 additions and 11 deletions

View File

@@ -6,7 +6,7 @@ import "projectreshoot/view/component/popup"
// Global page layout. Includes HTML document settings, header tags // Global page layout. Includes HTML document settings, header tags
// navbar and footer // navbar and footer
templ Global() { templ Global(title string) {
<!DOCTYPE html> <!DOCTYPE html>
<html <html
lang="en" lang="en"
@@ -33,7 +33,7 @@ templ Global() {
</script> </script>
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Project Reshoot</title> <title>{ title }</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico"/> <link rel="icon" type="image/x-icon" href="/static/favicon.ico"/>
<link href="/static/css/output.css" rel="stylesheet"/> <link href="/static/css/output.css" rel="stylesheet"/>
<script src="https://unpkg.com/htmx.org@2.0.4" integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin="anonymous"></script> <script src="https://unpkg.com/htmx.org@2.0.4" integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" crossorigin="anonymous"></script>

View File

@@ -4,7 +4,7 @@ import "projectreshoot/view/layout"
// Returns the about page content // Returns the about page content
templ About() { templ About() {
@layout.Global() { @layout.Global("About") {
<div class="text-center max-w-150 m-auto"> <div class="text-center max-w-150 m-auto">
<div class="text-4xl mt-8">About</div> <div class="text-4xl mt-8">About</div>
<div class="text-xl font-bold mt-4">What is Project Reshoot?</div> <div class="text-xl font-bold mt-4">What is Project Reshoot?</div>

View File

@@ -4,7 +4,7 @@ import "projectreshoot/view/layout"
import "projectreshoot/view/component/account" import "projectreshoot/view/component/account"
templ Account(subpage string) { templ Account(subpage string) {
@layout.Global() { @layout.Global("Account - " + subpage) {
@account.AccountContainer(subpage) @account.AccountContainer(subpage)
} }
} }

View File

@@ -7,7 +7,7 @@ import "strconv"
// a string, and err should be the corresponding response title. // a string, and err should be the corresponding response title.
// Message is a custom error message displayed below the code and error. // Message is a custom error message displayed below the code and error.
templ Error(code int, err string, message string) { templ Error(code int, err string, message string) {
@layout.Global() { @layout.Global(err) {
<div <div
class="grid mt-24 left-0 right-0 top-0 bottom-0 class="grid mt-24 left-0 right-0 top-0 bottom-0
place-content-center bg-base px-4" place-content-center bg-base px-4"

View File

@@ -4,7 +4,7 @@ import "projectreshoot/view/layout"
// Page content for the index page // Page content for the index page
templ Index() { templ Index() {
@layout.Global() { @layout.Global("Project Reshoot") {
<div class="text-center mt-24"> <div class="text-center mt-24">
<div class="text-4xl lg:text-6xl">Project Reshoot</div> <div class="text-4xl lg:text-6xl">Project Reshoot</div>
<div>A better way to discover and rate films</div> <div>A better way to discover and rate films</div>

View File

@@ -5,7 +5,7 @@ import "projectreshoot/view/component/form"
// Returns the login page // Returns the login page
templ Login() { templ Login() {
@layout.Global() { @layout.Global("Login") {
<div class="max-w-100 mx-auto px-2"> <div class="max-w-100 mx-auto px-2">
<div class="mt-7 bg-mantle border border-surface1 rounded-xl"> <div class="mt-7 bg-mantle border border-surface1 rounded-xl">
<div class="p-4 sm:p-7"> <div class="p-4 sm:p-7">

View File

@@ -4,7 +4,7 @@ import "projectreshoot/tmdb"
import "projectreshoot/view/layout" import "projectreshoot/view/layout"
templ Movie(movie *tmdb.Movie, credits *tmdb.Credits, image *tmdb.Image) { templ Movie(movie *tmdb.Movie, credits *tmdb.Credits, image *tmdb.Image) {
@layout.Global() { @layout.Global(movie.Title) {
<div class="md:bg-surface0 md:p-2 md:rounded-lg transition-all"> <div class="md:bg-surface0 md:p-2 md:rounded-lg transition-all">
<div <div
id="billedcrew" id="billedcrew"

View File

@@ -3,7 +3,7 @@ package page
import "projectreshoot/view/layout" import "projectreshoot/view/layout"
templ Movies() { templ Movies() {
@layout.Global() { @layout.Global("Search movies") {
<div class="max-w-4xl mx-auto md:mt-0 mt-2 px-2 md:px-0"> <div class="max-w-4xl mx-auto md:mt-0 mt-2 px-2 md:px-0">
<form hx-post="/search-movies" hx-target="#search-movies-results"> <form hx-post="/search-movies" hx-target="#search-movies-results">
<div <div

View File

@@ -5,7 +5,7 @@ import "projectreshoot/contexts"
templ Profile() { templ Profile() {
{{ user := contexts.GetUser(ctx) }} {{ user := contexts.GetUser(ctx) }}
@layout.Global() { @layout.Global("Profile - " + user.Username) {
<div class=""> <div class="">
Hello, { user.Username } Hello, { user.Username }
</div> </div>

View File

@@ -5,7 +5,7 @@ import "projectreshoot/view/component/form"
// Returns the login page // Returns the login page
templ Register() { templ Register() {
@layout.Global() { @layout.Global("Register") {
<div class="max-w-100 mx-auto px-2"> <div class="max-w-100 mx-auto px-2">
<div class="mt-7 bg-mantle border border-surface1 rounded-xl"> <div class="mt-7 bg-mantle border border-surface1 rounded-xl">
<div class="p-4 sm:p-7"> <div class="p-4 sm:p-7">