Skip to content

Commit

Permalink
Solved issue BU-ISCIII#322 No extraction parameter fields are showed
Browse files Browse the repository at this point in the history
  • Loading branch information
luissian committed Sep 28, 2024
1 parent 5881ffe commit f8108cc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions django_utils/templatetags/replace_spaces.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django import template

register = template.Library()


@register.filter
def replace_spaces_with_underscores(value):
return value.replace(" ", "_")
11 changes: 6 additions & 5 deletions wetlab/templates/wetlab/handling_molecules.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "core/base.html" %}
{% load static %}
{% load replace_spaces %}
{% block content %}
{% include "wetlab/menu.html" %}
{% include 'core/jexcel_functionality.html' %}
Expand Down Expand Up @@ -125,7 +126,7 @@ <h3>Update sample extraction data with defined parameters</h3>
<div class="card-body">
<h5>Protocol: {{ prot }}</h5>
<div class="row horizontal-scroll my-3">
<div style="height:200px;" id="spreadsheet_{{ prot }}"></div>
<div style="height:200px;" id="spreadsheet_{{ prot|replace_spaces_with_underscores }}"></div>
</div>
</div>
{% endfor %}
Expand Down Expand Up @@ -637,12 +638,12 @@ <h4>Not molecule uses have been defined yet</h4>
{% if molecule_parameters %}
$(document).ready(function () {
{% for prot , value_dict in molecule_parameters.items %}
var {{ prot }}_data = [{% for values in value_dict.m_data %}
var {{ prot|replace_spaces_with_underscores }}_data = [{% for values in value_dict.m_data %}
[{% for value in values %}'{{value}}',{% endfor %}],{% endfor %}
];

var {{ prot }}_data_table = jspreadsheet(document.getElementById('spreadsheet_{{ prot }}'),{
data:{{ prot }}_data,
var {{ prot|replace_spaces_with_underscores }}_data_table = jspreadsheet(document.getElementById('spreadsheet_{{ prot|replace_spaces_with_underscores }}'),{
data:{{ prot|replace_spaces_with_underscores }}_data,
columns: [
{ type: 'hidden' },
{ type: 'text', title:'{{value_dict.fix_heading.0}}', width:180 , readOnly:true },
Expand Down Expand Up @@ -670,7 +671,7 @@ <h4>Not molecule uses have been defined yet</h4>


$("#addExtractionParameters").submit(function (e) {
var table_data = {{ prot }}_data_table.getData()
var table_data = {{ prot|replace_spaces_with_underscores }}_data_table.getData()
var data_json = JSON.stringify(table_data)
$("<input />").attr("type", "hidden")
.attr("name", "{{ prot }}")
Expand Down
1 change: 0 additions & 1 deletion wetlab/utils/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,6 @@ def _lab_statistics(
g_data,
).render()
)
# import pdb; pdb.set_trace()
return research_lab_statistics

research_lab_statistics = {}
Expand Down

0 comments on commit f8108cc

Please sign in to comment.