72 lines
2.4 KiB
Django/Jinja
72 lines
2.4 KiB
Django/Jinja
{% macro subSection(title, spaceBefore) %}
|
|
{% if (spaceBefore) %} <br><br> {% endif %}
|
|
<strong>{{ _(title) }}</strong>
|
|
<hr>
|
|
{% endmacro %}
|
|
|
|
|
|
{% macro card(content, class) %}
|
|
<div class="card">
|
|
<p class="{{ class }}">{{ _(content) }}</p>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro quote(content, cite, class) %}
|
|
<blockquote>
|
|
<p class="{{ class }}">{{ _(content) }}</p>
|
|
<small>{{ cite }}</small>
|
|
</blockquote>
|
|
{% endmacro %}
|
|
|
|
{% macro field(label, title, type, binding, enable, unit, step, min, max) %}
|
|
{% set step = step|default('0.01') %}
|
|
{% set min = min|default("") %}
|
|
{% set max = max|default("") %}
|
|
{% set unit = unit|trim|default("") %}
|
|
<div class="row-fluid">
|
|
<div class="span6">
|
|
<label for="{{ label }}" class="pull-right" style="margin-top: 5px;" title="{{ title }}">
|
|
{{ _(label) }}
|
|
</label>
|
|
</div>
|
|
<div class="span6">
|
|
<div class="input-append">
|
|
<input type="{{ type }}" id="{{ label }}" title="{{ title }}" class="input-small" step="{{ step }}" min="{{ min }}" max="{{ max }}" data-bind="value: {{ binding }}, enable: {{ enable }}">
|
|
{% if unit != "" %}
|
|
<span class="add-on" title="{{ title }}">{{ _(unit) }}</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
|
|
{% macro labelField(label, title, type, binding, enable, unit, step, min, max) %}
|
|
{% set step = step|default('0.01') %}
|
|
{% set min = min|default("") %}
|
|
{% set max = max|default("") %}
|
|
{% set unit = unit|trim|default("") %}
|
|
<div class="row-fluid">
|
|
<div class="span6">
|
|
<label for="{{ label }}" class="pull-right" style="margin-top: 5px;" title="{{ title }}">
|
|
{{ _(label) }}
|
|
</label>
|
|
</div>
|
|
<div class="span6">
|
|
<div class="input-append input-prepend">
|
|
<span class="add-on" title="{{ title }}">{{ _(label) }}</span>
|
|
<input type="{{ type }}" id="{{ label }}" title="{{ title }}" class="input-small" step="{{ step }}" min="{{ min }}" max="{{ max }}" data-bind="value: {{ binding }}, enable: {{ enable }}">
|
|
{% if unit != "" %}
|
|
<span class="add-on" title="{{ title }}">{{ _(unit) }}</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro linkToMarlin(command, title) %}
|
|
|
|
<span class="add-on" title="{{ title }}">
|
|
<a target="_blank" href="https://marlinfw.org/docs/gcode/{{command}}.html"><i class="fas fa-info-circle"></i></a>
|
|
</span>
|
|
{% endmacro %} |