-
Notifications
You must be signed in to change notification settings - Fork 15
Add improved maintenance column with a dropdown showing tasks #1761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
4dec947
1972920
0205d27
1851bcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Improve maintenace column by adding a dropdown with tasks that affect the incident | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,38 @@ | ||
| <!-- htmx/templates/htmx/incident/cells/_incident_maintenance.html --> | ||
| {% if incident.planned_maintenance_tasks.exists %} | ||
| <i class="text-primary text-lg fa-solid fa-person-digging"></i> | ||
| {% endif %} | ||
| {% with tasks=incident.planned_maintenance_tasks.all %} | ||
| {% if tasks %} | ||
| <div class="dropdown dropdown-hover dropdown-bottom dropdown-end"> | ||
| <button tabindex="0" | ||
| class="btn btn-ghost btn-sm cursor-pointer flex items-center gap-1 text-primary"> | ||
| <i class="fa-solid fa-person-digging"></i> | ||
| <span class="text-xs">{{ tasks|length }} task{{ tasks|length|pluralize }}</span> | ||
| </button> | ||
| <div tabindex="0" | ||
| class="dropdown-content bg-base-100 rounded-box z-20 w-72 p-2 shadow-lg flex flex-col gap-1"> | ||
Simrayz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <span class="text-xs font-medium opacity-60 px-2">Planned Maintenance</span> | ||
| {% for task in tasks %} | ||
| <a href="{% url 'htmx:plannedmaintenance-detail' pk=task.pk %}" | ||
| class="flex flex-col gap-0.5 p-2 rounded-lg hover:bg-base-200 transition-colors"> | ||
| <span class="font-medium truncate" title="{{ task.description }}">{{ task.description|default:"No description" }}</span> | ||
| <div class="flex items-center justify-between gap-2 text-xs opacity-60"> | ||
| <span>{{ task.start_time|date:"M d, H:i" }} | ||
| {% if task.end_time.year >= 9999 %} | ||
| - now | ||
| {% else %} | ||
| - {{ task.end_time|date:"M d, H:i" }} | ||
Simrayz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {% endif %} | ||
| </span> | ||
| {% if task.current %} | ||
| <span class="badge badge-success badge-sm">Ongoing</span> | ||
| {% elif task.future %} | ||
| <span class="badge badge-info badge-sm">Scheduled</span> | ||
Simrayz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| {% else %} | ||
| <span class="badge badge-ghost badge-sm">Completed</span> | ||
| {% endif %} | ||
| </div> | ||
| </a> | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| {% endif %} | ||
| {% endwith %} | ||
Uh oh!
There was an error while loading. Please reload this page.