Changed modules icons in the vignette
authorMinh Tran <mit@openerp.com>
Thu, 8 Dec 2011 16:11:24 +0000 (17:11 +0100)
committerMinh Tran <mit@openerp.com>
Thu, 8 Dec 2011 16:11:24 +0000 (17:11 +0100)
bzr revid: mit@openerp.com-20111208161124-o325usj9ikheewv8

openerp/addons/base/module/module_view.xml
openerp/addons/base/static/src/css/modules.css
openerp/modules/module.py

index 212a288..c155b01 100644 (file)
 
               <kanban>
                   <field name="icon"/>
+                  <field name="name"/>
                   <field name="state"/>
+                  <field name="complexity"/>
                   <templates>
-                      <t t-name="kanban-box">
-                        <img t-if="record.icon.value" src="#{record.icon.value}.png" class="module-icon"/>
-                        <img t-if="!record.icon.value" src="/web/static/src/img/header-preferences.png" class="module-icon"/>
-                        <div class="module-desc">
-                          <h4><field name="shortdesc"/></h4>
-                          <p>
-                             <field name="category_id"/><br/>
-                             Complexity: <field name="complexity"/>
-                           </p>
-                          <a type="object" name="button_install" states="uninstalled" class="button">Install</a>
-                          <button t-if="record.state.raw_value == 'installed'" class="label" disabled="disabled">Installed</button>
-                        </div>
-                      </t>
+                    <t t-name="kanban-box">
+                      <a type="edit"> 
+                        <img t-attf-src="/#{record.name.value}/static/images/icon.png" class="oe_module_icon"/>
+                      </a>
+                      <div class="oe_module_desc">
+                        <h4><a type="edit"><field name="shortdesc"/></a></h4>
+                        <p>
+                           <field name="category_id"/><br/>
+                           <span t-if="record.complexity.raw_value == 'Expert'" class="oe_label oe_warning">Complex</span>
+                         </p>
+                        <a type="object" name="button_install" states="uninstalled" class="button">Install</a>
+                        <button t-if="record.state.raw_value == 'installed'" class="label" disabled="disabled">Installed</button>
+                      </div>
+                      <script>
+                        $('.oe_module_icon').error(function() { $(this).attr('src', "/base/static/src/img/kanban_partner.png"); });
+                        $('a .oe_module_icon').error(function() { $(this).attr('src', "/base/static/src/img/kanban_partner.png"); });
+                      </script>
+                    </t>
                   </templates>
               </kanban>
 
index 645a332..3b52567 100644 (file)
@@ -1,31 +1,39 @@
-.module-icon, .module-desc {
+.oe_module_icon, .oe_module_desc {
   display: inline-block;
   vertical-align: top;
 }
 
-.module-icon {
+.oe_module_icon {
   width: 80px;
   height: 80px;
-  padding: 0 4px;
+  padding: 4px;
 }
 
-.module-desc {
+.oe_module_desc {
   width: 220px;
   font-size: 13px;
   padding: 2px 4px 8px;
   color: #4c4c4c;
 }
 
-.module-desc h4 {
-  margin: 3px 0;
+.oe_module_desc h4 {
+  margin: 0;
   font-size: 13px;
 }
 
-.module-desc p {
+.oe_module_desc h4 a {
+  color: #4c4c4c;
+}
+
+.oe_module_desc h4 a:hover {
+  text-decoration: underline;
+}
+
+.oe_module_desc p {
   margin: 3px 0 5px;
 }
 
 .oe_kanban_record {
   margin: 5px 0;
-  min-height: 80px;
+  min-height: 100px;
 }
index 09fcb2e..d35ca74 100644 (file)
@@ -251,7 +251,7 @@ def load_information_from_description_file(module):
             info.setdefault('description', '')
             info.setdefault('complexity', 'normal')
             info.setdefault('core', False)
-            info.setdefault('icon', '')
+            info.setdefault('icon', 'images/icon.png')
             info['certificate'] = info.get('certificate') or None
             info['web'] = info.get('web') or False
             info['license'] = info.get('license') or 'AGPL-3'