Skip to content
Snippets Groups Projects
Commit 018144b8 authored by Nicolas Martinelli's avatar Nicolas Martinelli Committed by Yannick Tivisse
Browse files

[IMP] lunch: new lunch widget

The JS widget is simplified, which a cleaner approach.
For the rendering part:
  - the server reads the data
  - the JS widget formats/organizes the data
  - the template renders the data prepared by the widget

Quick summary of the modifications:
1. The associated field is a text field which contains JSON-encoded
data. The data are read server-side, and not client-side anymore.

2. The widget is an AbstractField, no need of ReinitializeWidgetMixin
anymore. No use of the FieldMonetary widget directly, but use a similar
format_value instead (inspired by ShowPaymentLineWidget).

3. Data formatting (call to format_value) is done in the widget, not in
the template anymore. This seems to be the standard way of doing, since
lunch was the only module where format_value was in the template and not
in the widget.

4. The addition of an order line is cleaner since all necessary data
are prepared server-side.
parent 7cf554af
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment