New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filling in layout #2
Changes from 13 commits
9f66980
6dfd2d8
f0a89c2
fa155f3
330c581
8bf47a7
5efb1a6
824f112
aea1ad6
de43c9c
60e02a6
61a9bb3
fa36a9f
0cbaed9
b9fe1cb
daab3e2
f882cfe
6d13d3f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
@import "bootstrap-sprockets"; | ||
@import "bootstrap"; | ||
|
||
/* mixins, variables, etc. */ | ||
|
||
$gray-medium-light: #eaeaea; | ||
|
||
/* universal */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
|
||
body { | ||
padding-top: 60px; | ||
} | ||
|
||
section { | ||
overflow: auto; | ||
} | ||
|
||
textarea { | ||
resize: vertical; | ||
} | ||
|
||
.center { | ||
text-align: center; | ||
h1 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be preceded by an empty line |
||
margin-bottom: 10px; | ||
} | ||
} | ||
|
||
/* typography */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
|
||
h1, h2, h3, h4, h5, h6 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each selector in a comma sequence should be on its own line |
||
line-height: 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each selector in a comma sequence should be on its own line |
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each selector in a comma sequence should be on its own line |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each selector in a comma sequence should be on its own line |
||
h1 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Each selector in a comma sequence should be on its own line |
||
font-size: 3em; | ||
letter-spacing: -2px; | ||
margin-bottom: 30px; | ||
text-align: center; | ||
} | ||
|
||
h2 { | ||
font-size: 1.2em; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Properties should be ordered color, font-size, font-weight, letter-spacing, margin-bottom, text-align |
||
letter-spacing: -1px; | ||
margin-bottom: 30px; | ||
text-align: center; | ||
font-weight: normal; | ||
color: $gray-light; | ||
} | ||
|
||
p { | ||
font-size: 1.1em; | ||
line-height: 1.7em; | ||
} | ||
|
||
|
||
/* header */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
|
||
#logo { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid using id selectors |
||
float: left; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Properties should be ordered color, float, font-size, font-weight, letter-spacing, margin-right, padding-top, text-transform |
||
margin-right: 10px; | ||
font-size: 1.7em; | ||
color: white; | ||
text-transform: uppercase; | ||
letter-spacing: -1px; | ||
padding-top: 9px; | ||
font-weight: bold; | ||
&:hover { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be preceded by an empty line |
||
color: white; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Color |
||
text-decoration: none; | ||
} | ||
} | ||
|
||
/* footer */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
|
||
footer { | ||
margin-top: 45px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Properties should be ordered border-top, color, margin-top, padding-top |
||
padding-top: 5px; | ||
border-top: 1px solid $gray-medium-light; | ||
color: $gray-light; | ||
a { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be preceded by an empty line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be preceded by an empty line |
||
color: $gray; | ||
&:hover { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be preceded by an empty line |
||
color: $gray-darker; | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be followed by an empty line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be followed by an empty line |
||
small { | ||
float: left; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be followed by an empty line |
||
ul { | ||
float: right; | ||
list-style: none; | ||
li { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rule declaration should be preceded by an empty line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Selector should have depth of applicability no greater than 2, but was 3 |
||
float: left; | ||
margin-left: 15px; | ||
} | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Files should end with a trailing newline |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class StaticPagesController < ApplicationController | ||
def home | ||
end | ||
|
||
def help | ||
end | ||
|
||
def about | ||
end | ||
|
||
def contact | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
module ApplicationHelper | ||
def full_title(page_title) | ||
base_title = "Expenses" | ||
if page_title.empty? | ||
base_title | ||
else | ||
"#{base_title} | #{page_title}" | ||
end | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<footer class="footer"> | ||
<small> | ||
Expenses App | ||
by <a href="http://www.mohnishjadwani.com/">Mohnish G J</a> | ||
</small> | ||
<nav> | ||
<ul> | ||
<li><%= link_to "About", about_path %></li> | ||
<li><%= link_to "Contact", contact_path %></li> | ||
</ul> | ||
</nav> | ||
</footer> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
<header class="navbar navbar-fixed-top navbar-inverse"> | ||
<div class="container"> | ||
<%= link_to "User Registrations App", '#', style:"float:left" %> | ||
<% if logged_in? %> | ||
<%= link_to "Log out", logout_path, method: "delete", style:"float:right" %> | ||
<% end %> | ||
<%= link_to "Expenses App", root_path, id: "logo" %> | ||
<nav> | ||
<ul class="nav navbar-nav navbar-right"> | ||
<li><%= link_to "Home", root_path %></li> | ||
<li><%= link_to "Help", help_path %></li> | ||
<% if logged_in? %> | ||
<li><%= link_to "Log out", logout_path, method: "delete"%></li> | ||
<% else %> | ||
<li><%= link_to "Log in", login_path %></li> | ||
<% end %> | ||
</ul> | ||
</nav> | ||
</div> | ||
</header> | ||
</header> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!--[if lt IE 9]> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/r29/html5.min.js"> | ||
</script> | ||
<![endif]--> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> | ||
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> | ||
<%= csrf_meta_tags %> | ||
</head> | ||
<body> | ||
<%= render 'layouts/header' %> | ||
<br/><br/> | ||
<% flash.each do |message_type, message| %> | ||
<div class="alert alert-<%= message_type %>"><%= message %></div> | ||
<br/> | ||
<% end %> | ||
<%= yield %> | ||
</body> | ||
<head> | ||
<title><%= full_title(yield(:title)) %> </title> | ||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> | ||
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> | ||
<%= csrf_meta_tags %> | ||
<%= render 'layouts/shim' %> | ||
</head> | ||
<body> | ||
<%= render 'layouts/header' %> | ||
<div class="container"> | ||
<% flash.each do |message_type, message| %> | ||
<div class="alert alert-<%= message_type %>"><%= message %></div> | ||
<br/> | ||
<% end %> | ||
<%= yield %> | ||
<%= render 'layouts/footer' %> | ||
</div> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% provide(:title, 'About') %> | ||
<h2>About</h2> | ||
<p>This is a basic app to help you better track your expenses</p> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% provide(:title, 'Contact') %> | ||
<h2>Contact</h2> | ||
<p>Feel free to contact me on mail4mohnish@gmail.com</p> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% provide(:title, 'Help') %> | ||
<h2>Help</h2> | ||
<p>For any queries/feedback on the app feel free to email me on mail4mohnish@gmail.com</p> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<% provide(:title, 'Home') %> | ||
|
||
<div class="center jumbotron"> | ||
<h3>Welcome to the Expenses App where tracking your expenses are made easy</h3> | ||
|
||
|
||
<%= link_to "New user? Sign up now!", signup_path, class: "btn btn-large btn-primary" %> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
begin | ||
load File.expand_path("../spring", __FILE__) | ||
rescue LoadError | ||
end | ||
APP_PATH = File.expand_path('../../config/application', __FILE__) | ||
require_relative '../config/boot' | ||
require 'rails/commands' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
begin | ||
load File.expand_path("../spring", __FILE__) | ||
rescue LoadError | ||
end | ||
require_relative '../config/boot' | ||
require 'rake' | ||
Rake.application.run |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# This file loads spring without using Bundler, in order to be fast. | ||
# It gets overwritten when you run the `spring binstub` command. | ||
|
||
unless defined?(Spring) | ||
require "rubygems" | ||
require "bundler" | ||
|
||
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) | ||
Gem.paths = { "GEM_PATH" => Bundler.bundle_path.to_s } | ||
gem "spring", match[1] | ||
require "spring/binstub" | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
Rails.application.routes.draw do | ||
|
||
root 'sessions#new' | ||
root 'static_pages#home' | ||
get 'home' => 'static_pages#home' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
get 'help' => 'static_pages#help' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
get 'about' => 'static_pages#about' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
get 'contact' => 'static_pages#contact' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
|
||
resources :users | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'rails_helper' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
|
||
describe ApplicationHelper do | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra empty line detected at block body beginning. |
||
describe "#full_title" do | ||
it "should include the page title" do | ||
expect(full_title("About")).to match(/About/) | ||
end | ||
|
||
it "should include the base title" do | ||
expect(full_title("About")).to match(/^Expenses/) | ||
end | ||
|
||
it "should not include a bar for the home page" do | ||
expect(full_title("")).not_to match(/\|/) | ||
end | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Final newline missing. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
describe "Home page" do | ||
it "should have the name of the app" do | ||
visit root_path | ||
expect(page).to have_content('User Registrations App') | ||
expect(page).to have_content('Expenses App') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping. |
||
end | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
//
comments everywhere