jobshop 0.0.4.2p4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -3
  3. data/app/assets/javascripts/jobshop/application.js +14 -1
  4. data/app/assets/stylesheets/jobshop/application.scss +250 -42
  5. data/app/assets/stylesheets/jobshop/breakpoints.scss +35 -0
  6. data/app/builders/jobshop/builder.rb +34 -0
  7. data/app/controllers/concerns/registration_token_validation.rb +8 -6
  8. data/app/controllers/jobshop/pages_controller.rb +11 -4
  9. data/app/controllers/jobshop/{sites → teams}/registrations_controller.rb +1 -2
  10. data/app/controllers/jobshop/{sites_controller.rb → teams_controller.rb} +1 -1
  11. data/app/helpers/jobshop/application_helper.rb +5 -0
  12. data/app/models/jobshop/dashboard.rb +5 -0
  13. data/app/models/jobshop/registration.rb +9 -7
  14. data/app/models/jobshop/{site.rb → team.rb} +2 -1
  15. data/app/models/jobshop/user.rb +2 -1
  16. data/app/views/devise/confirmations/new.html.haml +10 -0
  17. data/app/views/devise/mailer/confirmation_instructions.html.haml +4 -0
  18. data/app/views/devise/mailer/password_change.html.haml +3 -0
  19. data/app/views/devise/mailer/reset_password_instructions.html.haml +6 -0
  20. data/app/views/devise/mailer/unlock_instructions.html.haml +5 -0
  21. data/app/views/devise/passwords/edit.html.haml +19 -0
  22. data/app/views/devise/passwords/new.html.haml +10 -0
  23. data/app/views/devise/registrations/edit.html.haml +31 -0
  24. data/app/views/devise/registrations/new.html.haml +21 -0
  25. data/app/views/devise/sessions/new.html.haml +14 -0
  26. data/app/views/devise/shared/_links.html.haml +19 -0
  27. data/app/views/devise/unlocks/new.html.haml +10 -0
  28. data/app/views/jobshop/dashboards/show.html.haml +140 -1
  29. data/app/views/jobshop/pages/index.html.haml +6 -11
  30. data/app/views/jobshop/teams/registrations/new.html.haml +26 -0
  31. data/app/views/layouts/jobshop/application.html.haml +7 -6
  32. data/config/initializers/devise.rb +1 -1
  33. data/config/routes.rb +2 -2
  34. data/db/migrate/20160417210218_create_jobshop_dashboards.rb +15 -0
  35. data/db/migrate/20160425062447_rename_site_to_team.rb +30 -0
  36. data/lib/generators/jobshop/team/USAGE +7 -0
  37. data/lib/generators/jobshop/{site/site_generator.rb → team/team_generator.rb} +8 -8
  38. data/lib/jobshop/engine.rb +1 -1
  39. data/lib/jobshop/version.rb +4 -3
  40. data/lib/tasks/jobshop_tasks.rake +20 -4
  41. metadata +44 -36
  42. data/app/assets/stylesheets/jobshop/generics.scss +0 -25
  43. data/app/assets/stylesheets/jobshop/material-icons.scss +0 -24
  44. data/app/assets/stylesheets/jobshop/site/configuration.scss +0 -3
  45. data/app/views/jobshop/sites/registrations/new.html.haml +0 -30
  46. data/lib/generators/jobshop/site/USAGE +0 -8
@@ -0,0 +1,26 @@
1
+ %div(class="registration-layout")
2
+ %main
3
+ %div#register
4
+ = form_for @registration, builder: Jobshop::Builder, url: team_registration_path(@registration.team) do |f|
5
+ .mdl-card__title
6
+ %object.logo{ type: "image/svg+xml", data: image_path("jobshop/logo.svg") }
7
+
8
+ %h4
9
+ Get started with
10
+ %br>
11
+ %strong Jobshop
12
+ .mdl-card__supporting-text
13
+ = hidden_field_tag(:registration_token, params[:registration_token])
14
+
15
+ - if @registration.errors.present?
16
+ %p.error try again
17
+
18
+ = f.fields_for(@registration.team) do |team_f|
19
+ %div= team_f.text_field(:name)
20
+
21
+ = f.fields_for(@registration.user) do |user_f|
22
+ %div= user_f.email_field(:email)
23
+ %div= user_f.password_field(:password)
24
+ %div= user_f.password_field(:password_confirmation)
25
+ %div= f.button "Next »".html_safe, class: "btn waves-effect waves-light"
26
+
@@ -1,14 +1,15 @@
1
1
  !!!
