diff --git a/src/app.py b/src/app.py index 456a73a..9ba7d84 100644 --- a/src/app.py +++ b/src/app.py @@ -295,7 +295,7 @@ def serve_barcode(tenant_id, filename): # Import product management routes from routes.admin import (add_product, edit_product, delete_product, - generate_barcode, generate_barcode_page) + generate_barcode, generate_barcode_page, manage_ar_fields) # Register product management routes (remove /admin/ from paths) app.add_url_rule('//add', 'admin.add_product', add_product, methods=['GET', 'POST']) @@ -303,6 +303,7 @@ app.add_url_rule('//edit/', 'admin.edit_product', app.add_url_rule('//delete/', 'admin.delete_product', delete_product, methods=['POST']) app.add_url_rule('//generate_barcode//', 'admin.generate_barcode', generate_barcode) app.add_url_rule('//generate_barcode_page/', 'admin.generate_barcode_page', generate_barcode_page) +app.add_url_rule('//ar_fields', 'admin.manage_ar_fields', manage_ar_fields, methods=['GET', 'POST']) # Register API routes with tenant prefix from routes.api import api_index diff --git a/src/templates/admin/ar_fields.html b/src/templates/admin/ar_fields.html index b49f93b..2b26339 100644 --- a/src/templates/admin/ar_fields.html +++ b/src/templates/admin/ar_fields.html @@ -8,7 +8,7 @@

Manage AR Content Fields

Configure the fields that will be returned by the /arcontentfields and /arinfo endpoints.

- Back to Admin + Back to Settings
diff --git a/src/templates/admin/edit_product.html b/src/templates/admin/edit_product.html index 16873bb..a2f3680 100644 --- a/src/templates/admin/edit_product.html +++ b/src/templates/admin/edit_product.html @@ -34,7 +34,7 @@
- Current image + Current image
{% endif %} diff --git a/src/templates/admin/index.html b/src/templates/admin/index.html index d005c1c..fb3fc22 100644 --- a/src/templates/admin/index.html +++ b/src/templates/admin/index.html @@ -43,7 +43,7 @@ {% if custom_field.fieldType == 'IMAGE_URI' %} {% if field.value %}
- {{ custom_field.label }} + {{ custom_field.label }}
{% endif %} {% else %} diff --git a/src/templates/index.html b/src/templates/index.html index b03129a..7f394b3 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -30,7 +30,7 @@ Product ID {% for custom_field in custom_fields %} - {% if custom_field.fieldName != '_id' and custom_field.fieldType != 'IMAGE_URI' %} + {% if custom_field.fieldName != '_id' %} {{ custom_field.label }} {% endif %} {% endfor %} @@ -42,10 +42,18 @@ {{ product_id }} {% for custom_field in custom_fields %} - {% if custom_field.fieldName != '_id' and custom_field.fieldType != 'IMAGE_URI' %} + {% if custom_field.fieldName != '_id' %} {% set matching_fields = product_data|selectattr('fieldName', 'equalto', custom_field.fieldName)|list %} - {{ matching_fields[0].value if matching_fields else '' }} + {% if custom_field.fieldType == 'IMAGE_URI' %} + {% if matching_fields and matching_fields[0].value %} +
+ {{ custom_field.label }} +
+ {% endif %} + {% else %} + {{ matching_fields[0].value if matching_fields else '' }} + {% endif %} {% endif %} {% endfor %} diff --git a/src/templates/tenant_settings.html b/src/templates/tenant_settings.html index d6270ef..c39a0f8 100644 --- a/src/templates/tenant_settings.html +++ b/src/templates/tenant_settings.html @@ -49,7 +49,7 @@

Manage the fields that are returned in the AR content API.

- + Manage AR Fields