diff --git a/content/bounty/app-i18n.md b/content/bounty/app-i18n.md index 4be6c0be..6452d68b 100644 --- a/content/bounty/app-i18n.md +++ b/content/bounty/app-i18n.md @@ -1,7 +1,7 @@ --- category: browser title: Internationalization of LBRY Browser -award: 40000 +award: 2000 status: available date: '2016-07-01' --- diff --git a/content/bounty/bittorrent-support.md b/content/bounty/bittorrent-support.md index 83d01d51..4cbf1a1f 100644 --- a/content/bounty/bittorrent-support.md +++ b/content/bounty/bittorrent-support.md @@ -1,7 +1,7 @@ --- category: daemon title: Add Support for BitTorrent -award: 100000 +award: 10000 status: available date: '2016-07-01' --- diff --git a/content/bounty/http-support.md b/content/bounty/http-support.md index 30123a28..8008e062 100644 --- a/content/bounty/http-support.md +++ b/content/bounty/http-support.md @@ -1,7 +1,7 @@ --- category: daemon title: Add Support for HTTP -award: 40000 +award: 3000 status: available date: '2016-11-01' --- diff --git a/content/bounty/lbry-club.md b/content/bounty/lbry-club.md index 5fa290e5..8b78cb04 100644 --- a/content/bounty/lbry-club.md +++ b/content/bounty/lbry-club.md @@ -1,7 +1,7 @@ --- category: human title: LBRY Community Rep -award: 5000 +award: 300 status: available date: '2016-07-01' --- diff --git a/content/bounty/pkg-installer-for-osx.md b/content/bounty/pkg-installer-for-osx.md index 1f5d1cf0..d13de8fa 100644 --- a/content/bounty/pkg-installer-for-osx.md +++ b/content/bounty/pkg-installer-for-osx.md @@ -1,7 +1,7 @@ --- category: osx title: PKG Installer for OS X -award: 20000 +award: 1500 status: available date: '2016-07-01' --- diff --git a/content/bounty/pr-for-lbry.md b/content/bounty/pr-for-lbry.md index a54f563c..db131422 100644 --- a/content/bounty/pr-for-lbry.md +++ b/content/bounty/pr-for-lbry.md @@ -1,7 +1,7 @@ --- category: human title: Write, Broadcast or Share LBRY -award: 2000 +award: 250 status: available date: '2016-07-01' --- diff --git a/content/bounty/social-media-cover-images.md b/content/bounty/social-media-cover-images.md index cca86498..b4a79513 100644 --- a/content/bounty/social-media-cover-images.md +++ b/content/bounty/social-media-cover-images.md @@ -2,7 +2,7 @@ category: design title: Create Social Media Cover Images award: 500 -status: available +status: complete date: '2016-07-01' --- diff --git a/content/bounty/typos-and-edits.md b/content/bounty/typos-and-edits.md index 174bd8e0..2dc6b4cc 100644 --- a/content/bounty/typos-and-edits.md +++ b/content/bounty/typos-and-edits.md @@ -1,8 +1,8 @@ --- category: web title: Typos and Edits -award: 50 -status: complete +award: 10 +status: available date: '2016-11-01' --- diff --git a/controller/action/ContentActions.class.php b/controller/action/ContentActions.class.php index b748daaf..418750e7 100644 --- a/controller/action/ContentActions.class.php +++ b/controller/action/ContentActions.class.php @@ -139,13 +139,23 @@ class ContentActions extends Actions return ['content/press-post', ['post' => $post]]; } + protected static function convertBountyAmount($amount) + { + return is_numeric($amount) ? round($amount / LBRY::getLBCtoUSDRate(), -1) : $amount; + } + public static function executeBounty(string $slug = null): array { Response::enableHttpCache(); + + if ($slug) { list($metadata, $postHtml) = View::parseMarkdown(ContentActions::VIEW_FOLDER_BOUNTY . '/' . $slug . '.md'); + + $metadata['lbc_award'] = static::convertBountyAmount($metadata['award']); + if (!$postHtml) { return NavActions::execute404(); @@ -184,6 +194,11 @@ class ContentActions extends Actions return $metadataA['title'] < $metadataB['title'] ? -1 : 1; }); + foreach($bounties as $bounty) { + $metadata = $bounty->getMetadata(); + $bounty->setMetadataItem('lbc_award', static::convertBountyAmount($metadata['award'])); + } + return ['bounty/list', [ 'bounties' => $bounties, 'categories' => $allCategories, diff --git a/model/Post.class.php b/model/Post.class.php index 77e7e4f9..7f680f0d 100644 --- a/model/Post.class.php +++ b/model/Post.class.php @@ -126,6 +126,11 @@ class Post return $this->metadata; } + public function setMetadataItem($key, $value) + { + $this->metadata[$key] = $value; + } + public function getRelativeUrl() { return '/' . $this->postType . '/' . $this->slug; diff --git a/view/template/bounty/_meta.php b/view/template/bounty/_meta.php index 4e4cf00a..6515e21a 100644 --- a/view/template/bounty/_meta.php +++ b/view/template/bounty/_meta.php @@ -1,5 +1,5 @@
+ >
\ No newline at end of file