Browse Source

use the /document/ route instead of /dashboard + minor fixes

damien 11 years ago
parent
commit
e5b5c8cbc2

BIN
pboard/pboard/public/img/glyphicons-halflings-white.png View File


BIN
pboard/pboard/public/img/glyphicons-halflings.png View File


+ 64 - 0
pboard/pboard/templates/data.mak View File

@@ -25,3 +25,67 @@ the entries as JSON.  Here, try it out: <a href="/data.html?a=1&b=2">/data.html?
25 25
         %endfor
26 26
     </table>
27 27
 
28
+  <div class="well span3 text-center">
29
+    <div>
30
+    </div>
31
+    <table id='keyboard'>
32
+      <tr>
33
+        <td colspan="5">
34
+          <input type='text' class="text-right" id='calculation'/><br/>
35
+          <input type='text' class="text-right" readonly id='result'/>
36
+        </td>
37
+      </tr>
38
+      <tr>
39
+        <td><span class='btn'>7</span></td>
40
+        <td><span class='btn'>8</span></td>
41
+        <td><span class='btn'>9</span></td>
42
+        <td><span class='btn'>(</span></td>
43
+        <td><span class='btn'>)</span></td>
44
+      </tr>
45
+      <tr>
46
+        <td><span class='btn'>4</span></td>
47
+        <td><span class='btn'>5</span></td>
48
+        <td><span class='btn'>6</span></td>
49
+        <td><span class='btn'>-</span></td>
50
+        <td><span class='btn'>+</span></td>
51
+      </tr>
52
+      <tr>
53
+        <td><span class='btn'>1</span></td>
54
+        <td><span class='btn'>2</span></td>
55
+        <td><span class='btn'>3</span></td>
56
+        <td><span class='btn'>/</span></td>
57
+        <td><span class='btn'>*</span></td>
58
+      </tr>
59
+      <tr>
60
+        <td><span class='btn'>.</span></td>
61
+        <td><span class='btn'>0</span></td>
62
+        <td><span class='btn'>%</span></td>
63
+        <td><span class='btn btn-success'>=</span></td>
64
+        <td><span class='btn btn-danger'>C</span></td>
65
+      </tr>
66
+    </table>
67
+    <script src="http://code.jquery.com/jquery.js"></script>
68
+    <script src="${tg.url('/javascript/bootstrap.min.js')}"></script>
69
+
70
+    <script>
71
+      $(document).ready(function() {
72
+        $('#keyboard span').on('click', function (e) {
73
+          current_value = $(this).text()
74
+          if(current_value=='C') {
75
+            $('#calculation').val('');
76
+            $('#result').val('');
77
+          } else if(current_value=='=') {
78
+            string = $('#calculation').val().replace(/[^0-9+-/\*\%\(\)]/gi, ''); // replace('/[^0-9()*/-+]/g', "");
79
+            console.log("Compute value of "+string)
80
+            calculation = eval(string);
81
+            console.log("Result is: "+calculation)
82
+            $('#result').val(calculation)
83
+          } else {
84
+            field = $('#calculation')
85
+            field.oldval = field.val();
86
+            field.val(field.oldval+current_value)
87
+          }
88
+        });
89
+      });
90
+    </script>
91
+  </div>

+ 5 - 5
pboard/pboard/templates/document.mak View File

@@ -150,7 +150,7 @@ POD :: ${current_node.getTruncatedLabel(40)} [${current_node.getStatus().label}]
150 150
             <li class="active"><a href="#tags" data-toggle="tab" title="${_('Tags')}"><i class='icon-g-tags'></i></a></li>
151 151
             <li><a href="#events" data-toggle="tab" title="History"><i class="icon-g-history"></i></a></li>
152 152
             <li><a href="#contacts" data-toggle="tab" title="Contacts"><i class="icon-g-user""></i> </a></li>
