2 <html xmlns:ng="http://angularjs.org">
6 <script src="angular.js" ng:autobind></script>
8 <script src="http://code.angularjs.org/0.9.15/angular-0.9.15.min.js"
12 Calendar.$inject = ['$xhr', '$resource'];
14 function Calendar($xhr,$resource){
15 console.info('Calendar');
18 , "/reservations/get/www.google.com/calendar/ical/8tg8ecg285qshtp75813jktqa0%40group.calendar.google.com/private-b9d68b530fde2c6060979f8a05aa0865/basic.ics"
19 , function(code, response){
20 console.log('xhr calendar', code, response);
25 var load_submited = function() {
27 , "/reservations/events/submited"
28 , function(code, response){
29 console.log('xhr submited', code, response);
30 self.submited = response;
36 var Reservation = $resource('/data/reservations/prijava/:id');
37 this.reservation = new Reservation();
41 // http://groups.google.com/group/angular/browse_thread/thread/af68afb22fd2d2ab/18fc5e3216a77e53?show_docid=18fc5e3216a77e53
44 <title>Reservations</title>
52 <div ng:controller="Calendar">
54 <h1>{{data.cal['X-WR-CALNAME']}}</h1>
56 <div>{{data.cal['X-WR-CALDESC'] | html}}</div>
59 <li ng:repeat="c in data.events" ng:show="! reservation.UID || reservation.UID == c.UID">
60 {{c.DTSTART}} - {{c.DTEND}}
61 <a href="" ng:click="reservation.UID = c.UID ; reservation.event = c">{{c.SUMMARY}}</a>
62 <b ng:show="submited[c.UID]">
63 broj prijava: {{submited[c.UID]}}
65 <div>{{c.LOCATION}}</div>
66 <div ng:show="c.DESCRIPTION">
73 <form ng:show="reservation.UID">
75 <div ng:show="! reservation._id">
76 Popunite vašu prijavu za
77 <b>{{reservation.event.SUMMARY}}</b>
78 <input type=button ng:click="reservation.UID = null" value="Odustani od prijave">
81 <div ng:show="reservation._id && reservation.UID" style="background: #ff8">
83 <b>{{reservation.event.SUMMARY}}</b>
84 <input type=button ng:click="reservation.UID = null" value="Promjeni termin">
88 ime: <input name="reservation.name" ng:required>
90 prezime: <input name="reservation.surname" ng:required>
92 e-mail: <input name="reservation.email" ng:required>
94 odsjek: <input name="reservation.odsjek" ng:required>
96 zvanje: <input name="reservation.zvanje">
98 područke/tema zaninimanja: <input name="reservation.porducje">
100 <input type=button ng:click="reservation.$save(); load_reservations();" value="Prijavi me">
101 <pre>{{reservation}}</pre>
104 <input name=debug type=checkbox>
105 <pre ng:show="debug">
107 reservation={{reservation}}