diff --git a/modules/conssheets/routes.py b/modules/conssheets/routes.py index c97556b..90b5f3e 100644 --- a/modules/conssheets/routes.py +++ b/modules/conssheets/routes.py @@ -750,13 +750,19 @@ def register_routes(bp): flash('Process not found', 'danger') return redirect(url_for('conssheets.index')) - # Get header fields for this process - header_fields = query_db(''' + # Get header fields for this process, stripping [title] prefix + header_fields_raw = query_db(''' SELECT * FROM cons_process_fields WHERE process_id = ? AND table_type = 'header' AND is_active = 1 ORDER BY sort_order, id ''', [process_id]) + header_fields = [] + for hf in header_fields_raw: + hf_dict = dict(hf) + hf_dict['field_label'] = strip_title_prefix(hf_dict['field_label']) + header_fields.append(hf_dict) + if request.method == 'POST': # Validate required fields missing_required = [] @@ -816,13 +822,19 @@ def register_routes(bp): flash('Permission denied', 'danger') return redirect(url_for('conssheets.index')) - # Get header fields - header_fields = query_db(''' + # Get header fields for this process, stripping [title] prefix + header_fields_raw = query_db(''' SELECT * FROM cons_process_fields WHERE process_id = ? AND table_type = 'header' AND is_active = 1 ORDER BY sort_order, id ''', [sess['process_id']]) + header_fields = [] + for hf in header_fields_raw: + hf_dict = dict(hf) + hf_dict['field_label'] = strip_title_prefix(hf_dict['field_label']) + header_fields.append(hf_dict) + # Get existing values existing_values = query_db(''' SELECT cpf.field_name, cshv.field_value diff --git a/modules/conssheets/templates/conssheets/staff_index.html b/modules/conssheets/templates/conssheets/staff_index.html index 05a5784..0af5269 100644 --- a/modules/conssheets/templates/conssheets/staff_index.html +++ b/modules/conssheets/templates/conssheets/staff_index.html @@ -46,7 +46,7 @@
{% if s.header_preview %}