projects
/
angular-mojolicious.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
5d3c80b
)
Merge branch 'master' of github.com:dpavlin/angular-mojolicious
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 17 Oct 2011 20:36:53 +0000
(22:36 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 17 Oct 2011 20:36:53 +0000
(22:36 +0200)
angular-server.pl
patch
|
blob
|
history
diff --git
a/angular-server.pl
b/angular-server.pl
index
d2edf1d
..
3dad3c4
100755
(executable)
--- a/
angular-server.pl
+++ b/
angular-server.pl
@@
-230,6
+230,8
@@
use iCal::Parser;
plugin 'proxy';
+my $slot_regex = '(\d+)\s*mjesta';
+
get '/reservations/get/(*url)' => sub {
my $self = shift;
@@
-267,8
+269,9
@@
get '/reservations/get/(*url)' => sub {
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;