-
-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
265 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
.. 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 | ||
|
||
================================== | ||
Multi images for events in website | ||
================================== | ||
|
||
This module extends the functionality of website events to support having a | ||
thumbnail in events list and an image gallery per event displayed as a carousel | ||
at the bottom of the page, and allows you to choose which of those | ||
customizations you want applied. | ||
|
||
Installation | ||
============ | ||
|
||
To install this module, you need to: | ||
|
||
* Install `OCA/server-tools <https://github.com/OCA/server-tools/>`_. | ||
|
||
Configuration | ||
============= | ||
|
||
To disable the thumbnail in the events list, you need to: | ||
|
||
#. Log in. | ||
#. Go to `the events list </event>`_. | ||
#. Uncheck *Customize > Event thumbnail in list*. | ||
|
||
To choose the placement of the carousel gallery in events, you need to: | ||
|
||
#. Log in. | ||
#. Go to `the events list </event>`_. | ||
#. Enter any event. | ||
#. Check any of *Customize > ...* | ||
- *Carousel gallery at top*. | ||
- *Carousel gallery at bottom*. | ||
- *Carousel gallery at right*. | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Go to event management backend. | ||
#. Add any number of images to any event. | ||
#. Publish it. | ||
#. Go to its website page and scroll to the bottom to see the carousel gallery. | ||
|
||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas | ||
:alt: Try me on Runbot | ||
:target: https://runbot.odoo-community.org/runbot/199/8.0 | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues | ||
<https://github.com/OCA/event/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 | ||
<https://github.com/OCA/ | ||
event/issues/new?body=module:%20 | ||
website_event_multi_image%0Aversion:%20 | ||
8.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Rafael Blasco <rafael.blasco@tecnativa.com> | ||
* Jairo Llopis <jairo.llopis@tecnativa.com> | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Jairo Llopis <jairo.llopis@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Multi images for events in website", | ||
"summary": "Show a gallery of images per event in their website", | ||
"version": "8.0.1.0.0", | ||
"category": "Event Management", | ||
"website": "http://www.tecnativa.com", | ||
"author": "Antiun Ingeniería S.L., " | ||
"Tecnativa, " | ||
"Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"application": False, | ||
"installable": True, | ||
"depends": [ | ||
"event_multi_image", | ||
"website_event", | ||
"website_multi_image", | ||
], | ||
"data": [ | ||
"security/ir_rule.yml", | ||
"security/ir.model.access.csv", | ||
"views/event_templates.xml", | ||
], | ||
"images": [ | ||
"images/carousel.png", | ||
"images/thumbnail.png", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * event_multi_image | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2016-02-04 17:25+0000\n" | ||
"PO-Revision-Date: 2016-02-04 18:26+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.5\n" | ||
|
||
#. module: event_multi_image | ||
#: model:ir.model,name:event_multi_image.model_event_event | ||
msgid "Event" | ||
msgstr "Evento" | ||
|
||
#. module: event_multi_image | ||
#: view:event.event:event_multi_image.view_event_form | ||
#: field:event.event,image_ids:0 | ||
msgid "Images" | ||
msgstr "Imágenes" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Jairo Llopis <jairo.llopis@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Jairo Llopis <jairo.llopis@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp import api, fields, models | ||
|
||
|
||
class MultiImage(models.Model): | ||
_inherit = "base_multi_image.image" | ||
|
||
event_published = fields.Boolean( | ||
compute="_compute_event_published", | ||
store=True, | ||
) | ||
|
||
@api.multi | ||
@api.depends("owner_model", "owner_id") | ||
def _compute_event_published(self): | ||
"""Know if this image is from a published event.""" | ||
for s in self: | ||
if s.owner_model == "event.event": | ||
s.event_published = (self.env[s.owner_model].sudo() | ||
.browse(s.owner_id).published) | ||
else: | ||
s.event_published = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
public_image_access,Allow public to read published event images,base_multi_image.model_base_multi_image_image,base.group_public,1,0,0,0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Jairo Llopis <jairo.llopis@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
- !record {model: ir.rule, id: public_image_rule}: | ||
name: Public only sees images of published events | ||
model_id: base_multi_image.model_base_multi_image_image | ||
domain_force: [("event_published", "=", True)] | ||
groups: | ||
- base.group_public |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- © 2016 Antiun Ingeniería S.L. - Jairo Llopis | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> | ||
|
||
<openerp> | ||
<data> | ||
|
||
<template id="index" | ||
inherit_id="website_event.index" | ||
name="Event thumbnail in list" | ||
customize_show="True" | ||
active="True"> | ||
<xpath expr="//div[@class='media-body']" position="before"> | ||
<div t-if="event.image_main_medium" class="pull-right"> | ||
<a t-attf-href="/event/#{slug(event)}"> | ||
<img | ||
t-att-src="website.image_url(event, 'image_main_medium')" | ||
t-att-alt="event.display_name" | ||
class="media-object"/> | ||
</a> | ||
</div> | ||
</xpath> | ||
</template> | ||
|
||
<template id="gallery_top" | ||
inherit_id="website_event.event_description_full" | ||
name="Carousel gallery at top" | ||
customize_show="True" | ||
active="False"> | ||
<xpath expr="//div[@t-field='event.description']" position="before"> | ||
<h2>Image Gallery</h2> | ||
<t t-call="website_multi_image.carousel"> | ||
<t t-set="multi_image_owner" t-value="event"/> | ||
</t> | ||
</xpath> | ||
</template> | ||
|
||
<template id="gallery_bottom" | ||
inherit_id="website_event.event_description_full" | ||
name="Carousel gallery at bottom" | ||
customize_show="True" | ||
active="False"> | ||
<xpath expr="//div[@t-field='event.description']" position="after"> | ||
<h2>Image Gallery</h2> | ||
<t t-call="website_multi_image.carousel"> | ||
<t t-set="multi_image_owner" t-value="event"/> | ||
</t> | ||
</xpath> | ||
</template> | ||
|
||
<template id="gallery_right" | ||
inherit_id="website_event.event_description_full" | ||
name="Carousel gallery at right column" | ||
customize_show="True" | ||
active="False"> | ||
<xpath expr="//div[@class='col-md-4 css_noprint']" position="inside"> | ||
<div class="panel panel-default" t-if="event.address_id"> | ||
<div class="panel-heading"> | ||
<h4>Image Gallery</h4> | ||
</div> | ||
<div class="panel-body"> | ||
<t t-call="website_multi_image.carousel"> | ||
<t t-set="multi_image_owner" t-value="event"/> | ||
</t> | ||
</div> | ||
</div> | ||
</xpath> | ||
</template> | ||
|
||
</data> | ||
</openerp> |