-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
media.html
24 lines (20 loc) · 1.26 KB
/
media.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<div class="asset-selector-container">
<div class="field-label inline" th:text="#{${field.friendlyName}}" th:classappend="${field.required ? 'required' : ''}" />
<div th:substituteby="components/fieldTooltip" />
<br />
<input type="hidden" class="mediaItem" th:field="*{fields['__${field.name}__'].value}" />
<a th:if="*{fields['__${field.name}__'].media != null and !#strings.isEmpty(fields['__${field.name}__'].media.url)}"
th:href="@{*{fields['__${field.name}__'].media.url}}" target="_blank">
<img class="thumbnail"
th:src="@{*{fields['__${field.name}__'].media.url + '?largeAdminThumbnail'}}" />
</a>
<a th:unless="*{fields['__${field.name}__'].media != null and !#strings.isEmpty(fields['__${field.name}__'].media.url)}">
<img class="thumbnail placeholder-image" th:src="@{/img/admin/placeholder-60x60.gif}" />
</a>
<button class="show-asset-selector tiny radius secondary button hover-cursor"
type="button" th:inline="text"
th:attr="data-select-url=@{${'/'+sectionKey+ '/' + entityForm.id + '/chooseAsset'}}">
<i class="icon-camera"></i> [[#{Select_Upload_Image}]]
</button>
<span class="error" th:errors="*{fields['__${field.name}__'].value}" />
</div>