diff --git a/htmx_contact/main.py b/htmx_contact/main.py index 9390e85..5515fd6 100644 --- a/htmx_contact/main.py +++ b/htmx_contact/main.py @@ -67,7 +67,7 @@ def new_contact(): **request.form ) with Session.begin() as session: - contact = Contact(**validated_form) + contact = Contact(user_id=current_user.id, **validated_form.model_dump()) session.add(contact) session.commit() flash("New Contacted added!") diff --git a/htmx_contact/static/css/main.css b/htmx_contact/static/css/main.css index 8d1c9c1..1469379 100644 --- a/htmx_contact/static/css/main.css +++ b/htmx_contact/static/css/main.css @@ -24,8 +24,8 @@ opacity: 1; } -input[type=text] { - width: 300px; +input[type=text], +input[type=email] { padding: 10px 5px; border-radius: .25rem; border: 2px solid black; @@ -117,3 +117,51 @@ table { justify-content: space-between; align-items: center; } + +label { + display: block; +} + +fieldset { + font-size: 20px; + border-radius: 5px; +} + +.red { + background-color: crimson; +} + +.flex-row { + display: flex; +} + +.flex-space-betw { + justify-content: space-between; + align-items: center; +} + +.flex-center { + justify-content: center; + align-items: center; +} + +.flex-column { + display: flex; + flex-direction: column; +} + +.font-red { + color: crimson; +} + +form span { + display: block; +} + +.width-375-px { + width: 375px; +} + +.width-100 { + width: 100%; +} diff --git a/htmx_contact/templates/contacts.html b/htmx_contact/templates/contacts.html index e458288..7a3ff76 100644 --- a/htmx_contact/templates/contacts.html +++ b/htmx_contact/templates/contacts.html @@ -2,11 +2,12 @@ {% block content %}
- Back -
+