Browse Source

Merge branch '8.0' of /home/iii/addons-yelizariev/../mail_wall_menu into 8.0

pull/1/head
Ildar Nasyrov 9 years ago
parent
commit
9fb6565650
  1. 1
      mail_wall_menu/__init__.py
  2. 18
      mail_wall_menu/__openerp__.py
  3. 33
      mail_wall_menu/mail_wall_menu_views.xml
  4. 1
      mail_wall_menu/models.py
  5. BIN
      mail_wall_menu/static/description/icon.png
  6. 1
      mail_wall_menu/static/lib/masonry.pkgd.min.js
  7. 29
      mail_wall_menu/static/src/css/mail_wall_menu.css
  8. 36
      mail_wall_menu/static/src/js/mail_wall_menu.js

1
mail_wall_menu/__init__.py

@ -0,0 +1 @@
import models

18
mail_wall_menu/__openerp__.py

@ -0,0 +1,18 @@
{
'name' : 'Menu for widgets at Messaging section',
'version' : '1.0.0',
'author' : 'IT-Projects LLC, Ivan Yelizariev',
'license': 'GPL-3',
'category' : 'Social Network',
'website' : 'https://yelizariev.github.io',
'description': """
Module creates special menu at Messaging section to show only gamification-like blocks there.
Tested on Odoo 8.0 ab7b5d7732a7c222a0aea45bd173742acd47242d
""",
'depends' : ['mail'],
'data':[
'mail_wall_menu_views.xml',
],
'installable': True
}

33
mail_wall_menu/mail_wall_menu_views.xml

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="assets" inherit_id="mail.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/mail_wall_menu/static/src/css/mail_wall_menu.css"/>
<script type="text/javascript" src="/mail_wall_menu/static/lib/masonry.pkgd.min.js"></script>
<script type="text/javascript" src="/mail_wall_menu/static/src/js/mail_wall_menu.js"></script>
</xpath>
</template>
<record id="action_dashboard" model="ir.actions.client">
<field name="name">Dashboard</field>
<field name="tag">mail.wall</field>
<field name="context">{
'default_model': 'res.users',
'default_res_id': uid,
'thread_model': 'res.partner',
'needaction_menu_ref': ['mail.mail_tomefeeds', 'mail.mail_starfeeds']
}</field>
<field name="params" eval="&quot;{
'disable_thread': True
}&quot;"/>
</record>
<menuitem id="mail_wall_menu.menu_folder" name="Dashboard" parent="mail.mail_feeds_main" groups="base.group_user" sequence="5"/>
<menuitem id="mail_wall_menu.menu_dashboard" name="Dashboard" parent="mail_wall_menu.menu_folder" groups="base.group_user" sequence="10" action="action_dashboard"/>
</data>
</openerp>

1
mail_wall_menu/models.py

@ -0,0 +1 @@
from openerp import api,models,fields

BIN
mail_wall_menu/static/description/icon.png

After

Width: 100  |  Height: 100  |  Size: 2.1 KiB

1
mail_wall_menu/static/lib/masonry.pkgd.min.js
File diff suppressed because it is too large
View File

29
mail_wall_menu/static/src/css/mail_wall_menu.css

@ -0,0 +1,29 @@
.openerp .oe_mail_wall .dashboard_only .oe_mail{
display:none;
}
.openerp .oe_mail_wall .oe_mail_wall_aside{
display:none;
}
.openerp .oe_mail_wall .dashboard_only .oe_mail_wall_aside{
margin:0;
padding: 16px;
display: block;
position: static;
width:100%;
}
.openerp .oe_mail_wall .dashboard_only .oe_mail_wall_aside .oe_gamification_challenge_list {
background-color:inherit;
}
.openerp .oe_mail_wall .dashboard_only .oe_goal{
background-color: #ededf6;
width:280px;
margin:5px;
border: solid 1px #888;
padding: 4px 9px;
position:absolute;
left:-300px;
}

36
mail_wall_menu/static/src/js/mail_wall_menu.js

@ -0,0 +1,36 @@
openerp.mail_wall_menu = function(instance){
var QWeb = instance.web.qweb;
var _t = instance.web._t;
instance.mail.Widget.include({
start: function(){
if (this.action.params.disable_thread){
$('.oe_view_manager_body').addClass('dashboard_only');
var msnry = new Masonry( '.oe_mail_wall_aside', {
// options
columnWidth: 290,
itemSelector: '.oe_goal',
transitionDuration: 0
});
var update = -10;
this.msnry_interval = setInterval(function(){
update++;
if (update > 0 && update % 5 != 0)
return;
if (update > 0)
update = 0;
msnry.reloadItems();
msnry.layout();
}, 1000)
return;
}
this._super.apply(this, arguments)
},
destroy: function(){
clearInterval(this.msnry_interval);
this._super.apply(this, arguments);
}
})
}
Loading…
Cancel
Save