experiment

This commit is contained in:
2026-05-10 22:28:13 +02:00
parent 500950017f
commit 13141bc46a
13 changed files with 153 additions and 86 deletions
@@ -1,17 +1,19 @@
{% extends "scanner/base.html" %}
{% load i18n home_tags scanner_tags %}
{% block styles %}
{{ block.super }}
<link href="/static/planarian/css/planarian.css" rel="stylesheet">
{% endblock %}
{% block columns %}{% endblock %}
{#% block sidebar_list %#}
<!--
{% block sidebar_list %}
<a href="/" class="w3-bar-item w3-btn w3-hover-opacity"><i class="fa-solid fa-house w3-text-orange w3-xlarge"></i> {% trans "Retour accueil" %}</a>
<form method="post" class="w3-bar-item" action="">
{% csrf_token %}
<select id="_sid" name="_sid" class="w3-select w3-margin-bottom" onchange="this.form.submit()" title="{% trans "Ensemble d'expériences" %}">
<option value="0">---- {% trans "Session" %}</option>
{% for s in sessions %}
<option value="{{ s.id }}" {% if s.id == current_session.id %}selected{% endif %}>{{ s.name }}</option>
<option value="{{ s.id }}" {% if s.id == current_session.id %}selected{% endif %}>{{ s }}</option>
{% endfor %}
</select>
<div class="w3-margin-left w3-margin-bottom">
@@ -20,17 +22,17 @@
<label>{{ ss.multiwell }}</label>
{% endfor %}
</div>
{% if current_session.id and current_experiment %}
{% multiwell_cards current_session.id current_experiment %}
{% endif %}
</form>
{% if current_session.id %}
<a href="{% url 'scanner:main' %}" class="w3-bar-item w3-btn w3-hover-opacity">
<i class="fa-solid fa-film w3-text-green w3-xlarge""></i> {% trans "Balayage multi-puits" %}
</a>
{% endif %}
-->
{#% endblock %#}
{% if current_session.id and current_experiment.id %}
<hr class="w3-bar-item divider w3-grey">
<form method="post" class="w3-bar-item" action="{% url 'planarian:export-csv' %}">
{% csrf_token %}
<input type="hidden" name="_sid" value="{{ current_session.id }}">
<input type="hidden" name="_expid" value="{{ current_experiment.id }}">
<button type="submit" class="w3-button w3-blue w3-round w3-padding w3-margin-top">📥 {% trans "Exporter CSV" %}</button>
</form>
{% endif %}
{% endblock %}
{% block js_footer %}
{{ block.super }}
@@ -33,6 +33,9 @@
<form method="post" novalidate>
{% csrf_token %}
<input type="hidden" id="_sid" name="_sid" value="{{ current_session.id }}">
<input type="hidden" id="_expid" name="_expid" value="{{ current_experiment.id }}">
<!-- Erreurs globales du formulaire -->
{% if form.non_field_errors %}
<div class="w3-panel w3-red w3-round">
@@ -309,5 +309,4 @@
if (e.target === modal) modal.style.display = 'none';
};
</script>
{% endblock %}
@@ -1,4 +1,5 @@
{% extends "planarian/base.html" %}
{% load i18n %}
{% block content %}
@@ -47,7 +48,9 @@
<!-- Formulaire -->
<form method="post" novalidate>
{% csrf_token %}
<input type="hidden" id="_sid" name="_sid" value="{{ current_session.id }}">
<input type="hidden" id="_expid" name="_expid" value="{{ current_experiment.id }}">
{% if form.non_field_errors %}
<div class="w3-panel w3-red w3-round">
{% for error in form.non_field_errors %}
@@ -69,33 +72,24 @@
<label class="w3-text-blue"><b>{{ form.experiment.label }}</b></label>
{% if form.experiment.help_text %}
<p class="w3-small w3-text-grey" style="margin:0 0 4px;">{{ form.experiment.help_text }}</p>
{% endif %}
<!-- Saisie libre ou sélection depuis les configs existantes -->
<input list="experiment-list" name="experiment" id="id_experiment"
value="{{ form.experiment.value|default:'' }}"
class="w3-input w3-border w3-round"
placeholder="{% trans 'Ex : exp_2026_04_25' %}">
<datalist id="experiment-list">
{% for cfg in experiment_choices %}
<option value="{{ cfg }}">
{% endif %}
<select id="experiment-list">
{% for cfg in experiments %}
<option value="{{ cfg.identifier}}" {% if current_experiment.identifier == cfg.identifier %}selected{% endif %} >{{ cfg.identifier }}</option>
{% endfor %}
</datalist>
</select>
{% if form.experiment.errors %}
<span class="w3-text-red w3-small">{{ form.experiment.errors|join:", " }}</span>
<!--span class="w3-text-red w3-small">{{ form.experiment.errors|join:", " }}</span-->
{% endif %}
</div>
<div class="w3-col m5 s12 w3-margin-bottom">
<label class="w3-text-blue"><b>{{ form.well.label }}</b></label>
<input list="well-list" name="well" id="id_well"
value="{{ form.well.value|default:'' }}"
class="w3-input w3-border w3-round"
placeholder="{% trans 'Ex : A1' %}">
<datalist id="well-list">
<select id="id_well">
{% for w in well_choices %}
<option value="{{ w }}">
<option value="{{ w.name }}">{{ w.name }}</option>
{% endfor %}
</datalist>
</select>
{% if form.well.errors %}
<span class="w3-text-red w3-small">{{ form.well.errors|join:", " }}</span>
{% endif %}