citygate 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. data/README.rdoc +66 -1
  2. data/Rakefile +0 -1
  3. data/app/assets/javascripts/citygate/admin_users.coffee +1 -13
  4. data/app/assets/javascripts/citygate/application.js +3 -2
  5. data/app/assets/javascripts/citygate/jquery.pjax.js +688 -0
  6. data/app/controllers/citygate/admin/application_controller.rb +9 -1
  7. data/app/controllers/citygate/admin/users_controller.rb +1 -1
  8. data/app/controllers/citygate/application_controller.rb +2 -0
  9. data/app/controllers/citygate/users/omniauth_callbacks_controller.rb +10 -8
  10. data/app/controllers/citygate/users_controller.rb +2 -2
  11. data/app/models/citygate/user.rb +8 -1
  12. data/app/views/citygate/admin/users/index.html.erb +12 -1
  13. data/app/views/citygate/admin/users/show.html.erb +4 -2
  14. data/app/views/citygate/shared/_navigation.html.erb +2 -1
  15. data/app/views/citygate/users/show.html.erb +13 -2
  16. data/app/views/{citygate/devise → devise}/_links.erb +0 -0
  17. data/app/views/devise/registrations/edit.html.erb +32 -0
  18. data/app/views/devise/registrations/new.html.erb +18 -0
  19. data/app/views/layouts/admin/application.html.erb +1 -0
  20. data/config/accounts.yml +5 -0
  21. data/config/initializers/01_load_config.rb +1 -0
  22. data/config/initializers/devise.rb +22 -12
  23. data/config/routes.rb +9 -4
  24. data/lib/citygate/engine.rb +15 -1
  25. data/lib/citygate/version.rb +1 -1
  26. data/lib/gravatar.rb +8 -0
  27. metadata +67 -57
  28. data/app/assets/javascripts/citygate/global.coffee +0 -14
  29. data/app/views/citygate/admin/users/_user_show.html.erb +0 -2
  30. data/app/views/citygate/admin/users/_users.html.erb +0 -12
  31. data/app/views/citygate/admin/users/index.js.erb +0 -1
  32. data/app/views/citygate/admin/users/show.js.erb +0 -1
  33. data/app/views/citygate/devise/registrations/edit.html.haml +0 -31
data/README.rdoc CHANGED
@@ -2,4 +2,69 @@
2
2
 
3
3
  Citygate is a rails engine that provides your application with user authentication (on the site or through facebook or google) using Devise and fully customizable authorization using CanCan.
4
4
 
5
- It also provides a customizable backend for administrating all your users, using pjax and pushState making your website as fast as responsive as you ever wanted it to be.
5
+ It also provides a customizable backend for administrating all your users, using pjax and pushState making your website as fast as responsive as you ever wanted it to be.
6
+
7
+ == Instalation
8
+
9
+ First add the gem to your Gemfile to get the latest stable version
10
+
11
+ gem "citygate"
12
+
13
+ or go on the edge with
14
+
15
+ gem "citygate", :git => "https://zamith@github.com/zamith/citygate.git"
16
+
17
+ == Database Configuration
18
+
19
+ In order to get the database ready to run citygate you will need to fetch the migrations
20
+
21
+ rake citygate:install:migrations
22
+
23
+ and run them
24
+
25
+ rake db:migrate
26
+
27
+ then drop this line at your +db/seeds.rb+ file in order to be able to populate the db with the needed records
28
+
29
+ Citygate::Engine.load_seed
30
+
31
+ and finally run the seeds command to actually populate the db
32
+
33
+ rake db:seed
34
+
35
+ == Routes Configuration
36
+
37
+ To get all the citygate routes working you just need to mount them by adding the following line to your +config/routes.rb+ file
38
+
39
+ mount Citygate::Engine => "/"
40
+
41
+ == Environment Configuration
42
+
43
+ Since citygate will send confirmation emails to any user that signs up, you will need to have your email configured.
44
+
45
+ In case of development add this to +config/environments/development.rb+
46
+
47
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
48
+
49
+ == Citygate Options
50
+
51
+ You can change citygate's defaults by editing your +config/application.rb+ file like so
52
+
53
+ Citygate::Engine.configure do
54
+ config.option = value
55
+ end
56
+
57
+ === Options
58
+
59
+ The available options are:
60
+
61
+ will_paginate_options:: an hash with any option supported by paginate[https://github.com/mislav/will_paginate/wiki]
62
+ mount_path:: if you mount the engine in any other path than "/", must define it here as well so that omniauth can be aware of it
63
+
64
+ == Running Citygate
65
+
66
+ Users in citygate will not be able to login with their google account if you use WEBrick, due to its url length limitation. Therefore run your server in development with <tt>rails s thin</tt>, to run the thin server.
67
+
68
+ ---
69
+
70
+ *Note:* Do not forget to check the routes made available to you by Citygate with <tt>rake routes</tt> and to take a look at the doc at RubyDoc[http://rubydoc.info/github/zamith/citygate/master/frames]
data/Rakefile CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env rake
2
2
  begin
3
3
  require 'bundler/setup'
4
- require 'bundler/gem_tasks'
5
4
  rescue LoadError
6
5
  puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
6
  end
@@ -1,14 +1,2 @@
1
1
  $ ->
2
- # Every link that is click in the users area must push the state for the previous location and update the URL,
3
- # since everything is AJAXified
4
- $("#users a").live "click", ->
5
- # Push the state before the click (when it's the first page load it starts the stack)
6
- history.pushState buildState(), "", window.location.href
7
-
8
- # Gets the content for the container through AJAX
9
- $.getScript @href, =>
10
- # If the last url to be pushed to the history is different the one we're at, then push the new state
11
- history.replaceState buildState(), "", @href if history.state.page isnt @href
12
-
13
- # Prevent the page refresh
14
- false
2
+ $("a").pjax("[data-pjax-container]")
@@ -12,5 +12,6 @@
12
12
  //
13
13
  //= require jquery
14
14
  //= require jquery_ujs
15
- //= require citygate/global
16
- //= require_tree .
15
+ //= require citygate/jquery.pjax
16
+ //= require citygate/admin_users
17
+