Skip to content

Commit

Permalink
Added the remining graphics for lob
Browse files Browse the repository at this point in the history
  • Loading branch information
luissian committed May 8, 2024
1 parent 8b0fd3a commit 8d66737
Show file tree
Hide file tree
Showing 2 changed files with 241 additions and 108 deletions.
244 changes: 136 additions & 108 deletions wetlab/templates/wetlab/stats_per_researcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,138 +307,166 @@ <h3>Statistics from recorded samples</h3>
{{ researcher_lab_statistics.lab_sample_states_graphic|safe }}
</div>
</div>
<div class="row ">
<h4 class="text-center">Comparison of sample types used</h4>
<div class="col-md-6">
<div id="lab_sample_type_chart"></div>
{{ researcher_lab_statistics.lab_sample_type_graphic|safe }}
</div>
<div class="col-md-6">
<div id="lab_sample_type_vs_all_chart"></div>
{{ researcher_lab_statistics.lab_sample_type_vs_all_graphic|safe }}
</div>
</div>
<div class="row ">
<h4 class="text-center">Comparison of species used</h4>
<div class="col-md-6">
<div id="lab_samples_species_chart"></div>
{{ researcher_lab_statistics.lab_samples_species_graphic|safe }}
</div>
<div class="col-md-6">
<div id="lab_samples_species_vs_all_chart"></div>
{{ researcher_lab_statistics.lab_samples_species_vs_all_graphic|safe }}
</div>
</div>
</div>
<div class="col-md-6">
<div id="lab_sample_states_chart"></div>
{{ researcher_lab_statistics.lab_sample_states_graphic|safe }}
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end sequenced graphics tab-->
<div class="tab-pane fade"
id="lab-table"
role="tabpanel"
aria-labelledby="lab-table-tab">
<div class="container">
<div class="row mt-4">
<div class="col-md">
<div class="card">
<div class="card-header text-center">
<h3>Recorded samples from laboratory</h3>
</div>
<div class="card-body">
<table class="table table-hover" id="lab_sample_table">
<thead>
<tr>
{% for column in researcher_lab_statistics.lab_table_heading %}<th>{{ column }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for sample_data in researcher_lab_statistics.lab_samples %}
<tr>
{% for value in sample_data %}<td>{{ value }}</td>{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- end sequenced graphics tab-->
<div class="tab-pane fade"
id="lab-table"
role="tabpanel"
aria-labelledby="lab-table-tab">
<div class="container">
<div class="row mt-4">
<div class="col-md">
<div class="card">
<div class="card-header text-center">
<h3>Recorded samples from laboratory</h3>
</div>
<div class="card-body">
<table class="table table-hover" id="lab_sample_table">
<thead>
<tr>
{% for column in researcher_lab_statistics.lab_table_heading %}<th>{{ column }}</th>{% endfor %}
</tr>
</thead>
<tbody>
{% for sample_data in researcher_lab_statistics.lab_samples %}
<tr>
{% for value in sample_data %}<td>{{ value }}</td>{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- end table tab-->
</div>
</div>
<!-- end table tab-->
</div>
</div>
{% else %}
<div class="container">
<div class="row my-2">
<div class="col-sm-7 offset-3">
<div class="card ">
</div>
</div>
{% else %}
<div class="container">
<div class="row my-2">
<div class="col-sm-7 offset-3">
<div class="card ">
{% if request.user|has_group:"WetlabManager" %}
<div class="card-header">
<h3 class="text-center">Statistics per Investigator or Laboratory</h3>
</div>
{% else %}
<div class="card-header">
<h3 class="text-center">Statistics per Investigator</h3>
</div>
{% endif %}
<div class="card-body">
<form method="post"
enctype="multipart/form-data"
name="statsresearcher"
id="statsresearcher"
class="form-horizontal well">
{% csrf_token %}
<input type="hidden" name="action" value="researcher" />
{% if request.user|has_group:"WetlabManager" %}
<div class="card-header">
<h3 class="text-center">Statistics per Investigator or Laboratory</h3>
<div class="form-floating mb-3">
<input type="text"
class="form-control"
name="researchername"
id="researchername"
placeholder="Researcher name" />
<label class="form-control" for="researchername">Researcher name</label>
</div>
<div class="form-floating mb-3">
<select class="form-select" name="labname" id="labname" aria-label="labname">
<option value="">Choose a value</option>
{% for id , value in lab_list %}<option value="{{ id }}">{{ value }}</option>{% endfor %}
</select>
<label for="labname">Select Laboratory name</label>
</div>
{% else %}
<div class="card-header">
<h3 class="text-center">Statistics per Investigator</h3>
<div class="form-floating mb-3">
<input type="text"
class="form-control"
name="researchername"
id="researchername"
placeholder="Researcher name"
value="{{ user.get_username }}"
readonly />
<label for="researchername">Researcher name</label>
</div>
{% endif %}
<div class="card-body">
<form method="post"
enctype="multipart/form-data"
name="statsresearcher"
id="statsresearcher"
class="form-horizontal well">
{% csrf_token %}
<input type="hidden" name="action" value="researcher" />
{% if request.user|has_group:"WetlabManager" %}
<div class="form-floating mb-3">
<input type="text"
class="form-control"
name="researchername"
id="researchername"
placeholder="Researcher name" />
<label class="form-control" for="researchername">Researcher name</label>
</div>
<div class="form-floating mb-3">
<select class="form-select" name="labname" id="labname" aria-label="labname">
<option value="">Choose a value</option>
{% for id , value in lab_list %}<option value="{{ id }}">{{ value }}</option>{% endfor %}
</select>
<label for="labname">Select Laboratory name</label>
</div>
{% else %}
<div class="form-floating mb-3">
<input type="text"
class="form-control"
name="researchername"
id="researchername"
placeholder="Researcher name"
value="{{ user.get_username }}"
readonly />
<label for="researchername">Researcher name</label>
</div>
{% endif %}
<div class="row g-2">
<div class="col-md">
<div class="form-floating">
<input type="date"
class="form-control"
id="start_date"
name="startdate"
placeholder="Filter run from start date" />
<label for="start_date">From Start Date (DD/MM/YYYY)</label>
</div>
</div>
<div class="col-md">
<div class="form-floating">
<input type="date"
class="form-control"
id="end_date"
name="enddate"
placeholder="Filter run from end date" />
<label for="end_date">End Date (DD/MM/YYYY)</label>
</div>
</div>
<div class="row g-2">
<div class="col-md">
<div class="form-floating">
<input type="date"
class="form-control"
id="start_date"
name="startdate"
placeholder="Filter run from start date" />
<label for="start_date">From Start Date (DD/MM/YYYY)</label>
</div>
<input class="btn btn-outline-secondary mt-2"
type="reset"
value="Reset Fields" />
<input class="btn float-end btn-outline-primary mt-2"
type="submit"
value="Submit" />
</form>
</div>
<div class="col-md">
<div class="form-floating">
<input type="date"
class="form-control"
id="end_date"
name="enddate"
placeholder="Filter run from end date" />
<label for="end_date">End Date (DD/MM/YYYY)</label>
</div>
</div>
</div>
</div>
<input class="btn btn-outline-secondary mt-2"
type="reset"
value="Reset Fields" />
<input class="btn float-end btn-outline-primary mt-2"
type="submit"
value="Submit" />
</form>
</div>
</div>
</div>
{% endif %}
</div>
</div>
</section>
<script type="text/javascript">
{% endif %}
</div>
</section>
<script type="text/javascript">
$(document).ready(function() {
$('#researcher_table').DataTable({
dom: "Bfltirp",
Expand All @@ -460,5 +488,5 @@ <h3 class="text-center">Statistics per Investigator</h3>
buttons: ['excel', 'csv']
});
});
</script>
</script>
{% endblock %}
Loading

0 comments on commit 8d66737

Please sign in to comment.