citygate 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +66 -1
- data/Rakefile +0 -1
- data/app/assets/javascripts/citygate/admin_users.coffee +1 -13
- data/app/assets/javascripts/citygate/application.js +3 -2
- data/app/assets/javascripts/citygate/jquery.pjax.js +688 -0
- data/app/controllers/citygate/admin/application_controller.rb +9 -1
- data/app/controllers/citygate/admin/users_controller.rb +1 -1
- data/app/controllers/citygate/application_controller.rb +2 -0
- data/app/controllers/citygate/users/omniauth_callbacks_controller.rb +10 -8
- data/app/controllers/citygate/users_controller.rb +2 -2
- data/app/models/citygate/user.rb +8 -1
- data/app/views/citygate/admin/users/index.html.erb +12 -1
- data/app/views/citygate/admin/users/show.html.erb +4 -2
- data/app/views/citygate/shared/_navigation.html.erb +2 -1
- data/app/views/citygate/users/show.html.erb +13 -2
- data/app/views/{citygate/devise → devise}/_links.erb +0 -0
- data/app/views/devise/registrations/edit.html.erb +32 -0
- data/app/views/devise/registrations/new.html.erb +18 -0
- data/app/views/layouts/admin/application.html.erb +1 -0
- data/config/accounts.yml +5 -0
- data/config/initializers/01_load_config.rb +1 -0
- data/config/initializers/devise.rb +22 -12
- data/config/routes.rb +9 -4
- data/lib/citygate/engine.rb +15 -1
- data/lib/citygate/version.rb +1 -1
- data/lib/gravatar.rb +8 -0
- metadata +67 -57
- data/app/assets/javascripts/citygate/global.coffee +0 -14
- data/app/views/citygate/admin/users/_user_show.html.erb +0 -2
- data/app/views/citygate/admin/users/_users.html.erb +0 -12
- data/app/views/citygate/admin/users/index.js.erb +0 -1
- data/app/views/citygate/admin/users/show.js.erb +0 -1
- 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,14 +1,2 @@
|
|
1
1
|
$ ->
|
2
|
-
|
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]")
|