diff options
| author | Vijaykumar Baladaniya <vba@tinyerp.com> | 2012-07-02 12:12:19 +0530 |
|---|---|---|
| committer | Vijaykumar Baladaniya <vba@tinyerp.com> | 2012-07-02 12:12:19 +0530 |
| commit | 3fbf31c10e80676e2e84fbfe0c1d6164b8d3fdde (patch) | |
| tree | dd2f4b814dba545b17fc3eaebc07fcfb837d6203 /addons | |
| parent | 4e6580c7af7dab5e80a35c65f588fb0a97671923 (diff) | |
improve header part in surveys layout
bzr revid: vba@tinyerp.com-20120702064219-5lx3nbbvoctjp8hu
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/survey/wizard/survey_answer.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 78638dd0589..a0c35be81cb 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -147,33 +147,34 @@ class survey_question_wiz(osv.osv_memory): if flag: pag_rec = page_obj.browse(cr, uid, p_id, context=context) xml_form = etree.Element('form', {'string': tools.ustr(pag_rec.title)}) - xml_header = etree.SubElement(xml_form, 'header', {'col': '5', 'colspan': '4'}) - xml_header_group = etree.SubElement(xml_header, 'group', {'col': '6', 'colspan': '6'}) - xml_group = etree.SubElement(xml_form, 'group', {'col': '8', 'colspan': '4'}) + xml_header = etree.SubElement(xml_form, 'header', {'col': '6', 'colspan': '4'}) + xml_header_title = etree.SubElement(xml_header, 'group', {'col': '6', 'colspan': '6'}) ############# PAGE HEADER : START ################### #etree.SubElement(xml_group, 'field', {'name': 'progress_bar_' + tools.ustr(page_number) , 'widget':'progressbar'}) #fields['progress_bar_' + tools.ustr(page_number)] = {'type':'float', 'string':"Progress", 'views':{}} # etree.SubElement(xml_group, 'label', {'string': tools.ustr(tools.ustr(pag_rec.note)), 'align':"0.0"}) - - etree.SubElement(xml_header_group, 'label', {'string': tools.ustr(pag_rec.title) ,'colspan': '2' }) + + etree.SubElement(xml_header_title, 'label', {'string': tools.ustr(pag_rec.title) ,'colspan': '2' }) + xml_header_group = etree.SubElement(xml_header_title, 'group', {'col': '4', 'colspan': '2'}) + xml_group = etree.SubElement(xml_form, 'group', {'col': '8', 'colspan': '4'}) + etree.SubElement(xml_header_group, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_right"}) - etree.SubElement(xml_header_group, 'button', {'icon': "gtk-cancel", 'special': "cancel",'string':"Cancel", 'class':"oe_right"}) + etree.SubElement(xml_header_group, 'button', {'special': "cancel",'string':"Exit", 'class':"oe_right"}) if pre_button: - etree.SubElement(xml_header_group, 'button', {'colspan':"1",'icon':"gtk-go-back",'name':"action_previous",'string':"Previous",'type':"object", 'class':"oe_right"}) + etree.SubElement(xml_header_group, 'button', {'colspan':"1",'name':"action_previous",'string':"Previous",'type':"object", 'class':"oe_right"}) but_string = "Next" if int(page_number) + 1 == total_pages: but_string = "Done" - if context.has_key('active') and context.get('active',False) and int(page_number) + 1 == total_pages and context.has_key('response_id') and context.has_key('response_no') and context.get('response_no',0) + 1 == len(context.get('response_id',0)): - etree.SubElement(xml_header_group, 'button', {'icon': "gtk-go-forward", 'special' : 'cancel','string': tools.ustr("Done") ,'context' : tools.ustr(context), 'class':"oe_right"}) + etree.SubElement(xml_header_group, 'button', {'special' : 'cancel','string': tools.ustr("Done") ,'context' : tools.ustr(context), 'class':"oe_right"}) elif context.has_key('active') and context.get('active', False) and int(page_number) + 1 == total_pages and context.has_key('response_id'): - etree.SubElement(xml_header_group, 'button', {'icon': "gtk-go-forward", 'name':"action_forward_next",'string': tools.ustr("Next Answer") ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"}) + etree.SubElement(xml_header_group, 'button', {'name':"action_forward_next",'string': tools.ustr("Next Answer") ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"}) elif context.has_key('active') and context.get('active',False) and int(page_number) + 1 == total_pages: - etree.SubElement(xml_header_group, 'button', {'icon': "gtk-go-forward", 'special': "cancel", 'string' : 'Done', 'context' : tools.ustr(context), 'class':"oe_right"}) + etree.SubElement(xml_header_group, 'button', {'special': "cancel", 'string' : 'Done', 'context' : tools.ustr(context), 'class':"oe_right"}) else: - etree.SubElement(xml_header_group, 'button', {'icon': "gtk-go-forward", 'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"}) + etree.SubElement(xml_header_group, 'button', {'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"}) ############# PAGE HEADER : END ################### |
