odoo14-addon-cms-status-message


Nameodoo14-addon-cms-status-message JSON
Version 14.0.1.0.1.dev4 PyPI version JSON
download
home_pagehttps://github.com/OCA/website-cms
SummaryBasic status messages for your CMS system
upload_time2025-02-07 08:12:09
maintainerNone
docs_urlNone
authorCamptocamp, Odoo Community Association (OCA)
requires_python>=3.6
licenseLGPL-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ==================
CMS status message
==================

.. 
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! This file is generated by oca-gen-addon-readme !!
   !! changes will be overwritten.                   !!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !! source digest: sha256:91b38597ea2967187778e5b779ed0a60aa6bd6cfec03a3d91fcdd46c7cdaccf5
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
    :target: https://odoo-community.org/page/development-status
    :alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
    :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite--cms-lightgray.png?logo=github
    :target: https://github.com/OCA/website-cms/tree/14.0/cms_status_message
    :alt: OCA/website-cms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
    :target: https://translation.odoo-community.org/projects/website-cms-14-0/website-cms-14-0-cms_status_message
    :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
    :target: https://runboat.odoo-community.org/builds?repo=OCA/website-cms&target_branch=14.0
    :alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

A "status message" is an important message that you want to show to
users.

For instance: a user submit a form or does a specific action and you
want to report the status of this action like "your profile has been
updated" or "Your upgrade has been successful.".

This module allows to easily display this kind of messages to your
users.

Messages are displayed using Twitter bootstrap alerts.

You can add several messages: they will be displayed one after another.

**Table of contents**

.. contents::
   :local:

Usage
=====

Python code
~~~~~~~~~~~

Set a message:

.. code:: python

    msg = _('My important message.')
    env["ir.http"].add_status_message(msg)

By default the message type is ``info``. The title (the label at the
beginning of the message) matches the message type:

-  'info': 'Info'
-  'success': 'Success'
-  'danger': 'Error'
-  'warning': 'Warning'

You can change message parameters:

.. code:: python

    msg = _('Watch out!')
    env["ir.http"].add_status_message(msg, kind='warning', title='Oh no')

Messages will be displayed like this:

.. image:: https://raw.githubusercontent.com/OCA/website-cms/14.0/cms_status_message/images/preview.png

Autodismiss
~~~~~~~~~~~

By default messages will be auto-dismissed after 8 seconds.
You can turn this off by setting an ir.config_param like::

    cms_status_message.autodismiss = 0

You can customize the timeout by setting the key::

    cms_status_message.autodismiss_timeout = 3000  # milliseconds


You can also customize this on demand when you create the message:


.. code:: python

    msg = _('I will disappear more slowly')
    options = {'autodismissTimeout': 10000}
    env["ir.http"].add_status_message(msg, dismiss_options=options)


Javascript code
~~~~~~~~~~~~~~~

Dependencies:

FIXME v16

.. code:: javascript


    var msg_tool = require('cms_status_message.tool');
    var core = require('web.core');
    var _t = core._t;

Inject a custom message on the fly:

.. code:: javascript

    msg = {
        'msg': _t('Item unpublished.'),
        'title': _t('Warning'),
        'type': 'warning'
    }
    msg_tool.render_messages(msg).then(function(html) {
        // wipe existing
        $('.status_message').remove();
        // inject new
        $(html).hide().prependTo('#wrap').fadeIn('slow');
    });


Add a status message to the session, useful if you want to show the
message only after a redirect:

.. code:: javascript

    var msg =  _t('Contratulations! You made it!.');
    var options = {'title': _('My title'), 'dismissible': false};
    msg_tool.add_message(msg, options);

Customize appereance
~~~~~~~~~~~~~~~~~~~~

By default the alert box is added on top of ``<main />`` content. If you
want to customize this behavior just override or disable
``cms_status_message.add_status_message`` template.


Test your theme look and feel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Go to `/cms/status-message/display-test` to see how messages will look like
when your theme is applied.

Changelog
=========

16.0.1.0.0 (2023-05-13)
~~~~~~~~~~~~~~~~~~~~~~~

**Features**

- Migration to v16 (`#127 <https://github.com/OCA/website-cms/issues/127>`_)
- Get rid of `website` dependency


13.0.1.0.1 (2021-08-23)
~~~~~~~~~~~~~~~~~~~~~~~

**Features**

- Migration to v13 (`#111 <https://github.com/OCA/website-cms/issues/111>`_)


11.0.1.3.0 (2018-08-07)
~~~~~~~~~~~~~~~~~~~~~~~

**Improvements**

* Get rid of example package

  The example package was there only to show how a message would look like.
  But in real life you want always to verify how they look like
  with your theme styles applied.

  Now we have a new route `/cms/status-message/display-test` to check them.
  `cms_status_message_example` module has been removed.


11.0.1.2.0 (2018-08-07)
~~~~~~~~~~~~~~~~~~~~~~~

**Improvements**

