Skip to content

Commit d59af25

Browse files
hughesbmlasley
authored andcommitted
[MIG] web_widget_slick: Migrate to v10
* Add local slick files to use instead of CDN * Override CSS to display widget correctly * Adjust arrow button size/placement * Bump version * Rename __openerp__.py -> __manifest__.py * Rename widget_slick.js -> web_widget_slick.js * Update copyright, license (AGPL -> LGPL) * Update readme * Correct eslint errors * Change module name in various places for consistency * Improve styling of widget arrows, dots * Change css -> less * Remove unneeded slick files * Copyright 2017 -> 2016-2017 * Add OCA to authors * Use OCA icon * Fix readme * Clean up assets * Fix file permissions * Update readme with reference to example module * Fix formatting error, incorrect link * Add javascript tests * Add note to readme about functional testing with example module * Fix/cleanup javascript * Fix destroy_content() method * Move slide navigation out of slide addition loop * Remove unused variables * Remove unneeded DOM append * Reorganize files/directories * Adjust template tags (templates -> template) * Add slick-field class to field template instead of using jQuery * Misc cleanup * Adjust breakpoint settings to show fewer images by default * Enable adaptiveHeight by default * Add .img and .img-responsive classes to images * Fix dragging issues by preventing default mousedown and touchstart event behavior * Set swipeToSlide default to true * Change how slick slides are populated to allow grid mode * Fix issue causing carousel images to display improperly in some situations * Add better functional testing instructions to readme * Add roadmap to readme * Make minor styling changes * Fix issue with template loading w/ PhantomJS * Clean up template, use css class provided by widget * Remove unneeded dependency from tests * Break up render_value method * Break up destroy_content method * Add unslicking to destroy_content, add test * Clean up qweb template formatting * Fix indentation * Change widget name * Add Slick copyright information * Add padding left/right, move arrows in to avoid clipping when widget not in a sheet tag * Apply dot and arrow styles only when needed * Add _resizeCarousel() and related methods to ensure accurate carousel sizing in various views * Resize carousel on core.bus resize * Account for differences in group layouts and labels, sheet/no-sheet layouts * Adjust, clean up less * Clean up js
1 parent ec343b6 commit d59af25

21 files changed

+3975
-12944
lines changed

web_widget_slick/README.rst

+59-17
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg
2-
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
3-
:alt: License: AGPL-3
1+
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
2+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
3+
:alt: License: LGPL-3
44

5-
=================
6-
Odoo Slick Widget
7-
=================
8-
9-
This module provides a Slick Carousel widget for use in Odoo.
5+
=====================
6+
Slick Carousel Widget
7+
=====================
108

9+
This module provides a Slick Carousel widget for use in the Odoo backend web interface.
1110

1211
Usage
1312
=====
@@ -23,16 +22,14 @@ Default usage is on a One2many attachment field, as defined below::
2322
inverse_name='res_id',
2423
)
2524

26-
Assuming the above model, you would use add a Slick Carousel on the
25+
Assuming the above model, you would add a Slick Carousel on the
2726
``image_ids`` column by using the following field definition in the
2827
model's form view::
2928

3029
<field name="image_ids" widget="one2many_slick_images" options="{}"/>
3130

32-
Example implementation - https://repo.laslabs.com/projects/ODOO/repos/web/browse/web_widget_slick_example
33-
3431
Options
35-
=======
32+
-------
3633

3734
The widget passes options directly through to Slick, so any `setting
3835
available to Slick`_ is available to the widget. Additional options
@@ -48,25 +45,70 @@ specific to Odoo are:
4845

4946
.. _setting available to Slick: http://kenwheeler.github.io/slick/#settings
5047

48+
Example Module
49+
--------------
50+
51+
An example implementation, for instructional purposes as well as convenient
52+
functional testing, is provided in the `web_widget_slick_example` module.
53+
54+
* Install `web_widget_slick_example`.
55+
* Activate Developer Mode.
56+
* Go to Settings / Technical / Slick, and open the record to view the widget.
57+
58+
To try out different Slick settings:
59+
60+
* Go to Settings/User Interface/Views and search for 'slick.example.view.form'.
61+
* Open the form view record.
62+
* Click the Edit button.
63+
* In the Architecture editor, find `options="{'slidesToShow': 2}`, and add
64+
any desired settings (separated by commas) inside the curly braces.
65+
* Save the changes and browse to the widget, as described above, to see the
66+
widget with the new settings in effect.
67+
68+
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
69+
:alt: Try me on Runbot
70+
:target: https://runbot.odoo-community.org/runbot/162/10.0
71+
72+
Known issues / Roadmap
73+
======================
74+
75+
* Adding / Deleting images from a carousel is not currently supported.
76+
77+
Bug Tracker
78+
===========
79+
80+
Bugs are tracked on `GitHub Issues
81+
<https://github.com/OCA/web/issues>`_. In case of trouble, please
82+
check there if your issue has already been reported. If you spotted it first,
83+
help us smash it by providing detailed and welcomed feedback.
5184

5285
Credits
5386
=======
5487

5588
Images
5689
------
5790

58-
* LasLabs: `Icon <https://repo.laslabs.com/projects/TEM/repos/odoo-module_template/browse/module_name/static/description/icon.svg?raw>`_.
91+
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
5992

6093
Contributors
6194
------------
6295

6396
* Dave Lasley <[email protected]>
97+
* Brent Hughes <[email protected]>
98+
99+
Do not contact contributors directly about support or help with technical issues.
64100

65101
Maintainer
66102
----------
67103

68-
.. image:: https://laslabs.com/logo.png
69-
:alt: LasLabs Inc.
70-
:target: https://laslabs.com
104+
.. image:: https://odoo-community.org/logo.png
105+
:alt: Odoo Community Association
106+
:target: https://odoo-community.org
107+
108+
This module is maintained by the OCA.
109+
110+
OCA, or the Odoo Community Association, is a nonprofit organization whose
111+
mission is to support the collaborative development of Odoo features and
112+
promote its widespread use.
71113

72-
This module is maintained by LasLabs Inc.
114+
To contribute to this module, please visit https://odoo-community.org.

web_widget_slick/__init__.py

100755100644
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
2-
# © 2016-TODAY LasLabs Inc.
3-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
# Copyright 2016-2017 LasLabs Inc.
3+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

web_widget_slick/__manifest__.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2016-2017 LasLabs Inc.
3+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
4+
5+
{
6+
"name": "Slick Carousel Widget",
7+
"summary": "Adds SlickJS slider widget for use as a carousel on Many2one"
8+
" attachment fields in backend form views.",
9+
"version": "10.0.1.0.0",
10+
"category": "Web",
11+
"website": "https://laslabs.com/",
12+
"author": "LasLabs, Odoo Community Association (OCA)",
13+
"license": "LGPL-3",
14+
"application": False,
15+
"installable": True,
16+
"depends": [
17+
"web",
18+
],
19+
"data": [
20+
"templates/assets.xml",
21+
],
22+
"qweb": [
23+
"static/src/xml/web_widget_slick.xml",
24+
],
25+
}

web_widget_slick/__openerp__.py

-25
This file was deleted.

web_widget_slick/static/description/icon.png

100755100644
-864 Bytes
Loading

0 commit comments

Comments
 (0)