Compare commits

..
Author SHA1 Message Date
Akinwale Ariwodola 60580adb0b doc updates per review 2018-08-09 21:28:14 +01:00
Akinwale Ariwodola 3363bd1cb9 Update README.md with installation instructions. 2018-08-06 12:36:38 +01:00
7 changed files with 246 additions and 242 deletions

No files matched your search

Generated
+213 -215
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -163,11 +163,11 @@ CREATE TABLE `TransactionsAddresses`
`AddressId` BIGINT UNSIGNED NOT NULL,
`DebitAmount` DECIMAL(18,8) DEFAULT 0 NOT NULL COMMENT 'Sum of the inputs to this address for the tx',
`CreditAmount` DECIMAL(18,8) DEFAULT 0 NOT NULL COMMENT 'Sum of the outputs to this address for the tx',
`TransactionTime` DATETIME DEFAULT UTC_TIMESTAMP() NOT NULL,
`LatestTransactionTime` DATETIME DEFAULT UTC_TIMESTAMP() NOT NULL,
PRIMARY KEY `PK_TransactionAddress` (`TransactionId`, `AddressId`),
FOREIGN KEY `Idx_TransactionsAddressesTransaction` (`TransactionId`) REFERENCES `Transactions` (`Id`),
FOREIGN KEY `Idx_TransactionsAddressesAddress` (`AddressId`) REFERENCES `Addresses` (`Id`),
INDEX `Idx_TransactionsAddressesTransactionTime` (`TransactionTime`),
INDEX `Idx_TransactionsAddressesLatestTransactionTime` (`LatestTransactionTime`),
INDEX `Idx_TransactionsAddressesDebit` (`DebitAmount`),
INDEX `Idx_TransactionsAddressesCredit` (`CreditAmount`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
-4
View File
@@ -452,8 +452,6 @@ class MainController extends AppController {
$this->loadModel('Transactions');
$this->loadModel('Inputs');
$this->loadModel('Outputs');
$this->loadModel('Claims');
$sourceAddress = $this->request->query('address');
$tx = $this->Transactions->find()->select(
@@ -477,8 +475,6 @@ class MainController extends AppController {
$outputs[$i]->IsClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'CLAIM') > -1);
$outputs[$i]->IsSupportClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'SUPPORT_CLAIM') > -1);
$outputs[$i]->IsUpdateClaim = (strpos($outputs[$i]->ScriptPubKeyAsm, 'UPDATE_CLAIM') > -1);
$claim = $this->Claims->find()->where(['TransactionHash' => $tx->Hash, 'Vout' => $outputs[$i]->Vout])->first();
$outputs[$i]->Claim = $claim;
}
$totalIn = 0;
+1 -13
View File
@@ -5,19 +5,7 @@ namespace App\Model\Entity;
use Cake\ORM\Entity;
class Claim extends Entity {
function getLbryLink() {
$link = $this->Name;
if (isset($this->Publisher->Name)) {
$link = $this->Publisher->Name . '/' . $link;
}
$link = 'lbry://' . $link;
return $link;
}
function getExplorerLink() {
$link = '/claims/' . $this->ClaimId;
return $link;
}
}
?>
?>
+30 -6
View File
@@ -40,6 +40,14 @@
$a = ['purple', 'orange', 'blue', 'teal', 'green', 'yellow'];
$autoThumbText = '';
$link = $claim->Name;
$rawLink = $claim->Name;
if (isset($claim->Publisher->Name)) {
$link = urlencode($claim->Publisher->Name) . '/' . $link;
$rawLink = $claim->Publisher->Name . '/' . $rawLink;
}
$link = 'lbry://' . $link;
$rawLink = 'lbry://' . $rawLink;
if ($claim->ClaimType == 1) { $autoThumbText = strtoupper(substr($claim->Name, 1, min( strlen($claim->Name), 10 ))); } else {
$str = str_replace(' ', '', (strlen(trim($claim->Title)) > 0) ? $claim->Title : $claim->Name);
$autoThumbText = strtoupper(mb_substr($str, 0, min( strlen($str), 10 )));
@@ -73,7 +81,7 @@ if (strlen(trim($desc)) == 0) {
<div class="claim-info">
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
<img src="<?php echo $claim->ThumbnailUrl ?>" alt="" />
<?php else: ?>
<div class="autothumb"><?php echo $autoThumbText ?></div>
<?php endif; ?>
@@ -136,7 +144,7 @@ if (strlen(trim($desc)) == 0) {
<div class="value half-width"><?php echo strlen(trim($claim->Language)) > 0 ? ($claim->Language == 'en' ? 'English' : '') : '<em>Unspecified</em>' ?></div>
</div>
<?php endif; ?>
<a href="<?php echo $claim->getLbryLink() ?>" class="open-lbry-link">Open in LBRY</a>
<a href="<?php echo $link ?>" class="open-lbry-link">Open in LBRY</a>
</div>
<div class="clear"></div>
@@ -157,6 +165,14 @@ if (strlen(trim($desc)) == 0) {
}
$autoThumbText = '';
$link = $claim->Name;
$rawLink = $claim->Name;
if (isset($claim->Publisher->Name)) {
$link = urlencode($claim->Publisher->Name) . '/' . $link;
$rawLink = $claim->Publisher->Name . '/' . $rawLink;
}
$link = 'lbry://' . $link;
$rawLink = 'lbry://' . $rawLink;
$cost = '';
if (isset($claim->Price) && $claim->Price > 0) {
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
@@ -200,7 +216,7 @@ if (strlen(trim($desc)) == 0) {
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
<img src="<?php echo $claim->ThumbnailUrl ?>" alt="" />
<?php else: ?>
<div class="autothumb"><?php echo $autoThumbText ?></div>
<?php endif; ?>
@@ -208,7 +224,7 @@ if (strlen(trim($desc)) == 0) {
<div class="metadata">
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
<div class="link" title="<?php echo $rawLink ?>"><a href="<?php echo $link ?>" rel="nofollow"><?php echo $rawLink ?></a></div>
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
@@ -275,6 +291,14 @@ if (strlen(trim($desc)) == 0) {
$row++;
}
$autoThumbText = '';
$link = $claim->Name;
$rawLink = $claim->Name;
if (isset($claim->Publisher->Name)) {
$link = urlencode($claim->Publisher->Name) . '/' . $link;
$rawLink = $claim->Publisher->Name . '/' . $rawLink;
}
$link = 'lbry://' . $link;
$rawLink = 'lbry://' . $rawLink;
$cost = '';
if (isset($claim->Price) && $claim->Price > 0) {
$cost = $this->Amount->formatCurrency($claim->Price) . ' LBC';
@@ -318,7 +342,7 @@ if (strlen(trim($desc)) == 0) {
<div data-autothumb="<?php echo $autoThumbText ?>" class="thumbnail <?php echo $a[mt_rand(0, count($a) - 1)] ?>">
<?php if (!$claim->IsNSFW && strlen(trim($claim->ThumbnailUrl)) > 0): ?>
<img src="<?php echo htmlspecialchars($claim->ThumbnailUrl) ?>" alt="" />
<img src="<?php echo $claim->ThumbnailUrl ?>" alt="" />
<?php else: ?>
<div class="autothumb"><?php echo $autoThumbText ?></div>
<?php endif; ?>
@@ -326,7 +350,7 @@ if (strlen(trim($desc)) == 0) {
<div class="metadata">
<div class="title" title="<?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '') ?>"><?php echo $claim->ClaimType == 1 ? $claim->Name : ((strlen(trim($claim->Title)) > 0) ? $claim->Title : '<em>No Title</em>') ?></div>
<div class="link" title="<?php echo $claim->getLbryLink() ?>"><a href="<?php echo $claim->getLbryLink() ?>" rel="nofollow"><?php echo $claim->getLbryLink() ?></a></div>
<div class="link" title="<?php echo $rawLink ?>"><a href="<?php echo $link ?>" rel="nofollow"><?php echo $rawLink ?></a></div>
<div class="desc"><?php echo strlen(trim($claim->Description)) > 0 ? $claim->Description : '<em>No description available</em>' ?></div>
-1
View File
@@ -136,7 +136,6 @@
foreach ($outputs as $out): ?>
<div id="output-<?php echo $out->Vout ?>" class="output <?php if (isset($out['OutputAddresses']) && count($out['OutputAddresses']) > 0 && $out['OutputAddresses'][0]->Address == $sourceAddress): ?>is-source<?php endif; ?>">
<div class="labels">
<?php if($out->IsClaim or $out->IsSupportClaim or $out->IsUpdateClaim): ?><a class="view-claim" href="<?php echo $out->Claim->getExplorerLink() ?>">View</a><?php endif; ?>
<?php if($out->IsSupportClaim): ?><div class="support">SUPPORT</div><?php endif; ?>
<?php if($out->IsUpdateClaim): ?><div class="update">UPDATE</div><?php endif; ?>
<?php if($out->IsClaim): ?><div class="claim">CLAIM</div><?php endif; ?>
-1
View File
@@ -252,7 +252,6 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi
.tx-details-layout .outputs .output .labels .support { background: #ffeb3b }
.tx-details-layout .outputs .output .labels .update { background: #ea80fc }
.tx-details-layout .outputs .output .labels .claim { background: #76ff03 }
.tx-details-layout .outputs .output .view-claim { font-size: 80%; }
.tx-details-layout .inputs .input .value, .tx-details-layout .outputs .output .value { font-weight: normal }
.tx-details-layout .inputs .input.is-source, .tx-details-layout .outputs .output.is-source { border-right-width: 18px; border-right-color: #1e88e5; background: #e3f2fd }
.tx-details-layout .inputs .input.highlighted, .tx-details-layout .outputs .output.highlighted { background: #f1f8e9 }