From 51c2a50791a5caacfe8cf35c664918ec9b7e2cda Mon Sep 17 00:00:00 2001 From: tarteo Date: Fri, 27 Jan 2017 14:29:07 +0100 Subject: [PATCH 01/16] Initial commit --- website_snippet_calendar/README.rst | 73 ++++++++++ website_snippet_calendar/__init__.py | 5 + website_snippet_calendar/__openerp__.py | 24 +++ .../controllers/__init__.py | 5 + website_snippet_calendar/controllers/main.py | 63 ++++++++ website_snippet_calendar/i18n/ca.po | 58 ++++++++ website_snippet_calendar/i18n/es.po | 60 ++++++++ website_snippet_calendar/i18n/fr.po | 59 ++++++++ website_snippet_calendar/i18n/it.po | 60 ++++++++ website_snippet_calendar/i18n/nb.po | 58 ++++++++ website_snippet_calendar/i18n/nl.po | 58 ++++++++ website_snippet_calendar/i18n/pt_BR.po | 60 ++++++++ website_snippet_calendar/i18n/sl.po | 59 ++++++++ .../security/ir.model.access.csv | 4 + .../security/security.xml | 39 +++++ .../static/description/icon.png | Bin 0 -> 8352 bytes .../static/src/css/website_calendar_block.css | 137 ++++++++++++++++++ .../static/src/img/blocks/calendar.png | Bin 0 -> 3823 bytes .../static/src/js/website_calendar_block.js | 123 ++++++++++++++++ .../templates/website_calendar_snippet.xml | 40 +++++ 20 files changed, 985 insertions(+) create mode 100644 website_snippet_calendar/README.rst create mode 100644 website_snippet_calendar/__init__.py create mode 100644 website_snippet_calendar/__openerp__.py create mode 100644 website_snippet_calendar/controllers/__init__.py create mode 100644 website_snippet_calendar/controllers/main.py create mode 100644 website_snippet_calendar/i18n/ca.po create mode 100644 website_snippet_calendar/i18n/es.po create mode 100644 website_snippet_calendar/i18n/fr.po create mode 100644 website_snippet_calendar/i18n/it.po create mode 100644 website_snippet_calendar/i18n/nb.po create mode 100644 website_snippet_calendar/i18n/nl.po create mode 100644 website_snippet_calendar/i18n/pt_BR.po create mode 100644 website_snippet_calendar/i18n/sl.po create mode 100644 website_snippet_calendar/security/ir.model.access.csv create mode 100644 website_snippet_calendar/security/security.xml create mode 100644 website_snippet_calendar/static/description/icon.png create mode 100644 website_snippet_calendar/static/src/css/website_calendar_block.css create mode 100644 website_snippet_calendar/static/src/img/blocks/calendar.png create mode 100644 website_snippet_calendar/static/src/js/website_calendar_block.js create mode 100644 website_snippet_calendar/templates/website_calendar_snippet.xml diff --git a/website_snippet_calendar/README.rst b/website_snippet_calendar/README.rst new file mode 100644 index 0000000000..6ec063cb7b --- /dev/null +++ b/website_snippet_calendar/README.rst @@ -0,0 +1,73 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +================ +Calendar Snippet +================ + +This module adds a new block in the website editor. +The new block is based on Messaging -> Calendar. Use field 'Privacy' +to determine its publicity. +Since it's a block it can be placed anywhere on your website. + + +Usage +===== + +Privacy setting is per event; in order to change privacy setting you should: + +* open the event form; +* click Edit Event button; +* go to Options tab. + + +To use this module, you need to: + +* Go to the website and click Edit; +* Click on Insert Blocks; +* Select the Features section. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/186/8.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed `feedback +`_. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Dennis Sluijk + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/website_snippet_calendar/__init__.py b/website_snippet_calendar/__init__.py new file mode 100644 index 0000000000..d1294c90ab --- /dev/null +++ b/website_snippet_calendar/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 ONESTEiN BV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import controllers diff --git a/website_snippet_calendar/__openerp__.py b/website_snippet_calendar/__openerp__.py new file mode 100644 index 0000000000..e6ef84a213 --- /dev/null +++ b/website_snippet_calendar/__openerp__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# © 2016 ONESTEiN BV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Calendar Snippet', + 'images': [], + 'category': 'Website', + 'summary': 'Calendar (based on Messaging -> Calendar) on website.', + 'version': '8.0.1.0.0', + 'author': 'ONESTEiN BV,Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'website': 'http://www.onestein.eu', + 'depends': ['website', 'calendar', 'web'], + 'data': [ + 'security/ir.model.access.csv', + 'security/security.xml', + 'templates/website_calendar_snippet.xml', + ], + 'demo': [], + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_snippet_calendar/controllers/__init__.py b/website_snippet_calendar/controllers/__init__.py new file mode 100644 index 0000000000..cde1a70841 --- /dev/null +++ b/website_snippet_calendar/controllers/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2016 ONESTEiN BV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import main diff --git a/website_snippet_calendar/controllers/main.py b/website_snippet_calendar/controllers/main.py new file mode 100644 index 0000000000..8ce6d12757 --- /dev/null +++ b/website_snippet_calendar/controllers/main.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# © 2016 ONESTEiN BV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import json +from datetime import datetime + +from openerp import http +from openerp.http import request + + +class WebsiteCalendarBlock(http.Controller): + + @http.route( + ['/calendar_block/get_events//'], + type='http', + auth='public', + website=True) + def get_events(self, start, end, **post): + cr, uid, context = request.cr, request.uid, request.context + + # Get events + calendar_event_obj = request.registry['calendar.event'] + calendar_event_ids = calendar_event_obj.search( + cr, uid, [('start', '<', unicode(datetime.fromtimestamp(end))), + ('stop', '>', unicode(datetime.fromtimestamp(start)))], + context=context) + calendar_events = calendar_event_obj.browse( + cr, uid, calendar_event_ids, context=context) + + contacts = [] + if request.website.user_id.id != uid: + calendar_contact_obj = request.registry['calendar.contacts'] + calendar_contact_ids = calendar_contact_obj.search( + cr, uid, [('user_id', '=', uid)], context=context) + calendar_contacts = calendar_contact_obj.browse( + cr, uid, calendar_contact_ids, context=context) + + # Create response (Cannot serialize object) + contacts.append(request.env.user.partner_id.id) + for contact in calendar_contacts: + contacts.append(contact.partner_id.id) + + # Events + events = [] + for calendar_event in calendar_events: + # Fetch attendees + attendees = [] + for attendee_id in calendar_event.attendee_ids: + attendees.append({'id': attendee_id.partner_id.id, + 'name': attendee_id.partner_id.name}) + + events.append( + {'id': calendar_event.id, + 'start': calendar_event.start, + 'end': calendar_event.stop, + 'title': calendar_event.name, + 'allDay': calendar_event.allday, + 'color': calendar_event.color_partner_id, + 'attendees': attendees + }) + + return json.dumps({'events': events, 'contacts': contacts}) diff --git a/website_snippet_calendar/i18n/ca.po b/website_snippet_calendar/i18n/ca.po new file mode 100644 index 0000000000..a99d96a720 --- /dev/null +++ b/website_snippet_calendar/i18n/ca.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_calendar_snippet +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-01-11 08:54+0000\n" +"PO-Revision-Date: 2016-03-03 20:09+0000\n" +"Last-Translator: <>\n" +"Language-Team: Catalan (http://www.transifex.com/oca/OCA-website-8-0/language/ca/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ca\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:70 +#, python-format +msgid "All day" +msgstr "" + +#. module: website_calendar_snippet +#: view:website:website.snippets +msgid "Calendar" +msgstr "" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:75 +#, python-format +msgid "Day" +msgstr "" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:73 +#, python-format +msgid "Month" +msgstr "Mes" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:72 +#, python-format +msgid "Today" +msgstr "" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:74 +#, python-format +msgid "Week" +msgstr "" diff --git a/website_snippet_calendar/i18n/es.po b/website_snippet_calendar/i18n/es.po new file mode 100644 index 0000000000..f23c0254f8 --- /dev/null +++ b/website_snippet_calendar/i18n/es.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_calendar_snippet +# +# Translators: +# Carles Antoli , 2016 +# Carles Antoli , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-29 12:59+0000\n" +"PO-Revision-Date: 2016-03-23 17:20+0000\n" +"Last-Translator: Carles Antoli \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-website-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:70 +#, python-format +msgid "All day" +msgstr "Todo el dia" + +#. module: website_calendar_snippet +#: view:website:website.snippets +msgid "Calendar" +msgstr "Calendario" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:75 +#, python-format +msgid "Day" +msgstr "Día" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:73 +#, python-format +msgid "Month" +msgstr "Mes" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:72 +#, python-format +msgid "Today" +msgstr "Hoy" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:74 +#, python-format +msgid "Week" +msgstr "Semana" diff --git a/website_snippet_calendar/i18n/fr.po b/website_snippet_calendar/i18n/fr.po new file mode 100644 index 0000000000..5fb50045c6 --- /dev/null +++ b/website_snippet_calendar/i18n/fr.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_calendar_snippet +# +# Translators: +# Christophe CHAUVET , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-29 12:59+0000\n" +"PO-Revision-Date: 2016-05-06 08:30+0000\n" +"Last-Translator: Christophe CHAUVET \n" +"Language-Team: French (http://www.transifex.com/oca/OCA-website-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:70 +#, python-format +msgid "All day" +msgstr "Toute la journée" + +#. module: website_calendar_snippet +#: view:website:website.snippets +msgid "Calendar" +msgstr "Calendrier" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:75 +#, python-format +msgid "Day" +msgstr "Jour" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:73 +#, python-format +msgid "Month" +msgstr "Mois" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:72 +#, python-format +msgid "Today" +msgstr "Aujourd'hui" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:74 +#, python-format +msgid "Week" +msgstr "Semaine" diff --git a/website_snippet_calendar/i18n/it.po b/website_snippet_calendar/i18n/it.po new file mode 100644 index 0000000000..035d6c9273 --- /dev/null +++ b/website_snippet_calendar/i18n/it.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_calendar_snippet +# +# Translators: +# Paolo Valier, 2016 +# Paolo Valier, 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-29 12:59+0000\n" +"PO-Revision-Date: 2016-03-11 08:54+0000\n" +"Last-Translator: Paolo Valier\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-website-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:70 +#, python-format +msgid "All day" +msgstr "Tutto il giorno" + +#. module: website_calendar_snippet +#: view:website:website.snippets +msgid "Calendar" +msgstr "Calendario" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:75 +#, python-format +msgid "Day" +msgstr "Giorno" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:73 +#, python-format +msgid "Month" +msgstr "Mese" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:72 +#, python-format +msgid "Today" +msgstr "Oggi" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:74 +#, python-format +msgid "Week" +msgstr "Settimana" diff --git a/website_snippet_calendar/i18n/nb.po b/website_snippet_calendar/i18n/nb.po new file mode 100644 index 0000000000..d0647612ab --- /dev/null +++ b/website_snippet_calendar/i18n/nb.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_calendar_snippet +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-11-29 19:52+0000\n" +"PO-Revision-Date: 2016-03-03 20:09+0000\n" +"Last-Translator: <>\n" +"Language-Team: Norwegian Bokmål (http://www.transifex.com/oca/OCA-website-8-0/language/nb/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nb\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:70 +#, python-format +msgid "All day" +msgstr "" + +#. module: website_calendar_snippet +#: view:website:website.snippets +msgid "Calendar" +msgstr "" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:75 +#, python-format +msgid "Day" +msgstr "Dag" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:73 +#, python-format +msgid "Month" +msgstr "Måned" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:72 +#, python-format +msgid "Today" +msgstr "" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:74 +#, python-format +msgid "Week" +msgstr "Uke" diff --git a/website_snippet_calendar/i18n/nl.po b/website_snippet_calendar/i18n/nl.po new file mode 100644 index 0000000000..2183d570c7 --- /dev/null +++ b/website_snippet_calendar/i18n/nl.po @@ -0,0 +1,58 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_calendar_snippet +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-29 12:59+0000\n" +"PO-Revision-Date: 2016-03-03 20:09+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Dutch (http://www.transifex.com/oca/OCA-website-8-0/language/nl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:70 +#, python-format +msgid "All day" +msgstr "Hele dag" + +#. module: website_calendar_snippet +#: view:website:website.snippets +msgid "Calendar" +msgstr "Kalender" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:75 +#, python-format +msgid "Day" +msgstr "Dag" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:73 +#, python-format +msgid "Month" +msgstr "Maand" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:72 +#, python-format +msgid "Today" +msgstr "Vandaag" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:74 +#, python-format +msgid "Week" +msgstr "Week" diff --git a/website_snippet_calendar/i18n/pt_BR.po b/website_snippet_calendar/i18n/pt_BR.po new file mode 100644 index 0000000000..a87f1338be --- /dev/null +++ b/website_snippet_calendar/i18n/pt_BR.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_calendar_snippet +# +# Translators: +# danimaribeiro , 2016 +# danimaribeiro , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-29 12:59+0000\n" +"PO-Revision-Date: 2016-03-05 18:12+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-website-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:70 +#, python-format +msgid "All day" +msgstr "Todo o dia" + +#. module: website_calendar_snippet +#: view:website:website.snippets +msgid "Calendar" +msgstr "Calendário" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:75 +#, python-format +msgid "Day" +msgstr "Dia" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:73 +#, python-format +msgid "Month" +msgstr "Mês" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:72 +#, python-format +msgid "Today" +msgstr "Hoje" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:74 +#, python-format +msgid "Week" +msgstr "Semana" diff --git a/website_snippet_calendar/i18n/sl.po b/website_snippet_calendar/i18n/sl.po new file mode 100644 index 0000000000..ab693130f3 --- /dev/null +++ b/website_snippet_calendar/i18n/sl.po @@ -0,0 +1,59 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_calendar_snippet +# +# Translators: +# Matjaž Mozetič , 2016 +msgid "" +msgstr "" +"Project-Id-Version: website (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-29 12:59+0000\n" +"PO-Revision-Date: 2016-03-05 05:50+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-website-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:70 +#, python-format +msgid "All day" +msgstr "Cel dan" + +#. module: website_calendar_snippet +#: view:website:website.snippets +msgid "Calendar" +msgstr "Koledar" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:75 +#, python-format +msgid "Day" +msgstr "Dan" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:73 +#, python-format +msgid "Month" +msgstr "Mesec" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:72 +#, python-format +msgid "Today" +msgstr "Danes" + +#. module: website_calendar_snippet +#. openerp-web +#: code:addons/website_calendar_snippet/static/src/js/website_calendar_block.js:74 +#, python-format +msgid "Week" +msgstr "Teden" diff --git a/website_snippet_calendar/security/ir.model.access.csv b/website_snippet_calendar/security/ir.model.access.csv new file mode 100644 index 0000000000..8132a59c21 --- /dev/null +++ b/website_snippet_calendar/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +calendar_event_public,calendar_event public,calendar.model_calendar_event,base.group_public,1,0,0,0 +calendar_attendee_public,calendar_attendee public,calendar.model_calendar_attendee,base.group_public,1,0,0,0 +res_partner_public,res_partner public,base.model_res_partner,base.group_public,1,0,0,0 diff --git a/website_snippet_calendar/security/security.xml b/website_snippet_calendar/security/security.xml new file mode 100644 index 0000000000..01aff6b35d --- /dev/null +++ b/website_snippet_calendar/security/security.xml @@ -0,0 +1,39 @@ + + + + + + Calendar event public + + [('class', '=', 'public')] + + + + + + + + + Calendar attendee public + + [('event_id.class', '=', 'public')] + + + + + + + + + Partner public + + [(1, '=', 1)] + + + + + + + + + diff --git a/website_snippet_calendar/static/description/icon.png b/website_snippet_calendar/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b53e13d4a1321cc0c5569a80033984e167da7c57 GIT binary patch literal 8352 zcmcI}c{r4B^!NRY8O9P*3RyByNec>*b;w%TLP+*(Ew;$cV~G@|z7=H~`@TnZhD0H2 zmalb?bu44c&Tr~_UGMwf`^S5|?;mr`+;h%--{*YJ@|@?KFl|lMBMh7j0DvRvYD#wi zfT%wqfTpE>-FL~f`LlX@M^zEzw{y=?7f4$L4Fv#-@QiyFDC(NtNzLdf0L)+he4u8> z%m>szIbD?vU3DF8T-_~Ptbw+Ly@RWerm`OPnW&Js(3LByYl;#8U|H0a6!bhy7vt&Q zal6Gg&s1b)UaV}*Uw-oz*-(VP*nIok$M3_NvL7#s_K2RQ$G8amI!6zEd4u`(^(Lks z`T8P9Bqskn^4IH(d@m0XeY>@d{O8Q@fO6g_OdH<8&hFZs2HTTjc=G0V!@jOg$F zZa1n})4G!ez?atTN1J;VKThn{R&K{gAAAkZTH_s^Si6n!0WPd;^-;3!KMagyo5J%% z2?7b8D?ihshbgl5=>Q(K91kJ$&LmWx99x%@@FRDnquBiy_3c%tq+rq3f5olh25k=m z_!qysZdb8CPMfcd5X*Br8?RF;60Wly1mNRgZ9UfPqekk95S>x-q#dhCkWi-2Ct1YFUA%;Cvuq!rZCxl`1H6*s)9uelQT4Sbu-7S z>CSTi{vD4SJbOi%Xry@$;Zx%OJ-tT$)urIFEg4q(X{u1L_f+>1WE=D8Nz?rU%3RP? zY@OeE7t7HZ$s(sn$r}LYP+v7Qtc!2EVk^BQ*g)RojbXihblFNx6av4l#f^N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C#|(^^er& zv+D!8WLqDCpUpR;wK$ElS+XWEf&u~ph0JQKidKdcG^xz^;TE%ts-U&?b@%W-i2;{; zgxTJxQ~#wlzX+c??yTYXT2U#bHaA=pqnK*Q;LV%GHl-p} zqJ2_1-;DY52pi8}1FdD&6~$2Z9&28ZK>v5J?iT-jVZnE7Y^(*>-u~@0i*$V4UKkx3 zdK8^cB9TV_{Q2`^ch_H8ntg`0G=N3BsJOTl!+&jUdD$5W`8YZ{>Wk*RP;)=fURYQ- zs6&+-(G47hM)vZt(f_70%WF=ntP~Gx4yNzTSo^tb5`%c>z-V-z?H?ms8^QKrfBgtW zzZ(dFK+w^r%V%d%NT%#o32TAG4>Fj;skFTh9@>K7Xt;dwZE?Sx!!Njwj=7Y}2^TGo zIM98NExuwO{9ecpe)z>e2)^>PHE4muMw)u==u0mj>!pA46`M8nxP&0Pg+uh?*9o`q}EPPBb8n4 zmpW|(5)H8+>YjUTVoaxqSB6<>iH^VRbRIy)q=X`Sw$hL2!_2GLGt7@&`Km1GDR4f2 zDi3UIWvQJiB|S7|3}oZtIooa|oar4`;m_feI&|QSfpl#TJ%+ri`J)=R2UK#S^44<~ Py8'; + if (all_filters[events[i].color] !== undefined) { + events[i].className = 'calendar_color_' + all_filters[events[i].color]; + } + else { + events[i].className = 'cal_opacity calendar_color_'+ all_filters[-1]; + } + } + } + callback(events); + } + }); + }, + weekNumberTitle: _t("W"), + allDayText: _t('All day'), + buttonText : { + today: _t("Today"), + month: _t("Month"), + week: _t("Week"), + day: _t("Day") + }, + aspectRatio: 1.8, + snapMinutes: 15, + weekMode : 'liquid', + columnFormat: { + month: 'ddd', + week: 'ddd ' + dateFormat, + day: 'dddd ' + dateFormat, + }, + titleFormat: { + month: 'MMMM yyyy', + week: dateFormat + "{ '—'"+ dateFormat, + day: dateFormat, + }, + timeFormat : { + // for agendaWeek and agendaDay + agenda: shortTimeformat + '{ - ' + shortTimeformat + '}', // 5:00 - 6:30 + // for all other views + '': shortTimeformat.replace(/:mm/,'(:mm)') // 7pm + }, + axisFormat : shortTimeformat.replace(/:mm/,'(:mm)'), + weekNumbers: true, + monthNames: Date.CultureInfo.monthNames, + monthNamesShort: Date.CultureInfo.abbreviatedMonthNames, + dayNames: Date.CultureInfo.dayNames, + dayNamesShort: Date.CultureInfo.abbreviatedDayNames, + firstDay: Date.CultureInfo.firstDayOfWeek, + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + eventAfterRender: function (event, element, view) { + if ((view.name !== 'month') && (((event.end-event.start)/60000)<=30)) { + //if duration is too small, we see the html code of img + var current_title = $(element.find('.fc-event-time')).text(); + var new_title = current_title.substr(0,current_title.indexOf("0?current_title.indexOf(" + + + + + + + + + + + \ No newline at end of file From da383ea52b20e1887170a4ccd67086ff657fafc9 Mon Sep 17 00:00:00 2001 From: tarteo Date: Fri, 27 Jan 2017 15:55:36 +0100 Subject: [PATCH 02/16] [MIG] Manifest --- website_snippet_calendar/__openerp__.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/website_snippet_calendar/__openerp__.py b/website_snippet_calendar/__openerp__.py index e6ef84a213..8680328f5a 100644 --- a/website_snippet_calendar/__openerp__.py +++ b/website_snippet_calendar/__openerp__.py @@ -1,23 +1,25 @@ # -*- coding: utf-8 -*- -# © 2016 ONESTEiN BV () +# © 2017 Onestein () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Calendar Snippet', - 'images': [], 'category': 'Website', - 'summary': 'Calendar (based on Messaging -> Calendar) on website.', - 'version': '8.0.1.0.0', - 'author': 'ONESTEiN BV,Odoo Community Association (OCA)', + 'summary': 'Calendar on website.', + 'version': '9.0.1.0.0', + 'author': 'Onestein,Odoo Community Association (OCA)', 'license': 'AGPL-3', 'website': 'http://www.onestein.eu', - 'depends': ['website', 'calendar', 'web'], + 'depends': [ + 'website', + 'calendar', + 'web' + ], 'data': [ 'security/ir.model.access.csv', 'security/security.xml', 'templates/website_calendar_snippet.xml', ], - 'demo': [], 'installable': True, 'auto_install': False, 'application': False, From d0d516a4e9a351bdb2dab2e9658fb63c4e641848 Mon Sep 17 00:00:00 2001 From: tarteo Date: Fri, 27 Jan 2017 16:43:52 +0100 Subject: [PATCH 03/16] [MIG] Migrating js, python, css and templates --- website_snippet_calendar/__init__.py | 2 +- .../controllers/__init__.py | 2 +- website_snippet_calendar/controllers/main.py | 6 +-- .../security/security.xml | 9 ++-- ...block.css => website_snippet_calendar.css} | 3 ++ .../src/img/{blocks => snippets}/calendar.png | Bin ...r_block.js => website_snippet_calendar.js} | 7 ++- .../templates/website_calendar_snippet.xml | 40 ---------------- .../templates/website_snippet_calendar.xml | 43 ++++++++++++++++++ 9 files changed, 62 insertions(+), 50 deletions(-) rename website_snippet_calendar/static/src/css/{website_calendar_block.css => website_snippet_calendar.css} (97%) rename website_snippet_calendar/static/src/img/{blocks => snippets}/calendar.png (100%) rename website_snippet_calendar/static/src/js/{website_calendar_block.js => website_snippet_calendar.js} (95%) delete mode 100644 website_snippet_calendar/templates/website_calendar_snippet.xml create mode 100644 website_snippet_calendar/templates/website_snippet_calendar.xml diff --git a/website_snippet_calendar/__init__.py b/website_snippet_calendar/__init__.py index d1294c90ab..df31b29cc8 100644 --- a/website_snippet_calendar/__init__.py +++ b/website_snippet_calendar/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# © 2016 ONESTEiN BV () +# © 2017 Onestein () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import controllers diff --git a/website_snippet_calendar/controllers/__init__.py b/website_snippet_calendar/controllers/__init__.py index cde1a70841..631d63f87d 100644 --- a/website_snippet_calendar/controllers/__init__.py +++ b/website_snippet_calendar/controllers/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# © 2016 ONESTEiN BV () +# © 2017 Onestein () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import main diff --git a/website_snippet_calendar/controllers/main.py b/website_snippet_calendar/controllers/main.py index 8ce6d12757..82bc848b4e 100644 --- a/website_snippet_calendar/controllers/main.py +++ b/website_snippet_calendar/controllers/main.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# © 2016 ONESTEiN BV () +# © 2017 Onestein () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import json @@ -9,10 +9,10 @@ from openerp.http import request -class WebsiteCalendarBlock(http.Controller): +class WebsiteCalendarSnippet(http.Controller): @http.route( - ['/calendar_block/get_events//'], + ['/calendar_snippet/get_events//'], type='http', auth='public', website=True) diff --git a/website_snippet_calendar/security/security.xml b/website_snippet_calendar/security/security.xml index 01aff6b35d..cf6db096fe 100644 --- a/website_snippet_calendar/security/security.xml +++ b/website_snippet_calendar/security/security.xml @@ -1,8 +1,11 @@ + + - + Calendar event public [('class', '=', 'public')] @@ -13,7 +16,7 @@ - + Calendar attendee public [('event_id.class', '=', 'public')] @@ -24,7 +27,7 @@ - + Partner public [(1, '=', 1)] diff --git a/website_snippet_calendar/static/src/css/website_calendar_block.css b/website_snippet_calendar/static/src/css/website_snippet_calendar.css similarity index 97% rename from website_snippet_calendar/static/src/css/website_calendar_block.css rename to website_snippet_calendar/static/src/css/website_snippet_calendar.css index 7ef4420400..cb4eea1462 100644 --- a/website_snippet_calendar/static/src/css/website_calendar_block.css +++ b/website_snippet_calendar/static/src/css/website_snippet_calendar.css @@ -1,3 +1,6 @@ +/* Copyright 2017 Onestein + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + .attendee_head { float: right; margin-left: 1px; diff --git a/website_snippet_calendar/static/src/img/blocks/calendar.png b/website_snippet_calendar/static/src/img/snippets/calendar.png similarity index 100% rename from website_snippet_calendar/static/src/img/blocks/calendar.png rename to website_snippet_calendar/static/src/img/snippets/calendar.png diff --git a/website_snippet_calendar/static/src/js/website_calendar_block.js b/website_snippet_calendar/static/src/js/website_snippet_calendar.js similarity index 95% rename from website_snippet_calendar/static/src/js/website_calendar_block.js rename to website_snippet_calendar/static/src/js/website_snippet_calendar.js index 43f133e20d..e5524658a9 100644 --- a/website_snippet_calendar/static/src/js/website_calendar_block.js +++ b/website_snippet_calendar/static/src/js/website_snippet_calendar.js @@ -1,10 +1,13 @@ +/* Copyright 2017 Onestein +* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + (function () { 'use strict'; var website = openerp.website; var _t = openerp._t; website.ready().then(function () { - website.if_dom_contains('div.calendar_block', function ($el) { + website.if_dom_contains('div.calendar_snippet', function ($el) { var $calendar = $el.find('.calendar'); $calendar.html(''); var datejs_locale = "/web/static/lib/datejs/globalization/" + $('html').attr('lang').replace("_", "-") + ".js"; @@ -28,7 +31,7 @@ $calendar.fullCalendar({ events: function(start, end, callback) { $.ajax({ - url: '/calendar_block/get_events/' + Math.round(start.getTime() / 1000) + '/' + Math.round(end.getTime() / 1000), + url: '/calendar_snippet/get_events/' + Math.round(start.getTime() / 1000) + '/' + Math.round(end.getTime() / 1000), dataType: 'json', success: function(result) { //Setup colors diff --git a/website_snippet_calendar/templates/website_calendar_snippet.xml b/website_snippet_calendar/templates/website_calendar_snippet.xml deleted file mode 100644 index d639a333ff..0000000000 --- a/website_snippet_calendar/templates/website_calendar_snippet.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/website_snippet_calendar/templates/website_snippet_calendar.xml b/website_snippet_calendar/templates/website_snippet_calendar.xml new file mode 100644 index 0000000000..59e3658364 --- /dev/null +++ b/website_snippet_calendar/templates/website_snippet_calendar.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + \ No newline at end of file From 2536e9dd235c5849157d6f3e72af204054739d9c Mon Sep 17 00:00:00 2001 From: tarteo Date: Mon, 30 Jan 2017 09:56:25 +0100 Subject: [PATCH 04/16] [MIG] README and assets --- website_snippet_calendar/README.rst | 23 ++++++++----------- website_snippet_calendar/__openerp__.py | 2 +- .../templates/website_snippet_calendar.xml | 13 ++++------- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/website_snippet_calendar/README.rst b/website_snippet_calendar/README.rst index 6ec063cb7b..0924b690e6 100644 --- a/website_snippet_calendar/README.rst +++ b/website_snippet_calendar/README.rst @@ -7,20 +7,21 @@ Calendar Snippet ================ This module adds a new block in the website editor. -The new block is based on Messaging -> Calendar. Use field 'Privacy' +The new block is based on Calendar (module). Use field 'Privacy' to determine its publicity. Since it's a block it can be placed anywhere on your website. +Configuration +============= -Usage -===== - -Privacy setting is per event; in order to change privacy setting you should: +Privacy setting is per event; in order to change privacy setting go to: -* open the event form; +* the event form; * click Edit Event button; * go to Options tab. +Usage +===== To use this module, you need to: @@ -30,19 +31,15 @@ To use this module, you need to: .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/186/8.0 + :target: https://runbot.odoo-community.org/runbot/186/9.0 Bug Tracker =========== Bugs are tracked on `GitHub Issues -`_. In case of trouble, please +`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed `feedback -`_. +help us smashing it by providing a detailed and welcomed feedback. Credits ======= diff --git a/website_snippet_calendar/__openerp__.py b/website_snippet_calendar/__openerp__.py index 8680328f5a..2623816057 100644 --- a/website_snippet_calendar/__openerp__.py +++ b/website_snippet_calendar/__openerp__.py @@ -18,7 +18,7 @@ 'data': [ 'security/ir.model.access.csv', 'security/security.xml', - 'templates/website_calendar_snippet.xml', + 'templates/website_snippet_calendar.xml', ], 'installable': True, 'auto_install': False, diff --git a/website_snippet_calendar/templates/website_snippet_calendar.xml b/website_snippet_calendar/templates/website_snippet_calendar.xml index 59e3658364..2185d5e6dd 100644 --- a/website_snippet_calendar/templates/website_snippet_calendar.xml +++ b/website_snippet_calendar/templates/website_snippet_calendar.xml @@ -25,19 +25,14 @@ - - - \ No newline at end of file From f685d99de98abfbae1fc93a7dedf0769e4d4abb6 Mon Sep 17 00:00:00 2001 From: tarteo Date: Mon, 30 Jan 2017 16:54:06 +0100 Subject: [PATCH 05/16] [MIG] Templates --- website_snippet_calendar/__openerp__.py | 3 +- .../static/src/js/website_snippet_calendar.js | 232 +++++++++--------- website_snippet_calendar/templates/assets.xml | 18 ++ .../templates/snippets.xml | 25 ++ .../templates/website_snippet_calendar.xml | 38 --- 5 files changed, 165 insertions(+), 151 deletions(-) create mode 100644 website_snippet_calendar/templates/assets.xml create mode 100644 website_snippet_calendar/templates/snippets.xml delete mode 100644 website_snippet_calendar/templates/website_snippet_calendar.xml diff --git a/website_snippet_calendar/__openerp__.py b/website_snippet_calendar/__openerp__.py index 2623816057..50a5a2b6a8 100644 --- a/website_snippet_calendar/__openerp__.py +++ b/website_snippet_calendar/__openerp__.py @@ -18,7 +18,8 @@ 'data': [ 'security/ir.model.access.csv', 'security/security.xml', - 'templates/website_snippet_calendar.xml', + 'templates/assets.xml', + 'templates/snippets.xml', ], 'installable': True, 'auto_install': False, diff --git a/website_snippet_calendar/static/src/js/website_snippet_calendar.js b/website_snippet_calendar/static/src/js/website_snippet_calendar.js index e5524658a9..8942d01ed5 100644 --- a/website_snippet_calendar/static/src/js/website_snippet_calendar.js +++ b/website_snippet_calendar/static/src/js/website_snippet_calendar.js @@ -1,126 +1,134 @@ /* Copyright 2017 Onestein * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ -(function () { - 'use strict'; - var website = openerp.website; - var _t = openerp._t; - website.ready().then(function () { - website.if_dom_contains('div.calendar_snippet', function ($el) { - var $calendar = $el.find('.calendar'); - $calendar.html(''); - var datejs_locale = "/web/static/lib/datejs/globalization/" + $('html').attr('lang').replace("_", "-") + ".js"; +odoo.define('website_snippet_calendar', function(require) { +'use strict'; - var all_filters = {}; - var color_map = {}; + var core = require('web.core'); + var time = require('web.time'); + var _t = core._t; - var get_color = function(key) { - if (color_map[key]) { - return color_map[key]; - } - var index = (((_.keys(color_map).length + 1) * 5) % 24) + 1; - color_map[key] = index; - return index; + $(document).ready(function() { + console.log(moment); + + //Reset + var $calendar = $('.s_calendar .calendar'); + $calendar.html(''); + + //Colors + var all_filters = {}; + var color_map = {}; + + var get_color = function(key) { + if (color_map[key]) { + return color_map[key]; } + var index = (((_.keys(color_map).length + 1) * 5) % 24) + 1; + color_map[key] = index; + return index; + } - $.getScript(datejs_locale, function(data) { - var shortTimeformat = Date.CultureInfo.formatPatterns.shortTime; - var dateFormat = Date.CultureInfo.formatPatterns.shortDate; - console.log(dateFormat); - $calendar.fullCalendar({ - events: function(start, end, callback) { - $.ajax({ - url: '/calendar_snippet/get_events/' + Math.round(start.getTime() / 1000) + '/' + Math.round(end.getTime() / 1000), - dataType: 'json', - success: function(result) { - //Setup colors - all_filters[0] = get_color(result.contacts[0]); - all_filters[-1] = get_color(-1); - _.each(result.contacts, function (c) { - if (!all_filters[c] && c != result.contacts[0]) { - all_filters[c] = get_color(c); - } - }); + //Get date format + var dateFormat = time.strftime_to_moment_format(_t.database.parameters.date_format); - //Mutate data for calendar - var events = result.events; - for(var i = 0; i < events.length; i++) { - events[i].start = Date.parseExact(events[i].start, "yyyy-MM-dd HH:mm:ss"); - events[i].end = Date.parseExact(events[i].end, "yyyy-MM-dd HH:mm:ss"); - var start_offset = events[i].start.getTimezoneOffset(); - var end_offset = events[i].end.getTimezoneOffset(); - start_offset = start_offset - (start_offset * 2); - end_offset = end_offset - (end_offset * 2); - events[i].start.addMinutes(start_offset); - events[i].end.addMinutes(end_offset); - - for(var j = 0; j < events[i].attendees.length; j++) { - events[i].title += ''; - if (all_filters[events[i].color] !== undefined) { - events[i].className = 'calendar_color_' + all_filters[events[i].color]; - } - else { - events[i].className = 'cal_opacity calendar_color_'+ all_filters[-1]; - } - } - } - callback(events); + var conversions = [['YYYY', 'yyyy'], ['YY', 'y'], ['DDDD', 'dddd'], ['DD', 'dd']]; + _.each(conversions, function(conv) { + dateFormat = dateFormat.replace(conv[0], conv[1]); + }); + + $calendar.fullCalendar({ + events: function(start, end, callback) { + $.ajax({ + url: '/calendar_snippet/get_events/' + Math.round(start.getTime() / 1000) + '/' + Math.round(end.getTime() / 1000), + dataType: 'json', + success: function(result) { + //Setup colors + all_filters[0] = get_color(result.contacts[0]); + all_filters[-1] = get_color(-1); + _.each(result.contacts, function (c) { + if (!all_filters[c] && c != result.contacts[0]) { + all_filters[c] = get_color(c); } }); - }, - weekNumberTitle: _t("W"), - allDayText: _t('All day'), - buttonText : { - today: _t("Today"), - month: _t("Month"), - week: _t("Week"), - day: _t("Day") - }, - aspectRatio: 1.8, - snapMinutes: 15, - weekMode : 'liquid', - columnFormat: { - month: 'ddd', - week: 'ddd ' + dateFormat, - day: 'dddd ' + dateFormat, - }, - titleFormat: { - month: 'MMMM yyyy', - week: dateFormat + "{ '—'"+ dateFormat, - day: dateFormat, - }, - timeFormat : { - // for agendaWeek and agendaDay - agenda: shortTimeformat + '{ - ' + shortTimeformat + '}', // 5:00 - 6:30 - // for all other views - '': shortTimeformat.replace(/:mm/,'(:mm)') // 7pm - }, - axisFormat : shortTimeformat.replace(/:mm/,'(:mm)'), - weekNumbers: true, - monthNames: Date.CultureInfo.monthNames, - monthNamesShort: Date.CultureInfo.abbreviatedMonthNames, - dayNames: Date.CultureInfo.dayNames, - dayNamesShort: Date.CultureInfo.abbreviatedDayNames, - firstDay: Date.CultureInfo.firstDayOfWeek, - header: { - left: 'prev,next today', - center: 'title', - right: 'month,agendaWeek,agendaDay' - }, - eventAfterRender: function (event, element, view) { - if ((view.name !== 'month') && (((event.end-event.start)/60000)<=30)) { - //if duration is too small, we see the html code of img - var current_title = $(element.find('.fc-event-time')).text(); - var new_title = current_title.substr(0,current_title.indexOf("0?current_title.indexOf("'; + if (all_filters[events[i].color] !== undefined) { + events[i].className = 'calendar_color_' + all_filters[events[i].color]; + } + else { + events[i].className = 'cal_opacity calendar_color_'+ all_filters[-1]; + } + } } - }, - eventRender: function (event, element, view) { - element.find('.fc-event-title').html(event.title); - }, - }); - }); + callback(events); + } + }); + }, + weekNumberTitle: _t("W"), + allDayText: _t('All day'), + monthNames: moment.months(), + monthNamesShort: moment.monthsShort(), + dayNames: moment.weekdays(), + dayNamesShort: moment.weekdaysShort(), + firstDay: moment._locale._week.dow, + weekNumberCalculation: function(date) { + return moment(date).week(); + }, + weekNumbers: true, + titleFormat: { + month: 'MMMM yyyy', + week: "w", + day: dateFormat, + }, + titleFormat: { + month: 'MMMM yyyy', + week: "w", + day: dateFormat, + }, + columnFormat: { + month: 'ddd', + week: 'ddd ' + dateFormat, + day: 'dddd ' + dateFormat, + }, + weekMode : 'liquid', + snapMinutes: 15, + buttonText: { + today: _t("Today"), + month: _t("Month"), + week: _t("Week"), + day: _t("Day") + }, + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + eventAfterRender: function (event, element, view) { + if ((view.name !== 'month') && (((event.end-event.start)/60000)<=30)) { + //if duration is too small, we see the html code of img + var current_title = $(element.find('.fc-event-time')).text(); + var new_title = current_title.substr(0,current_title.indexOf("0?current_title.indexOf(" + + + + + + + \ No newline at end of file diff --git a/website_snippet_calendar/templates/snippets.xml b/website_snippet_calendar/templates/snippets.xml new file mode 100644 index 0000000000..5fef5ebe35 --- /dev/null +++ b/website_snippet_calendar/templates/snippets.xml @@ -0,0 +1,25 @@ + + + + + + + + + + \ No newline at end of file diff --git a/website_snippet_calendar/templates/website_snippet_calendar.xml b/website_snippet_calendar/templates/website_snippet_calendar.xml deleted file mode 100644 index 2185d5e6dd..0000000000 --- a/website_snippet_calendar/templates/website_snippet_calendar.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - \ No newline at end of file From 0f9f8e540c67d48ba1af55b1c5be6fe61e1d7eea Mon Sep 17 00:00:00 2001 From: tarteo Date: Tue, 31 Jan 2017 11:01:57 +0100 Subject: [PATCH 06/16] [MIG] Colors of events --- .../static/src/js/website_snippet_calendar.js | 18 ++++++++------ .../src/less/website_snippet_calendar.less | 24 +++++++++++++++++++ website_snippet_calendar/templates/assets.xml | 2 +- 3 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 website_snippet_calendar/static/src/less/website_snippet_calendar.less diff --git a/website_snippet_calendar/static/src/js/website_snippet_calendar.js b/website_snippet_calendar/static/src/js/website_snippet_calendar.js index 8942d01ed5..a6f82a2e83 100644 --- a/website_snippet_calendar/static/src/js/website_snippet_calendar.js +++ b/website_snippet_calendar/static/src/js/website_snippet_calendar.js @@ -47,7 +47,7 @@ odoo.define('website_snippet_calendar', function(require) { all_filters[0] = get_color(result.contacts[0]); all_filters[-1] = get_color(-1); _.each(result.contacts, function (c) { - if (!all_filters[c] && c != result.contacts[0]) { + if (!all_filters[c]/* && c != result.contacts[0]*/) { all_filters[c] = get_color(c); } }); @@ -66,13 +66,17 @@ odoo.define('website_snippet_calendar', function(require) { for(var j = 0; j < events[i].attendees.length; j++) { events[i].title += ''; - if (all_filters[events[i].color] !== undefined) { - events[i].className = 'calendar_color_' + all_filters[events[i].color]; - } - else { - events[i].className = 'cal_opacity calendar_color_'+ all_filters[-1]; - } } + + if (all_filters[events[i].color] !== undefined) { + //events[i].className = 'calendar_color_' + all_filters[events[i].color]; + events[i].className = 'calendar_color_'+ all_filters[events[i].color]; + } + else { + events[i].className = 'calendar_color_'+ all_filters[-1]; + } + console.log(events[i].className); + console.log(all_filters); } callback(events); } diff --git a/website_snippet_calendar/static/src/less/website_snippet_calendar.less b/website_snippet_calendar/static/src/less/website_snippet_calendar.less new file mode 100644 index 0000000000..a0738271a9 --- /dev/null +++ b/website_snippet_calendar/static/src/less/website_snippet_calendar.less @@ -0,0 +1,24 @@ +/* Copyright 2017 Onestein + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ + +@nb-calendar-colors: 24; + +.calendar { + .calendar_color_loop(@index) when (@index < @nb-calendar-colors+1) { + .calendar_color_@{index} { + color: #0D0D0D; + background-color: spin(rgb(255, 192, 192), 360/(@nb-calendar-colors+1) * @index); + border-color: spin(rgb(255, 192, 192), 360/(@nb-calendar-colors+1) * @index); + opacity: 0.7; + } + .calendar_color_loop(@index + 1); + } + .calendar_color_loop(1); +} + +.attendee_head { + float: right; + margin-left: 1px; + height: 23px; + width: 23px; +} \ No newline at end of file diff --git a/website_snippet_calendar/templates/assets.xml b/website_snippet_calendar/templates/assets.xml index 8063ae54e4..9b037eefd7 100644 --- a/website_snippet_calendar/templates/assets.xml +++ b/website_snippet_calendar/templates/assets.xml @@ -6,7 +6,7 @@