[Feature] Leftovers after Release (#303)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#303
This commit is contained in:
2026-01-22 10:26:38 +13:00
parent f905bf21cf
commit ab0b5a5186
16 changed files with 465 additions and 11 deletions

View File

@ -1,4 +1,12 @@
{% if meta.can_edit %}
<li>
<a
class="button"
onclick="document.getElementById('edit_scenario_modal').showModal(); return false;"
>
<i class="glyphicon glyphicon-trash"></i> Edit Scenario</a
>
</li>
<li>
<a
class="button"

View File

@ -0,0 +1,20 @@
{% extends "collections/paginated_base.html" %}
{% block page_title %}Settings{% endblock %}
{% block action_button %}
{% endblock action_button %}
{% block action_modals %}
{% endblock action_modals %}
{% block description %}
<p>A setting includes configuration parameters for pathway predictions.</p>
<a
target="_blank"
href="https://wiki.envipath.org/index.php/Setting"
class="link link-primary"
>
Learn more &gt;&gt;
</a>
{% endblock description %}

View File

@ -0,0 +1,91 @@
{% load static %}
<dialog
id="edit_scenario_modal"
class="modal"
x-data="modalForm()"
@close="reset()"
>
<div class="modal-box">
<!-- Header -->
<h3 class="font-bold text-lg">Edit Scenario</h3>
<!-- Close button (X) -->
<form method="dialog">
<button
class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"
:disabled="isSubmitting"
>
</button>
</form>
<!-- Body -->
<div class="py-4">
<form
id="edit-scenario-modal-form"
accept-charset="UTF-8"
action=""
method="post"
>
{% csrf_token %}
<div class="form-control mb-3">
<label class="label" for="scenario-name">
<span class="label-text">Name</span>
</label>
<input
id="scenario-name"
class="input input-bordered w-full"
name="scenario-name"
value="{{ scenario.name|safe }}"
required
/>
</div>
<div class="form-control mb-3">
<label class="label" for="scenario-description">
<span class="label-text">Description</span>
</label>
<input
id="scenario-description"
type="text"
class="input input-bordered w-full"
value="{{ scenario.description|safe }}"
name="scenario-description"
/>
</div>
</form>
</div>
<!-- Footer -->
<div class="modal-action">
<button
type="button"
class="btn"
onclick="this.closest('dialog').close()"
:disabled="isSubmitting"
>
Close
</button>
<button
type="button"
class="btn btn-primary"
@click="submit('edit-scenario-modal-form')"
:disabled="isSubmitting"
>
<span x-show="!isSubmitting">Update</span>
<span
x-show="isSubmitting"
class="loading loading-spinner loading-sm"
></span>
<span x-show="isSubmitting">Updating...</span>
</button>
</div>
</div>
<!-- Backdrop -->
<form method="dialog" class="modal-backdrop">
<button :disabled="isSubmitting">close</button>
</form>
</dialog>

View File

@ -306,6 +306,21 @@
>
<path d="M 0 0 L 10 5 L 0 10 z" fill="#999" />
</marker>
<marker
id="doublearrow"
viewBox="0 0 20 30"
refX="53"
refY="5"
markerWidth="18"
markerHeight="18"
orient="auto-start-reverse"
markerUnits="userSpaceOnUse"
>
<!-- first triangle -->
<path d="M 0 0 L 10 5 L 0 10 z" fill="#999" />
<!-- second triangle -->
<path d="M 10 0 L 20 5 L 10 10 Z" fill="#999" />
</marker>
<marker
id="arrow_passes_app_domain"
viewBox="0 0 10 10"

View File

@ -3,6 +3,7 @@
{% block content %}
{% block action_modals %}
{% include "modals/objects/edit_scenario_modal.html" %}
{% include "modals/objects/add_additional_information_modal.html" %}
{% include "modals/objects/update_scenario_additional_information_modal.html" %}
{% include "modals/objects/generic_delete_modal.html" %}
@ -160,6 +161,25 @@
</div>
</div>
</div>
<!-- Pathways -->
{% if scenario.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 p in scenario.related_pathways %}
<li>
<a href="{{ p.url }}" class="hover:bg-base-200"
>{{ p.name }} <i>({{ p.package.name }})</i></a
>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
</div>
<script>

View File

@ -0,0 +1,67 @@
{% extends "framework_modern.html" %}
{% block content %}
{% block action_modals %}
{% endblock action_modals %}
<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">{{ setting.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 %}
{% endblock %}
</ul>
</div>
</div>
</div>
</div>
<!-- The actual setting -->
<div class="collapse-arrow bg-base-200 collapse">
<input type="checkbox" checked />
<div class="collapse-content">
{% with setting_to_render=setting can_be_default=False %}
{% include "objects/setting_template.html" %}
{% endwith %}
</div>
</div>
</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 %}

View File

@ -31,6 +31,32 @@
{% endblock %}
{% block content %}
<div class="card bg-base-200 mb-6 ">
<div class="card-body">
<h3 class="card-title">Welcome to the new enviPath!</h3>
<p class="mb-4 text-sm">
Rebuilt from the ground up for faster predictions, greater stability,
and powerful scalability. Explore a decade of research on a modern,
reliable platform.<br />
The old system is still accessible but will be shut down at a later
date. If you want to back up your data, download it from the
<a
href="https://legacy.envipath.org"
class="link link-primary"
target="_blank"
>old system</a
>
or contact us via the
<a
href="https://community.envipath.org/"
class="link link-primary"
target="_blank"
>community forum</a
>
for assistance.
</p>
</div>
</div>
<!-- Tab Navigation -->
<div class="border-base-300 mb-6 border-b">
<div class="flex justify-start">