[IMP]survey-kanban-view
authorPinakin Nayi (OpenERP) <pna@tinyerp.com>
Thu, 5 Jul 2012 12:43:05 +0000 (18:13 +0530)
committerPinakin Nayi (OpenERP) <pna@tinyerp.com>
Thu, 5 Jul 2012 12:43:05 +0000 (18:13 +0530)
bzr revid: pna@tinyerp.com-20120705124305-am3bqq8v0yrqrc12

addons/survey/static/src/css/survey.css
addons/survey/survey.py
addons/survey/survey_view.xml

index 0102dc1..6964e4c 100644 (file)
@@ -1,20 +1,3 @@
-.oe_module_survey{
-    font-size: 12px;
-    border-style:dotted;
-    border-radius: 15px;
-    text-align: left;
-    height:145px;
-    width:220px;
-}
-
-.oe_survey_title{
-    font-size: 15px;
-    height: auto;
-    font-size: 16px;
-    font-weight:bold;
-    width: 205px;
-}
-
 .oe_survey_responsible{
     height: auto;
     width: 200px;
     width: 200px;
     font-size: 14px;
 }
-
-.oe_survey_fill{
-       align:right;
-       padding: 1px 165px;
-}
-
 .oe_survey_rate{
     font-size: 14px;
 }
+.oe_kanban_survey {
+    width: 300px;
+}
+
index 40f13b2..1c1c8b6 100644 (file)
@@ -68,6 +68,7 @@ class survey(osv.osv):
         'users': fields.many2many('res.users', 'survey_users_rel', 'sid', 'uid', 'Users'),
         'send_response': fields.boolean('Email Notification on Answer'),
         'type': fields.many2one('survey.type', 'Type'),
+        'color': fields.integer('Color Index'),
         'invited_user_ids': fields.many2many('res.users', 'survey_invited_user_rel', 'sid', 'uid', 'Invited User'),
     }
     _defaults = {
index dedb044..bdba677 100644 (file)
                 <kanban>
                     <field name="title"/>
                     <field name="date_open"/>
+                    <field name="color"/>
                     <templates>
                         <t t-name="kanban-box">
-                          <div class="oe_module_survey">
-                            <a class="oe_module_icon">
-                               <div class="oe_survey_title"><t t-esc="record.title.raw_value.toString()"/></div><br/>
-                               <div class="oe_survey_responsible">
-                                   <t t-if="record.responsible_id.raw_value">By: <field name="responsible_id"/></t>
-                               </div><br/>
-                               <div class="oe_survey_start_date">
-                                  Open From:
-                                   <t t-if="record.date_open.raw_value">
-                                       <t t-esc="record.date_open.raw_value.getDate()"/>
-                                       <t t-esc="record.date_open.raw_value.toString('MMM')"/>, 
-                                       <t t-esc="record.date_open.raw_value.getFullYear()"/>
-                                   </t>
-                               </div><br/>
-                               <div class="oe_survey_rate">
-                                   Rate:
-                                <div class="oe_survey_fill" >
-                                   <button type="object" name="fill_survey" class="">
-                                       <span>Fill</span>
-                                   </button>
-                               </div>                                   
-                               </div>
-                            </a>
-                          </div>  
+                            <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_survey oe_kanban_auto_height">
+                                <div class="oe_dropdown_toggle oe_dropdown_kanban">
+                                    <span class="oe_e">i</span>
+                                    <ul class="oe_dropdown_menu">
+                                        <li><a type="edit">Edit...</a></li>
+                                        <li><a type="delete">Delete</a></li>
+                                        <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
+                                    </ul>
+                                </div>
+                                <div class="oe_kanban_content">
+                                    <h3 class="oe_kanban_ellipsis"><field name="title"/></h3>
+                                    <div class="oe_survey_responsible">
+                                       <t t-if="record.responsible_id.raw_value">By: <field name="responsible_id"/></t>
+                                   </div><br/>
+                                   <div class="oe_survey_start_date">
+                                      Open From:
+                                       <t t-if="record.date_open.raw_value">
+                                           <t t-esc="record.date_open.raw_value.getDate()"/>
+                                           <t t-esc="record.date_open.raw_value.toString('MMM')"/>,
+                                           <t t-esc="record.date_open.raw_value.getFullYear()"/>
+                                       </t>
+                                   </div><br/>
+                                   <div class="oe_survey_rate">
+                                       Rate:
+                                        <a name="fill_survey" type="object">Fill</a>
+                                   </div>
+                                </div>
+                            </div>
                         </t>
                     </templates>
                 </kanban>