cck_forms 3.6.0 → 3.6.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ac913bdb00f008ff4928945481a137270c4002c162e96c827f2d076b4ab24fb
|
4
|
+
data.tar.gz: 6466bf72731c201e6d3386d85e3db8f42dacd12b14377bc69c616307873ececb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36dcc060729037b66807f262eb4864fae2f8ca0d378a0bb77c20dce705ee72a9dadf109299ddd9dc1793c7545391b3fb254b3bbf2b87251b7f07c4a6c8576d62
|
7
|
+
data.tar.gz: cbf452a9e33468bf091cee8e5e02691883e3187bb2bb167f1df56da317904739b4a78369a54da02ad060e9f87ffc2e7af4de0cc6b146c967fbdde0299e1383dc
|
@@ -226,9 +226,11 @@ class CckForms::ParameterTypeClass::WorkHours
|
|
226
226
|
|
227
227
|
open_until_last_client_html = unless options[:hide_open_until_last_client]
|
228
228
|
<<HTML
|
229
|
-
<
|
230
|
-
<
|
231
|
-
|
229
|
+
<li class="nav-item">
|
230
|
+
<a class="nav-link">
|
231
|
+
#{form_builder.check_box :open_until_last_client} #{I18n.t 'cck_forms.work_hours.until_last_client'}
|
232
|
+
</a>
|
233
|
+
</li>
|
232
234
|
HTML
|
233
235
|
end
|
234
236
|
|
@@ -237,21 +239,25 @@ HTML
|
|
237
239
|
<div class="form_work_hours_time">
|
238
240
|
#{header}
|
239
241
|
</div>
|
242
|
+
<div class="form_work_hours_time form-inline">
|
243
|
+
<div class="form_work_hours_selects">
|
244
|
+
<span class="form_work_hours_select">
|
245
|
+
<span>#{I18n.t 'cck_forms.work_hours.time_from'}</span> #{open_time_form}
|
246
|
+
</span>
|
247
|
+
<span class="form_work_hours_select">
|
248
|
+
<span>#{I18n.t 'cck_forms.work_hours.time_till'}</span> #{close_time_form}
|
249
|
+
</span>
|
250
|
+
</div>
|
251
|
+
</div>
|
240
252
|
<div class="form_work_hours_time">
|
241
|
-
<
|
242
|
-
<
|
243
|
-
<
|
244
|
-
#{I18n.t 'cck_forms.work_hours.
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
<label class="form_work_hours_option">#{form_builder.check_box :open_24_hours} #{I18n.t 'cck_forms.work_hours.24h'}</label>
|
250
|
-
</div>
|
251
|
-
#{open_until_last_client_html}
|
252
|
-
</td>
|
253
|
-
</tr>
|
254
|
-
</table>
|
253
|
+
<ul class="nav nav-pills">
|
254
|
+
<li class="nav-item">
|
255
|
+
<a class="nav-link">
|
256
|
+
#{form_builder.check_box :open_24_hours} #{I18n.t 'cck_forms.work_hours.24h'}
|
257
|
+
</a>
|
258
|
+
</li>
|
259
|
+
#{open_until_last_client_html}
|
260
|
+
</ul>
|
255
261
|
</div>
|
256
262
|
</div>
|
257
263
|
HTML
|
data/lib/cck_forms/version.rb
CHANGED
@@ -166,10 +166,12 @@ $(function() {
|
|
166
166
|
* days are grouped by the same "work value" (checkboxes & open/close time):
|
167
167
|
*
|
168
168
|
* > [^] Mon [^] Tue [^] Wed [^] Thu [^] Fri [_] Sat [_] Sun
|
169
|
-
* > from [09]:[00] till [20]:[00]
|
169
|
+
* > from [09]:[00] till [20]:[00]
|
170
|
+
* > [_] open 24 hours [_] open until last client
|
170
171
|
*
|
171
172
|
* > [_] Mon [_] Tue [_] Wed [_] Thu [_] Fri [^] Sat [^] Sun
|
172
|
-
* > from [10]:[00] till [__]:[__]
|
173
|
+
* > from [10]:[00] till [__]:[__]
|
174
|
+
* > [_] open 24 hours [^] open until last client
|
173
175
|
*
|
174
176
|
* [ Add days ]
|
175
177
|
*
|
@@ -200,7 +202,7 @@ $(function() {
|
|
200
202
|
$widget.createGroup([], []);
|
201
203
|
});
|
202
204
|
|
203
|
-
this._lastP = $('<p></p>').appendTo($form).append($addGroupLink);
|
205
|
+
this._lastP = $('<p class="form_work_hours_add_days"></p>').appendTo($form).append($addGroupLink);
|
204
206
|
|
205
207
|
this._$template = $form.find(".form_work_hours_day_template");
|
206
208
|
|
@@ -239,7 +241,7 @@ $(function() {
|
|
239
241
|
var newHtml = this._$template[0].outerHTML.replace(/((?:id|name)="[^"]*)template([^"]*")/g, "$1" + this.newGroupId() + "$2");
|
240
242
|
var $newGroup = $(newHtml);
|
241
243
|
|
242
|
-
// mark checkboxes
|
244
|
+
// mark day checkboxes
|
243
245
|
for(var i = 0, ic = days.length; i < ic; ++ i) {
|
244
246
|
$newGroup
|
245
247
|
.find("input[name$=\"[days]\"][value=" + days[i] + "]")
|
@@ -249,7 +251,7 @@ $(function() {
|
|
249
251
|
}
|
250
252
|
|
251
253
|
// hide checkboxes, link-o-buttons will be in their place
|
252
|
-
$newGroup.find("input[
|
254
|
+
$newGroup.find("input[type=checkbox]").hide();
|
253
255
|
$newGroup.find(".nav-pills").on("click", "a", function(event) {
|
254
256
|
// skip events originated at checkbox inside this link
|
255
257
|
if(event.target == this) {
|
@@ -266,6 +268,12 @@ $(function() {
|
|
266
268
|
|
267
269
|
// make HTML & instantiate widget workhoursday
|
268
270
|
$newGroup.workhoursday().workhoursday("value", value).insertBefore(this._lastP).show();
|
271
|
+
|
272
|
+
// highlight checked checkboxes
|
273
|
+
$newGroup
|
274
|
+
.find("input[name$=\"[open_24_hours]\"]:checked, input[name$=\"[open_until_last_client]\"]:checked")
|
275
|
+
.closest(".nav-link").addClass("active") // Bootstrap 4
|
276
|
+
.closest(".nav-item").addClass("active"); // Bootstrap 3
|
269
277
|
},
|
270
278
|
|
271
279
|
/**
|
@@ -330,23 +338,39 @@ $(function() {
|
|
330
338
|
// open 24 hours? nullify open/close time
|
331
339
|
case "open_24_hours":
|
332
340
|
$group.workhoursday("openTime", {hours: '', minutes: ''}).workhoursday("closeTime", {hours: '', minutes: ''});
|
341
|
+
|
342
|
+
input.parentNode.className += " active"; // Bootstrap 4
|
343
|
+
input.parentNode.parentNode.className += " active"; // Bootstrap 3
|
333
344
|
break;
|
334
345
|
|
335
346
|
// open until last client? nullify close time
|
336
347
|
case "open_until_last_client":
|
337
348
|
$group.workhoursday("closeTime", {hours: '', minutes: ''});
|
349
|
+
|
350
|
+
input.parentNode.className += " active"; // Bootstrap 4
|
351
|
+
input.parentNode.parentNode.className += " active"; // Bootstrap 3
|
338
352
|
break;
|
339
353
|
|
340
354
|
// close time set? uncheck "open until last" checkbox
|
341
355
|
case "close_time_hours":
|
342
356
|
case "close_time_minutes":
|
343
357
|
$group.workhoursday("openUntilLastClient", false);
|
358
|
+
|
359
|
+
$group
|
360
|
+
.find("input[name$=\"[open_until_last_client]\"]")
|
361
|
+
.closest(".nav-link").removeClass("active") // Bootstrap 4
|
362
|
+
.closest(".nav-item").removeClass("active"); // Bootstrap 3
|
344
363
|
// break skipped on purpose!
|
345
364
|
|
346
365
|
// any time set? uncheck "open 24h" checkbox
|
347
366
|
case "open_time_hours":
|
348
367
|
case "open_time_minutes":
|
349
368
|
$group.workhoursday("open24Hours", false);
|
369
|
+
|
370
|
+
$group
|
371
|
+
.find("input[name$=\"[open_24_hours]\"]")
|
372
|
+
.closest(".nav-link").removeClass("active") // Bootstrap 4
|
373
|
+
.closest(".nav-item").removeClass("active"); // Bootstrap 3
|
350
374
|
break;
|
351
375
|
}
|
352
376
|
|
@@ -356,6 +380,13 @@ $(function() {
|
|
356
380
|
$group.workhoursday(camelCasedTime, {minutes: 0})
|
357
381
|
}
|
358
382
|
|
383
|
+
// input unchecked
|
384
|
+
} else if(inputNodeName == "input" && !input.checked && (fieldName == "open_24_hours" || fieldName == "open_until_last_client")) {
|
385
|
+
|
386
|
+
// remove active class
|
387
|
+
input.parentNode.className = input.parentNode.className.replace(/(^|\s)active($|\s)/, "$1"); // Bootstrap 4
|
388
|
+
input.parentNode.parentNode.className = input.parentNode.parentNode.className.replace(/(^|\s)active($|\s)/, "$1"); // Bootstrap 3
|
389
|
+
|
359
390
|
// not input
|
360
391
|
} else {
|
361
392
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cck_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Konanykhin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
|
-
rubygems_version: 3.0.
|
120
|
+
rubygems_version: 3.0.3
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Content Construction Kit Forms
|