Skip to content

Commit

Permalink
Merge pull request #335 from woutervandamme/bugfix/media_chooser
Browse files Browse the repository at this point in the history
[MediaBundle] Media chooser type parameter now filters results correctly
  • Loading branch information
Roderik van der Veer committed Apr 16, 2015
2 parents 763388d + 99511d0 commit 034c8ea
Showing 1 changed file with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,20 @@
{% else %}
{% if adminlist.count > 0 %}
<div class="row">
{% set counter = 1 %}
{% for media in folder.media %}
{% set handler = mediamanager.getHandler(media) %}
{% set imageurl = handler.getImageUrl(media, app.request.basePath) %}
{% if imageurl is not empty and media.location == 'local' %}
{% if imageurl|lower|split('.')|last == 'svg' or 'image/svg' in media.contentType %}
{% set imageurl = imageurl %}
{% else %}
{% set imageurl = imageurl | imagine_filter('media_list_thumbnail') %}
{% if not handler or handler.canHandle(media) %}
{% set handler = mediamanager.getHandler(media) %}
{% set imageurl = handler.getImageUrl(media, app.request.basePath) %}
{% if imageurl is not empty and media.location == 'local' %}
{% if imageurl|lower|split('.')|last == 'svg' or 'image/svg' in media.contentType %}
{% set imageurl = imageurl %}
{% else %}
{% set imageurl = imageurl | imagine_filter('media_list_thumbnail') %}
{% endif %}
{% endif %}
{% endif %}

{% if not handler or handler.canHandle(media) %}

<div class="col-sm-6 col-md-4 col-lg-3">
<a href="javascript:void(0)" class="js-url-chooser-media-select thumbnail media-thumbnail" data-thumb-path="{{ imageurl }}" data-path="{{ media.url }}" data-title="{{ media.name|escape('js') }}" data-id="{{ media.id }}" data-cke="{% if cKEditorFuncNum %}true{% else %}false{% endif %}">
<figure>
Expand All @@ -218,15 +220,17 @@
</div>

{# Clearfixes #}
{% if loop.index is divisible by(2) %}
{% if counter is divisible by(2) %}
<div class="clearfix visible-sm-block"></div>
{% endif %}
{% if loop.index is divisible by(3) %}
{% if counter is divisible by(3) %}
<div class="clearfix visible-md-block"></div>
{% endif %}
{% if loop.index is divisible by(4) %}
{% if counter is divisible by(4) %}
<div class="clearfix visible-lg-block"></div>
{% endif %}

{% set counter = counter+1 %}
{% endif %}
{% endfor %}
</div>
Expand Down

0 comments on commit 034c8ea

Please sign in to comment.