jobshop 0.0.4.2p4 → 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.
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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebd478bfbc679ef91271554cd5a9f8c0bd12475d
4
- data.tar.gz: 81649a0c32fbfe838c26046da849bd94ad8d08db
3
+ metadata.gz: 911cba16d1bf58d408dd6776437e6996e6fe04a3
4
+ data.tar.gz: cfa8021ce4383cec99661fefadfb394c08dd3ade
5
5
  SHA512:
6
- metadata.gz: c1df82ba9a8337d6f4262bc3c3c093fc4581e0c402c7b15713b334d4b358214aa1bad765b0c5274c67ddfee9fe4131689d772e442a3002ebd2be9f91232cd6bf
7
- data.tar.gz: 69071e78619c4e6d17d141cd00b89a7032a61d1201b915ed617071143d0337a281b6f6334cb750993c52f6a542ec6a5910313bad1e5ca83963dcd0512798523f
6
+ metadata.gz: fb7a4111e42a7383f59c987d77adbdd14d2498b3ee680bbeddf374153162e6f2294e8d7ca582a2d6b99f1bfd061585ad1a634a922241486803b32682cf47d239
7
+ data.tar.gz: aa5738597b6865e64806ca76ddf507508221f560e79bce0512d9cb3516503f93e761477ba638d1cf52c263e58e5f4278b157adc7c4693a49f689c1eb3d99f28c
data/README.md CHANGED
@@ -44,13 +44,14 @@ $ rake db:create
44
44
  $ rake db:migrate
45
45
  ```
46
46
 
47
- Lastly, create your first Jobshop site:
47
+ Lastly, create your first Jobshop team:
48
48
 
49
49
  ```
