Skip to content
This repository has been archived by the owner on May 14, 2019. It is now read-only.

Commit

Permalink
mobile-HTML5 boilerplate first pass
Browse files Browse the repository at this point in the history
  • Loading branch information
froots committed Jun 8, 2011
1 parent 20157fe commit ca9b4fd
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 62 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ group :production do
end

# Asset template engines
gem 'haml-rails'
gem 'sass-rails', "~> 3.1.0.rc"
gem 'coffee-script'
gem 'uglifier'
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ GEM
eventmachine (0.12.10)
execjs (1.1.1)
multi_json (~> 1.0)
haml (3.1.2)
haml-rails (0.3.4)
actionpack (~> 3.0)
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
hike (1.0.0)
i18n (0.6.0)
jquery-rails (1.0.9)
Expand Down Expand Up @@ -113,6 +119,7 @@ PLATFORMS

DEPENDENCIES
coffee-script
haml-rails
jquery-rails
pg
rails (= 3.1.0.rc2)
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/home.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
7 changes: 7 additions & 0 deletions app/assets/stylesheets/home.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Place all the styles related to the home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

body.home {
// Place scoped styles here
}
5 changes: 5 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class HomeController < ApplicationController
def index

end
end
2 changes: 2 additions & 0 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module HomeHelper
end
1 change: 1 addition & 0 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%p Home
14 changes: 0 additions & 14 deletions app/views/layouts/application.html.erb

This file was deleted.

47 changes: 47 additions & 0 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
!!! 5
/[if IEMobile 7 ] <html class="no-js iem7" manifest="default.appcache?v=1">
<!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js" manifest="default.appcache?v=1"> <!--<![endif]-->
%head
%meta{:charset => "utf-8"}
%title
%meta{:content => "", :name => "description"}
%meta{:content => "", :name => "author"}
%meta{:content => "True", :name => "HandheldFriendly"}
%meta{:content => "320", :name => "MobileOptimized"}
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
%link{:href => "img/h/apple-touch-icon.png", :rel => "apple-touch-icon-precomposed", :sizes => "114x114"}
%link{:href => "img/m/apple-touch-icon.png", :rel => "apple-touch-icon-precomposed", :sizes => "72x72"}
%link{:href => "img/l/apple-touch-icon-precomposed.png", :rel => "apple-touch-icon-precomposed"}
%link{:href => "img/l/apple-touch-icon.png", :rel => "shortcut icon"}
/
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-startup-image" href="img/l/splash.png">
%meta{:content => "on", "http-equiv" => "cleartype"}
%link{:href => "css/style.css?v=1", :rel => "stylesheet"}
%script{:src => "js/libs/modernizr-custom.js"}

%body
#container
%header
%h1 Edinburgh International Book Festival
#main{:role => "main"}
= yield
%footer
%script{:src => "//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"}
:javascript
window.jQuery || document.write("<script src='js/libs/jquery-1.5.1.min.js'>\x3C/script>")
%script{:src => "js/mylibs/helper.js"}
:javascript
MBP.scaleFix();
yepnope({
test : Modernizr.mq('(min-width)'),
nope : ['js/libs/respond.min.js']
});
/ <script src="https://getfirebug.com/firebug-lite.js"></script>
:javascript
var _gaq=[["_setAccount","UA-XXXXX-X"],["_trackPageview"]];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
4 changes: 4 additions & 0 deletions config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@

# Initialize the rails application
EdbookfestMobile::Application.initialize!

Haml::Template.options[:format] = :html5
Haml::Template.options[:attr_wrapper] = '"'

2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => 'welcome#index'
root :to => 'home#index'

# See how all your routes lay out with "rake routes"

Expand Down
47 changes: 0 additions & 47 deletions public/index.html

This file was deleted.

7 changes: 7 additions & 0 deletions test/functional/home_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class HomeControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
4 changes: 4 additions & 0 deletions test/unit/helpers/home_helper_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'test_helper'

class HomeHelperTest < ActionView::TestCase
end

0 comments on commit ca9b4fd

Please sign in to comment.