bullet_train 1.0.72 → 1.0.76

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db7e610daaa879e4dea53f480faa8b68cbc8435e41c711faadea5201f7da8d48
4
- data.tar.gz: 5af9b859d7ca735cbfbc2c61b5872f3478c19298053818d59c006d22bd7a86f7
3
+ metadata.gz: 1304c0985b95c7d97ec6946b7db2cba4aa6ff9c9cd94d42b5235ecfff87df984
4
+ data.tar.gz: a06bdab53e17c60fdb793cd65bd4ccc66f07eec005a36049566d51913352672b
5
5
  SHA512:
6
- metadata.gz: 317a5954cf9fad29bf320c977ee7c6614e1d64ba103d94a2b6ae2f116a3d97b8a0de5542c09d5d473605a5ce6fbe1d15af7a53f51996cd7732dc86599fa572f9
7
- data.tar.gz: 0b11af68716bb942c93c9eeb794d258bbe61f84fb2a7548eb77af5401401bcd3019507ef68549eb918eb3f2f07418dd30e1f940b221e393064701ff580fabbd0
6
+ metadata.gz: 0645f429cf77724cebe323c67cfbb99c9da602eee2f1c66df4de8c80207a5740bf555842f79bc0a74c56eb40328af2780b9f7dab3ccf81dea37ac7b72807b63d
7
+ data.tar.gz: ad960c79b67b759d1e25d9a4d61fd8edb87ff08ea5f08b82fc29c1bc7d3f06d14bf80b390739226362015dd3c6fe540432cf8f6971b9a314a4806a7099f3ea93
@@ -2,10 +2,6 @@ module RootRedirect
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  def index
5
- if ENV["MARKETING_SITE_URL"]
6
- redirect_to ENV["MARKETING_SITE_URL"]
7
- else
8
- redirect_to new_user_session_path
9
- end
5
+ redirect_to ENV["MARKETING_SITE_URL"] || new_user_session_path
10
6
  end
11
7
  end
@@ -0,0 +1,19 @@
1
+ # NOTE: This is a workaround to get Devise working with Turbo
2
+ class TurboDeviseController < ApplicationController
3
+ class Responder < ActionController::Responder
4
+ def to_turbo_stream
5
+ controller.render(options.merge(formats: :html))
6
+ rescue ActionView::MissingTemplate => error
7
+ if get?
8
+ raise error
9
+ elsif has_errors? && default_action
10
+ render rendering_options.merge(formats: :html, status: :unprocessable_entity)
11
+ else
12
+ redirect_to navigation_location
13
+ end
14
+ end
15
+ end
16
+
17
+ self.responder = Responder
18
+ respond_to :html, :turbo_stream
19
+ end
@@ -1,8 +1,10 @@
1
1
  module Account::DatesHelper
2
2
  # e.g. October 11, 2018
3
- def display_date(timestamp)
3
+ def display_date(timestamp, custom_date_format = nil)
4
4
  return nil unless timestamp
5
- if local_time(timestamp).year == local_time(Time.now).year
5
+ if custom_date_format
6
+ local_time(timestamp).strftime(custom_date_format)
7
+ elsif local_time(timestamp).year == local_time(Time.now).year
6
8
  local_time(timestamp).strftime("%B %-d")
7
9
  else
8
10
  local_time(timestamp).strftime("%B %-d, %Y")
@@ -12,23 +14,23 @@ module Account::DatesHelper
12
14
  # e.g. October 11, 2018 at 4:22 PM
13
15
  # e.g. Yesterday at 2:12 PM
14
16
  # e.g. April 24 at 7:39 AM
15
- def display_date_and_time(timestamp)
17
+ def display_date_and_time(timestamp, custom_date_format = nil, custom_time_format = nil)
16
18
  return nil unless timestamp
17
19
 
18
20
  # today?
19
21
  if local_time(timestamp).to_date == local_time(Time.now).to_date
20
- "Today at #{display_time(timestamp)}"
22
+ "Today at #{display_time(timestamp, custom_time_format)}"
21
23
  # yesterday?
22
24
  elsif (local_time(timestamp).to_date) == (local_time(Time.now).to_date - 1.day)
23
- "Yesterday at #{display_time(timestamp)}"
25
+ "Yesterday at #{display_time(timestamp, custom_time_format)}"
24
26
  else
25
- "#{display_date(timestamp)} at #{display_time(timestamp)}"
27
+ "#{display_date(timestamp, custom_date_format)} at #{display_time(timestamp, custom_time_format)}"
26
28
  end
27
29
  end
28
30
 
29
31
  # e.g. 4:22 PM
30
- def display_time(timestamp)
31
- local_time(timestamp).strftime("%l:%M %p")
32
+ def display_time(timestamp, custom_time_format = nil)
33
+ local_time(timestamp).strftime(custom_time_format || "%l:%M %p")
32
34
  end
