Always show channel description

This commit is contained in:
grandeljay 2022-11-29 17:01:44 +01:00
parent 1a4e911fb8
commit e964537b78
2 changed files with 60 additions and 48 deletions

View file

@ -65,6 +65,7 @@ $(function() {
/** /**
* Preferences * Preferences
*/ */
$('.ui.progress').progress();
/** Locale */ /** Locale */
var dropdown_locale_settings = { var dropdown_locale_settings = {

View file

@ -380,30 +380,6 @@ $page->navigation();
</div> </div>
</div> </div>
<div class="field">
<?php if (defined('CHANNELS') && is_array(CHANNELS)) { ?>
<script type="text/javascript">
var CHANNELS = <?= json_encode(CHANNELS) ?>;
</script>
<div class="field">
<label><?= __('Channel') ?></label>
<select class="ui search clearable dropdown channel" name="user-channel">
<option value=""><?= __('Select channel') ?></option>
<?php foreach (CHANNELS as $channel) { ?>
<?php if ($channel['branch'] === $_SESSION['user']->channel) { ?>
<option value="<?= $channel['branch'] ?>" selected><?= $channel['label'] ?></option>
<?php } else { ?>
<option value="<?= $channel['branch'] ?>"><?= $channel['label'] ?></option>
<?php } ?>
<?php } ?>
</select>
</div>
<?php } ?>
</div>
<div class="field"> <div class="field">
<label><?= __('Advertisements') ?></label> <label><?= __('Advertisements') ?></label>
@ -478,35 +454,70 @@ $page->navigation();
$count_users_rc = reset($count_users_rc); $count_users_rc = reset($count_users_rc);
?> ?>
<?php if ($count_users_rc < $count_users_needed) { ?> <div class="ui segment">
<h3 class="ui header"><?= __('Channel') ?></h3> <form class="ui form" method="POST">
<input type="hidden" name="user-id" value="<?= $_SESSION['user']->id ?>" />
<input type="hidden" name="section" value="preferences" />
<div class="ui segment"> <?php if (defined('CHANNELS') && is_array(CHANNELS)) { ?>
<p><?= __('In order to improve the user experience of wishthis, newer versions are published after an extensive testing period.') ?></p> <script type="text/javascript">
<p><?= __('Subscribing to the Stable channel ensures you have the highest possible stability while using wishthis, minimizing the amount of errors you may encounter (if any).') ?></p> var CHANNELS = <?= json_encode(CHANNELS) ?>;
<p><?= __('If you want to speed up the release of newer versions, consider subscribing to the Release candidate of wishthis. A newer version is not published unless the next release candidate has been sufficiently tested.') ?></p> </script>
<div class="ui primary progress" data-value="<?= $count_users_rc ?>" data-total="<?= $count_users_needed ?>"> <div class="field">
<div class="bar"> <label><?= __('Channel') ?></label>
<div class="progress"></div>
<select class="ui search clearable dropdown channel" name="user-channel">
<option value=""><?= __('Select channel') ?></option>
<?php foreach (CHANNELS as $channel) { ?>
<?php if ($channel['branch'] === $_SESSION['user']->channel) { ?>
<option value="<?= $channel['branch'] ?>" selected><?= $channel['label'] ?></option>
<?php } else { ?>
<option value="<?= $channel['branch'] ?>"><?= $channel['label'] ?></option>
<?php } ?>
<?php } ?>
</select>
</div> </div>
<div class="label">
<?php
$count_users_needed = $count_users_needed - $count_users_rc;
printf( <div class="field">
_n( <p><?= __('In order to improve the user experience of wishthis, newer versions are published after an extensive testing period.') ?></p>
'%d more subscriber needed', <p><?= __('Subscribing to the Stable channel ensures you have the highest possible stability while using wishthis, minimizing the amount of errors you may encounter (if any).') ?></p>
'%d more subscribers needed', <p><?= __('If you want to speed up the release of newer versions, consider subscribing to the Release candidate of wishthis. A newer version is not published unless the next release candidate has been sufficiently tested.') ?></p>
$count_users_needed
), <?php if ($count_users_rc < $count_users_needed) { ?>
$count_users_needed <div class="ui primary progress" data-value="<?= $count_users_rc ?>" data-total="<?= $count_users_needed ?>">
) <div class="bar">
?> <div class="progress"></div>
</div>
<div class="label">
<?php
$count_users_needed = $count_users_needed - $count_users_rc;
printf(
_n(
'%d more subscriber needed',
'%d more subscribers needed',
$count_users_needed
),
$count_users_needed
)
?>
</div>
</div>
<?php } ?>
</div> </div>
</div> <?php } ?>
</div>
<?php } ?> <div class="ui error message"></div>
<input class="ui primary button"
type="submit"
value="<?= __('Save') ?>"
title="<?= __('Save') ?>"
/>
</form>
</div>
</div> </div>