Added information to claim page

This commit is contained in:
marcdeb1 2019-04-06 16:07:30 +02:00
parent 428c9d8896
commit 7899669c4b
4 changed files with 30 additions and 9 deletions

View file

@ -169,7 +169,7 @@ class MainController extends AppController {
$this->set('currentPage', $page); $this->set('currentPage', $page);
$this->set('claims', $claims); $this->set('claims', $claims);
} else { } else {
$claim = $this->Claims->find()->select($this->Claims)->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->where(['Claims.claim_id' => $id])->order(['Claims.created_at' => 'DESC'])->first(); $claim = $this->Claims->find()->select($this->Claims)->select(['publisher' => 'C.name'])->leftJoin(['C' => 'claim'], ['C.claim_id = Claims.publisher_id'])->select(['claim_bid' => 'O.value'])->leftJoin(['O' => 'output'], ['Claims.transaction_hash_id = O.transaction_hash AND Claims.vout = O.vout'])->where(['Claims.claim_id' => $id])->order(['Claims.created_at' => 'DESC'])->first();
if (!$claim) { if (!$claim) {
return $this->redirect('/'); return $this->redirect('/');
} }

View file

@ -44,7 +44,7 @@ $cost = 'Free';
if (isset($claim->price) && $claim->price > 0) { if (isset($claim->price) && $claim->price > 0) {
$cost = $this->Amount->formatCurrency($claim->price) . ' LBC'; $cost = $this->Amount->formatCurrency($claim->price) . ' LBC';
} else if (isset($claim->fee) && strtolower($claim->fee_currency) === 'lbc') { } else if (isset($claim->fee) && strtolower($claim->fee_currency) === 'lbc') {
$cost = $this->Amount->formatCurrency($claim->fee) . ' LBC'; $cost = (float) ($claim->fee) . ' LBC';
} }
$desc = $claim->description; $desc = $claim->description;
@ -66,6 +66,10 @@ if (strlen(trim($desc)) == 0) {
<div class="claims-body"> <div class="claims-body">
<div class="claim-info"> <div class="claim-info">
<div class="tags">
<div class="bid-state"><?php echo $claim->bid_state; ?></div>
</div>
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>"> <div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
<?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?> <?php if (!$claim->is_nsfw && strlen(trim($claim->thumbnail_url)) > 0): ?>
<img src="<?php echo htmlspecialchars($claim->thumbnail_url) ?>" alt="" /> <img src="<?php echo htmlspecialchars($claim->thumbnail_url) ?>" alt="" />
@ -101,6 +105,17 @@ if (strlen(trim($desc)) == 0) {
<div class="clear"></div> <div class="clear"></div>
<?php endif; ?> <?php endif; ?>
<div class="half-width"><div class="label help-text" title="The quantity of tokens used to back the stake.">Claim bid</div></div>
<div class="half-width"><div class="label help-text" title="The sum of the claim bid and all of its active supports.">Effective amount</div></div>
<div class="value half-width"><?php echo (float) ($claim->claim_bid) . ' LBC'; ?></div>
<div class="value half-width"><?php echo (float) ($claim->effective_amount / 100000000) . ' LBC'; ?></div>
<div class="clear"></div>
<div class="label help-text" title="A unique identifier that is used to locate and fetch the content from the data network.">Stream hash</div>
<div class="value"><?php echo $claim->sd_hash ?></div>
</div> </div>
</div> </div>

View file

@ -19,7 +19,12 @@
<div class="tx-time"> <div class="tx-time">
<?php <?php
$created_time = (abs($tx->transaction_time - strtotime($tx->created_at)) > 3600) ? $tx->transaction_time : $tx->created_at; $transaction_time = \DateTime::createFromFormat('U', $tx->transaction_time);
if($tx->transaction_time == null || strlen(trim($tx->transaction_time)) == 0) {
$created_time = $tx->created_at;
} else {
$created_time = (abs($tx->transaction_time - strtotime($tx->created_at)) > 3600) ? $transaction_time : $tx->created_at;
}
?> ?>
<div class="created-time"> <div class="created-time">
<h3 title="Represents the time this transaction was created on the explorer">Time Created</h3> <h3 title="Represents the time this transaction was created on the explorer">Time Created</h3>
@ -29,7 +34,7 @@
<div class="conf-time"> <div class="conf-time">
<h3 title="The time the first confirmation of this transaction happened on the blockchain">Block Time</h3> <h3 title="The time the first confirmation of this transaction happened on the blockchain">Block Time</h3>
<div><?php echo ($tx->transaction_time == null || strlen(trim($tx->transaction_time)) == 0) ? '<em>Not yet confirmed</em>' : <div><?php echo ($tx->transaction_time == null || strlen(trim($tx->transaction_time)) == 0) ? '<em>Not yet confirmed</em>' :
\DateTime::createFromFormat('U', $tx->transaction_time)->format('j M Y H:i:s') . ' UTC' ?> $transaction_time->format('j M Y H:i:s') . ' UTC' ?>
<?php if ($tx->transaction_time > $tx->created_at->getTimestamp()): <?php if ($tx->transaction_time > $tx->created_at->getTimestamp()):
$diffSeconds = $tx->transaction_time - $tx->created_at->getTimestamp(); $diffSeconds = $tx->transaction_time - $tx->created_at->getTimestamp();

View file

@ -69,7 +69,7 @@ border-radius: 0 8px 8px 0 }
.claims-grid .claim-grid-item.last-item { margin-right: 0 } .claims-grid .claim-grid-item.last-item { margin-right: 0 }
.claims-grid .claim-grid-item.last-row { margin-bottom: 0 } .claims-grid .claim-grid-item.last-row { margin-bottom: 0 }
.claims-grid .claim-grid-item .price-tag { font-size: 65%; position: absolute; left: 0; top: 0; z-index: 505; background: #155b4a; color: #fff; text-align: center; padding: 4px 12px } .claims-grid .claim-grid-item .price-tag { font-size: 65%; position: absolute; left: 0; top: 0; z-index: 505; background: #155b4a; color: #fff; text-align: center; padding: 4px 12px }
.claims-grid .claim-grid-item .tags { font-size: 65%; position: absolute; right: 0; top: 0; z-index: 505 } .claims-grid .claim-grid-item .tags, .claim-info .tags { font-size: 65%; position: absolute; right: 0; top: 0; z-index: 505 }
.claims-grid .claim-grid-item .thumbnail { width: 100%; height: 200px; background: #f0f0f0; display: block; position: relative; overflow: hidden;} .claims-grid .claim-grid-item .thumbnail { width: 100%; height: 200px; background: #f0f0f0; display: block; position: relative; overflow: hidden;}
.claims-grid .claim-grid-item .thumbnail img { width: 100%; position: absolute; left: 0; top: 0; border-bottom: 1px solid #eee } .claims-grid .claim-grid-item .thumbnail img { width: 100%; position: absolute; left: 0; top: 0; border-bottom: 1px solid #eee }
.claims-grid .claim-grid-item .thumbnail.purple { background: #ab47bc } .claims-grid .claim-grid-item .thumbnail.purple { background: #ab47bc }
@ -79,9 +79,9 @@ border-radius: 0 8px 8px 0 }
.claims-grid .claim-grid-item .thumbnail.green { background: #66bb6a } .claims-grid .claim-grid-item .thumbnail.green { background: #66bb6a }
.claims-grid .claim-grid-item .thumbnail.yellow { background: #fdd835 } .claims-grid .claim-grid-item .thumbnail.yellow { background: #fdd835 }
.claims-grid .claim-grid-item .thumbnail .autothumb { display: block; margin: 73px auto 0 auto; text-align: center; font-size: 240%; color: #fff; line-height: 54px } .claims-grid .claim-grid-item .thumbnail .autothumb { display: block; margin: 73px auto 0 auto; text-align: center; font-size: 240%; color: #fff; line-height: 54px }
.claims-grid .claim-grid-item .tags > div { display: inline-block; padding: 4px 12px; margin-left: 2px } .claims-grid .claim-grid-item .tags > div, .claim-info .tags > div { display: inline-block; padding: 4px 12px; margin-left: 2px }
.claims-grid .claim-grid-item .tags .nsfw { background: #e53935; text-align: center; color: #fff; position: relative; left: 1px } .claims-grid .claim-grid-item .tags .nsfw { background: #e53935; text-align: center; color: #fff; position: relative; left: 1px }
.claims-grid .claim-grid-item .tags .bid-state { background: #551CA1; text-align: center; color: #fff; } .claims-grid .claim-grid-item .tags .bid-state, .claim-info .bid-state { background: #551CA1; text-align: center; color: #fff; }
.claims-grid .claim-grid-item .tags .content-type { background: #880e4f; text-align: center; color: #fff; } .claims-grid .claim-grid-item .tags .content-type { background: #880e4f; text-align: center; color: #fff; }
.claims-grid .claim-grid-item .metadata { padding: 24px; font-size: 90% } .claims-grid .claim-grid-item .metadata { padding: 24px; font-size: 90% }
.claims-grid .claim-grid-item .title { font-size: 120%; height: 25px; line-height: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap } .claims-grid .claim-grid-item .title { font-size: 120%; height: 25px; line-height: 25px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
@ -95,11 +95,12 @@ border-radius: 0 8px 8px 0 }
.claims-grid .claim-grid-item .spacer { height: 16px } .claims-grid .claim-grid-item .spacer { height: 16px }
.claims-body { width: 1200px; margin: 0 auto 0 auto; cursor: default } .claims-body { width: 1200px; margin: 0 auto 0 auto; cursor: default }
.claims-body .claim-info { width: 400px; float: left; /*box-shadow: 0 2px 4px rgba(0,0,0,.175);*/ border: 1px solid rgba(0,0,0,.15); cursor: default } .claims-body .claim-info { position: relative; width: 400px; float: left; /*box-shadow: 0 2px 4px rgba(0,0,0,.175);*/ border: 1px solid rgba(0,0,0,.15); cursor: default }
.claims-body .claim-info .thumbnail { width: 100%; height: 220px; background: #f0f0f0; display: block; position: relative; overflow: hidden } .claims-body .claim-info .thumbnail { width: 100%; height: 220px; background: #f0f0f0; display: block; position: relative; overflow: hidden }
.claims-body .claim-info .thumbnail img { width: 100% } .claims-body .claim-info .thumbnail img { width: 100% }
.claims-body .claim-info .content { padding: 24px } .claims-body .claim-info .content { padding: 24px }
.claims-body .claim-info .content .label { font-size: inherit; text-decoration: underline; color: #666666 } .claims-body .claim-info .content .label { display: inline; font-size: inherit; text-decoration: underline; color: #666666 }
.claims-body .claim-info .content .help-text { text-decoration: underline dotted grey; cursor: help; }
.claims-body .claim-info .content .value { font-weight: 300; margin-bottom: 24px; word-break: break-word; word-wrap: break-word } .claims-body .claim-info .content .value { font-weight: 300; margin-bottom: 24px; word-break: break-word; word-wrap: break-word }
.claims-body .claim-info .content .value:last-child { margin-bottom: 0 } .claims-body .claim-info .content .value:last-child { margin-bottom: 0 }
.claims-body .claim-info .content .half-width { width: 50%; float: left } .claims-body .claim-info .content .half-width { width: 50%; float: left }