153
-            <li><a href="#comments" data-toggle="tab" title="Comments"><i class="icon-g-comments"></i> </a></li>
153
+            <li><a href="#comments" data-toggle="tab" title="Comments"><i class="icon-g-conversation"></i> </a></li>
154 154
             <li><a href="#files" data-toggle="tab" title="Files"><i class="icon-g-attach"></i> </a></li>
155 155
         </ul>
156 156
         <div class="tab-content">
@@ -313,10 +313,10 @@ POD :: ${current_node.getTruncatedLabel(40)} [${current_node.getStatus().label}]
313 313
             % else:
314 314
               <table class="table table-striped table-hover table-condensed">
315 315
                 % for comment in current_node.getComments():
316
-                  <tr title="Last updated: ${event.updated_at}">
316
+                  <tr title="Last updated: ${comment.updated_at}">
317 317
                     <td>
318
+                      <i>The ${comment.getFormattedDate(comment.updated_at)} at ${comment.getFormattedTime(comment.updated_at)}, comment.author wrote: </i><br/>
318 319
                       <b>${comment.data_label}</b><br/>
319
-                      <i>commented by comment.author the ${comment.getFormattedDate(comment.updated_at)} at ${comment.getFormattedTime(comment.updated_at)}</i></br>
320 320
                       <p>
321 321
                         ${comment.data_content|n}
322 322
                       </p>
@@ -360,13 +360,13 @@ POD :: ${current_node.getTruncatedLabel(40)} [${current_node.getStatus().label}]
360 360
             % else:
361 361
               <table class="table table-striped table-hover table-condensed">
362 362
                 % for current_file in current_node.getFiles():
363
-                  <tr title="Last updated: ${event.updated_at}">
363
+                  <tr title="Last updated: ${current_file.updated_at}">
364 364
                     <td>
365 365
                       <img src="${tg.url('/api/get_file_content_thumbnail/%s'%(current_file.node_id))}" class="img-polaroid">
366 366
                     </td>
367 367
                     <td>
368 368
                       <b>${current_file.data_label}</b><br/>
369
-                      <i>commented by comment.author the ${current_file.getFormattedDate(comment.updated_at)} at ${current_file.getFormattedTime(comment.updated_at)}</i></br>
369
+                      <i>commented by comment.author the ${current_file.getFormattedDate(current_file.updated_at)} at ${current_file.getFormattedTime(current_file.updated_at)}</i></br>
370 370
                       <p>
371 371
                         ${current_file.data_content|n}
372 372
                       </p>

+ 2 - 2
pboard/pboard/templates/master.mak View File

@@ -476,13 +476,13 @@ tr:Hover td div.pod-toolbar {
476 476
         <a class="brand" href="#"><!--img src="${tg.url('/img/turbogears_logo.png')}" alt="TurboGears 2"/--> <strong>pod</strong></a>
477 477
         <div class="nav-collapse">
478 478
           <ul class="nav">
479
-            <li class="active"><a href="${tg.url('/dashboard')}"><i class="icon-home icon-white"></i> Dashboard</a></li>
479
+            <li class="active"><a href="${tg.url('/document')}"><i class="icon-g-book-open"></i> ${_('Documents')}</a></li>
480 480
             <li>
481 481
               <a title="${_('Toggle view mode: narrow')}" id='view-size-toggle-button-small' style="display: none;"><i class='icon-g-eye-open'></i> ${_('View mode')}</a>
482 482
               <a title="${_('Toggle view mode: medium')}" id='view-size-toggle-button-medium'><i class='icon-g-eye-open'></i> ${_('View mode')}</a>
483 483
               <a title="${_('Toggle view mode: large')}" id='view-size-toggle-button-large' style="display: none;"><i class='icon-g-eye-open'></i> ${_('View mode')}</a>
484 484
             </li>
485
-            <li><a href="#">Link</a></li>
485
+            <li><a href="${tg.url('/iconset')}"><i class="icon-g-show-thumbnails"></i> ${_('Icons')}</a></li>
486 486
 
487 487
           % if request.identity:
488 488
             <li class="dropdown">