diff --git a/web_events_calendar_view/README.rst b/web_events_calendar_view/README.rst new file mode 100755 index 000000000..023774350 --- /dev/null +++ b/web_events_calendar_view/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Website Event Calendar View +================================================ +This module allow to view the events in calendar and user can easily +navigate to event from calendar. + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE v3.0 (AGPL-3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Version 16: (V16) Renu M, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/web_events_calendar_view/__init__.py b/web_events_calendar_view/__init__.py new file mode 100644 index 000000000..3fab28bf9 --- /dev/null +++ b/web_events_calendar_view/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Renu M (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import models +from . import controllers diff --git a/web_events_calendar_view/__manifest__.py b/web_events_calendar_view/__manifest__.py new file mode 100644 index 000000000..01a45a80f --- /dev/null +++ b/web_events_calendar_view/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Renu M (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'Website Event Calendar View', + 'version': '16.0.1.0.0', + 'category': 'Website', + 'summary': 'Website Calendar View for Event in Odoo 16', + 'description': 'This module helps you make calender view of events in ' + 'website.Hence we can easily navigate to the event ' + 'through the calendar', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['website_event'], + 'data': [ + 'views/event_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'web_events_calendar_view/static/src/css/calender.scss', + 'web_events_calendar_view/static/src/js/calendar.js', + 'web_events_calendar_view/static/src/xml/templates.xml', + ], + }, + 'images': ['web_events_calendar_view/static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/web_events_calendar_view/controllers/__init__.py b/web_events_calendar_view/controllers/__init__.py new file mode 100644 index 000000000..e22206eeb --- /dev/null +++ b/web_events_calendar_view/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Renu M (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import web_events_calendar_view diff --git a/web_events_calendar_view/controllers/web_events_calendar_view.py b/web_events_calendar_view/controllers/web_events_calendar_view.py new file mode 100644 index 000000000..261a4d4b5 --- /dev/null +++ b/web_events_calendar_view/controllers/web_events_calendar_view.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Renu M (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from datetime import date, timedelta +from odoo import http +from odoo.fields import Date +from odoo.http import request + + +class EventCalendar(http.Controller): + @http.route("/web_events_calendar_view/days_with_events", + auth="public", type="json", website=True) + def days_with_events(self, start, end): + """Day with any events. + + start: + Search events from that date. + + end: + Search events until that date. + """ + events = request.env["event.event"].search([ + "|", + ("date_begin", "<=", end), + ("date_end", ">=", start), + ]) + days = set() + one_day = timedelta(days=1) + start = Date.from_string(start) + end = Date.from_string(end) + for event in events: + now = max(Date.from_string(event.date_begin), start) + event_end = min(Date.from_string(event.date_end), end) + while now <= event_end: + days.add(now) + now += one_day + return [Date.to_string(day) for day in days] + + @http.route("/web_events_calendar_view/events_for_day", + auth="public", type="json", website=True) + def events_for_day(self, day=None, limit=None): + """Day wise list of events. + + day: + Date in a string. If ``None``, we'll search for upcoming events + from today up to specified limit. + + limit: + How many results to return. + """ + ref = day or Date.to_string(date.today()) + domain = [ + ("date_end", ">=", ref), + ] + if day: + domain.append(("date_begin", "<=", ref)) + return request.env["event.event"].search_read( + domain=domain, + limit=limit, + fields=[ + "date_begin_pred_located", + "name", + "event_type_id", + "website_published", + "website_url", + ], + ) + + @http.route(['/calendar_events'], type='http', auth="public", + website=True) + def calendar_events(self): + return request.render( + "web_events_calendar_view.global_events_calendar") diff --git a/web_events_calendar_view/doc/RELEASE_NOTES.md b/web_events_calendar_view/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..cae00135a --- /dev/null +++ b/web_events_calendar_view/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 06.01.2024 +#### Version 16.0.1.0.0 +#### ADD + +- Initial commit for Website Event Calendar View diff --git a/web_events_calendar_view/models/__init__.py b/web_events_calendar_view/models/__init__.py new file mode 100644 index 000000000..04e7a71e8 --- /dev/null +++ b/web_events_calendar_view/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Renu M (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import event diff --git a/web_events_calendar_view/models/event.py b/web_events_calendar_view/models/event.py new file mode 100644 index 000000000..0158e2bcb --- /dev/null +++ b/web_events_calendar_view/models/event.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Renu M (odoo@cybrosys.info) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import api, fields, models, tools +from odoo.tools import format_datetime + + +class EventEvent(models.Model): + _inherit = 'event.event' + + date_begin_pred_located = fields.Char( + compute='_compute_date_begin_pred_located', + store=True, + ) + + @api.depends('date_begin', 'date_tz') + def _compute_date_begin_pred_located(self): + for record in self: + record.date_begin_pred_located = format_datetime( + self.env, + record.date_begin, + tz=record.date_tz, + dt_format='medium') diff --git a/web_events_calendar_view/static/description/assets/hero.gif b/web_events_calendar_view/static/description/assets/hero.gif new file mode 100644 index 000000000..551eab99e Binary files /dev/null and b/web_events_calendar_view/static/description/assets/hero.gif differ diff --git a/web_events_calendar_view/static/description/assets/icons/check.png b/web_events_calendar_view/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/check.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/chevron.png b/web_events_calendar_view/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/chevron.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/cogs.png b/web_events_calendar_view/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/cogs.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/consultation.png b/web_events_calendar_view/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/consultation.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/ecom-black.png b/web_events_calendar_view/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/ecom-black.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/education-black.png b/web_events_calendar_view/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/education-black.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/hotel-black.png b/web_events_calendar_view/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/hotel-black.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/license.png b/web_events_calendar_view/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/license.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/lifebuoy.png b/web_events_calendar_view/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/lifebuoy.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/manufacturing-black.png b/web_events_calendar_view/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/manufacturing-black.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/pos-black.png b/web_events_calendar_view/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/pos-black.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/puzzle.png b/web_events_calendar_view/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/puzzle.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/restaurant-black.png b/web_events_calendar_view/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/restaurant-black.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/service-black.png b/web_events_calendar_view/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/service-black.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/trading-black.png b/web_events_calendar_view/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/trading-black.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/training.png b/web_events_calendar_view/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/training.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/update.png b/web_events_calendar_view/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/update.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/user.png b/web_events_calendar_view/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/user.png differ diff --git a/web_events_calendar_view/static/description/assets/icons/wrench.png b/web_events_calendar_view/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/web_events_calendar_view/static/description/assets/icons/wrench.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/categories.png b/web_events_calendar_view/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/categories.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/check-box.png b/web_events_calendar_view/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/check-box.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/compass.png b/web_events_calendar_view/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/compass.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/corporate.png b/web_events_calendar_view/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/corporate.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/customer-support.png b/web_events_calendar_view/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/customer-support.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/cybrosys-logo.png b/web_events_calendar_view/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/cybrosys-logo.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/features.png b/web_events_calendar_view/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/features.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/logo.png b/web_events_calendar_view/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/logo.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/pictures.png b/web_events_calendar_view/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/pictures.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/pie-chart.png b/web_events_calendar_view/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/pie-chart.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/right-arrow.png b/web_events_calendar_view/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/right-arrow.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/star.png b/web_events_calendar_view/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/star.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/support.png b/web_events_calendar_view/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/support.png differ diff --git a/web_events_calendar_view/static/description/assets/misc/whatsapp.png b/web_events_calendar_view/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/misc/whatsapp.png differ diff --git a/web_events_calendar_view/static/description/assets/modules/1.png b/web_events_calendar_view/static/description/assets/modules/1.png new file mode 100644 index 000000000..c0aa245ce Binary files /dev/null and b/web_events_calendar_view/static/description/assets/modules/1.png differ diff --git a/web_events_calendar_view/static/description/assets/modules/2.png b/web_events_calendar_view/static/description/assets/modules/2.png new file mode 100644 index 000000000..5acf9a06a Binary files /dev/null and b/web_events_calendar_view/static/description/assets/modules/2.png differ diff --git a/web_events_calendar_view/static/description/assets/modules/3.png b/web_events_calendar_view/static/description/assets/modules/3.png new file mode 100644 index 000000000..b1308667f Binary files /dev/null and b/web_events_calendar_view/static/description/assets/modules/3.png differ diff --git a/web_events_calendar_view/static/description/assets/modules/4.png b/web_events_calendar_view/static/description/assets/modules/4.png new file mode 100644 index 000000000..1077a4c4e Binary files /dev/null and b/web_events_calendar_view/static/description/assets/modules/4.png differ diff --git a/web_events_calendar_view/static/description/assets/modules/5.png b/web_events_calendar_view/static/description/assets/modules/5.png new file mode 100644 index 000000000..f8aaeb32c Binary files /dev/null and b/web_events_calendar_view/static/description/assets/modules/5.png differ diff --git a/web_events_calendar_view/static/description/assets/modules/6.png b/web_events_calendar_view/static/description/assets/modules/6.png new file mode 100644 index 000000000..bc5648b1a Binary files /dev/null and b/web_events_calendar_view/static/description/assets/modules/6.png differ diff --git a/web_events_calendar_view/static/description/assets/screenshots/1.png b/web_events_calendar_view/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..c1cf67907 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/screenshots/1.png differ diff --git a/web_events_calendar_view/static/description/assets/screenshots/2.png b/web_events_calendar_view/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..d9234dfeb Binary files /dev/null and b/web_events_calendar_view/static/description/assets/screenshots/2.png differ diff --git a/web_events_calendar_view/static/description/assets/screenshots/3.png b/web_events_calendar_view/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..a81400db8 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/screenshots/3.png differ diff --git a/web_events_calendar_view/static/description/assets/screenshots/4.png b/web_events_calendar_view/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..9b4a29854 Binary files /dev/null and b/web_events_calendar_view/static/description/assets/screenshots/4.png differ diff --git a/web_events_calendar_view/static/description/banner.png b/web_events_calendar_view/static/description/banner.png new file mode 100644 index 000000000..1a6312ff4 Binary files /dev/null and b/web_events_calendar_view/static/description/banner.png differ diff --git a/web_events_calendar_view/static/description/icon.png b/web_events_calendar_view/static/description/icon.png new file mode 100644 index 000000000..bc5a9392f Binary files /dev/null and b/web_events_calendar_view/static/description/icon.png differ diff --git a/web_events_calendar_view/static/description/index.html b/web_events_calendar_view/static/description/index.html new file mode 100644 index 000000000..a6adc2bde --- /dev/null +++ b/web_events_calendar_view/static/description/index.html @@ -0,0 +1,625 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Website Event Calendar View

+

+ Navigate Events through Website Calendar + +

+ + +
+
+
+
+ +
+
+ +
+

+ Explore This + Module

+
+ + + +
+
+ +
+

+ Overview +

+
+
+
+ Give users the ability to simply track events on the calendar by date + and to quickly access the event directly from the calendar. +
+
+ + +
+
+ +
+

+ Features +

+
+
+
+
+ + Enterprise and Community compatible. +
+
+ + Able to recognise the event between a certain date on the calendar. +
+
+ + Easily discern the events which are unpublished. +
+
+ + Can easily navigate to the event through calendar list. +
+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Event Calendar menu in Website +

+

+ User can view all events from this menu Events Calendar.

+ +
+
+

+ Date wise Events. +

+

+ User can easily track events by date wise.

+ +
+
+

+ User can easily navigate to the event from the calendar on + one click. +

+ +
+
+

+ Unpublished Events. +

+

+ User can easily identify the unpublished events.

+ +
+
+
+ + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + +
+
+ +
+

+ Our Services +

+
+
+
+
+
+ +
+
+ Odoo + Customization
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Support
+
+
+
+ +
+
+ Hire + Odoo + Developer
+
+
+
+ +
+
+ Odoo + Integration
+
+
+
+ +
+
+ Odoo + Migration
+
+
+
+ +
+
+ Odoo + Consultancy
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + +
+
+ +
+

+ Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/web_events_calendar_view/static/src/css/calender.scss b/web_events_calendar_view/static/src/css/calender.scss new file mode 100644 index 000000000..6b1fe520b --- /dev/null +++ b/web_events_calendar_view/static/src/css/calender.scss @@ -0,0 +1,78 @@ +h3{ + font-size:3rem; + font-weight:bold; + color:#c68307; +} +.s_event_calendar_list { + .event_details{ + margin-bottom:7px; + } + .event_list_title{ + font-size:1.25rem; + font-weight:bold; + } + .event_title { + border: 0 solid $table-border-color; + border-bottom-width: 1px; + a{ + color: #333; + } + } + + .s_event_calendar { + .bootstrap-datetimepicker-widget { + width: 100%; + } + + .day:not(.active):not(:hover):not(.disabled) { + background-color: #FFDEAD; + font-weight:bold; + } + } + .day:not(.active):hover{ + background: #ff7b54; + color:#FFFFFF ; + } + .day.active,.day.active:hover{ + background-color: #000000; + color:#FFFFFF + } + td.today:not(.active)::before { + border-bottom-color: #cf2e2e !important; + } + + .category::before { + content: "| "; + } + .event_btn{ + background-color: #fff; + color:#3D3935; + border:2px solid; + border-color:#AB2328; + } + animation: unset !important; + opacity: 1 !important; + background-size: 1500px auto; + padding-top: 50px; + padding-bottom: 46px; + @media screen and(min-width:768px) { + table{ + height:475px; + td{ + padding: 1rem !important; + } + } + + .event_list_column{ + padding-left:50px; + padding-top:70px; + .s_event_list{ + margin-top:15px; + + } + } + .cal_heading{ + padding-bottom:20px; + } + } +} \ No newline at end of file diff --git a/web_events_calendar_view/static/src/js/calendar.js b/web_events_calendar_view/static/src/js/calendar.js new file mode 100644 index 000000000..4b205a1d2 --- /dev/null +++ b/web_events_calendar_view/static/src/js/calendar.js @@ -0,0 +1,146 @@ +odoo.define('web_events_calendar_view.calendar', function (require) { + "use strict"; + var animation = require('website.content.snippets.animation'); + var core = require("web.core"); + var time = require("web.time"); + var ajax = require("web.ajax"); + var DATE_FORMAT = time.strftime_to_moment_format("%Y-%m-%d"); + var DATETIME_FORMAT = time.strftime_to_moment_format( + "%Y-%m-%d %H:%M:%S"); + var INVERSE_FORMAT = "L"; + + var CustomCalendar = animation.Class.extend({ + selector: ".s_event_calendar_list", + init: function () { + this.datepickerOptions = { + inline: true, + minDate: moment().subtract(100, "years"), + maxDate: moment().add(100, "years"), + icons: { + previous: "fa fa-chevron-left", + next: "fa fa-chevron-right", + }, + format: DATE_FORMAT, + useCurrent: false, + locale: moment.locale(), + }; + return this._super.apply(this, arguments); + }, + + start: function (editableMode) { + this._super.apply(this, arguments); + + if (editableMode) { + return; + } + this.selectedDates = { + min: null, + max: null, + matches: [], + }; + + this.$calendar = this.$target.find('.s_event_calendar') + .on("change.datetimepicker", $.proxy(this, "dateSelected")) + .on("update.datetimepicker", $.proxy(this, "calendarMoved")); + this.$list = this.$target.find(".s_event_list"); + this.defaultAmount = Number(this.$(".js_amount").html()) || 4; + this.dateFormat = this.$list.data("dateFormat") || "LLL"; + // Get initial events to render the list + this.loadEvents(null, this.defaultAmount) + .then($.proxy(this, "renderList")); + // Preload dates and render the calendar + this.preloadDates(moment()) + .then($.proxy(this, "renderCalendar")); + }, + + dateSelected: function (event) { + this.loadEvents(event.date.format(DATE_FORMAT)) + .then($.proxy(this, "renderList")); + }, + + calendarMoved: function (event) { + if (event.change !== "M") { + // We only care when months are displayed + return; + } + // Preload dates if needed and show evented days + this.preloadDates(event.viewDate); + }, + + preloadDates: function (when) { + var margin = moment.duration(4, "months"); + // Don't preload if we have up to 4 months of margin + if ( + this.selectedDates.min && this.selectedDates.max && + this.selectedDates.min <= when - margin && + this.selectedDates.max >= when + margin + ) { + return $.Deferred().resolve(); + } + // Default values + margin.add(2, "months"); + var start = moment(when - margin), + end = moment(when + margin); + // If we already preloaded, preload 6 more months + if (this.selectedDates.min) { + start.subtract(6, "months"); + } + if (this.selectedDates.max) { + end.add(6, "months"); + } + // Do the preloading + return this.loadDates(start, end); + }, + + loadDates: function (start, end) { + return ajax.rpc( + "/web_events_calendar_view/days_with_events", + { + start: start.format(DATE_FORMAT), + end: end.format(DATE_FORMAT), + } + ).then($.proxy(this, "updateDatesCache", start, end)); + }, + + updateDatesCache: function (start, end, dates) { + if (!this.selectedDates.min || this.selectedDates.min > start) { + this.selectedDates.min = start; + } + if (!this.selectedDates.max || this.selectedDates.max < end) { + this.selectedDates.max = end; + } + this.selectedDates.matches = _.union(this.selectedDates.matches, dates); + }, + + loadEvents: function (day, limit) { + return ajax.rpc( + "/web_events_calendar_view/events_for_day", + {day: day, limit: limit} + ); + }, + + renderCalendar: function () { + var enabledDates = _.map(this.selectedDates.matches, function (ndate) { + return moment(ndate, DATE_FORMAT); + }); + this.$calendar.empty().datetimepicker(_.extend({}, + this.datepickerOptions, {'enabledDates': enabledDates})); + }, + + renderList: function (events) { + this.$list.html(core.qweb.render( + "web_events_calendar_view.list", + {events: events} + )); + }, + }); + + animation.registry.web_events_calendar_view = CustomCalendar; + + return { + CustomCalendar: CustomCalendar, + DATE_FORMAT: DATE_FORMAT, + DATETIME_FORMAT: DATETIME_FORMAT, + INVERSE_FORMAT: INVERSE_FORMAT, + }; +}); diff --git a/web_events_calendar_view/static/src/xml/templates.xml b/web_events_calendar_view/static/src/xml/templates.xml new file mode 100644 index 000000000..437cecd32 --- /dev/null +++ b/web_events_calendar_view/static/src/xml/templates.xml @@ -0,0 +1,26 @@ + + + diff --git a/web_events_calendar_view/views/event_templates.xml b/web_events_calendar_view/views/event_templates.xml new file mode 100644 index 000000000..ca463fa2f --- /dev/null +++ b/web_events_calendar_view/views/event_templates.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + Events Calendar + /calendar_events + + 20 + +