Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][MIG] web_widget_darkroom: Migrated to 10.0 #595

Merged
merged 4 commits into from
Oct 2, 2017
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
102 changes: 102 additions & 0 deletions web_widget_darkroom/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3

================================
DarkroomJS Image Editing for Web
================================

This module provides a `DarkroomJS`_ (v2.0.1) web widget for use with image
fields. It also adds a Darkroom button to the normal image widget, which can
be used to edit the image via Darkroom in a modal.

.. _DarkroomJS: https://github.com/MattKetmo/darkroomjs

The widget currently supports the following operations and can be extended to
allow others:

* Zoom and pan
* Rotate
* Crop
* Step back in history client-side (before save)

Usage
=====

After installing the module, you can use it in the following ways:

* Specify the ``darkroom`` widget when adding an image field to a view.
Configuration values can be provided using the ``options`` attribute::

<field name="image" widget="darkroom" options="{'minWidth': 100}"/>

The widget passes options directly through to DarkroomJS, which supports the
following:

* minWidth
* minHeight
* maxWidth
* maxHeight
* ratio (aspect ratio)
* backgroundColor

* Open a form view that contains an image in edit mode and hover over the
image widget. You should see a Darkroom button that can be clicked to open
the image in a Darkroom modal, where it can be edited and the changes can be
saved.

.. image:: /web_widget_darkroom/static/description/modal_screenshot_1.png
:alt: Darkroom Modal Screenshot 1
:class: img-thumbnail
:height: 260

.. image:: /web_widget_darkroom/static/description/modal_screenshot_2.png
:alt: Darkroom Modal Screenshot 2
:class: img-thumbnail col-xs-offset-1
:height: 260

Known Issues / Roadmap
======================

* Darkroom modals are currently not supported during record creation
* Fabric.js >= 1.70 is not currently supported by DarkroomJS
(`MattKetmo/darkroomjs#112 <https://github.com/MattKetmo/darkroomjs/issues/112>`_)

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. In
case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smash it by providing detailed and welcome
feedback.

Credits
=======

Images
------

* Odoo Community Association:
`Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Dave Lasley <[email protected]>
* Oleg Bulkin <[email protected]>
* Brent Hughes <[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.
5 changes: 5 additions & 0 deletions web_widget_darkroom/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from . import wizards
26 changes: 26 additions & 0 deletions web_widget_darkroom/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
# Copyright 2016-2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
'name': 'Web DarkroomJS Image Editing',
'summary': 'Provides web widget for image editing and adds it to standard'
' image widget as modal',
'version': '10.0.1.0.0',
'category': 'Web',
'website': 'https://laslabs.com/',
'author': 'LasLabs, Odoo Community Association (OCA)',
'license': 'LGPL-3',
'application': False,
'installable': True,
'depends': [
'web',
],
'data': [
'views/assets.xml',
'wizards/darkroom_modal.xml',
],
'qweb': [
'static/src/xml/field_templates.xml',
],
}
Binary file added web_widget_darkroom/static/description/icon.png
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading