diff --git a/htmx_contact/main.py b/htmx_contact/main.py index 1fc6253..185c1ad 100644 --- a/htmx_contact/main.py +++ b/htmx_contact/main.py @@ -45,3 +45,8 @@ def contacts(): results = session.scalars(stmt).all() return render_template("contacts.html", contacts=results) + + +@bp.route("/contacts/new", methods=["GET"]) +def new_contact(): + return render_template("new_contact.html") diff --git a/htmx_contact/static/css/main.css b/htmx_contact/static/css/main.css index 00cff52..8d1c9c1 100644 --- a/htmx_contact/static/css/main.css +++ b/htmx_contact/static/css/main.css @@ -1,3 +1,9 @@ +*, +*:before, +*:after { + box-sizing: border-box; +} + .toast-basic { padding: 12px 20px; color: #ffffff; @@ -17,3 +23,97 @@ .toastify.on { opacity: 1; } + +input[type=text] { + width: 300px; + padding: 10px 5px; + border-radius: .25rem; + border: 2px solid black; + font-size: 16px; +} + + +body { + font-family: 'Roboto', "Helvetica Neue"; + font-size: 16px; +} + +a { + text-decoration: none; +} + +table a { + color: cadetblue; +} + +table a:hover { + color: #5477f5; + transition: all 0.2s ease-in-out; + cursor: pointer; + border-bottom: 2.5px solid; +} + +.button { + padding: 12px 15px; + color: #ffffff; + background-color: cadetblue; + border: none; + border-radius: .25rem; + font-size: 16px; +} + +.button:hover { + background-color: #5477f5; + transition: all 0.2s ease-in-out; + color: #ffffff; +} + +.button a:hover { + color: #ffffff; +} + +.container { + width: 100%; + text-align: center; +} + +.width-60 table { + margin-top: 30px; + width: 100%; + text-align: left; + margin-left: auto; + margin-right: auto; + border-collapse: collapse; + border-bottom: 2px solid black; +} + +th, +td { + padding: 5px; +} + +table { + margin-bottom: 20px; +} + + +.width-60 { + width: 60%; + margin-left: auto; + margin-right: auto; +} + +.width-60 form { + text-align: left; +} + +.width-60 table thead { + border-bottom: 2px solid black; +} + +.form-container { + margin-top: 20px; + display: flex; + justify-content: space-between; + align-items: center; +} diff --git a/htmx_contact/templates/contacts.html b/htmx_contact/templates/contacts.html index 062ac36..e458288 100644 --- a/htmx_contact/templates/contacts.html +++ b/htmx_contact/templates/contacts.html @@ -1,12 +1,16 @@ {% extends 'base.html' %} {% block content %} -
- +First | @@ -21,8 +25,13 @@{{ contact.last_name }} | {{ contact.phone }} | {{ contact.email }} | +Edit | +View | + {% endfor %}
---|