Commit 253e8184 authored by Rachel TORCHET's avatar Rachel TORCHET
Browse files

Update tests aspects - remove trash button on the first occurrence of the test description/results

parent 0ce0aa8d
......@@ -338,12 +338,17 @@ Description: IPPI-DB Theme
.formset-item .formset-item-delete-host {
font-size: initial;
text-align: right;
}
.formset-item-delete-host input {
display: none;
}
.flex-group {
display:inline-flex;
}
.formset-item+.formset-item, .formset-nested-item+.formset-nested-item {
margin-top: 1em;
}
......@@ -1325,6 +1330,10 @@ Description: IPPI-DB Theme
}
/* Tests form */
.test_title {
text-align: left;
margin-top: 15px;
}
.tests {
background-color: #E3E9EB;
......
{% load i18n %}
{% load customtags %}
{% block extra_js %}
<script type="text/javascript">
$(document).ready(function () {
var elements = document.getElementsByClassName('delete-btn');
elements[0].style.visibility="collapse";
elements[1].style.visibility="collapse";
});
</script>
{% endblock extra_js %}
<div class="formset-item formset-item-inline-grid">
<h3 class="compound_title">Description</h3>
{{form|bootstrap}}
<h3 class="test_title">Test description</h3>
{{ form|bootstrap}}
<div class="formset-nested-container">
{{ form.nested.management_form }}
{{ form.nested.non_form_errors|bootstrap }}
{% if nested_form %}
<div class="formset-nested-item formset-item-inline-grid">
<h3 class="compound_title">Results</h3>
{{ nested_form|bootstrap }}
<div class="formset-nested-item formset-item-inline-grid">
<h3 class="test_title">Test results</h3>
{{ nested_form|bootstrap }}
</div>
{% endif %}
{% for nested_form in nested_forms %}
<div class="formset-nested-item formset-item-inline-grid">
<h3 class="compound_title">Results</h3>
{{ nested_form|bootstrap }}
<div class="formset-nested-item formset-item-inline-grid">
<h3 class="test_title">Test results</h3>
{{ nested_form|bootstrap }}
</div>
{% endfor %}
<div class="form_div">
<input type="button"
class="add-test"
value="{%if add_another_nested_one %}{{add_another_nested_one}} {%else%}Add another one{%endif%}"
onclick="add_nested_form_to_nested_formset(this,'{{form.nested.prefix}}','{{parent_prefix}}');"/>
<input type="button" class="add-test"
value="{%if add_another_nested_one %}{{add_another_nested_one}} {%else%}Add another one{%endif%}"
onclick="add_nested_form_to_nested_formset(this,'{{form.nested.prefix}}','{{parent_prefix}}');" />
</div>
</div>
</div>
\ No newline at end of file
......@@ -84,7 +84,7 @@ def bootstrap_core(object):
# HACK : If the field is the DELETE button of the formset
attrs["onchange"] = "delete_button_clicked(this);"
field.label = ugettext("DELETE_label")
wrapping_classes += " formset-item-delete-host"
wrapping_classes += " formset-item-delete-host delete-btn"
css_classes.add("formset-item-delete")
# overwrite the css classes
......
......@@ -597,6 +597,8 @@ def admin_session_view(request, biblio_pk, ppi_pk, contribution_pk=None):
"testcytotoxdescription"
] = bibliography.testcytotoxdescription_set.all()
context["testpkdescription"] = bibliography.testpkdescription_set.all()
context["testactivityresults"] = bibliography.testactivitydescription_set.all()
print(testactivityresults)
context["refcompoundbiblio"] = bibliography.refcompoundbiblio_set.all()
if ppi_pk:
ppi = get_object_or_404(models.Ppi, pk=ppi_pk)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment