web mailing list archives

web@odoo-community.org

Avatar

Re: [OCA/web] [11.0][ADD] web_view_calendar_list (#1512)

by Simone Orsi <notifications@github.com> - 10/07/2020 07:57:41

@simahawk requested changes on this pull request.

@etobella nice addition, thanks!
A bunch of comments on my side 😜


In web_view_calendar_list/static/src/js/calendar_list_renderer.js:

> +                    if (self.state.context.default_name) {

+                        data.title = self.state.context.default_name;

+                    }

+                    self.trigger_up('openCreate', data);

+                    self.$calendar.fullCalendar('unselect');

+                },

+                eventRender: function (event, element) {

+                    var $render = $(self._eventRender(event));

+                    event.title = $render.find('.o_field_type_char:first').text();

+                    element.find('.fc-list-item-title').html($render.html());

+                    element.addClass($render.attr('class'));

+                    var display_hour = '';

+                    if (!event.allDay) {

+                        var start = event.r_start || event.start;

+                        var end = event.r_end || event.end;

+                        var timeFormat = _t.database.parameters.time_format.search("%H") != -1 ? 'HH:mm': 'h:mma';

can't you use format utils?


In web_view_calendar_list/static/src/js/calendar_list_renderer.js:

> +                    // compute title: in week mode, display the week number

+                    var title = mode === 'week' ? view.intervalStart.week() : view.title;

+                    self.trigger_up('viewUpdated', {

+                        mode: mode,

+                        title: title,

+                    });

+                },

+                height: 'parent',

+                unselectAuto: false,

+                locale: locale, // reset locale when fullcalendar has already been instanciated before now

+            });

+

+            this.$calendar.fullCalendar(fc_options);

+        },

+

+        _render: function () {

@etobella can you explain w/ a detailed comment?


In web_view_calendar_list/views/webclient_templates.xml:

> @@ -0,0 +1,14 @@

+<?xml version="1.0" encoding="utf-8"?>

could you move this to templates/assets.xml?

—
You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.