forked from realpython/materials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle_selection.html
More file actions
45 lines (42 loc) · 1.08 KB
/
Copy pathstyle_selection.html
File metadata and controls
45 lines (42 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{% extends "base.html" %}
{% block title %}
- Style Selection
{% endblock title %}
{% block content %}
<style>
{{ style_definitions }}
.code {
background-color: {{ style_bg_color }};
}
</style>
<script>
document.addEventListener("DOMContentLoaded", () => {
document.querySelector("select").addEventListener("change", () => {
document.querySelector("form").submit();
});
});
</script>
<form method="post" action="{{ url_for("save_style") }}">
<div class="controls">
<select name="style">
{% for style_name in all_styles %}
<option value="{{ style_name }}"
{% if style_name == style %}selected{% endif %}>
{{ style_name }}
</option>
{% endfor %}
</select>
</div>
<div class="code">
{{ highlighted_code | safe }}
</div>
<div class="controls">
<button formmethod="get" formaction="{{ url_for("code") }}">
⬅️ Back
</button>
<button formmethod="get" formaction="{{ url_for("image") }}">
Create Image 📸
</button>
</div>
</form>
{% endblock content %}