compony 0.9.0 → 0.10.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/VERSION +1 -1
- data/compony.gemspec +4 -4
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +2 -2
- data/doc/Compony/ComponentMixins/Default/Labelling.html +120 -39
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +1 -1
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Buttons/CssButton.html +1 -1
- data/doc/Compony/Components/Buttons/Link.html +1 -1
- data/doc/Compony/Components/Buttons.html +1 -1
- data/doc/Compony/Components/Destroy.html +13 -13
- data/doc/Compony/Components/Edit.html +17 -17
- data/doc/Compony/Components/Form.html +49 -49
- data/doc/Compony/Components/Index.html +1 -1
- data/doc/Compony/Components/List.html +346 -473
- data/doc/Compony/Components/New.html +13 -13
- data/doc/Compony/Components/Show.html +28 -28
- data/doc/Compony/Components/WithForm.html +1 -1
- data/doc/Compony/Components.html +1 -1
- data/doc/Compony/ControllerMixin.html +1 -1
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/ExposedIntentsDsl.html +1 -1
- data/doc/Compony/Intent.html +79 -65
- data/doc/Compony/MethodAccessibleHash.html +1 -1
- data/doc/Compony/ModelFields/Anchormodel.html +1 -1
- data/doc/Compony/ModelFields/Association.html +1 -1
- data/doc/Compony/ModelFields/Attachment.html +1 -1
- data/doc/Compony/ModelFields/Base.html +1 -1
- data/doc/Compony/ModelFields/Boolean.html +1 -1
- data/doc/Compony/ModelFields/Color.html +1 -1
- data/doc/Compony/ModelFields/Currency.html +1 -1
- data/doc/Compony/ModelFields/Date.html +1 -1
- data/doc/Compony/ModelFields/Datetime.html +1 -1
- data/doc/Compony/ModelFields/Decimal.html +1 -1
- data/doc/Compony/ModelFields/Email.html +1 -1
- data/doc/Compony/ModelFields/Float.html +1 -1
- data/doc/Compony/ModelFields/Integer.html +1 -1
- data/doc/Compony/ModelFields/Percentage.html +1 -1
- data/doc/Compony/ModelFields/Phone.html +1 -1
- data/doc/Compony/ModelFields/RichText.html +1 -1
- data/doc/Compony/ModelFields/String.html +1 -1
- data/doc/Compony/ModelFields/Text.html +1 -1
- data/doc/Compony/ModelFields/Time.html +1 -1
- data/doc/Compony/ModelFields/Url.html +1 -1
- data/doc/Compony/ModelFields.html +1 -1
- data/doc/Compony/ModelMixin.html +1 -1
- data/doc/Compony/NaturalOrdering.html +1 -1
- data/doc/Compony/RequestContext.html +22 -10
- data/doc/Compony/Version.html +1 -1
- data/doc/Compony/ViewHelpers.html +1 -1
- data/doc/Compony/VirtualModel.html +1 -1
- data/doc/Compony.html +8 -8
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +8 -8
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +2 -2
- data/doc/guide/nesting.md +26 -4
- data/doc/index.html +2 -2
- data/doc/method_list.html +174 -182
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/component.rb +1 -1
- data/lib/compony/component_mixins/default/labelling.rb +28 -17
- data/lib/compony/components/destroy.rb +2 -5
- data/lib/compony/components/edit.rb +2 -4
- data/lib/compony/components/form.rb +0 -1
- data/lib/compony/components/index.rb +1 -1
- data/lib/compony/components/list.rb +57 -62
- data/lib/compony/components/new.rb +0 -1
- data/lib/compony/components/show.rb +4 -11
- data/lib/compony/intent.rb +10 -4
- data/lib/compony/{exposed_intents_dsl.rb → manage_intents_dsl.rb} +6 -3
- data/lib/compony/model_mixin.rb +1 -1
- data/lib/compony/request_context.rb +10 -3
- data/lib/compony.rb +4 -4
- metadata +3 -3
|
@@ -331,37 +331,13 @@
|
|
|
331
331
|
<p>DSL method Sets the CSS class attribute for form select inputs in filters.</p>
|
|
332
332
|
</div></span>
|
|
333
333
|
|
|
334
|
-
</li>
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
<li class="protected ">
|
|
338
|
-
<span class="summary_signature">
|
|
339
|
-
|
|
340
|
-
<a href="#filtering_enabled%3F-instance_method" title="#filtering_enabled? (instance method)">#<strong>filtering_enabled?</strong> ⇒ Boolean </a>
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
</span>
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
<span class="note title protected">protected</span>
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
<span class="summary_desc"><div class='inline'>
|
|
355
|
-
<p>Returns whether filtering is possible and wanted in general (regardless of whether there are any filters defined).</p>
|
|
356
|
-
</div></span>
|
|
357
|
-
|
|
358
334
|
</li>
|
|
359
335
|
|
|
360
336
|
|
|
361
337
|
<li class="public ">
|
|
362
338
|
<span class="summary_signature">
|
|
363
339
|
|
|
364
|
-
<a href="#
|
|
340
|
+
<a href="#filtering-instance_method" title="#filtering (instance method)">#<strong>filtering</strong>(new_filtering) ⇒ Object </a>
|
|
365
341
|
|
|
366
342
|
|
|
367
343
|
|
|
@@ -376,42 +352,40 @@
|
|
|
376
352
|
|
|
377
353
|
|
|
378
354
|
<span class="summary_desc"><div class='inline'>
|
|
379
|
-
<p>DSL method
|
|
355
|
+
<p>DSL method Enables or disables filtering entirely (sorting is independent of this setting).</p>
|
|
380
356
|
</div></span>
|
|
381
357
|
|
|
382
358
|
</li>
|
|
383
359
|
|
|
384
360
|
|
|
385
|
-
<li class="
|
|
361
|
+
<li class="protected ">
|
|
386
362
|
<span class="summary_signature">
|
|
387
363
|
|
|
388
|
-
<a href="#
|
|
364
|
+
<a href="#filtering_enabled%3F-instance_method" title="#filtering_enabled? (instance method)">#<strong>filtering_enabled?</strong> ⇒ Boolean </a>
|
|
389
365
|
|
|
390
366
|
|
|
391
367
|
|
|
392
368
|
</span>
|
|
393
369
|
|
|
394
370
|
|
|
395
|
-
<span class="note title constructor">constructor</span>
|
|
396
|
-
|
|
397
|
-
|
|
398
371
|
|
|
372
|
+
<span class="note title protected">protected</span>
|
|
399
373
|
|
|
400
374
|
|
|
401
375
|
|
|
402
376
|
|
|
403
377
|
|
|
404
378
|
<span class="summary_desc"><div class='inline'>
|
|
405
|
-
<p>
|
|
379
|
+
<p>Returns whether filtering is possible and wanted in general (regardless of whether there are any filters defined).</p>
|
|
406
380
|
</div></span>
|
|
407
381
|
|
|
408
382
|
</li>
|
|
409
383
|
|
|
410
384
|
|
|
411
|
-
<li class="
|
|
385
|
+
<li class="public ">
|
|
412
386
|
<span class="summary_signature">
|
|
413
387
|
|
|
414
|
-
<a href="#
|
|
388
|
+
<a href="#filters-instance_method" title="#filters (instance method)">#<strong>filters</strong>(*filter_names) ⇒ Object </a>
|
|
415
389
|
|
|
416
390
|
|
|
417
391
|
|
|
@@ -419,14 +393,14 @@
|
|
|
419
393
|
|
|
420
394
|
|
|
421
395
|
|
|
422
|
-
|
|
396
|
+
|
|
423
397
|
|
|
424
398
|
|
|
425
399
|
|
|
426
400
|
|
|
427
401
|
|
|
428
402
|
<span class="summary_desc"><div class='inline'>
|
|
429
|
-
<p>
|
|
403
|
+
<p>DSL method Adds multiple filters at once, sharing the same kwargs.</p>
|
|
430
404
|
</div></span>
|
|
431
405
|
|
|
432
406
|
</li>
|
|
@@ -435,13 +409,15 @@
|
|
|
435
409
|
<li class="public ">
|
|
436
410
|
<span class="summary_signature">
|
|
437
411
|
|
|
438
|
-
<a href="#
|
|
412
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(skip_pagination: false, results_per_page: 20, skip_filtering: false, skip_sorting: false, skip_sorting_in_filter: false, skip_sorting_links: false, skip_columns: [], skip_row_intents: [], skip_filters: [], default_sorting: 'id asc') ⇒ List </a>
|
|
439
413
|
|
|
440
414
|
|
|
441
415
|
|
|
442
416
|
</span>
|
|
443
417
|
|
|
444
418
|
|
|
419
|
+
<span class="note title constructor">constructor</span>
|
|
420
|
+
|
|
445
421
|
|
|
446
422
|
|
|
447
423
|
|
|
@@ -450,7 +426,7 @@
|
|
|
450
426
|
|
|
451
427
|
|
|
452
428
|
<span class="summary_desc"><div class='inline'>
|
|
453
|
-
<p>
|
|
429
|
+
<p>The following parameters are meant for the case where this component is nested and therefore instanciated by a parent comp.</p>
|
|
454
430
|
</div></span>
|
|
455
431
|
|
|
456
432
|
</li>
|
|
@@ -459,7 +435,7 @@
|
|
|
459
435
|
<li class="public ">
|
|
460
436
|
<span class="summary_signature">
|
|
461
437
|
|
|
462
|
-
<a href="#
|
|
438
|
+
<a href="#pagination-instance_method" title="#pagination (instance method)">#<strong>pagination</strong>(new_pagination) ⇒ Object </a>
|
|
463
439
|
|
|
464
440
|
|
|
465
441
|
|
|
@@ -474,16 +450,16 @@
|
|
|
474
450
|
|
|
475
451
|
|
|
476
452
|
<span class="summary_desc"><div class='inline'>
|
|
477
|
-
<p>DSL method
|
|
453
|
+
<p>DSL method Enables or disables pagination (caution: all records will be loaded).</p>
|
|
478
454
|
</div></span>
|
|
479
455
|
|
|
480
456
|
</li>
|
|
481
457
|
|
|
482
458
|
|
|
483
|
-
<li class="
|
|
459
|
+
<li class="protected ">
|
|
484
460
|
<span class="summary_signature">
|
|
485
461
|
|
|
486
|
-
<a href="#
|
|
462
|
+
<a href="#pagination_enabled%3F-instance_method" title="#pagination_enabled? (instance method)">#<strong>pagination_enabled?</strong> ⇒ Boolean </a>
|
|
487
463
|
|
|
488
464
|
|
|
489
465
|
|
|
@@ -491,14 +467,14 @@
|
|
|
491
467
|
|
|
492
468
|
|
|
493
469
|
|
|
494
|
-
|
|
470
|
+
<span class="note title protected">protected</span>
|
|
495
471
|
|
|
496
472
|
|
|
497
473
|
|
|
498
474
|
|
|
499
475
|
|
|
500
476
|
<span class="summary_desc"><div class='inline'>
|
|
501
|
-
<p>
|
|
477
|
+
<p>Returns whether pagination is enabled (regardless of whether there is more than one page).</p>
|
|
502
478
|
</div></span>
|
|
503
479
|
|
|
504
480
|
</li>
|
|
@@ -507,7 +483,7 @@
|
|
|
507
483
|
<li class="public ">
|
|
508
484
|
<span class="summary_signature">
|
|
509
485
|
|
|
510
|
-
<a href="#
|
|
486
|
+
<a href="#process_data!-instance_method" title="#process_data! (instance method)">#<strong>process_data!</strong>(controller) ⇒ Object </a>
|
|
511
487
|
|
|
512
488
|
|
|
513
489
|
|
|
@@ -522,7 +498,7 @@
|
|
|
522
498
|
|
|
523
499
|
|
|
524
500
|
<span class="summary_desc"><div class='inline'>
|
|
525
|
-
<p>
|
|
501
|
+
<p>This method must be called before the data is read for the first time.</p>
|
|
526
502
|
</div></span>
|
|
527
503
|
|
|
528
504
|
</li>
|
|
@@ -531,7 +507,7 @@
|
|
|
531
507
|
<li class="public ">
|
|
532
508
|
<span class="summary_signature">
|
|
533
509
|
|
|
534
|
-
<a href="#
|
|
510
|
+
<a href="#results_per_page-instance_method" title="#results_per_page (instance method)">#<strong>results_per_page</strong>(new_results_per_page) ⇒ Object </a>
|
|
535
511
|
|
|
536
512
|
|
|
537
513
|
|
|
@@ -546,7 +522,7 @@
|
|
|
546
522
|
|
|
547
523
|
|
|
548
524
|
<span class="summary_desc"><div class='inline'>
|
|
549
|
-
<p>DSL method
|
|
525
|
+
<p>DSL method In case pagination is active, defines the amount of records to display per page.</p>
|
|
550
526
|
</div></span>
|
|
551
527
|
|
|
552
528
|
</li>
|
|
@@ -555,7 +531,7 @@
|
|
|
555
531
|
<li class="public ">
|
|
556
532
|
<span class="summary_signature">
|
|
557
533
|
|
|
558
|
-
<a href="#
|
|
534
|
+
<a href="#row_intents-instance_method" title="#row_intents (instance method)">#<strong>row_intents</strong>(**intent_opts, &block) ⇒ Object </a>
|
|
559
535
|
|
|
560
536
|
|
|
561
537
|
|
|
@@ -570,7 +546,7 @@
|
|
|
570
546
|
|
|
571
547
|
|
|
572
548
|
<span class="summary_desc"><div class='inline'>
|
|
573
|
-
<p>DSL method
|
|
549
|
+
<p>DSL method If a block is given: Enters the DSL where row intents can be added or removed (use from Component#setup within the component).</p>
|
|
574
550
|
</div></span>
|
|
575
551
|
|
|
576
552
|
</li>
|
|
@@ -579,7 +555,7 @@
|
|
|
579
555
|
<li class="public ">
|
|
580
556
|
<span class="summary_signature">
|
|
581
557
|
|
|
582
|
-
<a href="#
|
|
558
|
+
<a href="#skip_column-instance_method" title="#skip_column (instance method)">#<strong>skip_column</strong>(name) ⇒ Object </a>
|
|
583
559
|
|
|
584
560
|
|
|
585
561
|
|
|
@@ -594,7 +570,7 @@
|
|
|
594
570
|
|
|
595
571
|
|
|
596
572
|
<span class="summary_desc"><div class='inline'>
|
|
597
|
-
<p>DSL method Marks a single
|
|
573
|
+
<p>DSL method Marks a single column as skipped.</p>
|
|
598
574
|
</div></span>
|
|
599
575
|
|
|
600
576
|
</li>
|
|
@@ -603,7 +579,7 @@
|
|
|
603
579
|
<li class="public ">
|
|
604
580
|
<span class="summary_signature">
|
|
605
581
|
|
|
606
|
-
<a href="#
|
|
582
|
+
<a href="#sort-instance_method" title="#sort (instance method)">#<strong>sort</strong>(name, label: nil) ⇒ Object </a>
|
|
607
583
|
|
|
608
584
|
|
|
609
585
|
|
|
@@ -618,7 +594,7 @@
|
|
|
618
594
|
|
|
619
595
|
|
|
620
596
|
<span class="summary_desc"><div class='inline'>
|
|
621
|
-
<p>DSL method
|
|
597
|
+
<p>DSL method Adds a sorting criterion that will be processed by ransack.</p>
|
|
622
598
|
</div></span>
|
|
623
599
|
|
|
624
600
|
</li>
|
|
@@ -627,7 +603,7 @@
|
|
|
627
603
|
<li class="public ">
|
|
628
604
|
<span class="summary_signature">
|
|
629
605
|
|
|
630
|
-
<a href="#
|
|
606
|
+
<a href="#sorting-instance_method" title="#sorting (instance method)">#<strong>sorting</strong>(new_sorting) ⇒ Object </a>
|
|
631
607
|
|
|
632
608
|
|
|
633
609
|
|
|
@@ -642,16 +618,16 @@
|
|
|
642
618
|
|
|
643
619
|
|
|
644
620
|
<span class="summary_desc"><div class='inline'>
|
|
645
|
-
<p>DSL method
|
|
621
|
+
<p>DSL method Enables or disables sorting entirely (both links and sorting input in filter).</p>
|
|
646
622
|
</div></span>
|
|
647
623
|
|
|
648
624
|
</li>
|
|
649
625
|
|
|
650
626
|
|
|
651
|
-
<li class="
|
|
627
|
+
<li class="protected ">
|
|
652
628
|
<span class="summary_signature">
|
|
653
629
|
|
|
654
|
-
<a href="#
|
|
630
|
+
<a href="#sorting_enabled%3F-instance_method" title="#sorting_enabled? (instance method)">#<strong>sorting_enabled?</strong> ⇒ Boolean </a>
|
|
655
631
|
|
|
656
632
|
|
|
657
633
|
|
|
@@ -659,14 +635,14 @@
|
|
|
659
635
|
|
|
660
636
|
|
|
661
637
|
|
|
662
|
-
|
|
638
|
+
<span class="note title protected">protected</span>
|
|
663
639
|
|
|
664
640
|
|
|
665
641
|
|
|
666
642
|
|
|
667
643
|
|
|
668
644
|
<span class="summary_desc"><div class='inline'>
|
|
669
|
-
<p>
|
|
645
|
+
<p>Returns whether sorting is possible and wanted in general (regardless of whether there are any sorts defined).</p>
|
|
670
646
|
</div></span>
|
|
671
647
|
|
|
672
648
|
</li>
|
|
@@ -675,7 +651,7 @@
|
|
|
675
651
|
<li class="public ">
|
|
676
652
|
<span class="summary_signature">
|
|
677
653
|
|
|
678
|
-
<a href="#
|
|
654
|
+
<a href="#sorting_in_filter-instance_method" title="#sorting_in_filter (instance method)">#<strong>sorting_in_filter</strong>(new_sorting_in_filter) ⇒ Object </a>
|
|
679
655
|
|
|
680
656
|
|
|
681
657
|
|
|
@@ -690,7 +666,7 @@
|
|
|
690
666
|
|
|
691
667
|
|
|
692
668
|
<span class="summary_desc"><div class='inline'>
|
|
693
|
-
<p>DSL method
|
|
669
|
+
<p>DSL method Enables or disables sorting in filter.</p>
|
|
694
670
|
</div></span>
|
|
695
671
|
|
|
696
672
|
</li>
|
|
@@ -699,7 +675,7 @@
|
|
|
699
675
|
<li class="protected ">
|
|
700
676
|
<span class="summary_signature">
|
|
701
677
|
|
|
702
|
-
<a href="#
|
|
678
|
+
<a href="#sorting_in_filter_enabled%3F-instance_method" title="#sorting_in_filter_enabled? (instance method)">#<strong>sorting_in_filter_enabled?</strong> ⇒ Boolean </a>
|
|
703
679
|
|
|
704
680
|
|
|
705
681
|
|
|
@@ -714,7 +690,7 @@
|
|
|
714
690
|
|
|
715
691
|
|
|
716
692
|
<span class="summary_desc"><div class='inline'>
|
|
717
|
-
<p>Returns whether sorting is possible and wanted in general (regardless of whether there are any sorts defined).</p>
|
|
693
|
+
<p>Returns whether sorting in filter is possible and wanted in general (regardless of whether there are any sorts defined).</p>
|
|
718
694
|
</div></span>
|
|
719
695
|
|
|
720
696
|
</li>
|
|
@@ -723,7 +699,7 @@
|
|
|
723
699
|
<li class="protected ">
|
|
724
700
|
<span class="summary_signature">
|
|
725
701
|
|
|
726
|
-
<a href="#
|
|
702
|
+
<a href="#sorting_in_filter_select_opts-instance_method" title="#sorting_in_filter_select_opts (instance method)">#<strong>sorting_in_filter_select_opts</strong> ⇒ Object </a>
|
|
727
703
|
|
|
728
704
|
|
|
729
705
|
|
|
@@ -738,16 +714,16 @@
|
|
|
738
714
|
|
|
739
715
|
|
|
740
716
|
<span class="summary_desc"><div class='inline'>
|
|
741
|
-
<p>Returns
|
|
717
|
+
<p>Returns the select options for sorting suitable for passing in a <code>f.select</code>.</p>
|
|
742
718
|
</div></span>
|
|
743
719
|
|
|
744
720
|
</li>
|
|
745
721
|
|
|
746
722
|
|
|
747
|
-
<li class="
|
|
723
|
+
<li class="public ">
|
|
748
724
|
<span class="summary_signature">
|
|
749
725
|
|
|
750
|
-
<a href="#
|
|
726
|
+
<a href="#sorting_links-instance_method" title="#sorting_links (instance method)">#<strong>sorting_links</strong>(new_sorting_links) ⇒ Object </a>
|
|
751
727
|
|
|
752
728
|
|
|
753
729
|
|
|
@@ -755,14 +731,14 @@
|
|
|
755
731
|
|
|
756
732
|
|
|
757
733
|
|
|
758
|
-
|
|
734
|
+
|
|
759
735
|
|
|
760
736
|
|
|
761
737
|
|
|
762
738
|
|
|
763
739
|
|
|
764
740
|
<span class="summary_desc"><div class='inline'>
|
|
765
|
-
<p>
|
|
741
|
+
<p>DSL method Enables or disables sorting links.</p>
|
|
766
742
|
</div></span>
|
|
767
743
|
|
|
768
744
|
</li>
|
|
@@ -848,7 +824,7 @@
|
|
|
848
824
|
<div class="method_details first">
|
|
849
825
|
<h3 class="signature first" id="initialize-instance_method">
|
|
850
826
|
|
|
851
|
-
#<strong>initialize</strong>(skip_pagination: false, results_per_page: 20, skip_filtering: false, skip_sorting: false, skip_sorting_in_filter: false, skip_sorting_links: false, skip_columns: [],
|
|
827
|
+
#<strong>initialize</strong>(skip_pagination: false, results_per_page: 20, skip_filtering: false, skip_sorting: false, skip_sorting_in_filter: false, skip_sorting_links: false, skip_columns: [], skip_row_intents: [], skip_filters: [], default_sorting: 'id asc') ⇒ <tt><span class='object_link'><a href="" title="Compony::Components::List (class)">List</a></span></tt>
|
|
852
828
|
|
|
853
829
|
|
|
854
830
|
|
|
@@ -1000,8 +976,6 @@
|
|
|
1000
976
|
<span class='type'>(<tt>Array</tt>)</span>
|
|
1001
977
|
|
|
1002
978
|
|
|
1003
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
|
1004
|
-
|
|
1005
979
|
|
|
1006
980
|
—
|
|
1007
981
|
<div class='inline'>
|
|
@@ -1085,7 +1059,13 @@
|
|
|
1085
1059
|
47
|
|
1086
1060
|
48
|
|
1087
1061
|
49
|
|
1088
|
-
50
|
|
1062
|
+
50
|
|
1063
|
+
51
|
|
1064
|
+
52
|
|
1065
|
+
53
|
|
1066
|
+
54
|
|
1067
|
+
55
|
|
1068
|
+
56</pre>
|
|
1089
1069
|
</td>
|
|
1090
1070
|
<td>
|
|
1091
1071
|
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 20</span>
|
|
@@ -1098,19 +1078,25 @@
|
|
|
1098
1078
|
<span class='label'>skip_sorting_in_filter:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
|
1099
1079
|
<span class='label'>skip_sorting_links:</span> <span class='kw'>false</span><span class='comma'>,</span>
|
|
1100
1080
|
<span class='label'>skip_columns:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|
1101
|
-
<span class='label'>
|
|
1081
|
+
<span class='label'>skip_row_intents:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|
1102
1082
|
<span class='label'>skip_filters:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span>
|
|
1103
1083
|
<span class='label'>default_sorting:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>id asc</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
|
1104
1084
|
<span class='op'>**</span><span class='rparen'>)</span>
|
|
1105
|
-
<span class='ivar'>@pagination</span> <span class='op'>=</span> <span class='
|
|
1085
|
+
<span class='ivar'>@pagination</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
1086
|
+
<span class='ivar'>@skip_pagination</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_skip_pagination'>skip_pagination</span>
|
|
1106
1087
|
<span class='ivar'>@results_per_page</span> <span class='op'>=</span> <span class='id identifier rubyid_results_per_page'>results_per_page</span>
|
|
1107
|
-
<span class='ivar'>@filtering</span> <span class='op'>=</span> <span class='
|
|
1108
|
-
<span class='ivar'>@
|
|
1109
|
-
<span class='ivar'>@
|
|
1088
|
+
<span class='ivar'>@filtering</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
1089
|
+
<span class='ivar'>@skip_filtering</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_skip_filtering'>skip_filtering</span>
|
|
1090
|
+
<span class='ivar'>@sorting</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
1091
|
+
<span class='ivar'>@sorting_in_filter</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
1092
|
+
<span class='ivar'>@sorting_links</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
1093
|
+
<span class='ivar'>@skip_sorting_in_filter</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_skip_sorting'>skip_sorting</span> <span class='op'>||</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_skip_sorting_in_filter'>skip_sorting_in_filter</span>
|
|
1094
|
+
<span class='ivar'>@skip_sorting_links</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_skip_sorting'>skip_sorting</span> <span class='op'>||</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_skip_sorting_links'>skip_sorting_links</span>
|
|
1110
1095
|
<span class='ivar'>@columns</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Compony.html" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
1111
|
-
<span class='ivar'>@
|
|
1096
|
+
<span class='ivar'>@row_intent_blocks</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
1112
1097
|
<span class='ivar'>@skipped_columns</span> <span class='op'>=</span> <span class='id identifier rubyid_skip_columns'>skip_columns</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_sym</span><span class='rparen'>)</span>
|
|
1113
|
-
<span class='ivar'>@
|
|
1098
|
+
<span class='ivar'>@skipped_row_intents</span> <span class='op'>=</span> <span class='id identifier rubyid_skip_row_intents'>skip_row_intents</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Enumerable</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_skip_row_intents'>skip_row_intents</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_sym</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
1099
|
+
<span class='ivar'>@skip_row_intents</span> <span class='op'>=</span> <span class='id identifier rubyid_skip_row_intents'>skip_row_intents</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>TrueClass</span><span class='rparen'>)</span>
|
|
1114
1100
|
<span class='ivar'>@filters</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Compony.html" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
1115
1101
|
<span class='ivar'>@sorts</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../../Compony.html" title="Compony (module)">Compony</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
1116
1102
|
<span class='ivar'>@skipped_filters</span> <span class='op'>=</span> <span class='id identifier rubyid_skip_filters'>skip_filters</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:to_sym</span><span class='rparen'>)</span>
|
|
@@ -1249,22 +1235,22 @@
|
|
|
1249
1235
|
<pre class="lines">
|
|
1250
1236
|
|
|
1251
1237
|
|
|
1252
|
-
132
|
|
1253
|
-
133
|
|
1254
|
-
134
|
|
1255
|
-
135
|
|
1256
|
-
136
|
|
1257
|
-
137
|
|
1258
1238
|
138
|
|
1259
1239
|
139
|
|
1260
1240
|
140
|
|
1261
1241
|
141
|
|
1262
1242
|
142
|
|
1263
1243
|
143
|
|
1264
|
-
144
|
|
1244
|
+
144
|
|
1245
|
+
145
|
|
1246
|
+
146
|
|
1247
|
+
147
|
|
1248
|
+
148
|
|
1249
|
+
149
|
|
1250
|
+
150</pre>
|
|
1265
1251
|
</td>
|
|
1266
1252
|
<td>
|
|
1267
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1253
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 138</span>
|
|
1268
1254
|
|
|
1269
1255
|
<span class='kw'>def</span> <span class='id identifier rubyid_column'>column</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>class:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>link_opts:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>**</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1270
1256
|
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
@@ -1310,12 +1296,12 @@
|
|
|
1310
1296
|
<pre class="lines">
|
|
1311
1297
|
|
|
1312
1298
|
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1299
|
+
154
|
|
1300
|
+
155
|
|
1301
|
+
156</pre>
|
|
1316
1302
|
</td>
|
|
1317
1303
|
<td>
|
|
1318
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1304
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 154</span>
|
|
1319
1305
|
|
|
1320
1306
|
<span class='kw'>def</span> <span class='id identifier rubyid_columns'>columns</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_col_names'>col_names</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span>
|
|
1321
1307
|
<span class='id identifier rubyid_col_names'>col_names</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_col_name'>col_name</span><span class='op'>|</span> <span class='id identifier rubyid_column'>column</span><span class='lparen'>(</span><span class='id identifier rubyid_col_name'>col_name</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
@@ -1351,12 +1337,12 @@
|
|
|
1351
1337
|
<pre class="lines">
|
|
1352
1338
|
|
|
1353
1339
|
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1340
|
+
97
|
|
1341
|
+
98
|
|
1342
|
+
99</pre>
|
|
1357
1343
|
</td>
|
|
1358
1344
|
<td>
|
|
1359
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1345
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 97</span>
|
|
1360
1346
|
|
|
1361
1347
|
<span class='kw'>def</span> <span class='id identifier rubyid_default_sorting'>default_sorting</span><span class='lparen'>(</span><span class='id identifier rubyid_new_default_sorting'>new_default_sorting</span><span class='rparen'>)</span>
|
|
1362
1348
|
<span class='ivar'>@default_sorting</span> <span class='op'>=</span> <span class='id identifier rubyid_new_default_sorting'>new_default_sorting</span>
|
|
@@ -1446,6 +1432,10 @@
|
|
|
1446
1432
|
<pre class="lines">
|
|
1447
1433
|
|
|
1448
1434
|
|
|
1435
|
+
187
|
|
1436
|
+
188
|
|
1437
|
+
189
|
|
1438
|
+
190
|
|
1449
1439
|
191
|
|
1450
1440
|
192
|
|
1451
1441
|
193
|
|
@@ -1463,14 +1453,10 @@
|
|
|
1463
1453
|
205
|
|
1464
1454
|
206
|
|
1465
1455
|
207
|
|
1466
|
-
208
|
|
1467
|
-
209
|
|
1468
|
-
210
|
|
1469
|
-
211
|
|
1470
|
-
212</pre>
|
|
1456
|
+
208</pre>
|
|
1471
1457
|
</td>
|
|
1472
1458
|
<td>
|
|
1473
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1459
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 187</span>
|
|
1474
1460
|
|
|
1475
1461
|
<span class='kw'>def</span> <span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='op'>**</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
1476
1462
|
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
@@ -1545,12 +1531,12 @@
|
|
|
1545
1531
|
<pre class="lines">
|
|
1546
1532
|
|
|
1547
1533
|
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1534
|
+
111
|
|
1535
|
+
112
|
|
1536
|
+
113</pre>
|
|
1551
1537
|
</td>
|
|
1552
1538
|
<td>
|
|
1553
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1539
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 111</span>
|
|
1554
1540
|
|
|
1555
1541
|
<span class='kw'>def</span> <span class='id identifier rubyid_filter_input_class'>filter_input_class</span><span class='lparen'>(</span><span class='id identifier rubyid_class_str'>class_str</span><span class='rparen'>)</span>
|
|
1556
1542
|
<span class='ivar'>@filter_input_class</span> <span class='op'>=</span> <span class='id identifier rubyid_class_str'>class_str</span>
|
|
@@ -1606,12 +1592,12 @@
|
|
|
1606
1592
|
<pre class="lines">
|
|
1607
1593
|
|
|
1608
1594
|
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1595
|
+
125
|
|
1596
|
+
126
|
|
1597
|
+
127</pre>
|
|
1612
1598
|
</td>
|
|
1613
1599
|
<td>
|
|
1614
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1600
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 125</span>
|
|
1615
1601
|
|
|
1616
1602
|
<span class='kw'>def</span> <span class='id identifier rubyid_filter_item_wrapper_class'>filter_item_wrapper_class</span><span class='lparen'>(</span><span class='id identifier rubyid_class_str'>class_str</span><span class='rparen'>)</span>
|
|
1617
1603
|
<span class='ivar'>@filter_item_wrapper_class</span> <span class='op'>=</span> <span class='id identifier rubyid_class_str'>class_str</span>
|
|
@@ -1667,12 +1653,12 @@
|
|
|
1667
1653
|
<pre class="lines">
|
|
1668
1654
|
|
|
1669
1655
|
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1656
|
+
104
|
|
1657
|
+
105
|
|
1658
|
+
106</pre>
|
|
1673
1659
|
</td>
|
|
1674
1660
|
<td>
|
|
1675
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1661
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 104</span>
|
|
1676
1662
|
|
|
1677
1663
|
<span class='kw'>def</span> <span class='id identifier rubyid_filter_label_class'>filter_label_class</span><span class='lparen'>(</span><span class='id identifier rubyid_class_str'>class_str</span><span class='rparen'>)</span>
|
|
1678
1664
|
<span class='ivar'>@filter_label_class</span> <span class='op'>=</span> <span class='id identifier rubyid_class_str'>class_str</span>
|
|
@@ -1728,12 +1714,12 @@
|
|
|
1728
1714
|
<pre class="lines">
|
|
1729
1715
|
|
|
1730
1716
|
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1717
|
+
118
|
|
1718
|
+
119
|
|
1719
|
+
120</pre>
|
|
1734
1720
|
</td>
|
|
1735
1721
|
<td>
|
|
1736
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1722
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 118</span>
|
|
1737
1723
|
|
|
1738
1724
|
<span class='kw'>def</span> <span class='id identifier rubyid_filter_select_class'>filter_select_class</span><span class='lparen'>(</span><span class='id identifier rubyid_class_str'>class_str</span><span class='rparen'>)</span>
|
|
1739
1725
|
<span class='ivar'>@filter_select_class</span> <span class='op'>=</span> <span class='id identifier rubyid_class_str'>class_str</span>
|
|
@@ -1741,6 +1727,47 @@
|
|
|
1741
1727
|
</td>
|
|
1742
1728
|
</tr>
|
|
1743
1729
|
</table>
|
|
1730
|
+
</div>
|
|
1731
|
+
|
|
1732
|
+
<div class="method_details ">
|
|
1733
|
+
<h3 class="signature " id="filtering-instance_method">
|
|
1734
|
+
|
|
1735
|
+
#<strong>filtering</strong>(new_filtering) ⇒ <tt>Object</tt>
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
</h3><div class="docstring">
|
|
1742
|
+
<div class="discussion">
|
|
1743
|
+
|
|
1744
|
+
<p>DSL method Enables or disables filtering entirely (sorting is independent of this setting).</p>
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
</div>
|
|
1748
|
+
</div>
|
|
1749
|
+
<div class="tags">
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
</div><table class="source_code">
|
|
1753
|
+
<tr>
|
|
1754
|
+
<td>
|
|
1755
|
+
<pre class="lines">
|
|
1756
|
+
|
|
1757
|
+
|
|
1758
|
+
72
|
|
1759
|
+
73
|
|
1760
|
+
74</pre>
|
|
1761
|
+
</td>
|
|
1762
|
+
<td>
|
|
1763
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 72</span>
|
|
1764
|
+
|
|
1765
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_filtering'>filtering</span><span class='lparen'>(</span><span class='id identifier rubyid_new_filtering'>new_filtering</span><span class='rparen'>)</span>
|
|
1766
|
+
<span class='ivar'>@filtering</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_new_filtering'>new_filtering</span>
|
|
1767
|
+
<span class='kw'>end</span></pre>
|
|
1768
|
+
</td>
|
|
1769
|
+
</tr>
|
|
1770
|
+
</table>
|
|
1744
1771
|
</div>
|
|
1745
1772
|
|
|
1746
1773
|
<div class="method_details ">
|
|
@@ -1782,15 +1809,15 @@
|
|
|
1782
1809
|
<pre class="lines">
|
|
1783
1810
|
|
|
1784
1811
|
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1812
|
+
387
|
|
1813
|
+
388
|
|
1814
|
+
389</pre>
|
|
1788
1815
|
</td>
|
|
1789
1816
|
<td>
|
|
1790
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1817
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 387</span>
|
|
1791
1818
|
|
|
1792
1819
|
<span class='kw'>def</span> <span class='id identifier rubyid_filtering_enabled?'>filtering_enabled?</span>
|
|
1793
|
-
<span class='ivar'>@filtering</span> <span class='op'>&&</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Ransack</span><span class='rparen'>)</span>
|
|
1820
|
+
<span class='ivar'>@filtering</span> <span class='op'>&&</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Ransack</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_filtering</span>
|
|
1794
1821
|
<span class='kw'>end</span></pre>
|
|
1795
1822
|
</td>
|
|
1796
1823
|
</tr>
|
|
@@ -1823,12 +1850,12 @@
|
|
|
1823
1850
|
<pre class="lines">
|
|
1824
1851
|
|
|
1825
1852
|
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1853
|
+
212
|
|
1854
|
+
213
|
|
1855
|
+
214</pre>
|
|
1829
1856
|
</td>
|
|
1830
1857
|
<td>
|
|
1831
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1858
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 212</span>
|
|
1832
1859
|
|
|
1833
1860
|
<span class='kw'>def</span> <span class='id identifier rubyid_filters'>filters</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_filter_names'>filter_names</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span>
|
|
1834
1861
|
<span class='id identifier rubyid_filter_names'>filter_names</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_filter_name'>filter_name</span><span class='op'>|</span> <span class='id identifier rubyid_filter'>filter</span><span class='lparen'>(</span><span class='id identifier rubyid_filter_name'>filter_name</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
@@ -1836,6 +1863,47 @@
|
|
|
1836
1863
|
</td>
|
|
1837
1864
|
</tr>
|
|
1838
1865
|
</table>
|
|
1866
|
+
</div>
|
|
1867
|
+
|
|
1868
|
+
<div class="method_details ">
|
|
1869
|
+
<h3 class="signature " id="pagination-instance_method">
|
|
1870
|
+
|
|
1871
|
+
#<strong>pagination</strong>(new_pagination) ⇒ <tt>Object</tt>
|
|
1872
|
+
|
|
1873
|
+
|
|
1874
|
+
|
|
1875
|
+
|
|
1876
|
+
|
|
1877
|
+
</h3><div class="docstring">
|
|
1878
|
+
<div class="discussion">
|
|
1879
|
+
|
|
1880
|
+
<p>DSL method Enables or disables pagination (caution: all records will be loaded).</p>
|
|
1881
|
+
|
|
1882
|
+
|
|
1883
|
+
</div>
|
|
1884
|
+
</div>
|
|
1885
|
+
<div class="tags">
|
|
1886
|
+
|
|
1887
|
+
|
|
1888
|
+
</div><table class="source_code">
|
|
1889
|
+
<tr>
|
|
1890
|
+
<td>
|
|
1891
|
+
<pre class="lines">
|
|
1892
|
+
|
|
1893
|
+
|
|
1894
|
+
60
|
|
1895
|
+
61
|
|
1896
|
+
62</pre>
|
|
1897
|
+
</td>
|
|
1898
|
+
<td>
|
|
1899
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 60</span>
|
|
1900
|
+
|
|
1901
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_pagination'>pagination</span><span class='lparen'>(</span><span class='id identifier rubyid_new_pagination'>new_pagination</span><span class='rparen'>)</span>
|
|
1902
|
+
<span class='ivar'>@pagination</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_new_pagination'>new_pagination</span>
|
|
1903
|
+
<span class='kw'>end</span></pre>
|
|
1904
|
+
</td>
|
|
1905
|
+
</tr>
|
|
1906
|
+
</table>
|
|
1839
1907
|
</div>
|
|
1840
1908
|
|
|
1841
1909
|
<div class="method_details ">
|
|
@@ -1877,15 +1945,15 @@
|
|
|
1877
1945
|
<pre class="lines">
|
|
1878
1946
|
|
|
1879
1947
|
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1948
|
+
407
|
|
1949
|
+
408
|
|
1950
|
+
409</pre>
|
|
1883
1951
|
</td>
|
|
1884
1952
|
<td>
|
|
1885
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
1953
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 407</span>
|
|
1886
1954
|
|
|
1887
1955
|
<span class='kw'>def</span> <span class='id identifier rubyid_pagination_enabled?'>pagination_enabled?</span>
|
|
1888
|
-
<span class='ivar'>@pagination</span>
|
|
1956
|
+
<span class='ivar'>@pagination</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_pagination</span>
|
|
1889
1957
|
<span class='kw'>end</span></pre>
|
|
1890
1958
|
</td>
|
|
1891
1959
|
</tr>
|
|
@@ -1918,6 +1986,10 @@
|
|
|
1918
1986
|
<pre class="lines">
|
|
1919
1987
|
|
|
1920
1988
|
|
|
1989
|
+
233
|
|
1990
|
+
234
|
|
1991
|
+
235
|
|
1992
|
+
236
|
|
1921
1993
|
237
|
|
1922
1994
|
238
|
|
1923
1995
|
239
|
|
@@ -1944,19 +2016,15 @@
|
|
|
1944
2016
|
260
|
|
1945
2017
|
261
|
|
1946
2018
|
262
|
|
1947
|
-
263
|
|
1948
|
-
264
|
|
1949
|
-
265
|
|
1950
|
-
266
|
|
1951
|
-
267</pre>
|
|
2019
|
+
263</pre>
|
|
1952
2020
|
</td>
|
|
1953
2021
|
<td>
|
|
1954
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2022
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 233</span>
|
|
1955
2023
|
|
|
1956
2024
|
<span class='kw'>def</span> <span class='id identifier rubyid_process_data!'>process_data!</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='rparen'>)</span>
|
|
1957
2025
|
<span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Data was already processed!</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='ivar'>@processed_data</span>
|
|
1958
2026
|
<span class='comment'># Filtering
|
|
1959
|
-
</span> <span class='kw'>if</span> <span class='id identifier rubyid_filtering_enabled?'>filtering_enabled?</span>
|
|
2027
|
+
</span> <span class='kw'>if</span> <span class='id identifier rubyid_filtering_enabled?'>filtering_enabled?</span> <span class='op'>||</span> <span class='id identifier rubyid_sorting_enabled?'>sorting_enabled?</span>
|
|
1960
2028
|
<span class='ivar'>@q</span> <span class='op'>=</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_ransack'>ransack</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='id identifier rubyid_param_name'>param_name</span><span class='lparen'>(</span><span class='symbol'>:q</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='label'>auth_object:</span> <span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_current_ability'>current_ability</span><span class='comma'>,</span> <span class='label'>search_key:</span> <span class='id identifier rubyid_param_name'>param_name</span><span class='lparen'>(</span><span class='symbol'>:q</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
1961
2029
|
<span class='ivar'>@q</span><span class='period'>.</span><span class='id identifier rubyid_sorts'>sorts</span> <span class='op'>=</span> <span class='ivar'>@default_sorting</span> <span class='kw'>if</span> <span class='ivar'>@q</span><span class='period'>.</span><span class='id identifier rubyid_sorts'>sorts</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
|
|
1962
2030
|
<span class='id identifier rubyid_filtered_data'>filtered_data</span> <span class='op'>=</span> <span class='ivar'>@q</span><span class='period'>.</span><span class='id identifier rubyid_result'>result</span><span class='period'>.</span><span class='id identifier rubyid_accessible_by'>accessible_by</span><span class='lparen'>(</span><span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_current_ability'>current_ability</span><span class='rparen'>)</span>
|
|
@@ -2015,12 +2083,12 @@
|
|
|
2015
2083
|
<pre class="lines">
|
|
2016
2084
|
|
|
2017
2085
|
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2086
|
+
66
|
|
2087
|
+
67
|
|
2088
|
+
68</pre>
|
|
2021
2089
|
</td>
|
|
2022
2090
|
<td>
|
|
2023
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2091
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 66</span>
|
|
2024
2092
|
|
|
2025
2093
|
<span class='kw'>def</span> <span class='id identifier rubyid_results_per_page'>results_per_page</span><span class='lparen'>(</span><span class='id identifier rubyid_new_results_per_page'>new_results_per_page</span><span class='rparen'>)</span>
|
|
2026
2094
|
<span class='ivar'>@results_per_page</span> <span class='op'>=</span> <span class='id identifier rubyid_new_results_per_page'>new_results_per_page</span>
|
|
@@ -2031,9 +2099,9 @@
|
|
|
2031
2099
|
</div>
|
|
2032
2100
|
|
|
2033
2101
|
<div class="method_details ">
|
|
2034
|
-
<h3 class="signature " id="
|
|
2102
|
+
<h3 class="signature " id="row_intents-instance_method">
|
|
2035
2103
|
|
|
2036
|
-
#<strong>
|
|
2104
|
+
#<strong>row_intents</strong>(**intent_opts, &block) ⇒ <tt>Object</tt>
|
|
2037
2105
|
|
|
2038
2106
|
|
|
2039
2107
|
|
|
@@ -2042,67 +2110,13 @@
|
|
|
2042
2110
|
</h3><div class="docstring">
|
|
2043
2111
|
<div class="discussion">
|
|
2044
2112
|
|
|
2045
|
-
<p>DSL method
|
|
2113
|
+
<p>DSL method If a block is given: Enters the DSL where row intents can be added or removed (use from Component#setup within the component). If no block is given: Builds the declared intents for the given record and returns them (use in <code>content</code> or <code>before_render</code>, pass kwarg <code>:data</code>).</p>
|
|
2046
2114
|
|
|
2047
2115
|
|
|
2048
2116
|
</div>
|
|
2049
2117
|
</div>
|
|
2050
2118
|
<div class="tags">
|
|
2051
|
-
<p class="tag_title">Parameters:</p>
|
|
2052
|
-
<ul class="param">
|
|
2053
|
-
|
|
2054
|
-
<li>
|
|
2055
|
-
|
|
2056
|
-
<span class='name'>name</span>
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
<span class='type'>(<tt>Symbol</tt>, <tt>String</tt>)</span>
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
—
|
|
2064
|
-
<div class='inline'>
|
|
2065
|
-
<p>The name of the action (e.g. :edit).</p>
|
|
2066
|
-
</div>
|
|
2067
|
-
|
|
2068
|
-
</li>
|
|
2069
|
-
|
|
2070
|
-
<li>
|
|
2071
|
-
|
|
2072
|
-
<span class='name'>button_opts</span>
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
—
|
|
2082
|
-
<div class='inline'>
|
|
2083
|
-
<p>Only relevant in case of an auto-generated row action, this allows to configure the generated button.</p>
|
|
2084
|
-
</div>
|
|
2085
|
-
|
|
2086
|
-
</li>
|
|
2087
|
-
|
|
2088
|
-
<li>
|
|
2089
|
-
|
|
2090
|
-
<span class='name'>block</span>
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
<span class='type'>(<tt>Block</tt>)</span>
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
—
|
|
2098
|
-
<div class='inline'>
|
|
2099
|
-
<p>To create a custom row action; block will be given the current record and instance-execed once per row, for every record.</p>
|
|
2100
|
-
</div>
|
|
2101
|
-
|
|
2102
|
-
</li>
|
|
2103
2119
|
|
|
2104
|
-
</ul>
|
|
2105
|
-
|
|
2106
2120
|
|
|
2107
2121
|
</div><table class="source_code">
|
|
2108
2122
|
<tr>
|
|
@@ -2110,8 +2124,6 @@
|
|
|
2110
2124
|
<pre class="lines">
|
|
2111
2125
|
|
|
2112
2126
|
|
|
2113
|
-
166
|
|
2114
|
-
167
|
|
2115
2127
|
168
|
|
2116
2128
|
169
|
|
2117
2129
|
170
|
|
@@ -2119,20 +2131,24 @@
|
|
|
2119
2131
|
172
|
|
2120
2132
|
173
|
|
2121
2133
|
174
|
|
2122
|
-
175
|
|
2134
|
+
175
|
|
2135
|
+
176
|
|
2136
|
+
177
|
|
2137
|
+
178</pre>
|
|
2123
2138
|
</td>
|
|
2124
2139
|
<td>
|
|
2125
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2140
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 168</span>
|
|
2126
2141
|
|
|
2127
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
2128
|
-
<span class='
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
<span class='
|
|
2142
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_row_intents'>row_intents</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_intent_opts'>intent_opts</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
|
2143
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
|
2144
|
+
<span class='comment'># Enter DSL
|
|
2145
|
+
</span> <span class='ivar'>@row_intent_blocks</span> <span class='op'><<</span> <span class='id identifier rubyid_block'>block</span>
|
|
2146
|
+
<span class='kw'>else</span>
|
|
2147
|
+
<span class='comment'># Build the declared intents
|
|
2148
|
+
</span> <span class='id identifier rubyid_intents_ordering'>intents_ordering</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="../NaturalOrdering.html" title="Compony::NaturalOrdering (class)">NaturalOrdering</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
|
2149
|
+
<span class='ivar'>@row_intent_blocks</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_block'>block</span><span class='op'>|</span> <span class='const'><span class='object_link'><a href="../ManageIntentsDsl.html" title="Compony::ManageIntentsDsl (class)">ManageIntentsDsl</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="../ManageIntentsDsl.html#initialize-instance_method" title="Compony::ManageIntentsDsl#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_intents_ordering'>intents_ordering</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_intent_opts'>intent_opts</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_evaluate'>evaluate</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span> <span class='rbrace'>}</span> <span class='comment'># this populates intents_ordering
|
|
2150
|
+
</span> <span class='kw'>return</span> <span class='id identifier rubyid_intents_ordering'>intents_ordering</span><span class='period'>.</span><span class='id identifier rubyid_map!'>map!</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:payload</span><span class='rparen'>)</span>
|
|
2134
2151
|
<span class='kw'>end</span>
|
|
2135
|
-
<span class='ivar'>@row_actions</span><span class='period'>.</span><span class='id identifier rubyid_natural_push'>natural_push</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span>
|
|
2136
2152
|
<span class='kw'>end</span></pre>
|
|
2137
2153
|
</td>
|
|
2138
2154
|
</tr>
|
|
@@ -2185,12 +2201,12 @@
|
|
|
2185
2201
|
<pre class="lines">
|
|
2186
2202
|
|
|
2187
2203
|
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2204
|
+
161
|
|
2205
|
+
162
|
|
2206
|
+
163</pre>
|
|
2191
2207
|
</td>
|
|
2192
2208
|
<td>
|
|
2193
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2209
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 161</span>
|
|
2194
2210
|
|
|
2195
2211
|
<span class='kw'>def</span> <span class='id identifier rubyid_skip_column'>skip_column</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
2196
2212
|
<span class='ivar'>@skipped_columns</span> <span class='op'><<</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
@@ -2201,91 +2217,9 @@
|
|
|
2201
2217
|
</div>
|
|
2202
2218
|
|
|
2203
2219
|
<div class="method_details ">
|
|
2204
|
-
<h3 class="signature " id="
|
|
2205
|
-
|
|
2206
|
-
#<strong>skip_filtering!</strong> ⇒ <tt>Object</tt>
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
</h3><div class="docstring">
|
|
2213
|
-
<div class="discussion">
|
|
2214
|
-
|
|
2215
|
-
<p>DSL method Disables filtering entirely (sorting is independent of this setting).</p>
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
</div>
|
|
2219
|
-
</div>
|
|
2220
|
-
<div class="tags">
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
</div><table class="source_code">
|
|
2224
|
-
<tr>
|
|
2225
|
-
<td>
|
|
2226
|
-
<pre class="lines">
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
66
|
|
2230
|
-
67
|
|
2231
|
-
68</pre>
|
|
2232
|
-
</td>
|
|
2233
|
-
<td>
|
|
2234
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 66</span>
|
|
2235
|
-
|
|
2236
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_skip_filtering!'>skip_filtering!</span>
|
|
2237
|
-
<span class='ivar'>@filtering</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
2238
|
-
<span class='kw'>end</span></pre>
|
|
2239
|
-
</td>
|
|
2240
|
-
</tr>
|
|
2241
|
-
</table>
|
|
2242
|
-
</div>
|
|
2243
|
-
|
|
2244
|
-
<div class="method_details ">
|
|
2245
|
-
<h3 class="signature " id="skip_pagination!-instance_method">
|
|
2246
|
-
|
|
2247
|
-
#<strong>skip_pagination!</strong> ⇒ <tt>Object</tt>
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
</h3><div class="docstring">
|
|
2254
|
-
<div class="discussion">
|
|
2255
|
-
|
|
2256
|
-
<p>DSL method Disables pagination (caution: all records will be loaded).</p>
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
</div>
|
|
2260
|
-
</div>
|
|
2261
|
-
<div class="tags">
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
</div><table class="source_code">
|
|
2265
|
-
<tr>
|
|
2266
|
-
<td>
|
|
2267
|
-
<pre class="lines">
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
54
|
|
2271
|
-
55
|
|
2272
|
-
56</pre>
|
|
2273
|
-
</td>
|
|
2274
|
-
<td>
|
|
2275
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 54</span>
|
|
2276
|
-
|
|
2277
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_skip_pagination!'>skip_pagination!</span>
|
|
2278
|
-
<span class='ivar'>@pagination</span> <span class='op'>=</span> <span class='kw'>false</span>
|
|
2279
|
-
<span class='kw'>end</span></pre>
|
|
2280
|
-
</td>
|
|
2281
|
-
</tr>
|
|
2282
|
-
</table>
|
|
2283
|
-
</div>
|
|
2284
|
-
|
|
2285
|
-
<div class="method_details ">
|
|
2286
|
-
<h3 class="signature " id="skip_row_action-instance_method">
|
|
2220
|
+
<h3 class="signature " id="sort-instance_method">
|
|
2287
2221
|
|
|
2288
|
-
#<strong>
|
|
2222
|
+
#<strong>sort</strong>(name, label: nil) ⇒ <tt>Object</tt>
|
|
2289
2223
|
|
|
2290
2224
|
|
|
2291
2225
|
|
|
@@ -2294,7 +2228,7 @@
|
|
|
2294
2228
|
</h3><div class="docstring">
|
|
2295
2229
|
<div class="discussion">
|
|
2296
2230
|
|
|
2297
|
-
<p>DSL method
|
|
2231
|
+
<p>DSL method Adds a sorting criterion that will be processed by ransack. <code>data_class</code> must be sortable by this criterion. See Ransack’s sorting for constraints. For every call of this method, one sorting link and two entries (asc, desc) in the sorting-in-filter feature will be generated, if enabled.</p>
|
|
2298
2232
|
|
|
2299
2233
|
|
|
2300
2234
|
</div>
|
|
@@ -2314,54 +2248,31 @@
|
|
|
2314
2248
|
|
|
2315
2249
|
—
|
|
2316
2250
|
<div class='inline'>
|
|
2317
|
-
<p>
|
|
2251
|
+
<p>Sorting criteria, e.g. <code>:id</code> or <code>:label</code>.</p>
|
|
2318
2252
|
</div>
|
|
2319
2253
|
|
|
2320
2254
|
</li>
|
|
2321
2255
|
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 180</span>
|
|
2337
|
-
|
|
2338
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_skip_row_action'>skip_row_action</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
2339
|
-
<span class='ivar'>@skipped_row_actions</span> <span class='op'><<</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span>
|
|
2340
|
-
<span class='kw'>end</span></pre>
|
|
2341
|
-
</td>
|
|
2342
|
-
</tr>
|
|
2343
|
-
</table>
|
|
2256
|
+
<li>
|
|
2257
|
+
|
|
2258
|
+
<span class='name'>label</span>
|
|
2259
|
+
|
|
2260
|
+
|
|
2261
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
2262
|
+
|
|
2263
|
+
|
|
2264
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
2265
|
+
|
|
2266
|
+
|
|
2267
|
+
—
|
|
2268
|
+
<div class='inline'>
|
|
2269
|
+
<p>Label of the sorting link / entries.</p>
|
|
2344
2270
|
</div>
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
<h3 class="signature " id="skip_sorting!-instance_method">
|
|
2348
|
-
|
|
2349
|
-
#<strong>skip_sorting!</strong> ⇒ <tt>Object</tt>
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2271
|
+
|
|
2272
|
+
</li>
|
|
2354
2273
|
|
|
2355
|
-
</
|
|
2356
|
-
<div class="discussion">
|
|
2357
|
-
|
|
2358
|
-
<p>DSL method Disables sorting entirely (both links and sorting input in filter).</p>
|
|
2359
|
-
|
|
2274
|
+
</ul>
|
|
2360
2275
|
|
|
2361
|
-
</div>
|
|
2362
|
-
</div>
|
|
2363
|
-
<div class="tags">
|
|
2364
|
-
|
|
2365
2276
|
|
|
2366
2277
|
</div><table class="source_code">
|
|
2367
2278
|
<tr>
|
|
@@ -2369,17 +2280,17 @@
|
|
|
2369
2280
|
<pre class="lines">
|
|
2370
2281
|
|
|
2371
2282
|
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2283
|
+
221
|
|
2284
|
+
222
|
|
2285
|
+
223
|
|
2286
|
+
224</pre>
|
|
2376
2287
|
</td>
|
|
2377
2288
|
<td>
|
|
2378
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2289
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 221</span>
|
|
2379
2290
|
|
|
2380
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
2381
|
-
<span class='
|
|
2382
|
-
<span class='ivar'>@
|
|
2291
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sort'>sort</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='label'>label:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
|
2292
|
+
<span class='id identifier rubyid_label'>label</span> <span class='op'>||=</span> <span class='id identifier rubyid_data_class'>data_class</span><span class='period'>.</span><span class='id identifier rubyid_fields'>fields</span><span class='lbracket'>[</span><span class='id identifier rubyid_name'>name</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_label'>label</span>
|
|
2293
|
+
<span class='ivar'>@sorts</span><span class='period'>.</span><span class='id identifier rubyid_natural_push'>natural_push</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>label:</span><span class='rparen'>)</span>
|
|
2383
2294
|
<span class='kw'>end</span></pre>
|
|
2384
2295
|
</td>
|
|
2385
2296
|
</tr>
|
|
@@ -2387,9 +2298,9 @@
|
|
|
2387
2298
|
</div>
|
|
2388
2299
|
|
|
2389
2300
|
<div class="method_details ">
|
|
2390
|
-
<h3 class="signature " id="
|
|
2301
|
+
<h3 class="signature " id="sorting-instance_method">
|
|
2391
2302
|
|
|
2392
|
-
#<strong>
|
|
2303
|
+
#<strong>sorting</strong>(new_sorting) ⇒ <tt>Object</tt>
|
|
2393
2304
|
|
|
2394
2305
|
|
|
2395
2306
|
|
|
@@ -2398,7 +2309,7 @@
|
|
|
2398
2309
|
</h3><div class="docstring">
|
|
2399
2310
|
<div class="discussion">
|
|
2400
2311
|
|
|
2401
|
-
<p>DSL method
|
|
2312
|
+
<p>DSL method Enables or disables sorting entirely (both links and sorting input in filter).</p>
|
|
2402
2313
|
|
|
2403
2314
|
|
|
2404
2315
|
</div>
|
|
@@ -2412,15 +2323,17 @@
|
|
|
2412
2323
|
<pre class="lines">
|
|
2413
2324
|
|
|
2414
2325
|
|
|
2326
|
+
78
|
|
2415
2327
|
79
|
|
2416
2328
|
80
|
|
2417
2329
|
81</pre>
|
|
2418
2330
|
</td>
|
|
2419
2331
|
<td>
|
|
2420
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2332
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 78</span>
|
|
2421
2333
|
|
|
2422
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
2423
|
-
<span class='ivar'>@sorting_in_filter</span> <span class='op'>=</span> <span class='
|
|
2334
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sorting'>sorting</span><span class='lparen'>(</span><span class='id identifier rubyid_new_sorting'>new_sorting</span><span class='rparen'>)</span>
|
|
2335
|
+
<span class='ivar'>@sorting_in_filter</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_new_sorting'>new_sorting</span>
|
|
2336
|
+
<span class='ivar'>@sorting_links</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_new_sorting'>new_sorting</span>
|
|
2424
2337
|
<span class='kw'>end</span></pre>
|
|
2425
2338
|
</td>
|
|
2426
2339
|
</tr>
|
|
@@ -2428,9 +2341,9 @@
|
|
|
2428
2341
|
</div>
|
|
2429
2342
|
|
|
2430
2343
|
<div class="method_details ">
|
|
2431
|
-
<h3 class="signature " id="
|
|
2344
|
+
<h3 class="signature " id="sorting_enabled?-instance_method">
|
|
2432
2345
|
|
|
2433
|
-
#<strong>
|
|
2346
|
+
#<strong>sorting_enabled?</strong> ⇒ <tt>Boolean</tt> <span class="extras">(protected)</span>
|
|
2434
2347
|
|
|
2435
2348
|
|
|
2436
2349
|
|
|
@@ -2439,13 +2352,26 @@
|
|
|
2439
2352
|
</h3><div class="docstring">
|
|
2440
2353
|
<div class="discussion">
|
|
2441
2354
|
|
|
2442
|
-
<p>
|
|
2355
|
+
<p>Returns whether sorting is possible and wanted in general (regardless of whether there are any sorts defined)</p>
|
|
2443
2356
|
|
|
2444
2357
|
|
|
2445
2358
|
</div>
|
|
2446
2359
|
</div>
|
|
2447
2360
|
<div class="tags">
|
|
2448
2361
|
|
|
2362
|
+
<p class="tag_title">Returns:</p>
|
|
2363
|
+
<ul class="return">
|
|
2364
|
+
|
|
2365
|
+
<li>
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
|
|
2372
|
+
</li>
|
|
2373
|
+
|
|
2374
|
+
</ul>
|
|
2449
2375
|
|
|
2450
2376
|
</div><table class="source_code">
|
|
2451
2377
|
<tr>
|
|
@@ -2453,15 +2379,15 @@
|
|
|
2453
2379
|
<pre class="lines">
|
|
2454
2380
|
|
|
2455
2381
|
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2382
|
+
392
|
|
2383
|
+
393
|
|
2384
|
+
394</pre>
|
|
2459
2385
|
</td>
|
|
2460
2386
|
<td>
|
|
2461
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2387
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 392</span>
|
|
2462
2388
|
|
|
2463
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
2464
|
-
<span class='ivar'>@sorting_links</span> <span class='op'
|
|
2389
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_enabled?'>sorting_enabled?</span>
|
|
2390
|
+
<span class='lparen'>(</span><span class='lparen'>(</span><span class='ivar'>@sorting_in_filter</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_sorting_in_filter</span><span class='rparen'>)</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='ivar'>@sorting_links</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_sorting_links</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='kw'>defined?</span><span class='lparen'>(</span><span class='const'>Ransack</span><span class='rparen'>)</span>
|
|
2465
2391
|
<span class='kw'>end</span></pre>
|
|
2466
2392
|
</td>
|
|
2467
2393
|
</tr>
|
|
@@ -2469,9 +2395,9 @@
|
|
|
2469
2395
|
</div>
|
|
2470
2396
|
|
|
2471
2397
|
<div class="method_details ">
|
|
2472
|
-
<h3 class="signature " id="
|
|
2398
|
+
<h3 class="signature " id="sorting_in_filter-instance_method">
|
|
2473
2399
|
|
|
2474
|
-
#<strong>
|
|
2400
|
+
#<strong>sorting_in_filter</strong>(new_sorting_in_filter) ⇒ <tt>Object</tt>
|
|
2475
2401
|
|
|
2476
2402
|
|
|
2477
2403
|
|
|
@@ -2480,51 +2406,13 @@
|
|
|
2480
2406
|
</h3><div class="docstring">
|
|
2481
2407
|
<div class="discussion">
|
|
2482
2408
|
|
|
2483
|
-
<p>DSL method
|
|
2409
|
+
<p>DSL method Enables or disables sorting in filter.</p>
|
|
2484
2410
|
|
|
2485
2411
|
|
|
2486
2412
|
</div>
|
|
2487
2413
|
</div>
|
|
2488
2414
|
<div class="tags">
|
|
2489
|
-
<p class="tag_title">Parameters:</p>
|
|
2490
|
-
<ul class="param">
|
|
2491
|
-
|
|
2492
|
-
<li>
|
|
2493
|
-
|
|
2494
|
-
<span class='name'>name</span>
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
<span class='type'>(<tt>Symbol</tt>, <tt>String</tt>)</span>
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
—
|
|
2502
|
-
<div class='inline'>
|
|
2503
|
-
<p>Sorting criteria, e.g. <code>:id</code> or <code>:label</code>.</p>
|
|
2504
|
-
</div>
|
|
2505
|
-
|
|
2506
|
-
</li>
|
|
2507
2415
|
|
|
2508
|
-
<li>
|
|
2509
|
-
|
|
2510
|
-
<span class='name'>label</span>
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
<span class='type'>(<tt>String</tt>)</span>
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
—
|
|
2520
|
-
<div class='inline'>
|
|
2521
|
-
<p>Label of the sorting link / entries.</p>
|
|
2522
|
-
</div>
|
|
2523
|
-
|
|
2524
|
-
</li>
|
|
2525
|
-
|
|
2526
|
-
</ul>
|
|
2527
|
-
|
|
2528
2416
|
|
|
2529
2417
|
</div><table class="source_code">
|
|
2530
2418
|
<tr>
|
|
@@ -2532,17 +2420,15 @@
|
|
|
2532
2420
|
<pre class="lines">
|
|
2533
2421
|
|
|
2534
2422
|
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
228</pre>
|
|
2423
|
+
85
|
|
2424
|
+
86
|
|
2425
|
+
87</pre>
|
|
2539
2426
|
</td>
|
|
2540
2427
|
<td>
|
|
2541
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2428
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 85</span>
|
|
2542
2429
|
|
|
2543
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
2544
|
-
<span class='
|
|
2545
|
-
<span class='ivar'>@sorts</span><span class='period'>.</span><span class='id identifier rubyid_natural_push'>natural_push</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='label'>label:</span><span class='rparen'>)</span>
|
|
2430
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_in_filter'>sorting_in_filter</span><span class='lparen'>(</span><span class='id identifier rubyid_new_sorting_in_filter'>new_sorting_in_filter</span><span class='rparen'>)</span>
|
|
2431
|
+
<span class='ivar'>@sorting_in_filter</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_new_sorting_in_filter'>new_sorting_in_filter</span>
|
|
2546
2432
|
<span class='kw'>end</span></pre>
|
|
2547
2433
|
</td>
|
|
2548
2434
|
</tr>
|
|
@@ -2550,9 +2436,9 @@
|
|
|
2550
2436
|
</div>
|
|
2551
2437
|
|
|
2552
2438
|
<div class="method_details ">
|
|
2553
|
-
<h3 class="signature " id="
|
|
2439
|
+
<h3 class="signature " id="sorting_in_filter_enabled?-instance_method">
|
|
2554
2440
|
|
|
2555
|
-
#<strong>
|
|
2441
|
+
#<strong>sorting_in_filter_enabled?</strong> ⇒ <tt>Boolean</tt> <span class="extras">(protected)</span>
|
|
2556
2442
|
|
|
2557
2443
|
|
|
2558
2444
|
|
|
@@ -2561,7 +2447,7 @@
|
|
|
2561
2447
|
</h3><div class="docstring">
|
|
2562
2448
|
<div class="discussion">
|
|
2563
2449
|
|
|
2564
|
-
<p>Returns whether sorting is possible and wanted in general (regardless of whether there are any sorts defined)</p>
|
|
2450
|
+
<p>Returns whether sorting in filter is possible and wanted in general (regardless of whether there are any sorts defined)</p>
|
|
2565
2451
|
|
|
2566
2452
|
|
|
2567
2453
|
</div>
|
|
@@ -2595,8 +2481,8 @@
|
|
|
2595
2481
|
<td>
|
|
2596
2482
|
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 397</span>
|
|
2597
2483
|
|
|
2598
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
2599
|
-
<span class='
|
|
2484
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_in_filter_enabled?'>sorting_in_filter_enabled?</span>
|
|
2485
|
+
<span class='id identifier rubyid_sorting_enabled?'>sorting_enabled?</span> <span class='op'>&&</span> <span class='ivar'>@sorting_in_filter</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_sorting_in_filter</span>
|
|
2600
2486
|
<span class='kw'>end</span></pre>
|
|
2601
2487
|
</td>
|
|
2602
2488
|
</tr>
|
|
@@ -2604,9 +2490,9 @@
|
|
|
2604
2490
|
</div>
|
|
2605
2491
|
|
|
2606
2492
|
<div class="method_details ">
|
|
2607
|
-
<h3 class="signature " id="
|
|
2493
|
+
<h3 class="signature " id="sorting_in_filter_select_opts-instance_method">
|
|
2608
2494
|
|
|
2609
|
-
#<strong>
|
|
2495
|
+
#<strong>sorting_in_filter_select_opts</strong> ⇒ <tt>Object</tt> <span class="extras">(protected)</span>
|
|
2610
2496
|
|
|
2611
2497
|
|
|
2612
2498
|
|
|
@@ -2615,26 +2501,13 @@
|
|
|
2615
2501
|
</h3><div class="docstring">
|
|
2616
2502
|
<div class="discussion">
|
|
2617
2503
|
|
|
2618
|
-
<p>Returns
|
|
2504
|
+
<p>Returns the select options for sorting suitable for passing in a <code>f.select</code>. Used in sorting-in-filter feature. Useful for custom subclasses of List.</p>
|
|
2619
2505
|
|
|
2620
2506
|
|
|
2621
2507
|
</div>
|
|
2622
2508
|
</div>
|
|
2623
2509
|
<div class="tags">
|
|
2624
2510
|
|
|
2625
|
-
<p class="tag_title">Returns:</p>
|
|
2626
|
-
<ul class="return">
|
|
2627
|
-
|
|
2628
|
-
<li>
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
</li>
|
|
2636
|
-
|
|
2637
|
-
</ul>
|
|
2638
2511
|
|
|
2639
2512
|
</div><table class="source_code">
|
|
2640
2513
|
<tr>
|
|
@@ -2642,15 +2515,27 @@
|
|
|
2642
2515
|
<pre class="lines">
|
|
2643
2516
|
|
|
2644
2517
|
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2518
|
+
412
|
|
2519
|
+
413
|
|
2520
|
+
414
|
|
2521
|
+
415
|
|
2522
|
+
416
|
|
2523
|
+
417
|
|
2524
|
+
418
|
|
2525
|
+
419
|
|
2526
|
+
420</pre>
|
|
2648
2527
|
</td>
|
|
2649
2528
|
<td>
|
|
2650
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2529
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 412</span>
|
|
2651
2530
|
|
|
2652
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
2653
|
-
<span class='id identifier
|
|
2531
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_in_filter_select_opts'>sorting_in_filter_select_opts</span>
|
|
2532
|
+
<span class='ivar'>@sorts</span><span class='period'>.</span><span class='id identifier rubyid_flat_map'>flat_map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_sort'>sort</span><span class='op'>|</span>
|
|
2533
|
+
<span class='qwords_beg'>%w[</span><span class='tstring_content'>asc</span><span class='words_sep'> </span><span class='tstring_content'>desc</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_order'>order</span><span class='op'>|</span>
|
|
2534
|
+
<span class='id identifier rubyid_label'>label</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sort'>sort</span><span class='lbracket'>[</span><span class='symbol'>:label</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_order'>order</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>asc</span><span class='tstring_end'>'</span></span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>↑</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>↓</span><span class='tstring_end'>'</span></span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
2535
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sort'>sort</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_order'>order</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
2536
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span>
|
|
2537
|
+
<span class='kw'>end</span>
|
|
2538
|
+
<span class='kw'>end</span>
|
|
2654
2539
|
<span class='kw'>end</span></pre>
|
|
2655
2540
|
</td>
|
|
2656
2541
|
</tr>
|
|
@@ -2658,9 +2543,9 @@
|
|
|
2658
2543
|
</div>
|
|
2659
2544
|
|
|
2660
2545
|
<div class="method_details ">
|
|
2661
|
-
<h3 class="signature " id="
|
|
2546
|
+
<h3 class="signature " id="sorting_links-instance_method">
|
|
2662
2547
|
|
|
2663
|
-
#<strong>
|
|
2548
|
+
#<strong>sorting_links</strong>(new_sorting_links) ⇒ <tt>Object</tt>
|
|
2664
2549
|
|
|
2665
2550
|
|
|
2666
2551
|
|
|
@@ -2669,7 +2554,7 @@
|
|
|
2669
2554
|
</h3><div class="docstring">
|
|
2670
2555
|
<div class="discussion">
|
|
2671
2556
|
|
|
2672
|
-
<p>
|
|
2557
|
+
<p>DSL method Enables or disables sorting links.</p>
|
|
2673
2558
|
|
|
2674
2559
|
|
|
2675
2560
|
</div>
|
|
@@ -2683,27 +2568,15 @@
|
|
|
2683
2568
|
<pre class="lines">
|
|
2684
2569
|
|
|
2685
2570
|
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
420
|
|
2690
|
-
421
|
|
2691
|
-
422
|
|
2692
|
-
423
|
|
2693
|
-
424
|
|
2694
|
-
425</pre>
|
|
2571
|
+
91
|
|
2572
|
+
92
|
|
2573
|
+
93</pre>
|
|
2695
2574
|
</td>
|
|
2696
2575
|
<td>
|
|
2697
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2576
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 91</span>
|
|
2698
2577
|
|
|
2699
|
-
<span class='kw'>def</span> <span class='id identifier
|
|
2700
|
-
<span class='ivar'>@
|
|
2701
|
-
<span class='qwords_beg'>%w[</span><span class='tstring_content'>asc</span><span class='words_sep'> </span><span class='tstring_content'>desc</span><span class='tstring_end'>]</span></span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_order'>order</span><span class='op'>|</span>
|
|
2702
|
-
<span class='id identifier rubyid_label'>label</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sort'>sort</span><span class='lbracket'>[</span><span class='symbol'>:label</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_order'>order</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>asc</span><span class='tstring_end'>'</span></span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>↑</span><span class='tstring_end'>'</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>↓</span><span class='tstring_end'>'</span></span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
2703
|
-
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_sort'>sort</span><span class='lbracket'>[</span><span class='symbol'>:name</span><span class='rbracket'>]</span><span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_order'>order</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
2704
|
-
<span class='lbracket'>[</span><span class='id identifier rubyid_label'>label</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rbracket'>]</span>
|
|
2705
|
-
<span class='kw'>end</span>
|
|
2706
|
-
<span class='kw'>end</span>
|
|
2578
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_links'>sorting_links</span><span class='lparen'>(</span><span class='id identifier rubyid_new_sorting_links'>new_sorting_links</span><span class='rparen'>)</span>
|
|
2579
|
+
<span class='ivar'>@sorting_links</span> <span class='op'>=</span> <span class='op'>!</span><span class='op'>!</span><span class='id identifier rubyid_new_sorting_links'>new_sorting_links</span>
|
|
2707
2580
|
<span class='kw'>end</span></pre>
|
|
2708
2581
|
</td>
|
|
2709
2582
|
</tr>
|
|
@@ -2749,15 +2622,15 @@
|
|
|
2749
2622
|
<pre class="lines">
|
|
2750
2623
|
|
|
2751
2624
|
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2625
|
+
402
|
|
2626
|
+
403
|
|
2627
|
+
404</pre>
|
|
2755
2628
|
</td>
|
|
2756
2629
|
<td>
|
|
2757
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2630
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 402</span>
|
|
2758
2631
|
|
|
2759
2632
|
<span class='kw'>def</span> <span class='id identifier rubyid_sorting_links_enabled?'>sorting_links_enabled?</span>
|
|
2760
|
-
<span class='id identifier rubyid_sorting_enabled?'>sorting_enabled?</span> <span class='op'>&&</span> <span class='ivar'>@sorting_links</span>
|
|
2633
|
+
<span class='id identifier rubyid_sorting_enabled?'>sorting_enabled?</span> <span class='op'>&&</span> <span class='ivar'>@sorting_links</span> <span class='op'>&&</span> <span class='op'>!</span><span class='ivar'>@skip_sorting_links</span>
|
|
2761
2634
|
<span class='kw'>end</span></pre>
|
|
2762
2635
|
</td>
|
|
2763
2636
|
</tr>
|
|
@@ -2790,12 +2663,12 @@
|
|
|
2790
2663
|
<pre class="lines">
|
|
2791
2664
|
|
|
2792
2665
|
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2666
|
+
228
|
|
2667
|
+
229
|
|
2668
|
+
230</pre>
|
|
2796
2669
|
</td>
|
|
2797
2670
|
<td>
|
|
2798
|
-
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line
|
|
2671
|
+
<pre class="code"><span class="info file"># File 'lib/compony/components/list.rb', line 228</span>
|
|
2799
2672
|
|
|
2800
2673
|
<span class='kw'>def</span> <span class='id identifier rubyid_sorts'>sorts</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span>
|
|
2801
2674
|
<span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_name'>name</span><span class='op'>|</span> <span class='id identifier rubyid_sort'>sort</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>**</span><span class='rparen'>)</span> <span class='rbrace'>}</span>
|
|
@@ -2810,7 +2683,7 @@
|
|
|
2810
2683
|
</div>
|
|
2811
2684
|
|
|
2812
2685
|
<div id="footer">
|
|
2813
|
-
Generated on
|
|
2686
|
+
Generated on Mon Dec 8 15:19:20 2025 by
|
|
2814
2687
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
2815
2688
|
0.9.34 (ruby-3.3.5).
|
|
2816
2689
|
</div>
|