-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from sherlockode/fix/search-page-results
Update search page style
- Loading branch information
Showing
5 changed files
with
110 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% block block %}EMPTY CONTENT{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{# | ||
This file is part of the Sonata package. | ||
(c) Thomas Rabaix <[email protected]> | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
#} | ||
|
||
{% extends '@SherlockodeSonataModular/Block/block_base.html.twig' %} | ||
|
||
{% block block %} | ||
{% set show_empty_boxes = sonata_admin.adminPool.container.getParameter('sonata.admin.configuration.global_search.empty_boxes') %} | ||
{% set visibility_class = 'sonata-search-result-' ~ show_empty_boxes %} | ||
{% if pager and pager.getResults()|length %} | ||
{% set visibility_class = 'sonata-search-result-show' %} | ||
{% endif %} | ||
|
||
<div class="col-lg-4 col-md-6 search-box-item {{ visibility_class }}"> | ||
<div class="box box-solid {{ visibility_class }}"> | ||
<div class="box-header with-border {{ visibility_class }}"> | ||
{% set icon = settings.icon|default('') %} | ||
{{ icon|raw }} | ||
<h3 class="box-title"> | ||
{{ admin.label|trans({}, admin.translationdomain) }} | ||
</h3> | ||
|
||
<div class="box-tools pull-right"> | ||
{% if pager and pager.getNbResults() > 0 %} | ||
<span class="badge">{{ pager.getNbResults() }}</span> | ||
{% elseif admin.hasRoute('create') and admin.hasAccess('create') %} | ||
<a href="{{ admin.generateUrl('create') }}" class="btn btn-box-tool"> | ||
<i class="fa fa-plus" aria-hidden="true"></i> | ||
</a> | ||
{% endif %} | ||
{% if admin.hasRoute('list') and admin.hasAccess('list') %} | ||
<a href="{{ admin.generateUrl('list') }}" class="btn btn-box-tool"> | ||
<i class="fa fa-list" aria-hidden="true"></i> | ||
</a> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% if pager and pager.getResults()|length %} | ||
<div class="box-body no-padding"> | ||
<div class="list-group"> | ||
{% for result in pager.getResults() %} | ||
{% set link = admin.getSearchResultLink(result) %} | ||
{% if link %} | ||
<a href="{{ link }}" class="list-group-item list-group-item-action">{{ admin.toString(result) }}</a> | ||
{% else %} | ||
<a href="#" class="list-group-item list-group-item-action">{{ admin.toString(result) }}</a> | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
{% else %} | ||
<div class="box-body"> | ||
<p> | ||
<em>{{ 'no_results_found'|trans({}, 'SonataAdminBundle') }}</em> | ||
</p> | ||
</div> | ||
{% endif %} | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters