forked from NeonSwan/nexudus-spaces-default-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresources.htm
245 lines (220 loc) · 11.9 KB
/
resources.htm
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
{% extends master.master %}
{% block content %}
<div id="wrapper">
<!-- CONTAINER -->
<div id="main" class="container">
<!-- BREADCRUMB -->
<ul class="breadcrumb">
<li><a href="{% Url PublicHome, Index %}">{% T Home %}</a> <span class="divider">/</span></li>
<li class="active">{% T Space resources %}</li>
</ul>
<!-- END BREADCRUMB -->
<div class="row">
<!-- CONTENT -->
<section id="content" class="span9">
{% for resource in data.Resources %}
<article class="post" style="min-height: 285px">
<h2 class="page-title"><a href="{% Url PublicResources, Details, id: resource.Id, name: resource.Name | Clean %}">{{ resource.Name }}</a></h2>
<!-- POST CONTENT -->
<div class="body-content">
<div class="row">
<div class="span2">
{% if resource.HasImage %}
<a href="{% Url PublicResources, Details, id: resource.Id, name: resource.Name | Clean %}" class="thumbnail pull-left">
<img style="width: 100%" data-large-image="{% Url PublicResources, GetImage, id: resource.Id, h: 800, w: 800 %}" src="{% Url PublicResources, GetImage, id: resource.Id, h: 200, w: 200 %}" alt="{{ resource.Name }}" class="entry-image" />
</a>
<div class="clearfix"></div>
{% endif %}
</div>
<div class="{% if resource.HasImage %}span7{% else %}span12{% endif %}">
<p>{{ resource.Description }}</p>
<p>
<a href="{% Url PublicResources, Details, id: resource.Id, name: resource.Name | Clean %}">{% T View more details %}</a>
|
<a href="javascript: window.prompt('{{ resource.Name }}. Calendar URL:','http://{{ data.Domain }}{% Url Feeds, ResourceBookings, guid: resource.UniqueId %}'); return false;">{% T Calendar Feed %}</a>
</p>
</div>
</div>
</div>
<div class="row">
<div class="span9">
<p class="resource_features">
{% if resource.Allocation > 0 %}
<span class="btn btn-grey">
<strong>{{resource.Allocation}}</strong>
<span aria-hidden="true" class="icon i-16 icon-user"></span>
</span>
{% endif %}
{% if resource.Projector %}
<span data-toggle="popover" data-placement="top" data-content="{% T Projector %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-camera-2"></span></span>
{% endif %}
{% if resource.Internet %}
<span data-toggle="popover" data-placement="top" data-content="{% T Internet %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-globe"></span></span>
{% endif %}
{% if resource.ConferencePhone %}
<span data-toggle="popover" data-placement="top" data-content="{% T Conference phone %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-tree"></span></span>
{% endif %}
{% if resource.StandardPhone %}
<span data-toggle="popover" data-placement="top" data-content="{% T Phone %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-phone"></span></span>
{% endif %}
{% if resource.WhiteBoard %}
<span data-toggle="popover" data-placement="top" data-content="{% T Whiteboard / flipboard %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-signup"></span></span>
{% endif %}
{% if resource.LargeDisplay %}
<span data-toggle="popover" data-placement="top" data-content="{% T Large display %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-screen"></span></span>
{% endif %}
{% if resource.Catering %}
<span data-toggle="popover" data-placement="top" data-content="{% T Catering %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-food"></span></span>
{% endif %}
{% if resource.TeaAndCoffee %}
<span data-toggle="popover" data-placement="top" data-content="{% T Tea and coffee %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-mug"></span></span>
{% endif %}
{% if resource.Drinks %}
<span data-toggle="popover" data-placement="top" data-content="{% T Drinks %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-glass"></span></span>
{% endif %}
{% if resource.SecurityLock %}
<span data-toggle="popover" data-placement="top" data-content="{% T Lock %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-lock"></span></span>
{% endif %}
{% if resource.CCTV %}
<span data-toggle="popover" data-placement="top" data-content="{% T CCTV %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-camera-2"></span></span>
{% endif %}
{% if resource.VoiceRecorder %}
<span data-toggle="popover" data-placement="top" data-content="{% T Voice recorder %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-radio-checked"></span></span>
{% endif %}
{% if resource.AirConditioning %}
<span data-toggle="popover" data-placement="top" data-content="{% T Air conditioning %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-dashboard"></span></span>
{% endif %}
{% if resource.Heating %}
<span data-toggle="popover" data-placement="top" data-content="{% T Heating %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-dashboard"></span></span>
{% endif %}
{% if resource.NaturalLight %}
<span data-toggle="popover" data-placement="top" data-content="{% T Natural light %}" data-trigger="hover" class="btn btn-grey"><span aria-hidden="true" class="icon i-16 icon-brightness-medium"></span></span>
{% endif %}
</p>
</div>
</div>
<div class="row">
<div class="span9">
<div class="well text-center">
{% if data.Coworker != null %}
<a href="#" onclick="$('#Booking_Resource').val({{ resource.Id }});createBooking(new Date());return false;" class="btn btn-orange">{% T Make a booking %}</a>
{% else %}
<a href="{% Url Login, Index, lang: data.Language %}&returnUrl={% Url PublicResources, Details, id: resource.Id, name: resource.Name | Clean %}" class="btn btn-orange">{% T Login to make a booking %}</a>
{% endif %}
</div>
</div>
</div>
<!-- END POST CONTENT -->
</article>
{% endfor %}
</section>
<!-- END CONTENT -->
<!-- SIDEBAR -->
<aside id="sidebar-right" class="span3">
{% if data.Setting_Social_Flickr != "" %}
<!-- WIDGET FLICKR -->
<div class="widget widget-flickr">
<div class="widget-title">
<h3>{% T Flickr Feed %}</h3>
</div>
<div class="widget-body">
<ul>
</ul>
</div>
</div>
<!-- END WIDGET FLICKR -->
{% endif %}
</aside>
<!-- END SIDEBAR -->
</div>
</div>
<!-- END CONTAINER -->
</div>
{% include booking.htm %}
{% endblock %}
{% block script %}
<script>
$(function () {
//init popovers
$('.resource_features span').popover();
var coeff = 1000 * 60 * 15;
//Initialize timepickers
$("#Booking_From").datetimepicker({ language: '{{ data.Language }}', format: "dd MM yyyy - HH:ii P", minuteStep: 15, showMeridian: true, autoclose: true, todayBtn: true, startDate: '+0d' });
$("#Booking_To").datetimepicker({ language: '{{ data.Language }}', format: "dd MM yyyy - HH:ii P", minuteStep: 15, showMeridian: true, autoclose: true, todayBtn: true, startDate: '+0d', startView: 1 });
//If todate is > from date, move to date ahead
$('#Booking_From').on('changeDate', function () {
var fromDate = $('#Booking_From').datetimepicker('getDate');
var toDate = $('#Booking_To').datetimepicker('getDate');
//Round the date
fromDate = new Date(Math.round(fromDate.getTime() / coeff) * coeff);
$('#Booking_From').datetimepicker('setDate', fromDate);
$('#Booking_To').datetimepicker('setStartDate', fromDate);
if (fromDate > toDate)
$('#Booking_To').datetimepicker('setDate', fromDate);
checkBooking();
});
//If todate is > from date, move from date back
$('#Booking_To').on('changeDate', function () {
var fromDate = $('#Booking_From').datetimepicker('getDate');
var toDate = $('#Booking_To').datetimepicker('getDate');
//Round the date
toDate = new Date(Math.round(toDate.getTime() / coeff) * coeff);
$('#Booking_To').datetimepicker('setDate', toDate);
$('#Booking_From').datetimepicker('setEndDate', toDate);
if (fromDate > toDate) {
$('#Booking_From').datetimepicker('setDate', toDate);
}
checkBooking();
});
$('#modal_booking form').on("submit", function (event) {
var id = $('#booking_id').val();
var url;
if (id > 0)
url = '{% Url Bookings, BookingJson %}';
else
url = '{% Url Bookings, NewBookingJson %}';
var data = getBookingData();
postAndClose(url, data, function () { location.reload(true); });
event.preventDefault();
});
$('#delete-button').click(function () {
if (confirm('{% T Cancel this booking? %}')) {
var url = '{% Url Bookings, DeleteJson %}';
var id = $('#booking_id').val();
postAndClose(url, { id: id }, function () { location.reload(true); });
}
return false;
});
$('#Booking_Resource').attr('data-bind', 'event: { change: updateProducts }');
var loadProducts = function () {
var bid = $('#booking_id').val();
if (bid && bid > 0)
return $.post('/en/bookings/GetResourceProducts?bookingId=' + bid + '&resourceId=' + $('#Booking_Resource').val());
else
return $.post('/en/bookings/GetResourceProducts?resourceId=' + $('#Booking_Resource').val());
}
var mapData = function (data) {
return vm.bookingProducts = ko.mapping.fromJS(data);
}
var updateData = function (data) {
return vm.bookingProducts = ko.mapping.fromJS(data, vm.bookingProducts);
}
var applyBindings = function () {
return ko.applyBindings(vm);
}
var updateProducts = function () {
$.when(loadProducts())
.then(updateData)
.then(checkBooking);
}
vm = {
bookingProducts: ko.observableArray(),
updateProducts: updateProducts,
checkBooking: checkBooking
};
$.when(loadProducts())
.then(mapData)
.then(applyBindings);
});
</script>
{% endblock %}