Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace <colgroup> and <thead> with bs4 tags #1049

Merged
merged 8 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions hawc/apps/animal/templates/animal/_animal_group_list_tbl.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
{% if object_list %}
<table id="ag-table" class="table table-sm table-striped">
<thead>
<tr>
{%if with_experiment %}
<th>Experiment</th>
{% endif %}
<th>Name</th>
<th>Species</th>
<th>Strain</th>
<th>Sex</th>
<th>Siblings</th>
</tr>
</thead>
{% bs4_thead 'Name,Species,Strain,Sex,Siblings' %}
<tbody>
{% for object in object_list %}
<tr>
{%if with_experiment %}
<td><a href="{% url 'animal:animal_group_detail' object.experiment.pk %}">{{object.experiment}}</a></td>
{% endif %}
<td><a href="{% url 'animal:animal_group_detail' object.pk %}">{{object}}</a></td>
<td>{{object.species}}</td>
<td>{{object.strain}}</td>
Expand Down
10 changes: 10 additions & 0 deletions hawc/apps/animal/templates/animal/_doseGroupsDiv.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div id="doseGroupsDiv">
<legend class='d-inline-block'>Dose-groups</legend>
<span class='float-right'>
<a class="btn btn-primary" id="new_dose_column" href="#">Add new representation</a>
<a class='btn btn-primary' href="{% url 'assessment:dose_units_create' assessment.pk %}" onclick="return window.app.HAWCUtils.newWindowPopupLink(this);" title="Add new dose-units">+</a>
</span>
{% if dose_groups_errors %}{% alert danger %}{{dose_groups_errors|safe}}{% endalert %}{% endif %}
<table id="dose_table" class="table table-sm table-striped"></table>
<input id="dose_groups_json" name="dose_groups_json" type="hidden" />
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
{% if object.can_delete %}
{% include "hawc/_delete_block.html" with name="animal-group" notes="This will remove all data associated with the animal-group, including dose-regimes, endpoints, and BMD modeling runs." %}
{% else %}
<div class="alert alert-danger" role="alert">Cannot be deleted. The dosing regime is associated with at least one more animal group; please delete associated animal groups before continuing.</div>
{% alert danger %}Cannot be deleted. The dosing regime is associated with at least one more animal group; please delete associated animal groups before continuing.{% endalert %}
{% endif %}
{% endblock content %}
16 changes: 1 addition & 15 deletions hawc/apps/animal/templates/animal/animalgroup_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,8 @@
<!-- Dosing Regime Form and Dose-Groups -->
{% if crud == "Create" %}
<div id="dosingRegimeContainer">

{% crispy form_dosing_regime %}
<div id="doseGroupsDiv">

<legend class='d-inline-block'>Dose-groups</legend>
<span class='float-right'>
<a class="btn btn-primary" id="new_dose_column" href="#">Add new representation</a>
<a class='btn btn-primary' href="{% url 'assessment:dose_units_create' assessment.pk %}" onclick="return window.app.HAWCUtils.newWindowPopupLink(this);" title="Add new dose-units">+</a>
</span>

{% if dose_groups_errors %}
<div class="alert alert-danger">{{dose_groups_errors|safe}}</div>
{% endif %}
<table id="dose_table" class="table table-sm table-striped"></table>
<input id="dose_groups_json" name="dose_groups_json" type="hidden" />
</div>
{% include 'animal/_doseGroupsDiv.html' %}
</div>
{% endif %}

Expand Down
16 changes: 1 addition & 15 deletions hawc/apps/animal/templates/animal/dosingregime_form.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
{% extends 'assessment-rooted.html' %}

{% block content %}

{% crispy form %}

<div id="doseGroupsDiv">

<legend class='d-inline-block'>Dose-groups</legend>
<span class='float-right'>
<a class="btn btn-primary" id="new_dose_column" href="#">Add new representation</a>
<a class='btn btn-primary' href="{% url 'assessment:dose_units_create' assessment.pk %}" onclick="return window.app.HAWCUtils.newWindowPopupLink(this);" title="Add new dose-units">+</a>
</span>

