View | Details | Raw Unified | Return to bug 41135
Collapse All | Expand All

(-)a/about.pl (-23 / +1 lines)
Lines 654-682 if ( $tab eq 'perl' ) { Link Here
654
654
655
    @components = sort { $a->{'name'} cmp $b->{'name'} } @components;
655
    @components = sort { $a->{'name'} cmp $b->{'name'} } @components;
656
656
657
    my $counter = 0;
657
    $template->param( table => \@components );
658
    my $row     = [];
659
    my $table   = [];
660
    foreach (@components) {
661
        push( @$row, $_ );
662
        unless ( ++$counter % 4 ) {
663
            push( @$table, { row => $row } );
664
            $row = [];
665
        }
666
    }
667
668
    # Processing the last line (if there are any modules left)
669
    if ( scalar(@$row) > 0 ) {
670
671
        # Extending $row to the table size
672
        $$row[3] = '';
673
674
        # Pushing the last line
675
        push( @$table, { row => $row } );
676
    }
677
    ## ## $table
678
679
    $template->param( table => $table );
680
658
681
}
659
}
682
660
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt (-39 / +96 lines)
Lines 17-22 Link Here
17
    .version-ellipsis {
17
    .version-ellipsis {
18
        text-decoration: underline;
18
        text-decoration: underline;
19
    }
19
    }
20
    #dt-info {
21
        display: flex;
22
    }
23
    .filter_controls {
24
        margin-top: 0.25em;
25
    }
20
</style>
26
</style>
21
</head>
27
</head>
22
<body id="about_about" class="about">
28
<body id="about_about" class="about">
Lines 85-90 Link Here
85
</div>
91
</div>
86
<!-- /.main.container-fluid -->
92
<!-- /.main.container-fluid -->
87
93
94
[% MACRO jsinclude BLOCK %]
95
    [% INCLUDE 'datatables.inc' %]
96
    <script>
97
        $(document).ready(function () {
98
            let perl_table = $("#perl_table").kohaTable({
99
                autoWidth: false,
100
                paging: false,
101
                columns: [null, { width: "10%" }, { width: "10%" }, { width: "10%" }, null],
102
                dom: '<"#dt-info"i><"top pager"<"table_entries"lp><"table_controls"fB>>tr<"bottom pager"i>',
103
                initComplete: function (settings, json) {
104
                    $("#dt-info").append(
105
                        '<div class="filter_controls"><a id="show_all" class="btn btn-link filter_table" href="#">Show all</a> | <a id="show_required_modules" class="btn btn-link filter_table" href="#"><i class="fa fa-asterisk"></i> Show required</a> | <a id="show_missing_modules" class="btn btn-link filter_table" href="#"><i class="fa fa-question"></i> Show missing</a></div>'
106
                    );
107
                },
108
            });
109
110
            $("body").on("click", ".filter_table", function (e) {
111
                e.preventDefault();
112
                perl_table.DataTable().column(1).search("").draw();
113
                perl_table.DataTable().column(4).search("").draw();
114
                if ($(this)[0].id == "show_required_modules") {
115
                    perl_table.DataTable().column(1).search(1).draw();
116
                } else if ($(this)[0].id == "show_missing_modules") {
117
                    perl_table.DataTable().column(4).search(1).draw();
118
                } else {
119
                    perl_table.DataTable().column(1).search("").draw();
120
                    perl_table.DataTable().column(4).search("").draw();
121
                }
122
            });
123
        });
124
    </script>
125
[% END %]
126
88
[% INCLUDE 'intranet-bottom.inc' %]
127
[% INCLUDE 'intranet-bottom.inc' %]
89
128
90
[% BLOCK about_panel %]
129
[% BLOCK about_panel %]
Lines 275-325 Link Here
275
314
276
[% BLOCK perl_panel %]
315
[% BLOCK perl_panel %]
277
    [% WRAPPER tab_panel tabname= "perl" bt_active = 1 %]
316
    [% WRAPPER tab_panel tabname= "perl" bt_active = 1 %]
278
        <table style="cursor:pointer">
317
        <h2>Perl modules</h2>
279
            <caption>Perl modules</caption>
318
        <table id="perl_table" style="cursor:pointer">
280
            [% FOREACH line IN table %]
319
            <caption class="visually-hidden">Perl modules</caption>
320
            <thead>
281
                <tr>
321
                <tr>
282
                    [% FOREACH ro IN line.row %]
322
                    <th>Module</th>
283
                        [% IF ( ro.require ) %]
