Commit 88776a44 authored by Niklas de Vries's avatar Niklas de Vries

Merge branch 'feature/add-mp3' into 'master'

added mp3 support

See merge request !7
parents b699674f 32383a76
{% block cwd_image_type_widget %}
{% set imageSrc = form.vars.data %}
{% set type = imageSrc.mediatype|split('/')[0] %}
<div class="row">
<div class="col-md-{{ form.vars.attr.imagecols|default(2) }}">
<div class="fileinput fileinput-{% if imageSrc is not null %}exists{% else %}new{% endif %}" data-provides="fileinput" data-name="{{ form.vars.full_name }}">
......@@ -8,9 +9,12 @@
</div>
<div class="fileinput-preview fileinput-exists thumbnail">
{% if imageSrc is not null and imageSrc.id is defined %}
<img src="{{ imageSrc|cwdImage.cropResize(200,200) }}" />
<input type="hidden" name="{{ form.vars.full_name }}" id="{{ form.vars.id }}" value="{{ imageSrc.id }}" />
{% if type == 'audio' %}
<audio src="{{ path('cwd_media_media_file', { media: imageSrc.id }) }}" controls id='mp3'></audio>
{% elseif type == 'image' %}
<img src="{{ imageSrc|cwdImage.cropResize(200,200) }}" />
{% endif %}
{% endif %}
</div>
<div>
......@@ -19,7 +23,7 @@
<span class="fileinput-exists"> {{ "Change"|trans }} </span>
<input type="file">
</span>
<a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> {{ "Reset"|trans }} </a>
<a href="javascript:;" class="btn red fileinput-exists" data-dismiss="fileinput"> {{ "Reset"|trans }} </a>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment