Skip to content

Commit

Permalink
migrated erb to haml
Browse files Browse the repository at this point in the history
  • Loading branch information
puneet committed Dec 2, 2014
1 parent 8f5e319 commit 5748a6f
Show file tree
Hide file tree
Showing 53 changed files with 377 additions and 625 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ gem 'email_validator'
# For variants support
gem 'browser'

gem 'haml-rails'

group :development do

# mutes assets pipeline log messages
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ GEM
execjs (2.2.1)
formtastic (2.3.0.rc3)
actionpack (>= 3.0)
haml (4.0.6)
tilt
haml-rails (0.5.3)
actionpack (>= 4.0.1)
activesupport (>= 4.0.1)
haml (>= 3.1, < 5.0)
railties (>= 4.0.1)
handy (0.0.27)
hashr
has_scope (0.6.0.rc)
Expand Down Expand Up @@ -245,6 +252,7 @@ DEPENDENCIES
devise (= 3.2.3)
devise-async
email_validator
haml-rails
handy
honeybadger
jbuilder (~> 1.2)
Expand Down
3 changes: 0 additions & 3 deletions app/views/home/index.html.erb

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
%span.home-message
This is home page.
58 changes: 0 additions & 58 deletions app/views/layouts/application.html+phone.erb

This file was deleted.

35 changes: 35 additions & 0 deletions app/views/layouts/application.html+phone.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
!!!
%html{lang: "en"}
%head
%meta{charset: "utf-8"}/
%meta{:content => "IE=Edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
%meta{content: "width=device-width, initial-scale=1.0", name: "viewport"}/
%title= content_for?(:title) ? yield(:title) : "Wheel"
= csrf_meta_tags
/ Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js" type="text/javascript"></script>
= stylesheet_link_tag "application_phone", media: "all"
/ <link rel="icon" href="/favicon.ico" type="image/x-icon">
/ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
%body
.navbar.navbar-default.navbar-static-top{role: "navigation"}
.container
.navbar-header
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand{href: "/"} Wheel
.navbar-collapse.collapse
= render 'shared/nav'
.container
.row
.col-sm-12
= bootstrap_flash
= yield
%footer
/ for footer
/ Placed at the end of the document so the pages load faster
= javascript_include_tag "application_phone"
58 changes: 0 additions & 58 deletions app/views/layouts/application.html.erb

This file was deleted.

35 changes: 35 additions & 0 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
!!!
%html{lang: "en"}
%head
%meta{charset: "utf-8"}/
%meta{:content => "IE=Edge,chrome=1", "http-equiv" => "X-UA-Compatible"}/
%meta{content: "width=device-width, initial-scale=1.0", name: "viewport"}/
%title= content_for?(:title) ? yield(:title) : "Wheel"
= csrf_meta_tags
/ Le HTML5 shim, for IE6-8 support of HTML elements
/[if lt IE 9]
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js" type="text/javascript"></script>
= stylesheet_link_tag "application_desktop", media: "all"
/ <link rel="icon" href="/favicon.ico" type="image/x-icon">
/ <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
%body{class: controller_name + ' ' + action_name}
.navbar.navbar-default.navbar-static-top{role: "navigation"}
.container
.navbar-header
%button.navbar-toggle{"data-target" => ".navbar-collapse", "data-toggle" => "collapse", :type => "button"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.navbar-brand{href: "/"} Wheel
.navbar-collapse.collapse
= render 'shared/nav'
.container.page
.row
.col-sm-12
= bootstrap_flash
= yield
%footer
/ for footer
/ Placed at the end of the document so the pages load faster
= javascript_include_tag "application_desktop"
110 changes: 34 additions & 76 deletions app/views/layouts/mailer.erb → app/views/layouts/mailer.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width"/>
<style>
!!! Strict
%html{xmlns: "http://www.w3.org/1999/xhtml"}
%head
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/
%meta{content: "width=device-width", name: "viewport"}/
:css
body {
font-family: sans-serif;
font-size: 14px;
Expand Down Expand Up @@ -152,73 +152,31 @@
position: relative;
z-index: 1;
}

</style>
</head>
<body style="font-size: 16px !important; line-height: 26px !important;">
<table class="body" style="width: 100% !important;">
<tr>
<td class="center" align="center" valign="top">
<center>

<table class="row header" style="background: #000000 !important; width: 100% !important;">
<tr>
<td class="center" align="center">
<center>

<table class="container">
<tr>
<td class="wrapper last">

<table class="twelve columns">
<tr>
<td class="six sub-columns">

</td>
<td class="six sub-columns last" >
<span class="template-label">&nbsp;</span>
</td>
</tr>
</table>

</td>
</tr>
</table>

</center>
</td>
</tr>
</table>

<table class="container">
<tr>
<td>

<table class="row">
<tr>
<td class="wrapper last">

<table class="twelve columns">
<tr>
<td>
<%= yield %>
</td>
<td class="expander"></td>
</tr>
</table>

</td>
</tr>
</table>

<!-- container end below -->
</td>
</tr>
</table>

</center>
</td>
</tr>
</table>
</body>
</html>
%body{style: "font-size: 16px !important; line-height: 26px !important;"}
%table.body{style: "width: 100% !important;"}
%tr
%td.center{align: "center", valign: "top"}
%center
%table.row.header{style: "background: #000000 !important; width: 100% !important;"}
%tr
%td.center{align: "center"}
%center
%table.container
%tr
%td.wrapper.last
%table.twelve.columns
%tr
%td.six.sub-columns
%td.six.sub-columns.last
%span.template-label &nbsp;
%table.container
%tr
%td
%table.row
%tr
%td.wrapper.last
%table.twelve.columns
%tr
%td
= yield
%td.expander
Loading

0 comments on commit 5748a6f

Please sign in to comment.