diff --git a/install/upgrade/bones.sql b/install/upgrade/bones.sql index bee4e31b0..909f38ed7 100644 --- a/install/upgrade/bones.sql +++ b/install/upgrade/bones.sql @@ -2,6 +2,10 @@ BEGIN; -- Feature: Bone inventory (#1473) +INSERT INTO model.openatlas_class (name, cidoc_class_code, alias_allowed, reference_system_allowed, new_types_allowed, write_access_group_name, layout_color, layout_icon, standard_type_id) VALUES + ('bone', 'E20', false, true, true, 'contributor', NULL, 'mdi-map-marker', NULL); + + INSERT INTO model.entity (cidoc_class_code, openatlas_class_name, name) VALUES ('E55', 'type_tools', 'Bone preservation'), ('E55', 'type_tools', '0%'), diff --git a/openatlas/views/tools.py b/openatlas/views/tools.py index 633d241da..d504bbf3a 100755 --- a/openatlas/views/tools.py +++ b/openatlas/views/tools.py @@ -295,7 +295,7 @@ def bones(id_: int) -> str | Response: _('bone inventory')]) -@app.route('/tools/bones_update//') +@app.route('/tools/bones_update//', methods=['GET', 'POST']) @required_group('contributor') def bones_update(id_: int, category) -> str | Response: entity = Entity.get_by_id(id_, types=True) @@ -308,10 +308,11 @@ def bones_update(id_: int, category) -> str | Response: 'bones', content= Markup(f'
{form.csrf_token}') + - bone_row( + bone_rows( form, category, structure[category.replace('_', ' ')]) + + form.save + Markup('
'), buttons=[manual('tools/anthropological_analyses')])}, crumbs=tools_start_crumbs(entity) + [ @@ -360,7 +361,7 @@ def bone_fields_recursive(form, label, item, choices): bone_fields_recursive(form, label, sub, choices) -def bone_row( +def bone_rows( form: Any, label: str, item: dict[str, Any], @@ -373,5 +374,5 @@ def bone_row( html += Markup('') if 'subs' in item: for label, sub in item['subs'].items(): - html += bone_row(form, label, sub, offset + 0.5) + html += bone_rows(form, label, sub, offset + 0.5) return html