Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added specific login page for the gallery

  • Loading branch information...
commit d4ef0e87573d4534268d789e9a3f70f813c2ae93 1 parent 1f018ed
@Benzene authored
Showing with 10 additions and 3 deletions.
  1. +9 −3 runner.rb
  2. +1 −0  views/layout.haml
  3. 0  views/login.haml
View
12 runner.rb
@@ -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
1  views/layout.haml
@@ -9,4 +9,5 @@
%script{ :type => 'text/javascript', :src => '/static/gallery/' + js + '.js' }
%body
+ #loginbox
= yield
View
0  views/login.haml
No changes.
Please sign in to comment.
Something went wrong with that request. Please try again.