indicator if applied discount profile
This commit is contained in:
@@ -234,6 +234,11 @@ discount-below-regular = The sale price must be below the regular price.
|
||||
discount-percent-range = The percentage must be between 0 and 100.
|
||||
discount-apply-confirm = Apply these discounts to the shop?
|
||||
discount-remove-confirm = Remove this discount?
|
||||
profile-applied = Applied
|
||||
profile-will-apply = Will apply
|
||||
profile-will-remove = Will remove
|
||||
profiles-unsaved = Unsaved changes — Save to apply
|
||||
profiles-no-changes = No changes
|
||||
admin-customers = Business accounts
|
||||
admin-customers-desc = Manage negotiated prices for business (B2B) accounts.
|
||||
admin-no-customers = No business accounts yet.
|
||||
|
||||
@@ -234,6 +234,11 @@ discount-below-regular = Zľavnená cena musí byť nižšia ako bežná cena.
|
||||
discount-percent-range = Percento musí byť medzi 0 a 100.
|
||||
discount-apply-confirm = Uplatniť tieto zľavy v obchode?
|
||||
discount-remove-confirm = Zrušiť túto zľavu?
|
||||
profile-applied = Uplatnené
|
||||
profile-will-apply = Bude uplatnené
|
||||
profile-will-remove = Bude zrušené
|
||||
profiles-unsaved = Neuložené zmeny — uložte na uplatnenie
|
||||
profiles-no-changes = Žiadne zmeny
|
||||
admin-customers = Firemné účty
|
||||
admin-customers-desc = Spravujte dohodnuté ceny pre firemné (B2B) účty.
|
||||
admin-no-customers = Zatiaľ žiadne firemné účty.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -40,17 +40,29 @@
|
||||
</p>
|
||||
{% if profiles | length > 0 %}
|
||||
<form method="post" action="/admin/catalog/products/profiles?audience={{ audience }}" class="mt-3 space-y-3"
|
||||
x-data="{
|
||||
orig: { {% for p in profiles %}'{{ p.id }}': {% if p.assigned %}true{% else %}false{% endif %}{% if not loop.last %}, {% endif %}{% endfor %} },
|
||||
sel: { {% for p in profiles %}'{{ p.id }}': {% if p.assigned %}true{% else %}false{% endif %}{% if not loop.last %}, {% endif %}{% endfor %} },
|
||||
get changed() { return Object.keys(this.orig).some(k => this.orig[k] !== this.sel[k]) }
|
||||
}"
|
||||
onsubmit="return confirm('{{ t(key="discount-apply-confirm", lang=lang | default(value='sk')) }}')">
|
||||
{{ ui::csrf_field() }}
|
||||
<div class="grid gap-2 sm:grid-cols-2">
|
||||
{% for profile in profiles %}
|
||||
<label class="flex items-center gap-2 text-sm text-on-surface dark:text-on-surface-dark">
|
||||
<input type="checkbox" name="profile_ids" value="{{ profile.id }}" {% if profile.assigned %}checked{% endif %}>
|
||||
<input type="checkbox" name="profile_ids" value="{{ profile.id }}" x-model="sel['{{ profile.id }}']" {% if profile.assigned %}checked{% endif %}>
|
||||
<span>{{ profile.name }} <span class="text-on-surface/60 dark:text-on-surface-dark/60">(−{{ profile.percent }}%, {% if profile.scope_type == "all_except" %}{{ t(key="scope-all-except", lang=lang | default(value='sk')) }}{% else %}{{ t(key="scope-include", lang=lang | default(value='sk')) }}{% endif %})</span></span>
|
||||
<span x-cloak x-show="sel['{{ profile.id }}'] && orig['{{ profile.id }}']" class="inline-flex items-center rounded-radius border border-success px-1.5 py-0.5 text-xs font-medium text-success">{{ t(key="profile-applied", lang=lang | default(value='sk')) }}</span>
|
||||
<span x-cloak x-show="sel['{{ profile.id }}'] && !orig['{{ profile.id }}']" class="inline-flex items-center rounded-radius border border-primary px-1.5 py-0.5 text-xs font-medium text-primary dark:border-primary-dark dark:text-primary-dark">{{ t(key="profile-will-apply", lang=lang | default(value='sk')) }}</span>
|
||||
<span x-cloak x-show="!sel['{{ profile.id }}'] && orig['{{ profile.id }}']" class="inline-flex items-center rounded-radius border border-warning px-1.5 py-0.5 text-xs font-medium text-warning">{{ t(key="profile-will-remove", lang=lang | default(value='sk')) }}</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{{ ui::button(label=t(key="save", lang=lang | default(value='sk')), type="submit", size="px-4 py-2 text-sm") }}
|
||||
<div class="flex items-center gap-3">
|
||||
{{ ui::button(label=t(key="save", lang=lang | default(value='sk')), type="submit", size="px-4 py-2 text-sm", attrs='x-bind:disabled="!changed"') }}
|
||||
<span x-cloak x-show="changed" class="text-xs font-medium text-warning">{{ t(key="profiles-unsaved", lang=lang | default(value='sk')) }}</span>
|
||||
<span x-cloak x-show="!changed" class="text-xs text-on-surface/50 dark:text-on-surface-dark/50">{{ t(key="profiles-no-changes", lang=lang | default(value='sk')) }}</span>
|
||||
</div>
|
||||
</form>
|
||||
{% else %}
|
||||
<p class="mt-2 text-sm text-on-surface/70 dark:text-on-surface-dark/70">
|
||||
|
||||
Reference in New Issue
Block a user