[people] Clean up form and add link to settings
This commit is contained in:
@ -1,27 +1,118 @@
|
|||||||
{% extends "base.html" %}
|
{% 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 %}
|
{% block content %}
|
||||||
<main class="col-md-4 ms-sm-auto col-lg-10 px-md-4">
|
<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">
|
<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>
|
<h1 class="h2">People</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="people-page">
|
||||||
<div class="col-md-4">
|
<div class="people-form-card">
|
||||||
<h3>Add Person</h3>
|
<h3>Add Person</h3>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
{{ form.as_p }}
|
{% for field in form %}
|
||||||
<input type="submit" value="Save">
|
<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>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-8">
|
<div class="people-list-card">
|
||||||
<h3>Your People</h3>
|
<h3>Your People</h3>
|
||||||
<ul>
|
<ul class="people-list">
|
||||||
{% for person in people %}
|
{% for person in people %}
|
||||||
<li>
|
<li>
|
||||||
{{ person.name }}
|
<span class="person-name">{{ person.name }}</span>
|
||||||
|
<span class="person-links">
|
||||||
<a href="{% url 'people:person_edit' person.pk %}">Edit</a>
|
<a href="{% url 'people:person_edit' person.pk %}">Edit</a>
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<li>No people yet.</li>
|
<li>No people yet.</li>
|
||||||
|
|||||||
@ -92,6 +92,11 @@
|
|||||||
.widget-links li {
|
.widget-links li {
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-link {
|
||||||
|
grid-column: 2;
|
||||||
|
margin: 8px 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@ -100,6 +105,7 @@
|
|||||||
|
|
||||||
{% block title %}Settings{% endblock %}
|
{% block title %}Settings{% endblock %}
|
||||||
{% block details %}
|
{% block details %}
|
||||||
|
<p class="settings-link"><a href="{% url 'people:person_form' %}">Manage People</a></p>
|
||||||
<form method="post" class="settings-form">{% csrf_token %}
|
<form method="post" class="settings-form">{% csrf_token %}
|
||||||
{% for field in form %}
|
{% for field in form %}
|
||||||
{% if field.name == "enable_public_widgets" %}
|
{% if field.name == "enable_public_widgets" %}
|
||||||
|
|||||||
Reference in New Issue
Block a user