{% if dose_groups_errors %}<div class="alert alert-danger">{{dose_groups_errors|safe}}</div>{% endif %}
<table id="dose_table" class="table table-sm table-striped"></table>
<input id="dose_groups_json" name="dose_groups_json" type="hidden" />
</div>

{% include 'animal/_doseGroupsDiv.html' %}
{% endblock %}

{% block extrajs %}
Expand Down
2 changes: 1 addition & 1 deletion hawc/apps/animal/templates/animal/endpoint_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% if animal_group.dosing_regime %}
{% crispy form %}
{% else %}
<div class="alert alert-danger" role="alert">Cannot create or modify an endpoint. The animal group has no dose regime. Please update the animal group to add a dosing regime before continuing.</div>
{% alert danger %}Cannot create or modify an endpoint. The animal group has no dose regime. Please update the animal group to add a dosing regime before continuing.{% endalert %}
{% endif %}

{# extra stuff that JS will move to correct location #}
Expand Down
14 changes: 2 additions & 12 deletions hawc/apps/assessment/templates/assessment/_dataset_list.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
{% if object_list.count > 0 %}
<h2>Datasets</h2>
<table class="table table-sm table-striped">
<colgroup>
<col style="width: 30%;">
<col style="width: 60%;">
<col style="width: 10%;">
</colgroup>
<thead>
<tr>
<th>Dataset</th>
<th>Description</th>
<th>Download</th>
</tr>
</thead>
{% bs4_colgroup '30,60,10' %}
{% bs4_thead 'Dataset,Description,Download' %}
<tbody>
{% for object in object_list %}
<tr>
Expand Down
18 changes: 2 additions & 16 deletions hawc/apps/assessment/templates/assessment/assessment_log_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,8 @@ <h2>{{assessment}} Logs</h2>
{% url_replace page=None as params%}

<table class="table table-sm table-striped">
<colgroup>
<col width="5%" />
<col width="25%" />
<col width="40%" />
<col width="15%" />
<col width="15%" />
</colgroup>
<thead>
<tr>
<th>Log</th>
<th>Item</th>
<th>Message</th>
<th>User</th>
<th>Timestamp</th>
</tr>
</thead>
{% bs4_colgroup '5,25,40,15,15' %}
{% bs4_thead 'Log,Item,Message,User,Timestamp' %}
<tbody>
{% for log in object_list %}
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ <h3>Assessment Value for {{object.assessment}}</h3>
</div>
{% endif %}
<table class="table table-sm table-striped">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
{% bs4_colgroup '30,70' %}
<tbody>
{% optional_table_row "Evaluation type" object.get_evaluation_type_display %}
{% optional_table_row "System or health effect basis" object.system %}
Expand Down
14 changes: 2 additions & 12 deletions hawc/apps/assessment/templates/assessment/content_types.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,8 @@ <h2>Content Types</h2>
</p>
<p><b>Selected values for key data in HAWC are shown below:</b></p>
<table class="table table-sm">
<colgroup>
<col width="40%"/>
<col width="40%"/>
<col width="20%"/>
</colgroup>
<thead>
<tr>
<th>Domain</th>
<th>Dataset</th>
<th>ID</th>
</tr>
</thead>
{% bs4_colgroup '40,40,20' %}
{% bs4_thead 'Domain,Dataset,ID' %}
<tbody>
{% for ct in content_types %}
<tr>
Expand Down
21 changes: 3 additions & 18 deletions hawc/apps/assessment/templates/assessment/dataset_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ <h2>{{object}}</h2>
</div>

<table class="table table-sm table-striped">
<colgroup>
<col style="width: 20%;">
<col style="width: 80%;">
</colgroup>
{% bs4_colgroup '20,80' %}
<tbody>
<tr>
<th>Description</th>
Expand Down Expand Up @@ -63,20 +60,8 @@ <h2>{{object}}</h2>
{% if crud == "Read" and obj_perms.edit and object.revisions.count > 0 %}
<h3>Dataset revisions</h3>
<table class="table table-sm table-striped">
<colgroup>
<col style="width: 10%;">
<col style="width: 50%;">
<col style="width: 15%;">
<col style="width: 25%;">
</colgroup>
<thead>
<tr>
<th>Version</th>
<th>Metadata</th>
<th>Download</th>
<th>Created/Last updated</th>
</tr>
</thead>
{% bs4_colgroup '10,50,15,25' %}
{% bs4_thead 'Version,Metadata,Download,Created/Last updated' %}
<tbody>
{% for revision in object.revisions.all %}
<tr>
Expand Down
5 changes: 1 addition & 4 deletions hawc/apps/assessment/templates/assessment/log_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ <h2>{{object}}</h2>


<table class="table table-sm table-striped">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
{% bs4_colgroup '30,70' %}
<tbody>

<tr>
Expand Down
19 changes: 3 additions & 16 deletions hawc/apps/assessment/templates/assessment/log_object_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
<h2>{{first_log}}s</h2>

<table class="table table-sm table-striped">
<colgroup>
<col width="30%">
<col width="70%">
</colgroup>
{% bs4_colgroup '30,70' %}
<tbody>

<tr>
Expand Down Expand Up @@ -40,18 +37,8 @@ <h2>{{first_log}}s</h2>
<h3>Logs</h3>

<table class="table table-sm table-striped">
<colgroup>
<col width="20%" />
<col width="20%" />
<col width="60%" />
</colgroup>
<thead>
<tr>
<th>Timestamp</th>
<th>User</th>
<th>Message</th>
</tr>
</thead>
{% bs4_colgroup '20,20,60' %}
{% bs4_thead 'Timestamp,User,Message' %}
<tbody>
{% for event in object_list %}
<tr>
Expand Down
4 changes: 2 additions & 2 deletions hawc/apps/bmd/templates/bmd/_read_only_session_alert.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="alert alert-warning" role="alert">
{% alert warning %}
<h4>Read only</h4>
<p>This session uses {{object.get_version_display}}, which can no longer be executed in HAWC. To make changes, update the assessment BMDS version to a more recent version. Then, you can delete this current analysis and create a new one.
</p>
</div>
{% endalert %}
5 changes: 1 addition & 4 deletions hawc/apps/bmd/templates/bmd/assessmentsettings_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ <h2>{{object}}</h2>
<p>BMD assessment-settings can only be modified by project managers.</p>

<table class="table table-sm table-striped">
<colgroup>
<col style="width: 30%;">
<col style="width: 70%;">
</colgroup>
{% bs4_colgroup '30,70' %}
<tbody>
<tr><th>Benchmark dose modeling<br/>software (<a href="https://www.epa.gov/bmds">BMDS</a>) version</th><td>{{object.get_version_display}}</td></tr>
<tr><th>Last updated</th><td>{{object.last_updated}}</td></tr>
Expand Down
14 changes: 3 additions & 11 deletions hawc/apps/bmd/templates/bmd/session_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,13 @@ <h2>BMD sessions</h2>
{% endif %}
</div>
{% if not assessment.bmd_settings.can_create_sessions %}
<div class="alert alert-warning" role="alert">
{% alert warning %}
<p>{{assessment.bmd_settings.get_version_display}} is no longer supported by HAWC. Change the assessment benchmark dose settings to the
newest BMDS version to create new sessions.</p>
</div>
{% endalert %}
{% endif %}
<table class='table table-sm table-striped'>
<thead>
<tr>
<th>Session</th>
<th>BMDS version</th>
<th>Dose units</th>
<th>Created</th>
<th>Last updated</th>
</tr>
</thead>
{% bs4_thead 'Session,BMDS Version,Dose Units,Created,Last Updated' %}
<tbody>
{% for o in object_list %}
<tr>
Expand Down
2 changes: 1 addition & 1 deletion hawc/apps/common/templates/common/widgets/error.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{% if message %}<div class="alert alert-danger"><i class="fa fa-fw fa-exclamation-triangle"></i>{{message}}</div>{% endif %}
{% if message %}{% alert danger %}<i class="fa fa-fw fa-exclamation-triangle"></i>{{message}}{% endalert %}{% endif %}
5 changes: 1 addition & 4 deletions hawc/apps/eco/templates/eco/fragments/_design_table.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<table class="table table-sm table-striped" hx-target="this" id="design-table">
<colgroup>
<col style="width: 20%;">
<col style="width: 80%;">
</colgroup>
{% bs4_colgroup '20,80' %}
<tbody>
{% optional_table_row "Name" object.name %}
{% optional_table_row "Design" object.get_design_display %}
Expand Down
5 changes: 1 addition & 4 deletions hawc/apps/epiv2/templates/epiv2/fragments/_design_table.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<table class="table table-sm table-striped" hx-target="this" id="design-table">
<colgroup>
<col style="width: 20%;">
<col style="width: 80%;">
</colgroup>
{% bs4_colgroup '20,80' %}
<tbody>
{% optional_table_row "Study design" object.get_study_design_display %}
{% optional_table_row "Study population N" object.participant_n %}
Expand Down
9 changes: 1 addition & 8 deletions hawc/apps/lit/templates/lit/_pubmedqueries_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
<h3>Results from queries</h3>
{% if queries %}
<table class="table table-sm table-striped">
<thead>
<tr>
<th>Date last executed</th>
<th>Total references found</th>
<th>References added</th>
<th>References removed</th>
</tr>
</thead>
{% bs4_thead 'Date last executed,Total references found,References added,References removed' %}
<tbody>
{% for query in queries %}
<tr>
Expand Down
18 changes: 2 additions & 16 deletions hawc/apps/lit/templates/lit/_search_list.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
{% if object_list %}
<table class="table table-sm table-striped">
<colgroup>
<col style="width: 50%;">
<col style="width: 16%;">
<col style="width: 10%;">
<col style="width: 12%;">
<col style="width: 12%;">
</colgroup>
<thead>
<tr>
<th>Title and description</th>
<th>Source</th>
<th>References</th>
<th>Created</th>
<th>Last Updated</th>
</tr>
</thead>
{% bs4_colgroup '50,16,10,12,12' %}
{% bs4_thead 'Title,Source,References,Created,Last Updated' %}
<tbody>
{% for object in object_list %}
<tr>
Expand Down
8 changes: 4 additions & 4 deletions hawc/apps/lit/templates/lit/reference_extract_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h4>Create studies from selected references</h4>
<div id="study-type-select">
<label for="study-type-select">Study Type(s)</label>
{% if form.study_type.errors %}
<div class="alert alert-danger">{{form.study_type.errors}}</div>
{% alert danger %}{{form.study_type.errors}}{% endalert %}
{% endif %}
<div id="study-type-select">
{% for checkbox in form.study_type %}
Expand All @@ -44,18 +44,18 @@ <h4>Create studies from selected references</h4>
</div>
{% csrf_token %}
{% if form.references.errors %}
<div class="alert alert-danger">{{form.references.errors}}</div>
{% alert danger %}{{form.references.errors}}{% endalert %}
{% endif %}
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="Convert selected to studies">
</div>
</div>
</form>
{% else %}
<div class="alert alert-success">
{% alert success %}
<button type="button" class="close" data-dismiss="alert">&times;</button>
<b>Nothing to be done!</b><br/>
<p>No references have been marked for inclusion which aren't studies already.</p>
</div>
{% endalert %}
{% endif %}
{% endblock %}
Loading
Loading