[people] Clean up form and add link to settings
All checks were successful
build & deploy / test (push) Successful in 1m50s
build & deploy / deploy (push) Successful in 22s

This commit is contained in:
2026-03-21 11:10:14 -04:00
parent 8bfc5646f9
commit c1ef057ad2
2 changed files with 105 additions and 8 deletions

View File

@ -1,27 +1,118 @@
{% extends "base.html" %}
{% block head_extra %}
<style>
.people-page {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 32px;
max-width: 1000px;
}
.people-form-card, .people-list-card {
background: #f8f9fa;
padding: 20px;
border-radius: 8px;
border: 1px solid #e0e0e0;
}
.people-form-card h3, .people-list-card h3 {
margin-top: 0;
padding-bottom: 12px;
border-bottom: 1px solid #dee2e6;
}
.form-group {
margin-bottom: 16px;
}
.form-group label {
display: block;
font-weight: 600;
margin-bottom: 4px;
font-size: 14px;
}
.form-group input, .form-group textarea {
width: 100%;
padding: 8px 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 14px;
font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.2);
}
.form-group textarea {
resize: vertical;
min-height: 80px;
}
.btn-primary {
padding: 10px 24px;
background: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
}
.btn-primary:hover {
background: #0056b3;
}
.people-list {
list-style: none;
padding: 0;
margin: 0;
}
.people-list li {
padding: 10px 0;
border-bottom: 1px solid #dee2e6;
display: flex;
justify-content: space-between;
align-items: center;
}
.people-list li:last-child {
border-bottom: none;
}
.people-list .person-name {
font-weight: 500;
}
.people-list .person-links a {
font-size: 13px;
margin-left: 8px;
}
</style>
{% endblock %}
{% block content %}
<main class="col-md-4 ms-sm-auto col-lg-10 px-md-4">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">People</h1>
</div>
<div class="row">
<div class="col-md-4">
<div class="people-page">
<div class="people-form-card">
<h3>Add Person</h3>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Save">
{% for field in form %}
<div class="form-group">
<label for="{{ field.id_for_label }}">{{ field.label }}</label>
{{ field }}
{% if field.errors %}
<small class="text-danger">{{ field.errors.0 }}</small>
{% endif %}
</div>
{% endfor %}
<button type="submit" class="btn-primary">Save</button>
</form>
</div>
<div class="col-md-8">
<div class="people-list-card">
<h3>Your People</h3>
<ul>
<ul class="people-list">
{% for person in people %}
<li>
{{ person.name }}
<a href="{% url 'people:person_edit' person.pk %}">Edit</a>
<span class="person-name">{{ person.name }}</span>
<span class="person-links">
<a href="{% url 'people:person_edit' person.pk %}">Edit</a>
</span>
</li>
{% empty %}
<li>No people yet.</li>

View File

@ -92,6 +92,11 @@
.widget-links li {
margin-bottom: 4px;
}
.settings-link {
grid-column: 2;
margin: 8px 0;
}
</style>
@ -100,6 +105,7 @@
{% block title %}Settings{% endblock %}
{% block details %}
<p class="settings-link"><a href="{% url 'people:person_form' %}">Manage People</a></p>
<form method="post" class="settings-form">{% csrf_token %}
{% for field in form %}
{% if field.name == "enable_public_widgets" %}