Skip to content

Commit

Permalink
Added specific login page for the gallery
Browse files Browse the repository at this point in the history
  • Loading branch information
Benzene committed Aug 31, 2010
1 parent 1f018ed commit d4ef0e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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])
Expand Down
1 change: 1 addition & 0 deletions views/layout.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
%script{ :type => 'text/javascript', :src => '/static/gallery/' + js + '.js' }

%body
#loginbox
= yield
Empty file added views/login.haml
Empty file.

0 comments on commit d4ef0e8

Please sign in to comment.