From a692a215469aaeec2515286be08d7bfbbf355c27 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 31 Oct 2012 11:23:07 +0100 Subject: [PATCH] [IMP] CSS lunch bzr revid: fp@tinyerp.com-20121031102307-d4s8sq9v32poebzj --- addons/lunch/__openerp__.py | 2 +- addons/lunch/lunch.py | 35 +++++------- addons/lunch/lunch_view.xml | 35 ++++++------ addons/lunch/static/src/css/Makefile | 3 + addons/lunch/static/src/css/lunch.css | 37 +++++++++++++ addons/lunch/static/src/css/lunch.sass | 32 +++++++++++ addons/lunch/static/src/css/lunch_style.css | 61 --------------------- 7 files changed, 105 insertions(+), 100 deletions(-) create mode 100644 addons/lunch/static/src/css/Makefile create mode 100644 addons/lunch/static/src/css/lunch.css create mode 100644 addons/lunch/static/src/css/lunch.sass delete mode 100644 addons/lunch/static/src/css/lunch_style.css diff --git a/addons/lunch/__openerp__.py b/addons/lunch/__openerp__.py index c07f060b278..b00901492c8 100644 --- a/addons/lunch/__openerp__.py +++ b/addons/lunch/__openerp__.py @@ -35,7 +35,7 @@ Category for the product. 'data': ['security/groups.xml','lunch_view.xml','wizard/lunch_validation_view.xml','wizard/lunch_cancel_view.xml','lunch_report.xml', 'report/report_lunch_order_view.xml', 'security/ir.model.access.csv',], - 'css':['static/src/css/lunch_style.css'], + 'css':['static/src/css/lunch.css'], 'demo': ['lunch_demo.xml',], 'test': [], 'installable': True, diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index 591014ff212..677cea7f6bf 100644 --- a/addons/lunch/lunch.py +++ b/addons/lunch/lunch.py @@ -126,19 +126,16 @@ class lunch_order(osv.Model): return True return False - def _default_alerts_get(self,cr,uid,arg,context=None): """ get the alerts to display on the order form """ alert_ref = self.pool.get('lunch.alert') alert_ids = alert_ref.search(cr,uid,[('lunch_active','=',True)],context=context) - alert_msg="" + alert_msg = [] for alert in alert_ref.browse(cr,uid,alert_ids,context=context): if self.can_display_alert(alert): if alert.active_from==alert.active_to: #the alert is executing all the day - alert_msg+="! " - alert_msg+=alert.message - alert_msg+='\n' + alert_msg.append(alert.message) elif alert.active_from=from_alert.time() and mynow.time()<=to_alert.time(): - alert_msg+="! " - alert_msg+=alert.message - alert_msg+='\n' - return alert_msg + alert_msg.append(alert.message) + return '\n'.join(alert_msg) def onchange_price(self,cr,uid,ids,order_line_ids,context=None): """ Onchange methode that refresh the total price of order""" @@ -228,7 +223,7 @@ class lunch_order(osv.Model): for key,value in categories.items(): text_xml+="""
-
%s
+

%s

