Skip to content

Commit

Permalink
admin and login
Browse files Browse the repository at this point in the history
  • Loading branch information
fnwinter committed Dec 22, 2024
1 parent 8e6ec87 commit 5cff642
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 0 deletions.
44 changes: 44 additions & 0 deletions cnas/bulma_example/create_account.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Create Account</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
</head>
<body>
<section class="section">
<div class="container">
<h1 class="title">Create Account</h1>
<form>
<div class="field">
<label class="label">Email</label>
<div class="control">
<input class="input" type="email" placeholder="Enter your email" required>
</div>
</div>

<div class="field">
<label class="label">Password</label>
<div class="control">
<input class="input" type="password" placeholder="Enter your password" required>
</div>
</div>

<div class="field">
<label class="label">Confirm Password</label>
<div class="control">
<input class="input" type="password" placeholder="Confirm your password" required>
</div>
</div>

<div class="field">
<div class="control">
<button class="button is-primary">Create Account</button>
</div>
</div>
</form>
</div>
</section>
</body>
</html>
41 changes: 41 additions & 0 deletions cnas/bulma_example/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.3/css/bulma.min.css">
</head>
<body>
<section class="hero is-fullheight">
<div class="hero-body">
<div class="container">
<div class="columns is-centered">
<div class="column is-4-desktop">
<form class="box">
<h1 class="title has-text-centered">Login</h1>
<div class="field">
<label class="label">Email</label>
<div class="control">
<input class="input" type="email" placeholder="e.g. [email protected]" required>
</div>
</div>
<div class="field">
<label class="label">Password</label>
<div class="control">
<input class="input" type="password" placeholder="********" required>
</div>
</div>
<div class="field">
<div class="control">
<button class="button is-primary is-fullwidth">Login</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
</body>
</html>
50 changes: 50 additions & 0 deletions cnas/bulma_example/lost_pwd.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lost Password</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
</head>
<body>
<section class="section">
<div class="container">
<h1 class="title">Lost Password</h1>
<form action="/send_pin" method="post">
<div class="field">
<label class="label">Email</label>
<div class="control">
<input class="input" type="email" name="email" placeholder="Enter your email" required>
</div>
</div>
<div class="control">
<button class="button is-link" type="submit">Send PIN</button>
</div>
</form>
<form action="/reset_password" method="post" style="margin-top: 20px;">
<div class="field">
<label class="label">PIN</label>
<div class="control">
<input class="input" type="text" name="pin" placeholder="Enter the PIN" required>
</div>
</div>
<div class="field">
<label class="label">New Password</label>
<div class="control">
<input class="input" type="password" name="new_password" placeholder="Enter new password" required>
</div>
</div>
<div class="field">
<label class="label">Confirm Password</label>
<div class="control">
<input class="input" type="password" name="confirm_password" placeholder="Confirm new password" required>
</div>
</div>
<div class="control">
<button class="button is-link" type="submit">Reset Password</button>
</div>
</form>
</div>
</section>
</body>
</html>
Empty file added cnas/pages/admin/admin.py
Empty file.
Empty file.
27 changes: 27 additions & 0 deletions cnas/pages/login/login.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from pages.page import page

from genhtml.web.html import html
from genhtml.web.body import body
from genhtml.web.para import para
from genhtml.web.div import div

from genhtml.web.script import script
from genhtml.web.button import button

from genhtml.builder.head_builder import head_builder

class login(page):
def __init__(self):
pass

def __str__(self):
with html(head_builder()) as _html:
with body() as _body:
_body.append(para("Login"))
with div() as _div:
_div.append(para("Email"))
_div.append(para("Password"))
_div.append(button("Login"))

_html.append(_body)
return str(_html)
Empty file added cnas/pages/login/lost_pwd.py
Empty file.

0 comments on commit 5cff642

Please sign in to comment.