Permalink
Browse files

Adding services function for iphone

  • Loading branch information...
1 parent fc173de commit 08b44b87ee7770b640142476d8cd0aed6a6c3907 @davidjrice committed Feb 23, 2010
Showing with 73 additions and 0 deletions.
  1. +9 −0 app/controllers/iphone_controller.rb
  2. +61 −0 app/views/iphone/services.html.erb
  3. +1 −0 config/routes.rb
  4. +2 −0 script/import.rb
@@ -8,4 +8,13 @@ def index
end
end
+ # GET /areas/:area_id/services
+ def services
+ @area = Area.find(params[:id])
+ @services = @area.services
+ respond_to do |format|
+ format.html { render :layout => false }
+ end
+ end
+
end
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <title>Metro</title>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
+ <link href="/stylesheets/reset.css" rel="stylesheet" type="text/css">
+ <link href="/stylesheets/iphone.css" rel="stylesheet" type="text/css">
+ <meta name = "viewport" content = "width = 320px, user-scalable = no">
+
+ <script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript"> google.load("jquery", "1.3.2"); </script>
+ <script src="/javascripts/jqtouch.min.js" type="application/x-javascript" charset="utf-8"></script>
+ <script type="text/javascript" charset="utf-8">
+ $.jQTouch({
+ icon: 'images/metro.png',
+ statusBar: 'black',
+ startupScreen: 'images/loading.png',
+ preloadImages: [
+ 'images/logo.png',
+ 'images/gps-icon.png',
+ ]
+ });
+ </script>
+</head>
+
+<body>
+
+ <div id="header">
+ <img src="images/logo.png">
+ </div>
+
+ <div id="nearest">
+ <img src="images/gps-icon.png">
+ Locate Nearest Bus Stop
+ </div>
+
+ <h2>Timetables</h2>
+
+ <div id="navigation" class="section">
+ <ol>
+ <%- @services.each do |service| -%>
+ <li class="metro<%= service.area.code %>">
+ <div class="route-number"><a href="#area-<%= service.area.code %>">Metro <%= service.area.code + service.code %></div>
+ <div class="route-name"><%= service.name %></a></div>
+ </li>
+ <%- end -%>
+ </ol>
+ </div>
+
+ <!-- <div id="metro1-timetable" class="section">
+ <strong>Metro 1 — Antrim Road</strong> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ </div> -->
+
+ <div id="footer">
+ Developed by #code4pizza. Route information kindly provided by Translink, timetable data acquired for proof of concept purposes only.
+ </div>
+
+</body>
+
+</html>
View
@@ -11,6 +11,7 @@
map.with_options :controller => 'iphone' do |iphone|
iphone.index '/iphone', :action => 'index'
+ iphone.services '/iphone/areas/:id/services', :action => 'services'
end
map.root :controller => 'translink'
View
@@ -13,5 +13,7 @@
# * route
# * route_stop
# * stop
+
+ # * lat / lon from easting / northing
end

0 comments on commit 08b44b8

Please sign in to comment.