Merge lp:~openerp-dev/openobject-addons/trunk-pad-project-defaultvalue-tta into lp:openobject-addons

Proposed by SnippetBucket.com
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-pad-project-defaultvalue-tta
Merge into: lp:openobject-addons
Diff against target: 89 lines (+16/-9)
4 files modified
pad/pad.py (+7/-3)
pad/static/src/js/pad.js (+7/-3)
pad/static/src/xml/pad.xml (+1/-2)
pad_project/project_task.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-pad-project-defaultvalue-tta
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+128250@code.launchpad.net

Description of the change

Hello,

Improvement with etherpad.

Fixed following issues.

# Fixd icon issue when etherpad content load with page view.

# project task create new task with blank etherpad[No welcome message].

Thanks,
Tejas - TTA

To post a comment you must log in.
7721. By SnippetBucket.com

Merged with latest.

7722. By SnippetBucket.com

Merge with latest.

7723. By SnippetBucket.com

[Fix] context issue for pad_project.

7724. By SnippetBucket.com

Merged with latest.

7725. By SnippetBucket.com

Merged with latest.

7726. By SnippetBucket.com

[IMP] resolve create blank pad issue.

7727. By SnippetBucket.com

[FIX] resolved padId error.

7728. By SnippetBucket.com

[FIX] etherpad have limitation on url size, so minimized url.

Unmerged revisions

7728. By SnippetBucket.com

[FIX] etherpad have limitation on url size, so minimized url.

7727. By SnippetBucket.com

[FIX] resolved padId error.

7726. By SnippetBucket.com

[IMP] resolve create blank pad issue.

7725. By SnippetBucket.com

Merged with latest.

7724. By SnippetBucket.com

Merged with latest.

7723. By SnippetBucket.com

[Fix] context issue for pad_project.

7722. By SnippetBucket.com

Merge with latest.

7721. By SnippetBucket.com

Merged with latest.

7720. By SnippetBucket.com

[IMP] page view: pad content load inside iframe.

7719. By SnippetBucket.com

[IMP] pad_project: Create a blank etherpad on new record creation.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pad/pad.py'
2--- pad/pad.py 2012-09-20 12:06:16 +0000
3+++ pad/pad.py 2012-10-12 12:24:22 +0000
4@@ -29,12 +29,12 @@
5 s = string.ascii_uppercase + string.digits
6 salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(10)])
7 #path
8- path = '%s-%s-%s' % (cr.dbname.replace('_','-'), self._name, salt)
9+ path = '%s-%s-%s' % (cr.dbname.replace('_','-')[:10], self._name, salt)
10 # contruct the url
11 url = '%s/p/%s' % (pad["server"], path)
12
13 #if create with content
14- if "field_name" in context and "model" in context and "object_id" in context:
15+ if path and "field_name" in context and "model" in context and "object_id" in context:
16 myPad = EtherpadLiteClient( pad["key"], pad["server"]+'/api')
17 myPad.createPad(path)
18
19@@ -49,7 +49,11 @@
20 myPad.setText(path, html2plaintext(record[real_field]))
21 #Etherpad for html not functional
22 #myPad.setHTML(path, record[real_field])
23-
24+ elif path and "field_name" in context and "model" in context and "field_value" in context:
25+ myPad = EtherpadLiteClient( pad["key"], pad["server"]+'/api')
26+ myPad.createPad(path)
27+ myPad.setText(path, context.get("field_value"))
28+
29 return {
30 "server": pad["server"],
31 "path": path,
32
33=== modified file 'pad/static/src/js/pad.js'
34--- pad/static/src/js/pad.js 2012-09-25 13:55:57 +0000
35+++ pad/static/src/js/pad.js 2012-10-12 12:24:22 +0000
36@@ -10,11 +10,12 @@
37 _super.apply(self,[val]);
38
39 if (val === false || val === "") {
40- self.field_manager.dataset.call('pad_generate_url',{context:{
41+ var context = _.extend({}, this.node.attrs.context, {
42 model: self.field_manager.model,
43 field_name: self.name,
44 object_id: self.field_manager.datarecord.id
45- }}).then(function(data) {
46+ });
47+ self.field_manager.dataset.call('pad_generate_url',{context:context}).then(function(data) {
48 if(data&&data.url){
49 _super.apply(self,[data.url]);
50 self.renderElement();
51@@ -38,7 +39,10 @@
52 }else{
53 this.content = '<div class="oe_pad_loading">... Loading pad ...</div>';
54 $.get(value+'/export/html').success(function(data){
55- self.$('.oe_pad_content').html('<div class="oe_pad_readonly">'+data+'<div>');
56+ var iframe = self.$('.oe_pad_content');
57+ iframe.contents().find('html').html(data);
58+ var iframeheight = iframe.contents().find('html')[0].offsetHeight;
59+ iframe[0].style.height = iframeheight + "px";
60 }).error(function(){
61 self.$('.oe_pad_content').text('Unable to load pad');
62 });
63
64=== modified file 'pad/static/src/xml/pad.xml'
65--- pad/static/src/xml/pad.xml 2012-09-24 13:46:00 +0000
66+++ pad/static/src/xml/pad.xml 2012-10-12 12:24:22 +0000
67@@ -16,8 +16,7 @@
68 <t t-if="widget.configured">
69 <t t-if="widget.get('effective_readonly')">
70 <div class="oe_form_field_text oe_pad oe_configured">
71- <div class="oe_pad_content etherpad_readonly">
72- </div>
73+ <iframe src="about:blank" class="oe_pad_content etherpad_readonly" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
74 </div>
75 </t>
76
77
78=== modified file 'pad_project/project_task.xml'
79--- pad_project/project_task.xml 2012-08-09 06:05:16 +0000
80+++ pad_project/project_task.xml 2012-10-12 12:24:22 +0000
81@@ -6,7 +6,7 @@
82 <field name="inherit_id" ref="project.view_task_form2"/>
83 <field name="arch" type="xml">
84 <field name="description" position="replace">
85- <field name="description_pad" attrs="{'readonly':[('state','=','done')]}" widget="pad"/>
86+ <field name="description_pad" attrs="{'readonly':[('state','=','done')]}" widget="pad" context="{'field_name': 'description_pad', 'field_value': ''}"/>
87 </field>
88 </field>
89 </record>

Subscribers

People subscribed via source and target branches

to all changes: