-
Notifications
You must be signed in to change notification settings - Fork 602
/
Copy pathteam_view.hbs
153 lines (129 loc) · 6.11 KB
/
team_view.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{{> header }}
<h1>Team View</h1>
<div class="row">
<div class="col-md-6 lead">{{logged_user.name}} {{logged_user.lastname}}'s team <a href="/calendar/feeds/" data-toggle="tooltip" data-placement="right" title="Export Team View to external calendars"><span class="fa fa-rss"></span></a></div>
<div class="col-md-3 col-md-offset-3">
<div class="btn-group btn-group-sm pull-right" role="group">
<a href="/calendar/teamview/?{{> team_view_url_parameters grouped_mode = 0 save_grouped_mode = 1 save_current_department = 1 }}" class="btn btn-default" {{#unless grouped_mode}}disabled=disabled{{/unless}}>All</a>
<a href="/calendar/teamview/?{{> team_view_url_parameters grouped_mode = 1 save_grouped_mode = 1 save_current_department = 1 }}" class="btn btn-default" {{#if grouped_mode}}disabled=disabled{{/if}}>By department</a>
</div>
</div>
</div>
{{> show_flash_messages }}
<div class="row"> </div>
<nav>
<div class="row">
<div class="col-xs-2">
<a class="btn btn-link btn-lg" href="/calendar/teamview/?{{> team_view_url_parameters base_date = prev_date }}"><span aria-hidden="true" class="fa fa-chevron-left"></span> {{as_date_formatted prev_date 'MMM' }}</a>
</div>
<div class="col-xs-8 calendar-section-caption">
<button id="team_view_month_select_btn" class="btn btn-link btn-lg" data-tom="/calendar/teamview/?{{> team_view_url_parameters base_date=0 }}" data-provide="datepicker" data-date-format="yyyy-mm" data-date-autoclose="1" data-date-min-view-mode="months">{{as_date_formatted base_date 'MMMM, YYYY' }} <i class="fa fa-angle-down"></i></button>
</div>
<div class="col-xs-2">
<a class="btn btn-link btn-lg pull-right" href="/calendar/teamview/?{{> team_view_url_parameters base_date = next_date }}">{{as_date_formatted next_date 'MMM'}} <span aria-hidden="true" class="fa fa-chevron-right"></span></a>
</div>
</div>
</nav>
<div class="row"> </div>
{{#if grouped_mode}}
{{#each users_and_leaves_by_departments}}
{{#if @index}}
<div class="row">
<div class="col-md-12"> </div>
</div>
{{/if}}
<div class="row clearfix">
<div class="col-md-12">
<table class="team-view-table table-hover">
<thead>
<tr>
<td class="team-view-header" colspan="2">
<div class="pull-left">
<h3>{{this.departmentName}}</h3>
</div>
</td>
{{#each this.users_and_leaves.0.days }}
<td colspan="2" class="team-view-header"><b>{{as_date_formatted this.moment 'dd'}}</b></td>
{{/each}}
</tr>
</thead>
<tbody>
{{#each this.users_and_leaves}}
<tr class="teamview-user-list-row" data-vpp-user-list-row={{this.user.id}}>
<td class="left-column-cell cross-link user-details-summary-trigger" data-user-id={{this.user.id}}>{{#if ../../logged_user.admin}} {{#with this.user }}<a href="/users/edit/{{this.id}}/">{{ this.full_name }}</a>{{/with}}{{else}}{{#with this.user }}<span>{{ this.full_name }}</span>{{/with}}{{/if}}</td>
<td>
<span class="teamview-deducted-days"
{{#if statistics }}
data-content="In {{as_date_formatted ../../base_date 'MMMM, YYYY' }} {{#with this.user }}{{this.full_name}} used {{../../statistics.deducted_days }} days from allowance{{/with}}"
data-placement="right"
data-toggle="popover"
data-trigger="focus hover"
{{/if}}
>
{{#if statistics }}{{ statistics.deducted_days }}{{/if}}
</span>
</td>
{{#each this.days}}
{{> calendar_cell day = this}}
{{/each}}
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
{{/each}}
{{else}}
<div class="row clearfix">
<div class="col-md-12">
<table class="team-view-table table-hover">
<thead>
<tr>
<td class="team-view-header" colspan="2">
<div class="dropdown pull-left">
<button class="btn btn-default dropdown-toggle left-column-cell" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{#if current_department }}{{current_department.name}}{{else}}All departments{{/if}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li><a href="?{{> team_view_url_parameters current_department = null save_current_department = 1 }}">All</a></li>
<li role="separator" class="divider"></li>
{{#each related_departments}}
<li><a href="?{{> team_view_url_parameters base_date = ../base_date current_department = this save_current_department = 1 }}">{{this.name}}</a></li>
{{/each}}
</ul>
</div>
</td>
{{#each users_and_leaves.0.days }}
<td colspan="2" class="team-view-header"><b>{{as_date_formatted this.moment 'dd'}}</b></td>
{{/each}}
</tr>
</thead>
<tbody>
{{#each users_and_leaves}}
<tr class="teamview-user-list-row" data-vpp-user-list-row={{this.user.id}}>
<td class="left-column-cell cross-link user-details-summary-trigger" data-user-id={{this.user.id}}>{{#if ../logged_user.admin}} {{#with this.user }}<a href="/users/edit/{{this.id}}/">{{ this.full_name }}</a>{{/with}}{{else}}{{#with this.user }}<span>{{ this.full_name }}</span>{{/with}}{{/if}}</td>
<td>
<span class="teamview-deducted-days"
{{#if statistics }}
data-content="In {{as_date_formatted ../base_date 'MMMM, YYYY' }} {{# with this.user }}{{this.full_name}} used {{../statistics.deducted_days }} days from allowance{{/with}}"
data-placement="right"
data-toggle="popover"
data-trigger="focus hover"
{{/if}}
>
{{#if statistics }}{{ statistics.deducted_days }}{{/if}}
</span>
</td>
{{#each this.days}}
{{> calendar_cell day = this}}
{{/each}}
</tr>
{{/each}}
</tbody>
</table>
</div>
</div>
{{/if}}
<div class="row clearfix"> </div>
{{> footer }}