diff --git a/website_event_excerpt_img/README.rst b/website_event_excerpt_img/README.rst new file mode 100644 index 000000000..80b7b6bbc --- /dev/null +++ b/website_event_excerpt_img/README.rst @@ -0,0 +1,120 @@ +.. 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 + +========================= +Excerpt + Image in Events +========================= + +This module extends the functionality of website events to support having a +more attractive layout that automatically displays an excerpt of each one, a +"Read more" button, and an image. + +It also adds a event priority control in the backend that will display the +event at the top and in a bigger shape in the website. + +Installation +============ + +To install this module, you need to: + +#. Install `OCA/server-tools `_. + +Configuration +============= + +To configure this module, you need to: + +#. Log in. +#. Go to `your website events page `_. +#. Open the *Customize* menu. +#. *Images and Description* should be checked, and you should see events with + an image and description in the layout. + +.. warning:: + Normal (not highlighted) events will show up a bit clunky if you do not + disable the *Filters* view from the *Customize* menu. + + You can either highlight all events, or disable that view. + + If you still need filters, see module ``website_event_filter_selector`` + found in this same repo. + +Usage +===== + +To use this module, you need to: + +#. Go to the events page in your website. They have image and description now. + +You will notice that short description is the excerpt of the first 80 +characters of the event's long description. If you want to set a manual +description, you need to: + +- From the frontend: + #. Click in that event. + #. Use the *Promote* tool to set a meta description. +- From the backend: + #. Go to *Marketing > Events > Events*. + #. Choose one. + #. Go to *Description*. + #. Use the *Website meta description* field for the same purpose. + +If you want to change the image, you need to: + +#. Edit the event page. +#. There, the first image appearing will be the one chosen. Beware, background + images count! + +If you want to set an event as important: + +#. Go to the event's form in backend. +#. Publish it. +#. Go to the *Description* tab. +#. Add a star in *Priority* to display the event in a full row on website. +#. Remove the star to display it in half a row. + +.. 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 +------------ + +* Rafael Blasco +* Jairo Llopis + +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_event_excerpt_img/__init__.py b/website_event_excerpt_img/__init__.py new file mode 100644 index 000000000..38cf175f0 --- /dev/null +++ b/website_event_excerpt_img/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Tecnativa - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/website_event_excerpt_img/__openerp__.py b/website_event_excerpt_img/__openerp__.py new file mode 100644 index 000000000..5731f9ea7 --- /dev/null +++ b/website_event_excerpt_img/__openerp__.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Tecnativa - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Excerpt + Image in Events", + "summary": "New layout for event summary, including an excerpt and image", + "version": "8.0.1.0.0", + "category": "Website", + "website": "https://www.tecnativa.com", + "author": "Antiun Ingeniería S.L., Tecnativa, " + "Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "website_event", + "html_image_url_extractor", + "html_text", + ], + "data": [ + "views/assets.xml", + "views/event.xml", + "views/event_event_view.xml", + ], + "images": [ + "images/frontend.png", + "images/backend.png", + "images/customize.png", + ], +} diff --git a/website_event_excerpt_img/i18n/es.po b/website_event_excerpt_img/i18n/es.po new file mode 100644 index 000000000..5ff29f418 --- /dev/null +++ b/website_event_excerpt_img/i18n/es.po @@ -0,0 +1,23 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_event_excerpt_img +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-22 16:51+0000\n" +"PO-Revision-Date: 2016-03-22 17:53+0100\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: \n" +"Language: es\n" +"X-Generator: Poedit 1.8.7.1\n" + +#. module: website_event_excerpt_img +#: view:event.event:website_event_excerpt_img.view_event_form +msgid "Short description of about 155 characters..." +msgstr "Descripción corta de unos 155 caracteres..." diff --git a/website_event_excerpt_img/images/backend.png b/website_event_excerpt_img/images/backend.png new file mode 100644 index 000000000..866ad6fd9 Binary files /dev/null and b/website_event_excerpt_img/images/backend.png differ diff --git a/website_event_excerpt_img/images/customize.png b/website_event_excerpt_img/images/customize.png new file mode 100644 index 000000000..5347635cd Binary files /dev/null and b/website_event_excerpt_img/images/customize.png differ diff --git a/website_event_excerpt_img/images/frontend.png b/website_event_excerpt_img/images/frontend.png new file mode 100644 index 000000000..d13472b73 Binary files /dev/null and b/website_event_excerpt_img/images/frontend.png differ diff --git a/website_event_excerpt_img/models/__init__.py b/website_event_excerpt_img/models/__init__.py new file mode 100644 index 000000000..a8da57e85 --- /dev/null +++ b/website_event_excerpt_img/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Tecnativa - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import event diff --git a/website_event_excerpt_img/models/event.py b/website_event_excerpt_img/models/event.py new file mode 100644 index 000000000..3c527a856 --- /dev/null +++ b/website_event_excerpt_img/models/event.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 Tecnativa - Jairo Llopis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class EventEvent(models.Model): + _inherit = "event.event" + + priority = fields.Selection( + [("0", "Normal"), ("1", "Highlighted")], + required=True, + default="0", + help="Importance of the event, as shown in website (if enabled).") diff --git a/website_event_excerpt_img/static/description/icon.png b/website_event_excerpt_img/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/website_event_excerpt_img/static/description/icon.png differ diff --git a/website_event_excerpt_img/static/src/css/website_event_excerpt_img.css b/website_event_excerpt_img/static/src/css/website_event_excerpt_img.css new file mode 100644 index 000000000..dda381a47 --- /dev/null +++ b/website_event_excerpt_img/static/src/css/website_event_excerpt_img.css @@ -0,0 +1,12 @@ +@charset "UTF-8"; +/* Copyright 2016 Tecnativa - Jairo Llopis + * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */ +#website_event_excerpt_img .event-thumbnail .img { + height: 8em; + width: 100%; + object-fit: cover; + object-position: center; } +#website_event_excerpt_img .event-priority-highlighted .event-thumbnail .img { + height: 16em; } + +/*# sourceMappingURL=website_event_excerpt_img.css.map */ diff --git a/website_event_excerpt_img/static/src/css/website_event_excerpt_img.css.map b/website_event_excerpt_img/static/src/css/website_event_excerpt_img.css.map new file mode 100644 index 000000000..c6b006b13 --- /dev/null +++ b/website_event_excerpt_img/static/src/css/website_event_excerpt_img.css.map @@ -0,0 +1,7 @@ +{ +"version": 3, +"mappings": ";;;AAOQ,gDAAI;EACA,MAAM,EAAE,GAAG;EACX,KAAK,EAAE,IAAI;EAEP,UAAG,EAAE,KAAK;EACV,eAAQ,EAAE,MAAM;AAKpB,4EAAI;EACA,MAAM,EAAE,IAAI", +"sources": ["website_event_excerpt_img.sass"], +"names": [], +"file": "website_event_excerpt_img.css" +} \ No newline at end of file diff --git a/website_event_excerpt_img/static/src/css/website_event_excerpt_img.sass b/website_event_excerpt_img/static/src/css/website_event_excerpt_img.sass new file mode 100644 index 000000000..3c632d3d8 --- /dev/null +++ b/website_event_excerpt_img/static/src/css/website_event_excerpt_img.sass @@ -0,0 +1,19 @@ +@charset "UTF-8" +/* Copyright 2016 Tecnativa - Jairo Llopis + License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +#website_event_excerpt_img + // Any thumbnail + .event-thumbnail + .img + height: 8em + width: 100% + object: + fit: cover + position: center + + // Highlighted thumbnails + .event-priority-highlighted + .event-thumbnail + .img + height: 16em diff --git a/website_event_excerpt_img/views/assets.xml b/website_event_excerpt_img/views/assets.xml new file mode 100644 index 000000000..ae7f22337 --- /dev/null +++ b/website_event_excerpt_img/views/assets.xml @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/website_event_excerpt_img/views/event.xml b/website_event_excerpt_img/views/event.xml new file mode 100644 index 000000000..a38445649 --- /dev/null +++ b/website_event_excerpt_img/views/event.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + diff --git a/website_event_excerpt_img/views/event_event_view.xml b/website_event_excerpt_img/views/event_event_view.xml new file mode 100644 index 000000000..5ff9e1c95 --- /dev/null +++ b/website_event_excerpt_img/views/event_event_view.xml @@ -0,0 +1,32 @@ + + + + + + + + Show meta description + event.event + + + + + + + + + + + + +