-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Add image removal link to image partial
- Loading branch information
Showing
1 changed file
with
60 additions
and
34 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 |
---|---|---|
@@ -1,38 +1,64 @@ | ||
<html data-namespace-typo3-fluid="true" | ||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
<html | ||
data-namespace-typo3-fluid="true" | ||
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" | ||
> | ||
|
||
<div class="row mb-1"> | ||
<div class="col-12"> | ||
<h2>Profile Image</h2> | ||
</div> | ||
<div class="col-md-4"> | ||
<f:if condition="{profile.image}"> | ||
<f:form.hidden property="image" value="{profile.image}" /> | ||
<f:image image="{profile.image}" maxHeight="300" class="img-thumbnail" /> | ||
</f:if> | ||
|
||
<f:form.validationResults for="profile.image"> | ||
<f:if condition="{validationResults.flattenedErrors}"> | ||
<ul class="errors"> | ||
<f:for each="{validationResults.flattenedErrors}" as="errors" key="propertyPath"> | ||
<f:for each="{errors}" as="error"> | ||
<li>{error}</li> | ||
</f:for> | ||
</f:for> | ||
</ul> | ||
<div class="row mb-1"> | ||
<div class="col-12"> | ||
<h2>Profile Image</h2> | ||
</div> | ||
<div class="col-md-4"> | ||
<f:if condition="{profile.image}"> | ||
<f:then> | ||
<f:image | ||
image="{profile.image}" | ||
maxHeight="300" | ||
class="img-thumbnail" | ||
/> | ||
<f:link.action | ||
action="removeImage" | ||
arguments="{profile: profile}" | ||
class="btn btn-danger" | ||
> | ||
Remove image | ||
</f:link.action> | ||
</f:then> | ||
<f:else> | ||
<f:form.validationResults for="profile.image"> | ||
<f:if condition="{validationResults.flattenedErrors}"> | ||
<ul class="errors"> | ||
<f:for | ||
each="{validationResults.flattenedErrors}" | ||
as="errors" | ||
key="propertyPath" | ||
> | ||
<f:for | ||
each="{errors}" | ||
as="error" | ||
> | ||
<li>{error}</li> | ||
</f:for> | ||
</f:for> | ||
</ul> | ||
</f:if> | ||
</f:form.validationResults> | ||
<label | ||
for="profile-image" | ||
class="visually-hidden" | ||
> | ||
Update profile image | ||
</label> | ||
<f:form.upload | ||
property="image" | ||
class="form-control" | ||
id="profile-image" | ||
/> | ||
<f:if condition="{maxFileUploadsInBytes}"> | ||
<small> | ||
Max file upload size: <f:format.bytes value="{maxFileUploadsInBytes}" /> | ||
</small> | ||
</f:if> | ||
</f:else> | ||
</f:if> | ||
</f:form.validationResults> | ||
|
||
<label for="profile-image" class="visually-hidden">Update profile image</label> | ||
<f:form.upload property="image" class="form-control" id="profile-image" /> | ||
<f:if condition="{maxFileUploadsInBytes}"> | ||
<small> | ||
Max file upload size: <f:format.bytes value="{maxFileUploadsInBytes}" /> | ||
</small> | ||
</f:if> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
</html> |