Fix image display and add AR fields management route

Fixes:
1. Image display - Images now properly display on tenant landing page and edit forms by prepending tenant ID to image paths (/tenant/images/... instead of /images/...)
2. AR fields route - Added /tenant/ar_fields route (without /admin/ prefix) for managing custom AR content fields
3. Template updates - Updated all image src attributes to include tenant prefix for proper routing
4. Navigation - Updated AR fields back button to return to settings page instead of non-existent admin index

Images are now visible in:
- Product list on tenant landing page
- Product edit forms showing current images
- Admin index (if accessed)
This commit is contained in:
2025-10-20 17:17:58 -04:00
parent f781cdf602
commit ccac3134f3
6 changed files with 17 additions and 8 deletions

View File

@@ -30,7 +30,7 @@
<tr>
<th>Product ID</th>
{% for custom_field in custom_fields %}
{% if custom_field.fieldName != '_id' and custom_field.fieldType != 'IMAGE_URI' %}
{% if custom_field.fieldName != '_id' %}
<th>{{ custom_field.label }}</th>
{% endif %}
{% endfor %}
@@ -42,10 +42,18 @@
<tr>
<td>{{ product_id }}</td>
{% for custom_field in custom_fields %}
{% if custom_field.fieldName != '_id' and custom_field.fieldType != 'IMAGE_URI' %}
{% if custom_field.fieldName != '_id' %}
<td>
{% 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 %}
<div class="product-image-container">
<img src="/{{ tenant.id }}{{ matching_fields[0].value }}" alt="{{ custom_field.label }}" class="product-image">
</div>
{% endif %}
{% else %}
{{ matching_fields[0].value if matching_fields else '' }}
{% endif %}
</td>
{% endif %}
{% endfor %}