Initial commit
This commit is contained in:
commit
97e799fd52
61 changed files with 2252 additions and 0 deletions
22
yksa_web/templates/yksa/ui/_state.html
Normal file
22
yksa_web/templates/yksa/ui/_state.html
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{% load i18n yksa_ui %}{% comment %}
|
||||
The only sanctioned rendering of state. Two vocabularies -- health (ok, warning,
|
||||
failed, running, skipped, unknown) and progress (not-started, in-progress,
|
||||
complete, forced, skipped, failed) -- one visual treatment. Never describe one
|
||||
object with both.
|
||||
|
||||
{% include "yksa/ui/_state.html" with state=run.ui_state %}
|
||||
{% include "yksa/ui/_state.html" with state=plan.ui_state label=plan.progress_label %}
|
||||
|
||||
`label` overrides the default word; `title` sets a tooltip. Colour is never the
|
||||
only signal, so the icon and the word ship with it.
|
||||
|
||||
The mapping from a domain status to a state name lives next to the model, not
|
||||
here. A conditional chain choosing a colour inside a template is the bug this
|
||||
partial exists to prevent: it is how the same run status ended up green on one
|
||||
page and grey on another.
|
||||
{% endcomment %}{% state state as s %}{% spaceless %}
|
||||
<span class="yksa-state yksa-state-{{ state|default:'unknown' }}"{% if title %} title="{{ title }}"{% endif %}>
|
||||
<i class="bi bi-{{ s.icon }}" aria-hidden="true"></i>
|
||||
<span>{{ label|default:s.label }}</span>
|
||||
</span>
|
||||
{% endspaceless %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue