This repository has been archived by the owner on Sep 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds an occupancy report to reservation resources
Resolves #183
- Loading branch information
Denis Krienbühl
committed
May 12, 2016
1 parent
8669db8
commit ff329a7
Showing
15 changed files
with
444 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// set date filter on input change | ||
var set_date_range_selector_filter = function(name, value) { | ||
var location = new Url(); | ||
location.query[name] = convert_date(value, datetimepicker_i18n[get_locale()].format, 'Y-m-d'); | ||
delete location.query.page; | ||
window.location.href = location.toString(); | ||
}; | ||
|
||
if (Modernizr.inputtypes.date) { | ||
$('.date-range-selector input[type="date"]').on('input', function() { | ||
set_date_range_selector_filter($(this).attr('name'), $(this).val()); | ||
}); | ||
} else { | ||
$('.date-range-selector input[type="date"]').each(function() { | ||
$(this).datetimepicker({ | ||
onChangeDateTime: function(_dp, $input) { | ||
set_date_range_selector_filter($input.attr('name'), $input.val()); | ||
} | ||
}); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<div metal:use-macro="layout.base" i18n:domain="onegov.town"> | ||
<tal:block metal:fill-slot="title"> | ||
${title} | ||
</tal:block> | ||
<tal:block metal:fill-slot="content"> | ||
<span class="page-lead"> | ||
<tal:block condition="start != end"> | ||
${layout.format_date(start, 'date_long')} - ${layout.format_date(end, 'date_long')} | ||
</tal:block> | ||
<tal:block condition="start == end"> | ||
${layout.format_date(start, 'date_long')} | ||
</tal:block> | ||
</span> | ||
|
||
<div class="row"> | ||
<div class="small-12 medium-8 columns"> | ||
<div class="row occupancy-block" tal:repeat="date occupancy"> | ||
<tal:block define="entries occupancy[date]"> | ||
<div class="columns small-12 medium-3"> | ||
<metal:block use-macro="layout.macros['calendar-day']" /> | ||
</div> | ||
<div class="columns small-12 medium-9"> | ||
<ul class="occupancy-entry"> | ||
<li tal:repeat="entry entries"> | ||
<tal:block tal:define="whole_day entry.start.time() != entry.end.time()"> | ||
<span class="date" tal:condition="whole_day"> | ||
${layout.format_time_range(entry.start, entry.end)} | ||
</span> | ||
<span class="date" tal:condition="not:whole_day" i18n:translate> | ||
Whole day | ||
</span> | ||
<span class="quota" tal:condition="resource.show_quota"> | ||
(${entry.quota}) | ||
</span> | ||
<div class="title"> | ||
<a href="${entry.url}">${entry.title}</a> | ||
</div> | ||
</tal:block> | ||
</li> | ||
</ul> | ||
</div> | ||
</tal:block> | ||
</div> | ||
</div> | ||
<div class="small-12 medium-4 columns"> | ||
<div class="date-range-selector-result"> | ||
<span>${count}</span> | ||
<span i18n:translate>Reservations</span> | ||
</div> | ||
<metal:block tal:define="start start.isoformat(); end end.isoformat()" use-macro="layout.macros['date-range-selector']" /> | ||
</div> | ||
</div> | ||
</tal:block> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.