diff --git a/controller/Controller.class.php b/controller/Controller.class.php
index d28799e3..24f77820 100644
--- a/controller/Controller.class.php
+++ b/controller/Controller.class.php
@@ -98,7 +98,13 @@ class Controller
$slug = preg_replace($faqPattern, '', $uri);
return $slug ? ContentActions::executeFaqPost($uri) : ContentActions::executeFaq();
}
- $noSlashUri = ltrim($uri, '/');
+
+ $bountyPattern = '#^' . BountyActions::URL_BOUNTY_LIST . '(/|$)#';
+ if (preg_match($bountyPattern, $uri))
+ {
+ $slug = preg_replace($bountyPattern, '', $uri);
+ return $slug ? BountyActions::executeShow($uri) : BountyActions::executeList($uri);
+ }
$accessPattern = '#^/signup#';
if (preg_match($accessPattern, $uri))
@@ -106,6 +112,8 @@ class Controller
return DownloadActions::executeSignup();
}
+
+ $noSlashUri = ltrim($uri, '/');
if (View::exists('page/' . $noSlashUri))
{
return ['page/' . $noSlashUri, []];
diff --git a/controller/action/BountyActions.class.php b/controller/action/BountyActions.class.php
new file mode 100644
index 00000000..b2e83c77
--- /dev/null
+++ b/controller/action/BountyActions.class.php
@@ -0,0 +1,47 @@
+getMetadata();
+ return isset($metadata['category']) ? $metadata['category'] : null;
+ }, $posts));
+
+ uasort($posts, function($postA, $postB) {
+ $metadataA = $postA->getMetadata();
+ $metadataB = $postB->getMetadata();
+ if ($metadataA['award'] != $metadataB['award'])
+ {
+ return $metadataA['award'] > $metadataB['award'] ? -1 : 1;
+ }
+ return $metadataA['title'] < $metadataB['title'] ? -1 : 1;
+ });
+
+ $completeStatuses = ['any', 'incomplete', 'complete'];
+
+ return ['bounty/list', [
+ 'posts' => $posts,
+ 'categories' => $allCategories,
+ 'completeStatuses' => $completeStatuses
+ ]];
+ }
+
+ public static function executeShow($relativeUri)
+ {
+ list($metadata, $postHtml) = View::parseMarkdown(ROOT_DIR . '/posts/' . $relativeUri . '.md');
+ if (!$postHtml)
+ {
+ return ['page/404', []];
+ }
+ return ['bounty/show', [
+ 'postHtml' => $postHtml,
+ 'metadata' => $metadata
+ ]];
+ }
+}
\ No newline at end of file
diff --git a/controller/action/NavActions.class.php b/controller/action/NavActions.class.php
index b8a3e109..7e84b5e0 100644
--- a/controller/action/NavActions.class.php
+++ b/controller/action/NavActions.class.php
@@ -19,6 +19,14 @@ class NavActions extends Actions
return static::$navUri ?: $_SERVER['REQUEST_URI'];
}
+ public static function prepareFooterPartial(array $vars)
+ {
+ return $vars + [
+ 'isDark' => false,
+ 'showLearnFooter' => false
+ ];
+ }
+
public static function prepareGlobalItemsPartial(array $vars)
{
$vars += ['selectedItem' => static::getNavUri()];
diff --git a/model/Post.class.php b/model/Post.class.php
index 86958276..553b2aaf 100644
--- a/model/Post.class.php
+++ b/model/Post.class.php
@@ -5,7 +5,7 @@ class Post
const SORT_DATE_DESC = 'sort_date_desc';
protected static $slugMap = [];
- protected $slug, $title, $author, $date, $markdown, $contentText, $contentHtml, $cover, $postType, $category;
+ protected $slug, $title, $metadata, $author, $date, $markdown, $contentText, $contentHtml, $cover, $postType, $category;
protected $isCoverLight = false;
public static function load($relativeOrAbsolutePath)
@@ -45,6 +45,7 @@ class Post
$this->postType = $postType;
$this->slug = $slug;
$this->markdown = $markdown;
+ $this->metadata = $frontMatter;
$this->title = isset($frontMatter['title']) ? $frontMatter['title'] : null;
$this->author = isset($frontMatter['author']) ? $frontMatter['author'] : null;
$this->date = isset($frontMatter['date']) ? new DateTime($frontMatter['date']) : null;
@@ -74,6 +75,11 @@ class Post
return $posts;
}
+ public function getMetadata()
+ {
+ return $this->metadata;
+ }
+
public function getRelativeUrl()
{
return $this->postType . '/' . $this->slug;
diff --git a/posts/bounty/android-app.md b/posts/bounty/android-app.md
new file mode 100644
index 00000000..bc6f6ede
--- /dev/null
+++ b/posts/bounty/android-app.md
@@ -0,0 +1,8 @@
+---
+category: android
+title: Mirror existing LBRY behavior in Android
+award: 10000
+date: '2016-07-01'
+---
+
+Domo arigato, Rami Malek.
\ No newline at end of file
diff --git a/posts/bounty/ios-app.md b/posts/bounty/ios-app.md
new file mode 100644
index 00000000..33055625
--- /dev/null
+++ b/posts/bounty/ios-app.md
@@ -0,0 +1,8 @@
+---
+category: ios
+title: Mirror existing LBRY behavior in iOS
+award: 10000
+date: '2016-07-01'
+---
+
+An Apple a day keeps the FBI away.
\ No newline at end of file
diff --git a/posts/bounty/refer-publisher.md b/posts/bounty/refer-publisher.md
new file mode 100644
index 00000000..03575ae8
--- /dev/null
+++ b/posts/bounty/refer-publisher.md
@@ -0,0 +1,8 @@
+---
+category: human
+title: Refer a Publisher to LBRY
+award: 100
+date: '2016-07-01'
+---
+
+Create a build for Windows that is reproducible in Travis CI. This involves blah, blah, and blah.
\ No newline at end of file
diff --git a/posts/bounty/wallet-ui.md b/posts/bounty/wallet-ui.md
new file mode 100644
index 00000000..55581eaa
--- /dev/null
+++ b/posts/bounty/wallet-ui.md
@@ -0,0 +1,9 @@
+---
+category: browser
+title: Add Wallet Interface to LBRY Browser
+award: 1000
+complete: true
+date: '2016-07-01'
+---
+
+Wallet wallet wallet, wallet wallet.
\ No newline at end of file
diff --git a/posts/bounty/windows-build.md b/posts/bounty/windows-build.md
new file mode 100644
index 00000000..7d99203b
--- /dev/null
+++ b/posts/bounty/windows-build.md
@@ -0,0 +1,10 @@
+---
+category: ci
+title: Build LBRY for Windows
+award: 1000
+date: '2016-07-01'
+---
+
+Contact your favorite YouTuber or other online publisher and let them know about [LBRY's publishing partnerships](http://lbry.io/publish).
+
+If you notify someone that is accepted, you'll earn a referral bonus.
\ No newline at end of file
diff --git a/view/template/bounty/list.php b/view/template/bounty/list.php
new file mode 100644
index 00000000..c476a4f8
--- /dev/null
+++ b/view/template/bounty/list.php
@@ -0,0 +1,67 @@
+
+
+ false]) ?>
+LBRY Bounties
+ Earn money for building a better internet.
+ Bounties
+
+
+ $('#bounty-filter-form').change(function() $(this).submit(); });
+
+