aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/common_jinja_templates
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/common_jinja_templates')
-rw-r--r--src/hydrilla/common_jinja_templates/base.html.jinja30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/hydrilla/common_jinja_templates/base.html.jinja b/src/hydrilla/common_jinja_templates/base.html.jinja
index 08178b3..0c29c0c 100644
--- a/src/hydrilla/common_jinja_templates/base.html.jinja
+++ b/src/hydrilla/common_jinja_templates/base.html.jinja
@@ -67,7 +67,15 @@ code in a proprietary work, I am not going to enforce this in court.
</label>
{% endmacro %}
-{% macro form_field(field_name, required=true, sep_after=true, height=none) %}
+{%
+ macro form_field(
+ field_name,
+ required = true,
+ sep_after = true,
+ height = none,
+ initial_value = none
+ )
+%}
<div class="flex-row">
{%
set attrs = {
@@ -79,9 +87,11 @@ code in a proprietary work, I am not going to enforce this in court.
%}
{% if height is none %}
+ {% do attrs.update({'value': initial_value}) %}
<input{{ attrs|xmlattr }}>
{% else %}
- <textarea{{ attrs|xmlattr }}></textarea>
+ {% set value = initial_value|default('', true) %}
+ <textarea{{ attrs|xmlattr }}>{{ value }}</textarea>
{% endif %}
</div>
@@ -90,10 +100,17 @@ code in a proprietary work, I am not going to enforce this in court.
{% endif %}
{% endmacro %}
+{% macro verbatim(code) %}
+ <code><pre>{{ code }}</pre></code>
+{% endmacro %}
+
<html>
<head>
{% block head %}
- <style>
+ {% if style_nonce is defined %}
+ {% set style_attrs = {'nonce': style_nonce} %}
+ {% endif %}
+ <style{{ style_attrs|default({})|xmlattr }}>
{% block style %}
body {
color: #444;
@@ -213,6 +230,13 @@ code in a proprietary work, I am not going to enforce this in court.
border-radius: 0;
}
+ code > pre {
+ overflow-x: auto;
+ background-color: #f0f0f0;
+ padding: 5px;
+ border: 1px solid #e3e3e3;
+ }
+
.hide {
display: none !important;
}