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

[13.0][MIG] website_snippet_preset #688

Closed
wants to merge 7 commits into from
Closed
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
58 changes: 58 additions & 0 deletions website_snippet_preset/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: https://www.gnu.org/licenses/agpl
:alt: License: AGPL-3

=======================
Website Snippet Presets
=======================

This module allows the user to save and restore presets of snippets.

Usage
=====

To use this module, you need to:

#. Go in editing mode on the website
#. Select a snippet
#. Click 'Presets'
#. Click 'Save Current'
#. Select a different snippet of the same type
#. Select the added preset in the 'Load' menu

.. 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/11.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 smash it by providing detailed and welcomed feedback.

Credits
=======

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

* Dennis Sluijk <d.sluijk@onestein.nl>

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

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.
4 changes: 4 additions & 0 deletions website_snippet_preset/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2018 Onestein
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
17 changes: 17 additions & 0 deletions website_snippet_preset/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2018 Onestein
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Website Snippet Presets",
"summary": "This module allows the user "
"to save and restore presets of snippets.",
"category": "Website",
"version": "13.0.1.0.0",
"author": "Onestein, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/website",
"depends": ["website"],
"data": ["templates/assets.xml", "security/ir.model.access.csv"],
"qweb": ["static/src/xml/website_snippet_preset.xml"],
"installable": True,
}
143 changes: 143 additions & 0 deletions website_snippet_preset/i18n/website_snippet_preset.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_snippet_preset
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/js/website_snippet_preset.js:17
#, python-format
msgid "<p>Preset with this name already exists.Do you want to overwrite it?</p>"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_arch
msgid "Arch"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/js/website_snippet_preset.js:61
#, python-format
msgid "Cancel"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_create_uid
msgid "Created by"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_create_date
msgid "Created on"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_display_name
msgid "Display Name"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/js/website_snippet_preset.js:49
#, python-format
msgid "Enter Name"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_id
msgid "ID"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset___last_update
msgid "Last Modified on"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_write_uid
msgid "Last Updated by"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_write_date
msgid "Last Updated on"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/xml/website_snippet_preset.xml:13
#, python-format
msgid "Load"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/xml/website_snippet_preset.xml:32
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_name
#, python-format
msgid "Name"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/js/website_snippet_preset.js:28
#, python-format
msgid "No"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/js/website_snippet_preset.js:23
#, python-format
msgid "Overwrite"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/js/website_snippet_preset.js:16
#, python-format
msgid "Overwrite?"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/xml/website_snippet_preset.xml:9
#, python-format
msgid "Presets"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/js/website_snippet_preset.js:56
#, python-format
msgid "Save"
msgstr ""

#. module: website_snippet_preset
#. openerp-web
#: code:addons/website_snippet_preset/static/src/xml/website_snippet_preset.xml:11
#, python-format
msgid "Save Current"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model.fields,field_description:website_snippet_preset.field_snippet_preset_snippet
msgid "Snippet"
msgstr ""

#. module: website_snippet_preset
#: model:ir.model,name:website_snippet_preset.model_snippet_preset
msgid "snippet.preset"
msgstr ""

4 changes: 4 additions & 0 deletions website_snippet_preset/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2018 Onestein
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import snippet_preset
12 changes: 12 additions & 0 deletions website_snippet_preset/models/snippet_preset.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2018 Onestein
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class SnippetPreset(models.Model):
_name = "snippet.preset"

snippet = fields.Char()
name = fields.Char()
arch = fields.Text()
1 change: 1 addition & 0 deletions website_snippet_preset/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Dennis Sluijk <d.sluijk@onestein.nl>
1 change: 1 addition & 0 deletions website_snippet_preset/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows the user to save and restore presets of snippets.
8 changes: 8 additions & 0 deletions website_snippet_preset/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
To use this module, you need to:

#. Go in editing mode on the website
#. Select a snippet
#. Click 'Presets'
#. Click 'Save Current'
#. Select a different snippet of the same type
#. Select the added preset in the 'Load' menu
3 changes: 3 additions & 0 deletions website_snippet_preset/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
read,Persission to read presets,model_snippet_preset,website.group_website_publisher,1,0,0,0
edit,Persission to edit presets,model_snippet_preset,website.group_website_designer,1,1,1,1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions website_snippet_preset/static/src/css/website_snippet_preset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* Copyright 2018 Onestein
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */

body #oe_manipulators .oe_overlay > .oe_overlay_options {
width: 400px;
}

.o_snippet_preset_del {
position: absolute;
right: 0px;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
right: 0px;
right: 0;

top: 0px;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
top: 0px;
top: 0;

height: 100%;
line-height: 200%;
}
Loading