Refactor rota detail view to include worker and shift lists only once, and update button text for clarity
This commit is contained in:
@@ -41,16 +41,14 @@
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
{% include 'rota/partials/worker_list.html' %}
|
||||
<p>
|
||||
<button class="button is-link" hx-get="{% url 'rota:worker_add' %}?rota_id={{ rota.id }}" hx-target="#modal" hx-swap="innerHTML">Add worker</button>
|
||||
<button class="button is-light" hx-get="{% url 'rota:worker_import' rota.id %}" hx-target="#modal" hx-swap="innerHTML" style="margin-left:0.5rem;">Import workers</button>
|
||||
<a class="button is-info is-light is-small" href="{% url 'rota:leaves_global_rota' rota.id %}" style="margin-left:0.5rem;">All leave requests</a>
|
||||
</p>
|
||||
{% include 'rota/partials/worker_list.html' %}
|
||||
</div>
|
||||
|
||||
{# Historic runs moved to be grouped with the scheduled-run controls further down the page. #}
|
||||
|
||||
<div class="mb-4">
|
||||
<h2 class="subtitle">Constraint options</h2>
|
||||
<div class="box">
|
||||
@@ -132,10 +130,9 @@
|
||||
{# Run controls and historic runs moved to the bottom of the page. #}
|
||||
|
||||
<div>
|
||||
<h2 class="subtitle">Edit shifts</h2>
|
||||
{% include 'rota/partials/shift_list.html' %}
|
||||
<p><button class="button is-link" hx-get="{% url 'rota:shift_add' rota.id %}" hx-target="#shift-form" hx-swap="innerHTML">Add shift</button></p>
|
||||
<div id="shift-form">{# Load form via HTMX when user clicks 'Add shift' - initial empty state #}</div>
|
||||
{% include 'rota/partials/shift_list.html' %}
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
@@ -145,7 +142,7 @@
|
||||
<div class="field is-grouped is-grouped-multiline">
|
||||
<div class="control"><label class="checkbox"><input type="checkbox" name="generate_builder" value="1"> Generate HTML export</label></div>
|
||||
<div class="control"><label class="checkbox"><input type="checkbox" name="builder_solve" value="1"> Solve when exporting (may be slow)</label></div>
|
||||
<div class="control"><button class="button is-primary" type="submit">Run scheduler (background)</button></div>
|
||||
<div class="control"><button class="button is-primary" type="submit">Run rota</button></div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# Generated by Django 6.0 on 2025-12-19 21:11
|
||||
|
||||
import django.db.models.deletion
|
||||
import uuid
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("rota", "0007_make_request_token_unique"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="assignment",
|
||||
options={"ordering": ("-created_at",)},
|
||||
),
|
||||
migrations.AlterUniqueTogether(
|
||||
name="assignment",
|
||||
unique_together=set(),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="assignment",
|
||||
name="worker",
|
||||
field=models.OneToOneField(
|
||||
on_delete=django.db.models.deletion.CASCADE, to="rota.worker"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="worker",
|
||||
name="request_token",
|
||||
field=models.UUIDField(default=uuid.uuid4, editable=False, null=True),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user