mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 09:37:26 +00:00
restore pr, adjust notices
This commit is contained in:
parent
d7f62b1b24
commit
ec9825a856
5 changed files with 49 additions and 64 deletions
|
@ -78,45 +78,19 @@ class MailActions extends Actions
|
|||
|
||||
public static function prepareSettingsFormPartial(array $vars)
|
||||
{
|
||||
return $vars + [
|
||||
'tagMetadata' => [
|
||||
'3d-printing' => [
|
||||
'label' => '3D Printing',
|
||||
'description' => 'Receive updates, tips, and new content suggestions related to 3D Printing.'
|
||||
],
|
||||
'android' => [
|
||||
'label' => 'Android',
|
||||
'description' => 'Be an Android beta tester, earn LBC, and receive notification when the app goes live!'
|
||||
],
|
||||
'college' => [
|
||||
'label' => 'University',
|
||||
'description' => 'LBRY has special programs and opportunities for people in school.'
|
||||
],
|
||||
'creator' => [
|
||||
'label' => 'Creator',
|
||||
'description' => 'Get the most out of the stuff you create with tips and feedback from LBRY.'
|
||||
],
|
||||
'consumer' => [
|
||||
'label' => 'Content Lover',
|
||||
'description' => 'Learn how to get the most out of LBRY as someone who just wants to find cool stuff.'
|
||||
],
|
||||
'developer' => [
|
||||
'label' => 'Developer',
|
||||
'description' => 'Receive technical updates and other news intended for those who are familiar with software engineering.'
|
||||
],
|
||||
'ios' => [
|
||||
'label' => 'iPhone',
|
||||
'description' => 'Be an iOS alpha tester, earn LBC, and receive notification when the app goes live!'
|
||||
],
|
||||
'reward' => [
|
||||
'label' => 'Rewards',
|
||||
'description' => 'Receive emails about the latest rewards that are available to LBRY users.'
|
||||
],
|
||||
'subscription' => [
|
||||
'label' => 'Subscriptions',
|
||||
'description' => 'Stay up to date on the latest content from your favorite creators.'
|
||||
],
|
||||
]
|
||||
$tags = LBRY::listTags($vars['token']);
|
||||
$tagMetadata = [];
|
||||
$specialDisplayNames = [
|
||||
'ios' => 'iOS'
|
||||
];
|
||||
foreach($tags as $tag) {
|
||||
if ($tag['is_user_addable']) {
|
||||
$tagMetadata[$tag['name']] = [
|
||||
'label' => $specialDisplayNames[$tag['name']] ?? ucwords(str_replace(['-', '_'], ' ', $tag['name'])),
|
||||
'description' => $tag['description']
|
||||
];
|
||||
}
|
||||
}
|
||||
return $vars + ['tagMetadata' => $tagMetadata];
|
||||
}
|
||||
}
|
||||
|
|
7
lib/thirdparty/LBRY.class.php
vendored
7
lib/thirdparty/LBRY.class.php
vendored
|
@ -21,6 +21,13 @@ class LBRY
|
|||
return $response['data']['lbc_usd'] ?? 0;
|
||||
}
|
||||
|
||||
public static function listTags($authToken)
|
||||
{
|
||||
echo $authToken;
|
||||
$response = Curl::get(static::getApiUrl('/tag/list'), ['auth_token' => $authToken], ['json_response' => true]);
|
||||
return $response['data'] ?? [];
|
||||
}
|
||||
|
||||
public static function subscribe($email, $tag = null)
|
||||
{
|
||||
return Curl::post(static::getApiUrl('/list/subscribe'), array_filter([
|
||||
|
|
|
@ -58,7 +58,8 @@
|
|||
<meta name="twitter:creator" content="@lbryio"/>
|
||||
<meta name="twitter:description" content="<?php echo Response::getMetaDescription() ?>"/>
|
||||
<?php if (Response::getMetaImages()): ?>
|
||||
<?php $url = reset(Response::getMetaImages()) ?>
|
||||
<?php $images = Response::getMetaImages() ?>
|
||||
<?php $url = reset($images) ?>
|
||||
<meta name="twitter:image" content="<?php echo $url ?>" />
|
||||
<?php endif ?>
|
||||
|
||||
|
|
|
@ -11,49 +11,55 @@
|
|||
<div class="notice notice-error spacer1"><?php echo $error ?></div>
|
||||
<?php else: ?>
|
||||
<form id="<?php echo $formId ?>" novalidate style="display: none">
|
||||
<section class="email-section" style="position: relative;">
|
||||
<section class="email-section">
|
||||
<div style="min-height: 33px"> <?php //hack fix to prevent jumping ?>
|
||||
<div class="notice notice-error hide spacer-half"></div>
|
||||
<div class="notice notice-success hide spacer-half">Your email preferences have been updated.</div>
|
||||
</div>
|
||||
<h4><?php echo count($emails) > 1 ? 'Receiving Addresses' : 'Do You Want To Receive Mail?' ?></h4>
|
||||
<?php if (count($emails) > 1): ?>
|
||||
<div class="meta spacer-half">Uncheck all boxes if you want to receive no future messages.</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="notice notice-error hide spacer-half"></div>
|
||||
<div class="notice notice-success hide spacer-half">Your email preferences have been updated.</div>
|
||||
|
||||
<?php $emailIndex = 0 ?>
|
||||
|
||||
<?php foreach ($emails as $email => $enabled): ?>
|
||||
<?php $emailId = 'email_' . (++$emailIndex) ?>
|
||||
<checkbox-element>
|
||||
<input id="<?php echo $emailId ?>" name="<?php echo $emailId ?>" type="checkbox"<?php echo $enabled ? " checked" : "" ?> value="<?php echo urlencode($email) ?>"/>
|
||||
<label for="<?php echo $emailId ?>"><?php echo $email ?></label>
|
||||
<label for="<?php echo $emailId ?>"><?php echo count($emails) > 1 ? $email : __('Yes') . ' (' . $email . ')' ?></label>
|
||||
<checkbox-toggle/>
|
||||
</checkbox-element>
|
||||
<?php endforeach ?>
|
||||
</section>
|
||||
|
||||
<section class="tag-section spacer1" style="position: relative;">
|
||||
<section class="tag-section spacer1">
|
||||
<div style="min-height: 33px"> <?php //hack fix to prevent jumping ?>
|
||||
<div class="notice notice-error hide spacer-half"></div>
|
||||
<div class="notice notice-success hide spacer-half">Your email preferences have been updated.</div>
|
||||
</div>
|
||||
<h4>Fine-tune your Mail</h4>
|
||||
<div class="notice notice-error hide spacer-half"></div>
|
||||
<div class="notice notice-success hide spacer-half">Your email preferences have been updated.</div>
|
||||
|
||||
<?php $tagIndex = 0 ?>
|
||||
<?php foreach ($tags as $tag => $enabled): ?>
|
||||
<?php if (!isset($tagMetadata[$tag])) {
|
||||
continue;
|
||||
} //fix/kill this?>
|
||||
<?php if (!isset($tagMetadata[$tag])) continue; ?>
|
||||
<?php $tagId = 'tag_' . (++$tagIndex) ?>
|
||||
<checkbox-element>
|
||||
<input id="<?php echo $tagId ?>" name="<?php echo $tagId ?>" type="checkbox"<?php echo $enabled ? " checked" : "" ?> value="<?php echo urlencode($tag) ?>"/>
|
||||
<label for="<?php echo $tagId ?>">
|
||||
<?php echo isset($tagMetadata[$tag]['label']) ? $tagMetadata[$tag]['label'] : $tag ?>
|
||||
<?php if (isset($tagMetadata[$tag]['description'])): ?>
|
||||
<span class="meta">· <?php echo $tagMetadata[$tag]['description'] ?></small>
|
||||
<?php endif ?>
|
||||
</label>
|
||||
<checkbox-toggle/>
|
||||
</checkbox-element>
|
||||
<div>
|
||||
<checkbox-element>
|
||||
<input id="<?php echo $tagId ?>" name="<?php echo $tagId ?>" type="checkbox"<?php echo $enabled ? " checked" : "" ?> value="<?php echo urlencode($tag) ?>"/>
|
||||
<label for="<?php echo $tagId ?>">
|
||||
<?php echo isset($tagMetadata[$tag]['label']) ? $tagMetadata[$tag]['label'] : $tag ?>
|
||||
<?php if (isset($tagMetadata[$tag]['description'])): ?>
|
||||
<span class="meta">· <?php echo $tagMetadata[$tag]['description'] ?></span>
|
||||
<?php endif ?>
|
||||
</label>
|
||||
<checkbox-toggle/>
|
||||
</checkbox-element>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
<?php if ($tagIndex === 0): ?>
|
||||
<div class="notice notice-error"><?php echo __('Something went wrong. Please email help@lbry.com') ?></div>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
</form>
|
||||
<?php endif ?>
|
||||
|
|
|
@ -9,13 +9,10 @@
|
|||
}
|
||||
|
||||
.notice {
|
||||
top: -0.5rem; right: 0;
|
||||
|
||||
border: 1px solid var(--lbry-gray-1);
|
||||
font-size: 0.8rem;
|
||||
// margin-bottom: 0.5rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
position: absolute;
|
||||
|
||||
[href] {
|
||||
text-decoration: underline;
|
||||
|
|
Loading…
Add table
Reference in a new issue