2015-12-18 10:27:22 +01:00
|
|
|
{% extends "forms/field.html.twig" %}
|
|
|
|
|
{% set defaults = config.plugins.form %}
|
|
|
|
|
{% set files = defaults.files|merge(field|default([])) %}
|
|
|
|
|
|
|
|
|
|
{% block input %}
|
2015-12-18 17:20:57 +01:00
|
|
|
|
2015-12-19 14:06:27 +01:00
|
|
|
{% if not plugin and not theme %}
|
|
|
|
|
The "file" input field cannot be used in Pages Blueprints. It's intended to be used for Plugins and Themes blueprints.
|
|
|
|
|
Use the "pagemediaselect" type instead.
|
|
|
|
|
{% else %}
|
|
|
|
|
{% if value %}
|
2015-12-21 16:21:51 +01:00
|
|
|
<img src="{{ base_url_relative_frontend == '/' ? '/' : base_url_relative_frontend ~ '/'}}{{ value }}" alt="{{ value|replace({(files.destination ~ '/'): ''}) }}" />
|
|
|
|
|
<a href="{{ uri.addNonce(base_url_relative ~ '/media/' ~ base64_encode(base_path ~ '/' ~ value) ~ '/task' ~ config.system.param_sep ~ 'removeFileFromBlueprint' ~ '/blueprint' ~ config.system.param_sep ~ files.blueprint ~ '/field' ~ config.system.param_sep ~ files.name ~ '/redirect' ~ config.system.param_sep ~ base64_encode(uri.path), 'admin-form', 'admin-nonce') }}">
|
|
|
|
|
<i class="fa fa-close"></i>
|
|
|
|
|
</a>
|
2015-12-18 17:20:57 +01:00
|
|
|
{% endif %}
|
2015-12-18 10:27:22 +01:00
|
|
|
|
2015-12-19 14:06:27 +01:00
|
|
|
<div class="form-input-wrapper {{ field.size }}">
|
|
|
|
|
<input
|
|
|
|
|
{# required attribute structures #}
|
2015-12-21 16:21:51 +01:00
|
|
|
name="{{ (scope ~ field.name)|fieldName ~ '[]' }}"
|
2015-12-19 14:06:27 +01:00
|
|
|
{% block input_attributes %}
|
|
|
|
|
type="file"
|
|
|
|
|
{% if files.accept %}accept="{{ files.accept|join(',') }}"{% endif %}
|
|
|
|
|
{{ parent() }}
|
|
|
|
|
{% endblock %}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
2015-12-18 10:27:22 +01:00
|
|
|
{% endblock %}
|