323
                    <th>Required</th>
284
                            [% SET th_font_weight = "bold" %]
324
                    <th>Current version</th>
325
                    <th>Minimum version</th>
326
                    <th>Status</th>
327
                </tr>
328
            </thead>
329
            <tbody>
330
                [% FOREACH line IN table %]
331
                    <tr>
332
                        <td>
333
                            [% IF ( line.require ) %]
334
                                <strong>[% line.name | html %]</strong>
335
                            [% ELSE %]
336
                                [% line.name | html %]
337
                            [% END %]
338
                        </td>
339
                        [% IF ( line.require ) %]
340
                            <td data-search="1" data-sort="1">
341
                                <i class="fa fa-check"></i>
342
                            </td>
285
                        [% ELSE %]
343
                        [% ELSE %]
286
                            [% SET th_font_weight = "normal" %]
344
                            <td data-search="0" data-sort="0"></td>
287
                        [% END %]
345
                        [% END %]
288
                        [% IF ( ro.current ) %]
346
289
                            [% SET th_background_color = "" %]
347
                        [% IF ( line.name == '' ) %]
290
                            [% SET th_title = t("Module current") %]
291
                        [% ELSIF ( ro.upgrade ) %]
292
                            [% SET th_background_color = "#FFCB2F" %]
293
                            [% SET th_title = t("Module upgrade needed") %]
294
                        [% ELSE %]
295
                            [% IF ( ro.require ) %]
296
                                [% SET th_background_color = "#FF8A8A" %]
297
                                [% SET th_title = t("Required module missing") %]
298
                            [% ELSIF ( ro.name != '' ) %]
299
                                [% SET th_background_color = "#FF8A8A" %]
300
                                [% SET th_title = t("Optional module missing") %]
301
                            [% END %]
302
                        [% END # /IF ro.current %]
303
                        <th scope="row" style="background-color:[% th_background_color | html %];font-weight:[% th_font_weight | html %];" title="[% th_title | html %]">
304
                            [% IF ( ro.name ) %]
305
                                [% ro.name | html %]
306
                                <span style="font-weight:normal; font-size:smaller">
307
                                    ([% ro.reqversion | html %]
308
                                    [% IF ro.maxversion %]- [% ro.maxversion | html %][% END %]
309
                                    [% IF ro.excversion %][% FOR v IN ro.excversion %], ![% v | html %][% END %][% END %])
310
                                </span>
311
                            [% END %]
312
                        </th>
313
                        [% IF ( ro.name == '' ) %]
314
                            <td></td>
348
                            <td></td>
315
                        [% ELSIF ( ro.version ) %]
349
                        [% ELSIF ( line.version ) %]
316
                            <td>[% ro.version | html %]</td>
350
                            <td>[% line.version | html %]</td>
317
                        [% ELSE %]
351
                        [% ELSE %]
318
                            <td style="font-weight:bold">Not Installed</td>
352
                            <td style="font-weight:bold">Not Installed</td>
319
                        [% END %]
353
                        [% END %]
320
                    [% END # /FOREACH ro %]
354
                        <td>
321
                </tr>
355
                            <span>
322
            [% END # /FOREACH line %]
356
                                [% line.reqversion | html %]
357
                                [% IF line.maxversion %]- [% line.maxversion | html %][% END %]
358
                                [% IF line.excversion %]
359
                                    [% FOR v IN line.excversion %]
360
                                        , ![% v | html %]
361
                                    [% END %]
362
                                [% END %]
363
                            </span>
364
                        </td>
365
                        <td [% IF ( !line.current && !line.upgrade ) %]data-search="1"[% ELSE %]data-search="0"[% END %]>
366
                            [% IF ( line.current ) %]
367
                                <span class="badge text-bg-info">Module current</span>
368
                            [% ELSIF ( line.upgrade ) %]
369
                                <span class="badge text-bg-info">Module upgrade needed</span>
370
                            [% ELSE %]
371
                                [% IF ( line.require ) %]
372
                                    <span class="badge text-bg-danger">Required module missing</span>
373
                                [% ELSIF ( line.name != '' ) %]
374
                                    <span class="badge text-bg-warning">Optional module missing</span>
375
                                [% END %]
376
                            [% END # /IF line.current %]
377
                        </td>
378
                    </tr>
379
                [% END %]
380
            </tbody>
323
        </table>
381
        </table>
324
    [% END # tab=perl %]
382
    [% END # tab=perl %]
325
[% END %]
383
[% END %]
326
- 

Return to bug 41135