aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorBonfaceKilz2021-10-27 14:22:53 +0300
committerBonfaceKilz2021-10-28 08:34:35 +0300
commitfb7456a0e850290961c0f8be59c09fdd425f15f1 (patch)
tree819ac233ea33c70e6950cc119e29e40d0e2f6385 /wqflask
parent0618b9f78d6ca2517f6265a9cfe7db64b6ae12ef (diff)
downloadgenenetwork2-fb7456a0e850290961c0f8be59c09fdd425f15f1.tar.gz
Rename metadata edit endpoints
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/metadata_edits.py8
-rw-r--r--wqflask/wqflask/templates/edit_phenotype.html2
-rw-r--r--wqflask/wqflask/templates/edit_probeset.html2
-rw-r--r--wqflask/wqflask/templates/show_trait_details.html4
4 files changed, 8 insertions, 8 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py
index 7e237976..08ff4704 100644
--- a/wqflask/wqflask/metadata_edits.py
+++ b/wqflask/wqflask/metadata_edits.py
@@ -116,7 +116,7 @@ def edit_probeset(conn, name):
}
-@metadata_edit.route("/<dataset_id>/traits/<name>/edit")
+@metadata_edit.route("/<dataset_id>/traits/<name>")
@edit_access_required
def display_phenotype_metadata(dataset_id: str, name: str):
conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"),
@@ -136,7 +136,7 @@ def display_phenotype_metadata(dataset_id: str, name: str):
)
-@metadata_edit.route("/traits/<name>/edit")
+@metadata_edit.route("/traits/<name>")
@edit_access_required
def display_probeset_metadata(name: str):
conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"),
@@ -153,7 +153,7 @@ def display_probeset_metadata(name: str):
)
-@metadata_edit.route("/<dataset_id>/traits/<name>/update", methods=("POST",))
+@metadata_edit.route("/<dataset_id>/traits/<name>", methods=("POST",))
@edit_access_required
def update_phenotype(dataset_id: str, name: str):
conn = MySQLdb.Connect(db=current_app.config.get("DB_NAME"),
@@ -276,5 +276,5 @@ def update_phenotype(dataset_id: str, name: str):
editor=author,
json_data=json.dumps(diff_data)))
flash(f"Diff-data: \n{diff_data}\nhas been uploaded", "success")
- return redirect(f"/datasets/{dataset_id}/traits/{name}/edit"
+ return redirect(f"/datasets/{dataset_id}/traits/{name}"
f"?resource-id={request.args.get('resource-id')}")
diff --git a/wqflask/wqflask/templates/edit_phenotype.html b/wqflask/wqflask/templates/edit_phenotype.html
index 5166a903..6b08163e 100644
--- a/wqflask/wqflask/templates/edit_phenotype.html
+++ b/wqflask/wqflask/templates/edit_phenotype.html
@@ -62,7 +62,7 @@
</div>
{% endif %}
-<form id="edit-form" class="form-horizontal" method="post" action="/datasets/{{dataset_id}}/traits/{{ publish_xref.id_ }}/update?resource-id={{ resource_id }}" enctype=multipart/form-data>
+<form id="edit-form" class="form-horizontal" method="post" action="/datasets/{{dataset_id}}/traits/{{ publish_xref.id_ }}?resource-id={{ resource_id }}" enctype=multipart/form-data>
<h2 class="text-center">Trait Information:</h2>
<div class="form-group">
<label for="pubmed-id" class="col-sm-2 control-label">Pubmed ID:</label>
diff --git a/wqflask/wqflask/templates/edit_probeset.html b/wqflask/wqflask/templates/edit_probeset.html
index 85d49561..cd7b1379 100644
--- a/wqflask/wqflask/templates/edit_probeset.html
+++ b/wqflask/wqflask/templates/edit_probeset.html
@@ -53,7 +53,7 @@ Submit Trait | Reset
{% endif %}
-<form id="edit-form" class="form-horizontal" method="post" action="/probeset/update">
+<form id="edit-form" class="form-horizontal" method="post" action="/datasets/traits/{{ dataset_id }}?resource-id={{ resource_id }}>
<h2 class="text-center">Probeset Information:</h2>
<div class="form-group">
<label for="symbol" class="col-sm-2 control-label">Symbol:</label>
diff --git a/wqflask/wqflask/templates/show_trait_details.html b/wqflask/wqflask/templates/show_trait_details.html
index b0639879..7a09f52e 100644
--- a/wqflask/wqflask/templates/show_trait_details.html
+++ b/wqflask/wqflask/templates/show_trait_details.html
@@ -237,11 +237,11 @@
{% if admin_status.get('metadata', Datarole.VIEW) > DataRole.VIEW %}
{% if this_trait.dataset.type == 'Publish' %}
{{ this_trait }}
- <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource" onclick="window.open('/datasets/{{ this_trait.dataset.id }}/traits/{{ this_trait.name }}/edit?resource-id={{ resource_id }}', '_blank')">Edit</button>
+ <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource" onclick="window.open('/datasets/{{ this_trait.dataset.id }}/traits/{{ this_trait.name }}?resource-id={{ resource_id }}', '_blank')">Edit</button>
{% endif %}
{% if this_trait.dataset.type == 'ProbeSet' %}
- <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource" onclick="window.open('/datasets/traits/{{ this_trait.name }}/edit?resource-id={{ resource_id }}', '_blank')">Edit</button>
+ <button type="button" id="edit_resource" class="btn btn-success" title="Edit Resource" onclick="window.open('/datasets/traits/{{ this_trait.name }}resource-id={{ resource_id }}', '_blank')">Edit</button>
{% endif %}
{% if admin_status.get('metadata', DataRole.VIEW) > DataRole.VIEW %}
<button type="button" id="edit_resource" class="btn btn-success" title="Edit Privileges" onclick="window.open('/resource-management/resources/{{ resource_id }}', '_blank')">Edit Privileges</button>