2
- %html{ lang: "en", data: { controller: controller_path, action: action_name }}
2
+ %html{ lang: "en" }
3
3
  %head
4
- %meta{ content: "text/html; charset=UTF-8", "http-equiv": "Content-Type" }/
5
- %meta{ name: "viewport", content: "width=device-width, initial-scale=1.0" }/
4
+ %meta(charset="UTF-8")
5
+ %meta(http-equiv="X-UA-Compatible" content="IE=edge")
6
+ %meta(name="viewport" content="width=device-width, initial-scale=1.0")
7
+
6
8
  %title Jobshop
7
9
 
8
- = stylesheet_link_tag "jobshop/application", media: "all", "data-turbolinks-track": "reload"
9
- = stylesheet_link_tag "https://fonts.googleapis.com/icon?family=Material+Icons"
10
+ = stylesheet_link_tag "jobshop/application", media: "all", "data-turbolinks-track": "reload"
10
11
  = javascript_include_tag "jobshop/application", "data-turbolinks-track": "reload"
11
12
  = csrf_meta_tags
12
13
 
13
- %body{ data: { slug: yield(:data_slug) }}
14
+ %body{ class: body_class }
14
15
  = content_for?(:content) ? yield(:content) : yield
@@ -160,7 +160,7 @@ Devise.setup do |config|
160
160
  # Email regex used to validate email formats. It simply asserts that
161
161
  # one (and only one) @ exists in the given string. This is mainly
162
162
  # to give user feedback and not to assert the e-mail validity.
163
- # config.email_regexp = /\A[^@]+@[^@]+\z/
163
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
164
164
 
165
165
  # ==> Configuration for :timeoutable
166
166
  # The time you want to timeout the user session without activity. After this
@@ -3,9 +3,9 @@ Jobshop::Engine.routes.draw do
3
3
 
4
4
  get "/dashboard", to: "dashboards#show", as: :user_root
5
5
 
6
- resources :sites, only: [ ] do
6
+ resources :teams, only: [ ] do
7
7
  resource :registration, only: [ :new, :create ],
8
- controller: "sites/registrations"
8
+ controller: "teams/registrations"
9
9
  end
10
10
 
11
11
  get "/" => "pages#show", page: "index"
@@ -0,0 +1,15 @@
1
+ class CreateJobshopDashboards < ActiveRecord::Migration[5.0]
2
+ def change
3
+ enable_extension "pgcrypto" unless extension_enabled?("pgcrypto")
4
+
5
+ create_table(:jobshop_dashboards, id: :uuid,
6
+ default: "gen_random_uuid()")do |t|
7
+ t.uuid :site_id
8
+
9
+ t.timestamps
10
+ end
11
+
12
+ add_foreign_key(:jobshop_dashboards, :jobshop_sites, column: "site_id",
13
+ on_delete: :cascade)
14
+ end
15
+ end
@@ -0,0 +1,30 @@
1
+ class RenameSiteToTeam < ActiveRecord::Migration[5.0]
2
+ def change
3
+ reversible do |dir|
4
+ dir.up do
5
+ remove_foreign_key :jobshop_users, column: "site_id"
6
+ remove_foreign_key :jobshop_dashboards, column: "site_id"
7
+ remove_foreign_key :jobshop_sites, column: "owner_id"
8
+ end
9
+ dir.down do
10
+ add_foreign_key :jobshop_users, :jobshop_sites, column: "site_id",
11
+ on_delete: :cascade
12
+ add_foreign_key :jobshop_dashboards, :jobshop_sites, column: "site_id",
13
+ on_delete: :cascade
14
+ add_foreign_key :jobshop_sites, :jobshop_users, column: "owner_id",
15
+ on_delete: :restrict
16
+ end
17
+ end
18
+
19
+ rename_table :jobshop_sites, :jobshop_teams
20
+ rename_column :jobshop_users, :site_id, :team_id
21
+ rename_column :jobshop_dashboards, :site_id, :team_id
22
+
23
+ add_foreign_key :jobshop_users, :jobshop_teams, column: "team_id",
24
+ on_delete: :cascade
25
+ add_foreign_key :jobshop_dashboards, :jobshop_teams, column: "team_id",
26
+ on_delete: :cascade
27
+ add_foreign_key :jobshop_teams, :jobshop_users, column: "owner_id",
28
+ on_delete: :restrict
29
+ end
30
+ end
@@ -0,0 +1,7 @@
1
+ Description:
2
+ Create a new Jobshop team.
3
+
4
+ Example:
5
+ rails generate team "team name"
6
+
7
+ This will generate a new team and print a configuration link on the console.
@@ -1,11 +1,11 @@
1
1
  module Jobshop
