From dbfac96abd78a419607dc48e2f1d95ee0b45452e Mon Sep 17 00:00:00 2001 From: Vijaykumar Baladaniya Date: Tue, 3 Jul 2012 19:02:20 +0530 Subject: [PATCH 1/2] [IMP]:improve in wizard of survey module bzr revid: vba@tinyerp.com-20120703133220-9oqxvgn1c8aqg3p1 --- addons/survey/__openerp__.py | 1 + addons/survey/static/css/survey.css | 11 +++++++++++ addons/survey/wizard/survey_answer.py | 11 +++-------- addons/survey/wizard/survey_answer.xml | 1 + 4 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 addons/survey/static/css/survey.css diff --git a/addons/survey/__openerp__.py b/addons/survey/__openerp__.py index e4c83a37eee..8e54351e296 100644 --- a/addons/survey/__openerp__.py +++ b/addons/survey/__openerp__.py @@ -57,5 +57,6 @@ Partners are also sent mails with user name and password for the invitation of t 'auto_install': False, 'certificate' : '001131639736864143245', 'images': ['images/survey_answers.jpeg','images/survey_pages.jpeg','images/surveys.jpeg'], + 'css' : ['static/css/survey.css'], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/survey/static/css/survey.css b/addons/survey/static/css/survey.css new file mode 100644 index 00000000000..20e76076eb3 --- /dev/null +++ b/addons/survey/static/css/survey.css @@ -0,0 +1,11 @@ +.oe_survey_title { + font-weight: bold; + font-size: 22px; + margin: 8px 0px 8px 0px; + color: #404040; +} + +.oe_survey_title_page { +{ + width: 2%; +} diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 7df10729b61..85383701408 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -152,13 +152,8 @@ class survey_question_wiz(osv.osv_memory): ############# 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_title, 'label', {'string': tools.ustr(pag_rec.title) ,'colspan': '2' ,'class':'oe_horizontal_separator'}) + etree.SubElement(xml_header_title, 'label', {'string': tools.ustr(pag_rec.title) ,'colspan': '2' ,'class' : 'oe_survey_title'}) xml_header_group = etree.SubElement(xml_header_title, 'group', {'col': '4', 'colspan': '2'}) - #xml_header_page = etree.SubElement(xml_header_title, 'group', {'col': '1', 'colspan': '1'}) 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"}) @@ -176,7 +171,7 @@ class survey_question_wiz(osv.osv_memory): etree.SubElement(xml_header_group, 'button', {'special': "cancel", 'string' : 'Done', 'context' : tools.ustr(context), 'class':"oe_right"}) else: etree.SubElement(xml_header_group, 'button', {'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"}) -# etree.SubElement(xml_header_page, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_right"}) + #etree.SubElement(xml_header_group, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_right oe_survey_title_page"}) ############# PAGE HEADER : END ################### @@ -204,7 +199,7 @@ class survey_question_wiz(osv.osv_memory): if wiz_id: fields["wizardid_" + str(wiz_id)] = {'type':'char', 'size' : 255, 'string':"", 'views':{}} - etree.SubElement(xml_form, 'field', {'invisible':'1','name': "wizardid_" + str(wiz_id),'default':str(lambda *a: 0)}) + etree.SubElement(xml_form, 'field', {'invisible':'1','name': "wizardid_" + str(wiz_id),'default':str(lambda *a: 0), 'modifiers':'{"invisible":true}'}) if pag_rec.note: xml_group = etree.SubElement(xml_form, 'group', {'col': '1', 'colspan': '4'}) diff --git a/addons/survey/wizard/survey_answer.xml b/addons/survey/wizard/survey_answer.xml index b494c794545..162e820c059 100644 --- a/addons/survey/wizard/survey_answer.xml +++ b/addons/survey/wizard/survey_answer.xml @@ -28,6 +28,7 @@ + Answer Survey ir.actions.act_window survey.question.wiz form From 21f7a7d46d59384bfe32369633450fda91aa41e5 Mon Sep 17 00:00:00 2001 From: Vijaykumar Baladaniya Date: Wed, 4 Jul 2012 12:21:03 +0530 Subject: [PATCH 2/2] [IMP]:improve in wizard of survey module bzr revid: vba@tinyerp.com-20120704065103-4dxal1knmqftzjxo --- addons/survey/static/css/survey.css | 9 ++++++--- addons/survey/wizard/survey_answer.py | 9 ++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/addons/survey/static/css/survey.css b/addons/survey/static/css/survey.css index 20e76076eb3..72cd1d6e106 100644 --- a/addons/survey/static/css/survey.css +++ b/addons/survey/static/css/survey.css @@ -2,10 +2,13 @@ font-weight: bold; font-size: 22px; margin: 8px 0px 8px 0px; - color: #404040; + color: #5B5B5B; +} + +.oe_survey_title_height{ + height: 33px; } .oe_survey_title_page { -{ - width: 2%; + font-size: 14px; } diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 85383701408..8e9710f929a 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -147,19 +147,18 @@ 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(sur_rec.title)}) - xml_header = etree.SubElement(xml_form, 'header', {'col': '6', 'colspan': '4'}) + xml_header = etree.SubElement(xml_form, 'header', {'col': '6', 'colspan': '4' ,'class': 'oe_survey_title_height'}) xml_header_title = etree.SubElement(xml_header, 'group', {'col': '6', 'colspan': '6'}) ############# PAGE HEADER : START ################### etree.SubElement(xml_header_title, 'label', {'string': tools.ustr(pag_rec.title) ,'colspan': '2' ,'class' : 'oe_survey_title'}) - xml_header_group = etree.SubElement(xml_header_title, 'group', {'col': '4', 'colspan': '2'}) + xml_header_group = etree.SubElement(xml_header_title, 'group', {'col': '4', 'colspan': '1'}) 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', {'special': "cancel",'string':"Exit", 'class':"oe_right"}) if pre_button: - etree.SubElement(xml_header_group, 'button', {'colspan':"1",'name':"action_previous",'string':"Previous",'type':"object", 'class':"oe_right"}) + etree.SubElement(xml_header_group, 'button', {'name':"action_previous",'string':"Previous",'type':"object", 'class':"oe_right"}) but_string = "Next" if int(page_number) + 1 == total_pages: but_string = "Done" @@ -171,7 +170,7 @@ class survey_question_wiz(osv.osv_memory): etree.SubElement(xml_header_group, 'button', {'special': "cancel", 'string' : 'Done', 'context' : tools.ustr(context), 'class':"oe_right"}) else: etree.SubElement(xml_header_group, 'button', {'name':"action_next",'string': tools.ustr(but_string) ,'type':"object",'context' : tools.ustr(context), 'class':"oe_right"}) - #etree.SubElement(xml_header_group, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_right oe_survey_title_page"}) + etree.SubElement(xml_header_group, 'label', {'string': tools.ustr(page_number+ 1) + "/" + tools.ustr(total_pages), 'class':"oe_right oe_survey_title_page"}) ############# PAGE HEADER : END ###################