diff options
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/templates/edit_phenotype.html | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/wqflask/wqflask/templates/edit_phenotype.html b/wqflask/wqflask/templates/edit_phenotype.html index a97b4a20..d67468c3 100644 --- a/wqflask/wqflask/templates/edit_phenotype.html +++ b/wqflask/wqflask/templates/edit_phenotype.html @@ -23,6 +23,7 @@ <input name="inbred-set-id" class="changed" type="hidden" value="{{ publish_xref.inbred_set_id }}"/> <input name="phenotype-id" class="changed" type="hidden" value="{{ publish_xref.phenotype_id }}"/> <input name="comments" class="changed" type="hidden" value="{{ publish_xref.comments }}"/> + <input name="edited" class="changed" type="hidden" value="false"/> </div> </div> <div> @@ -208,10 +209,10 @@ <td><input type="checkbox"></td> <td>{{ loop.index }}</td> <td>{{ sample }}</td> - <td><input type="text" name="value:{{ sample }}" value="{% if sample_data.get(sample) %}{{ '%0.3f' | format(sample_data.get(sample).value | float) }}{% else %}x{% endif %}" size=4 maxlength=4></input></td> + <td><input type="text" name="value:{{ sample }}" class="table_input" value="{% if sample_data.get(sample) %}{{ '%0.3f' | format(sample_data.get(sample).value | float) }}{% else %}x{% endif %}" size=4 maxlength=4></input></td> <td>±</td> - <td><input type="text" name="error:{{ sample }}" step='0.001' value="{% if sample_data.get(sample).error %}{{ '%0.3f' | format(sample_data.get(sample).error | float) }}{% else %}x{% endif %}" size=4 maxlength=4></input></td> - <td><input type="text" name="n_cases:{{ sample }}" value="{% if sample_data.get(sample).n_cases %}{{ sample_data.get(sample).n_cases }}{% else %}x{% endif %}" size=3 maxlength=3></input></td> + <td><input type="text" name="error:{{ sample }}" class="table_input" value="{% if sample_data.get(sample).error %}{{ '%0.3f' | format(sample_data.get(sample).error | float) }}{% else %}x{% endif %}" size=4 maxlength=4></input></td> + <td><input type="text" name="n_cases:{{ sample }}" class="table_input" value="{% if sample_data.get(sample).n_cases %}{{ sample_data.get(sample).n_cases }}{% else %}x{% endif %}" size=3 maxlength=3></input></td> </tr> {% endfor %} </tbody> @@ -234,5 +235,10 @@ $("input[type=submit]").click(function(){ $(":input:not(.changed)").attr("disabled", "disabled"); }); + + // This is an awkward way to detect changes to table data, so it doesn't process it otherwise + $(".table_input").change(function(){ + $("input[name=edited]").val("true"); + }); </script> {% endblock %} |