sinatra-authentication 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
 
7
7
  Jeweler::Tasks.new do |gemspec|
8
8
  gemspec.name = 'sinatra-authentication'
9
- gemspec.version = '0.2.0'
9
+ gemspec.version = '0.2.1'
10
10
  gemspec.description = "Simple authentication plugin for sinatra."
11
11
  gemspec.summary = "Simple authentication plugin for sinatra."
12
12
  gemspec.homepage = "http://github.com/maxjustus/sinatra-authentication"
data/lib/views/edit.haml CHANGED
@@ -11,26 +11,31 @@
11
11
  - else
12
12
  account
13
13
  %form{:action => "/users/#{@user.id}/edit", :method => "post"}
14
- %input{ :id => "user_email", :name => "user[email]", :size => 30, :type => "text", :value => @user.email }
15
- email
16
- %br
17
- %input{ :id => "user_password", :name => "user[password]", :size => 30, :type => "password" }
18
- new password
19
- %br
20
- %input{ :id => "user_password_confirmation", :name => "user[password_confirmation]", :size => 30, :type => "password" }
21
- confirm
14
+ .field
15
+ .label
16
+ %label{:for => "user_email"} Email
17
+ %input{ :id => "user_email", :name => "user[email]", :size => 30, :type => "text", :value => @user.email }
18
+ .field
19
+ .label
20
+ %label{:for => "user_password"} New password
21
+ %input{ :id => "user_password", :name => "user[password]", :size => 30, :type => "password" }
22
+ .field
23
+ .label
24
+ %label{:for => "user_password_confirmation"} Confirm
25
+ %input{ :id => "user_password_confirmation", :name => "user[password_confirmation]", :size => 30, :type => "password" }
22
26
  -# don't render permission field if admin and editing yourself so you don't shoot yourself in the foot
23
27
  - if current_user.admin? && current_user.id != @user.id
24
- %br
25
- %select{ :id => "permission_level", :name => "user[permission_level]" }
26
- %option{:value => -1, :selected => @user.admin?}
27
- admin
28
- %option{:value => 1, :selected => @user.permission_level == 1}
29
- authenticated user
30
- permission level
31
- %br
32
- %input{ :value => "update", :type => "submit" }
33
- - if Sinatra.const_defined?('FacebookObject')
34
- - unless @user.fb_uid
35
- |
36
- = render_facebook_connect_link('Link account with facebook')
28
+ .field
29
+ .label
30
+ %label{:for => 'permission_level'} Permission level
31
+ %select{ :id => "permission_level", :name => "user[permission_level]" }
32
+ %option{:value => -1, :selected => @user.admin?}
33
+ Admin
34
+ %option{:value => 1, :selected => @user.permission_level == 1}
35
+ Authenticated user
36
+ .buttons
37
+ %input{ :value => "Update", :type => "submit" }
38
+ - if Sinatra.const_defined?('FacebookObject')
39
+ - unless @user.fb_uid
40
+ |
41
+ = render_facebook_connect_link('Link account with Facebook')
data/lib/views/login.haml CHANGED
@@ -1,18 +1,18 @@
1
1
  #sinatra_authentication
2
2
  %h1 Login
3
3
  %form{:action => "/login", :method => "post"}
4
- %p
5
- %label{:for => "user_email'"} Email
6
- %br
4
+ .field
5
+ .label
6
+ %label{:for => "user_email'"} Email
7
7
  %input{:id => "user_email", :name => "email", :size => 30, :type => "text"}
8
- %p
9
- %label{:for => "user_password"} Password
10
- %br
8
+ .field
9
+ .label
10
+ %label{:for => "user_password"} Password
11
11
  %input{:id => "user_password", :name => "password", :size => 30, :type => "password"}
12
- %p
12
+ .buttons
13
13
  %input{:value => "login", :type => "submit"}
14
- %a{:href => "/signup"}
14
+ %a{:href => "/signup", :class => 'sinatra_authentication_link'}
15
15
  Signup
16
- %br
17
- - if Sinatra.const_defined?('FacebookObject')
18
- = render_facebook_connect_link
16
+ .facebook_login
17
+ - if Sinatra.const_defined?('FacebookObject')
18
+ = render_facebook_connect_link
@@ -1,17 +1,19 @@
1
1
  #sinatra_authentication
2
2
  %h1 Signup
3
3
  %form{:action => "/signup", :method => "post"}
4
- %p
5
- %label{:for => "user_email"} Email
6
- %br
4
+ .field
5
+ .label
6
+ %label{:for => "user_email"} Email
7
7
  %input{ :id => "user_email", :name => "user[email]", :size => 30, :type => "text" }
8
- %p
9
- %label{:for => "user_password"} Password
10
- %br
8
+ .field
9
+ .label
10
+ %label{:for => "user_password"} Password
11
11
  %input{ :id => "user_password", :name => "user[password]", :size => 30, :type => "password" }
12
- %p
13
- %label{:for => "user_password_confirmation"} Confirm Password
14
- %br
12
+ .field
13
+ .label
14
+ %label{:for => "user_password_confirmation"} Confirm Password
15
15
  %input{ :id => "user_password_confirmation", :name => "user[password_confirmation]", :size => 30, :type => "password" }
16
- %p
16
+ .buttons
17
17
  %input{ :value => "Create account", :type => "submit" }
18
+ %a{:href => "/login", :class => 'sinatra_authentication_link'}
19
+ Login
data/readme.markdown CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## INSTALLATION:
4
4
 
5
- in your sinatra app simply require either "dm-core" or "rufus-tokyo" and then "sinatra-authentication" and turn on session storage
5
+ in your sinatra app simply require either "dm-core", "rufus-tokyo" or "mongo_mapper" and then "sinatra-authentication" and turn on session storage
6
6
  with a super secret key, like so:
7
7
 
8
8
  require "dm-core"
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra-authentication}
8
- s.version = "0.2.0"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Max Justus Spransy"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Justus Spransy