2
2
  module Generators
3
- class SiteGenerator < Rails::Generators::NamedBase
3
+ class TeamGenerator < Rails::Generators::NamedBase
4
4
  source_root File.expand_path("../templates", __FILE__)
5
5
 
6
- desc "Create a jobshop site."
6
+ desc "Create a jobshop team."
7
7
 
8
- attr_reader :site, :link_text, :first_site
8
+ attr_reader :team, :link_text, :first_team
9
9
 
10
10
  def require_environment
11
11
  ENV['RAILS_ENV'] ||= "development"
@@ -17,12 +17,12 @@ module Jobshop
17
17
  require environment_filename
18
18
  end
19
19
 
20
- def create_site
21
- @site = Jobshop::Site.create!(name: name)
20
+ def create_team
21
+ @team = Jobshop::Team.create!(name: name)
22
22
  end
23
23
 
24
24
  def generate_token
25
- @token = site.generate_registration_token
25
+ @token = team.generate_registration_token
26
26
  end
27
27
 
28
28
  def generate_secure_registration_link
@@ -32,7 +32,7 @@ module Jobshop
32
32
  # protocol. HTTPS isn't mandatory in production but it is very, VERY
33
33
  # highly recommended.
34
34
  @link_text = Jobshop::Engine.routes.url_helpers.
