diff --git a/src/submissions/backend/db/models/kits.py b/src/submissions/backend/db/models/kits.py
index c49beb0..5156f18 100644
--- a/src/submissions/backend/db/models/kits.py
+++ b/src/submissions/backend/db/models/kits.py
@@ -1207,7 +1207,7 @@ class ProcedureType(BaseClass):
# NOTE: An overly complicated list comprehension create a list of sample locations
# NOTE: next will return a blank cell if no value found for row/column
env = jinja_template_loading()
- template = env.get_template("plate_map.html")
+ template = env.get_template("support/plate_map.html")
html = template.render(plate_rows=self.plate_rows, plate_columns=self.plate_columns, samples=sample_dicts, vw=vw)
return html + "
"
diff --git a/src/submissions/backend/db/models/submissions.py b/src/submissions/backend/db/models/submissions.py
index 56c2396..c83dc17 100644
--- a/src/submissions/backend/db/models/submissions.py
+++ b/src/submissions/backend/db/models/submissions.py
@@ -682,7 +682,7 @@ class Run(BaseClass, LogMixin):
for row in rows
for column in columns]
env = jinja_template_loading()
- template = env.get_template("plate_map.html")
+ template = env.get_template("support/plate_map.html")
html = template.render(samples=output_samples, PLATE_ROWS=plate_rows, PLATE_COLUMNS=plate_columns)
return html + "
"
@@ -1626,7 +1626,7 @@ class ClientSubmissionSampleAssociation(BaseClass):
# NOTE: Since there is no PCR, negliable result is necessary.
sample = self.to_sub_dict()
env = jinja_template_loading()
- template = env.get_template("tooltip.html")
+ template = env.get_template("support/tooltip.html")
tooltip_text = template.render(fields=sample)
try:
control = self.sample.control
@@ -1880,7 +1880,7 @@ class RunSampleAssociation(BaseClass):
# NOTE: Since there is no PCR, negliable result is necessary.
sample = self.to_sub_dict()
env = jinja_template_loading()
- template = env.get_template("tooltip.html")
+ template = env.get_template("support/tooltip.html")
tooltip_text = template.render(fields=sample)
try:
control = self.sample.control
diff --git a/src/submissions/frontend/widgets/procedure_creation.py b/src/submissions/frontend/widgets/procedure_creation.py
index 611cdcb..aabf1d2 100644
--- a/src/submissions/frontend/widgets/procedure_creation.py
+++ b/src/submissions/frontend/widgets/procedure_creation.py
@@ -2,6 +2,8 @@
"""
from __future__ import annotations
+
+import os
import sys, logging
from pathlib import Path
from pprint import pformat
@@ -15,7 +17,7 @@ from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from backend.db.models import Run, ProcedureType
-from tools import jinja_template_loading, get_application_from_parent
+from tools import jinja_template_loading, get_application_from_parent, render_details_template
from backend.validators import PydProcedure
logger = logging.getLogger(f"submissions.{__name__}")
@@ -54,13 +56,15 @@ class ProcedureCreation(QDialog):
self.webview.page().setWebChannel(self.channel)
def set_html(self):
- env = jinja_template_loading()
- template = env.get_template("procedure_creation.html")
- template_path = Path(template.environment.loader.__getattribute__("searchpath")[0])
- with open(template_path.joinpath("css", "styles.css"), "r") as f:
- css = f.read()
- html = template.render(proceduretype=self.proceduretype.as_dict, run=self.run.to_dict(),
- procedure=self.created_procedure.__dict__, plate_map=self.plate_map, css=css)
+ html = render_details_template(
+ template_name="procedure_creation",
+ # css_in=['new_context_menu'],
+ js_in=["procedure_form", "grid_drag", "context_menu"],
+ proceduretype=self.proceduretype.as_dict,
+ run=self.run.to_dict(),
+ procedure=self.created_procedure.__dict__,
+ plate_map=self.plate_map
+ )
with open("procedure.html", "w") as f:
f.write(html)
self.webview.setHtml(html)
@@ -86,21 +90,9 @@ class ProcedureCreation(QDialog):
def rearrange_plate(self, sample_list: list):
self.created_procedure.update_samples(sample_list=sample_list)
- @pyqtSlot(str, str)
- def log_drag(self, source_well: str, destination_well: str):
- logger.debug(f"Source Index: {source_well} Destination Index: {destination_well}")
- # source_well = source_well.split("-")
- # destination_well = destination_well.split("-")
- # source_row = int(source_well[0])
- # source_column = int(source_well[1])
- # destination_row = int(destination_well[0])
- # destination_column = int(destination_well[1])
- # self.created_procedure.shuffle_samples(
- # source_row=source_row,
- # source_column=source_column,
- # destination_row=destination_row,
- # destination_column=destination_column
- # )
+ @pyqtSlot(str)
+ def log(self, logtext: str):
+ logger.debug(logtext)
# class ProcedureWebViewer(QWebEngineView):
diff --git a/src/submissions/templates/css/styles.css b/src/submissions/templates/css/styles.css
index 5ac5add..11df3b1 100644
--- a/src/submissions/templates/css/styles.css
+++ b/src/submissions/templates/css/styles.css
@@ -115,6 +115,9 @@ div.gallery {
display: none;
position: absolute;
z-index: 10;
+ background-color: rgba(229, 231, 228, 0.7);
+ border-radius: 2px;
+ border-color: black;
}
.context-menu--active {
diff --git a/src/submissions/templates/details.html b/src/submissions/templates/details.html
index c98bb69..43e4ba5 100644
--- a/src/submissions/templates/details.html
+++ b/src/submissions/templates/details.html
@@ -5,7 +5,10 @@
{% if css %}
{% endif %}
@@ -18,12 +21,12 @@
{% endblock %}
{% block signing_button %}{% endblock %}