samurai_core 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +24 -0
  5. data/app/assets/javascripts/samurai/application.js +16 -0
  6. data/app/assets/stylesheets/samurai/application.css.scss +6 -0
  7. data/app/controllers/samurai/admin/admin_controller.rb +9 -0
  8. data/app/controllers/samurai/admin/users_controller.rb +9 -0
  9. data/app/controllers/samurai/application_controller.rb +13 -0
  10. data/app/controllers/samurai/dashboard_controller.rb +9 -0
  11. data/app/helpers/samurai/application_helper.rb +22 -0
  12. data/app/models/samurai/ability.rb +67 -0
  13. data/app/models/samurai/user.rb +10 -0
  14. data/app/views/devise/confirmations/new.html.erb +16 -0
  15. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  16. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  17. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  18. data/app/views/devise/passwords/edit.html.erb +22 -0
  19. data/app/views/devise/passwords/new.html.erb +16 -0
  20. data/app/views/devise/registrations/edit.html.erb +50 -0
  21. data/app/views/devise/registrations/new.html.erb +34 -0
  22. data/app/views/devise/sessions/new.html.erb +36 -0
  23. data/app/views/devise/shared/_links.html.erb +25 -0
  24. data/app/views/devise/unlocks/new.html.erb +16 -0
  25. data/app/views/layouts/samurai/application.html.erb +49 -0
  26. data/app/views/samurai/admin/admin/index.html.erb +34 -0
  27. data/app/views/samurai/admin/shared/_nav.html.erb +12 -0
  28. data/app/views/samurai/admin/users/index.html.erb +29 -0
  29. data/app/views/samurai/dashboard/index.html.erb +7 -0
  30. data/app/views/samurai/static/403.html +1 -0
  31. data/config/initializers/devise.rb +261 -0
  32. data/config/locales/devise.en.yml +60 -0
  33. data/config/routes.rb +8 -0
  34. data/db/migrate/20150413191412_devise_create_samurai_users.rb +42 -0
  35. data/db/migrate/20150415165903_add_admin_to_samurai_users.rb +5 -0
  36. data/lib/samurai/core.rb +13 -0
  37. data/lib/samurai/core/engine.rb +17 -0
  38. data/lib/samurai/core/version.rb +5 -0
  39. data/lib/samurai_core.rb +2 -0
  40. data/lib/tasks/core_tasks.rake +4 -0
  41. metadata +239 -0
