diff options
author | zsloan | 2023-05-10 17:14:24 +0000 |
---|---|---|
committer | zsloan | 2023-05-22 17:18:15 +0000 |
commit | 507f14a120169edbe3c1a76e15466da9d071ef19 (patch) | |
tree | 15edd15acca58239db0bbeaed66401b4174e5fd9 | |
parent | 70c2c10cf0bb8a6e14f744f258eccf5f396111b1 (diff) | |
download | genenetwork2-507f14a120169edbe3c1a76e15466da9d071ef19.tar.gz |
Fix phenotype metadata template to only read in changed sample data
Also fix the display so it only shows 3 decimal places
-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 %} |