diff options
| author | 2026-07-30 16:03:32 +0200 | |
|---|---|---|
| committer | 2026-07-30 16:03:32 +0200 | |
| commit | 2d22158dd95f76399f5716d556be60c77da04a46 (patch) | |
| tree | 15fca3adae0f44674fe06bc141879804659c3664 /templates/macros.html | |
| parent | aa56bc05285981d57c5adb2cee3c4e898fb2a702 (diff) | |
| download | server-v3.tar.gz server-v3.tar.bz2 server-v3.zip | |
Admin uiv3
Diffstat (limited to 'templates/macros.html')
| -rw-r--r-- | templates/macros.html | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/templates/macros.html b/templates/macros.html new file mode 100644 index 0000000..7c35f5e --- /dev/null +++ b/templates/macros.html | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | {% macro connector_icon(size=16) %} | ||
| 2 | <svg width="{{ size }}" height="{{ size }}" viewBox="0 0 24 24" fill="none" aria-hidden="true"> | ||
| 3 | <circle cx="4" cy="12" r="3" fill="currentColor" /> | ||
| 4 | <line x1="7" y1="12" x2="17" y2="12" stroke="currentColor" stroke-width="2" stroke-dasharray="1 4" stroke-linecap="round" /> | ||
| 5 | <circle cx="20" cy="12" r="3" fill="currentColor" /> | ||
| 6 | </svg> | ||
| 7 | {% endmacro %} | ||
| 8 | |||
| 9 | {% macro sun_icon(size=16) %} | ||
| 10 | <svg class="icon-sun" width="{{ size }}" height="{{ size }}" viewBox="0 0 24 24" fill="none" aria-hidden="true"> | ||
| 11 | <circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="2" /> | ||
| 12 | <path d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1" stroke="currentColor" stroke-width="2" stroke-linecap="round" /> | ||
| 13 | </svg> | ||
| 14 | {% endmacro %} | ||
| 15 | |||
| 16 | {% macro moon_icon(size=16) %} | ||
| 17 | <svg class="icon-moon" width="{{ size }}" height="{{ size }}" viewBox="0 0 24 24" fill="none" aria-hidden="true"> | ||
| 18 | <path d="M20 14.5A8.5 8.5 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" stroke="currentColor" stroke-width="2" stroke-linejoin="round" /> | ||
| 19 | </svg> | ||
| 20 | {% endmacro %} | ||
| 21 | |||
| 22 | {% macro field(name, type='text', label='', value='', error='', placeholder='') %} | ||
| 23 | <div class="field"> | ||
| 24 | <label class="field__label" for="field-{{ name }}">{{ label }}</label> | ||
| 25 | <input | ||
| 26 | class="field__input{% if error %} field__input--error{% endif %}" | ||
| 27 | type="{{ type }}" | ||
| 28 | id="field-{{ name }}" | ||
| 29 | name="{{ name }}" | ||
| 30 | value="{{ value or '' }}" | ||
| 31 | placeholder="{{ placeholder }}" | ||
| 32 | {% if error %}aria-invalid="true" aria-describedby="field-{{ name }}-error"{% endif %} | ||
| 33 | /> | ||
| 34 | {% if error %} | ||
| 35 | <p class="field__error" id="field-{{ name }}-error">{{ error }}</p> | ||
| 36 | {% endif %} | ||
| 37 | </div> | ||
| 38 | {% endmacro %} | ||
| 39 | |||
| 40 | {% macro button(text, variant='primary', type='submit') %} | ||
| 41 | <button class="btn btn--{{ variant }} btn--full" type="{{ type }}">{{ text }}</button> | ||
| 42 | {% endmacro %} | ||
| 43 | |||
| 44 | {% macro status_badge(label, variant='good') %} | ||
| 45 | <span class="nav__status"> | ||
| 46 | <span class="status-dot status-dot--{{ variant }}" aria-hidden="true"></span> | ||
| 47 | <span class="mono small muted">{{ label }}</span> | ||
| 48 | </span> | ||
| 49 | {% endmacro %} | ||
