Permalink
Browse files

Added specific login page for the gallery

  • Loading branch information...
1 parent 1f018ed commit d4ef0e87573d4534268d789e9a3f70f813c2ae93 @Benzene committed Aug 31, 2010
Showing with 10 additions and 3 deletions.
  1. +9 −3 runner.rb
  2. +1 −0 views/layout.haml
  3. 0 views/login.haml
View
@@ -16,9 +16,11 @@ class Gallery < Sinatra::Base
before do
if @env['rack.session']['uid'] then
- puts @env['rack.session']['uid']
- else
- redirect '/'
+ if @request.path_info == '/login' then
+ redirect '/gallery/'
+ end
+ elsif @request.path_info != '/login' then
+ redirect '/gallery/login'
end
end
@@ -29,6 +31,10 @@ class Gallery < Sinatra::Base
@title = "Albums"
haml :index
end
+
+ get '/login' do
+ haml :login
+ end
get '/t/:tag/' do
@tag = Tag.get(params[:tag])
View
@@ -9,4 +9,5 @@
%script{ :type => 'text/javascript', :src => '/static/gallery/' + js + '.js' }
%body
+ #loginbox
= yield
View
No changes.

0 comments on commit d4ef0e8

Please sign in to comment.