[BUGFIX] Hide comments section if there are no comments
authorTolleiv Nietsch <info@tolleiv.de>
Sun, 28 Aug 2011 15:49:28 +0000 (17:49 +0200)
committerTolleiv Nietsch <info@tolleiv.de>
Sun, 28 Aug 2011 15:49:28 +0000 (17:49 +0200)
Within the workspace list we shouldn't show the comments
section if a specific change has no comments.

Change-Id: I939df69d0c9f51fe2ef412b0040225b9f0362c10
Resolves: #29307
Branches: 4.5, 4.6

typo3/sysext/workspaces/Resources/Public/JavaScript/component.js

index 3c562b9..4777faf 100644 (file)
@@ -122,6 +122,7 @@ TYPO3.Workspaces.RowDetail.rowDetailTemplate = new Ext.XTemplate(
                                                '</div>',
                                        '</td>',
                                '</tr>',
+                               '<tpl if="this.hasComments(comments)">',
                                '<tr>',
                                        '<td class="t3-workspaces-foldout-subheaderLeft">',
                                                '<div class="t3-workspaces-foldout-subheader-container">User comments for <b>step {stage_position} of stage</b> "{label_Stage}"</div>',
@@ -150,12 +151,18 @@ TYPO3.Workspaces.RowDetail.rowDetailTemplate = new Ext.XTemplate(
                                        '<td class="char_select_profile_title">',
                                                '&nbsp;',
                                        '</td>',
+                                       '</tpl>',
                                '</tr>',
                        '</table>',
                '</tpl>',
        '</tpl>',
        '</div>',
-       '<div class="x-clear"></div>'
+       '<div class="x-clear"></div>',
+       {
+               hasComments: function(comments){
+                       return comments.length>0;
+               }
+       }
 );
 
 TYPO3.Workspaces.RowDetail.rowDataView = new Ext.DataView({