mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
[Admin] Some build and UI fixes
This commit is contained in:
parent
435a6052be
commit
78cfc2c544
5 changed files with 10 additions and 9 deletions
|
|
@ -14,6 +14,7 @@ Feature: Adding a new taxon for parent
|
|||
Given I want to create a new taxon for "Category"
|
||||
And I specify its code as "guns"
|
||||
And I name it "Guns" in "English (United States)"
|
||||
And I set its slug to "guns"
|
||||
And I add it
|
||||
Then I should be notified that it has been successfully created
|
||||
And the "Guns" taxon should appear in the registry
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Feature: Editing a taxon
|
|||
Given I want to modify the "T-Shirts" taxon
|
||||
When I rename it to "Stickers" in "English (United States)"
|
||||
And I change its description to "Main taxonomy for stickers" in "English (United States)"
|
||||
And I change its slug to "stickers" in "English (United States)"
|
||||
And I set its slug to "stickers"
|
||||
And I change its parent taxon to "Accessories"
|
||||
And I save my changes
|
||||
Then I should be notified that it has been successfully edited
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ $(document).ready(function() {
|
|||
});
|
||||
|
||||
function updateSlug($element) {
|
||||
$form = $element.parents('form');
|
||||
$slugInput = $element.parents('.content').find('[name*="[slug]"]');
|
||||
$loadableParent = $slugInput.parents('.field.loadable');
|
||||
|
||||
if ('readonly' == $slugInput.attr('readonly')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$form.addClass('loading');
|
||||
$loadableParent.addClass('loading');
|
||||
|
||||
if ('' != $slugInput.attr('data-parent') && undefined != $slugInput.attr('data-parent')) {
|
||||
$data = { name: $element.val(), parentId: $slugInput.attr('data-parent') };
|
||||
|
|
@ -46,7 +46,7 @@ function updateSlug($element) {
|
|||
$slugInput.parents('.field').removeClass('error');
|
||||
$slugInput.parents('.field').find('.sylius-validation-error').remove();
|
||||
}
|
||||
$form.removeClass('loading');
|
||||
$loadableParent.removeClass('loading');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -54,9 +54,9 @@ function updateSlug($element) {
|
|||
function toggleSlugModification($button, $slugInput) {
|
||||
if ($slugInput.attr('readonly')) {
|
||||
$slugInput.removeAttr('readonly');
|
||||
$button.html('<i class="lock icon"></i>');
|
||||
$button.html('<i class="unlock icon"></i>');
|
||||
} else {
|
||||
$slugInput.attr('readonly', 'readonly');
|
||||
$button.html('<i class="unlock icon"></i>');
|
||||
$button.html('<i class="lock icon"></i>');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<div class="ui action input">
|
||||
{{ form_widget(slugField, {'attr': {'readonly': 'readonly', 'data-url': path('sylius_admin_api_generate_product_slug')}}) }}
|
||||
<span id="toggle-slug-modification" class="ui icon button">
|
||||
<i class="lock icon"></i>
|
||||
<i class="unlock icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<div class="{% if slugField.vars.required %}required {% endif %}field{% if slugField.vars.errors|length > 0 %} error{% endif %}">
|
||||
<div class="{% if slugField.vars.required %}required {% endif %}field{% if slugField.vars.errors|length > 0 %} error{% endif %} ui loadable form">
|
||||
{{ form_label(slugField) }}
|
||||
{% if taxon.slug == null %}
|
||||
{{ form_widget(slugField, {'attr': {'data-url': path('sylius_admin_api_generate_taxon_slug'), 'data-parent': app.request.attributes.get('id')}}) }}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
<div class="ui action input">
|
||||
{{ form_widget(slugField, {'attr': {'readonly': 'readonly', 'data-url': path('sylius_admin_api_generate_taxon_slug')}}) }}
|
||||
<span id="toggle-taxon-slug-modification" class="ui icon button">
|
||||
<i class="unlock icon"></i>
|
||||
<i class="lock icon"></i>
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue