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

feat(PD-2005): digital items endpoint #480

Open
wants to merge 5 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
40 changes: 1 addition & 39 deletions src/views/pages/customer/orders/single.twig
Original file line number Diff line number Diff line change
Expand Up @@ -341,50 +341,12 @@
</div>
{% endif %}

{% if item.files %}
<h2 class="mb-3.5 text-sm font-bold">{{ trans('pages.orders.files') }}</h2>
<div class="flow-root rounded-md px-4 border border-gray-200">
<dl class="text-sm text-dark divide-y divide-border-color">
{% for file in item.files %}
{% set is_protected = "/download" in file.url ? false : true %}
<div class="order-file py-2.5 center-between">
<dt class="mb-2 md:mb-0">
{{ file.name }}
</dt>
<dd class="font-medium text-xs">
<salla-button href="{{ file.url }}" target="_blank"
class="btn--rounded-full font-bold text-gray-600 hover:text-black">
<i class="sicon-{{is_protected ? 'eye' : 'download'}}"></i> {{ is_protected ? trans('common.uploader.browse') : trans('pages.thank_you.download') }}
</salla-button>
</dd>
</div>
{% endfor %}
</dl>
</div>
{% elseif item.codes %}
<h2 class="mb-3.5 text-sm font-bold">{{ trans('pages.orders.codes') }}</h2>
<div class="flow-root rounded-md px-4 border border-gray-200">
<dl class="text-sm text-dark divide-y divide-border-color">
{% for code in item.codes %}
<div class="py-2.5 center-between">
<dt class="flex-center">
<i class="sicon-debit-card-back text-xl rtl:ml-2 ltr:mr-2 text-gray-500 inline-block -mt-1"></i>
<span class="break-all font-bold">{{ code.code }}</span>
</dt>
<salla-button class="btn--rounded-full" onclick="app.copyToClipboard(event)" data-content="{{ code.code }}">
<i class="copy-icon sicon-swap-stroke pointer-events-none"></i>
<span class="text-sm rtl:mr-2 ltr:ml-2 pointer-events-non">{{ trans('common.elements.copy') }}</span>
</salla-button>
</div>
{% endfor %}
</dl>
</div>
{% endif %}
{% if item.note %}
<p class="mt-3 text-sm text-gray-500">
<span>{{ trans('common.elements.note') }} : </span>{{ item.note }}
</p>
{% endif %}

{% if item.attachments %}
<div class="flow-root rounded-md px-4 border border-gray-200">
<dl class="text-sm text-dark divide-y divide-border-color">
Expand Down
44 changes: 0 additions & 44 deletions src/views/pages/thank-you.twig
Original file line number Diff line number Diff line change
Expand Up @@ -61,50 +61,6 @@

{% hook 'thank-you:items.start' %}

{% for item in order.items %}
{% if item.codes|length %}
<div class="bg-gray-50 p-5 rounded-md text-start mb-2.5 last:mb-0">
<h2 class="font-bold mb-5 unicode">
{{ trans('pages.thank_you.codes') }} ({{ item.name }})
</h2>
{% for code in item.codes %}
<div class="md:flex justify-between items-center mb-2 pb-2 border-b border-b-gray-200 last:pb-0 last:border-0 last:mb-0">
<p class="text-base flex items-center leading-none">
<i class="sicon-debit-card-back text-xl rtl:ml-2 ltr:mr-2 text-gray-500 inline-block -mt-1"></i>
<span>{{ code.code }}</span>
</p>
<salla-button onclick="app.copyToClipboard(event)" shape="link" data-content="{{ code.code }}">
<i class="copy-icon sicon-swap-stroke pointer-events-none"></i>
<span class="text-sm rtl:mr-2 ltr:ml-2 pointer-events-none">{{ trans('common.elements.copy') }}</span>
</salla-button>
</div>
{% endfor %}
</div>
{% endif %}

{% if item.files|length %}
<div class="bg-gray-50 p-5 rounded-md text-start">
<h2 class="font-bold mb-5 unicode">
{{ trans('pages.thank_you.files') }} ({{ item.name }})
</h2>
<div class="divide-y divide-gray-100">
{% for file in item.files %}
<div class="flex justify-between py-4 last:pb-0">
<div class="text-sm">
<i class="sicon-file-archive"></i>
<span class="fix-align mx-3">{{ file.name }}</span>
</div>
<a href="{{ file.url }}" target="_blank" class="text-primary text-sm font-bold">
<i class="sicon-download text-lg"></i>
<span class="fix-align">{{ trans('pages.thank_you.download') }}</span>
</a>
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}

{% hook 'thank-you:items.end' %}
</div>

Expand Down
Loading