summaryrefslogtreecommitdiff
path: root/archaeological_finds/templates/ishtar
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/templates/ishtar')
-rw-r--r--archaeological_finds/templates/ishtar/forms/qa_find_basket.html69
-rw-r--r--archaeological_finds/templates/ishtar/forms/qa_find_treatment.html63
-rw-r--r--archaeological_finds/templates/ishtar/sheet_find.html7
-rw-r--r--archaeological_finds/templates/ishtar/sheet_findbasket.html23
4 files changed, 150 insertions, 12 deletions
diff --git a/archaeological_finds/templates/ishtar/forms/qa_find_basket.html b/archaeological_finds/templates/ishtar/forms/qa_find_basket.html
new file mode 100644
index 000000000..77fc2abcd
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/forms/qa_find_basket.html
@@ -0,0 +1,69 @@
+{% extends "ishtar/forms/qa_base.html" %}
+{% load i18n inline_formset table_form %}
+
+{% block main_form %}
+ {% if form.non_field_errors %}
+ <div class="alert alert-danger" role="alert">
+ {{form.non_field_errors}}
+ </div>
+ {% endif %}
+
+ {% for hidden in form.hidden_fields %}
+ {{hidden}}
+ {% if hidden.errors %}<div class="invalid-feedback">
+ {{ hidden.errors }}
+ </div>{% endif %}
+ {% endfor %}
+
+ {% if form.basket %}
+ <div class="form-row">
+ <input type="radio" name="create_or_update" value="create"
+ id="create-choice" checked >
+ &nbsp;<label for="create-choice">{% trans "New" %}</label>
+ </div>
+ {% else %}
+ <input type="hidden" name="create_or_update" value="create">
+ {% endif %}
+ <div id="new-basket">
+ <div class="form-row">
+ {% with form.label as field %}
+ {% include "blocks/bs_field_snippet.html" %}
+ {% endwith %}
+ </div>
+ </div>
+ {% if form.basket %}
+ <div class="form-row">
+ <input type="radio" name="create_or_update" value="update"
+ id="update-choice">
+ &nbsp;<label for="update-choice">{% trans "Add" %}</label>
+ </div>
+ <div id="update-basket">
+ <div class="form-row">
+ {% with form.basket as field %}
+ {% include "blocks/bs_field_snippet.html" %}
+ {% endwith %}
+ </div>
+ </div>
+ {% endif %}
+{% endblock %}
+
+{% block js %}
+var update_form_display = function(){
+ if ($("#update-choice:checked").length){
+ $("#new-basket").hide();
+ $("#update-basket").show();
+ } else {
+ $("#update-basket").hide();
+ $("#new-basket").show();
+ }
+}
+
+$(document).ready(function(){
+ $("#create-choice").click(update_form_display);
+ $("#update-choice").click(update_form_display);
+ update_form_display();
+});
+
+{% endblock %}
+
+
diff --git a/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html b/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html
new file mode 100644
index 000000000..ef3906735
--- /dev/null
+++ b/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html
@@ -0,0 +1,63 @@
+{% extends "ishtar/forms/qa_base.html" %}
+{% load i18n inline_formset table_form %}
+
+{% block main_form %}
+ {% if form.non_field_errors %}
+ <div class="alert alert-danger" role="alert">
+ {{form.non_field_errors}}
+ </div>
+ {% endif %}
+
+ <h4>{% trans "Finds" %}</h4>
+ <ul>{% for item in items %}
+ <li>{{item}}</li>{% endfor %}
+ </ul>
+
+ <h4>{% trans "Packaging" %}</h4>
+ {% for hidden in form.hidden_fields %}
+ {{hidden}}
+ {% if hidden.errors %}<div class="invalid-feedback">
+ {{ hidden.errors }}
+ </div>{% endif %}
+ {% endfor %}
+ <div class="form-row">
+ {% with form.container as field %}
+ {% include "blocks/bs_field_snippet.html" %}
+ {% endwith %}
+ </div>
+
+ <div class="form-row">
+ {{ form.create_treatment }}&nbsp;<label for="{{form.create_treatment.auto_id}}">
+ {% trans "Associate a treatment" %}
+ </label>
+ </div>
+ <div id="new-treatment">
+ {% for field in form %}
+ {% if field.name != 'container' and field.name != 'create_treatment' %}
+ {% if forloop.counter0|divisibleby:2 %}
+ <div class="form-row">{% endif %}
+ {% include "blocks/bs_field_snippet.html" %}
+ {% if not forloop.counter0|divisibleby:2 %}
+ </div>{% endif %}
+ {% endif %}
+ {% endfor %}
+ </div>
+{% endblock %}
+
+{% block js %}
+var update_form_display = function(){
+ if ($("#{{form.create_treatment.auto_id}}:checked").length){
+ $("#new-treatment").show();
+ } else {
+ $("#new-treatment").hide();
+ }
+}
+
+$(document).ready(function(){
+ $("#{{form.create_treatment.auto_id}}").click(update_form_display);
+ update_form_display();
+});
+
+{% endblock %}
+
+
diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html
index 43136e357..021ea5652 100644
--- a/archaeological_finds/templates/ishtar/sheet_find.html
+++ b/archaeological_finds/templates/ishtar/sheet_find.html
@@ -93,12 +93,7 @@
<h3>{% trans "Sheet" %}</h3>
<div class='row'>
{% trans "Checked" as checked_label %}
- {% if item.CHECK_DICT %}
- {% field_flex checked_label item.checked|from_dict:item.CHECK_DICT %}
- {% endif%}
- {% if item.history_object and item.history_object.CHECK_DICT %}
- {% field_flex checked_label item.checked|from_dict:item.history_object.CHECK_DICT %}
- {% endif%}
+ {% field_flex checked_label item.checked_type %}
{% field_flex "Check date" item.check_date %}
{% include "ishtar/blocks/sheet_creation_section.html" %}
</div>
diff --git a/archaeological_finds/templates/ishtar/sheet_findbasket.html b/archaeological_finds/templates/ishtar/sheet_findbasket.html
index b6d4ffd42..3c3ca1d3f 100644
--- a/archaeological_finds/templates/ishtar/sheet_findbasket.html
+++ b/archaeological_finds/templates/ishtar/sheet_findbasket.html
@@ -1,13 +1,24 @@
{% extends "ishtar/sheet.html" %}
{% load i18n window_tables window_header from_dict window_field %}
-{% block head_title %}{% trans "Find basket" %}{% endblock %}
+{% block head_title %}{% trans "Basket" %} - {{item.label}}{% endblock %}
+
+{% block toolbar %}
+{% window_nav item window_id 'show-findbasket' 'find_basket_modify' %}
+{% endblock %}
{% block content %}
-{% window_nav item window_id 'show-findbasket' 'select_itemsinbasket' %}
-<p class="window-refs">{{ item.label|default:"" }}</p>
-{% field "Owned by" item.user %}
-{% field "Comment" item.comment %}
-{% dynamic_table_document finds 'finds_for_ope' 'basket' item.pk 'TABLE_COLS_FOR_OPE' output %}
+<div class='row'>
+ {% field_flex "Label" item.label %}
+ {% field_flex_detail "Owned by" item.user.person %}
+ {% field_flex_multiple "Shared_with" item.shared_with %}
+ {% field_flex "Comment" item.comment %}
+</div>
+
+<h3>{% trans "Content" %}</h3>
+
+{% dynamic_table_document finds 'finds' 'basket_id' item.pk 'TABLE_COLS' output %}
+
+
{% endblock %}