[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4505] branches/1.3



Revision: 4505
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4505&view=rev
Author:   einhverfr
Date:     2012-03-17 10:41:03 +0000 (Sat, 17 Mar 2012)
Log Message:
-----------
Pricelist template moved to new dynatable, showing basic functionality working as expected

Modified Paths:
--------------
    branches/1.3/UI/Contact/pricelist.html
    branches/1.3/UI/lib/dynatable.html
    branches/1.3/css/ledgersmb.css

Modified: branches/1.3/UI/Contact/pricelist.html
===================================================================
--- branches/1.3/UI/Contact/pricelist.html	2012-03-17 09:39:15 UTC (rev 4504)
+++ branches/1.3/UI/Contact/pricelist.html	2012-03-17 10:41:03 UTC (rev 4505)
@@ -1,5 +1,6 @@
 <?lsmb INCLUDE 'ui-header.html' ?>
 <?lsmb PROCESS 'elements.html' ?>
+<?lsmb PROCESS 'dynatable.html' ?>
 <!-- 
 
 The overall structure here is imagined to be a list of individual price
@@ -13,79 +14,59 @@
 <?lsmb account_class = entity_class ?>
 <body>
 <div class="listtop"><?lsmb text('Pricelist') ?> <?lsmb pricematrix.length ?></div>
-<table>
-<tr class="listheading">
-<th class="listheading"><?lsmb text('Partnumber') ?></th>
-<th class="listheading"><?lsmb text('Description') ?></th>
-<th class="listheading"><?lsmb IF accont_class == 1; 
-                                   text('Last Cost');
-                               ELSE;
-                                   text('Sell Price'); 
-                               END ?></th>
-<?lsmb IF account_class == 2 ?>
-<th class="listheading"><?lsmb text('Valid From') ?></th>
-<th class="listheading"><?lsmb text('Valid To') ?></th>
-<?lsmb ELSE ?>
-<th class="listheading"><?lsmb text('Vendor Partnumber') ?></th>
-<th class="listheading"><?lsmb text('Lead Time') ?></th>
-<?lsmb END ?>
-<th class="listheading"><?lsmb text('Currency') ?></th>
-<th class="listheading">&nbsp;</th>
-</tr>
-<?lsmb FOR pm IN pricematrix ?>
-<tr>
-<td><?lsmb pm.int_partnumber ?></td>
-<td><?lsmb pm.description ?></td>
-<td><?lsmb IF account_class == 1; pm.lastcost; ELSE; pm.sellprice; END ?>
-</td>
-<?lsmb IF account_class == 2; ?>
-<td><?lsmb pm.validfrom ?></td>
-<td><?lsmb pm.validto ?></td>
-<?lsmb ELSE ?>
-<td><?lsmb pm.partnumber ?></td>
-<td><?lsmb pm.leadtime ?></td>
-<?lsmb END  ?>
-<td><?lsmb pm.currency ?></td>
-<td><a href="<?lsmb script ?>?action=delete_pricematrix&credit_id=<?lsmb id ?>&entry_id=<?lsmb pm.entry_id ?>">[<?lsmb text('Delete') ?>]</a></td>
-</tr>
-<?lsmb END # FOR pricematrix ?>
-</table>
-
-<?lsmb IF pricematrix_pricegroup ?>
-<div class="listtop"><?lsmb text('Pricelist for Pricegroup') ?></div>
-<table>
-<tr class="listheading">
-<th class="listheading"><?lsmb text('Partnumber') ?></th>
-<th class="listheading"><?lsmb text('Description') ?></th>
-<th class="listheading"><?lsmb IF accont_class == 1; 
-                                   text('Last Cost');
-                               ELSE;
-                                   text('Sell Price');
-                               END ?></th>
-<?lsmb IF account_class == 2 ?>
-<th class="listheading"><?lsmb text('Valid From') ?></th>
-<th class="listheading"><?lsmb text('Valid To') ?></th>
-<?lsmb ELSE ?>
-<th class="listheading"><?lsmb text('Vendor Partnumber') ?></th>
-<th class="listheading"><?lsmb text('Lead Time') ?></th>
-<?lsmb END ?>
-<th class="listheading"><?lsmb text('Currency') ?></th>
-<?lsmb FOR pm IN pricematrix_pricegroup ?>
-<tr>
-<td><?lsmb pm.int_partnumber ?></td>
-<td><?lsmb pm.description ?></td>
-<td><?lsmb IF account_class == 1; pm.lastcost; ELSE; pm.sellprice; END ?>
-</td>
-<?lsmb IF account_class == 2; ?>
-<td><?lsmb pm.validfrom ?></td>
-<td><?lsmb pm.validto ?></td>
-<?lsmb ELSE ?>
-<td><?lsmb pm.partnumber ?></td>
-<td><?lsmb pm.leadtime ?></td>
-<?lsmb END  ?>
-<td><?lsmb pm.currency ?></td>
-</table>
-<?lsmb END ?>
-<?lsmb END ?>
+<?lsmb 
+    columns = [ { col_id = 'int_partnumber'
+                  name = text('Partnumber')
+                  type = 'text'
+                },
+                { col_id = 'description'
+                  name = text('Description')
+                  type = 'text'
+                } ];
+     IF account_class == 1;
+         columns.push(
+                  {col_id = 'lastcost'
+                     name = text('Last Cost') #'
+                     type = 'text_input'},
+                  {col_id = 'partnumber',
+                     name = text('Vendor Partnumber') #'
+                     type = 'text_input'},
+                  {col_id = 'leadtime',
+                     name = text('Lead Time') #'
+                     type = 'input_text'}
+         );
+     ELSE;
+         columns.push(
+                  {col_id = 'sellprice'
+                     name = text('Sell Price') #'
+                     type = 'text_input'},
+                  {col_id = 'validfrom',
+                     name = text('Valid From') #'
+                     type = 'text_input'},
+                  {col_id = 'validto',
+                     name = text('Valid To') #'
+                     type = 'text_input'},
+         );
+                        
+     END;
+     columns.push({col_id = 'currency',
+                     name = text('Currency'),
+                     type = 'text'},
+                  {col_id = 'delete',
+                     name = '&nbsp;',
+                     type = 'href',
+                href_base = script _ '?action=delete_pricematrix&credit_id=' 
+                            _ id _ '&entry_id=' }
+     );
+     FOREACH pm IN pricematrix;
+         pm.delete = '[' _ text('Delete') _ ']';
+         pm.row_id = pm.entry_id;
+     END;
+     PROCESS dynatable
+         tbody = { rows = pricematrix }; ?>
+<?lsmb IF pricematrix_pricegroup;
+     PROCESS dynatable
+         tbody = { rows = pricematrix_pricegroup };
+       END ?>
 </body>
 </html>

