diff --git a/controller/action/DownloadActions.class.php b/controller/action/DownloadActions.class.php
index 6e8f9fb4..b3fc35a4 100644
--- a/controller/action/DownloadActions.class.php
+++ b/controller/action/DownloadActions.class.php
@@ -29,28 +29,18 @@ class DownloadActions extends Actions
public static function executeGet()
{
$osChoices = OS::getAll();
- $os = static::guessOs();
- if ($os && isset($osChoices[$os]))
- {
+ $os = static::guessOS();
+
+ if(isset($os) && isset($osChoices[$os])){
list($uri, $osTitle, $osIcon, $buttonLabel, $analyticsLabel) = $osChoices[$os];
- $release = GitHub::getAppRelease();
- $asset = GitHub::getAppAsset($os);
- return ['download/get', [
- 'analyticsLabel' => $analyticsLabel,
- 'buttonLabel' => $buttonLabel,
- 'downloadUrl' => $asset ? $asset['browser_download_url'] : null,
- 'isAuto' => Request::getParam('auto'),
- 'os' => $os,
- 'osTitle' => $osTitle,
- 'osIcon' => $osIcon,
- 'releaseTimestamp' => $release ? strtotime($release['created_at']) : null,
- 'size' => $asset ? $asset['size'] / ( 1024 * 1024 ) : 0, //bytes -> MB
- 'version' => $release ? $release['name'] : null,
- ]];
+ $asset = Github::getAppAsset($os);
+ $param = ['osTitle' => $osTitle, 'osIcon' => $osIcon, 'os' => $os, 'downloadUrl' => $asset ? $asset['browser_download_url'] : null];
+ return ['download/get', $param];
+ }
+ else{
+ return ['download/get-no-os'];
}
-
- return ['download/get-no-os'];
}
public static function prepareListPartial(array $vars)
@@ -113,4 +103,32 @@ class DownloadActions extends Actions
return $email;
}
+
+ public static function prepareDownloadButtonPartial(array $vars)
+ {
+ $osChoices = OS::getAll();
+
+ $os = static::guessOS();
+
+ if ($os && isset($osChoices[$os])) {
+ list($uri, $osTitle, $osIcon, $buttonLabel, $analyticsLabel) = $osChoices[$os];
+ $release = Github::getAppRelease();
+ $asset = Github::getAppAsset($os);
+
+ $vars = $vars + [
+ 'analyticsLabel' => $analyticsLabel,
+ 'buttonLabel' => $buttonLabel,
+ 'downloadUrl' => $asset ? $asset['browser_download_url'] : null,
+ 'os' => $os,
+ 'osTitle' => $osTitle,
+ 'osIcon' => $osIcon,
+ 'releaseTimestamp' => $release ? strtotime($release['created_at']) : null,
+ 'size' => $asset ? $asset['size'] / (1024 * 1024) : 0, //bytes -> MB
+ 'version' => $release ? $release['name'] : null,
+ 'isAuto' => Request::getParam('auto'),
+ ];
+
+ }
+ return $vars;
+ }
}
diff --git a/view/template/download/_downloadButton.php b/view/template/download/_downloadButton.php
new file mode 100644
index 00000000..dca310f4
--- /dev/null
+++ b/view/template/download/_downloadButton.php
@@ -0,0 +1,32 @@
+
+
+
+
+ var anchor = document.getElementById('get-download-btn');
+ ga('send', 'event', anchor.getAttribute('data-analytics-category'), anchor.getAttribute('data-analytics-action'), anchor.getAttribute('data-analytics-label'));
+ setTimeout(function() { window.location = anchor.getAttribute('href'); }, 500);
+
+
+
+ Latest Version :
+ , Download Size :
+ MB,
+ built on
+ at UTC
+
+
+
+ {{download.works}}
+
+
+
+Download LBRY
+
diff --git a/view/template/download/get.php b/view/template/download/get.php
index 22b7c661..338213ae 100644
--- a/view/template/download/get.php
+++ b/view/template/download/get.php
@@ -2,7 +2,6 @@
false]) ?>
-
@@ -15,35 +14,12 @@
-
-
-
- var anchor = document.getElementById('get-download-btn');
- ga('send', 'event', anchor.getAttribute('data-analytics-category'), anchor.getAttribute('data-analytics-action'), anchor.getAttribute('data-analytics-label'));
- setTimeout(function() { window.location = anchor.getAttribute('href'); }, 500);
-
-
-
- Latest Version :
- , Download Size :
- MB,
- built on
- at
-
+ 'alt',])?>
+
diff --git a/view/template/page/home.php b/view/template/page/home.php
index 34a69bde..db9ed149 100644
--- a/view/template/page/home.php
+++ b/view/template/page/home.php
@@ -15,7 +15,6 @@
Hollywood films, college lessons, amazing streamers and more are on the first media network ruled by you.
+ 'primary',])?>