123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- {#
- This file is part of the Sonata package.
- (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
- For the full copyright and license information, please view the LICENSE
- file that was distributed with this source code.
- #}
- {% extends base_template %}
- {% block title %}
- {{ "title_show"|trans({'%name%': admin.toString(object)|truncate(15) }, 'SonataAdminBundle') }}
- {% endblock %}
- {% block navbar_title %}
- {{ block('title') }}
- {% endblock %}
- {%- block actions -%}
- {% include 'SonataAdminBundle:CRUD:action_buttons.html.twig' %}
- {%- endblock -%}
- {% block tab_menu %}
- {{ knp_menu_render(admin.sidemenu(action), {
- 'currentClass' : 'active',
- 'template': sonata_admin.adminPool.getTemplate('tab_menu_template')
- }, 'twig') }}
- {% endblock %}
- {% block show %}
- <div class="sonata-ba-view">
- {{ sonata_block_render_event('sonata.admin.show.top', { 'admin': admin, 'object': object }) }}
- {% set has_tab = (admin.showtabs|length == 1 and admin.showtabs|keys[0] != 'default') or admin.showtabs|length > 1 %}
- {% if has_tab %}
- <div class="nav-tabs-custom">
- <ul class="nav nav-tabs" role="tablist">
- {% for name, show_tab in admin.showtabs %}
- <li{% if loop.first %} class="active"{% endif %}>
- <a href="#tab_{{ admin.uniqid }}_{{ loop.index }}" data-toggle="tab">
- <i class="fa fa-exclamation-circle has-errors hide" aria-hidden="true"></i>
- {{ show_tab.label|trans({}, show_tab.translation_domain ?: admin.translationDomain) }}
- </a>
- </li>
- {% endfor %}
- </ul>
- <div class="tab-content">
- {% for code, show_tab in admin.showtabs %}
- <div
- class="tab-pane fade{% if loop.first %} in active{% endif %}"
- id="tab_{{ admin.uniqid }}_{{ loop.index }}"
- >
- <div class="box-body container-fluid">
- <div class="sonata-ba-collapsed-fields">
- {% if show_tab.description != false %}
- <p>{{ show_tab.description|raw }}</p>
- {% endif %}
- {% set groups = show_tab.groups %}
- {{ block('show_groups') }}
- </div>
- </div>
- </div>
- {% endfor %}
- </div>
- </div>
- {% elseif admin.showtabs is iterable %}
- {% set groups = admin.showtabs.default.groups %}
- {{ block('show_groups') }}
- {% endif %}
- </div>
- {{ sonata_block_render_event('sonata.admin.show.bottom', { 'admin': admin, 'object': object }) }}
- {% endblock %}
- {% block show_groups %}
- <div class="row">
- {% block field_row %}
- {% for code in groups %}
- {% set show_group = admin.showgroups[code] %}
- <div class="{{ show_group.class|default('col-md-12') }} {{ no_padding|default(false) ? 'nopadding' }}">
- <div class="{{ show_group.box_class }}">
- <div class="box-header">
- <h4 class="box-title">
- {% block show_title %}
- {{ show_group.label|trans({}, show_group.translation_domain|default(admin.translationDomain)) }}
- {% endblock %}
- </h4>
- </div>
- <div class="box-body table-responsive no-padding">
- <table class="table">
- <tbody>
- {% for field_name in show_group.fields %}
- {% block show_field %}
- <tr class="sonata-ba-view-container">
- {% if elements[field_name] is defined %}
- {{ elements[field_name]|render_view_element(object)}}
- {% endif %}
- </tr>
- {% endblock %}
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- {% endfor %}
- {% endblock %}
- </div>
- {% endblock %}
|