From 28da08d8c65bc15de38d0538a0360e4b60fcc70e Mon Sep 17 00:00:00 2001 From: Lem Smyth Date: Thu, 17 Feb 2022 22:23:08 -0600 Subject: [PATCH] channel list to table --- admin/css/lbry-admin.css | 35 ++++++++++++++++++ classes/LBRY_Admin.php | 77 ++++++++++++++++++++++++---------------- 2 files changed, 82 insertions(+), 30 deletions(-) diff --git a/admin/css/lbry-admin.css b/admin/css/lbry-admin.css index c52f3c3..3591f74 100644 --- a/admin/css/lbry-admin.css +++ b/admin/css/lbry-admin.css @@ -86,3 +86,38 @@ .lbry-meta-bx-content-last { padding: .2em .8em 1em .1em; } + +table.lbry-channel-table { + width: 100%; + border-collapse: collapse; + font-family: Georgia; +} + +.lbry-channel-table th, .lbry-channel-table td { + padding: 1em 2em; + border: 2px solid #fff; + background: #fbd7b4; + font-size: 1.1em; +} +.lbry-channel-table thead th { + padding: .5em 2em; + background: #f69546; + text-align: left; + font-weight: normal; + font-size: 1.2em; + color: #fff; +} +.lbry-channel-table tbody tr:nth-child(odd) *:nth-child(even), .lbry-channel-table tbody tr:nth-child(even) *:nth-child(odd) { + background: #f3eddd; +} +.lbry-channel-table tfoot th { + padding: .5em 2em; + background: #f69546; + text-align: left; + font-weight: normal; + font-size: .9em; + color: #fff; +} +.lbry-channel-table tr *:nth-child(3), .lbry-channel-table tr *:nth-child(4) { + /* text-align: right; */ +} \ No newline at end of file diff --git a/classes/LBRY_Admin.php b/classes/LBRY_Admin.php index 2ce5fd7..6a34e77 100644 --- a/classes/LBRY_Admin.php +++ b/classes/LBRY_Admin.php @@ -253,39 +253,56 @@ class LBRY_Admin public function available_channels_callback() { $channel_list = LBRY()->daemon->channel_list(); - if ( $channel_list ) { ?> - - -

Looks like you haven't added any channels yet, feel free to do so below:

- + + + Channel + LBRY URL + Posts + Supports + + + + claim_id; + $results = LBRY()->daemon->claim_search( $claim_id ); + $lbry_url = $results->items[0]->canonical_url; + if ( $lbry_url ) { + $open_url = str_replace( 'lbry://', 'open.lbry.com/', $lbry_url ); + } + $support_amount = $results->items[0]->meta->support_amount; + $claims_published = $results->items[0]->meta->claims_in_channel; + if ( ( $support_amount < 0.001 ) ) { + ( $support_amount = '0' ); + } elseif ( ( $support_amount < 0.01 ) && ( $support_amount >= 0.001 ) ) { + ( $support_amount = '<0.01' ); + } elseif ( ( $support_amount <= 0.099 ) && ( $support_amount >= 0.01) ) { + ( $support_amount = number_format( floatval( $support_amount ), 2, '.', '' ) ); + } elseif ( ( $support_amount <= 0.999 ) && ( $support_amount >= 0.1 ) ) { + ( $support_amount = number_format( floatval( $support_amount ), 1, '.', '' ) ); + } else { + ( $support_amount = number_format( intval( $support_amount ) ) ); + } + $init_bid = $results->items[0]->amount; ?> + + name, 'lbrypress' ); ?> + + + + Add + + + + + LBRYPress + + + +

Looks like you haven't added any channels yet, feel free to do so below:

+