Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated layout and seed file to make a bit more sense.

  • Loading branch information...
commit 87dfedccd2ea67e253d43d9ea2bdb447c22002ff 1 parent 40f71ca
@airhorns authored
View
3  app/controllers/application_controller.rb
@@ -49,7 +49,7 @@ def require_no_user
if current_user
store_location
flash[:notice] = "You must be logged out to access this page"
- redirect_to account_url
+ redirect_to root_url
return false
end
end
@@ -64,6 +64,7 @@ def store_location
# logged in to send them back to where they were going if they were interrupted.
# @return [nil]
def redirect_back_or_default(default)
+ session[:return_to] = nil if session[:return_to] =~ /user_session/
redirect_to(session[:return_to] || default)
session[:return_to] = nil
end
View
2  app/controllers/user_sessions_controller.rb
@@ -26,7 +26,7 @@ def create
flash[:notice] = "Login successful!"
# Call the special redirect handler {ApplicationController#redirect_back_or_default}
# to take a user back to the url they tried to access but were denied access.
- redirect_back_or_default account_url
+ redirect_back_or_default root_url
else
# Show the user the login form again if they weren't able to log in.
render :action => :new
View
11 app/views/layouts/application.html.erb
@@ -19,11 +19,11 @@
</head>
<body>
- <!--- #container start -->
- <div class="container">
- <div id="header" class="span-24 last">
+ <div id="header">
+ <div class="container">
<div class="span-16">
- <h1>&nbsp;&nbsp;Accütron 9500</h1>
+ <h1>Accütron 9500</h1>
+ <img src="/images/logo.png">
</div>
<div class="span-7 append-1 last right">
<% if !current_user %>
@@ -35,6 +35,9 @@
<% end %>
</div>
</div>
+ </div>
+ <!--- #container start -->
+ <div class="container">
<div class="sidebar span-4">
<% if current_user %>
View
15 db/seeds.rb
@@ -26,7 +26,7 @@
:password_confirmation => "apple123",
:role => "employee")
-@employees = [].push(@joe)
+@employees = [@joe, @admin]
@mary = User.create!(:email=>"mary@example.com",
:active=> true,
@@ -84,7 +84,7 @@
:due_date => "2010-04-06 00:00:00 UTC",
:user => @mary,
:business => @acme,
-:users => @employees[2..-1])
+:users => @employees[3..-1].push(@joe))
Task.create!([{:name => "Layout and CSS", :description => "Visual themeing of the website", :project => @project1},
{:name => "MVC Code", :description => "Rails work.", :project => @project1},
@@ -104,7 +104,7 @@
@employees.each do |user|
[@project1, @project2].each do |project|
(rand(5) + 3).times do
- Expense.create!(:name => "Dinner with client.",
+ Expense.create!(:name => %w{Dinner Lunch Breakfast Tea}.rand + " with client.",
:description => "An important meal where important things were discussed.",
:date => Time.now - rand(5).days - rand(1000).minutes,
:user => user,
@@ -113,14 +113,15 @@
:state => [Expense::Pending, Expense::Approved, Expense::Rejected][rand(3)]
)
end
- (rand(20) + 10).times do
- HourReport.create!(:name => 'An important feature',
- :description => "An important meal where important things were discussed.",
+ (rand(10) + 5).times do
+ task = project.tasks.rand
+ HourReport.create!(:name => "Worked on #{task.name}",
+ :description => "Spent some time working on task ##{task.id}",
:date => Time.now - rand(5).days - rand(1000).minutes,
:hours => rand(10)+1,
:user => user,
:cost => rand(10000)/2,
- :task => project.tasks[rand(project.tasks.length-1)],
+ :task => task,
:state => [HourReport::Pending, HourReport::Approved, HourReport::Rejected][rand(3)]
)
end
View
BIN  public/images/Untitled-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
62 public/stylesheets/application.css
@@ -3,29 +3,36 @@ html {
}
body {
- background-color: #EEE;
+ background-color: #FFF;
height: 100%;
}
.container {
background-color: #FFFFFF;
min-height: 100%;
+ width: 952px;
+}
+#header .container {
+ border: none;
+ border-bottom: 2px solid #DDD;
+
}
-
#header {
- background-color: #FF7E00;
+ /* background-color: #FF7E00;
-moz-border-radius-bottomleft: 15px;
-webkit-border-bottom-left-radius: 15px;
-moz-border-radius-bottomright: 15px;
-webkit-border-bottom-right-radius: 15px;
- color: #fff;
- margin-bottom: 10px;
+ */
+ border-top: 4px solid #e71818;
+ margin-bottom: 10px;
+ width: 100%;
}
-#header h1{
- color: #fff;
+#header h1 {
+ display: none;
}
-#header a {
- color: #ccc;
+#header div.span-7 {
+ margin-top: 35px;
}
ul#menu {
margin: 10px 0px 0px 10px;
@@ -61,3 +68,40 @@ form p + p {
.right {
text-align: right;
}
+
+/* Awesome CSS3 Buttons, taken from http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html */
+.awesome, .awesome:visited {
+ background: #222 url(/images/alert-overlay.png) repeat-x;
+ display: inline-block;
+ padding: 5px 10px 6px;
+ color: #fff;
+ text-decoration: none;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
+ -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.5);
+ text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
+ border-bottom: 1px solid rgba(0,0,0,0.25);
+ position: relative;
+ cursor: pointer;
+}
+
+.awesome:hover { background-color: #111; color: #fff; }
+.awesome:active { top: 1px; }
+.small.awesome, .small.awesome:visited { font-size: 11px; padding: ; }
+.awesome, .awesome:visited,
+.medium.awesome, .medium.awesome:visited { font-size: 13px; font-weight: bold; line-height: 1; text-shadow: 0 -1px 1px rgba(0,0,0,0.25); }
+.large.awesome, .large.awesome:visited { font-size: 14px; padding: 8px 14px 9px; }
+
+.green.awesome, .green.awesome:visited { background-color: #91bd09; }
+.green.awesome:hover { background-color: #749a02; }
+.blue.awesome, .blue.awesome:visited { background-color: #2daebf; }
+.blue.awesome:hover { background-color: #007d9a; }
+.red.awesome, .red.awesome:visited { background-color: #e33100; }
+.red.awesome:hover { background-color: #872300; }
+.magenta.awesome, .magenta.awesome:visited { background-color: #a9014b; }
+.magenta.awesome:hover { background-color: #630030; }
+.orange.awesome, .orange.awesome:visited { background-color: #ff5c00; }
+.orange.awesome:hover { background-color: #d45500; }
+.yellow.awesome, .yellow.awesome:visited { background-color: #ffb515; }
+.yellow.awesome:hover { background-color: #fc9200; }
Please sign in to comment.
Something went wrong with that request. Please try again.