OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/frontend/app/components/wp-table/wp-table.directive.html

189 lines
6.8 KiB

<div class="generic-table--container work-package-table--container"
ng-class="{ '-with-footer': displaySums }">
<div class="generic-table--results-container" ng-if="rows.length">
<table interactive-table class="keyboard-accessible-list generic-table">
<colgroup>
<col highlight-col />
<col highlight-col ng-repeat="column in columns" />
</colgroup>
<thead>
<tr>
<th class="checkbox -short hide-when-print">
<div class="generic-table--header-outer">
<a href
alt="{{ text.toggleRows }}"
class="no-decoration-on-hover"
ng-click="setCheckedStateForAllRows(!(rows | allRowsChecked))"
9 years ago
title="{{ text.toggleRows }}">
9 years ago
<icon-wrapper icon-title="{{ text.toggleRows }}"
icon-name="checkmark"></icon-wrapper>
</a>
</div>
</th>
<th sort-header ng-repeat="column in columns"
has-dropdown-menu
position-relative-to=".generic-table--sort-header-outer"
target="columnContextMenu"
locals="columns, column"
locale="column.custom_field && columns.custom_field.name_locale || locale"
header-name="column.name"
header-title="column.title"
sortable="column.sortable"
query="query"
ng-class="column.name == 'id' && '-short' ">
</th>
</tr>
</thead>
<tbody>
<!-- Group headers -->
9 years ago
<tr wp-group-header
ng-repeat-start="row in rows"
ng-if="!!groupByColumn &&
($first || row.groupName !== rows[$index-1].groupName)"
ng-class="{
group: true,
open: groupExpanded[currentGroup],
closed: !groupExpanded[currentGroup],
keyboard_hover: true
}"
id="group-header-{{ row.groupName }}">
<td colspan="{{ columns.length + 2 - (!!hideWorkPackageDetails * 1) }}">
<div ng-class="[
'expander',
'icon-context',
'icon-' + (groupExpanded[currentGroup] && 'minus2' || 'plus')
]"
ng-click="toggleCurrentGroup()">
<span ng-class="{
'hidden-for-sighted': true,
expand: !groupExpanded[currentGroup],
collapse: groupExpanded[currentGroup]
}">
{{ groupExpanded[currentGroup] && text.collapse || text.expand }}
</span>
<span class="hidden-for-sighted collapse">{{ text.collapse }}</span>
</div>
<div>
{{ currentGroupObject.value }}
<span class="count">
({{ currentGroupObject.count }})
</span>
</div>
</td>
</tr>
<!-- Work package rows -->
9 years ago
<tr wp-row
id="work-package-{{ row.object.id }}"
has-dropdown-menu
trigger-on-event="contextmenu"
target="WorkPackageContextMenu"
locals="rows,row"
after-focus-on=".id :focusable"
single-click="selectWorkPackage(row, $event)"
ng-dblclick="showWorkPackageDetails(row)"
ng-class="[
'issue',
'hascontextmenu',
row.checked && 'context-menu-selection',
!row.object['leaf?'] && 'parent' || '',
row.level > 0 && 'child idnt' || '',
row.level > 0 && ('idnt-' + row.level) || ''
]"
ng-show="!groupByColumn || groupExpanded[row.groupName]"
wp-edit-form="row.object">
<td class="checkbox -short hide-when-print">
<accessible-checkbox name="ids[]"
checkbox-id="work_package{{row.object.id}}"
checkbox-value="row.object.id"
checkbox-title="{{checkboxTitle}}"
model="row.checked"/>
</td>
<td ng-repeat="column in columns"
lang="{{column.custom_field && column.custom_field.name_locale || locale}}"
wp-edit-field="column.name"
class="wp-table--cell"
ng-class="{ '-short': column.name == 'id' }">
<wp-td attribute="column.name"
schema="row.object.schema"
object="row.object"
ng-class="[row.level > 0 && column.name == 'subject' && 'icon-context icon-arrow-right5 icon-small']">
</wp-td>
</td>
</tr>
<!-- Sums for groups -->
9 years ago
<tr wp-group-sums
ng-repeat-end
ng-if="sumsLoaded() && !!groupByColumn &&
($last || row.groupName !== rows[$index+1].groupName)"
ng-show="!groupByColumn || groupExpanded[row.groupName]"
ng-class="[
'group-sum',
'sum',
'grouped',
'group',
'issue',
'work_package'
]">
<td colspan="{{1 - (!!hideWorkPackageDetails * 1)}}">
9 years ago
{{ text.sumFor }}
{{ currentGroupObject.value }}
</td>
<td ng-repeat="column in columns">
<wp-td attribute="column.name"
schema="resource.sumsSchema"
object="currentGroupObject.sums">
</wp-td>
</td>
</tr>
</tbody>
<tfoot>
<!-- Total sums -->
<tr ng-if="sumsLoaded()"
class="sum group all issue work_package">
<td colspan="{{1 - (!!hideWorkPackageDetails * 1)}}">
<div class="generic-table--footer-outer">
{{ text.sumFor }} {{ text.allWorkPackages }}
</div>
</td>
<td ng-repeat="column in columns">
<wp-td class="generic-table--footer-outer"
attribute="column.name"
schema="resource.sumsSchema"
object="resource.totalSums">
</wp-td>
</td>
</tr>
</tfoot>
</table>
<div class="generic-table--header-background"></div>
<div class="generic-table--footer-background" ng-if="sumsLoaded()"></div>
</div>
<div class="generic-table--no-results-container" ng-if="!rows.length">
9 years ago
<i class="icon-info1"></i>
<h2 class="generic-table--no-results-title">
{{ text.noResults }}
</h2>
<div class="generic-table--no-results-description"
ng-bind-html="text.noResultsDescription"></div>
</div>
</div>