Assign articles to shop section by selecting items in purchase list
After #292 it would be helpful to assign articles to a shop section by simply selecting items.
-
add list of shop sections as JSON in <script>
tag -
add article IDs as data-article-id
attributes to<td>
with article name -
add button purchase list editor Assign articles to shop section - create modal
-
select box for shop sections -
bonus: combo box for entering name of new shop section to create
-
-
2nd modal to display warnings (see below) - Ajax action
assign_articles_to_shop_sections
-
send application/x-www-form-urlencoded request -
shop_section=42
xornew_shop_section=Großeinkauf
- when removing items from shop section to no shop section ->
shop_section=null
-
article=1
,article=2
, …
-
-
create Ajax endpoint -
implement business logic - keyword purchase list and ID are required to send appropriate HTML snippet in response
- for similar function on articles page→create new endpoint under
/articles
that calls same model/result methods
- for similar function on articles page→create new endpoint under
- respond with HTML snippet with refreshed purchase list table including JSON data of shop sections (in case a new one was created)
- URL:
.../purchase_list/ID/assign_articles_to_shop_section
- Response: HTML snippet without wrapper
-
-
Warnings:
-
only 1 item of 2+ items selected for article (e.g. only one of 1 kg apples, 10 pieces apples selected)
Edited by Kurt Roscher