forked from enviPath/enviPy
[Feature] Modern UI roll out (#236)
This PR moves all the collection pages into the new UI in a rough push. I did not put the same amount of care into these as into search, index, and predict. ## Major changes - All modals are now migrated to a state based alpine.js implementation. - jQuery is no longer present in the base layout; ajax is replace by native fetch api - most of the pps.js is now obsolte (as I understand it; the code is not referenced any more @jebus please double check) - in-memory pagination for large result lists (set to 50; we can make that configurable later; performance degrades at around 1k) stukk a bit rough tracked in #235 ## Minor things - Sarch and index also use alpine now - The loading spinner is now CSS animated (not sure if it currently gets correctly called) ## Not done - Ihave not even cheked the admin pages. Not sure If these need migrations - The temporary migration pages still use the old template. Not sure what is supposed to happen with those? @jebus ## What I did to test - opend all pages in browse, and user ; plus all pages reachable from there. - Interacted and tested the functionality of each modal superfically with exception of the API key modal (no functional test). --- This PR is massive sorry for that; just did not want to push half-brokenn state. @jebus @liambrydon I would be glad if you could click around and try to break it :) Finally closes #133 Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#236 Co-authored-by: Tobias O <tobias.olenyi@envipath.com> Co-committed-by: Tobias O <tobias.olenyi@envipath.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
{% extends "framework.html" %}
|
||||
{% extends "framework_modern.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
@ -11,343 +11,257 @@
|
||||
{% include "modals/objects/generic_delete_modal.html" %}
|
||||
{% endblock action_modals %}
|
||||
|
||||
<div class="panel-group" id="reaction-detail">
|
||||
<div class="panel panel-default">
|
||||
<div
|
||||
class="panel-heading"
|
||||
id="headingPanel"
|
||||
style="font-size:2rem;height: 46px"
|
||||
>
|
||||
{{ reaction.name|safe }}
|
||||
<div
|
||||
id="actionsButton"
|
||||
style="float: right;font-weight: normal;font-size: medium;position: relative; top: 50%; transform: translateY(-50%);z-index:100;display: none;"
|
||||
class="dropdown"
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
class="dropdown-toggle"
|
||||
data-toggle="dropdown"
|
||||
role="button"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
><span class="glyphicon glyphicon-wrench"></span> Actions
|
||||
<span class="caret"></span><span style="padding-right:1em"></span
|
||||
></a>
|
||||
<ul id="actionsList" class="dropdown-menu">
|
||||
{% block actions %}
|
||||
{% include "actions/objects/reaction.html" %}
|
||||
{% endblock %}
|
||||
<div class="space-y-2 p-4">
|
||||
<!-- Header Section -->
|
||||
<div class="card bg-base-100">
|
||||
<div class="card-body">
|
||||
<div class="flex items-center justify-between">
|
||||
<h2 class="card-title text-2xl">{{ reaction.name }}</h2>
|
||||
<div id="actionsButton" class="dropdown dropdown-end hidden">
|
||||
<div tabindex="0" role="button" class="btn btn-ghost btn-sm">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="16"
|
||||
height="16"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="lucide lucide-wrench"
|
||||
>
|
||||
<path
|
||||
d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"
|
||||
/>
|
||||
</svg>
|
||||
Actions
|
||||
</div>
|
||||
<ul
|
||||
tabindex="-1"
|
||||
class="dropdown-content menu bg-base-100 rounded-box z-50 w-52 p-2"
|
||||
>
|
||||
{% block actions %}
|
||||
{% include "actions/objects/reaction.html" %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Description -->
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">Description</div>
|
||||
<div class="collapse-content">{{ reaction.description }}</div>
|
||||
</div>
|
||||
|
||||
{% if reaction.aliases %}
|
||||
<!-- Aliases -->
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">Aliases</div>
|
||||
<div class="collapse-content">
|
||||
<ul class="menu bg-base-100 rounded-box">
|
||||
{% for alias in reaction.aliases %}
|
||||
<li><a class="hover:bg-base-200">{{ alias }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Description -->
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-desc-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-detail"
|
||||
href="#reaction-desc"
|
||||
>Description</a
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="reaction-desc" class="panel-collapse in collapse">
|
||||
<div class="panel-body list-group-item">
|
||||
{{ reaction.description|safe }}
|
||||
</div>
|
||||
<!-- Image Representation -->
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">Image Representation</div>
|
||||
<div class="collapse-content">
|
||||
<div class="flex justify-center">{{ reaction.as_svg|safe }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if reaction.aliases %}
|
||||
<!-- Aliases -->
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-aliases-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-detail"
|
||||
href="#reaction-aliases"
|
||||
>Aliases</a
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="reaction-aliases" class="panel-collapse in collapse">
|
||||
<div class="panel-body list-group-item">
|
||||
{% for alias in reaction.aliases %}
|
||||
<a class="list-group-item">{{ alias }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Image -->
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-image-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-detail"
|
||||
href="#reaction-image"
|
||||
>Image Representation</a
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="reaction-image" class="panel-collapse in collapse">
|
||||
<div class="panel-body list-group-item">
|
||||
<div id="image-div" align="center">{{ reaction.as_svg|safe }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reaction Description -->
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-description-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-description-detail"
|
||||
href="#reaction-description-smiles"
|
||||
>Reaction Description</a
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="reaction-description-smiles" class="panel-collapse in collapse">
|
||||
<div class="panel-body list-group-item">
|
||||
<!-- Reaction Description -->
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">Reaction Description</div>
|
||||
<div class="collapse-content">
|
||||
<div class="flex flex-wrap items-center justify-center gap-4">
|
||||
{% for educt in reaction.educts.all %}
|
||||
<a class="btn btn-default" href="{{ educt.url }}"
|
||||
>{{ educt.name|safe }}</a
|
||||
<a href="{{ educt.url }}" class="btn btn-outline btn-sm"
|
||||
>{{ educt.name }}</a
|
||||
>
|
||||
{% endfor %}
|
||||
<span
|
||||
class="glyphicon glyphicon-arrow-right"
|
||||
style="margin-left:5em;margin-right:5em;"
|
||||
aria-hidden="true"
|
||||
></span>
|
||||
{% for product in reaction.products.all %}
|
||||
<a class="btn btn-default" href="{{ product.url }}"
|
||||
>{{ product.name|safe }}</a
|
||||
>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SMIRKS -->
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-smirks-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-detail"
|
||||
href="#reaction-smirks"
|
||||
>SMIRKS Representation</a
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="24"
|
||||
height="24"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="lucide lucide-arrow-right"
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="reaction-smirks" class="panel-collapse in collapse">
|
||||
<div class="panel-body list-group-item">{{ reaction.smirks }}</div>
|
||||
</div>
|
||||
|
||||
{% if reaction.rules.all %}
|
||||
<!-- Rules -->
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-rules-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-detail"
|
||||
href="#reaction-rules"
|
||||
>Rules</a
|
||||
<path d="M5 12h14" />
|
||||
<path d="m12 5 7 7-7 7" />
|
||||
</svg>
|
||||
{% for product in reaction.products.all %}
|
||||
<a href="{{ product.url }}" class="btn btn-outline btn-sm"
|
||||
>{{ product.name }}</a
|
||||
>
|
||||
</h4>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="reaction-rules" class="panel-collapse in collapse">
|
||||
<div class="panel-body list-group-item">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- SMIRKS Representation -->
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">
|
||||
SMIRKS Representation
|
||||
</div>
|
||||
<div class="collapse-content">{{ reaction.smirks }}</div>
|
||||
</div>
|
||||
|
||||
<!-- Rules -->
|
||||
{% if reaction.rules.all %}
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">Rules</div>
|
||||
<div class="collapse-content">
|
||||
<ul class="menu bg-base-100 rounded-box">
|
||||
{% for r in reaction.rules.all %}
|
||||
<a class="list-group-item" href="{{ r.url }}"
|
||||
>{{ r.name|safe }}</a
|
||||
>
|
||||
<li>
|
||||
<a href="{{ r.url }}" class="hover:bg-base-200">{{ r.name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if reaction.get_related_enzymes %}
|
||||
<!-- EC Numbers -->
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="rule-ec-numbers-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#rule-detail"
|
||||
href="#rule-ec-numbers"
|
||||
>EC Numbers</a
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="rule-ec-numbers" class="panel-collapse in collapse">
|
||||
<div class="panel-body list-group-item">
|
||||
<!-- EC Numbers -->
|
||||
{% if reaction.get_related_enzymes %}
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">EC Numbers</div>
|
||||
<div class="collapse-content">
|
||||
<ul class="menu bg-base-100 rounded-box">
|
||||
{% for e in reaction.get_related_enzymes %}
|
||||
<a
|
||||
class="list-group-item"
|
||||
href="http://www.brenda-enzymes.org/enzyme.php?ecno={{ e.ec_number }}"
|
||||
>{{ e.name }}</a
|
||||
>
|
||||
<li>
|
||||
<a
|
||||
href="http://www.brenda-enzymes.org/enzyme.php?ecno={{ e.ec_number }}"
|
||||
class="hover:bg-base-200"
|
||||
>{{ e.name }}</a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if reaction.related_pathways %}
|
||||
<!-- Pathways -->
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-pathway-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-detail"
|
||||
href="#reaction-pathway"
|
||||
>Pathways</a
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="reaction-pathway" class="panel-collapse in collapse">
|
||||
<div class="panel-body list-group-item">
|
||||
<!-- Pathways -->
|
||||
{% if reaction.related_pathways %}
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">Pathways</div>
|
||||
<div class="collapse-content">
|
||||
<ul class="menu bg-base-100 rounded-box">
|
||||
{% for r in reaction.related_pathways %}
|
||||
<a class="list-group-item" href="{{ r.url }}"
|
||||
>{{ r.name|safe }}</a
|
||||
>
|
||||
<li>
|
||||
<a href="{{ r.url }}" class="hover:bg-base-200"
|
||||
>{{ r.name }} <i>({{ r.package.name }})</i></a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</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 in collapse">
|
||||
<div class="panel-body list-group-item">
|
||||
<!-- Scenarios -->
|
||||
{% if reaction.scenarios.all %}
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">Scenarios</div>
|
||||
<div class="collapse-content">
|
||||
<ul class="menu bg-base-100 rounded-box">
|
||||
{% for s in reaction.scenarios.all %}
|
||||
<a class="list-group-item" href="{{ s.url }}"
|
||||
>{{ s.name|safe }} <i>({{ s.package.name|safe }})</i></a
|
||||
>
|
||||
<li>
|
||||
<a href="{{ s.url }}" class="hover:bg-base-200"
|
||||
>{{ s.name }} <i>({{ s.package.name }})</i></a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- External Identifiers -->
|
||||
{% if reaction.get_external_identifiers %}
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-external-identifier-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-detail"
|
||||
href="#reaction-external-identifier"
|
||||
>External Identifier</a
|
||||
>
|
||||
</h4>
|
||||
<!-- External Identifiers -->
|
||||
{% if reaction.get_external_identifiers %}
|
||||
<div class="collapse-arrow bg-base-200 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-xl font-medium">
|
||||
External Identifier
|
||||
</div>
|
||||
<div
|
||||
id="reaction-external-identifier"
|
||||
class="panel-collapse in collapse"
|
||||
>
|
||||
<div class="panel-body list-group-item">
|
||||
<div class="collapse-content">
|
||||
<div class="space-y-2">
|
||||
{% if reaction.get_rhea_identifiers %}
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-rhea-identifier-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-external-identifier"
|
||||
href="#reaction-rhea-identifier"
|
||||
>Rhea</a
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div
|
||||
id="reaction-rhea-identifier"
|
||||
class="panel-collapse in collapse"
|
||||
>
|
||||
{% for eid in reaction.get_rhea_identifiers %}
|
||||
<a class="list-group-item" href="{{ eid.external_url }}"
|
||||
>{{ eid.identifier_value }}</a
|
||||
>
|
||||
{% endfor %}
|
||||
<div class="collapse-arrow bg-base-100 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-lg font-medium">Rhea</div>
|
||||
<div class="collapse-content">
|
||||
<ul class="menu bg-base-200 rounded-box">
|
||||
{% for eid in reaction.get_rhea_identifiers %}
|
||||
<li>
|
||||
<a
|
||||
href="{{ eid.external_url }}"
|
||||
class="hover:bg-base-300"
|
||||
>{{ eid.identifier_value }}</a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if reaction.get_uniprot_identifiers %}
|
||||
<div
|
||||
class="panel panel-default panel-heading list-group-item"
|
||||
style="background-color:silver"
|
||||
>
|
||||
<h4 class="panel-title">
|
||||
<a
|
||||
id="reaction-uniprot-identifier-link"
|
||||
data-toggle="collapse"
|
||||
data-parent="#reaction-external-identifier"
|
||||
href="#reaction-uniprot-identifier"
|
||||
>UniProt</a
|
||||
>
|
||||
</h4>
|
||||
</div>
|
||||
<div
|
||||
id="reaction-uniprot-identifier"
|
||||
class="panel-collapse in collapse"
|
||||
>
|
||||
{% for eid in reaction.get_uniprot_identifiers %}
|
||||
<a class="list-group-item" href="{{ eid.external_url }}"
|
||||
>10 SwissProt entries ({{ eid.identifier_value }})</a
|
||||
>
|
||||
{% endfor %}
|
||||
<div class="collapse-arrow bg-base-100 collapse">
|
||||
<input type="checkbox" checked />
|
||||
<div class="collapse-title text-lg font-medium">UniProt</div>
|
||||
<div class="collapse-content">
|
||||
<ul class="menu bg-base-200 rounded-box">
|
||||
{% for eid in reaction.get_uniprot_identifiers %}
|
||||
<li>
|
||||
<a
|
||||
href="{{ eid.external_url }}"
|
||||
class="hover:bg-base-300"
|
||||
>10 SwissProt entries ({{ eid.identifier_value }})</a
|
||||
>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Show actions button if there are actions
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const actionsButton = document.getElementById("actionsButton");
|
||||
const actionsList = actionsButton?.querySelector("ul");
|
||||
if (actionsList && actionsList.children.length > 0) {
|
||||
actionsButton?.classList.remove("hidden");
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock content %}
|
||||
|
||||
Reference in New Issue
Block a user