{% macro render_model_view(view) %}
{% from "widgets/partials/card_header.html.j2" import render_card_header %}

    <div class="card">
        {{ render_card_header(view) }}
        <div id="collapse-{{ view.id }}" class="card-body collapse {% if not view.collapsed %}show{% endif %}">
            {% if view.data %}
                <table class="table">
                    <tbody>
                    {% for field_name, value in view.data.items() %}
                        <tr>
                            <th>{{ field_name|capitalize }}</th>
                            <td>
                                {% if field_name in view.readonly_fields %}
                                    {{ value }} <!-- You can add styling to indicate read-only -->
                                {% else %}
                                    {{ value }}
                                {% endif %}
                            </td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            {% else %}
                <p>No data available.</p>
            {% endif %}
        </div>
    </div>
{% endmacro %}