refactor credit reports to separate area, standardize urls

This commit is contained in:
Jeremy Kauffman 2017-07-11 19:07:29 -04:00
parent 9f6996c248
commit a54e045f3d
14 changed files with 140 additions and 67 deletions

View file

@ -1,5 +1,6 @@
---
title: "Quarterly Credit Report: Second Quarter 2016"
sheet: https://docs.google.com/spreadsheets/d/1r7puheE4Ut4c08R47uCDZbDdMHAoQa0WDqw470gjMIw/edit#gid=0
category: policy
---
@ -7,10 +8,6 @@ category: policy
This is LBRY's first quarterly report. We enter with zero credits expended. We anticipate zero institutional expenditures, zero or limited organizational expenditures, and light community expenditures.
## Current Balance Sheet
[Available here](https://docs.google.com/spreadsheets/d/1r7puheE4Ut4c08R47uCDZbDdMHAoQa0WDqw470gjMIw/edit#gid=0)
## Overview By Fund
### Community Fund

View file

@ -1,15 +1,12 @@
---
title: "Quarterly Credit Report: Third Quarter 2016"
sheet: https://docs.google.com/spreadsheets/d/1zPG58YuLPqpB3yzypntRWouoEVc4saDOifpnvnwS8Rc/edit?ts=57f28d0e#gid=799352054
category: policy
---
## Summary
This is LBRY's second quarterly report. This quarter we outlaid only 267,778 of the 2,000,000 allocated Community credits. 100,000 operational credits were exchanged with Shapeshift to provide liquidity. No institutional credits were moved or spent.
## Current Balance Sheet
[Available here](https://docs.google.com/spreadsheets/d/1zPG58YuLPqpB3yzypntRWouoEVc4saDOifpnvnwS8Rc/edit?ts=57f28d0e#gid=799352054)
## Overview By Fund
### Community Fund

View file

@ -1,6 +1,7 @@
---
title: "Quarterly Credit Report: Fourth Quarter 2016"
sheet: https://docs.google.com/spreadsheets/d/11nKwFXN3gIQHnE7jYjEK5AFClyAde9aFs6UlnGX3Uzg/edit#gid=799352054
category: policy
---
## Summary
@ -8,10 +9,6 @@ category: policy
This quarter we did not move any community credits from cold storage. We spent 293,604 already moved community credits on line items detailed below. No operational credits were moved or spent. No institutional credits were moved or spent.
As the LBRY protocol performance and reliability has increased, we anticipate increased outlays in Q1 2017. We will be redeeming many if not all beta invites, as well as launching a new program offering credits to developers. We also may begin the first institutional outlays, but any outlays here will be pilot programs and come with spending restrictions.
## Current Balance Sheet
[Available here](https://docs.google.com/spreadsheets/d/11nKwFXN3gIQHnE7jYjEK5AFClyAde9aFs6UlnGX3Uzg/edit#gid=799352054)
## Overview By Fund
### Community Fund
@ -24,7 +21,7 @@ As the LBRY protocol performance and reliability has increased, we anticipate in
-4,345 credits were used for “other” purposes, mostly given to developers
This quarter was a down quarter in credit outlays because we declined to send beta invites to users while the protocol was showing poor reliability.
This quarter was a down quarter in credit outlays because we declined to send beta invites to users while the protocol was showing poor reliability.
As reliability has been increasing, we anticipate inviting many if not all users on the beta waitlist. This will represent a significant uptick in credit outlays, possibly as much as 1-2 million LBC. We will also be launching a new program offering credits to developers.
### Operational Fund

View file

@ -1,5 +1,6 @@
---
title: "Quarterly Credit Report: First Quarter 2017"
sheet: https://docs.google.com/spreadsheets/d/1c-8CR1ro7lKOANHhWhivF7bZ19_ppgCq-d-HD_u43vM/edit#gid=799352054
category: policy
---
## Summary
@ -7,10 +8,6 @@ category: policy
This quarter we moved 3 million community credits from cold storage. We spent 1,186,244 total community credits on line items detailed below. No operational credits were moved or spent. No institutional credits were moved or spent.
As the LBRY protocol performance and reliability has again increased, we anticipate increased outlays in Q2 2017. This will primarily be driven by the redemption of beta invites. We also may begin the first institutional outlays, but any outlays here will be pilot programs and come with spending restrictions.
## Current Balance Sheet
[Available here](https://docs.google.com/spreadsheets/d/1c-8CR1ro7lKOANHhWhivF7bZ19_ppgCq-d-HD_u43vM/edit#gid=799352054)
## Overview By Fund
### Community Fund

View file

@ -1,6 +1,6 @@
---
title: How does the Bounty Program work?
category: policy
category: other
---
You can earn LBRY Credits for completing tasks as part of the LBRY Bounty Program.

View file

@ -1,6 +1,6 @@
---
title: LBRY Credit Policy
category: policy
title: What is LBRY doing with non-mined credits?
category: other
---
LBRY, Inc. controls a significant number of LBRY credits (LBC). At the inception of the blockchain, it was 400,000,000 LBC.
@ -21,14 +21,7 @@ The initial 400m credits are broken down as follows:
LBRY issues a quarterly report every 3 months in January, April, July, and October, covering the preceding 3 full months. These reports outline the corresponding transaction history as the current state of LBRY, Inc.'s balance sheet and anticipated future expenditures.
| Date | Report | Balance Sheet |
| ---- | ------ | ------------ |
| Q2 2016 | [report](/faq/quarterly-report-july-2016) | [sheet](https://docs.google.com/spreadsheets/d/1r7puheE4Ut4c08R47uCDZbDdMHAoQa0WDqw470gjMIw/edit#gid=0) |
| Q3 2016 | [report](/faq/quarterly-report-3q-2016) | [sheet](https://docs.google.com/spreadsheets/d/1zPG58YuLPqpB3yzypntRWouoEVc4saDOifpnvnwS8Rc/edit?ts=57f28d0e#gid=799352054) |
| Q4 2016 | [report](https://docs.google.com/document/d/10xY_4PXQagYOMDBtA7Lv8-jcs2ryCBKi9WXvAN4l8EU/edit?usp=sharing) | [sheet](https://docs.google.com/spreadsheets/d/11nKwFXN3gIQHnE7jYjEK5AFClyAde9aFs6UlnGX3Uzg/edit?usp=sharing) |
| Q1 2017 | [report](https://docs.google.com/document/d/1_B6hUXuxfSxsmVuNIUkgX7NROj0WvZc8PCI4O87aZkQ/edit?usp=sharing) | [sheet](https://docs.google.com/spreadsheets/d/1c-8CR1ro7lKOANHhWhivF7bZ19_ppgCq-d-HD_u43vM/edit?usp=sharing) |
Specific details of historic, ongoing, and anticipated fund expenditures can be seen in the most recent quarterly report.
The full list of these reports can be seen on [the credit reports page](https://lbry.io/credit-reports).
## Community Fund

View file

@ -112,18 +112,22 @@ class Controller
$router->post('/set-culture', 'i18nActions::setCulture');
$permanentRedirects = [
'/lbry-osx-latest.dmg' => '/get',
'/lbry-linux-latest.deb' => '/get',
'/dl/lbry_setup.sh' => '/get',
'/art' => '/what',
'/why' => '/learn',
'/feedback' => '/learn',
'/faq/when-referral-payouts' => '/faq/referrals',
'/faq/why-care-about-lbry' => '/get',
'/news/meet-the-lbry-founders' => '/team',
'/faq/no-auction-options' => '/faq/naming',
'/join-list' => '/list/subscribe',
'/publish' => '/youtube'
'/lbry-osx-latest.dmg' => '/get',
'/lbry-linux-latest.deb' => '/get',
'/dl/lbry_setup.sh' => '/get',
'/art' => '/what',
'/why' => '/learn',
'/feedback' => '/learn',
'/faq/when-referral-payouts' => '/faq/referrals',
'/faq/why-care-about-lbry' => '/get',
'/news/meet-the-lbry-founders' => '/team',
'/faq/no-auction-options' => '/faq/naming',
'/join-list' => '/list/subscribe',
'/publish' => '/youtube',
'/faq/quarterly-report-july-2016' => '/credit-reports/2016-Q2',
'/faq/quarterly-report-3q-2016' => '/credit-reports/2016-Q3',
'/faq/Q4-credit-report' => '/credit-reports/2016-Q4',
'/faq/Q1-17-CreditReport' => '/credit-reports/2017-Q1',
];
$tempRedirects = [
@ -155,6 +159,9 @@ class Controller
$router->get([ContentActions::URL_FAQ . '/{slug:c}?', 'faq'], 'ContentActions::executeFaq');
$router->get([ContentActions::URL_BOUNTY . '/{slug:c}?', 'bounty'], 'ContentActions::executeBounty');
$router->get([ContentActions::URL_PRESS . '/{slug:c}', 'press'], 'ContentActions::executePress');
// $router->get([ContentActions::URL_CREDIT_REPORTS . '/{slug:c}?', 'faq'], 'ContentActions::executeFaq');
$router->get(ContentActions::URL_CREDIT_REPORTS, 'ContentActions::executeCreditReports');
$router->get([ContentActions::URL_CREDIT_REPORTS . '/{year:c}-q{quarter:c}', ContentActions::URL_CREDIT_REPORTS . '/{year:c}-Q{quarter:c}'], 'ContentActions::executeCreditReport');
$router->any(['/signup{whatever}?', 'signup'], 'DownloadActions::executeSignup');

View file

@ -8,18 +8,21 @@ class ContentActions extends Actions
SLUG_FAQ = 'faq',
SLUG_PRESS = 'press',
SLUG_BOUNTY = 'bounty',
SLUG_CREDIT_REPORTS = 'credit-reports',
URL_NEWS = '/' . self::SLUG_NEWS,
URL_FAQ = '/' . self::SLUG_FAQ,
URL_PRESS = '/' . self::SLUG_PRESS,
URL_BOUNTY = '/' . self::SLUG_BOUNTY,
URL_CREDIT_REPORTS = '/' . self::SLUG_CREDIT_REPORTS,
CONTENT_DIR = ROOT_DIR . '/content',
VIEW_FOLDER_NEWS = self::CONTENT_DIR . '/' . self::SLUG_NEWS,
VIEW_FOLDER_FAQ = self::CONTENT_DIR . '/' . self::SLUG_FAQ,
VIEW_FOLDER_BOUNTY = self::CONTENT_DIR . '/' . self::SLUG_BOUNTY,
VIEW_FOLDER_PRESS = self::CONTENT_DIR . '/' . self::SLUG_PRESS;
VIEW_FOLDER_PRESS = self::CONTENT_DIR . '/' . self::SLUG_PRESS,
VIEW_FOLDER_CREDIT_REPORTS = self::CONTENT_DIR . '/' . self::SLUG_CREDIT_REPORTS;
public static function executeHome(): array
{
@ -87,7 +90,6 @@ class ContentActions extends Actions
'setup' => 'Installing and Running LBRY',
'wallet' => 'The LBRY Wallet',
'mining' => 'Mining LBC',
'policy' => 'Policies',
'developer' => 'Developers',
'differences' => 'What Makes LBRY Different?',
'other' => 'Other Questions',
@ -125,6 +127,38 @@ class ContentActions extends Actions
return ['content/faq-post', ['post' => $post]];
}
public static function executeCreditReports(string $year = null, string $month = null): array
{
Response::enableHttpCache();
$posts = Post::find(static::VIEW_FOLDER_CREDIT_REPORTS);
return ['content/credit-reports', [
'posts' => $posts
]];
}
public static function executeCreditReport(string $year = null, string $quarter = null): array
{
Response::enableHttpCache();
try
{
$post = Post::load(static::SLUG_CREDIT_REPORTS . '/' . $year . '-Q' . $quarter);
}
catch (PostNotFoundException $e)
{
return Controller::redirect('/' . static::SLUG_CREDIT_REPORTS);
}
$metadata = $post->getMetadata();
return ['content/credit-report', [
'post' => $post,
'sheetUrl' => $metadata['sheet']
]];
}
public static function executePress(string $slug = null): array
{
Response::enableHttpCache();

View file

@ -126,6 +126,11 @@ class Post
return $this->metadata;
}
public function getMetadataItem($key, $default = null)
{
return $this->metadata[$key] ?? $default;
}
public function setMetadataItem($key, $value)
{
$this->metadata[$key] = $value;
@ -373,7 +378,7 @@ class Post
public static function getSlugFromFilename($filename)
{
return strtolower(preg_replace('#^\d+\-#', '', basename(trim($filename), '.md')));
return strtolower(preg_replace('#^\d{1,3}\-#', '', basename(trim($filename), '.md')));
}
public static function collectMetadata(array $posts, $field)

View file

@ -0,0 +1,18 @@
<?php Response::setMetaDescription($post->getTitle()) ?>
<?php NavActions::setNavUri('/learn') ?>
<?php echo View::render('nav/_header') ?>
<main>
<section class="post-content">
<div class="content">
<br/>
<div class="meta">
<a href="/credit-reports">« Credit Reports</a>
</div>
<h1><?php echo htmlentities($post->getTitle()) ?></h1>
<h2>Sheet</h2>
<a href="<?php echo $sheetUrl ?>">Sheet</a>
<?php echo $post->getContentHtml() ?>
</div>
</section>
</main>
<?php echo View::render('nav/_footer') ?>

View file

@ -0,0 +1,28 @@
<?php Response::setMetaDescription('Quarterly reports regarding usage of LBRY credits by LBRY Inc.') ?>
<?php echo View::render('nav/_header', ['isDark' => false]) ?>
<main>
<section class="content content-readable spacer2">
<h1>Quarterly Credit Reports</h1>
<p>
LBRY issues a quarterly report every 3 months in January, April, July, and October, covering the preceding 3 full months. These reports outline the corresponding transaction history as the current state of LBRY, Inc.'s balance sheet and anticipated future expenditures.
</p>
<table class="post-content-table full-table">
<thead>
<tr>
<th>Date</th>
<th>Report</th>
<th>Balance Sheet</th>
</tr>
</thead>
<?php foreach($posts as $post): ?>
<tr>
<td><?php echo strtoupper($post->getSlug()) ?></td>
<td><a href="<?php echo $post->getRelativeUrl() ?>" class="link-primary">Report</a></td>
<td><a href="<?php echo $post->getMetadataItem('sheet') ?>" class="link-primary">Sheet</a></td>
</tr>
<?php endforeach ?>
</table>
</section>
</main>
<?php echo View::render('nav/_footer') ?>

View file

@ -7,7 +7,7 @@
<div class="content">
<br />
<div class="meta">
<a href="/faq"><< {{page.faq.back}}</a>
<a href="/faq">« {{page.faq.back}}</a>
</div>
<h1><?php echo htmlentities($post->getTitle()) ?></h1>
<?php echo $post->getContentHtml() ?>

View file

@ -33,6 +33,9 @@
<div class="spacer1">
<a href="/team" class="link-primary">About the Team</a>
</div>
<div class="spacer1">
<a href="/credit-reports" class="link-primary">Credit Reports</a>
</div>
</div>
</div>
</div>

View file

@ -115,6 +115,24 @@
word-wrap: break-word;
max-width: 100%;
thead th, > tr:first-child th
{
border-bottom: 1px solid #e2e2e2;
vertical-align: bottom;
font-weight: bold;
font-size: 0.9em;
padding: $spacing-vertical/4+1 8px $spacing-vertical/4-2;
text-align: left;
img
{
vertical-align: text-bottom;
}
}
tr.thead:not(:first-child) th
{
border-top: 1px solid #e2e2e2;
}
th, td
{
padding: $spacing-vertical/2 8px;
@ -128,18 +146,7 @@
{
vertical-align: top;
}
thead th, > tr:first-child th
{
vertical-align: bottom;
font-weight: bold;
font-size: 0.9em;
padding: $spacing-vertical/4+1 8px $spacing-vertical/4-2;
text-align: left;
img
{
vertical-align: text-bottom;
}
}
td.center
{
vertical-align: middle;
@ -159,17 +166,7 @@
{
width: 100%;
}
}
.post-content table
{
thead th, > tr:first-child th
{
border-bottom: 1px solid #e2e2e2;
}
tr.thead:not(:first-child) th
{
border-top: 1px solid #e2e2e2;
}
tbody
{
tr