-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
154 additions
and
89 deletions.
There are no files selected for viewing
29 changes: 21 additions & 8 deletions
29
src/Sylius/Bundle/AdminBundle/Resources/assets/scripts/bootstrap.js
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,12 +1,25 @@ | ||
/* eslint-env browser */ | ||
import * as bootstrap from 'bootstrap'; | ||
|
||
(function () { | ||
const dropdowns = document.querySelectorAll('.dropdown-toggle.dropdown-static'); | ||
const dropdown = [...dropdowns].map((dropdownToggleEl) => new bootstrap.Dropdown(dropdownToggleEl, { | ||
popperConfig(defaultBsPopperConfig) { | ||
return { ...defaultBsPopperConfig, strategy: 'fixed' }; | ||
}, | ||
})); | ||
}()); | ||
// Fix dropdowns | ||
(() => { | ||
document.querySelectorAll('.dropdown-static').forEach((dropdownToggleEl) => { | ||
const parent = dropdownToggleEl.closest('[data-bs-toggle="dropdown"]'); | ||
if (parent) { | ||
let dropdown = new bootstrap.Dropdown(parent, { | ||
popperConfig(defaultBsPopperConfig) { | ||
return { ...defaultBsPopperConfig, strategy: 'fixed' }; | ||
}, | ||
}); | ||
} | ||
}); | ||
})(); | ||
|
||
// Initialize tooltips | ||
(() => { | ||
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach((tooltipTriggerEl) => { | ||
let tooltip = new bootstrap.Tooltip(tooltipTriggerEl); | ||
}); | ||
})(); | ||
|
||
window.bootstrap = bootstrap; |
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
4 changes: 2 additions & 2 deletions
4
...lius/Bundle/AdminBundle/templates/order/show/content/header/title_block/actions.html.twig
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
4 changes: 2 additions & 2 deletions
4
src/Sylius/Bundle/AdminBundle/templates/product_attribute/grid/action/create.html.twig
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
25 changes: 25 additions & 0 deletions
25
src/Sylius/Bundle/AdminBundle/templates/shared/grid/action/list.html.twig
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,25 @@ | ||
{% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %} | ||
|
||
{% set visible = options.visible is defined ? options.visible : true %} | ||
|
||
{% if visible %} | ||
<div> | ||
{% if action.label %} | ||
<span class="dropdown-header">{{ action.label|trans }}</span> | ||
{% endif %} | ||
|
||
{% for link in options.links %} | ||
{% set is_link_visible = link.visible is defined ? link.visible : true %} | ||
|
||
{% if is_link_visible %} | ||
{% set path = link.url is defined ? link.url : path(link.route, link.parameters|default([])) %} | ||
<a class="dropdown-item" href="{{ path }}"> | ||
{% if link.icon is defined %} | ||
{{ icon({ icon: link.icon, class: 'icon icon-tabler dropdown-item-icon' }) }} | ||
{% endif %} | ||
{{ link.label|trans }} | ||
</a> | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
{% endif %} |
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
17 changes: 10 additions & 7 deletions
17
src/Sylius/Bundle/AdminBundle/templates/shared/grid/item_action/archive.html.twig
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,17 +1,20 @@ | ||
{% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %} | ||
|
||
{% set path = options.link.url|default(path(options.link.route|default(grid.requestConfiguration.getRouteName('archive')), options.link.parameters|default({'id': data.id}))) %} | ||
{% set message = action.label|default('sylius.ui.delete') %} | ||
|
||
<form action="{{ path }}" method="POST" name="sylius_archivable"> | ||
<input type="hidden" name="_method" value="PATCH"> | ||
<input type="hidden" name="sylius_archivable[_token]" value="{{ csrf_token('sylius_archivable') }}" /> | ||
|
||
<button class="dropdown-item" type="submit" data-confirm-btn-submit> | ||
{{ icon({ icon: action.icon ?? 'archive', class: 'icon icon-tabler dropdown-item-icon' }) }} | ||
{% if data.archivedAt is not null %} | ||
{% if data.archivedAt is not null %} | ||
<button class="btn" type="submit" data-confirm-btn-submit> | ||
{{ icon({ icon: action.icon ?? 'archive', class: 'icon icon-tabler dropdown-item-icon' }) }} | ||
{{ action.options.restore_label|default('sylius.ui.restore')|trans }} | ||
{% else %} | ||
{{ action.label|default('sylius.ui.archive')|trans }} | ||
{% endif %} | ||
</button> | ||
</button> | ||
{% else %} | ||
<button class="btn btn-icon" type="submit" data-confirm-btn-submit data-bs-toggle="tooltip" data-bs-title="{{ action.label|default('sylius.ui.archive')|trans }}"> | ||
{{ icon({ icon: action.icon ?? 'archive', class: 'icon icon-tabler dropdown-item-icon' }) }} | ||
</button> | ||
{% endif %} | ||
</form> |
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
10 changes: 3 additions & 7 deletions
10
src/Sylius/Bundle/AdminBundle/templates/shared/grid/item_action/delete.html.twig
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,16 +1,12 @@ | ||
{% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %} | ||
|
||
{% set path = options.link.url|default(path(options.link.route|default(grid.requestConfiguration.getRouteName('delete')), options.link.parameters|default({'id': data.id}))) %} | ||
{% set message = action.label %} | ||
|
||
{% if message is empty %} | ||
{% set message = 'sylius.ui.delete' %} | ||
{% endif %} | ||
{% set message = action.label|default('sylius.ui.delete') %} | ||
|
||
<form action="{{ path }}" method="post"> | ||
<input type="hidden" name="_method" value="DELETE"> | ||
<button class="dropdown-item" type="submit" data-confirm-btn-submit {{ sylius_test_html_attribute('delete-button') }}> | ||
{{ icon({ icon: action.icon ?? 'trash-x', class: 'icon icon-tabler dropdown-item-icon' }) }} {{ message|trans }} | ||
<button class="btn btn-icon" type="submit" data-confirm-btn-submit {{ sylius_test_html_attribute('delete-button') }} data-bs-toggle="tooltip" data-bs-title="{{ message|trans }}"> | ||
{{ icon({ icon: action.icon ?? 'trash-x', class: 'icon icon-tabler text-danger' }) }} | ||
</button> | ||
<input type="hidden" name="_csrf_token" value="{{ csrf_token(data.id) }}" /> | ||
</form> |
11 changes: 3 additions & 8 deletions
11
src/Sylius/Bundle/AdminBundle/templates/shared/grid/item_action/show.html.twig
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,13 +1,8 @@ | ||
{% from '@SyliusAdmin/shared/helper/icon.html.twig' import icon %} | ||
|
||
{% set path = options.link.url|default(path(options.link.route|default(grid.requestConfiguration.getRouteName('show')), options.link.parameters|default({'id': data.id}))) %} | ||
{% set message = action.label|default('sylius.ui.show') %} | ||
|
||
{% set message = action.label %} | ||
{% if message is empty %} | ||
{% set message = 'sylius.ui.show' %} | ||
{% endif %} | ||
|
||
<a href="{{ path }}" class="dropdown-item"> | ||
{{ icon({ icon: action.icon ?? 'eye', class: 'icon icon-tabler dropdown-item-icon' }) }} | ||
{{ message|trans }} | ||
<a href="{{ path }}" class="btn btn-icon" data-bs-toggle="tooltip" data-bs-title="{{ message|trans }}"> | ||
{{ icon({ icon: action.icon|default('eye'), class: 'icon icon-tabler' }) }} | ||
</a> |
Oops, something went wrong.