* Add auto-dimiss option

  By default messages will be auto-dismissed after 8 seconds.
  You can turn this off by setting an ir.config_param like::

    cms_status_message.autodismiss = 0

  You can customize the timeout by setting the key::

    cms_status_message.autodismiss_timeout = 3000  # milliseconds

  Check README for further info.


11.0.1.1.0 (2018-04-22)
~~~~~~~~~~~~~~~~~~~~~~~

**Improvements**

* Improve JS API

  1. load qweb template on demand
  2. load qweb template only if not loaded yet
  3. use promises for rendering

  We load qweb templates via JS.
  Prior to this change we got 1 request every time,
  on every page load per each template,
  even if we were not using any status message feature.

  Now we load templates only when needed
  and we load them only if not loaded yet,
  lowering page load time a bit :)

  Plus, rendering now returns a promise object so you can chain calls
  and do things when rendering is really finished.


11.0.1.0.0 (2018-01-18)
~~~~~~~~~~~~~~~~~~~~~~~

Upgrade to v11

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/website-cms/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/website-cms/issues/new?body=module:%20cms_status_message%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Camptocamp

Contributors
~~~~~~~~~~~~

* Simone Orsi <simone.orsi@camptocamp.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: https://odoo-community.org

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.

.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px
    :target: https://github.com/simahawk
    :alt: simahawk

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-simahawk| 

