projects
/
angular-mojolicious.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1851c5e
)
last fallback for slots is calendar description
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 15 Oct 2011 08:23:22 +0000
(10:23 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 15 Oct 2011 08:24:48 +0000
(10:24 +0200)
angular-server.pl
patch
|
blob
|
history
diff --git
a/angular-server.pl
b/angular-server.pl
index
1ef3778
..
5d86f9a
100755
(executable)
--- a/
angular-server.pl
+++ b/
angular-server.pl
@@
-230,6
+230,8
@@
use iCal::Parser;
plugin 'proxy';
plugin 'proxy';
+my $slot_regex = '(\d+)\s*mjesta';
+
get '/reservations/get/(*url)' => sub {
my $self = shift;
get '/reservations/get/(*url)' => sub {
my $self = shift;
@@
-267,8
+269,9
@@
get '/reservations/get/(*url)' => sub {
SUMMARY
)) {
next unless exists $_->{$check_slot};
SUMMARY
)) {
next unless exists $_->{$check_slot};
- $_->{slots} = $1 if $_->{$check_slot} =~ m/
(\d+)\s*mjesta/
s;
+ $_->{slots} = $1 if $_->{$check_slot} =~ m/
$slot_regex/i
s;
}
}
+ $_->{slots} ||= $1 if $ical->{cal}->{'X-WR-CALDESC'} =~ m/$slot_regex/s;
$_;
} @events;
$_;
} @events;