Misc improvements

This commit is contained in:
Austen Adler 2021-08-22 00:14:50 -04:00
parent b9b503d61b
commit 9ed83f0b96
2 changed files with 8 additions and 6 deletions

View File

@ -100,6 +100,10 @@ async fn start_socket(req: HttpRequest, stream: web::Payload) -> impl Responder
state.parameters = params;
state
.render()
.map(|s| {
println!("{}", s);
s
})
.map_err(|e| {
format!("Error rendering state: {:?}", e);
e

View File

@ -1,14 +1,12 @@
<!-- TODO: When refreshing, the selected element does not change -->
<!-- TODO: Do not use .to_string() for comparison -->
<select id="template-name" rust-input="change-template">
{% let selected_name = parameters.get_name() %}
{% for name in Parameters::get_names() %}
{%- let selected_name = parameters.get_name() -%}
{% for name in Parameters::get_names() -%}
<option value="{{ name }}"
{% if selected_name == name.to_string() -%}
selected="selected"
{%- endif -%}
{%- if selected_name == name.to_string() %} selected="selected"{% endif -%}
>{{ name }}</option>
{% endfor %}
{% endfor -%}
</select>
<form rust-submit="form">