-
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.
Add sonata templates for logo and vich download file
- Loading branch information
1 parent
eb2f889
commit c5e259e
Showing
10 changed files
with
65 additions
and
1 deletion.
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
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,3 @@ | ||
# Required for the QA lint-twig to work | ||
vich_uploader: | ||
db_driver: orm |
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,16 @@ | ||
{% extends '@SonataAdmin/CRUD/base_list_field.html.twig' %} | ||
|
||
{% block field %} | ||
{% set fileNameValue = attribute(object, field_description.fieldName ~ 'Name') %} | ||
{% if fileNameValue is null %} | ||
{% set url = asset('bundles/smartsonata/images/placeholders/128x128.png') %} | ||
{% set alt = 'logo' %} | ||
{% else %} | ||
{% set url = vich_uploader_asset(object, field_description.fieldName ~ 'File') %} | ||
{% set alt = attribute(object, field_description.fieldName ~ 'OriginalName') %} | ||
{% endif %} | ||
|
||
<div class="user-block pull-left"> | ||
<img class="img-circle img-bordered-sm" src="{{ url }}" alt="{{ alt }}"/> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% extends '@SonataAdmin/CRUD/base_show_field.html.twig' %} | ||
|
||
{% block field %} | ||
{% set fileNameValue = attribute(object, field_description.fieldName ~ 'Name') %} | ||
{% if fileNameValue is null %} | ||
{% set url = asset('bundles/smartsonata/images/placeholders/128x128.png') %} | ||
{% set alt = 'logo' %} | ||
{% else %} | ||
{% set url = vich_uploader_asset(object, field_description.fieldName ~ 'File') %} | ||
{% set alt = attribute(object, field_description.fieldName ~ 'OriginalName') %} | ||
{% endif %} | ||
|
||
<img class="img-bordered-sm" src="{{ url }}" alt="{{ alt }}" width="100"/> | ||
{% 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,8 @@ | ||
{% extends '@SonataAdmin/CRUD/base_show_field.html.twig' %} | ||
|
||
{% block field %} | ||
{% set fileNameValue = attribute(object, field_description.fieldName ~ 'Name') %} | ||
{% if fileNameValue is not null %} | ||
<a href="{{ vich_uploader_asset(object, field_description.fieldName ~ 'File') }}">{{ 'vich_uploader.link.download'|trans }}</a> | ||
{% endif %} | ||
{% 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