Fix generated timeline table markup

pull/913/head
Till Breuer 11 years ago
parent 51ebb8f74d
commit bbd32c7ccc
  1. 5
      app/assets/javascripts/angular/directives/timeline-table-row-directive.js
  2. 6
      app/assets/javascripts/angular/helpers/timeline-table-helper.js
  3. 17
      public/templates/timelines/timeline_table.html

@ -4,7 +4,10 @@ openprojectApp.directive('timelineTableRow', [function() {
// TODO restrict to 'E' once https://github.com/angular/angular.js/issues/1459 is solved // TODO restrict to 'E' once https://github.com/angular/angular.js/issues/1459 is solved
scope: true, scope: true,
link: function(scope, element, attributes) { link: function(scope, element, attributes) {
scope.rowObject = scope.row.payload; var rowObject = scope.row.payload;
scope.rowObject = rowObject;
scope.changeDetected = rowObject.objectType === 'PlanningElement' && (rowObject.hasAlternateDates() || rowObject.isNewlyAdded() || rowObject.isDeleted());
scope.indent = scope.hideTreeRoot ? scope.row.level-1 : scope.row.level; scope.indent = scope.hideTreeRoot ? scope.row.level-1 : scope.row.level;
// set dom element // set dom element

@ -22,11 +22,13 @@ openprojectApp.factory('TimelineTableHelper', [function() {
} }
// first level group // first level group
if(node.payload.objectType === 'Project') { isNested = node.level >= 2;
if (node.payload.objectType === 'Project' && !isNested) {
node.firstLevelGroup = node.payload.getFirstLevelGrouping(); node.firstLevelGroup = node.payload.getFirstLevelGrouping();
node.firstLevelGroupingName = node.payload.getFirstLevelGroupingName(); node.firstLevelGroupingName = node.payload.getFirstLevelGroupingName();
} else { } else {
node.firstLevelGroup = parent.firstLevelGroup; // inherit group from parent
node.firstLevelGroup = parent.firstLevelGroup;
} }
}, },

@ -2,9 +2,7 @@
<thead> <thead>
<tr> <tr>
<th class="tl-first-column" ng-style="{height: height}">{{I18n.t('js.timelines.filter.column.name')}}</th> <th class="tl-first-column" ng-style="{height: height}">{{I18n.t('js.timelines.filter.column.name')}}</th>
<th ng-repeat="key in columns"> <th ng-repeat="key in columns">{{I18n.t('js.timelines.filter.column.' + key)}}</th>
{{I18n.t('js.timelines.filter.column.' + key)}}
</th>
</tr> </tr>
</thead> </thead>
@ -25,7 +23,6 @@
ng-class="{ ng-class="{
'tl-first-row': $first, 'tl-first-row': $first,
'tl-last-row': $last, 'tl-last-row': $last,
'tl-grouping': isGrouping,
'tl-project-row': rowObject.objectType === 'Project' 'tl-project-row': rowObject.objectType === 'Project'
}" }"
ng-show="row.ancestors | ancestorsExpanded" ng-show="row.ancestors | ancestorsExpanded"
@ -42,19 +39,17 @@
</a> </a>
<span class="tl-word-ellipsis"> <span class="tl-word-ellipsis">
<span> <span ng-if="changeDetected">
<a title="{{I18n.t('js.timelines.change')}}" <a title="{{I18n.t('js.timelines.change')}}"
ng-class="{ ng-class="{
'icon tl-icon-added': rowObject.objectType === 'PlanningElement' && rowObject.isNewlyAdded(), 'icon tl-icon-added': rowObject.isNewlyAdded(),
'icon tl-icon-deleted': rowObject.objectType === 'PlanningElement' && rowObject.isDeleted(), 'icon tl-icon-deleted': rowObject.isDeleted(),
'icon tl-icon-changed': rowObject.objectType === 'PlanningElement' && rowObject.hasAlternateDates() 'icon tl-icon-changed': !rowObject.isDeleted() && !rowObject.isNewlyAdded()
}" /> }" />
</span> </span>
<span> <span>
<a modal title="{{row.text}}" target="row.url" ng-class="{'tl-discreet-link': true, 'tl-project': rowObject.objectType === 'Project'}"> <a modal title="{{row.text}}" target="row.url" ng-class="{'tl-discreet-link': true, 'tl-project': rowObject.objectType === 'Project'}">{{row.text}}</a>
{{row.text}}
</a>
</span> </span>
</span> </span>
</td> </td>

Loading…
Cancel
Save