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

SF.net SVN: ledger-smb:[6131] trunk/UI



Revision: 6131
          http://sourceforge.net/p/ledger-smb/code/6131
Author:   einhverfr
Date:     2013-10-15 07:26:11 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
Correcting Dojo issues with account creation screen

Modified Paths:
--------------
    trunk/UI/accounts/edit.html
    trunk/UI/accounts/edit.js
    trunk/UI/lib/Loader.js

Modified: trunk/UI/accounts/edit.html
===================================================================
--- trunk/UI/accounts/edit.html	2013-10-14 14:26:53 UTC (rev 6130)
+++ trunk/UI/accounts/edit.html	2013-10-15 07:26:11 UTC (rev 6131)
@@ -4,24 +4,76 @@
     include_script = ['UI/accounts/edit.js']
 ?> 
 <?lsmb PROCESS elements.html ?> 
-<body onload="init()">
+<body class="<?lsmb dojo_theme ?>">
+<script type="text/javascript" language="Javascript">
+    var activeDiv = "<?lsmb charttype ?>";
+</script>
+<div class="TabSet" id="account-tabs">
+<div class="lsmbtab" title="<?lsmb text('Heading') ?>" id="H">
 <form method="post" action="<?lsmb form.script ?>">
-<div class="listtop"><?lsmb form.title ?></div>
-<div class="inputline" id="charttype-line">
-   <label class="line">&nbsp;</label>
-   <div class="inputgroup">
+<?lsmb PROCESS input element_data = {
+        value = 'H'
+        name = 'charttype'
+        type = 'hidden'
+} ?>
+<div class="inputline" id="accno-line">
+  <label class="line"><?lsmb text('Account Number') ?></label>
+  <div class="inputgroup">
     <?lsmb 
-     ctypes = [
-                { text = 'Account', value = 'A'}
-                { text = 'Heading', value = 'H'}
-              ];
-    INCLUDE select element_data = {
-                  name = 'charttype'
-               options = ctypes
-        default_values = [form.charttype]
-    };?>
+    INCLUDE input element_data = {
+      name = 'accno'
+       id  = 'accno-h'
+      size = '20'
+     value = form.accno
+      type = 'text'
+     class = 'control-code'
+    } ?>
   </div>
 </div>
+<div class="inputline" id="desc-line">
+   <label class="line"><?lsmb text('Description') ?></label>
+   <div class="inputgroup">
+      <?lsmb 
+    INCLUDE input element_data = {
+        id = 'desc-h'
+      name = 'description'
+      size = '40'
+     value = form.description
+      type = 'text'
+     class = 'description'
+    } ?>
+   </div>
+</div>
+<div class="inputline" id="heading-line">
+   <label class="line"><?lsmb text('Heading') ?></label>
+   <div class="inputgroup">
+      <?lsmb 
+    FOREACH h IN form.all_headings;
+        h.text = h.accno _ '--' _ h.description;
+    END;
+    form.all_headings.push({});
+    INCLUDE select element_data = {
+                  name = 'heading'
+               options = form.all_headings
+        default_values = [form.heading]
+             text_attr = 'text'
+            value_attr = 'id'
+                 class = 'account'
+                    id = 'heading-h'
+    }; ?>
+   </div>
+</div>
+<hr size="3" noshade="noshade" />
+<?lsmb FOREACH button IN buttons; INCLUDE button element_data=button; END ?>
+</form>
+</div>
+<div class="lsmbtab" title="<?lsmb text('Account') ?>" id="A">
+<form method="post" action="<?lsmb form.script ?>">
+<?lsmb PROCESS input element_data = {
+        value = 'A'
+        name = 'charttype'
+        type = 'hidden'
+} ?>
 <div class="inputline" id="accno-line">
   <label class="line"><?lsmb text('Account Number') ?></label>
   <div class="inputgroup">
@@ -332,7 +384,7 @@
    <div class="inputgroup">
       <?lsmb IF form.IC_expense;IC_expense= 'CHECKED'; END;
          INCLUDE input element_data={
-              name = 'IC_expense',
+              name = 'IC_returns',
               type = 'checkbox',
              label = text('Returns'),
            checked = IC_returns,
@@ -405,7 +457,7 @@
 		}; END ?>
 
 <hr size="3" noshade="noshade" />
-<?lsmb FOREACH button IN buttons; INCLUDE button element_data=button; END ?>
+<?lsmb FOREACH button IN buttons; button.id = button.name _ '-A'; INCLUDE button element_data=button; END ?>
 </form>
 </body>
 </html>

Modified: trunk/UI/accounts/edit.js
===================================================================
--- trunk/UI/accounts/edit.js	2013-10-14 14:26:53 UTC (rev 6130)
+++ trunk/UI/accounts/edit.js	2013-10-15 07:26:11 UTC (rev 6131)
@@ -1,24 +1,17 @@
+require([
+         'dojo/query',
+         'dojo/dom',
+         "lsmb/lib/TabSet",
+          'dojo/window',
+         'dojo/domReady!'],
+       function(query, dom, tc, win){
+           if (activeDiv != 'H') {
+               activeDiv = 'A';
+           }
+           console.log(activeDiv);
+           var tabs = new tc({doLayout: false}, dom.byId('account-tabs'));
+           tabs.startup(activeDiv, win.getBox());
+       }
 
-function init(){
-    var typeselect = document.getElementById('charttype');
-    typeselect.addEventListener(
-              'blur', 
-              changetype,
-              true
-   );
-   changetype()
-}
+);
 
-function changetype() {
-   var typeselect = document.getElementById('charttype');
-   var headingrow = document.getElementById('heading-line');
-   var accdetails = document.getElementById('accdetails');
-   var dropdowns = document.getElementById('dropdowns');
-   if (typeselect.value == 'A'){
-         accdetails.style.display = 'block';
-         dropdowns.style.display = 'block';
-   } else {
-         accdetails.style.display = 'none';
-         dropdowns.style.display = 'none';
-   }
-}

Modified: trunk/UI/lib/Loader.js
===================================================================
--- trunk/UI/lib/Loader.js	2013-10-14 14:26:53 UTC (rev 6130)
+++ trunk/UI/lib/Loader.js	2013-10-15 07:26:11 UTC (rev 6131)
@@ -177,7 +177,8 @@
                                              { "name": input.name,
                                             "options": optlist,
                                               "title": input.title,
-                                                 "id": input.id
+                                                 "id": input.id,
+                                            "on_load": input.on_load
                                              } , input); 
                                   }
                  },

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


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits