forked from enviPath/enviPy
Add Edge check for pes
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
x-data="{
|
x-data="{
|
||||||
isSubmitting: false,
|
isSubmitting: false,
|
||||||
reactionImageUrl: '',
|
reactionImageUrl: '',
|
||||||
|
pes: false,
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.isSubmitting = false;
|
this.isSubmitting = false;
|
||||||
@ -15,20 +16,30 @@
|
|||||||
const substratesSelect = document.getElementById('add_pathway_edge_substrates');
|
const substratesSelect = document.getElementById('add_pathway_edge_substrates');
|
||||||
const productsSelect = document.getElementById('add_pathway_edge_products');
|
const productsSelect = document.getElementById('add_pathway_edge_products');
|
||||||
|
|
||||||
|
const pesLinks = [];
|
||||||
|
|
||||||
const substrates = [];
|
const substrates = [];
|
||||||
for (const option of substratesSelect.selectedOptions) {
|
for (const option of substratesSelect.selectedOptions) {
|
||||||
substrates.push(option.dataset.smiles);
|
substrates.push(option.dataset.smiles);
|
||||||
|
if (option.dataset.pes === 'true') {
|
||||||
|
pesLinks.push(option.dataset.pes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const products = [];
|
const products = [];
|
||||||
for (const option of productsSelect.selectedOptions) {
|
for (const option of productsSelect.selectedOptions) {
|
||||||
products.push(option.dataset.smiles);
|
products.push(option.dataset.smiles);
|
||||||
|
if (option.dataset.pes === 'true') {
|
||||||
|
pesLinks.push(option.dataset.pes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (substrates.length > 0 && products.length > 0) {
|
if (substrates.length > 0 && products.length > 0) {
|
||||||
const reaction = substrates.join('.') + '>>' + products.join('.');
|
const reaction = substrates.join('.') + '>>' + products.join('.');
|
||||||
this.reactionImageUrl = '{% url "depict" %}?smirks=' + encodeURIComponent(reaction);
|
this.reactionImageUrl = '{% url "depict" %}?smirks=' + encodeURIComponent(reaction);
|
||||||
|
this.pes = pesLinks.length > 0;
|
||||||
} else {
|
} else {
|
||||||
|
this.pes = false;
|
||||||
this.reactionImageUrl = '';
|
this.reactionImageUrl = '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -106,6 +117,7 @@
|
|||||||
{% for n in pathway.nodes %}
|
{% for n in pathway.nodes %}
|
||||||
<option
|
<option
|
||||||
data-smiles="{{ n.default_node_label.smiles }}"
|
data-smiles="{{ n.default_node_label.smiles }}"
|
||||||
|
data-pes="{% if n.default_node_label.pes_link %}true{% else %}false{% endif %}"
|
||||||
value="{{ n.url }}"
|
value="{{ n.url }}"
|
||||||
>
|
>
|
||||||
{{ n.default_node_label.name|safe }}
|
{{ n.default_node_label.name|safe }}
|
||||||
@ -132,6 +144,7 @@
|
|||||||
{% for n in pathway.nodes %}
|
{% for n in pathway.nodes %}
|
||||||
<option
|
<option
|
||||||
data-smiles="{{ n.default_node_label.smiles }}"
|
data-smiles="{{ n.default_node_label.smiles }}"
|
||||||
|
data-pes="{% if n.default_node_label.pes_link %}true{% else %}false{% endif %}"
|
||||||
value="{{ n.url }}"
|
value="{{ n.url }}"
|
||||||
>
|
>
|
||||||
{{ n.default_node_label.name|safe }}
|
{{ n.default_node_label.name|safe }}
|
||||||
@ -144,6 +157,9 @@
|
|||||||
|
|
||||||
<div class="mb-3" x-show="reactionImageUrl" x-cloak>
|
<div class="mb-3" x-show="reactionImageUrl" x-cloak>
|
||||||
<img :src="reactionImageUrl" class="w-full" alt="Reaction preview" />
|
<img :src="reactionImageUrl" class="w-full" alt="Reaction preview" />
|
||||||
|
<div x-show="pes">
|
||||||
|
<span class='alert alert-info alert-soft'>The reaction contains a partially elucidated structure!</br>For visualization the representative structure is used. The pathway itself will show the actual partially elucidated structure.</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user