Skip to content

Commit

Permalink
EZP-28576: Design improvements for Sub-items sorting order panel
Browse files Browse the repository at this point in the history
  • Loading branch information
mikadamczyk committed Dec 18, 2017
1 parent a7f9c83 commit 1580364
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
7 changes: 7 additions & 0 deletions src/bundle/Resources/public/scss/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@
border-color: $ez-color-secondary;
}
}

.ez-form-inline {
.control-label,
.form-control {
margin-right: .5rem;
}
}
10 changes: 10 additions & 0 deletions src/bundle/Resources/translations/content_type.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,16 @@
<target state="new">%identifier%</target>
<note>key: content_type_group.view.view.title</note>
</trans-unit>
<trans-unit id="2a6703809d34ce1103cc6e1342e07a8a81848c01" resname="location_update_form.in">
<source>in</source>
<target state="new">in</target>
<note>key: location_update_form.in</note>
</trans-unit>
<trans-unit id="53acad0127e4919fc2769ff04c46e1e66b7c601a" resname="location_update_form.order_by">
<source>Order by</source>
<target state="new">Order by</target>
<note>key: location_update_form.order_by</note>
</trans-unit>
<trans-unit id="7fe072f41348fb097b6bb018eec4f1b1bc9cffc3" resname="modal.cancel">
<source>Cancel</source>
<target state="new">Cancel</target>
Expand Down
15 changes: 5 additions & 10 deletions src/bundle/Resources/translations/locationview.en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,16 @@
<target state="new">Name</target>
<note>key: tab.details.state_name</note>
</trans-unit>
<trans-unit id="e1b7d3c1364b48bbad819511efa9a50c508e5372" resname="tab.details.sub_items_default_ordering">
<source>Sub-items default ordering</source>
<target state="new">Sub-items default ordering</target>
<note>key: tab.details.sub_items_default_ordering</note>
</trans-unit>
<trans-unit id="a8bf01d5deb416a97cd7d2a7f5f21084a0f86889" resname="tab.details.sub_items_listing_by">
<source>Default listing of sub-items by</source>
<target state="new">Default listing of sub-items by</target>
<note>key: tab.details.sub_items_listing_by</note>
</trans-unit>
<trans-unit id="fe4321b1de5be805ed8224c8cf442a89e9fa38b4" resname="tab.details.sub_items_listing_by_set">
<source>Set</source>
<target state="new">Set</target>
<note>key: tab.details.sub_items_listing_by_set</note>
</trans-unit>
<trans-unit id="03aa9832291905ed83ba60081ebffe5786d92418" resname="tab.details.sub_items_sorting_order">
<source>Sub-items sorting order</source>
<target state="new">Sub-items sorting order</target>
<note>key: tab.details.sub_items_sorting_order</note>
</trans-unit>
<trans-unit id="09fcd5ad39b9c2b778be171f88559f6c117ff48b" resname="tab.details.technical_details">
<source>Technical details</source>
<target state="new">Technical details</target>
Expand Down
9 changes: 3 additions & 6 deletions src/bundle/Resources/views/content/tab/details.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,23 @@
</table>

{% include '@EzPlatformAdminUi/parts/table_header.html.twig' with {
headerText: 'tab.details.sub_items_default_ordering'|trans|desc('Sub-items default ordering'),
headerText: 'tab.details.sub_items_sorting_order'|trans|desc('Sub-items sorting order'),
ground: 'ground-base'
} %}

<table class="table">
<tbody>
<tr>
<td data-sort-field="{{ sort_field_clause_map[location.sortField] }}" data-sort-order="{{ location.sortOrder ? "ascending" : "descending" }}">
{{ 'tab.details.sub_items_listing_by'|trans|desc('Default listing of sub-items by') }}
</td>
<td>
{{ form_start(form_location_update, {
'method': 'POST',
'action': path('ezplatform.location.update'),
'attr': {'class': 'form-inline'}
'attr': {'class': 'form-inline ez-form-inline'}
}) }}

{{ form_widget(form_location_update) }}

<button type="submit" class="btn btn-primary ml-1">
<button type="submit" class="btn btn-secondary ml-1">
{{ 'tab.details.sub_items_listing_by_set'|trans|desc('Set') }}
</button>

Expand Down
6 changes: 3 additions & 3 deletions src/lib/Form/Type/Location/LocationUpdateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public function buildForm(FormBuilderInterface $builder, array $options)
->add(
'sortField',
SortFieldChoiceType::class,
['label' => false]
['label' => /** @Desc("Order by") */ 'location_update_form.order_by']
)
->add(
'sortOrder',
SortOrderChoiceType::class,
['label' => false]
['label' => /** @Desc("in") */ 'location_update_form.in']
)
;
}
Expand All @@ -43,7 +43,7 @@ public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => LocationUpdateData::class,
'translation_domain' => 'forms',
'translation_domain' => 'content_type',
]);
}
}

0 comments on commit 1580364

Please sign in to comment.