Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c93e73a

Browse files
committedSep 30, 2017
/series/info: update form.
1 parent 76753e8 commit c93e73a

File tree

1 file changed

+22
-1
lines changed
  • src/main/webapp/WEB-INF/views/series

1 file changed

+22
-1
lines changed
 

‎src/main/webapp/WEB-INF/views/series/info.html

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,33 @@
9595
</span>
9696
</label>
9797
<div class="col-sm-9">
98-
<input type="file" id="image" style="box-shadow: none; border: 0px;" required="required" accept="image/png,image/jpeg" th:field="*{image}" />
98+
<input id="image"
99+
type="file"
100+
style="box-shadow: none; border: 0px;"
101+
accept="image/png,image/jpeg"
102+
th:field="*{image}"
103+
th:attr="required=${#authorization.expression('hasAuthority(''DOWNLOAD_IMAGE'')') ? null : 'required'}" />
99104
<!--/*/
100105
<span id="image.errors" class="help-block" th:if="${#fields.hasErrors('image')}" th:each="error : ${#fields.errors('image')}" th:text="${error}"></span>
101106
/*/-->
102107
</div>
103108
</div>
109+
<div class="form-group form-group-sm"
110+
th:classappend="${#fields.hasErrors('imageUrl') or #fields.hasErrors('downloadedImage') ? 'has-error' : ''}"
111+
sec:authorize="hasAuthority('DOWNLOAD_IMAGE')">
112+
<label for="image-url" class="control-label col-sm-3">
113+
<span class="field-label" th:text="#{t_image_url}">
114+
Image URL
115+
</span>
116+
</label>
117+
<div class="col-sm-9">
118+
<input type="url" id="image-url" class="form-control" th:field="*{imageUrl}" />
119+
<!--/*/
120+
<span id="image-url.errors" class="help-block" th:if="${#fields.hasErrors('imageUrl')}" th:each="error : ${#fields.errors('imageUrl')}" th:text="${error}"></span>
121+
<span id="image-url.errors" class="help-block" th:if="${#fields.hasErrors('downloadedImage')}" th:each="error : ${#fields.errors('downloadedImage')}" th:text="${error}"></span>
122+
/*/-->
123+
</div>
124+
</div>
104125
<div class="form-group from-group-sm">
105126
<div class="col-sm-offset-3 col-sm-5">
106127
<input type="submit" class="btn btn-primary" value="Add image" th:value="#{t_add_image}" />

0 commit comments

Comments
 (0)
Please sign in to comment.