]>
Commit | Line | Data |
---|---|---|
90dc8f2b | 1 | <?php |
c06c1713 | 2 | require_once "../inc/common.php"; |
c06c1713 | 3 | require_once "../inc/header.php"; |
90dc8f2b VP |
4 | |
5 | if (!empty($_POST)) | |
6 | { | |
7 | do_log($_POST); | |
8 | ||
9 | /* Nothing being posted yet */ | |
10 | ||
11 | } | |
12 | ||
90dc8f2b | 13 | ?> |
0d846731 | 14 | <h4>Channels Overview</h4><br> |
5a054690 | 15 | |
bf719cce BM |
16 | <!-- The channel list --> |
17 | <table id="data_list" class="table-striped display responsive nowrap" style="width:100%"> | |
c69491f1 | 18 | <thead class="table-primary"> |
bf719cce BM |
19 | <th scope="col">Name</th> |
20 | <th scope="col">Users</th> | |
21 | <th scope="col">Modes</th> | |
22 | <th scope="col">Topic</th> | |
23 | <th scope="col">Created</th> | |
24 | </thead> | |
def32bb1 | 25 | </table> |
bf719cce | 26 | |
638559e7 | 27 | <script> |
bf719cce BM |
28 | let data_list_table = null; |
29 | ||
30 | $(document).ready( function () { | |
31 | args = { | |
32 | 'responsive': true, | |
33 | 'fixedHeader': { | |
34 | header: true, | |
35 | headerOffset: 53 | |
36 | }, | |
37 | 'ajax': { | |
38 | 'url': '<?php echo get_config("base_url"); ?>api/channels.php', | |
39 | dataSrc: '' | |
40 | }, | |
41 | 'pageLength':100, | |
42 | 'order':[[1,'desc']], | |
43 | 'columns': [ | |
44 | { 'data': 'Name', 'responsivePriority': 1, 'className':'virtuallink' }, | |
45 | { 'data': 'Users', 'responsivePriority': 2 }, | |
46 | { 'data': 'Modes', 'responsivePriority': 3 }, | |
47 | { 'data': 'Topic', 'responsivePriority': 5, 'className':'tdwrap' }, | |
48 | { 'data': 'Created', 'responsivePriority': 4 }, | |
49 | ], | |
50 | }; | |
51 | /* Hide on mobile */ | |
52 | if (window.innerWidth > 8000) | |
638559e7 | 53 | { |
bf719cce BM |
54 | args['dom'] = 'Pfrtip'; |
55 | args['searchPanes'] = { | |
56 | 'initCollapsed': 'true', | |
57 | 'columns': [1,3], | |
58 | 'dtOpts': { | |
59 | select: { style: 'multi'}, | |
60 | order: [[ 1, "desc" ]] | |
61 | }, | |
638559e7 | 62 | } |
bf719cce | 63 | } |
638559e7 | 64 | |
bf719cce BM |
65 | data_list_table = $('#data_list').DataTable(args); |
66 | ||
67 | $('#data_list').on( 'click', 'td', function () { | |
68 | show_channel(this); | |
69 | } ); | |
70 | } ); | |
71 | ||
72 | function show_channel(e) | |
73 | { | |
74 | /* The first column is the 'Select' column */ | |
75 | // not on this page, or not yet ;) | |
76 | //if (data_list_table.cell(e).index().column == 0) | |
77 | // return; | |
78 | ||
79 | /* For all the other columns we show the view screen */ | |
80 | var data = data_list_table.row(e).data(); | |
81 | channel = data['Name']; | |
9b71952e | 82 | window.location = '<?php echo get_config('base_url'); ?>channels/details.php?chan=' + |
bf719cce BM |
83 | encodeURIComponent(channel); |
84 | // not working: still expands on mobile: e.stopImmediatePropagation(); | |
85 | return true; | |
86 | } | |
638559e7 | 87 | |
638559e7 | 88 | </script> |
bf719cce BM |
89 | |
90 | <?php require_once UPATH.'/inc/footer.php'; ?> |