46 lines
1.9 KiB
HTML
46 lines
1.9 KiB
HTML
{% extends "details.html" %}
|
|
<head>
|
|
{% block head %}
|
|
{{ super() }}
|
|
<title>Reagent Details for {{ reagent['name'] }} - {{ reagent['lot'] }}</title>
|
|
{% endblock %}
|
|
</head>
|
|
<body>
|
|
{% block body %}
|
|
<h2><u>Reagent Details for {{ reagent['name'] }} - {{ reagent['lot'] }}</u></h2>
|
|
{{ super() }}
|
|
<p>{% for key, value in reagent.items() if key not in reagent['excluded'] %}
|
|
<!-- <b>{{ key | replace("_", " ") | title }}: </b>{% if permission and key in reagent['editable']%}<input type={% if key=='expiry' %}"date"{% else %}"text"{% endif %} id="{{ key }}" name="{{ key }}" value="{{ value }}">{% else %}{{ value }}{% endif %}<br>-->
|
|
<b>{{ key | replace("_", " ") | title }}: </b>{{ value }}<br>
|
|
{% endfor %}</p>
|
|
<!-- {% if permission %}-->
|
|
<!-- <button type="button" id="save_btn">Save</button>-->
|
|
<!-- {% endif %}-->
|
|
{% if reagent['submissions'] %}<h2>Submissions:</h2>
|
|
{% for submission in reagent['submissions'] %}
|
|
<p><b><a class="data-link" id="{{ submission }}">{{ submission }}:</a></b> {{ reagent['role'] }}</p>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endblock %}
|
|
</body>
|
|
|
|
{% block script %}
|
|
{{ super() }}
|
|
<script>
|
|
document.getElementById("save_btn").addEventListener("click", function(){
|
|
var new_lot = document.getElementById('lot').value
|
|
var new_exp = document.getElementById('expiry').value
|
|
backend.update_reagent("{{ reagent['lot'] }}", new_lot, new_exp);
|
|
});
|
|
{% for submission in reagent['submissions'] %}
|
|
document.getElementById("{{ submission }}").addEventListener("click", function(){
|
|
backend.submission_details("{{ submission }}");
|
|
});
|
|
{% endfor %}
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
backend.activate_export(false);
|
|
}, false);
|
|
</script>
|
|
{% endblock %}
|
|
|
|
</html> |