Files
colossus/views/test/edit.twig

56 lines
1.9 KiB
Twig

{% extends 'layout.twig' %}
{% block title %}Editing: {{ test.title }}{% endblock %}
{% block content %}
<div class="row mb-4">
<div class="col-12">
<h1>Editing: {{ test.title }}</h1>
</div>
</div>
<div class="row">
<div class="col-12">
<form action="{{ url_for('test.edit', { test_id: test.id }) }}" method="POST">
<div class="row mb-3">
<div class="col-6">
<label class="form-label" for="test_title">Test title:</label>
<input id="test_title" class="form-control" type="text" name="test_title" placeholder="My new test" value="{{ test.title }}">
</div>
<div class="col-6">
<label class="form-label" for="test_component">Hardware component:</label>
<select id="test_component" class="form-select" name="test_component">
{% for c in components %}
<option value="{{ c.id }}" {% if test.component.id == c.id %}selected{% endif %}>{{ c.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="row">
<div class="col-12 mb-3">
<label class="form-label" for="test_benchmarks">Benchmarks:</label>
<select id="test_benchmarks" class="form-select" name="test_benchmarks[]" multiple>
{% for b in benchmarks %}
<option value="{{ b.id }}" {% if test.isBenchmarkSelected(b.id) %}selected{% endif %}>{{ b.name }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
<label class="form-label" for="test_description">Test description:</label>
<textarea id="test_description" class="form-control" name="test_description" rows="8">{{ test.description }}</textarea>
</div>
</div>
<input class="btn btn-primary" type="submit" value="Submit Changes">
</form>
</div>
</div>
{% endblock %}