""" % (key,) i = 0 for val in value: @@ -237,20 +232,20 @@ class lunch_order(osv.Model): function_name = "add_preference_"+str(val.id) text_xml+= '''
-
-
%s
-
- - -
+ + + +
+
+ %s + %.2f %s +
- %.2f %s -
-
+
%s
- ''' % (val['product_name'],function_name, function_name, val['price'] or 0.0, currency['name'], val['note'] or '') + ''' % (function_name, function_name, val['product_name'], val['price'] or 0.0, currency['name'], val['note'] or '') text_xml+= ('''
''') text_xml+= ('''
''') # ADD into ARCH xml diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml index 02384c07ddb..d8ee3f614e5 100644 --- a/addons/lunch/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -1,13 +1,13 @@ - - - - + + + + - - + + Search @@ -74,8 +74,8 @@ - - + + Your Orders lunch.order form @@ -199,7 +199,7 @@ - + Product Categories lunch.product.category tree,form @@ -285,10 +285,10 @@ - Orders Form - lunch.order - -
+ Lunch Order + lunch.order + +
@@ -303,8 +303,7 @@ - - +
@@ -322,9 +321,9 @@

- -
-
+ + +
diff --git a/addons/lunch/static/src/css/Makefile b/addons/lunch/static/src/css/Makefile new file mode 100644 index 00000000000..941e8dbfe7d --- /dev/null +++ b/addons/lunch/static/src/css/Makefile @@ -0,0 +1,3 @@ +lunch.css: lunch.sass + sass -t expanded lunch.sass lunch.css + diff --git a/addons/lunch/static/src/css/lunch.css b/addons/lunch/static/src/css/lunch.css new file mode 100644 index 00000000000..8f4aa1dcd39 --- /dev/null +++ b/addons/lunch/static/src/css/lunch.css @@ -0,0 +1,37 @@ +@charset "utf-8"; +.openerp .oe_lunch .oe_lunch_alert textarea { + background-color: #ffc7c7; + padding: 10px; + height: 1em; + margin-bottom: 20px; +} +.openerp .oe_lunch button.oe_button_add { + position: relative; + top: -2px; + left: 3px; +} +.openerp .oe_lunch button.oe_button_plus { + margin: -2px; +} +.openerp .oe_lunch .oe_lunch_30pc { + width: 30%; + display: inline-block; + vertical-align: top; +} +.openerp .oe_lunch .oe_lunch_30pc + .oe_lunch_30pc { + padding-left: 5%; +} +.openerp .oe_lunch h2 { + color: #7c7bad; +} +.openerp .oe_lunch .oe_lunch_button { + float: right; +} +.openerp .oe_lunch .oe_lunch_vignette { + border-bottom: 1px solid #dddddd; + padding-top: 5px; + padding-bottom: 5px; +} +.openerp .oe_lunch .oe_group_text_button { + margin-bottom: 3px; +} diff --git a/addons/lunch/static/src/css/lunch.sass b/addons/lunch/static/src/css/lunch.sass new file mode 100644 index 00000000000..209d114f4c2 --- /dev/null +++ b/addons/lunch/static/src/css/lunch.sass @@ -0,0 +1,32 @@ +@charset "utf-8" + +.openerp + .oe_lunch + .oe_lunch_alert + textarea + background-color: #ffc7c7 + padding: 10px + height: 1em + margin-bottom: 20px + button.oe_button_add + position: relative + top: -2px + left: 3px + button.oe_button_plus + margin: -2px + .oe_lunch_30pc + width: 30% + display: inline-block + vertical-align: top + .oe_lunch_30pc + .oe_lunch_30pc + padding-left: 5% + h2 + color: #7C7BAD + .oe_lunch_button + float: right + .oe_lunch_vignette + border-bottom: 1px solid #dddddd + padding-top: 5px + padding-bottom: 5px + .oe_group_text_button + margin-bottom: 3px diff --git a/addons/lunch/static/src/css/lunch_style.css b/addons/lunch/static/src/css/lunch_style.css deleted file mode 100644 index 098cab12d26..00000000000 --- a/addons/lunch/static/src/css/lunch_style.css +++ /dev/null @@ -1,61 +0,0 @@ - -.openerp .oe_lunch_view { -} - -.openerp .oe_lunch_30pc { - width: 33%; - display: inline-block; - vertical-align: top; -} -.openerp .oe_lunch_title { - font-weight: bold; - font-size: 17px; - margin-left: 10px; - color: #7C7BAD; -} - -.openerp .oe_lunch_vignette { - padding: 8px; - min-height: 50px; - border: 1px solid; - border-color: grey; - margin-right: 12px; - margin-bottom: 5px; - -moz-border-radius: 15px; - border-radius: 15px; - box-shadow: grey 1.5px 1.5px 1.5px; -} - -.openerp .oe_small_textarea>textarea { - min-height: 20px; - height: 20px; - color: red; -} - -.openerp .oe_lunch_button { - margin: 0px; - padding: 0px; - text-align: right; - width: 29%; - min-width: 55px; - max-width: 30%; - display: inline-block; -} - -.openerp .oe_lunch_note { - margin: 0px; - padding: 0px; - margin-top: 4px; - text-align: left; - font-style: italic; - color: #686464; - display: inline-block; -} - -.openerp .oe_lunch_text { - font-size: 15px; - font-style: bold; - width: 69%; - max-width: 70%; - display: inline-block; -} \ No newline at end of file