aboutsummaryrefslogtreecommitdiff
path: root/uploader
diff options
context:
space:
mode:
Diffstat (limited to 'uploader')
-rw-r--r--uploader/phenotypes/views.py18
-rw-r--r--uploader/templates/phenotypes/edit-phenotype.html124
2 files changed, 12 insertions, 130 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index 97bcafe..834a450 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -374,10 +374,15 @@ def process_phenotypes_individual_files(error_uri):
bundlepath = Path(app.config["UPLOAD_FOLDER"],
f"{str(uuid.uuid4()).replace('-', '')}.zip")
with ZipFile(bundlepath,mode="w") as zfile:
- for rqtlkey, formkey in (("phenocovar", "phenotype-descriptions"),
- ("pheno", "phenotype-data"),
- ("phenose", "phenotype-se"),
- ("phenonum", "phenotype-n")):
+ for rqtlkey, formkey, _type in (
+ ("phenocovar", "phenotype-descriptions", "mandatory"),
+ ("pheno", "phenotype-data", "mandatory"),
+ ("phenose", "phenotype-se", "optional"),
+ ("phenonum", "phenotype-n", "optional")):
+ if _type == "optional" and not bool(form.get(formkey)):
+ # skip if an optional key does not exist.
+ continue
+
cdata[f"{rqtlkey}_transposed"] = (
(form.get(f"{formkey}-transposed") or "off") == "on")
@@ -1010,8 +1015,9 @@ def load_data_success(
gn2_uri = urlparse(app.config["GN2_SERVER_URL"])
job = gnlibs_jobs.job(jobsconn, job_id, fulldetails=True)
app.logger.debug("THE JOB: %s", job)
- _xref_ids = (str(item) for item
- in json.loads(job["metadata"].get("xref_ids", "[]")))
+ _xref_ids = tuple(
+ str(item) for item
+ in json.loads(job["metadata"].get("xref_ids", "[]")))
_publication = fetch_publication_by_id(
conn, int(job["metadata"].get("publication_id", "0")))
_search_terms = (item for item in
diff --git a/uploader/templates/phenotypes/edit-phenotype.html b/uploader/templates/phenotypes/edit-phenotype.html
index 32c903f..115d6af 100644
--- a/uploader/templates/phenotypes/edit-phenotype.html
+++ b/uploader/templates/phenotypes/edit-phenotype.html
@@ -201,130 +201,6 @@
</form>
</div>
-
-<div class="row">
- <h3 class="subheading">publication information</h3>
- <p>Use the form below to update the publication information for this
- phenotype.</p>
- <form id="frm-edit-phenotype-pub-data"
- class="form-horizontal"
- method="POST"
- action="#">
- <div class="form-group">
- <label for="txt-pubmed-id" class="control-label col-sm-2">Pubmed ID</label>
- <div class="col-sm-10">
- <input id="txt-pubmed-id" name="pubmed-id" type="text"
- class="form-control" />
- <span class="form-text text-muted">
- Enter your publication's PubMed ID.</span>
- </div>
- </div>
-
- <div class="form-group">
- <label for="txt-publication-authors" class="control-label col-sm-2">Authors</label>
- <div class="col-sm-10">
- <input id="txt-publication-authors" name="publication-authors"
- type="text" class="form-control" />
- <span class="form-text text-muted">
- Enter the authors.</span>
- </div>
- </div>
-
- <div class="form-group">
- <label for="txt-publication-title" class="control-label col-sm-2">
- Publication Title</label>
- <div class="col-sm-10">
- <input id="txt-publication-title" name="publication-title" type="text"
- class="form-control" />
- <span class="form-text text-muted">
- Enter your publication's title.</span>
- </div>
- </div>
-
- <div class="form-group">
- <label for="txt-publication-abstract" class="control-label col-sm-2">
- Publication Abstract</label>
- <div class="col-sm-10">
- <textarea id="txt-publication-abstract" name="publication-abstract"
- class="form-control" rows="10"></textarea>
- <span class="form-text text-muted">
- Enter the abstract for your publication.</span>
- </div>
- </div>
-
- <div class="form-group">
- <label for="txt-publication-journal" class="control-label col-sm-2">Journal</label>
- <div class="col-sm-10">
- <input id="txt-publication-journal" name="journal" type="text"
- class="form-control" />
- <span class="form-text text-muted">
- Enter the name of the journal where your work was published.</span>
- </div>
- </div>
-
- <div class="form-group">
- <label for="txt-publication-volume" class="control-label col-sm-2">Volume</label>
- <div class="col-sm-10">
- <input id="txt-publication-volume" name="publication-volume" type="text"
- class="form-control" />
- <span class="form-text text-muted">
- Enter the volume in the following format &hellip;</span>
- </div>
- </div>
-
- <div class="form-group">
- <label for="txt-publication-pages" class="control-label col-sm-2">Pages</label>
- <div class="col-sm-10">
- <input id="txt-publication-pages" name="publication-pages" type="text"
- class="form-control" />
- <span class="form-text text-muted">
- Enter the journal volume where your work was published.</span>
- </div>
- </div>
-
- <div class="form-group">
- <label for="select-publication-month" class="control-label col-sm-2">
- Publication Month</label>
- <div class="col-sm-10">
- <select id="select-publication-month" name="publication-month"
- class="form-control">
- {%for month in monthnames%}
- <option value="{{month | lower}}"
- {%if current_month | lower == month | lower%}
- selected="selected"
- {%endif%}>{{month | capitalize}}</option>
- {%endfor%}
- </select>
- <span class="form-text text-muted">
- Select the month when the work was published.
- <span class="text-danger">
- This cannot be before, say 1600 and cannot be in the future!</span></span>
- </div>
- </div>
-
- <div class="form-group">
- <label for="txt-publication-year" class="control-label col-sm-2">Publication Year</label>
- <div class="col-sm-10">
- <input id="txt-publication-year" name="publication-year" type="text"
- class="form-control" value="{{current_year}}" />
- <span class="form-text text-muted">
- Enter the year your work was published.
- <span class="text-danger">
- This cannot be before, say 1600 and cannot be in the future!</span>
- </span>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-10">
- <input type="submit"
- name="submit"
- class="btn btn-primary not-implemented"
- value="update publication" />
- </div>
- </div>
- </form>
-</div>
-
{%endblock%}
{%block sidebarcontents%}