diff --git a/snippet_video_bg/__init__.py b/snippet_video_bg/__init__.py new file mode 100644 index 000000000..b0f26a9a6 --- /dev/null +++ b/snippet_video_bg/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import controllers diff --git a/snippet_video_bg/__manifest__.py b/snippet_video_bg/__manifest__.py new file mode 100644 index 000000000..8cd25fbf8 --- /dev/null +++ b/snippet_video_bg/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Hilar AK() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +{ + 'name': "Website Video Background", + 'version': '10.0.1.0.0', + 'summary': """Make Website Background as Video""", + 'description': """ + Website page background as youtube video. + """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "https://cybrosys.com/", + 'category': 'Website', + 'depends': ['base', 'website'], + 'data': [ + 'views/conf_view.xml', + 'views/assets.xml', + 'views/templates.xml', + ], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': False +} diff --git a/snippet_video_bg/controllers/__init__.py b/snippet_video_bg/controllers/__init__.py new file mode 100644 index 000000000..b0f26a9a6 --- /dev/null +++ b/snippet_video_bg/controllers/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import controllers diff --git a/snippet_video_bg/controllers/controllers.py b/snippet_video_bg/controllers/controllers.py new file mode 100644 index 000000000..2bfa4c9c8 --- /dev/null +++ b/snippet_video_bg/controllers/controllers.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from odoo import http +from odoo.http import request + + +class SnippetVideoBg(http.Controller): + + @http.route('/set_video_id', type='http', auth="user", methods=['POST'], website=True) + def index(self, **kw): + """ + Here set the system param video id. + :param kw: + :return: + """ + video_id = kw.get('id') + request.env['ir.config_parameter'].set_param( + 'video_id', video_id) if video_id else '' + return request.redirect('/') diff --git a/snippet_video_bg/demo/demo.xml b/snippet_video_bg/demo/demo.xml new file mode 100644 index 000000000..0b11d6107 --- /dev/null +++ b/snippet_video_bg/demo/demo.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/snippet_video_bg/models/__init__.py b/snippet_video_bg/models/__init__.py new file mode 100644 index 000000000..cde864bae --- /dev/null +++ b/snippet_video_bg/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import models diff --git a/snippet_video_bg/models/models.py b/snippet_video_bg/models/models.py new file mode 100644 index 000000000..b79c93d8b --- /dev/null +++ b/snippet_video_bg/models/models.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# +# from odoo import models, fields +# +# +# class WebsiteMapKey(models.Model): +# _inherit = 'website' +# video_id = fields.Char("Youtube Video Id") +# +# +# class WebsiteMapConfig(models.TransientModel): +# _inherit = 'website.config.settings' +# +# video_id = fields.Char(related='website_id.video_id', string="Youtube Video Id", +# help="Paste Youtube VideoId Here") diff --git a/snippet_video_bg/security/ir.model.access.csv b/snippet_video_bg/security/ir.model.access.csv new file mode 100644 index 000000000..e6a7f6914 --- /dev/null +++ b/snippet_video_bg/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_snippet_video_bg_snippet_video_bg,snippet_video_bg.snippet_video_bg,model_snippet_video_bg_snippet_video_bg,,1,0,0,0 \ No newline at end of file diff --git a/snippet_video_bg/static/description/add.png b/snippet_video_bg/static/description/add.png new file mode 100644 index 000000000..62d17c4ec Binary files /dev/null and b/snippet_video_bg/static/description/add.png differ diff --git a/snippet_video_bg/static/description/banner.jpg b/snippet_video_bg/static/description/banner.jpg new file mode 100644 index 000000000..cd7a1fa74 Binary files /dev/null and b/snippet_video_bg/static/description/banner.jpg differ diff --git a/snippet_video_bg/static/description/cybro_logo.png b/snippet_video_bg/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/snippet_video_bg/static/description/cybro_logo.png differ diff --git a/snippet_video_bg/static/description/icon.png b/snippet_video_bg/static/description/icon.png new file mode 100644 index 000000000..133eeefac Binary files /dev/null and b/snippet_video_bg/static/description/icon.png differ diff --git a/snippet_video_bg/static/description/id_prompt.png b/snippet_video_bg/static/description/id_prompt.png new file mode 100644 index 000000000..9a45f60f4 Binary files /dev/null and b/snippet_video_bg/static/description/id_prompt.png differ diff --git a/snippet_video_bg/static/description/index.html b/snippet_video_bg/static/description/index.html new file mode 100644 index 000000000..189bcbc7c --- /dev/null +++ b/snippet_video_bg/static/description/index.html @@ -0,0 +1,161 @@ +
+
+

Website Video Background

+

Cybrosys Technologies

+
+
+
+
+

Make youtube Video as background on website pages

+

+ Get video id from youtube and add it on website. + Eg: https://www.youtube.com/watch?v=uNCr7NdOJgw here uNCr7NdOJgw is your video id. +

+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+

Need Any Help?

+ +
+ diff --git a/snippet_video_bg/static/description/new.png b/snippet_video_bg/static/description/new.png new file mode 100644 index 000000000..4f97cc29c Binary files /dev/null and b/snippet_video_bg/static/description/new.png differ diff --git a/snippet_video_bg/static/description/prev1.png b/snippet_video_bg/static/description/prev1.png new file mode 100644 index 000000000..10c76832d Binary files /dev/null and b/snippet_video_bg/static/description/prev1.png differ diff --git a/snippet_video_bg/static/description/prev2.png b/snippet_video_bg/static/description/prev2.png new file mode 100644 index 000000000..9a2424812 Binary files /dev/null and b/snippet_video_bg/static/description/prev2.png differ diff --git a/snippet_video_bg/static/description/prompt.png b/snippet_video_bg/static/description/prompt.png new file mode 100644 index 000000000..53cfd96ed Binary files /dev/null and b/snippet_video_bg/static/description/prompt.png differ diff --git a/snippet_video_bg/static/description/system param.png b/snippet_video_bg/static/description/system param.png new file mode 100644 index 000000000..dd39710d7 Binary files /dev/null and b/snippet_video_bg/static/description/system param.png differ diff --git a/snippet_video_bg/static/description/youtube_id.png b/snippet_video_bg/static/description/youtube_id.png new file mode 100644 index 000000000..d0dd3cce3 Binary files /dev/null and b/snippet_video_bg/static/description/youtube_id.png differ diff --git a/snippet_video_bg/static/src/js/index.js b/snippet_video_bg/static/src/js/index.js new file mode 100644 index 000000000..128190c22 --- /dev/null +++ b/snippet_video_bg/static/src/js/index.js @@ -0,0 +1,37 @@ +odoo.define('snippet_video_bg.wrapwrap_bg_video', function (require) { + 'use strict'; + var Model = require('web.Model'); + var ajax = require('web.ajax'); + var core = require('web.core'); + var base = require('web_editor.base'); + var web_editor = require('web_editor.editor'); + var options = require('web_editor.snippets.options'); + var website = require('website.website'); + var contentMenu = require('website.contentMenu'); + var _t = core._t; + + contentMenu.TopBar.include({ + new_bg_video_id: function() { + website.prompt({ + id: "bg_video_id", + window_title: _t("Add a YouTube Video Id here"), + input: "Video ID", + }).then(function (id) { + website.form('/set_video_id', 'POST', { + id: id + }); + }); + }, + }); + $('document').ready(function() { + var model = new Model('ir.config_parameter'); + model.call('get_param', ['video_id']).then(function(video_id){ + var options = { + videoId: video_id || false, + start: 0, + mute: true, + }; + $('#wrapwrap').tubular(options); + }); + }); +});; \ No newline at end of file diff --git a/snippet_video_bg/views/assets.xml b/snippet_video_bg/views/assets.xml new file mode 100644 index 000000000..296d225c9 --- /dev/null +++ b/snippet_video_bg/views/assets.xml @@ -0,0 +1,8 @@ + +