forked from enviPath/enviPy
Added UI elements to add/remove Scenarios to various objects (#51)
Fixes #23 Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#51
This commit is contained in:
@ -534,6 +534,16 @@ class AliasMixin(models.Model):
|
||||
class ScenarioMixin(models.Model):
|
||||
scenarios = models.ManyToManyField("epdb.Scenario", verbose_name='Attached Scenarios')
|
||||
|
||||
@transaction.atomic
|
||||
def set_scenarios(self, scenarios: List['Scenario']):
|
||||
self.scenarios.clear()
|
||||
self.save()
|
||||
|
||||
for s in scenarios:
|
||||
self.scenarios.add(s)
|
||||
|
||||
self.save()
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
||||
|
||||
@ -199,6 +199,15 @@ def breadcrumbs(first_level_object=None, second_level_namespace=None, second_lev
|
||||
return bread
|
||||
|
||||
|
||||
def set_scenarios(current_user, attach_object, scenario_urls: List[str]):
|
||||
scens = []
|
||||
for scenario_url in scenario_urls:
|
||||
package = PackageManager.get_package_by_url(current_user, scenario_url)
|
||||
scen = Scenario.objects.get(package=package, uuid=scenario_url.split('/')[-1])
|
||||
scens.append(scen)
|
||||
|
||||
attach_object.set_scenarios(scens)
|
||||
|
||||
def index(request):
|
||||
context = get_base_context(request)
|
||||
context['title'] = 'enviPath - Home'
|
||||
@ -691,7 +700,8 @@ def package_model(request, package_uuid, model_uuid):
|
||||
context['breadcrumbs'] = breadcrumbs(current_package, 'model', current_model)
|
||||
|
||||
context['model'] = current_model
|
||||
|
||||
context['current_object'] = current_model
|
||||
|
||||
return render(request, 'objects/model.html', context)
|
||||
|
||||
elif request.method == 'POST':
|
||||
@ -881,6 +891,7 @@ def package_compound(request, package_uuid, compound_uuid):
|
||||
context['breadcrumbs'] = breadcrumbs(current_package, 'compound', current_compound)
|
||||
|
||||
context['compound'] = current_compound
|
||||
context['current_object'] = current_compound
|
||||
|
||||
return render(request, 'objects/compound.html', context)
|
||||
|
||||
@ -892,6 +903,12 @@ def package_compound(request, package_uuid, compound_uuid):
|
||||
else:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
set_scenarios(current_user, current_compound, selected_scenarios)
|
||||
return redirect(current_compound.url)
|
||||
|
||||
new_compound_name = request.POST.get('compound-name')
|
||||
new_compound_description = request.POST.get('compound-description')
|
||||
|
||||
@ -965,9 +982,19 @@ def package_compound_structure(request, package_uuid, compound_uuid, structure_u
|
||||
context['object_type'] = 'compound'
|
||||
|
||||
context['compound_structure'] = current_structure
|
||||
context['current_object'] = current_structure
|
||||
|
||||
return render(request, 'objects/compound_structure.html', context)
|
||||
|
||||
elif request.method == 'POST':
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
set_scenarios(current_user, current_structure, selected_scenarios)
|
||||
return redirect(current_structure.url)
|
||||
|
||||
return HttpResponseBadRequest()
|
||||
else:
|
||||
return HttpResponseNotAllowed(['GET', ])
|
||||
|
||||
@ -1073,6 +1100,8 @@ def package_rule(request, package_uuid, rule_uuid):
|
||||
context['breadcrumbs'] = breadcrumbs(current_package, 'rule', current_rule)
|
||||
|
||||
context['rule'] = current_rule
|
||||
context['current_object'] = current_rule
|
||||
|
||||
if isinstance(current_rule, SimpleAmbitRule):
|
||||
return render(request, 'objects/simple_rule.html', context)
|
||||
else: # isinstance(current_rule, ParallelRule) or isinstance(current_rule, SequentialRule):
|
||||
@ -1086,6 +1115,12 @@ def package_rule(request, package_uuid, rule_uuid):
|
||||
else:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
set_scenarios(current_user, current_rule, selected_scenarios)
|
||||
return redirect(current_rule.url)
|
||||
|
||||
rule_name = request.POST.get('rule-name', '').strip()
|
||||
rule_description = request.POST.get('rule-description', '').strip()
|
||||
|
||||
@ -1171,6 +1206,7 @@ def package_reaction(request, package_uuid, reaction_uuid):
|
||||
context['breadcrumbs'] = breadcrumbs(current_package, 'reaction', current_reaction)
|
||||
|
||||
context['reaction'] = current_reaction
|
||||
context['current_object'] = current_reaction
|
||||
|
||||
return render(request, 'objects/reaction.html', context)
|
||||
|
||||
@ -1182,6 +1218,12 @@ def package_reaction(request, package_uuid, reaction_uuid):
|
||||
else:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
set_scenarios(current_user, current_reaction, selected_scenarios)
|
||||
return redirect(current_reaction.url)
|
||||
|
||||
new_reaction_name = request.POST.get('reaction-name')
|
||||
new_reaction_description = request.POST.get('reaction-description')
|
||||
|
||||
@ -1314,6 +1356,7 @@ def package_pathway(request, package_uuid, pathway_uuid):
|
||||
context['breadcrumbs'] = breadcrumbs(current_package, 'pathway', current_pathway)
|
||||
|
||||
context['pathway'] = current_pathway
|
||||
context['current_object'] = current_pathway
|
||||
|
||||
context['breadcrumbs'] = [
|
||||
{'Home': s.SERVER_URL},
|
||||
@ -1334,6 +1377,12 @@ def package_pathway(request, package_uuid, pathway_uuid):
|
||||
else:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
set_scenarios(current_user, current_pathway, selected_scenarios)
|
||||
return redirect(current_pathway.url)
|
||||
|
||||
pathway_name = request.POST.get('pathway-name')
|
||||
pathway_description = request.POST.get('pathway-description')
|
||||
|
||||
@ -1454,6 +1503,8 @@ def package_pathway_node(request, package_uuid, pathway_uuid, node_uuid):
|
||||
]
|
||||
|
||||
context['node'] = current_node
|
||||
context['current_object'] = current_node
|
||||
|
||||
context['app_domain_assessment_data'] = json.dumps(current_node.get_app_domain_assessment_data())
|
||||
|
||||
return render(request, 'objects/node.html', context)
|
||||
@ -1471,8 +1522,14 @@ def package_pathway_node(request, package_uuid, pathway_uuid, node_uuid):
|
||||
return redirect(current_pathway.url)
|
||||
else:
|
||||
return HttpResponseBadRequest()
|
||||
else:
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
set_scenarios(current_user, current_node, selected_scenarios)
|
||||
return redirect(current_node.url)
|
||||
|
||||
return HttpResponseBadRequest()
|
||||
else:
|
||||
return HttpResponseNotAllowed(['GET', 'POST'])
|
||||
|
||||
@ -1562,6 +1619,7 @@ def package_pathway_edge(request, package_uuid, pathway_uuid, edge_uuid):
|
||||
context['object_type'] = 'reaction'
|
||||
context['breadcrumbs'] = breadcrumbs(current_package, 'pathway', current_pathway, 'edge', current_edge)
|
||||
context['edge'] = current_edge
|
||||
context['current_object'] = current_edge
|
||||
|
||||
return render(request, 'objects/edge.html', context)
|
||||
|
||||
@ -1574,6 +1632,14 @@ def package_pathway_edge(request, package_uuid, pathway_uuid, edge_uuid):
|
||||
current_edge.delete()
|
||||
return redirect(current_pathway.url)
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
set_scenarios(current_user, current_edge, selected_scenarios)
|
||||
return redirect(current_edge.url)
|
||||
|
||||
return HttpResponseBadRequest()
|
||||
|
||||
else:
|
||||
return HttpResponseNotAllowed(['GET', 'POST'])
|
||||
|
||||
@ -1584,6 +1650,12 @@ def package_scenarios(request, package_uuid):
|
||||
current_package = PackageManager.get_package_by_id(current_user, package_uuid)
|
||||
|
||||
if request.method == 'GET':
|
||||
|
||||
if 'application/json' in request.META.get('HTTP_ACCEPT'): #request.headers.get('Accept') == 'application/json':
|
||||
scens = Scenario.objects.filter(package=current_package).order_by('name')
|
||||
res = [{'name': s.name, 'url': s.url, 'uuid': s.uuid} for s in scens]
|
||||
return JsonResponse(res, safe=False)
|
||||
|
||||
context = get_base_context(request)
|
||||
context['title'] = f'enviPath - {current_package.name} - Scenarios'
|
||||
|
||||
|
||||
@ -7,6 +7,10 @@
|
||||
<a role="button" data-toggle="modal" data-target="#add_structure_modal">
|
||||
<i class="glyphicon glyphicon-plus"></i> Add Structure</a>
|
||||
</li>
|
||||
<li>
|
||||
<a role="button" data-toggle="modal" data-target="#set_scenario_modal">
|
||||
<i class="glyphicon glyphicon-plus"></i> Set Scenarios</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="button" data-toggle="modal" data-target="#delete_compound_modal">
|
||||
<i class="glyphicon glyphicon-trash"></i> Delete Compound</a>
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
<a role="button" data-toggle="modal" data-target="#edit_compound_structure_modal">
|
||||
<i class="glyphicon glyphicon-edit"></i> Edit Compound Structure</a>
|
||||
</li>
|
||||
<li>
|
||||
<a role="button" data-toggle="modal" data-target="#set_scenario_modal">
|
||||
<i class="glyphicon glyphicon-plus"></i> Set Scenarios</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="button" data-toggle="modal" data-target="#delete_compound_structure_modal">
|
||||
<i class="glyphicon glyphicon-trash"></i> Delete Compound Structure</a>
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
<a role="button" data-toggle="modal" data-target="#edit_node_modal">
|
||||
<i class="glyphicon glyphicon-edit"></i> Edit Node</a>
|
||||
</li>
|
||||
<li>
|
||||
<a role="button" data-toggle="modal" data-target="#set_scenario_modal">
|
||||
<i class="glyphicon glyphicon-plus"></i> Set Scenarios</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="button" data-toggle="modal" data-target="#delete_node_modal">
|
||||
<i class="glyphicon glyphicon-trash"></i> Delete Node</a>
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
<a class="button" data-toggle="modal" data-target="#edit_pathway_modal">
|
||||
<i class="glyphicon glyphicon-edit"></i> Edit Pathway</a>
|
||||
</li>
|
||||
<li>
|
||||
<a role="button" data-toggle="modal" data-target="#set_scenario_modal">
|
||||
<i class="glyphicon glyphicon-plus"></i> Set Scenarios</a>
|
||||
</li>
|
||||
{# <li>#}
|
||||
{# <a class="button" data-toggle="modal" data-target="#add_pathway_edge_modal">#}
|
||||
{# <i class="glyphicon glyphicon-plus"></i> Calculate Compound Properties</a>#}
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
<a role="button" data-toggle="modal" data-target="#edit_reaction_modal">
|
||||
<i class="glyphicon glyphicon-edit"></i> Edit Reaction</a>
|
||||
</li>
|
||||
<li>
|
||||
<a role="button" data-toggle="modal" data-target="#set_scenario_modal">
|
||||
<i class="glyphicon glyphicon-plus"></i> Set Scenarios</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="button" data-toggle="modal" data-target="#delete_reaction_modal">
|
||||
<i class="glyphicon glyphicon-trash"></i> Delete Reaction</a>
|
||||
|
||||
@ -3,4 +3,12 @@
|
||||
<a role="button" data-toggle="modal" data-target="#edit_rule_modal">
|
||||
<i class="glyphicon glyphicon-edit"></i> Edit Rule</a>
|
||||
</li>
|
||||
<li>
|
||||
<a role="button" data-toggle="modal" data-target="#set_scenario_modal">
|
||||
<i class="glyphicon glyphicon-plus"></i> Set Scenarios</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="button" data-toggle="modal" data-target="#delete_rule_modal">
|
||||
<i class="glyphicon glyphicon-trash"></i> Delete Rule</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
72
templates/modals/objects/generic_set_scenario_modal.html
Normal file
72
templates/modals/objects/generic_set_scenario_modal.html
Normal file
@ -0,0 +1,72 @@
|
||||
{% load static %}
|
||||
<div class="modal fade bs-modal-lg" id="set_scenario_modal" tabindex="-1" aria-labelledby="set_scenario_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">Set Scenarios for {{ current_object.name }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="loading_scenario_div" class="text-center"></div>
|
||||
<form id="set_scenario_modal_form" accept-charset="UTF-8" action="{{ current_object.url }}"
|
||||
data-remote="true" method="post">
|
||||
{% csrf_token %}
|
||||
<label for="scenario-select">Scenarios</label>
|
||||
<select id="scenario-select" name="selected-scenarios" data-actions-box='true' class="form-control"
|
||||
multiple data-width='100%'>
|
||||
<option disabled>Select Scenarios</option>
|
||||
</select>
|
||||
</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="set_scenario_modal_form_submit">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
|
||||
$(function () {
|
||||
var loaded = false;
|
||||
|
||||
var attachedScenarios = []
|
||||
{% if current_object.scenarios.all %}
|
||||
{% for scen in current_object.scenarios.all %}
|
||||
attachedScenarios.push('{{ scen.url }}')
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
$('#scenario-select').selectpicker();
|
||||
|
||||
$('#set_scenario_modal').on('shown.bs.modal', function () {
|
||||
|
||||
if (!loaded) {
|
||||
makeLoadingGif("#loading_scenario_div", "{% static '/images/wait.gif' %}");
|
||||
$('#loading_scenario_div').append("<p></p><div class='alert alert-info'>Loading Scenarios...</div>");
|
||||
|
||||
$.getJSON("{% url 'package scenario list' meta.current_package.uuid %}").then(function (data) {
|
||||
for(s in data) {
|
||||
scenario = data[s]
|
||||
var selected = attachedScenarios.includes(scenario.url);
|
||||
$('#scenario-select').append(`<option value="${scenario.url}" ${selected ? 'selected' : ''}>${scenario.name}</option>`);
|
||||
}
|
||||
$('#scenario-select').selectpicker('refresh');
|
||||
$("#loading_scenario_div").empty();
|
||||
});
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
$('#set_scenario_modal_form_submit').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$('#set_scenario_modal_form').submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
{% block action_modals %}
|
||||
{% include "modals/objects/edit_rule_modal.html" %}
|
||||
{% include "modals/objects/generic_set_scenario_modal.html" %}
|
||||
{% endblock action_modals %}
|
||||
|
||||
<div class="panel-group" id="rule-detail">
|
||||
@ -49,7 +50,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Scenarios -->
|
||||
{% if rule.scenarios.all %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
<h4 class="panel-title">
|
||||
<a id="rule-scenario-link" data-toggle="collapse" data-parent="#rule-detail"
|
||||
href="#rule-scenario">Scenarios</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="rule-scenario" class="panel-collapse collapse in">
|
||||
<div class="panel-body list-group-item">
|
||||
{% for s in rule.scenarios.all %}
|
||||
<a class="list-group-item" href="{{ s.url }}">{{ s.name }} <i>({{ s.package.name }})</i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- EC Numbers -->
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
{% block action_modals %}
|
||||
{% include "modals/objects/edit_compound_modal.html" %}
|
||||
{% include "modals/objects/add_structure_modal.html" %}
|
||||
{% include "modals/objects/generic_set_scenario_modal.html" %}
|
||||
{% include "modals/objects/delete_compound_modal.html" %}
|
||||
{% endblock action_modals %}
|
||||
|
||||
@ -135,6 +136,23 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Scenarios -->
|
||||
{% if compound.scenarios.all %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
<h4 class="panel-title">
|
||||
<a id="compound-scenario-link" data-toggle="collapse" data-parent="#compound-detail"
|
||||
href="#compound-scenario">Scenarios</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="compound-scenario" class="panel-collapse collapse in">
|
||||
<div class="panel-body list-group-item">
|
||||
{% for s in compound.scenarios.all %}
|
||||
<a class="list-group-item" href="{{ s.url }}">{{ s.name }} <i>({{ s.package.name }})</i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- External Identifiers -->
|
||||
{% if compound.get_external_identifiers %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
{% block action_modals %}
|
||||
{% include "modals/objects/edit_compound_structure_modal.html" %}
|
||||
{% include "modals/objects/generic_set_scenario_modal.html" %}
|
||||
{% endblock action_modals %}
|
||||
|
||||
<div class="panel-group" id="compound-structure-detail">
|
||||
@ -54,6 +55,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if compound_structure.scenarios.all %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
<h4 class="panel-title">
|
||||
<a id="compound_structure-scenario-link" data-toggle="collapse" data-parent="#compound-structure-detail"
|
||||
href="#compound-structure-scenario">Scenarios</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="compound-structure-scenario" class="panel-collapse collapse in">
|
||||
<div class="panel-body list-group-item">
|
||||
{% for s in compound_structure.scenarios.all %}
|
||||
<a class="list-group-item" href="{{ s.url }}">{{ s.name }} <i>({{ s.package.name }})</i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Reactions -->
|
||||
|
||||
<!-- Pathways -->
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
{% block action_modals %}
|
||||
{# {% include "modals/objects/edit_edge_modal.html" %}#}
|
||||
{# {% include "modals/objects/delete_edge_modal.html" %}#}
|
||||
{% include "modals/objects/generic_set_scenario_modal.html" %}
|
||||
{% endblock action_modals %}
|
||||
|
||||
<div class="panel-group" id="edge-detail">
|
||||
@ -103,6 +104,21 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if edge.scenarios.all %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
<h4 class="panel-title">
|
||||
<a id="edge-scenario-link" data-toggle="collapse" data-parent="#edge-detail"
|
||||
href="#edge-scenario">Scenarios</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="edge-scenario" class="panel-collapse collapse in">
|
||||
<div class="panel-body list-group-item">
|
||||
{% for s in edge.scenarios.all %}
|
||||
<a class="list-group-item" href="{{ s.url }}">{{ s.name }} <i>({{ s.package.name }})</i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
{% block action_modals %}
|
||||
{% include "modals/objects/edit_node_modal.html" %}
|
||||
{% include "modals/objects/generic_set_scenario_modal.html" %}
|
||||
{% include "modals/objects/delete_node_modal.html" %}
|
||||
{% endblock action_modals %}
|
||||
|
||||
@ -69,6 +70,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if node.scenarios.all %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
<h4 class="panel-title">
|
||||
<a id="node-scenario-link" data-toggle="collapse" data-parent="#node-detail"
|
||||
href="#node-scenario">Scenarios</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="node-scenario" class="panel-collapse collapse in">
|
||||
<div class="panel-body list-group-item">
|
||||
{% for s in node.scenarios.all %}
|
||||
<a class="list-group-item" href="{{ s.url }}">{{ s.name }} <i>({{ s.package.name }})</i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if app_domain_assessment_data %}
|
||||
<div id="appDomainAssessmentResultTable"></div>
|
||||
<script>
|
||||
|
||||
@ -83,6 +83,7 @@
|
||||
{% include "modals/objects/add_pathway_edge_modal.html" %}
|
||||
{% include "modals/objects/download_pathway_modal.html" %}
|
||||
{% include "modals/objects/edit_pathway_modal.html" %}
|
||||
{% include "modals/objects/generic_set_scenario_modal.html" %}
|
||||
{% include "modals/objects/delete_pathway_node_modal.html" %}
|
||||
{% include "modals/objects/delete_pathway_edge_modal.html" %}
|
||||
{% include "modals/objects/delete_pathway_modal.html" %}
|
||||
@ -207,6 +208,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if pathway.scenarios.all %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
<h4 class="panel-title">
|
||||
<a id="pathway-scenario-link" data-toggle="collapse" data-parent="#pathway-detail"
|
||||
href="#pathway-scenario">Scenarios</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="pathway-scenario" class="panel-collapse collapse in">
|
||||
<div class="panel-body list-group-item">
|
||||
{% for s in pathway.scenarios.all %}
|
||||
<a class="list-group-item" href="{{ s.url }}">{{ s.name }} <i>({{ s.package.name }})</i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if pathway.setting %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
<h4 class="panel-title">
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
{% block action_modals %}
|
||||
{% include "modals/objects/edit_reaction_modal.html" %}
|
||||
{% include "modals/objects/generic_set_scenario_modal.html" %}
|
||||
{% include "modals/objects/delete_reaction_modal.html" %}
|
||||
{% endblock action_modals %}
|
||||
|
||||
@ -120,6 +121,22 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if reaction.scenarios.all %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
<h4 class="panel-title">
|
||||
<a id="reaction-scenario-link" data-toggle="collapse" data-parent="#reaction-detail"
|
||||
href="#reaction-scenario">Scenarios</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="reaction-scenario" class="panel-collapse collapse in">
|
||||
<div class="panel-body list-group-item">
|
||||
{% for s in reaction.scenarios.all %}
|
||||
<a class="list-group-item" href="{{ s.url }}">{{ s.name }} <i>({{ s.package.name }})</i></a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- External Identifiers -->
|
||||
{% if reaction.get_external_identifiers %}
|
||||
<div class="panel panel-default panel-heading list-group-item" style="background-color:silver">
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
{% block action_modals %}
|
||||
{% include "modals/objects/edit_rule_modal.html" %}
|
||||
{% include "modals/objects/generic_set_scenario_modal.html" %}
|
||||
{% endblock action_modals %}
|
||||
|
||||
<div class="panel-group" id="rule-detail">
|
||||
|
||||
Reference in New Issue
Block a user