-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
75 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% block iphp_file_widget %} | ||
|
||
|
||
<div {{ block('widget_container_attributes') }}> | ||
|
||
{% if form.file is defined %} | ||
{{ form_widget(form.file) }} | ||
{% endif %} | ||
|
||
{# if was upload error value is uploadedFile and originalName no exists#} | ||
{% if file_data and file_data.originalName is defined %} | ||
{% set fileUrl = file_data.path %} | ||
|
||
{% if show_preview and file_data.width is defined %} | ||
{% block iphp_file_widget_image_preview %} | ||
|
||
<div style="float: left" class="iphp_file_widget_image_preview"> | ||
<a href="{{ fileUrl }}" target="_blank"><img | ||
src="{{ fileUrl }}" | ||
width="{{ file_data .width > 200 ? 200 : file_data.width }}" border="0"></a> | ||
</div> | ||
|
||
<div>{{ file_data.width ~ 'x' ~ file_data.height }} </div> | ||
{% endblock iphp_file_widget_image_preview %} | ||
{% endif %} | ||
|
||
|
||
|
||
{% block iphp_file_widget_file_info %} | ||
<div> | ||
|
||
{% block iphp_file_widget_file_link %} | ||
<div> | ||
<a href="{{ fileUrl }}" target="_blank" class="full-img-link">{{ file_data.fileName }}</a> | ||
</div> | ||
{% endblock iphp_file_widget_file_link %} | ||
|
||
{% block iphp_file_widget_file_attrs %} | ||
<div>{{ file_data.size /1000 }} Kb</div> | ||
|
||
{% if file_data.originalName != file_data.fileName %} | ||
<div> | ||
{% trans %}Original file name{% endtrans %}: | ||
<strong>{{ file_data.originalName }}</strong> | ||
</div> | ||
{% endif %} | ||
{% endblock iphp_file_widget_file_attrs %} | ||
|
||
|
||
{% if form.delete is defined %} | ||
{% block iphp_file_widget_file_delete %} | ||
<div> | ||
{{ form_row (form.delete, {'label_attr' : { 'style' :'width:auto;padding-right:10px' }}) }} | ||
</div> | ||
{% endblock iphp_file_widget_file_delete %} | ||
{% endif %} | ||
|
||
</div> | ||
{% endblock iphp_file_widget_file_info %} | ||
|
||
|
||
|
||
|
||
{% endif %} | ||
|
||
|
||
{% block iphp_file_widget_end %} | ||
<div style="clear: both"></div> | ||
{% endblock iphp_file_widget_end %} | ||
|
||
</div> | ||
|
||
|
||
{% endblock iphp_file_widget %} |
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 |
---|---|---|
@@ -1,60 +1 @@ | ||
{% block iphp_file_widget %} | ||
|
||
|
||
<div {{ block('widget_container_attributes') }}> | ||
|
||
{% if form.file is defined %} | ||
{{ form_widget(form.file) }} | ||
{% endif %} | ||
|
||
{# if was upload error value is uploadedFile and originalName no exists#} | ||
{% if file_data and file_data.originalName is defined %} | ||
{% set fileUrl = file_data.path %} | ||
{# |url_encode() #} | ||
|
||
|
||
|
||
{% block iphp_file_info %} | ||
<table> | ||
<tr> | ||
|
||
{% if show_preview %} | ||
{% if file_data.width is defined %} | ||
<td><a href="{{ fileUrl }}" target="_blank" class="full-img-link"><img | ||
src="{{ fileUrl }}" | ||
width="{{ file_data .width > 200 ? 200 : file_data.width }}" border="0"></a> | ||
</td> | ||
<td> </td> | ||
{% endif %} | ||
{% endif %} | ||
|
||
<td style="vertical-align: top;"> | ||
|
||
<a href="{{ fileUrl }}" target="_blank" class="full-img-link">{{ file_data.fileName }}</a> | ||
<br>{{ file_data.size /1000 }} Kb | ||
{{ file_data.width is defined ? ', ' ~ file_data.width ~ 'x' ~ file_data.height : "" }} | ||
|
||
{% if file_data.originalName != file_data.fileName %} | ||
<br>{% trans %}Original file name{% endtrans %}: <b>{{ file_data.originalName }}</b> | ||
{% endif %} | ||
|
||
|
||
|
||
{% if form.delete is defined %} | ||
<br><br> | ||
{{ form_row (form.delete, {'label_attr' : { 'style' :'width:auto;padding-right:10px' }})}} | ||
{% endif %} | ||
|
||
</td> | ||
|
||
</tr> | ||
</table> | ||
{% endblock iphp_file_info %} | ||
|
||
|
||
{% endif %} | ||
|
||
</div> | ||
|
||
|
||
{% endblock iphp_file_widget %} | ||
{% extends 'IphpFileStoreBundle:Form:fields-base.html.twig' %} |