33
35
 
34
36
  def local_time(time)
@@ -1,425 +1 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html xmlns="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
5
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
- <title>Welcome to <%= t('application.name') %>!</title>
7
- <% # TODO This is not what we want to do long-term. Would love to see this powered by Tailwind CSS. %>
8
- <style type="text/css">
9
- *:not(br):not(tr):not(html) {
10
- font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
11
- box-sizing: border-box;
12
- }
13
-
14
- body {
15
- width: 100% !important;
16
- height: 100%;
17
- margin: 0;
18
- line-height: 1.4;
19
- background-color: #F6F7F8;
20
- color: #3E4B5B;
21
- font-size: 16px;
22
- -webkit-text-size-adjust: none;
23
- }
24
-
25
- p,
26
- ul,
27
- ol,
28
- blockquote {
29
- line-height: 1.4;
30
- text-align: left;
31
- }
32
-
33
- a {
34
- color: #047BF8;
35
- }
36
-
37
- a img {
38
- border: none;
39
- }
40
- /* Layout ------------------------------ */
41
-
42
- .email-wrapper {
43
- width: 100%;
44
- margin: 0;
45
- padding: 0;
46
- background-color: #F6F7F8;
47
- }
48
-
49
- .email-content {
50
- width: 100%;
51
- margin: 0;
52
- padding: 0;
53
- }
54
- /* Masthead ----------------------- */
55
-
56
- .email-masthead {
57
- padding: 25px 0;
58
- text-align: center;
59
- }
60
-
61
- .email-masthead_logo {
62
- width: 94px;
63
- }
64
-
65
- .email-masthead_name {
66
- font-size: 16px;
67
- /*font-weight: bold;*/
68
- color: #bbbfc3;
69
- text-decoration: none;
70
- /*text-shadow: 0 1px 0 white;*/
71
- }
72
- /* Body ------------------------------ */
73
-
74
- .email-body {
75
- width: 100%;
76
- margin: 0;
77
- padding: 0;
78
- border-top: 1px solid #EDEFF2;
79
- border-bottom: 1px solid #EDEFF2;
80
- background-color: #FFFFFF;
81
-
82
- }
83
-
84
- .email-body_inner {
85
- width: 570px;
86
- margin: 0 auto;
87
- padding: 0;
88
- background-color: #FFFFFF;
89
- }
90
-
91
- .email-footer {
92
- width: 570px;
93
- margin: 0 auto;
94
- padding: 0;
95
- text-align: center;
96
- }
97
-
98
- .email-footer p {
99
- color: #AAAAAA;
100
- }
101
-
102
- .body-action {
103
- width: 100%;
104
- margin: 30px auto;
105
- padding: 0;
106
- text-align: center;
107
- }
108
-
109
- .body-sub {
110
- margin-top: 25px;
111
- padding-top: 25px;
112
- border-top: 1px solid #EDEFF2;
113
- }
114
-
115
- .content-cell {
116
- padding: 35px;
117
- }
118
-
119
- .preheader {
120
- display: none !important;
121
- }
122
- /* Attribute list ------------------------------ */
123
-
124
- .attributes {
125
- margin: 0 0 21px;
126
- }
127
-
128
- .attributes_content {
129
- background-color: #EDEFF2;
130
- padding: 16px;
131
- }
132
-
133
- .attributes_item {
134
- padding: 0;
135
- }
136
- /* Related Items ------------------------------ */
137
-
138
- .related {
139
- width: 100%;
140
- margin: 0;
141
- padding: 25px 0 0 0;
142
- }
143
-
144
- .related_item {
145
- padding: 10px 0;
146
- color: #3E4B5B;
147
- font-size: 15px;
148
- line-height: 18px;
149
- }
150
-
151
- .related_item-title {
152
- display: block;
153
- margin: .5em 0 0;
154
- }
155
-
156
- .related_item-thumb {
157
- display: block;
158
- padding-bottom: 10px;
159
- }
160
-
161
- .related_heading {
162
- border-top: 1px solid #EDEFF2;
163
- text-align: center;
164
- padding: 25px 0 10px;
165
- }
166
- /* Discount Code ------------------------------ */
167
-
168
- .discount {
169
- width: 100%;
170
- margin: 0;
171
- padding: 24px;
172
- background-color: #EDEFF2;
173
- border: 2px dashed #9BA2AB;
174
- }
175
-
176
- .discount_heading {
177
- text-align: center;
178
- }
179
-
180
- .discount_body {
181
- text-align: center;
182
- font-size: 15px;
183
- }
184
- /* Social Icons ------------------------------ */
185
-
186
- .social {
187
- width: auto;
188
- }
189
-
190
- .social td {
191
- padding: 0;
192
- width: auto;
193
- }
194
-
195
- .social_icon {
196
- height: 20px;
197
- margin: 0 8px 10px 8px;
198
- padding: 0;
199
- }
200
- /* Data table ------------------------------ */
201
-
202
- .purchase {
203
- width: 100%;
204
- margin: 0;
205
- padding: 35px 0;
206
- }
207
-
208
- .purchase_content {
209
- width: 100%;
210
- margin: 0;
211
- padding: 25px 0 0 0;
212
- }
213
-
214
- .purchase_item {
215
- padding: 10px 0;
216
- color: #3E4B5B;
217
- font-size: 15px;
218
- line-height: 18px;
219
- }
220
-
221
- .purchase_heading {
222
- padding-bottom: 8px;
223
- border-bottom: 1px solid #EDEFF2;
224
- }
225
-
226
- .purchase_heading p {
227
- margin: 0;
228
- color: #9BA2AB;
229
- font-size: 12px;
230
- }
231
-
232
- .purchase_footer {
233
- padding-top: 15px;
234
- border-top: 1px solid #EDEFF2;
235
- }
236
-
237
- .purchase_total {
238
- margin: 0;
239
- text-align: right;
240
- /*font-weight: bold;*/
241
- color: #3E4B5B;
242
- }
243
-
244
- .purchase_total--label {
245
- padding: 0 15px 0 0;
246
- }
247
- /* Utilities ------------------------------ */
248
-
249
- .align-right {
250
- text-align: right;
251
- }
252
-
253
- .align-left {
254
- text-align: left;
255
- }
256
-
257
- .align-center {
258
- text-align: center;
259
- }
260
- /*Media Queries ------------------------------ */
261
-
262
- @media only screen and (max-width: 600px) {
263
- .email-body_inner,
264
- .email-footer {
265
- width: 100% !important;
266
- }
267
- }
268
-
269
- @media only screen and (max-width: 500px) {
270
- .button {
271
- width: 100% !important;
272
- }
273
- }
274
- /* Buttons ------------------------------ */
275
-
276
- .button {
277
- background-color: #047BF8;
278
- border-top: 10px solid #047BF8;
279
- border-right: 18px solid #047BF8;
280
- border-bottom: 10px solid #047BF8;
281
- border-left: 18px solid #047BF8;
282
- display: inline-block;
283
- color: #FFF;
284
- text-decoration: none;
285
- border-radius: 3px;
286
- -webkit-text-size-adjust: none;
287
- line-height: 22px;
288
- font-size: 16px;
289
- color: #FFF;
290
- }
291
-
292
- .button--link {
293
- background-color: transparent;
294
- border-top: 10px solid transparent;
295
- border-right: 18px solid transparent;
296
- border-bottom: 10px solid transparent;
297
- border-left: 18px solid transparent;
298
- display: inline-block;
299
- color: #047BF8;
300
- text-decoration: underline;
301
- border-radius: 3px;
302
- /*box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16);*/
303
- -webkit-text-size-adjust: none;
304
- }
305
-
306
- .button--green {
307
- background-color: #22BC66;
308
- border-top: 10px solid #22BC66;
309
- border-right: 18px solid #22BC66;
310
- border-bottom: 10px solid #22BC66;
311
- border-left: 18px solid #22BC66;
312
- }
313
-
314
- .button--red {
315
- background-color: #FF6136;
316
- border-top: 10px solid #FF6136;
317
- border-right: 18px solid #FF6136;
318
- border-bottom: 10px solid #FF6136;
319
- border-left: 18px solid #FF6136;
320
- }
321
- /* Type ------------------------------ */
322
-
323
- h1 {
324
- margin-top: 0;
325
- color: #3E4B5B;
326
- font-size: 19px;
327
- font-weight: bold;
328
- text-align: left;
329
- }
330
-
331
- h2 {
332
- margin-top: 0;
333
- color: #3E4B5B;
334
- font-size: 16px;
335
- font-weight: bold;
336
- text-align: left;
337
- }
338
-
339
- h3 {
340
- margin-top: 0;
341
- color: #3E4B5B;
342
- font-size: 14px;
343
- font-weight: bold;
344
- text-align: left;
345
- }
346
-
347
- p {
348
- margin-top: 0;
349
- color: #3E4B5B;
350
- font-size: 16px;
351
- line-height: 1.5em;
352
- text-align: left;
353
- }
354
-
355
- p.sub {
356
- font-size: 12px;
357
- }
358
-
359
- p.center {
360
- text-align: center;
361
- }
362
-
363
- .body-action.less-footer {
364
- margin-bottom: 10px;
365
- }
366
- </style>
367
- </head>
368
- <body>
369
- <% if content_for? :preheader %>
370
- <span class="preheader"><% yield :preheader %></span>
371
- <% end %>
372
- <table class="email-wrapper" width="100%" cellpadding="0" cellspacing="0">
373
- <tr>
374
- <td align="center">
375
- <table class="email-content" width="100%" cellpadding="0" cellspacing="0">
376
- <tr>
377
- <td class="email-masthead">
378
- <a href="<%= root_url %>" class="email-masthead_name">
379
- <%= email_image_tag("logo/logo.png", width: image_width_for_height("logo/logo.png", BulletTrain::Themes.logo_height), height: BulletTrain::Themes.logo_height, style: "width: #{image_width_for_height('logo/logo.png', BulletTrain::Themes.logo_height)}px; height: #{BulletTrain::Themes.logo_height}px;") %>
380
- </a>
381
- </td>
382
- </tr>
383
- <!-- Email Body -->
384
- <tr>
385
- <td class="email-body" width="100%" cellpadding="0" cellspacing="0">
386
- <table class="email-body_inner" align="center" width="570" cellpadding="0" cellspacing="0">
387
- <!-- Body content -->
388
- <tr>
389
- <td class="content-cell">
390
-
391
- <%= yield %>
392
-
393
- <% if false %>
394
- <!-- Sub copy -->
395
- <table class="body-sub">
396
- <tr>
397
- <td>
398
- <p class="sub"><%= t('.trouble') %></p>
399
- <p class="sub">{{action_url}}</p>
400
- </td>
401
- </tr>
402
- </table>
403
- <% end %>
404
- </td>
405
- </tr>
406
- </table>
407
- </td>
408
- </tr>
409
- <tr>
410
- <td>
411
- <table class="email-footer" align="center" width="570" cellpadding="0" cellspacing="0">
412
- <tr>
413
- <td class="content-cell" align="center">
414
- <p class="sub align-center">&copy; <%= t('.all_rights_reserved', year: Date.today.year, product_name: t('application.name')) %></p>
415
- </td>
416
- </tr>
417
- </table>
418
- </td>
419
- </tr>
420
- </table>
421
- </td>
422
- </tr>
423
- </table>
424
- </body>
425
- </html>
1
+ <%= render "themes/#{current_theme}/layouts/mailer" %>
@@ -0,0 +1,14 @@
1
+ # NOTE: This is a workaround to get Devise working with Turbo
2
+ class TurboFailureApp < Devise::FailureApp
3
+ def respond
4
+ if request_format == :turbo_stream
5
+ redirect
6
+ else
7
+ super
8
+ end
9
+ end
10
+
11
+ def skip_format?
12
+ %w[html turbo_stream */*].include? request_format.to_s
13
+ end
14
+ end
@@ -76,7 +76,7 @@ When you're including multiple fields, you can DRY up redundant settings (e.g. `
76
76
  ```
77
77
 
78
78
  ## Field partials that integrate with third-party service providers
79
- - `cloudinary` makes it trivial to upload photos and images to [Cloudinary](https://cloudinary.com) and store their resulting Cloudinary ID as an attribute of the model backing the form.
79
+ - `cloudinary` makes it trivial to upload photos and images to [Cloudinary](https://cloudinary.com) and store their resulting Cloudinary ID as an attribute of the model backing the form. To enable this field partial, sign up for Cloudinary and copy the "Cloudinary URL" they provide you with into your `config/application.yml` as `CLOUDINARY_URL`. If you use our [Heroku app.json] to provision your production environment, this will happen in that environment automatically.
80
80
 
81
81
  ## Yaml Configuration
82
82
  The localization Yaml file (where you configure label and option values for a field) is automatically generated when you run Super Scaffolding for a model. If you haven't done this yet, the localization Yaml file for `Scaffolding::CompletelyConcrete::TangibleThing` serves as a good example. Under `en.scaffolding/completely_concrete/tangible_things.fields` you'll see definitions like this:
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.0.72"
2
+ VERSION = "1.0.76"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.72
4
+ version: 1.0.76
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-21 00:00:00.000000000 Z
11
+ date: 2022-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -453,6 +453,7 @@ files:
453
453
  - app/controllers/concerns/sessions/controller_base.rb
454
454
  - app/controllers/registrations_controller.rb
455
455
  - app/controllers/sessions_controller.rb
456
+ - app/controllers/turbo_devise_controller.rb
456
457
  - app/helpers/account/buttons_helper.rb
457
458
  - app/helpers/account/dates_helper.rb
458
459
  - app/helpers/account/forms_helper.rb
@@ -555,6 +556,7 @@ files:
555
556
  - app/views/user_mailer/invited.html.erb
556
557
  - app/views/user_mailer/welcome.html.erb
557
558
  - config/initializers/concerns/inflections_base.rb
559
+ - config/initializers/concerns/turbo_failure_app.rb
558
560
  - config/locales/en/base.yml
559
561
  - config/locales/en/devise.en.yml
560
562
  - config/locales/en/doorkeeper.en.yml