Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement #1984 done (Email Attachments ) #1995

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/Webkul/Admin/src/Resources/assets/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
}

@layer components {
.icon-image:before {
content: "\e956";
}

.icon-bookmark:before {
content: "\e92c";
}
Expand Down
Binary file modified packages/Webkul/Admin/src/Resources/assets/fonts/icomoon.woff
Binary file not shown.
49 changes: 42 additions & 7 deletions packages/Webkul/Admin/src/Resources/views/mail/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,20 +252,43 @@ class="dark:text-gray-300"

{!! view_render_event('admin.mail.view.attach.before', ['email' => $email]) !!}

<div
<div
class="flex flex-wrap gap-2"
v-if="email.attachments.length"
>
<a
:href="'{{ route('admin.mail.attachment_download') }}/' + attachment.id"
class="flex cursor-pointer items-center gap-1 rounded-md p-1.5"
<div
class="group relative flex items-center gap-2 rounded-md border border-gray-300 bg-gray-100 px-2 py-1.5 dark:border-gray-800 dark:bg-gray-900"
target="_blank"
v-for="attachment in email.attachments"
>
<span class="icon-attached-file text-xl"></span>
<!-- Thumbnail or Icon -->
<div class="flex items-center gap-2">
<template v-if="isImage(attachment.path)">
<span class="icon-image text-2xl"></span>
</template>

<template v-else-if="isVideo(attachment.path)">
<span class="icon-video text-2xl"></span>
</template>

<template v-else-if="isDocument(attachment.path)">
<span class="icon-file text-2xl"></span>
</template>

<template v-else>
<span class="icon-attachment text-2xl"></span>
</template>
</div>

<span class="max-w-[400px] truncate dark:text-white">
@{{ attachment.name || attachment.path }}
</span>

<span class="font-medium text-brandColor">@{{ attachment.name }}</span>
</a>
<a
class="icon-download absolute right-0 rounded-md bg-gradient-to-r from-transparent via-gray-50 to-gray-100 p-2 pl-8 text-xl opacity-0 transition-all group-hover:opacity-100 dark:via-gray-900 dark:to-gray-900"
:href="'{{ route('admin.mail.attachment_download') }}/' + attachment.id"
></a>
</div>
</div>

{!! view_render_event('admin.mail.view.attach.after', ['email' => $email]) !!}
Expand Down Expand Up @@ -1259,6 +1282,18 @@ class="primary-button"
emits: ['on-discard', 'on-email-action'],

methods: {
isImage(path) {
return /\.(jpg|jpeg|png|gif|webp)$/i.test(path);
},

isVideo(path) {
return /\.(mp4|avi|mov|wmv|mkv)$/i.test(path);
},

isDocument(path) {
return /\.(pdf|docx?|xlsx?|pptx?)$/i.test(path);
},

emailAction(type) {
if (type != 'delete') {
this.$emit('on-email-action', {type, email: this.email});
Expand Down
75 changes: 75 additions & 0 deletions public/admin/build/assets/app-036f94ed.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/admin/build/assets/app-3cf45bb1.css

This file was deleted.

1 change: 1 addition & 0 deletions public/admin/build/assets/app-594d0459.css

Large diffs are not rendered by default.

68 changes: 0 additions & 68 deletions public/admin/build/assets/app-aa241a99.js

This file was deleted.

5 changes: 5 additions & 0 deletions public/admin/build/assets/ar.es-2968a13f.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions public/admin/build/assets/ar.es-79300351.js

This file was deleted.

5 changes: 5 additions & 0 deletions public/admin/build/assets/bg.es-182cdcb3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions public/admin/build/assets/bg.es-f41722c8.js

This file was deleted.

5 changes: 0 additions & 5 deletions public/admin/build/assets/bn.es-33e1adf7.js

This file was deleted.

5 changes: 5 additions & 0 deletions public/admin/build/assets/bn.es-3f8773a4.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions public/admin/build/assets/bs.es-47a220af.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions public/admin/build/assets/bs.es-5b20eacb.js

This file was deleted.

5 changes: 5 additions & 0 deletions public/admin/build/assets/ca.es-47a49a5a.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions public/admin/build/assets/ca.es-e714c4ae.js

This file was deleted.

5 changes: 5 additions & 0 deletions public/admin/build/assets/cs.es-29e50c14.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions public/admin/build/assets/cs.es-77591dcf.js

This file was deleted.

5 changes: 0 additions & 5 deletions public/admin/build/assets/da.es-4c1ec762.js

This file was deleted.

5 changes: 5 additions & 0 deletions public/admin/build/assets/da.es-eecb0b06.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions public/admin/build/assets/de.es-83841cfd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions public/admin/build/assets/de.es-8b0b2f4d.js

This file was deleted.

Loading
Loading