@@ -0,0 +1,60 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid %{authentication_keys} or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid %{authentication_keys} or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ omniauth_callbacks:
27
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
28
+ success: "Successfully authenticated from %{kind} account."
29
+ passwords:
30
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
31
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
32
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
33
+ updated: "Your password has been changed successfully. You are now signed in."
34
+ updated_not_active: "Your password has been changed successfully."
35
+ registrations:
36
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
37
+ signed_up: "Welcome! You have signed up successfully."
38
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
39
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
40
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
41
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
42
+ updated: "Your account has been updated successfully."
43
+ sessions:
44
+ signed_in: "Signed in successfully."
45
+ signed_out: "Signed out successfully."
46
+ already_signed_out: "Signed out successfully."
47
+ unlocks:
48
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
49
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
50
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
51
+ errors:
52
+ messages:
53
+ already_confirmed: "was already confirmed, please try signing in"
54
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
55
+ expired: "has expired, please request a new one"
56
+ not_found: "not found"
57
+ not_locked: "was not locked"
58
+ not_saved:
59
+ one: "1 error prohibited this %{resource} from being saved:"
60
+ other: "%{count} errors prohibited this %{resource} from being saved:"
data/config/routes.rb ADDED
@@ -0,0 +1,8 @@
1
+ Samurai::Core::Engine.routes.draw do
2
+ devise_for :users, class_name: "Samurai::User", module: :devise
3
+ namespace :admin do
4
+ get '/' => "admin#index"
5
+ resources :users, only: :index
6
+ end
7
+ root to: "dashboard#index"
8
+ end
@@ -0,0 +1,42 @@
1
+ class DeviseCreateSamuraiUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:samurai_users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, null: false, default: ""
6
+ t.string :encrypted_password, null: false, default: ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, default: 0, null: false
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ ## Confirmable
23
+ # t.string :confirmation_token
24
+ # t.datetime :confirmed_at
25
+ # t.datetime :confirmation_sent_at
26
+ # t.string :unconfirmed_email # Only if using reconfirmable
27
+
28
+ ## Lockable
29
+ # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
30
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
31
+ # t.datetime :locked_at
32
+
33
+
34
+ t.timestamps
35
+ end
36
+
37
+ add_index :samurai_users, :email, unique: true
38
+ add_index :samurai_users, :reset_password_token, unique: true
39
+ # add_index :samurai_users, :confirmation_token, unique: true
40
+ # add_index :samurai_users, :unlock_token, unique: true
41
+ end
42
+ end
@@ -0,0 +1,5 @@
1
+ class AddAdminToSamuraiUsers < ActiveRecord::Migration
2
+ def change
3
+ add_column :samurai_users, :admin, :boolean
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ require 'sass-rails'
2
+ require 'bootstrap-sass'
3
+ require 'autoprefixer-rails'
4
+ require 'devise'
5
+ require 'cancan'
6
+
7
+ module Samurai
8
+ module Core
9
+ def self.available?(engine_name)
10
+ Object.const_defined?("Samurai::#{engine_name.to_s.camelize}")
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ module Samurai
2
+ module Core
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace Samurai
5
+
6
+ paths["app/views"] << "app/views/samurai"
7
+
8
+ initializer :append_migrations do |app|
9
+ unless app.root.to_s.match(root.to_s)
10
+ config.paths["db/migrate"].expanded.each do |p|
11
+ app.config.paths["db/migrate"] << p
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ module Samurai
2
+ module Core
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,2 @@
1
+ require 'samurai/core'
2
+ require 'samurai/core/engine'
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :core do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,239 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: samurai_core
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Thibault Denizet
8
+ - Lucas Mendelowski
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-04-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 4.2.1
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 4.2.1
28
+ - !ruby/object:Gem::Dependency
29
+ name: sass-rails
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: 5.0.1
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: 5.0.1
42
+ - !ruby/object:Gem::Dependency
43
+ name: bootstrap-sass
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: 3.3.3
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: 3.3.3
56
+ - !ruby/object:Gem::Dependency
57
+ name: autoprefixer-rails
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: 5.1.5
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: 5.1.5
70
+ - !ruby/object:Gem::Dependency
71
+ name: devise
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 3.4.1
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 3.4.1
84
+ - !ruby/object:Gem::Dependency
85
+ name: cancan
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: 1.6.10
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: 1.6.10
98
+ - !ruby/object:Gem::Dependency
99
+ name: sqlite3
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: rspec-rails
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: factory_girl_rails
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ - !ruby/object:Gem::Dependency
141
+ name: faker
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ - !ruby/object:Gem::Dependency
155
+ name: database_cleaner
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ description: Core features of SamuraiCRM.
169
+ email:
170
+ - bo@samurails.com
171
+ - mendelowski@gmail.com
172
+ executables: []
173
+ extensions: []
174
+ extra_rdoc_files: []
175
+ files:
176
+ - MIT-LICENSE
177
+ - README.rdoc
178
+ - Rakefile
179
+ - app/assets/javascripts/samurai/application.js
180
+ - app/assets/stylesheets/samurai/application.css.scss
181
+ - app/controllers/samurai/admin/admin_controller.rb
182
+ - app/controllers/samurai/admin/users_controller.rb
183
+ - app/controllers/samurai/application_controller.rb
184
+ - app/controllers/samurai/dashboard_controller.rb
185
+ - app/helpers/samurai/application_helper.rb
186
+ - app/models/samurai/ability.rb
187
+ - app/models/samurai/user.rb
188
+ - app/views/devise/confirmations/new.html.erb
189
+ - app/views/devise/mailer/confirmation_instructions.html.erb
190
+ - app/views/devise/mailer/reset_password_instructions.html.erb
191
+ - app/views/devise/mailer/unlock_instructions.html.erb
192
+ - app/views/devise/passwords/edit.html.erb
193
+ - app/views/devise/passwords/new.html.erb
194
+ - app/views/devise/registrations/edit.html.erb
195
+ - app/views/devise/registrations/new.html.erb
196
+ - app/views/devise/sessions/new.html.erb
197
+ - app/views/devise/shared/_links.html.erb
198
+ - app/views/devise/unlocks/new.html.erb
199
+ - app/views/layouts/samurai/application.html.erb
200
+ - app/views/samurai/admin/admin/index.html.erb
201
+ - app/views/samurai/admin/shared/_nav.html.erb
202
+ - app/views/samurai/admin/users/index.html.erb
203
+ - app/views/samurai/dashboard/index.html.erb
204
+ - app/views/samurai/static/403.html
205
+ - config/initializers/devise.rb
206
+ - config/locales/devise.en.yml
207
+ - config/routes.rb
208
+ - db/migrate/20150413191412_devise_create_samurai_users.rb
209
+ - db/migrate/20150415165903_add_admin_to_samurai_users.rb
210
+ - lib/samurai/core.rb
211
+ - lib/samurai/core/engine.rb
212
+ - lib/samurai/core/version.rb
213
+ - lib/samurai_core.rb
214
+ - lib/tasks/core_tasks.rake
215
+ homepage: http://samurails.com
216
+ licenses:
217
+ - MIT
218
+ metadata: {}
219
+ post_install_message:
220
+ rdoc_options: []
221
+ require_paths:
222
+ - lib
223
+ required_ruby_version: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - ">="
226
+ - !ruby/object:Gem::Version
227
+ version: '0'
228
+ required_rubygems_version: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - ">="
231
+ - !ruby/object:Gem::Version
232
+ version: '0'
233
+ requirements: []
234
+ rubyforge_project:
235
+ rubygems_version: 2.2.2
236
+ signing_key:
237
+ specification_version: 4
238
+ summary: Core features of SamuraiCRM.
239
+ test_files: []