Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions website_multi_image/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

====================
Multiple images base
====================

This module extends the functionality of ``base_multi_image`` and provides some
technical tools useful to combine it with ``website``.

Basically, it provides reusable templates for objects owning multiple images.

Installation
============

This module adds no visible behavior, just some reusable tools for developers.
It will be automatically installed if any other module you have needs those
tools, but otherwise you probably don not need it.

Development
===========

To develop a module based on this one:

* See module ``website_event_multi_image`` as an example.
* ``t-call`` the provided templates in frontend website views:
* ``website_multi_image.carousel``: outputs a carousel for images.

.. 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
<https://github.com/OCA/website/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/
website/issues/new?body=module:%20
website_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 <[email protected]>
* Jairo Llopis <[email protected]>

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.
Empty file added website_multi_image/__init__.py
Empty file.
23 changes: 23 additions & 0 deletions website_multi_image/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# © 2015 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Multiple Images in Website",
"summary": "Templates to display multiple images in website views",
"version": "8.0.1.0.0",
"author": "Antiun Ingeniería, S.L., "
"Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "http://www.antiun.com",
"category": "Hidden",
"depends": [
"base_multi_image",
"website",
],
'installable': True,
"data": [
"views/assets.xml",
"views/owner_templates.xml",
],
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
344 changes: 344 additions & 0 deletions website_multi_image/static/description/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions website_multi_image/static/src/css/website_multi_image.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions website_multi_image/static/src/css/website_multi_image.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@charset "utf-8"
/* © 2016 Antiun Ingeniería S.L. - Jairo Llopis
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

#multi_image_carousel
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commented or is the notation for sass files?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad highlighter.

.item
height: 400px
background-position: center
16 changes: 16 additions & 0 deletions website_multi_image/views/assets.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="assets_frontend" inherit_id="website.assets_frontend">
<xpath expr=".">
<link rel="stylesheet"
href="/website_multi_image/static/src/css/website_multi_image.css"/>
</xpath>
</template>

</data>
</openerp>
54 changes: 54 additions & 0 deletions website_multi_image/views/owner_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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>

<!-- Call this template in your owner's website page to get a carousel.
It needs a `multi_image_owner` variable set. -->
<template id="carousel">
<div id="multi_image_carousel"
t-if="multi_image_owner.image_ids"
class="carousel slide mb32">

<!-- Indicators -->
<ol class="carousel-indicators">
<t t-foreach="multi_image_owner.image_ids" t-as="image">
<li data-target="#multi_image_carousel"
data-slide-to="0"
t-att-class="'active' if image_first else None"/>
</t>
</ol>

<!-- Slides -->
<div class="carousel-inner">
<t t-foreach="multi_image_owner.image_ids" t-as="image">
<div
t-attf-class="item #{'active' if image_first else ''}"
t-attf-style="background-image: url('#{website.image_url(image, 'image_main')}')">
<div class="carousel-caption">
<h3 t-esc="image.display_name"/>
</div>
</div>
</t>
</div>

<!-- Controls -->
<div
class="carousel-control left"
data-target="#multi_image_carousel"
data-slide="prev">
<i class="fa fa-chevron-left"/>
</div>
<div
class="carousel-control right"
data-target="#multi_image_carousel"
data-slide="next">
<i class="fa fa-chevron-right"/>
</div>
</div>
</template>

</data>
</openerp>