35
- new_site_registration_url(@site,
35
+ new_team_registration_url(@team,
36
36
  protocol: link_protocol,
37
37
  host: link_host,
38
38
  registration_token: @token
@@ -43,7 +43,7 @@ module Jobshop
43
43
  say <<-MESSAGE
44
44
  ### JOBSHOP - IMPORTANT INFORMATION ############################################
45
45
 
46
- Your Jobshop site "#{name}" has been initialized.
46
+ Your Jobshop team "#{name}" has been initialized.
47
47
  You may use the following link to complete the setup process.
48
48
 
49
49
  #{link_text}
@@ -1,7 +1,7 @@
1
1
  require "devise"
2
2
  require "haml-rails"
3
3
  require "jquery-rails"
4
- require "materialize-sass"
4
+ require "material_design_lite-sass"
5
5
  require "pundit"
6
6
  require "rolify"
7
7
  require "sass-rails"
@@ -6,9 +6,10 @@ module Jobshop
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 0
9
- TINY = 4
10
- PRE = "2p4"
9
+ TINY = 5
10
+ PRE = nil
11
11
 
12
- STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
12
+ CODE_NAME = "bump it up".freeze
13
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".").freeze
13
14
  end
14
15
  end
@@ -1,4 +1,20 @@
1
- # desc "Explaining what the task does"
2
- # task :jobshop do
3
- # # Task goes here
4
- # end
1
+ # This effectively hides the rake task from `$ rake -T`.
2
+ Rake::Task["jobshop:install:migrations"].instance_variable_set(:@comments, [])
3
+
4
+ namespace :jobshop do
5
+ task :disable_autoload do
6
+ ActiveSupport::Dependencies.class_eval do
7
+ extend Module.new {
8
+ def load_file(path, const_paths = loadable_constants_for_path(path))
9
+ jobshop_models_path = File.join(Jobshop::Engine.root, "app", "models")
10
+ return if path.starts_with?(jobshop_models_path)
11
+ super
12
+ end
13
+ }
14
+ end
15
+ end
16
+ end
17
+
18
+ %w( db:migrate db:rollback db:migrate:up db:migrate:down ).each do |t|
19
+ Rake::Task[t].prerequisites << "jobshop:disable_autoload"
20
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobshop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4.2p4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank J. Mattia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-23 00:00:00.000000000 Z
11
+ date: 2016-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coffee-rails
@@ -28,22 +28,16 @@ dependencies:
28
28
  name: devise
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 4.0.0.rc1
34
- - - "<"
31
+ - - "~>"
35
32
  - !ruby/object:Gem::Version
36
- version: '4.1'
33
+ version: 4.1.0
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 4.0.0.rc1
44
- - - "<"
38
+ - - "~>"
45
39
  - !ruby/object:Gem::Version
46
- version: '4.1'
40
+ version: 4.1.0
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: haml-rails
49
43
  requirement: !ruby/object:Gem::Requirement
@@ -73,19 +67,19 @@ dependencies:
73
67
  - !ruby/object:Gem::Version
74
68
  version: 4.1.0
75
69
  - !ruby/object:Gem::Dependency
76
- name: materialize-sass
70
+ name: material_design_lite-sass
77
71
  requirement: !ruby/object:Gem::Requirement
78
72
  requirements:
79
73
  - - "~>"
80
74
  - !ruby/object:Gem::Version
81
- version: 0.97.5
75
+ version: 1.1.3
82
76
  type: :runtime
83
77
  prerelease: false
84
78
  version_requirements: !ruby/object:Gem::Requirement
85
79
  requirements:
86
80
  - - "~>"
87
81
  - !ruby/object:Gem::Version
88
- version: 0.97.5
82
+ version: 1.1.3
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: pundit
91
85
  requirement: !ruby/object:Gem::Requirement
@@ -106,7 +100,7 @@ dependencies:
106
100
  requirements:
107
101
  - - ">="
108
102
  - !ruby/object:Gem::Version
109
- version: 5.0.0.beta3
103
+ version: 5.0.0.rc1
110
104
  - - "<"
111
105
  - !ruby/object:Gem::Version
112
106
  version: '5.1'
@@ -116,7 +110,7 @@ dependencies:
116
110
  requirements:
117
111
  - - ">="
118
112
  - !ruby/object:Gem::Version
119
- version: 5.0.0.beta3
113
+ version: 5.0.0.rc1
120
114
  - - "<"
121
115
  - !ruby/object:Gem::Version
122
116
  version: '5.1'
@@ -126,14 +120,14 @@ dependencies:
126
120
  requirements:
127
121
  - - "~>"
128
122
  - !ruby/object:Gem::Version
129
- version: 5.0.0
123
+ version: 5.1.0
130
124
  type: :runtime
131
125
  prerelease: false
132
126
  version_requirements: !ruby/object:Gem::Requirement
133
127
  requirements:
134
128
  - - "~>"
135
129
  - !ruby/object:Gem::Version
136
- version: 5.0.0
130
+ version: 5.1.0
137
131
  - !ruby/object:Gem::Dependency
138
132
  name: sass-rails
139
133
  requirement: !ruby/object:Gem::Requirement
@@ -154,7 +148,7 @@ dependencies:
154
148
  requirements:
155
149
  - - ">="
156
150
  - !ruby/object:Gem::Version
157
- version: 5.0.0.beta1
151
+ version: 5.0.0.beta2
158
152
  - - "<"
159
153
  - !ruby/object:Gem::Version
160
154
  version: '5.1'
@@ -164,7 +158,7 @@ dependencies:
164
158
  requirements:
165
159
  - - ">="
166
160
  - !ruby/object:Gem::Version
167
- version: 5.0.0.beta1
161
+ version: 5.0.0.beta2
168
162
  - - "<"
169
163
  - !ruby/object:Gem::Version
170
164
  version: '5.1'
@@ -188,14 +182,14 @@ dependencies:
188
182
  requirements:
189
183
  - - "~>"
190
184
  - !ruby/object:Gem::Version
191
- version: '4.5'
185
+ version: '4.6'
192
186
  type: :development
193
187
  prerelease: false
194
188
  version_requirements: !ruby/object:Gem::Requirement
195
189
  requirements:
196
190
  - - "~>"
197
191
  - !ruby/object:Gem::Version
198
- version: '4.5'
192
+ version: '4.6'
199
193
  - !ruby/object:Gem::Dependency
200
194
  name: generator_spec
201
195
  requirement: !ruby/object:Gem::Requirement
@@ -244,7 +238,7 @@ dependencies:
244
238
  requirements:
245
239
  - - ">="
246
240
  - !ruby/object:Gem::Version
247
- version: 3.5.0.beta1
241
+ version: 3.5.0.beta3
248
242
  - - "<"
249
243
  - !ruby/object:Gem::Version
250
244
  version: '3.6'
@@ -254,7 +248,7 @@ dependencies:
254
248
  requirements:
255
249
  - - ">="
256
250
  - !ruby/object:Gem::Version
257
- version: 3.5.0.beta1
251
+ version: 3.5.0.beta3
258
252
  - - "<"
259
253
  - !ruby/object:Gem::Version
260
254
  version: '3.6'
@@ -301,26 +295,38 @@ files:
301
295
  - app/assets/images/jobshop/logo.svg
302
296
  - app/assets/javascripts/jobshop/application.js
303
297
  - app/assets/stylesheets/jobshop/application.scss
304
- - app/assets/stylesheets/jobshop/generics.scss
305
- - app/assets/stylesheets/jobshop/material-icons.scss
306
- - app/assets/stylesheets/jobshop/site/configuration.scss
298
+ - app/assets/stylesheets/jobshop/breakpoints.scss
299
+ - app/builders/jobshop/builder.rb
307
300
  - app/controllers/concerns/registration_token_validation.rb
308
301
  - app/controllers/jobshop/application_controller.rb
309
302
  - app/controllers/jobshop/dashboards_controller.rb
310
303
  - app/controllers/jobshop/pages_controller.rb
311
- - app/controllers/jobshop/sites/registrations_controller.rb
312
- - app/controllers/jobshop/sites_controller.rb
304
+ - app/controllers/jobshop/teams/registrations_controller.rb
305
+ - app/controllers/jobshop/teams_controller.rb
313
306
  - app/helpers/jobshop/application_helper.rb
314
307
  - app/jobs/jobshop/application_job.rb
315
308
  - app/models/jobshop/application_record.rb
309
+ - app/models/jobshop/dashboard.rb
316
310
  - app/models/jobshop/registration.rb
317
- - app/models/jobshop/site.rb
311
+ - app/models/jobshop/team.rb
318
312
  - app/models/jobshop/user.rb
319
313
  - app/models/jobshop/virtual_record.rb
320
314
  - app/policies/jobshop/application_policy.rb
315
+ - app/views/devise/confirmations/new.html.haml
316
+ - app/views/devise/mailer/confirmation_instructions.html.haml
317
+ - app/views/devise/mailer/password_change.html.haml
318
+ - app/views/devise/mailer/reset_password_instructions.html.haml
319
+ - app/views/devise/mailer/unlock_instructions.html.haml
320
+ - app/views/devise/passwords/edit.html.haml
321
+ - app/views/devise/passwords/new.html.haml
322
+ - app/views/devise/registrations/edit.html.haml
323
+ - app/views/devise/registrations/new.html.haml
324
+ - app/views/devise/sessions/new.html.haml
325
+ - app/views/devise/shared/_links.html.haml
326
+ - app/views/devise/unlocks/new.html.haml
321
327
  - app/views/jobshop/dashboards/show.html.haml
322
328
  - app/views/jobshop/pages/index.html.haml
323
- - app/views/jobshop/sites/registrations/new.html.haml
329
+ - app/views/jobshop/teams/registrations/new.html.haml
324
330
  - app/views/layouts/jobshop/application.html.haml
325
331
  - config/initializers/assets.rb
326
332
  - config/initializers/devise.rb
@@ -333,12 +339,14 @@ files:
333
339
  - db/migrate/20160321213638_add_foreign_key_for_site.rb
334
340
  - db/migrate/20160322040604_add_owner_id_to_sites.rb
335
341
  - db/migrate/20160323132658_rename_configuration_token_to_registration_token.rb
342
+ - db/migrate/20160417210218_create_jobshop_dashboards.rb
343
+ - db/migrate/20160425062447_rename_site_to_team.rb
336
344
  - db/migrate/keep
337
345
  - lib/generators/jobshop/config/config_generator.rb
338
346
  - lib/generators/jobshop/config/templates/jobshop.rb.tt
339
347
  - lib/generators/jobshop/orm_helpers.rb
340
- - lib/generators/jobshop/site/USAGE
341
- - lib/generators/jobshop/site/site_generator.rb
348
+ - lib/generators/jobshop/team/USAGE
349
+ - lib/generators/jobshop/team/team_generator.rb
342
350
  - lib/jobshop.rb
343
351
  - lib/jobshop/dummy.rb
344
352
  - lib/jobshop/engine.rb
@@ -363,9 +371,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
363
371
  version: '0'
364
372
  required_rubygems_version: !ruby/object:Gem::Requirement
365
373
  requirements:
366
- - - ">"
374
+ - - ">="
367
375
  - !ruby/object:Gem::Version
368
- version: 1.3.1
376
+ version: '0'
369
377
  requirements: []
370
378
  rubyforge_project:
371
379
  rubygems_version: 2.5.1