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
=== modified file 'pad/pad.py'
--- pad/pad.py 2012-09-20 12:06:16 +0000
+++ pad/pad.py 2012-10-12 12:24:22 +0000
@@ -29,12 +29,12 @@
29 s = string.ascii_uppercase + string.digits29 s = string.ascii_uppercase + string.digits
30 salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(10)])30 salt = ''.join([s[random.randint(0, len(s) - 1)] for i in range(10)])
31 #path31 #path
32 path = '%s-%s-%s' % (cr.dbname.replace('_','-'), self._name, salt)32 path = '%s-%s-%s' % (cr.dbname.replace('_','-')[:10], self._name, salt)
33 # contruct the url33 # contruct the url
34 url = '%s/p/%s' % (pad["server"], path)34 url = '%s/p/%s' % (pad["server"], path)
3535
36 #if create with content36 #if create with content
37 if "field_name" in context and "model" in context and "object_id" in context:37 if path and "field_name" in context and "model" in context and "object_id" in context:
38 myPad = EtherpadLiteClient( pad["key"], pad["server"]+'/api')38 myPad = EtherpadLiteClient( pad["key"], pad["server"]+'/api')
39 myPad.createPad(path)39 myPad.createPad(path)
4040
@@ -49,7 +49,11 @@
49 myPad.setText(path, html2plaintext(record[real_field]))49 myPad.setText(path, html2plaintext(record[real_field]))
50 #Etherpad for html not functional50 #Etherpad for html not functional
51 #myPad.setHTML(path, record[real_field])51 #myPad.setHTML(path, record[real_field])
5252 elif path and "field_name" in context and "model" in context and "field_value" in context:
53 myPad = EtherpadLiteClient( pad["key"], pad["server"]+'/api')
54 myPad.createPad(path)
55 myPad.setText(path, context.get("field_value"))
56
53 return {57 return {
54 "server": pad["server"],58 "server": pad["server"],
55 "path": path,59 "path": path,
5660
=== modified file 'pad/static/src/js/pad.js'
--- pad/static/src/js/pad.js 2012-09-25 13:55:57 +0000
+++ pad/static/src/js/pad.js 2012-10-12 12:24:22 +0000
@@ -10,11 +10,12 @@
10 _super.apply(self,[val]);10 _super.apply(self,[val]);
1111
12 if (val === false || val === "") {12 if (val === false || val === "") {
13 self.field_manager.dataset.call('pad_generate_url',{context:{13 var context = _.extend({}, this.node.attrs.context, {
14 model: self.field_manager.model,14 model: self.field_manager.model,
15 field_name: self.name,15 field_name: self.name,
16 object_id: self.field_manager.datarecord.id16 object_id: self.field_manager.datarecord.id
17 }}).then(function(data) {17 });
18 self.field_manager.dataset.call('pad_generate_url',{context:context}).then(function(data) {
18 if(data&&data.url){19 if(data&&data.url){
19 _super.apply(self,[data.url]);20 _super.apply(self,[data.url]);
20 self.renderElement();21 self.renderElement();
@@ -38,7 +39,10 @@
38 }else{39 }else{
39 this.content = '<div class="oe_pad_loading">... Loading pad ...</div>';40 this.content = '<div class="oe_pad_loading">... Loading pad ...</div>';
40 $.get(value+'/export/html').success(function(data){41 $.get(value+'/export/html').success(function(data){
41 self.$('.oe_pad_content').html('<div class="oe_pad_readonly">'+data+'<div>');42 var iframe = self.$('.oe_pad_content');
43 iframe.contents().find('html').html(data);
44 var iframeheight = iframe.contents().find('html')[0].offsetHeight;
45 iframe[0].style.height = iframeheight + "px";
42 }).error(function(){46 }).error(function(){
43 self.$('.oe_pad_content').text('Unable to load pad');47 self.$('.oe_pad_content').text('Unable to load pad');
44 });48 });
4549
=== modified file 'pad/static/src/xml/pad.xml'
--- pad/static/src/xml/pad.xml 2012-09-24 13:46:00 +0000
+++ pad/static/src/xml/pad.xml 2012-10-12 12:24:22 +0000
@@ -16,8 +16,7 @@
16 <t t-if="widget.configured">16 <t t-if="widget.configured">
17 <t t-if="widget.get('effective_readonly')">17 <t t-if="widget.get('effective_readonly')">
18 <div class="oe_form_field_text oe_pad oe_configured">18 <div class="oe_form_field_text oe_pad oe_configured">
19 <div class="oe_pad_content etherpad_readonly">19 <iframe src="about:blank" class="oe_pad_content etherpad_readonly" width="100%" height="100%" frameborder="0" scrolling="no"></iframe>
20 </div>
21 </div>20 </div>
22 </t>21 </t>
2322
2423
=== modified file 'pad_project/project_task.xml'
--- pad_project/project_task.xml 2012-08-09 06:05:16 +0000
+++ pad_project/project_task.xml 2012-10-12 12:24:22 +0000
@@ -6,7 +6,7 @@
6 <field name="inherit_id" ref="project.view_task_form2"/>6 <field name="inherit_id" ref="project.view_task_form2"/>
7 <field name="arch" type="xml">7 <field name="arch" type="xml">
8 <field name="description" position="replace">8 <field name="description" position="replace">
9 <field name="description_pad" attrs="{'readonly':[('state','=','done')]}" widget="pad"/>9 <field name="description_pad" attrs="{'readonly':[('state','=','done')]}" widget="pad" context="{'field_name': 'description_pad', 'field_value': ''}"/>
10 </field>10 </field>
11 </field>11 </field>
12 </record>12 </record>

Subscribers

People subscribed via source and target branches

to all changes: