forked from enviPath/enviPy
Basic System (#31)
Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#31
This commit is contained in:
0
templates/modals/collections/new_edge_modal.html
Normal file
0
templates/modals/collections/new_edge_modal.html
Normal file
0
templates/modals/collections/new_node_modal.html
Normal file
0
templates/modals/collections/new_node_modal.html
Normal file
@ -16,23 +16,11 @@
|
||||
<input id="rule-name" class="form-control" name="rule-name" placeholder="Name"/>
|
||||
<label for="rule-description">Description</label>
|
||||
<input id="rule-description" class="form-control" name="rule-description" placeholder="Description"/>
|
||||
<label for="rule-smirks">SMIRKS</label>
|
||||
<input id="rule-smirks" class="form-control" name="rule-smirks" placeholder="SMIRKS"/>
|
||||
<p></p>
|
||||
<!-- TODO Ruletypes -->
|
||||
<!-- TODO Decide on rules to use?-->
|
||||
<div id="rule-smirks-viz"></div>
|
||||
<input type="hidden" name="rule-type" id="rule-type" value="SimpleAmbitRule">
|
||||
|
||||
<!-- <select id="rule-type" name="rule-type" class="form-control" data-width='100%'>-->
|
||||
<!-- <option disabled selected>Select Rule Type</option>-->
|
||||
<!-- {% for k, v in rule_types.items %}-->
|
||||
<!-- <option value="{{ v }}">{{ k }}</option>-->
|
||||
<!-- {% endfor %}-->
|
||||
<!-- </select>-->
|
||||
<!-- -->
|
||||
<div>
|
||||
<iframe id="new_rule_ketcher" src="{% static '/js/ketcher2/ketcher.html' %}" width="100%"
|
||||
height="510"></iframe>
|
||||
</div>
|
||||
<input type="hidden" name="rule-smirks" id="rule-smirks">
|
||||
<p></p>
|
||||
</form>
|
||||
</div>
|
||||
@ -47,13 +35,36 @@
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$('#rule-smirks').on('input', function(e) {
|
||||
$('#rule-smirks-viz').empty()
|
||||
|
||||
smirks = $('#rule-smirks').val()
|
||||
|
||||
const img = new Image();
|
||||
img.src = "{% url 'depict' %}?is_query_smirks=true&smirks=" + encodeURIComponent(smirks);
|
||||
img.style.width = '100%';
|
||||
img.style.height = '100%';
|
||||
img.style.objectFit = 'cover';
|
||||
|
||||
img.onload = function () {
|
||||
$('#rule-smirks-viz').append(img);
|
||||
};
|
||||
|
||||
img.onerror = function () {
|
||||
error_tpl = `
|
||||
<div class="alert alert-error" role="alert">
|
||||
<h4 class="alert-heading">Could not render SMIRKS!</h4>
|
||||
<p>Could not render SMIRKS - Have you entered a valid SMIRKS?</a>
|
||||
</p>
|
||||
</div>`
|
||||
$('#rule-smirks-viz').append(error_tpl);
|
||||
};
|
||||
});
|
||||
|
||||
$('#new_rule_modal_form_submit').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$(this).prop("disabled",true);
|
||||
|
||||
k = getKetcher('new_rule_ketcher');
|
||||
$('#rule-smirks').val(k.getSmiles());
|
||||
|
||||
// submit form
|
||||
$('#new_rule_modal_form').submit();
|
||||
});
|
||||
|
||||
126
templates/modals/objects/add_pathway_edge_modal.html
Normal file
126
templates/modals/objects/add_pathway_edge_modal.html
Normal file
@ -0,0 +1,126 @@
|
||||
{% load static %}
|
||||
<div class="modal fade bs-modal-lg" id="add_pathway_edge_modal" tabindex="-1" aria-labelledby="add_pathway_edge_modal"
|
||||
aria-modal="true"
|
||||
role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Add a Reaction</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="add_pathway_edge_modal_form" accept-charset="UTF-8"
|
||||
action="{% url 'package pathway edge list' meta.current_package.uuid pathway.uuid %}"
|
||||
data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<label for="edge-name">Name</label>
|
||||
<input id="edge-name" class="form-control" name="edge-name" placeholder="Name"/>
|
||||
<label for="edge-description">Description</label>
|
||||
<input id="edge-description" class="form-control" name="edge-description" placeholder="Description"/>
|
||||
<p></p>
|
||||
<div class="row">
|
||||
<div class="col-xs-5">
|
||||
<legend>Substrate(s)</legend>
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
<legend>Product(s)</legend>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-5">
|
||||
<select id="add_pathway_edge_substrates" name="edge-substrates"
|
||||
data-actions-box='true' class="form-control" multiple data-width='100%'>
|
||||
{% for n in pathway.nodes %}
|
||||
<option data-smiles="{{ n.default_node_label.smiles }}" value="{{ n.url }}">{{ n.default_node_label.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-2" style="display: flex; justify-content: center; align-items: center;">
|
||||
<i class="glyphicon glyphicon-arrow-right"></i>
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
<select id="add_pathway_edge_products" name="edge-products"
|
||||
data-actions-box='true' class="form-control" multiple data-width='100%'>
|
||||
{% for n in pathway.nodes %}
|
||||
<option data-smiles="{{ n.default_node_label.smiles }}" value="{{ n.url }}">{{ n.default_node_label.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p></p>
|
||||
<div class="col-xs-12" id="reaction_image">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary pull-left" data-dismiss="modal">Close
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" id="add_pathway_edge_modal_form_submit">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function reactionImage() {
|
||||
var substrates = [];
|
||||
$('#add_pathway_edge_substrates option:selected').each(function () {
|
||||
var smiles = $(this).data('smiles'); // read data-smiles attribute
|
||||
substrates.push(smiles);
|
||||
});
|
||||
|
||||
var products = []
|
||||
$('#add_pathway_edge_products option:selected').each(function () {
|
||||
var smiles = $(this).data('smiles'); // read data-smiles attribute
|
||||
products.push(smiles);
|
||||
});
|
||||
|
||||
if (substrates.length > 0 && products.length > 0) {
|
||||
reaction = substrates.join('.') + ">>" + products.join('.');
|
||||
$('#reaction_image').empty();
|
||||
$('#reaction_image').append(
|
||||
"<img width='100%' src='{% url 'depict' %}?smirks=" + encodeURIComponent(reaction) +"'>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$("#add_pathway_edge_substrates").selectpicker();
|
||||
$("#add_pathway_edge_products").selectpicker();
|
||||
|
||||
$("#add_pathway_edge_substrates").on('change', function (e) {
|
||||
reactionImage();
|
||||
})
|
||||
|
||||
$("#add_pathway_edge_products").on('change', function (e) {
|
||||
reactionImage();
|
||||
})
|
||||
|
||||
$(function () {
|
||||
$('#add_pathway_edge_modal_form_submit').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).prop("disabled", true);
|
||||
|
||||
|
||||
// submit form
|
||||
$('#add_pathway_edge_modal_form').submit();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
78
templates/modals/objects/add_pathway_node_modal.html
Normal file
78
templates/modals/objects/add_pathway_node_modal.html
Normal file
@ -0,0 +1,78 @@
|
||||
{% load static %}
|
||||
<div class="modal fade bs-modal-lg" id="add_pathway_node_modal" tabindex="-1" aria-labelledby="add_pathway_node_modal" aria-modal="true"
|
||||
role="dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">Add a Node</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="add_pathway_node_modal_form" accept-charset="UTF-8" action="{% url 'package pathway node list' meta.current_package.uuid pathway.uuid %}" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<label for="node-name">Name</label>
|
||||
<input id="node-name" class="form-control" name="node-name" placeholder="Name"/>
|
||||
<label for="node-description">Description</label>
|
||||
<input id="node-description" class="form-control" name="node-description" placeholder="Description"/>
|
||||
<label for="node-smiles">SMILES</label>
|
||||
<input type="text" class="form-control" name="node-smiles" placeholder="SMILES" id="node-smiles">
|
||||
<p></p>
|
||||
<div>
|
||||
<iframe id="add_node_ketcher" src="{% static '/js/ketcher2/ketcher.html' %}" width="100%"
|
||||
height="510"></iframe>
|
||||
</div>
|
||||
<p></p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary pull-left" data-dismiss="modal">Close
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" id="add_pathway_node_modal_form_submit">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
function newStructureModalketcherToNewStructureModalTextInput() {
|
||||
$('#node-smiles').val(this.ketcher.getSmiles());
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
||||
$('#add_node_ketcher').on('load', function() {
|
||||
const checkKetcherReady = () => {
|
||||
win = this.contentWindow
|
||||
if (win.ketcher && 'editor' in win.ketcher) {
|
||||
win.ketcher.editor.event.change.handlers.push({
|
||||
once: false,
|
||||
priority: 0,
|
||||
f: newStructureModalketcherToNewStructureModalTextInput,
|
||||
ketcher: win.ketcher
|
||||
});
|
||||
} else {
|
||||
setTimeout(checkKetcherReady, 100);
|
||||
}
|
||||
};
|
||||
|
||||
checkKetcherReady();
|
||||
})
|
||||
|
||||
$(function() {
|
||||
$('#add_pathway_node_modal_form_submit').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$(this).prop("disabled",true);
|
||||
|
||||
|
||||
|
||||
// submit form
|
||||
$('#add_pathway_node_modal_form').submit();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
35
templates/modals/objects/delete_model_modal.html
Normal file
35
templates/modals/objects/delete_model_modal.html
Normal file
@ -0,0 +1,35 @@
|
||||
{% load static %}
|
||||
<!-- Delete Model -->
|
||||
<div id="delete_model_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Delete Model</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Deletes the Model.
|
||||
<form id="delete-model-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" id="hidden" name="hidden" value="delete-model"/>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="delete-model-modal-submit">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#delete-model-modal-submit').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#delete-model-modal-form').submit();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
35
templates/modals/objects/delete_node_modal.html
Normal file
35
templates/modals/objects/delete_node_modal.html
Normal file
@ -0,0 +1,35 @@
|
||||
{% load static %}
|
||||
<!-- Delete Node -->
|
||||
<div id="delete_node_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Delete Node</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Deletes the Node as well as ingoing and outgoing edges.
|
||||
<form id="delete-node-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" id="hidden" name="hidden" value="delete-node"/>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="delete-node-modal-submit">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#delete-node-modal-submit').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#delete-node-modal-form').submit();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
65
templates/modals/objects/delete_pathway_edge_modal.html
Normal file
65
templates/modals/objects/delete_pathway_edge_modal.html
Normal file
@ -0,0 +1,65 @@
|
||||
{% load static %}
|
||||
<!-- Delete Edge -->
|
||||
<div id="delete_pathway_edge_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Delete Edge</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Deletes the Edge. Nodes referenced by this edge will remain.
|
||||
<p></p>
|
||||
<form id="delete-pathway-edge-modal-form" accept-charset="UTF-8" action="" data-remote="true"
|
||||
method="post">
|
||||
{% csrf_token %}
|
||||
<select id="delete_pathway_edge_edges" name="edge-url"
|
||||
data-actions-box='true' class="form-control" data-width='100%'>
|
||||
<option value="" disabled selected>Select Reaction to delete</option>
|
||||
{% for e in pathway.edges %}
|
||||
<option value="{{ e.url }}">{{ e.edge_label.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="hidden" id="hidden" name="hidden" value="delete-edge"/>
|
||||
</form>
|
||||
<p></p>
|
||||
<div id="delete_pathway_edge_image"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="delete-pathway-edge-modal-submit">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#delete_pathway_edge_edges").selectpicker();
|
||||
|
||||
$("#delete_pathway_edge_edges").on('change', function (e) {
|
||||
edge_url = $('#delete_pathway_edge_edges option:selected').val()
|
||||
|
||||
if (edge_url !== "") {
|
||||
$('#delete_pathway_edge_image').empty();
|
||||
$('#delete_pathway_edge_image').append(
|
||||
"<img width='100%' src='" + edge_url + "?image=svg'>"
|
||||
);
|
||||
}
|
||||
})
|
||||
|
||||
$('#delete-pathway-edge-modal-submit').click(function (e) {
|
||||
e.preventDefault();
|
||||
edge_url = $('#delete_pathway_edge_edges option:selected').val()
|
||||
|
||||
if (edge_url === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#delete-pathway-edge-modal-form').attr('action', edge_url)
|
||||
$('#delete-pathway-edge-modal-form').submit();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
35
templates/modals/objects/delete_pathway_modal.html
Normal file
35
templates/modals/objects/delete_pathway_modal.html
Normal file
@ -0,0 +1,35 @@
|
||||
{% load static %}
|
||||
<!-- Delete Pathway -->
|
||||
<div id="delete_pathway_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Delete Pathway</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Deletes the Pathway together with all Nodes and Edges.
|
||||
<form id="delete-pathway-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" id="hidden" name="hidden" value="delete-pathway"/>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="delete-pathway-modal-submit">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#delete-pathway-modal-submit').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#delete-pathway-modal-form').submit();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
65
templates/modals/objects/delete_pathway_node_modal.html
Normal file
65
templates/modals/objects/delete_pathway_node_modal.html
Normal file
@ -0,0 +1,65 @@
|
||||
{% load static %}
|
||||
<!-- Delete Node -->
|
||||
<div id="delete_pathway_node_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Delete Node</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Deletes the Node. Edges having this Node as Substrate or Product will be removed as well.
|
||||
<p></p>
|
||||
<form id="delete-pathway-node-modal-form" accept-charset="UTF-8" action="" data-remote="true"
|
||||
method="post">
|
||||
{% csrf_token %}
|
||||
<select id="delete_pathway_node_nodes" name="node-url"
|
||||
data-actions-box='true' class="form-control" data-width='100%'>
|
||||
<option value="" disabled selected>Select Compound to delete</option>
|
||||
{% for n in pathway.nodes %}
|
||||
<option value="{{ n.url }}">{{ n.default_node_label.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="hidden" id="hidden" name="hidden" value="delete-node"/>
|
||||
</form>
|
||||
<p></p>
|
||||
<div id="delete_pathway_node_image"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="delete-pathway-node-modal-submit">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$("#delete_pathway_node_nodes").selectpicker();
|
||||
|
||||
$("#delete_pathway_node_nodes").on('change', function (e) {
|
||||
node_url = $('#delete_pathway_node_nodes option:selected').val()
|
||||
|
||||
if (node_url !== "") {
|
||||
$('#delete_pathway_node_image').empty();
|
||||
$('#delete_pathway_node_image').append(
|
||||
"<img width='100%' src='" + node_url + "?image=svg'>"
|
||||
);
|
||||
}
|
||||
})
|
||||
|
||||
$('#delete-pathway-node-modal-submit').click(function (e) {
|
||||
e.preventDefault();
|
||||
node_url = $('#delete_pathway_node_nodes option:selected').val()
|
||||
|
||||
if (node_url === "") {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#delete-pathway-node-modal-form').attr('action', node_url)
|
||||
$('#delete-pathway-node-modal-form').submit();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
35
templates/modals/objects/delete_reaction_modal.html
Normal file
35
templates/modals/objects/delete_reaction_modal.html
Normal file
@ -0,0 +1,35 @@
|
||||
{% load static %}
|
||||
<!-- Delete Reaction -->
|
||||
<div id="delete_reaction_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Delete Reaction</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Deletes the Reaction.
|
||||
<form id="delete-reaction-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" id="hidden" name="hidden" value="delete-reaction"/>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="delete-reaction-modal-submit">Delete</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#delete-reaction-modal-submit').click(function (e) {
|
||||
e.preventDefault();
|
||||
$('#delete-reaction-modal-form').submit();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
@ -4,13 +4,13 @@
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Create a Compound</h5>
|
||||
<h5 class="modal-title">Edit Compound</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Edit a Compound.</p>
|
||||
<p>Edit Compound.</p>
|
||||
<form id="edit-compound-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
|
||||
46
templates/modals/objects/edit_node_modal.html
Normal file
46
templates/modals/objects/edit_node_modal.html
Normal file
@ -0,0 +1,46 @@
|
||||
{% load static %}
|
||||
<!-- Edit Node -->
|
||||
<div id="edit_node_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Edit Node</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Edit Node.</p>
|
||||
<form id="edit-node-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
<label for="node-name">Name</label>
|
||||
<input id="node-name" class="form-control" name="node-name" value="{{ node.name}}">
|
||||
</p>
|
||||
<p>
|
||||
<label for="node-description">Description</label>
|
||||
<input id="node-description" type="text" class="form-control"
|
||||
value="{{ node.description }}"
|
||||
name="node-description">
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="edit-node-modal-submit">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$('#edit-node-modal-submit').click(function(e){
|
||||
e.preventDefault();
|
||||
$('#edit-node-modal-form').submit();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
43
templates/modals/objects/edit_pathway_modal.html
Normal file
43
templates/modals/objects/edit_pathway_modal.html
Normal file
@ -0,0 +1,43 @@
|
||||
{% load static %}
|
||||
<!-- Edit Pathway -->
|
||||
<div id="edit_pathway_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Edit Pathway</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Edit Pathway.</p>
|
||||
<form id="edit-pathway-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
<label for="pathway-name">Name</label>
|
||||
<input id="pathway-name" class="form-control" name="pathway-name" value="{{ pathway.name }}">
|
||||
</p>
|
||||
<p>
|
||||
<label for="pathway-description">Description</label>
|
||||
<textarea id="pathway-description" type="text" class="form-control" name="pathway-description"
|
||||
rows="10">{{ pathway.description }}</textarea>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="edit-pathway-modal-submit">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$('#edit-pathway-modal-submit').click(function(e){
|
||||
e.preventDefault();
|
||||
$('#edit-pathway-modal-form').submit();
|
||||
});
|
||||
|
||||
})
|
||||
</script>
|
||||
@ -10,7 +10,6 @@
|
||||
<h3 class="modal-title">Update Reaction</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- <p>Edit a Reaction.</p>-->
|
||||
<form id="edit-reaction-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
{% load static %}
|
||||
<!-- Edit Rule -->
|
||||
<div id="edit_rule_modal" class="modal" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h3 class="modal-title">Update Rule</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="edit-rule-modal-form" accept-charset="UTF-8" action="" data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
<label for="rule-name">Name</label>
|
||||
<input id="rule-name" class="form-control" name="rule-name" value="{{ rule.name }}">
|
||||
</p>
|
||||
<p>
|
||||
<label for="rule-description">Description</label>
|
||||
<input id="rule-description" type="text" class="form-control"
|
||||
value="{{ rule.description }}" name="rule-description">
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
<button type="button" class="btn btn-primary" id="edit-rule-modal-submit">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$('#edit-rule-modal-submit').click(function(e){
|
||||
e.preventDefault();
|
||||
$('#edit-rule-modal-form').submit();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -70,7 +70,6 @@ $(function() {
|
||||
e.preventDefault();
|
||||
|
||||
const formData = $('#request_api_token_form').serialize();
|
||||
console.log(formData)
|
||||
$.post('', formData, function(response) {
|
||||
$('#new-token-pre').text(response.raw_token);
|
||||
$('#new-token').show();
|
||||
|
||||
Reference in New Issue
Block a user