Skip to content

Commit

Permalink
Merge pull request #4191 from Romashka/master
Browse files Browse the repository at this point in the history
Fixed revisions compare view
  • Loading branch information
greg0ire committed Nov 22, 2016
2 parents d404b31 + 3962e3f commit e6a4232
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
45 changes: 41 additions & 4 deletions Resources/views/CRUD/base_show.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ file that was distributed with this source code.

{% extends base_template %}

{% import 'SonataAdminBundle:CRUD:base_show_macro.html.twig' as show_helper %}

{%- block actions -%}
{% include 'SonataAdminBundle:CRUD:action_buttons.html.twig' %}
{%- endblock -%}
Expand Down Expand Up @@ -56,19 +54,58 @@ file that was distributed with this source code.
<p>{{ show_tab.description|raw }}</p>
{% endif %}

{{ show_helper.render_groups(admin, object, elements, show_tab.groups, has_tab) }}
{% set groups = show_tab.groups %}
{{ block('show_groups') }}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% elseif admin.showtabs is iterable %}
{{ show_helper.render_groups(admin, object, elements, admin.showtabs.default.groups, has_tab) }}
{% 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 %}
{{ admin.trans(show_group.name, {}, show_group.translation_domain) }}
{% 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 %}
4 changes: 0 additions & 4 deletions Resources/views/CRUD/base_show_compare.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ file that was distributed with this source code.

{% extends 'SonataAdminBundle:CRUD:base_show.html.twig' %}

{% block show_title %}
{{ name|trans({}, admin.translationdomain) }}
{% endblock %}

{% block show_field %}
<tr class="sonata-ba-view-container history-audit-compare">
{% if elements[field_name] is defined %}
Expand Down
2 changes: 2 additions & 0 deletions Resources/views/CRUD/base_show_macro.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{# NEXT_MAJOR: remove this template #}

{% macro render_groups(admin, object, elements, groups, has_tab, no_padding = false) %}
<div class="row">
{{ block('field_row') }}
Expand Down

0 comments on commit e6a4232

Please sign in to comment.