Modified: branches/1.3/UI/lib/dynatable.html
===================================================================
--- branches/1.3/UI/lib/dynatable.html	2012-03-17 09:39:15 UTC (rev 4504)
+++ branches/1.3/UI/lib/dynatable.html	2012-03-17 10:41:03 UTC (rev 4505)
@@ -1,5 +1,5 @@
 <?lsmb BLOCK dynatable ?>
-<table id="<?lsmb attributes.id ?>" class="<?lsmb attributes.class">
+<table id="<?lsmb attributes.id ?>" class="<?lsmb attributes.class ?>">
 <?lsmb- IF !hide_header -?>
 <thead>
    <tr>
@@ -44,8 +44,9 @@
               value="<?lsmb ROW.row_id ?>"
                <?lsmb CHECKED ?> />
          <?lsmb- ELSIF COL.type == 'href'; 
-                   IF row.${COL.col_id}_href_suffix;
-                      HREF = COL.href_base _ ROW.${COL.col_id}_href_suffix;
+                   HREF_SFX = COL.col_id _ "_href_suffix";
+                   IF row.$HREF_SFX;
+                      HREF = COL.href_base _ ROW.$HREF_SFX;
                    ELSE;
                       HREF = COL.href_base _ ROW.row_id;
                    END
@@ -67,7 +68,7 @@
      IF tfoot.coltypes.${COL.col_id} == 'spacer';
         SPACECOUNT = SPACECOUNT + 1;
      ELSE;
-       IF SPACECOUNT gt 0 ?>
+       IF SPACECOUNT > 0 ?>
           <td colspan="<?lsmb SPACECOUNT ?>">&nbsp;</td>
        <?lsmb END ?>
      <td class="<?lsmb COL.col_id ?>">
@@ -76,7 +77,7 @@
           ELSE; 
              TYPE = COL.type;
           END;
-          <?lsmb- IF TYPE == 'input_text' -?>
+          IF TYPE == 'input_text' -?>
           <input id="<?lsmb COL.col_id ?>-<?lsmb loop.count ?>"
                type="text"
               class="<?lsmb COL.class ?>"
@@ -104,6 +105,13 @@
               value="<?lsmb ROW.row_id ?>"
                <?lsmb CHECKED ?> />
          <?lsmb- ELSIF TYPE == 'href'; 
+                   HREF_SFX = COL.col_id _ "_href_suffix";
+                   IF row.$HREF_SFX;
+                      HREF = COL.href_base _ ROW.$HREF_SFX;
+                   ELSE;
+                      HREF = COL.href_base _ ROW.row_id;
+                   END
+          ?><a href="<?lsmb HREF ?>"><?lsmb ROW.${COL.col_id} ?></a>
                    IF row.${COL.col_id}_href_suffix;
                       HREF = COL.href_base _ ROW.${COL.col_id}_href_suffix;
                    ELSE;

Modified: branches/1.3/css/ledgersmb.css
===================================================================
--- branches/1.3/css/ledgersmb.css	2012-03-17 09:39:15 UTC (rev 4504)
+++ branches/1.3/css/ledgersmb.css	2012-03-17 10:41:03 UTC (rev 4505)
@@ -133,7 +133,7 @@
 }
 
 .listtop { font-size: 10pt; background-color: black; color: white; }
-.listheading { font-size: 10pt; background-color: #004a80; color: white; }
+.listheading, thead th { font-size: 10pt; background-color: #004a80; color: white; }
 A.listheading:link, A.listheading:active, A.listheading:visited {
   text-decoration: none; }
 .listrow1 { font-size: 10pt; background-color: #e6e6fa; color: black; vertical-align: top; }

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.