forked from NeonSwan/nexudus-spaces-default-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresource.htm
243 lines (218 loc) · 12.1 KB
/
resource.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
{% 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><a href="{% Url PublicResources, Index %}">{% T Space resources %}</a> <span class="divider">/</span></li>
<li class="active">{{ data.Local.Resource.Name }}</li>
</ul>
<!-- END BREADCRUMB -->
<div class="row">
<!-- CONTENT -->
<section id="content" class="span9">
<article class="post" style="min-height: 285px">
<h2 class="page-title"><a href="#">{{ data.Local.Resource.Name }}</a></h2>
<!-- POST CONTENT -->
<div class="body-content">
{% if data.Local.Resource.HasImage %}
<a href="#" class="thumbnail" style="margin-bottom: 10px">
<img src="{% Url PublicResources, GetImage, id: data.Local.Resource.Id, h: 1170 %}" alt="{{ resource.Name }}" class="entry-image" />
</a>
{% endif %}
<p>
{{ data.Local.Resource.Description }}
</p>
<p class="resource_features">
{% if data.Local.Resource.Allocation > 0 %}
<span class="btn btn-grey">
<strong>{{data.Local.Resource.Allocation}}</strong>
<span aria-hidden="true" class="icon i-16 icon-user"></span>
</span>
{% endif %}
{% if data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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 data.Local.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>
<p>
{% if data.Coworker != null %}
<a href="#" onclick="$('#Booking_Resource').val({{ data.Local.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: data.Local.Resource.Id, name: data.Local.Resource.Name | Clean %}" class="btn btn-orange">{% T Login to make a booking %}</a>
{% endif %}
</p>
</div>
<a class="pull-right btn btn-link" href="javascript: window.prompt('{{ data.Local.Resource.Name | Replace: "'","\'" }}. Calendar URL:','http://{{ data.Domain }}{% Url Feeds, ResourceBookings, guid: data.Local.Resource.UniqueId %}'); return false;">
{% T Calendar Feed %}
</a>
<a class="pull-right btn btn-link" href="{% Url Bookings, Index, Resourceid: data.Local.Resource.Id %}">
{% T Calendar %}
</a>
<!-- END POST CONTENT -->
</article>
</section>
<!-- END CONTENT -->
<!-- SIDEBAR -->
<aside id="sidebar-right" class="span3">
<!-- 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 -->
{% 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 %}