Add htmx to the project
This commit is contained in:
@ -75,7 +75,7 @@ templ form(err types.Message, title string) {
|
|||||||
</form>
|
</form>
|
||||||
<div class="text-center text-sm text-white">
|
<div class="text-center text-sm text-white">
|
||||||
Already have an account?
|
Already have an account?
|
||||||
<a class="underline" href="/signin" rel="ugc">
|
<a class="underline" href="/signin" rel="ugc" hx-get="/signin" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Sign in
|
Sign in
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,7 +13,7 @@ templ NotFound(title string){
|
|||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
class="inline-flex h-10 items-center rounded-md border border-gray-200 border-gray-200 bg-white px-8 text-sm font-medium shadow-sm gap-2 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-950"
|
class="inline-flex h-10 items-center rounded-md border border-gray-200 border-gray-200 bg-white px-8 text-sm font-medium shadow-sm gap-2 transition-colors hover:bg-gray-100 hover:text-gray-900 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-950"
|
||||||
href="/"
|
href="/" hx-get="/" hx-swap="outerHTML" hx-push-url="true" hx-target="#content"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
@ -47,7 +47,7 @@ templ InternalServerError(title string){
|
|||||||
<div class="grid gap-2">
|
<div class="grid gap-2">
|
||||||
<a
|
<a
|
||||||
class="inline-flex h-10 items-center justify-center rounded-md bg-gray-900 px-6 text-sm font-medium text-gray-50 shadow transition-colors hover:bg-gray-900/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-950 disabled:pointer-events-none disabled:opacity-50"
|
class="inline-flex h-10 items-center justify-center rounded-md bg-gray-900 px-6 text-sm font-medium text-gray-50 shadow transition-colors hover:bg-gray-900/90 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-gray-950 disabled:pointer-events-none disabled:opacity-50"
|
||||||
href="/"
|
href="/" hx-get="/" hx-swap="outerHTML" hx-push-url="true" hx-target="#content"
|
||||||
>
|
>
|
||||||
Go back to homepage
|
Go back to homepage
|
||||||
</a>
|
</a>
|
||||||
|
@ -20,12 +20,12 @@ templ content(title string, user types.User) {
|
|||||||
<div class="rounded-md shadow">
|
<div class="rounded-md shadow">
|
||||||
if user.Authenticated {
|
if user.Authenticated {
|
||||||
<a class="w-full flex items-center justify-center px-8 py-3 text-base leading-6 font-medium rounded-md text-white bg-pink-400 hover:bg-pink-500 hover:text-white focus:ring ring-offset-2 ring-pink-400 focus:outline-none transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10"
|
<a class="w-full flex items-center justify-center px-8 py-3 text-base leading-6 font-medium rounded-md text-white bg-pink-400 hover:bg-pink-500 hover:text-white focus:ring ring-offset-2 ring-pink-400 focus:outline-none transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10"
|
||||||
href="/user">
|
href="/user" hx-get="/user" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Open Dashboard
|
Open Dashboard
|
||||||
</a>
|
</a>
|
||||||
} else {
|
} else {
|
||||||
<a class="w-full flex items-center justify-center px-8 py-3 text-base leading-6 font-medium rounded-md text-white bg-pink-400 hover:bg-pink-500 hover:text-white focus:ring ring-offset-2 ring-pink-400 focus:outline-none transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10"
|
<a class="w-full flex items-center justify-center px-8 py-3 text-base leading-6 font-medium rounded-md text-white bg-pink-400 hover:bg-pink-500 hover:text-white focus:ring ring-offset-2 ring-pink-400 focus:outline-none transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10"
|
||||||
href="/signup">
|
href="/signup" hx-get="/signup" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Get started
|
Get started
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,12 @@ templ Base(title string){
|
|||||||
<meta name="author" content="Filekeeper" />
|
<meta name="author" content="Filekeeper" />
|
||||||
<link href="/public/output.css" rel="stylesheet"/>
|
<link href="/public/output.css" rel="stylesheet"/>
|
||||||
<title>{ title }</title>
|
<title>{ title }</title>
|
||||||
|
<script src="https://unpkg.com/htmx.org@1.9.12"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="content">
|
||||||
{ children... }
|
{ children... }
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
}
|
}
|
||||||
@ -70,10 +73,10 @@ templ Navbar(user types.User) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
} else {
|
} else {
|
||||||
<a href="/signup" class="text-gray-600 hover:text-gray-800">
|
<a href="/signup" class="text-gray-600 hover:text-gray-800" hx-get="/signup" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Sign up
|
Sign up
|
||||||
</a>
|
</a>
|
||||||
<a href="/signin" class="text-gray-600 hover:text-gray-800">
|
<a href="/signin" class="text-gray-600 hover:text-gray-800" hx-get="/signin" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Sign in
|
Sign in
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ templ content(err types.Message, title string) {
|
|||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<label class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-white" for="password">Password</label>
|
<label class="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-white" for="password">Password</label>
|
||||||
<a class="ml-auto inline-block text-sm underline text-gray-300 dark:text-gray-400" href="/forgot-password" rel="ugc">
|
<a class="ml-auto inline-block text-sm underline text-gray-300 dark:text-gray-400" href="/forgot-password" rel="ugc" hx-get="/forgot-password" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Forgot your password?
|
Forgot your password?
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -52,7 +52,7 @@ templ content(err types.Message, title string) {
|
|||||||
</a>
|
</a>
|
||||||
<div class="text-center text-sm text-white">
|
<div class="text-center text-sm text-white">
|
||||||
Don't have an account?
|
Don't have an account?
|
||||||
<a class="underline" href="/signup" rel="ugc">
|
<a class="underline" href="/signup" rel="ugc" hx-get="/signup" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Sign up
|
Sign up
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,7 +81,7 @@ templ form(err types.Message, title string) {
|
|||||||
</form>
|
</form>
|
||||||
<div class="text-center text-sm text-white">
|
<div class="text-center text-sm text-white">
|
||||||
Already have an account?
|
Already have an account?
|
||||||
<a class="underline" href="/signin" rel="ugc">
|
<a class="underline" href="/signin" rel="ugc" hx-get="/signin" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Sign in
|
Sign in
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -221,12 +221,12 @@ templ content(title string, user types.User, ListSession []*session.SessionInfo)
|
|||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
class="hover:bg-gray-200 inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"
|
class="hover:bg-gray-200 inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"
|
||||||
type="button" href="/upload">
|
type="button" href="/upload" hx-get="/upload" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Upload
|
Upload
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
class="hover:bg-gray-200 inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"
|
class="hover:bg-gray-200 inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"
|
||||||
type="button" href="/download">
|
type="button" href="/download" hx-get="/download" hx-swap="outerHTML" hx-push-url="true" hx-target="#content">
|
||||||
Download
|
Download
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user