From 2f8304abb14a38f827075542327f65140828362a Mon Sep 17 00:00:00 2001 From: luissian Date: Tue, 8 Oct 2024 17:52:12 +0200 Subject: [PATCH] prepared for clone repo --- core/utils/samples.py | 2 +- wetlab/class_views/handling_fragmentation.py | 23 + wetlab/templates/wetlab/display_sample.html | 42 +- .../wetlab/hamdling_fragmentation.html | 697 ++++++++++++++++++ wetlab/templates/wetlab/menu.html | 2 +- wetlab/urls.py | 6 + 6 files changed, 750 insertions(+), 22 deletions(-) create mode 100644 wetlab/class_views/handling_fragmentation.py create mode 100644 wetlab/templates/wetlab/hamdling_fragmentation.html diff --git a/core/utils/samples.py b/core/utils/samples.py index 9b8e287f..9e89698e 100644 --- a/core/utils/samples.py +++ b/core/utils/samples.py @@ -922,7 +922,7 @@ def get_all_sample_information(sample_id, join_values=False): .last() .get_param_value() ) - except core.models.MoleculeParameterValue.DoesNotExist: + except (core.models.MoleculeParameterValue.DoesNotExist, AttributeError): # if the parameter was not set at the time the molecule was handeled mol_param_value.append("") diff --git a/wetlab/class_views/handling_fragmentation.py b/wetlab/class_views/handling_fragmentation.py new file mode 100644 index 00000000..75b100d3 --- /dev/null +++ b/wetlab/class_views/handling_fragmentation.py @@ -0,0 +1,23 @@ +from django.shortcuts import render +from django.views import View +import core.models +import core.core_config +import core.utils.samples + +class HandlingFragmentation(View): + template_name = "wetlab/hamdling_fragmentation.html" + package = __package__.split(".")[0] + + def get(self, request, *args, **kwargs): + # collect the data to be shown in the form + return render(request, self.template_name, {"fragmentation_data": self.get_fragmentation_data}) + + def post(self, request, *args, **kwargs): + + + pass + + + def get_fragmentation_data(self): + # get the data to be shown in the form + pass \ No newline at end of file diff --git a/wetlab/templates/wetlab/display_sample.html b/wetlab/templates/wetlab/display_sample.html index 55d56d9c..5f733a79 100644 --- a/wetlab/templates/wetlab/display_sample.html +++ b/wetlab/templates/wetlab/display_sample.html @@ -225,26 +225,28 @@

Sample information for {{sample_information.sample_name} {% if lib_param_heading is not None %} -
-
-

Quality Parameter Library Preparation Information

-
- - - - {% for lib_par_head in lib_param_heading %} - - {%endfor%} - - - - - {% for value in lib_param_values %} - - {%endfor%} - - -
{{ lib_par_head }}
{{ value }}
+
+
+
+

Quality Parameter Library Preparation Information

+
+ + + + {% for lib_par_head in lib_param_heading %} + + {%endfor%} + + + + + {% for value in lib_param_values %} + + {%endfor%} + + +
{{ lib_par_head }}
{{ value }}
+
diff --git a/wetlab/templates/wetlab/hamdling_fragmentation.html b/wetlab/templates/wetlab/hamdling_fragmentation.html new file mode 100644 index 00000000..8d3fe060 --- /dev/null +++ b/wetlab/templates/wetlab/hamdling_fragmentation.html @@ -0,0 +1,697 @@ +{% extends "core/base.html" %} +{% load static %} +{% load replace_spaces %} +{% load join_list_of_tuples %} +{% block content %} + {% include "wetlab/menu.html" %} + {% include 'core/jexcel_functionality.html' %} + {% include "core/cdn_table_functionality.html" %} + {% include "wetlab/menu.html" %} + +
+
+ {% include 'registration/login_inline.html' %} + {% if error_message %} +
+
+
+
+

Unable to process your request

+
+
+

{{ error_message }}

+
+
+
+
+ {% endif %} + {% if fragmentation_protocol %} +
+
+
+
+

Assign the fragmentation Protocol to following samples.

+
+
+
+ {% csrf_token %} + +
+ + +
+
+ +
+
+
+ {% elif fragmentation_recorded.incomplete %} +
+
+
+
+

Information missing

+
+
+
+

Please add the missing information and click on the submit bottom

+
+ {% csrf_token %} + + + + + +
+
+
+ + +
+
+
+
+
+
+ {% elif fragmentation_parameters %} +
+
+
+
+

Update sample extraction data with defined parameters

+
+
+
+ {% csrf_token %} + + + {% for prot, value_dict in fragmentation_parameters.items %} + +
+
Protocol: {{ prot }}
+
+
+
+
+ {% endfor %} + + +
+
+
+
+
+ {% elif fragmentation_parameters_updated %} +
+
+
+
+

Samples have been updated with Extraction required parameters.

+
+
+
+ +
+
+
+
+
+ {% elif extraction_use %} +
+
+
+
+

fragmentations are updated with their use.

+
+
+ + + + {% for value in extraction_use.heading %}{% endfor %} + + + + {% for sample, _id, action in extraction_use.data %} + + + + + + {% endfor %} + +
{{ value }}
{{ sample }}{{ id }}{{ action }}
+
+
+ +
+
+
+
+
+
+ {% else %} +
+
+ + +
+
+ {% endif %} +
+
+ +{% endblock %} diff --git a/wetlab/templates/wetlab/menu.html b/wetlab/templates/wetlab/menu.html index 415ffcc0..57d2697a 100644 --- a/wetlab/templates/wetlab/menu.html +++ b/wetlab/templates/wetlab/menu.html @@ -99,7 +99,7 @@ Handling Extractions
  • - Handling Fragmentations + Handling Fragmentation
  • Handling Library Preparation diff --git a/wetlab/urls.py b/wetlab/urls.py index 225ee3a4..b0ce73b2 100644 --- a/wetlab/urls.py +++ b/wetlab/urls.py @@ -6,6 +6,7 @@ # Local imports import wetlab.views import wetlab.class_views.external_file_preparation +import wetlab.class_views.handling_fragmentation urlpatterns = [ path("", wetlab.views.index, name="index"), @@ -125,6 +126,11 @@ wetlab.views.display_user_lot_kit, name="display_user_lot_kit", ), + path( + "handlingFragmentation", + wetlab.class_views.handling_fragmentation.HandlingFragmentation.as_view(), + name="external_file_preparation", + ), path( "handlingLibraryPreparation", wetlab.views.handling_library_preparation,