mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 17:47:26 +00:00
commit
fb8c2c7afc
15 changed files with 334 additions and 172 deletions
|
@ -76,32 +76,40 @@ class Controller
|
|||
return static::redirect('https://github.com/lbryio/lbry/releases/download/v0.2.5/lbry_0.2.5_amd64.deb', 307);
|
||||
case '/art':
|
||||
return static::redirect('/what');
|
||||
default:
|
||||
$newsPattern = '#^' . ContentActions::URL_NEWS . '(/|$)#';
|
||||
if (preg_match($newsPattern, $uri))
|
||||
{
|
||||
$slug = preg_replace($newsPattern, '', $uri);
|
||||
if ($slug == ContentActions::RSS_SLUG)
|
||||
{
|
||||
return ContentActions::executeRss();
|
||||
}
|
||||
return $slug ? ContentActions::executePost($uri) : ContentActions::executeNews();
|
||||
}
|
||||
$faqPattern = '#^' . ContentActions::URL_FAQ . '(/|$)#';
|
||||
if (preg_match($faqPattern, $uri))
|
||||
{
|
||||
$slug = preg_replace($faqPattern, '', $uri);
|
||||
return $slug ? ContentActions::executePost($uri) : ContentActions::executeFaq();
|
||||
}
|
||||
$noSlashUri = ltrim($uri, '/');
|
||||
if (View::exists('page/' . $noSlashUri))
|
||||
{
|
||||
return ['page/' . $noSlashUri, []];
|
||||
}
|
||||
else
|
||||
{
|
||||
return ['page/404', [], [static::HEADER_STATUS => 404]];
|
||||
}
|
||||
}
|
||||
|
||||
$newsPattern = '#^' . ContentActions::URL_NEWS . '(/|$)#';
|
||||
if (preg_match($newsPattern, $uri))
|
||||
{
|
||||
$slug = preg_replace($newsPattern, '', $uri);
|
||||
if ($slug == ContentActions::RSS_SLUG)
|
||||
{
|
||||
return ContentActions::executeRss();
|
||||
}
|
||||
return $slug ? ContentActions::executePost($uri) : ContentActions::executeNews();
|
||||
}
|
||||
|
||||
$faqPattern = '#^' . ContentActions::URL_FAQ . '(/|$)#';
|
||||
if (preg_match($faqPattern, $uri))
|
||||
{
|
||||
$slug = preg_replace($faqPattern, '', $uri);
|
||||
return $slug ? ContentActions::executePost($uri) : ContentActions::executeFaq();
|
||||
}
|
||||
$noSlashUri = ltrim($uri, '/');
|
||||
|
||||
$accessPattern = '#^/signup#';
|
||||
if (preg_match($accessPattern, $uri))
|
||||
{
|
||||
return DownloadActions::executeSignup();
|
||||
}
|
||||
|
||||
if (View::exists('page/' . $noSlashUri))
|
||||
{
|
||||
return ['page/' . $noSlashUri, []];
|
||||
}
|
||||
else
|
||||
{
|
||||
return ['page/404', [], [static::HEADER_STATUS => 404]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,7 +147,7 @@ class Controller
|
|||
unset($headers[static::HEADER_STATUS]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach($headers as $name => $value)
|
||||
{
|
||||
header($name . ': ' . $value);
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
class Session
|
||||
{
|
||||
const KEY_MAILCHIMP_LIST_IDS = 'mailchimp_list_ids',
|
||||
KEY_DOWNLOAD_ACCESS_ERROR = 'download_error',
|
||||
KEY_DOWNLOAD_REFERRAL_CODE = 'beta_referral_code',
|
||||
KEY_DOWNLOAD_ALLOWED = 'beta_download_allowed',
|
||||
KEY_LIST_SUB_ERROR = 'list_error',
|
||||
KEY_LIST_SUB_SIGNATURE = 'list_sub_sig',
|
||||
KEY_LIST_SUB_SUCCESS = 'list_success',
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
*
|
||||
* @author jeremy
|
||||
*/
|
||||
|
||||
class PrefinerySubscribeException extends Exception {}
|
||||
|
||||
class DownloadActions extends Actions
|
||||
{
|
||||
const OS_ANDROID = 'android',
|
||||
|
@ -25,6 +28,20 @@ class DownloadActions extends Actions
|
|||
}
|
||||
|
||||
public static function executeGet()
|
||||
{
|
||||
if (Session::get(Session::KEY_DOWNLOAD_ALLOWED))
|
||||
{
|
||||
return static::executeGetAccepted();
|
||||
}
|
||||
|
||||
$os = static::guessOs();
|
||||
return ['download/get', [
|
||||
'os' => $os
|
||||
]];
|
||||
}
|
||||
|
||||
|
||||
public static function executeGetAccepted()
|
||||
{
|
||||
$osChoices = static::getOses();
|
||||
$os = static::guessOs();
|
||||
|
@ -32,21 +49,67 @@ class DownloadActions extends Actions
|
|||
if ($os && isset($osChoices[$os]))
|
||||
{
|
||||
list($uri, $osTitle, $osIcon, $partial) = $osChoices[$os];
|
||||
return ['download/get', [
|
||||
$inviteCode = Session::get(Session::KEY_DOWNLOAD_REFERRAL_CODE);
|
||||
return ['download/getAllowed', [
|
||||
'inviteCode' => $inviteCode,
|
||||
'os' => $os,
|
||||
'osTitle' => $osTitle,
|
||||
'osIcon' => $osIcon,
|
||||
'hasMatchingInvite' => isset($_POST['invite']) && preg_match('/^(pfa|pfb).*$/', $_POST['invite']),
|
||||
'hasInvite' => isset($_POST['invite']) && $_POST['invite'],
|
||||
'downloadHtml' => View::exists('download/' . $partial) ?
|
||||
View::render('download/' . $partial, ['downloadUrl' => static::getDownloadUrl($os)]) :
|
||||
false
|
||||
View::render('download/' . $partial, ['downloadUrl' => static::getDownloadUrl($os)]) :
|
||||
false
|
||||
]];
|
||||
}
|
||||
|
||||
return ['download/get-no-os', [
|
||||
'isSubscribed' => in_array(Mailchimp::LIST_GENERAL_ID, Session::get(Session::KEY_MAILCHIMP_LIST_IDS, []))
|
||||
]];
|
||||
return ['download/get-no-os'];
|
||||
}
|
||||
|
||||
public static function executeSignup()
|
||||
{
|
||||
$email = isset($_GET['email']) ? $_GET['email'] : (isset($_POST['email']) ? $_POST['email'] : null);
|
||||
$code = isset($_GET['code']) ? $_GET['code'] : (isset($_POST['code']) ? $_POST['code'] : null);
|
||||
|
||||
if (!$email || !filter_var($email, FILTER_VALIDATE_EMAIL))
|
||||
{
|
||||
Session::set(Session::KEY_DOWNLOAD_ACCESS_ERROR, 'Please provide a valid email. You provided: ' . $email);
|
||||
}
|
||||
elseif ($code)
|
||||
{
|
||||
try
|
||||
{
|
||||
static::subscribeToPrefinery($email, $code);
|
||||
Session::set(Session::KEY_DOWNLOAD_ALLOWED, true);
|
||||
}
|
||||
catch (PrefinerySubscribeException $e)
|
||||
{
|
||||
Session::set(Session::KEY_DOWNLOAD_ACCESS_ERROR, 'Your code is not valid. If you believe this is an error, please contact ' . Config::HELP_CONTACT_EMAIL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$referrerId = isset($_GET['referrer_id']) ? $_GET['referrer_id'] : (isset($_POST['referrer_id']) ? $_POST['referrer_id'] : null);
|
||||
$failure = false;
|
||||
try
|
||||
{
|
||||
// MailActions::subscribeToMailchimp($email, Mailchimp::LIST_GENERAL_ID);
|
||||
static::subscribeToPrefinery($email, null, $referrerId);
|
||||
}
|
||||
catch (PrefinerySubscribeException $e)
|
||||
{
|
||||
$failure = true;
|
||||
}
|
||||
catch (MailchimpSubscribeException $e)
|
||||
{
|
||||
$failure = true;
|
||||
}
|
||||
if ($failure)
|
||||
{
|
||||
Session::set(Session::KEY_DOWNLOAD_ACCESS_ERROR,
|
||||
'We were unable to add you to the wait list due to a technical error. Please contact ' . Config::HELP_CONTACT_EMAIL . ' for bonus credits.');
|
||||
}
|
||||
}
|
||||
|
||||
return Controller::redirect('/get');
|
||||
}
|
||||
|
||||
public static function prepareListPartial(array $vars)
|
||||
|
@ -57,6 +120,68 @@ class DownloadActions extends Actions
|
|||
];
|
||||
}
|
||||
|
||||
public static function subscribeToPrefinery($email, $inviteCode = null, $referrerId = null)
|
||||
{
|
||||
$apiKey = Config::get('prefinery_key');
|
||||
$options = [
|
||||
'headers' => [
|
||||
'Accept: application/json',
|
||||
'Content-type: application/json'
|
||||
],
|
||||
'json_post' => true
|
||||
];
|
||||
|
||||
$listUrl = 'https://lbry.prefinery.com/api/v2/betas/8679/testers.json?api_key=' . $apiKey;
|
||||
|
||||
$body = Curl::get($listUrl, ['email' => $email], $options);
|
||||
|
||||
if (!$body)
|
||||
{
|
||||
throw new PrefinerySubscribeException('Empty cURL response.');
|
||||
}
|
||||
|
||||
$data = json_decode($body, true);
|
||||
|
||||
if ($data && is_array($data) && count($data) && isset($data[0]['share_link']))
|
||||
{
|
||||
$shareLink = $data[0]['share_link'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$createUrl = 'https://lbry.prefinery.com/api/v2/betas/8679/testers.json?api_key=' . $apiKey;
|
||||
|
||||
$params = [
|
||||
'tester' => array_filter([
|
||||
'email' => $email,
|
||||
'status' => $inviteCode ? 'invited' : 'applied',
|
||||
'invitation_code' => $inviteCode,
|
||||
'referrer_id' => $referrerId
|
||||
])
|
||||
];
|
||||
|
||||
$body = Curl::post($createUrl, $params, $options);
|
||||
|
||||
if (!$body)
|
||||
{
|
||||
throw new PrefinerySubscribeException('Empty cURL response.');
|
||||
}
|
||||
|
||||
$data = json_decode($body, true);
|
||||
|
||||
if (!$data || !isset($data['share_link']))
|
||||
{
|
||||
throw new PrefinerySubscribeException('Missing share_link.');
|
||||
}
|
||||
|
||||
$shareLink = $data['share_link'];
|
||||
}
|
||||
|
||||
preg_match('/\?r\=(\w+)/', $shareLink, $matches);
|
||||
Session::set(Session::KEY_DOWNLOAD_REFERRAL_CODE, $matches[1] ?: 'unknown');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected static function guessOs()
|
||||
{
|
||||
//if exact OS is requested, use that
|
||||
|
@ -138,40 +263,4 @@ class DownloadActions extends Actions
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
// protected static function validateDownloadAccess()
|
||||
// {
|
||||
// $seshionKey = 'has-get-access';
|
||||
// if (Session::get($seshionKey))
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// if ($_SERVER['REQUEST_METHOD'] === 'POST')
|
||||
// {
|
||||
// $accessCodes = include ROOT_DIR . '/data/secret/access_list.php';
|
||||
// $today = date('Y-m-d H:i:s');
|
||||
// foreach($accessCodes as $code => $date)
|
||||
// {
|
||||
// if ($_POST['invite'] == $code && $today <= $date)
|
||||
// {
|
||||
// Session::set($seshionKey, true);
|
||||
// Controller::redirect('/get', 302);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if ($_POST['invite'])
|
||||
// {
|
||||
// Session::set('invite_error', 'Please provide a valid invite code.');
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// Session::set('invite_error', 'Please provide an invite code.');
|
||||
// }
|
||||
//
|
||||
// Controller::redirect('/get', 401);
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -29,11 +29,11 @@ class MailActions extends Actions
|
|||
}
|
||||
else
|
||||
{
|
||||
$mcApi = new Mailchimp();
|
||||
$mcListId = $_POST['listId'];
|
||||
$mergeFields = isset($_POST['mergeFields']) ? unserialize($_POST['mergeFields']) : [];
|
||||
$success = $mcApi->listSubscribe($mcListId, $email, $mergeFields, 'html', false);
|
||||
if ($success)
|
||||
$errorOrSuccess = static::subscribeToMailchimp($email, $mcListId, $mergeFields);
|
||||
|
||||
if ($errorOrSuccess === true)
|
||||
{
|
||||
Session::set(Session::KEY_MAILCHIMP_LIST_IDS, array_merge(Session::get(Session::KEY_MAILCHIMP_LIST_IDS, []), [$mcListId]));
|
||||
Session::set(Session::KEY_LIST_SUB_SUCCESS, true);
|
||||
|
@ -41,14 +41,24 @@ class MailActions extends Actions
|
|||
}
|
||||
else
|
||||
{
|
||||
$error = $mcApi->errorMessage ?: __('Something went wrong adding you to the list.');
|
||||
Session::set(Session::KEY_LIST_SUB_ERROR, $error);
|
||||
Session::set(Session::KEY_LIST_SUB_ERROR, $errorOrSuccess);
|
||||
}
|
||||
}
|
||||
|
||||
return Controller::redirect($nextUrl);
|
||||
}
|
||||
|
||||
public static function subscribeToMailchimp($email, $listId, array $mergeFields = [])
|
||||
{
|
||||
$mcApi = new Mailchimp();
|
||||
$success = $mcApi->listSubscribe($listId, $email, $mergeFields, 'html', false);
|
||||
if (!$success)
|
||||
{
|
||||
throw new MailchimpSubscribeException($mcApi->errorMessage ?: __('Something went wrong adding you to the list.'));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function prepareJoinList(array $vars)
|
||||
{
|
||||
$vars['listSig'] = md5(serialize($vars));
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
class MailchimpSubscribeException extends Exception {}
|
||||
|
||||
class Mailchimp extends MCAPI
|
||||
{
|
||||
const LIST_GENERAL_ID = '7b74c90030';
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
class Config
|
||||
{
|
||||
const HELP_CONTACT_EMAIL = 'josh@lbry.io';
|
||||
|
||||
protected static $loaded = false;
|
||||
protected static $data = [];
|
||||
|
||||
|
|
|
@ -51,6 +51,11 @@ class Curl
|
|||
|
||||
$ch = curl_init();
|
||||
|
||||
if ($ch === false || $ch === null)
|
||||
{
|
||||
throw new LogicException('Unable to initialize cURL');
|
||||
}
|
||||
|
||||
if ($method == static::GET && $params)
|
||||
{
|
||||
$url .= (strpos($url, '?') === false ? '?' : '&') . http_build_query($params);
|
||||
|
@ -112,7 +117,6 @@ class Curl
|
|||
return strlen($h);
|
||||
});
|
||||
|
||||
|
||||
$responseContent = curl_exec($ch);
|
||||
|
||||
$statusCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="notice notice-info spacer1">
|
||||
<em>This is a pre-release, beta version of LBRY.</em>
|
||||
It may crash, work unreliably, or inadvertently put a curse on your family for generations (a common programming error).
|
||||
<strong>This is still a beta.</strong>
|
||||
While LBRY is now live, it may crash, work unreliably, or inadvertently put a curse on your family for generations (a common programming error).
|
||||
Use at your own risk.
|
||||
</div>
|
|
@ -1,30 +0,0 @@
|
|||
<?php $reward = CreditApi::getCurrentTestCreditReward() ?>
|
||||
<h3>Test and Earn</h3>
|
||||
<?php echo View::render('download/_feedbackPrompt') ?>
|
||||
<ol>
|
||||
<li>Open LBRY.</li>
|
||||
<li>Search and stream <code>wonderfullife</code>. Continue to play as you desire.</li>
|
||||
<li><a href="/feedback" class="btn btn-alt">Provide Your Feedback</a></li>
|
||||
</ol>
|
||||
<p>
|
||||
In addition to <?php echo i18n::formatCredits($reward) ?>, your feedback will be personally read by the developers and help signal
|
||||
interest in LBRY to investors.
|
||||
</p>
|
||||
<?php /*
|
||||
<?php $reward = CreditApi::getCurrentTestCreditReward() ?>
|
||||
<div class="cover cover-dark cover-dark-grad content content-dark">
|
||||
<h1>Test and Earn</h1>
|
||||
<?php echo View::render('download/feedback-prompt') ?>
|
||||
<h3>Test Your Install</h3>
|
||||
<ol>
|
||||
<li>Double click the app (LBRY will open in your browser)</li>
|
||||
<li>Search and stream <code>wonderfullife</code></li>
|
||||
<li>Continue to play as you desire</li>
|
||||
</ol>
|
||||
<h3>Feedback</h3>
|
||||
<p>
|
||||
In addition to <?php echo i18n::formatCredits($reward) ?>, your feedback will be personally read by the developers and help signal
|
||||
interest in LBRY to investors.
|
||||
</p>
|
||||
<a href="/feedback" class="btn-alt">Provide Your Feedback</a>
|
||||
</div> */ ?>
|
|
@ -1,15 +1,8 @@
|
|||
<br/>
|
||||
<p>LBRY is coming out on your favorite platform soon. Join our list to know when.</p>
|
||||
<div class="spacer2">
|
||||
<?php echo View::render('mail/joinList', [
|
||||
'submitLabel' => 'Go',
|
||||
'returnUrl' => '/get',
|
||||
'meta' => true,
|
||||
'btnClass' => 'btn-alt',
|
||||
'listId' => Mailchimp::LIST_GENERAL_ID,
|
||||
'mergeFields' => ['CLI' => 'No'],
|
||||
]) ?>
|
||||
</div>
|
||||
<p>Can't wait? View the source and compile instructions on
|
||||
<a href="https://github.com/lbryio/lbry" class="link-primary">GitHub</a>.
|
||||
</p>
|
||||
<div class="notice notice-info">
|
||||
<p>LBRY is not yet out on your platform. You will receive an email as we expand LBRY to your preferred platform.</p>
|
||||
<?php if ($os == DownloadActions::OS_OSX): ?>
|
||||
<p>Arrival is expected by July 5.</p>
|
||||
<?php elseif ($os == DownloadActions::OS_WINDOWS): ?>
|
||||
<p>Arrival is expected this month.</p>
|
||||
<?php endif ?>
|
||||
</div>
|
|
@ -1,20 +0,0 @@
|
|||
<?php Response::setMetaDescription(__('Download/install the latest version of LBRY for %os%.', ['%os%' => $osTitle])) ?>
|
||||
<?php NavActions::setNavUri('/get') ?>
|
||||
<?php echo View::render('nav/header', ['isDark' => false]) ?>
|
||||
|
||||
<main class="column-fluid">
|
||||
<div class="span7">
|
||||
<div class="cover cover-dark cover-dark-grad content content-stretch content-dark">
|
||||
<h1>LBRY for <?php echo $osTitle ?> <span class="<?php echo $osIcon ?>"></span></h1>
|
||||
<p>LBRY is </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span5">
|
||||
<?php echo View::render('download/_list', [
|
||||
'excludeOs' => $os
|
||||
]) ?>
|
||||
<?php echo View::render('download/_social') ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php echo View::render('nav/footer') ?>
|
|
@ -1,39 +1,87 @@
|
|||
<?php Response::setMetaDescription(__('Download/install the latest version of LBRY for %os%.', ['%os%' => $osTitle])) ?>
|
||||
<?php Response::setMetaDescription(__('Download/install the latest version of LBRY.')) ?>
|
||||
<?php NavActions::setNavUri('/get') ?>
|
||||
<?php echo View::render('nav/header', ['isDark' => false]) ?>
|
||||
|
||||
<main class="column-fluid">
|
||||
<div class="span7">
|
||||
<div class="cover cover-dark cover-dark-grad content content-stretch content-dark">
|
||||
<h1>LBRY for <?php echo $osTitle ?> <span class="<?php echo $osIcon ?>"></span></h1>
|
||||
<?php if (!$hasMatchingInvite && !Session::get(Session::KEY_LIST_SUB_SUCCESS)): ?>
|
||||
<?php if ($hasInvite): ?>
|
||||
<div class="notice notice-error spacer1">Please enter a valid code.</div>
|
||||
<?php endif ?>
|
||||
<p>LBRY is currently in invite only mode. Enter your code below for access:</p>
|
||||
<form method="POST" action="/get">
|
||||
<div class="invite-submit">
|
||||
<input type="text" value="" name="invite" class="required standard" placeholder="abc123">
|
||||
<input type="submit" value="Access LBRY" name="subscribe" class="btn-alt">
|
||||
</div>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<p>Your code does not grant access until July 4th, 2016. Enter your email address below for a reminder.</p>
|
||||
<?php echo View::render('mail/joinList', [
|
||||
'submitLabel' => 'Go',
|
||||
'returnUrl' => '/get',
|
||||
'meta' => true,
|
||||
'btnClass' => 'btn-alt',
|
||||
'listId' => Mailchimp::LIST_GENERAL_ID,
|
||||
'mergeFields' => ['CLI' => 'No'],
|
||||
]) ?>
|
||||
<h1>Get LBRY</h1>
|
||||
<?php if (Session::get(Session::KEY_DOWNLOAD_ACCESS_ERROR)): ?>
|
||||
<div class="notice notice-error spacer1"><?php echo Session::get(Session::KEY_DOWNLOAD_ACCESS_ERROR) ?></div>
|
||||
<?php Session::unsetKey(Session::KEY_DOWNLOAD_ACCESS_ERROR) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (Session::get(Session::KEY_DOWNLOAD_REFERRAL_CODE)): ?>
|
||||
<div class="notice notice-info spacer1">
|
||||
<p>You are currently on the wait list. Move up the list and earn <?php echo i18n::formatCredits(25) ?> per referral by sharing this URL:</p>
|
||||
<p><a href="/get?r=<?php echo Session::get(Session::KEY_DOWNLOAD_REFERRAL_CODE) ?>">https://lbry.io/get?r=<?php echo Session::get(Session::KEY_DOWNLOAD_REFERRAL_CODE) ?></a></p>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<p>LBRY is currently in invite only mode. Enter your email to join the waitlist, or your email and invite code for access.</p>
|
||||
<form method="POST" action="/signup" id="signup-form" class="hide">
|
||||
<div class="hide">
|
||||
<input type="hidden" name="referrer_id" value="<?php echo $_GET['r'] ?: $_POST['r'] ?>" />
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="email">
|
||||
<?php echo __('Email') ?>
|
||||
</label>
|
||||
<div class="form-input">
|
||||
<input type="text" value="" name="email" class="required standard" placeholder="someone@somewhere.com">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="code_select">
|
||||
<?php echo __('Invite Code') ?>
|
||||
</label>
|
||||
<div class="form-input">
|
||||
<label class="label-radio">
|
||||
<input name="code_select" type="radio" value="" />
|
||||
None, but I want in as soon as possible!
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-input">
|
||||
<label class="label-radio">
|
||||
<input name="code_select" type="radio" value="yes" />
|
||||
Yes
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-input has-code">
|
||||
<input type="text" value="" name="code" class="required standard" placeholder="abc123">
|
||||
</div>
|
||||
</div>
|
||||
<div class="invite-submit has-code">
|
||||
<input type="submit" value="Access LBRY" name="subscribe" class="btn-alt">
|
||||
</div>
|
||||
<div class="invite-submit no-code">
|
||||
<input type="submit" value="Join List" name="subscribe" class="btn-alt">
|
||||
</div>
|
||||
</form>
|
||||
<?php js_start() ?>
|
||||
(function(){
|
||||
var form = $('#signup-form'),
|
||||
codeRadioInputs = form.find('input[name="code_select"]');
|
||||
codeRadioInputs.change(function() {
|
||||
var selectedInput = codeRadioInputs.filter(':checked'),
|
||||
choice = selectedInput.val(),
|
||||
hasChoice = selectedInput.length,
|
||||
hasCode = choice == 'yes';
|
||||
|
||||
form.find('.has-code')[hasChoice && hasCode ? 'show' : 'hide']();
|
||||
form.find('.no-code')[hasChoice && !hasCode ? 'show' : 'hide']();
|
||||
if (!hasCode)
|
||||
{
|
||||
form.find('input[name="code"]').val('');
|
||||
}
|
||||
}).change();
|
||||
|
||||
form.show();
|
||||
})();
|
||||
<?php js_end() ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span5">
|
||||
<?php echo View::render('download/_list', [
|
||||
'excludeOs' => $os
|
||||
]) ?>
|
||||
<?php echo View::render('download/_social') ?>
|
||||
</div>
|
||||
</main>
|
||||
|
|
33
view/template/download/getAllowed.php
Normal file
33
view/template/download/getAllowed.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php Response::setMetaDescription(__('Download/install the latest version of LBRY for %os%.', ['%os%' => $osTitle])) ?>
|
||||
<?php NavActions::setNavUri('/get') ?>
|
||||
<?php echo View::render('nav/header', ['isDark' => false]) ?>
|
||||
|
||||
<main class="column-fluid">
|
||||
<div class="span7">
|
||||
<div class="cover cover-dark cover-dark-grad content content-stretch content-dark">
|
||||
<h1>LBRY for <?php echo $osTitle ?> <span class="<?php echo $osIcon ?>"></span></h1>
|
||||
<?php if ($downloadHtml): ?>
|
||||
<?php echo View::render('download/_betaNotice') ?>
|
||||
<?php echo $downloadHtml ?>
|
||||
<?php else: ?>
|
||||
<?php echo View::render('download/_unavailable', [
|
||||
'os' => $os
|
||||
]) ?>
|
||||
<?php endif ?>
|
||||
<h3>Share and Earn</h3>
|
||||
<p>Earn <?php echo i18n::formatCredits(25) ?> per referral by sharing this URL:</p>
|
||||
<p><a href="/get?r=<?php echo Session::get(Session::KEY_DOWNLOAD_REFERRAL_CODE) ?>" class="link-primary">https://lbry.io/get?r=<?php echo Session::get(Session::KEY_DOWNLOAD_REFERRAL_CODE) ?></a></p>
|
||||
<?php echo View::render('download/_reward', [
|
||||
'inviteCode' => $inviteCode
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span5">
|
||||
<?php echo View::render('download/_list', [
|
||||
'excludeOs' => $os
|
||||
]) ?>
|
||||
<?php echo View::render('download/_social') ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php echo View::render('nav/footer') ?>
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
$input-width: 300px;
|
||||
|
||||
label[for]
|
||||
label[for], .label-radio
|
||||
{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
@ -35,6 +35,22 @@ textarea
|
|||
.form-row
|
||||
{
|
||||
margin-bottom: $spacing-vertical;
|
||||
> label
|
||||
{
|
||||
font-size: 0.8em;
|
||||
opacity: 0.9;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
input[type="checkbox"]
|
||||
{
|
||||
-webkit-appearance: checkbox;
|
||||
}
|
||||
|
||||
input[type="radio"]
|
||||
{
|
||||
-webkit-appearance: radio;
|
||||
}
|
||||
|
||||
.mail-submit, .invite-submit
|
||||
|
|
|
@ -31,13 +31,17 @@ $info_text: #3a87ad;
|
|||
}
|
||||
}
|
||||
|
||||
.notice
|
||||
.notice
|
||||
{
|
||||
padding: 10px 20px;
|
||||
border: 1px solid #000;
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
||||
a[href] { text-decoration: underline; }
|
||||
@include border-radius(5px);
|
||||
> p:last-child
|
||||
{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
.notice-success
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue