reservation-list.html 2.44 KB
Newer Older
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
<style>
 .panel-body-dashboard {
     padding: 2px;
 }
 .table-dashboard {
     margin: 1px;
 }
 .popover{
     max-width: 800px;
 }
 .table-condensed > thead > tr > th,
 .table-condensed > tbody > tr > th,
 .table-condensed > tfoot > tr > th,
 .table-condensed > thead > tr > td,
 .table-condensed > tbody > tr > td,
 .table-condensed > tfoot > tr > td {
     padding: 2px;
 }
 .panel-heading-list {
     padding: 2px;
 }
</style>
<div>
  <div class='panel panel-default'>
    <div class="panel-heading panel-heading-list">
      <h5>
	<center><%- name %> Reservations</center>
      </h5>
    </div>
    <div class='panel-body panel-body-dashboard'>
      <table class='tablesorter' id='reservations-table-<%- name %>'>
	<thead>
	  <tr>
	    <% if (showidx) { %><th>IDX</th><% } %>
	    <% if (showuser) { %><th>Creator</th><% } %>
	    <% if (showproject) { %><th>Project</th><% } %>
	    <th>Type</th>
	    <th>Count</th>
	    <th>Starts</th>
	    <th>Ends</th>
	  </tr>
	</thead>
	<tbody>
	  <% _.each(reservations, function(value, idx) { %>
	    <tr <% if (showidx) { %> data-idx="<%- value.idx %>"
				     data-pid="<%- value.pid %>"
				     data-cluster="<%- value.cluster %>"<% } %>>
	      <% if (showidx) { %>
		<td><%- value.idx %>
		  <a href="#" class="delete-button">
		    <span class='glyphicon glyphicon-remove pull-right'
			  style='color: red; margin-left: 3px;
				 margin-bottom: 4px;'></span>
		  </a>
		  <a href="reserve.php?edit=1&cluster=<%- value.cluster %>&idx=<%- value.idx %>"
		     class="edit-button">
		    <span class='glyphicon glyphicon-pencil pull-right'
			  style='color: red; margin-bottom: 4px;'></span>
		  </a>
		</td>
	      <% } %>	    
62
	      <% if (showuser) { %>
63
		<td style='white-space: nowrap;'>
64
65
66
67
68
69
70
		  <% if (value.creator_idx) { %>
		    <a href='user-dashboard.php?user=<%- value.creator_uid %>'>
		      <%- value.creator_uid %></a>
		  <% } else { %>
		    <%- value.creator_uid %>
		  <% } %>
		</td>
71
72
73
	      <% } %>	    
	      <% if (showproject) { %>	  
		<td style='white-space: nowrap;'>
74
75
76
77
78
79
80
		  <% if (value.pid_idx) { %>
		    <a href='show-project.php?project=<%- value.pid %>'>
		      <%- value.pid %></a>
		  <% } else { %>
		    <%- value.pid %>
		  <% } %>
		</td>
81
82
83
84
85
86
87
88
89
90
91
92
	      <% } %>
	      <td><%- value.type %></td>
	      <td><%- value.count %></td>
	      <td class="format-date"><%- value.start %></td>
	      <td class="format-date"><%- value.end %></td>
	    </tr>
	  <% }); %>
	</tbody>
      </table>
    </div>
  </div>
</div>