← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16141: event capture - hide event comments div if no comment exists

 

------------------------------------------------------------
revno: 16141
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Tue 2014-07-15 22:46:26 +0200
message:
  event capture - hide event comments div if no comment exists
modified:
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/i18n/en.json
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html
  dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/i18n/en.json'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/i18n/en.json	2014-07-15 15:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/i18n/en.json	2014-07-15 20:46:26 +0000
@@ -42,7 +42,7 @@
     "show_details": "Show details",
     "add_your_comment_here": "Add your comment here",
     "comments": "Comments",
-    "comment: "Comment",
+    "comment": "Comment",
     "recorded_comments": "Recorded comments",
     "show_comments": "Show comments",
     "new_event": "New Event",

=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html	2014-07-15 15:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/customForm.html	2014-07-15 20:46:26 +0000
@@ -53,26 +53,28 @@
         {{'comments'| translate}}
     </h4>
     <textarea rows="3" ng-model="note.value" placeholder="{{'add_your_comment_here'| translate}}" style="width:50%;"></textarea>
-    <table class="listTable dhis2-table-striped-border dhis2-table-hover" style='width: 50%;'>     
-        <thead>
-            <tr>
-                <th style="width:100%;">
-                    {{'recorded_comments' | translate}}
-                </th>
+    <div ng-if="currentEvent.notes">
+        <table class="listTable dhis2-table-striped-border dhis2-table-hover" style='width: 50%;'>     
+            <thead>
+                <tr>
+                    <th style="width:100%;">
+                        {{'recorded_comments' | translate}}
+                    </th>
+                </tr>
+            </thead>
+            <tr ng-repeat="note in currentEvent.notes">
+                <td class="over-flow-hidden" style="width:100%;">
+                    <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
+                        <div>{{note.value}}</div>
+                    </d2-pop-over>
+                    <script type="text/ng-template" id="note.html">
+                        <p>{{content.value}}</p>
+                        <hr>
+                        <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
+                        <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
+                    </script>
+                </td>
             </tr>
-        </thead>
-        <tr ng-repeat="note in currentEvent.notes">
-            <td class="over-flow-hidden" style="width:100%;">
-                <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
-                    <div>{{note.value}}</div>
-                </d2-pop-over>
-                <script type="text/ng-template" id="note.html">
-                    <p>{{content.value}}</p>
-                    <hr>
-                    <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
-                    <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
-                </script>
-            </td>
-        </tr>
-    </table>
+        </table>    
+    </div>    
 </div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html'
--- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2014-07-15 15:47:26 +0000
+++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2014-07-15 20:46:26 +0000
@@ -122,25 +122,28 @@
 </h4>
 <textarea rows="3" ng-model="note.value" placeholder="{{'add_your_comment_here'| translate}}" style="width:99%;"></textarea>
 
-<table class="listTable dhis2-table-striped-border dhis2-table-hover"> 
-    <thead>
-        <tr>
-            <th style="width:100%;">
-                {{'recorded_comments' | translate}}
-            </th>
+<div ng-if="currentEvent.notes">
+    
+    <table class="listTable dhis2-table-striped-border dhis2-table-hover"> 
+        <thead>
+            <tr>
+                <th style="width:100%;">
+                    {{'recorded_comments' | translate}}
+                </th>
+            </tr>
+        </thead>
+        <tr ng-repeat="note in currentEvent.notes">
+            <td class="over-flow-hidden" style="width:100%;">
+                <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
+                    <div>{{note.value}}</div>
+                </d2-pop-over>
+                <script type="text/ng-template" id="note.html">
+                            <p>{{content.value}}</p>
+                            <hr>
+                            <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
+                            <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
+                </script>
+            </td>
         </tr>
-    </thead>
-    <tr ng-repeat="note in currentEvent.notes">
-        <td class="over-flow-hidden" style="width:100%;">
-            <d2-pop-over content="note" template="note.html" details="{{'details'| translate}}">
-                <div>{{note.value}}</div>
-            </d2-pop-over>
-            <script type="text/ng-template" id="note.html">
-                        <p>{{content.value}}</p>
-                        <hr>
-                        <p><strong>{{'created_by' | translate}}: </strong>{{content.storedBy}}</p>
-                        <p><strong>{{'date' | translate}}: </strong>{{content.storedDate}}</p>                           
-            </script>
-        </td>
-    </tr>
-</table>
\ No newline at end of file
+    </table>
+</div>
\ No newline at end of file