-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customize elements for upload: multi upload page and drop upload sect…
…ion (#1220) * chore fix: avoid js error * feat: custom multiupload and dropupload * tests: unit tests + doc * chore refactor: formatDate in BEDITA object
- Loading branch information
Showing
12 changed files
with
159 additions
and
52 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
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
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,7 @@ | ||
{# :accepted-drop="[`.from-relation-${relationName}`,isRelationWithMedia && 'from-files']"> #} | ||
<drop-upload | ||
placeholder="{{ __('Click or drop new files here') }}" | ||
@new-relations="appendRelations" | ||
v-if="isRelationWithMedia" | ||
> | ||
</drop-upload> |
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,42 @@ | ||
{% do _view.assign('title', __('Multi upload')) %} | ||
{% if Perms.canSave() and not readonly %} | ||
<modules-index inline-template ids='{{ []|json_encode }}'> | ||
<div class="module-index"> | ||
<drop-upload | ||
object-type="{{ objectType }}" | ||
double="1" | ||
placeholder="{{ __('Click or drop new files here') }}" | ||
@new-relations="appendUploaded" | ||
> | ||
</drop-upload> | ||
<div v-for="item in uploaded" :key="item.id"> | ||
<a :href="`/view/${item.id}`"> | ||
<div style="display: grid; grid-template-columns: 50px 1fr; border-bottom: dashed gray 1px;"> | ||
<figure class="center-icon icon-opaque" v-if="item?.meta?.thumb_url"> | ||
<img :src="item?.meta?.thumb_url" :alt="item.attributes.title" style="height: 50px; width: 50px; object-fit: cover;"/> | ||
</figure> | ||
<span style="padding: 0.5rem" v-else> | ||
<app-icon icon="carbon:document"></app-icon> | ||
<: extension(item?.meta?.media_url) :> | ||
</span> | ||
<span style="padding: 1rem"> | ||
<: item.attributes.title :> | ||
</span> | ||
</div> | ||
</a> | ||
</div> | ||
</div> | ||
</modules-index> | ||
{% else %} | ||
<div class="alert alert-danger">{{ __('You do not have the required permissions to view this page.') }}</div> | ||
{% endif %} | ||
|
||
{# Add links to the module #} | ||
{% do _view.append('app-module-links', | ||
Html.link( | ||
__('List'), | ||
{'_name': 'modules:list', 'object_type': objectType}, | ||
{'title': __('List'), 'class': 'icon-left-dir button button-outlined button-outlined-hover-module-' ~ objectType} | ||
)|raw | ||
) %} | ||
|
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 |
---|---|---|
@@ -1,42 +1 @@ | ||
{% do _view.assign('title', __('Multi upload')) %} | ||
|
||
{% if Perms.canSave() and not readonly %} | ||
|
||
<modules-index inline-template ids='{{ []|json_encode }}'> | ||
<div class="module-index"> | ||
|
||
<drop-upload object-type="{{ objectType }}" double=1 placeholder="{{ __('Click or drop new files here') }}" @new-relations="appendUploaded"></drop-upload> | ||
|
||
<div v-for="item in uploaded" :key="item.id"> | ||
<a :href="`/view/${item.id}`"> | ||
<div style="display: grid; grid-template-columns: 50px 1fr; border-bottom: dashed gray 1px;"> | ||
<figure class="center-icon icon-opaque" v-if="item?.meta?.thumb_url"> | ||
<img | ||
:src="item?.meta?.thumb_url" | ||
:alt="item.attributes.title" | ||
style="height: 50px; width: 50px; object-fit: cover;" /> | ||
</figure> | ||
<span style="padding: 0.5rem" v-else> | ||
<app-icon icon="carbon:document"></app-icon> | ||
<: extension(item?.meta?.media_url) :> | ||
</span> | ||
<span style="padding: 1rem"><: item.attributes.title :></span> | ||
</div> | ||
</a> | ||
</div> | ||
|
||
</div> | ||
</modules-index> | ||
|
||
{% else %} | ||
<div class="alert alert-danger">{{ __('You do not have the required permissions to view this page.') }}</div> | ||
{% endif %} | ||
|
||
{# Add links to the module #} | ||
{% do _view.append('app-module-links', | ||
Html.link( | ||
__('List'), | ||
{'_name': 'modules:list', 'object_type': objectType}, | ||
{'title': __('List'), 'class': 'icon-left-dir button button-outlined button-outlined-hover-module-' ~ objectType} | ||
)|raw | ||
) %} | ||
{{ element(Element.multiupload()) }} |
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