odoo11-addon-cms-status-message


Nameodoo11-addon-cms-status-message JSON
Version 11.0.1.1.0 PyPI version JSON
download
home_page
SummaryBasic status messages for your CMS system
upload_time2018-04-24 04:43:50
maintainer
docs_urlNone
authorCamptocamp, Odoo Community Association (OCA)
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
licenseLGPL-3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://img.shields.io/badge/licence-lgpl--3-blue.svg
   :target: http://www.gnu.org/licenses/LGPL-3.0-standalone.html
   :alt: License: LGPL-3


==================
CMS status message
==================

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.

Usage
=====

Python code
-----------

Set a message:

.. code:: python

    msg = _('My important message.')
    if request.website:
        request.website.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!')
    if request.website:
        request.website.add_status_message(msg, type_='warning', title='Oh no')

Messages will be displayed like this:

.. image:: ./images/preview.png

Javascript code
---------------

Dependencies:

.. 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.

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 smashing it by providing a
detailed and welcomed feedback.

Credits
=======

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

-  Simone Orsi simone.orsi@camptocamp.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.



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "odoo11-addon-cms-status-message",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
    "maintainer_email": "",
    "keywords": "",
    "author": "Camptocamp, Odoo Community Association (OCA)",
    "author_email": "support@odoo-community.org",
    "download_url": "",
    "platform": "",
    "description": ".. image:: https://img.shields.io/badge/licence-lgpl--3-blue.svg\n   :target: http://www.gnu.org/licenses/LGPL-3.0-standalone.html\n   :alt: License: LGPL-3\n\n\n==================\nCMS status message\n==================\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\nUsage\n=====\n\nPython code\n-----------\n\nSet a message:\n\n.. code:: python\n\n    msg = _('My important message.')\n    if request.website:\n        request.website.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    if request.website:\n        request.website.add_status_message(msg, type_='warning', title='Oh no')\n\nMessages will be displayed like this:\n\n.. image:: ./images/preview.png\n\nJavascript code\n---------------\n\nDependencies:\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\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues <https://github.com/OCA/website-cms/issues>`_. In\ncase of trouble, please check there if your issue has already been\nreported. If you spotted it first, help us smashing it by providing a\ndetailed and welcomed feedback.\n\nCredits\n=======\n\nContributors\n------------\n\n-  Simone Orsi simone.orsi@camptocamp.com\n\nMaintainer\n----------\n\n.. image:: https://odoo-community.org/logo.png\n   :alt: Odoo Community Association\n   :target: https://odoo-community.org\n\nThis module is maintained by the OCA.\n\nOCA, or the Odoo Community Association, is a nonprofit organization\nwhose mission is to support the collaborative development of Odoo\nfeatures and promote its widespread use.\n\nTo contribute to this module, please visit https://odoo-community.org.\n\n\n",
    "bugtrack_url": null,
    "license": "LGPL-3",
    "summary": "Basic status messages for your CMS system",
    "version": "11.0.1.1.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "48b458da2fb456789ae40ff1fde65e5a28abc18bd79b44c047107d6d007ef946",
                "md5": "7588b4779feea2e49036d13e4295f079",
                "sha256": "9270d92b4bdb77f7d760438a68be35289342bd2bea64ed44de91363940aaf4eb"
            },
            "downloads": -1,
            "filename": "odoo11_addon_cms_status_message-11.0.1.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7588b4779feea2e49036d13e4295f079",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
            "size": 79633,
            "upload_time": "2018-04-24T04:43:50",
            "upload_time_iso_8601": "2018-04-24T04:43:50.098849Z",
            "url": "https://files.pythonhosted.org/packages/48/b4/58da2fb456789ae40ff1fde65e5a28abc18bd79b44c047107d6d007ef946/odoo11_addon_cms_status_message-11.0.1.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2018-04-24 04:43:50",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "odoo11-addon-cms-status-message"
}
        
Elapsed time: 0.12553s