Skip to content

Commit

Permalink
[TASK] Add image removal link to image partial
Browse files Browse the repository at this point in the history
  • Loading branch information
dot3media committed Apr 17, 2024
1 parent 46f3c1f commit 7b7fb1d
Showing 1 changed file with 60 additions and 34 deletions.
94 changes: 60 additions & 34 deletions Resources/Private/Partials/ProfileEdit/ProfileImage.html
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>

0 comments on commit 7b7fb1d

Please sign in to comment.