50
- $ rails g Jobshop:site "My Organization Name"
50
+ $ rails g Jobshop:team "My Team Name"
51
51
  ```
52
52
 
53
- Fire up your server `$ rails s` and navigate to the link provided by the site generator!
53
+ Fire up your server `$ rails s` and navigate to the link provided by the team
54
+ generator!
54
55
 
55
56
  ## Bug Reports
56
57
  If you discover a problem with Jobshop, we would like to know about it.
@@ -12,5 +12,18 @@
12
12
  //
13
13
  //= require jquery
14
14
  //= require jquery_ujs
15
- //= require materialize-sprockets
15
+ //= require material
16
+ //= require turbolinks
16
17
  //= require_tree .
18
+
19
+ document.addEventListener("turbolinks:load", function() {
20
+ componentHandler.upgradeDom();
21
+ });
22
+
23
+ $(document).on("click", "li.mdl-menu__item", function(event) {
24
+ var menuItemLink = $(this).find("a").first();
25
+
26
+ if (menuItemLink.length !== 0) {
27
+ menuItemLink.get(0).click();
28
+ }
29
+ });
@@ -1,56 +1,264 @@
1
1
  @charset "utf-8"
2
- @import url(https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic);
3
-
4
- @import "materialize/components/color";
5
- // TODO: Import overrides here;
6
- $primary-color: color("blue", "lighten-5") !default;
7
- $navbar-font-color: color("blue-grey", "darken-4") !default;
8
- $navbar-brand-font-size: 2.5rem !default;
9
- @import "materialize";
10
- @import "material-icons";
11
-
12
- html {
13
- height: 100%;
14
-
15
- body {
16
- background-color: color("blue", "lighten-5");
17
- margin: 0;
2
+
3
+ @import "material";
4
+
5
+ @import "jobshop/breakpoints";
6
+
7
+ html, body {
8
+ background-color: unquote("rgb(#{$palette-indigo-50})");
9
+ font-family: "Roboto", "Helvetica", sans-serif;
10
+ }
11
+
12
+ html { height: 100% }
13
+ body { min-height: 100%; }
14
+
15
+ .session-layout,
16
+ .registration-layout {
17
+ @extend .mdl-layout;
18
+ }
19
+
20
+ body.static-index {
21
+ & > .layout {
22
+ @extend .mdl-layout, .mdl-layout--fixed-header;
23
+
24
+ & > header {
25
+ @extend .mdl-layout__header, .mdl-color--white, .mdl-color-text--black;
26
+
27
+ & > div {
28
+ @extend .mdl-layout__header-row;
29
+
30
+ font-weight: bold !important;
31
+ }
32
+ }
33
+ }
34
+ }
35
+
36
+ main {
37
+ @extend .mdl-layout__content;
38
+
39
+ display: flex;
40
+ justify-content: center;
41
+ }
42
+
43
+ #sign-in,
44
+ #register {
45
+ @extend .mdl-card;
46
+ @extend .mdl-shadow--2dp;
47
+
48
+ margin: 1rem;
49
+ width: 100%;
50
+
51
+ @include tablet-up {
52
+ width: 440px;
18
53
  }
19
54
 
20
- h2 { font-family: 'Lora', serif; }
21
-
22
- .bubble:before {
23
- content: '';
24
- position: absolute;
25
- border-style: solid;
26
- border-width: 0 1.2rem 1.2rem;
27
- border-color: #fff transparent;
28
- display: block;
29
- z-index: 0;
30
- margin-left: -1.2rem;
31
- top: -1.17rem; /* FIXME: 1.2rem leaves a 1px gap at some breakpoints */
32
- left: 50%;
55
+ .mdl-card__supporting-text {
56
+ width: auto;
33
57
  }
34
58
 
35
- .card-action {
36
- display: flex;
37
- justify-content: space-between;
38
- align-items: center;
59
+ .mdl-textfield {
60
+ width: 100%;
39
61
  }
62
+ }
63
+
64
+ .mdl-menu__item a {
65
+ color: inherit;
66
+ font-weight: inherit;
67
+ text-decoration: none;
68
+ }
40
69
 
41
- .card-content {
42
- .error {
43
- color: $error-color !important;
44
- text-align: center;
70
+ .mdl-card__title {
71
+ align-items: center;
72
+ height: 200px;
73
+ justify-content: space-around;
74
+
75
+ h4 {
76
+ opacity: 0.82;
77
+ text-align: right;
78
+
79
+ strong {
80
+ font-size: 1.1em;
45
81
  }
46
82
  }
83
+ }
47
84
 
48
- .logo { margin: 2rem auto; }
85
+ .mdl-card__actions {
86
+ align-items: center;
87
+ display: flex;
88
+ justify-content: space-between;
89
+ padding: $card-vertical-padding $card-horizontal-padding;
49
90
 
50
- .sub-head {
51
- font-size: 1.5rem;
52
- font-weight: 300;
91
+ button {
92
+ @extend .mdl-button;
93
+ @extend .mdl-button--colored;
53
94
  }
54
95
  }
55
96
 
56
- @import "generics";
97
+ /**
98
+ * .demo-avatar {
99
+ * width: 48px;
100
+ * height: 48px;
101
+ * border-radius: 24px;
102
+ * }
103
+ *
104
+ * .demo-layout {
105
+ * .demo-header {
106
+ * .mdl-textfield {
107
+ * padding: 0px;
108
+ * margin-top: 41px;
109
+ *
110
+ * .mdl-textfield__expandable-holder {
111
+ * bottom: 19px;
112
+ * }
113
+ * }
114
+ * }
115
+ *
116
+ * .demo-navigation {
117
+ * .mdl-navigation__link {
118
+ * display: flex !important;
119
+ * flex-direction: row;
120
+ * align-items: center;
121
+ * color: rgba(255, 255, 255, 0.56);
122
+ * font-weight: 500;
123
+ * }
124
+ *
125
+ * .mdl-navigation__link:hover {
126
+ * background-color: #00BCD4;
127
+ * color: #37474F;
128
+ * }
129
+ * }
130
+ *
131
+ * .mdl-layout__header {
132
+ * .mdl-layout__drawer-button { color: rgba(0, 0, 0, 0.54); }
133
+ * }
134
+ * }
135
+ *
136
+ * .mdl-layout__drawer {
137
+ * .avatar { margin-bottom: 16px; }
138
+ * }
139
+ *
140
+ * .demo-drawer {
141
+ * border: none;
142
+ *
143
+ * /* iOS Safari specific workaround * /
144
+ * .mdl-menu__container { z-index: -1; }
145
+ * .demo-navigation { z-index: -2; }
146
+ * /* END iOS Safari specific workaround * /
147
+ *
148
+ * .mdl-menu .mdl-menu__item {
149
+ * display: flex;
150
+ * align-items: center;
151
+ *
152
+ * a {
153
+ * display: block;
154
+ * }
155
+ * }
156
+ * }
157
+ *
158
+ * .demo-drawer-header {
159
+ * box-sizing: border-box;
160
+ * display: flex;
161
+ * flex-direction: column;
162
+ * justify-content: flex-end;
163
+ * padding: 16px;
164
+ * height: 151px;
165
+ * }
166
+ *
167
+ * .demo-avatar-dropdown {
168
+ * display: flex;
169
+ * position: relative;
170
+ * flex-direction: row;
171
+ * align-items: center;
172
+ * width: 100%;
173
+ * }
174
+ *
175
+ * .demo-navigation {
176
+ * flex-grow: 1;
177
+ *
178
+ * .mdl-navigation__link .material-icons {
179
+ * font-size: 24px;
180
+ * color: rgba(255, 255, 255, 0.56);
181
+ * margin-right: 32px;
182
+ * }
183
+ * }
184
+ *
185
+ * .demo-content { max-width: 1080px; }
186
+ *
187
+ * .demo-cards {
188
+ * align-items: flex-start;
189
+ * align-content: flex-start;
190
+ *
191
+ * .demo-separator { height: 32px; }
192
+ *
193
+ * .mdl-card__title.mdl-card__title {
194
+ * color: white;
195
+ * font-size: 24px;
196
+ * font-weight: 400;
197
+ * }
198
+ *
199
+ * .mdl-card__actions {
200
+ * a {
201
+ * color: #00BCD4;
202
+ * text-decoration: none;
203
+ * }
204
+ * }
205
+ *
206
+ * ul { padding: 0; }
207
+ * h3 { font-size: 1em; }
208
+ * }
209
+ *
210
+ * .demo-updates .mdl-card__title {
211
+ * min-height: 200px;
212
+ * background-image: url('images/dog.png');
213
+ * background-position: 90% 100%;
214
+ * background-repeat: no-repeat;
215
+ * }
216
+ *
217
+ * .demo-options {
218
+ * .material-icons { color: rgba(255, 255, 255, 0.89); }
219
+ *
220
+ * .mdl-card__actions {
221
+ * height: 64px;
222
+ * display: flex;
223
+ * box-sizing: border-box;
224
+ * align-items: center;
225
+ * }
226
+ *
227
+ * .mdl-checkbox__box-outline {
228
+ * border-color: rgba(255, 255, 255, 0.89);
229
+ * }
230
+ *
231
+ * h3 { margin: 0; }
232
+ *
233
+ * ul {
234
+ * margin: 0;
235
+ * list-style-type: none;
236
+ * }
237
+ *
238
+ * li { margin: 4px 0; }
239
+ * }
240
+ *
241
+ * .demo-charts { align-items: center; }
242
+ * .demo-chart:nth-child(1) { color: #ACEC00; }
243
+ * .demo-chart:nth-child(2) { color: #00BBD6; }
244
+ * .demo-chart:nth-child(3) { color: #BA65C9; }
245
+ * .demo-chart:nth-child(4) { color: #EF3C79; }
246
+ *
247
+ * .demo-graphs {
248
+ * padding: 16px 32px;
249
+ * display: flex;
250
+ * flex-direction: column;
251
+ * align-items: stretch;
252
+ * }
253
+ *
254
+ * /* TODO: Find a proper solution to have the graphs
255
+ * * not float around outside their container in IE10/11.
256
+ * * Using a browserhacks.com solution for now.
257
+ * * /
258
+ * _:-ms-input-placeholder, :root .demo-graphs { min-height: 664px; }
259
+ * _:-ms-input-placeholder, :root .demo-graph { max-height: 300px; }
260
+ * /* TODO end * /
261
+ *
262
+ * .demo-graph:nth-child(1) { color: #00b9d8; }
263
+ * .demo-graph:nth-child(2) { color: #d9006e; }
264
+ */
@@ -0,0 +1,35 @@
1
+ a {
2
+ color: red;
3
+ }
4
+
5
+ $breakpoints: (
6
+ s-handset-p: 0px,
7
+ m-handset-p: 360px,
8
+ l-handset-p: 400px,
9
+ xl-handset-p: 480px,
10
+ s-tablet-p: 600px,
11
+ m-tablet-p: 720px,
12
+ l-tablet-p: 840px,
13
+ s-handset-l: 480px,
14
+ m-handset-l: 600px,
15
+ l-handset-l: 720px,
16
+ xl-handset-l: 840px,
17
+ s-tablet-l: 960px,
18
+ m-tablet-l: 1024px,
19
+ l-tablet-l: 1280px,
20
+ s-desktop: 1440px,
21
+ m-desktop: 1600px,
22
+ l-desktop: 1920px
23
+ );
24
+
25
+ @mixin handset {
26
+ @media screen and (max-width: #{map-get($breakpoints, xl-handset-p)}) {
27
+ @content;
28
+ }
29
+ }
30
+
31
+ @mixin tablet-up {
32
+ @media screen and (min-width: #{map-get($breakpoints, xl-handset-p) + 1}) {
33
+ @content;
34
+ }
35
+ }
@@ -0,0 +1,34 @@
1
+ module Jobshop
2
+ class Builder < ActionView::Helpers::FormBuilder # :nodoc:
3
+ [ :email_field, :password_field, :text_field ].each do |field_method|
4
+ define_method field_method do |field, options = {}|
5
+ output = ""
6
+ output += @template.content_tag(:div, class: "mdl-textfield mdl-js-textfield") do
7
+ content = ""
8
+ content += super(field, class: [ "mdl-textfield__input" ])
9
+ content += label(field, class: [ "mdl-textfield__label" ])
10
+ content.html_safe
11
+ end
12
+ output.html_safe
13
+ end
14
+ end
15
+
16
+ def check_box(field, *args)
17
+ output = ""
18
+ output += label(field, class: [ "mdl-checkbox", "mdl-js-checkbox", "mdl-js-ripple-effect" ]) do
19
+ content = ""
20
+ content += super(field, class: [ "mdl-checkbox__input" ])
21
+ content += @template.content_tag(:span, field.to_s.humanize, class: [ "mdl-checkbox__label" ])
22
+ content.html_safe
23
+ end
24
+ output.html_safe
25
+ end
26
+
27
+ def button(value = nil, *args)
28
+ button_classes = [ "mdl-button", "mdl-js-button", "mdl-button--raised",
29
+ "mdl-button--colored", "mdl-js-ripple-effect" ]
30
+
31
+ super(value, class: button_classes)
32
+ end
33
+ end
34
+ end
@@ -6,20 +6,22 @@ module RegistrationTokenValidation
6
6
  end
7
7
 
8
8
  def validate_registration_token!
9
- redirect_to new_user_session_path unless token_present_and_resolves?
9
+ redirect_to new_user_session_path unless registration_token_valid?
10
10
  end
11
11
 
12
- def token_present_and_resolves?
12
+ def registration_token_valid?
13
13
  params[:registration_token].present? && registration_token_resolves?
14
14
  end
15
15
 
16
16
  def registration_token_resolves?
17
17
  encrypted_token = Devise.token_generator.digest(
18
- Jobshop::Site, :registration_token, params[:registration_token])
18
+ Jobshop::Team, :registration_token, params[:registration_token])
19
19
 
20
- configurable = Jobshop::Site.find_by(
21
- id: params[:site_id], registration_token: encrypted_token)
20
+ configurable = Jobshop::Team.find_by(
21
+ id: params[:team_id], registration_token: encrypted_token)
22
22
 
23
- configurable && configurable.registration_token_period_valid?
23
+ configurable &&
24
+ configurable.registration_token_period_valid? &&
25
+ configurable.owner.blank?
24
26
  end
25
27
  end