This module is part of the `OCA/website-cms <https://github.com/OCA/website-cms/tree/14.0/cms_status_message>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/OCA/website-cms",
    "name": "odoo14-addon-cms-status-message",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Camptocamp, Odoo Community Association (OCA)",
    "author_email": "support@odoo-community.org",
    "download_url": null,
    "platform": null,
    "description": "==================\nCMS status message\n==================\n\n.. \n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! This file is generated by oca-gen-addon-readme !!\n   !! changes will be overwritten.                   !!\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n   !! source digest: sha256:91b38597ea2967187778e5b779ed0a60aa6bd6cfec03a3d91fcdd46c7cdaccf5\n   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n    :target: https://odoo-community.org/page/development-status\n    :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png\n    :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html\n    :alt: License: LGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite--cms-lightgray.png?logo=github\n    :target: https://github.com/OCA/website-cms/tree/14.0/cms_status_message\n    :alt: OCA/website-cms\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n    :target: https://translation.odoo-community.org/projects/website-cms-14-0/website-cms-14-0-cms_status_message\n    :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png\n    :target: https://runboat.odoo-community.org/builds?repo=OCA/website-cms&target_branch=14.0\n    :alt: Try me on Runboat\n\n|badge1| |badge2| |badge3| |badge4| |badge5|\n\nA \"status message\" is an important message that you want to show to\nusers.\n\nFor instance: a user submit a form or does a specific action and you\nwant to report the status of this action like \"your profile has been\nupdated\" or \"Your upgrade has been successful.\".\n\nThis module allows to easily display this kind of messages to your\nusers.\n\nMessages are displayed using Twitter bootstrap alerts.\n\nYou can add several messages: they will be displayed one after another.\n\n**Table of contents**\n\n.. contents::\n   :local:\n\nUsage\n=====\n\nPython code\n~~~~~~~~~~~\n\nSet a message:\n\n.. code:: python\n\n    msg = _('My important message.')\n    env[\"ir.http\"].add_status_message(msg)\n\nBy default the message type is ``info``. The title (the label at the\nbeginning of the message) matches the message type:\n\n-  'info': 'Info'\n-  'success': 'Success'\n-  'danger': 'Error'\n-  'warning': 'Warning'\n\nYou can change message parameters:\n\n.. code:: python\n\n    msg = _('Watch out!')\n    env[\"ir.http\"].add_status_message(msg, kind='warning', title='Oh no')\n\nMessages will be displayed like this:\n\n.. image:: https://raw.githubusercontent.com/OCA/website-cms/14.0/cms_status_message/images/preview.png\n\nAutodismiss\n~~~~~~~~~~~\n\nBy default messages will be auto-dismissed after 8 seconds.\nYou can turn this off by setting an ir.config_param like::\n\n    cms_status_message.autodismiss = 0\n\nYou can customize the timeout by setting the key::\n\n    cms_status_message.autodismiss_timeout = 3000  # milliseconds\n\n\nYou can also customize this on demand when you create the message:\n\n\n.. code:: python\n\n    msg = _('I will disappear more slowly')\n    options = {'autodismissTimeout': 10000}\n    env[\"ir.http\"].add_status_message(msg, dismiss_options=options)\n\n\nJavascript code\n~~~~~~~~~~~~~~~\n\nDependencies:\n\nFIXME v16\n\n.. code:: javascript\n\n\n    var msg_tool = require('cms_status_message.tool');\n    var core = require('web.core');\n    var _t = core._t;\n\nInject a custom message on the fly:\n\n.. code:: javascript\n\n    msg = {\n        'msg': _t('Item unpublished.'),\n        'title': _t('Warning'),\n        'type': 'warning'\n    }\n    msg_tool.render_messages(msg).then(function(html) {\n        // wipe existing\n        $('.status_message').remove();\n        // inject new\n        $(html).hide().prependTo('#wrap').fadeIn('slow');\n    });\n\n\nAdd a status message to the session, useful if you want to show the\nmessage only after a redirect:\n\n.. code:: javascript\n\n    var msg =  _t('Contratulations! You made it!.');\n    var options = {'title': _('My title'), 'dismissible': false};\n    msg_tool.add_message(msg, options);\n\nCustomize appereance\n~~~~~~~~~~~~~~~~~~~~\n\nBy default the alert box is added on top of ``<main />`` content. If you\nwant to customize this behavior just override or disable\n``cms_status_message.add_status_message`` template.\n\n\nTest your theme look and feel\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nGo to `/cms/status-message/display-test` to see how messages will look like\nwhen your theme is applied.\n\nChangelog\n=========\n\n16.0.1.0.0 (2023-05-13)\n~~~~~~~~~~~~~~~~~~~~~~~\n\n**Features**\n\n- Migration to v16 (`#127 <https://github.com/OCA/website-cms/issues/127>`_)\n- Get rid of `website` dependency\n\n\n13.0.1.0.1 (2021-08-23)\n~~~~~~~~~~~~~~~~~~~~~~~\n\n**Features**\n\n- Migration to v13 (`#111 <https://github.com/OCA/website-cms/issues/111>`_)\n\n\n11.0.1.3.0 (2018-08-07)\n~~~~~~~~~~~~~~~~~~~~~~~\n\n**Improvements**\n\n* Get rid of example package\n\n  The example package was there only to show how a message would look like.\n  But in real life you want always to verify how they look like\n  with your theme styles applied.\n\n  Now we have a new route `/cms/status-message/display-test` to check them.\n  `cms_status_message_example` module has been removed.\n\n\n11.0.1.2.0 (2018-08-07)\n~~~~~~~~~~~~~~~~~~~~~~~\n\n**Improvements**\n\n* Add auto-dimiss option\n\n  By default messages will be auto-dismissed after 8 seconds.\n  You can turn this off by setting an ir.config_param like::\n\n    cms_status_message.autodismiss = 0\n\n  You can customize the timeout by setting the key::\n\n    cms_status_message.autodismiss_timeout = 3000  # milliseconds\n\n  Check README for further info.\n\n\n11.0.1.1.0 (2018-04-22)\n~~~~~~~~~~~~~~~~~~~~~~~\n\n**Improvements**\n\n* Improve JS API\n\n  1. load qweb template on demand\n  2. load qweb template only if not loaded yet\n  3. use promises for rendering\n\n  We load qweb templates via JS.\n  Prior to this change we got 1 request every time,\n  on every page load per each template,\n  even if we were not using any status message feature.\n\n  Now we load templates only when needed\n  and we load them only if not loaded yet,\n  lowering page load time a bit :)\n\n  Plus, rendering now returns a promise object so you can chain calls\n  and do things when rendering is really finished.\n\n\n11.0.1.0.0 (2018-01-18)\n~~~~~~~~~~~~~~~~~~~~~~~\n\nUpgrade to v11\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/website-cms/issues>`_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us to smash it by providing a detailed and welcomed\n`feedback <https://github.com/OCA/website-cms/issues/new?body=module:%20cms_status_message%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n~~~~~~~\n\n* Camptocamp\n\nContributors\n~~~~~~~~~~~~\n\n* Simone Orsi <simone.orsi@camptocamp.com>\n\nMaintainers\n~~~~~~~~~~~\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n   :alt: Odoo Community Association\n   :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\n.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px\n    :target: https://github.com/simahawk\n    :alt: simahawk\n\nCurrent `maintainer <https://odoo-community.org/page/maintainer-role>`__:\n\n|maintainer-simahawk| \n\nThis module is part of the `OCA/website-cms <https://github.com/OCA/website-cms/tree/14.0/cms_status_message>`_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n",
    "bugtrack_url": null,
    "license": "LGPL-3",
    "summary": "Basic status messages for your CMS system",
    "version": "14.0.1.0.1.dev4",
    "project_urls": {
        "Homepage": "https://github.com/OCA/website-cms"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b14a716609cc87cfa485fb7305c24a3aac340270dc61a999e85694f452551d23",
                "md5": "0e0b9e57a9f3001ceeee0aab4ad63233",
                "sha256": "acfddf4bd1c02c4f69c689f042316ba5145602a0413ab56a1c5e95062462a30c"
            },
            "downloads": -1,
            "filename": "odoo14_addon_cms_status_message-14.0.1.0.1.dev4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0e0b9e57a9f3001ceeee0aab4ad63233",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 94533,
            "upload_time": "2025-02-07T08:12:09",
            "upload_time_iso_8601": "2025-02-07T08:12:09.396292Z",
            "url": "https://files.pythonhosted.org/packages/b1/4a/716609cc87cfa485fb7305c24a3aac340270dc61a999e85694f452551d23/odoo14_addon_cms_status_message-14.0.1.0.1.dev4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-07 08:12:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "OCA",
    "github_project": "website-cms",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "odoo14-addon-cms-status-message"
}
        
Elapsed time: 1.40999s