Skip to content
Browse files

Added more styling. Protected new number routes from non-logged in Me…

…mbers.
  • Loading branch information...
1 parent 02b5d07 commit db81c22d4bd6fbfaa9d46896a79b6c03c6a4980c @ekosz committed Mar 18, 2011
View
4 app/routes/number.rb
@@ -1,20 +1,24 @@
class Main < Sinatra::Base
get '/numbers' do
+ ensure_authenticated(User)
@numbers = Number.all
haml :"numbers/index"
end
get '/numbers/new' do
+ ensure_authenticated(User)
@number = Number.new
haml :"numbers/new"
end
get '/numbers/:id' do
+ ensure_authenticated(User)
@number = Number[params[:id]]
haml :"numbers/show"
end
get '/numbers/:id/edit' do
+ ensure_authenticated(User)
@number = Number[params[:id]]
haml :"numbers/edit"
end
View
28 app/views/css/menu.sass
@@ -0,0 +1,28 @@
+#menu
+ -moz-column-count: 3
+ -moz-column-gap: 20px
+ -webkit-column-count: 3
+ -webkit-column-gap: 20px
+ column-count: 3
+ column-gap: 20px
+ width: 1200px
+.menuitem
+ background-color: pink
+ margin: 20px auto
+ font-size: 2em
+ text-align: center
+ width: 200px
+ height: 200px
+ -moz-border-radius: 10px
+ border-radius: 10px
+ -webkit-transition: background 250ms ease-in-out
+ -moz-transition: background 250ms ease-in-out
+ -o-transition: background 250ms ease-in-out
+ transition: background 250ms ease-in-out
+ a
+ display: block
+ text-decoration: none
+ height: 100%
+ color: black
+.menuitem:hover
+ background-color: red
View
7 app/views/css/number.sass
@@ -9,15 +9,22 @@
font-size: 300%
.number
width: 160px
+ font-size: 120%
background-color: red
margin-bottom: 10px
-moz-border-radius: 30px
border-radius: 10px
padding: 5px
+ -webkit-transition: background 250ms ease-in-out
+ -moz-transition: background 250ms ease-in-out
+ -o-transition: background 250ms ease-in-out
+ transition: background 250ms ease-in-out
a
display: block
text-decoration: none
color: black
+.number:hover
+ background-color: orange
#number
width: 1200px
.number
View
1 app/views/css/style.sass
@@ -11,6 +11,7 @@
// Custom Styles go here
@import number
+@import menu
@import handheld
@import print
View
19 app/views/index.haml
@@ -1,9 +1,10 @@
-%p
- %a{:href=>'/users'}
- View your Users
-%p
- %a{:href=>'/numbers'}
- View All Numbers
-%p
- %a{:href=>'/groups'}
- View all Groups
+#menu
+ .menuitem
+ %a{:href=>'/users'}
+ View your Users
+ .menuitem
+ %a{:href=>'/numbers'}
+ View All Numbers
+ .menuitem
+ %a{:href=>'/groups'}
+ View all Groups
View
2 app/views/layout.haml
@@ -6,7 +6,7 @@
-# Always force latest IE rendering engine (even in intranet) & Chrome Frame. Remove this if you use the .htaccess
%meta{ :'http-equiv' => "X-UA-Compatible", :content => "IE=edge,chrome=1" }
- %title
+ %title Personal C Assistant
%meta{ :name => "description", :content => "" }
%meta{ :name => "author", :content => "" }
View
2 app/views/numbers/show.haml
@@ -1,2 +1,4 @@
#number
= partial :"numbers/number", :locals=>{:number=>@number}
+%a{:href=>'/numbers'}
+ All Numbers

0 comments on commit db81c22

Please sign in to comment.
Something went wrong with that request. Please try again.