szurubooru/src/Views/user-settings.phtml

97 lines
2.6 KiB
PHTML
Raw Normal View History

2014-04-30 00:11:13 +02:00
<form
action="<?= \Chibi\Router::linkTo(
['UserController', 'settingsAction'],
['name' => $this->context->transport->user->name]) ?>"
method="post"
class="settings">
2014-02-16 16:03:13 +01:00
<div class="form-row safety">
<label>Safety:</label>
2013-10-22 00:17:06 +02:00
<div class="input-wrapper">
<?php foreach (PostSafety::getAll() as $safety): ?>
<?php if (Access::check(Privilege::ListPosts, PostSafety::toString($safety))): ?>
<label>
<?php
$attrs = [];
$attrs['type'] = 'checkbox';
$attrs['name'] = 'safety[]';
$attrs['value'] = $safety;
if ($this->context->transport->user->hasEnabledSafety($safety))
$attrs['checked'] = 'checked';
echo TextHelper::htmlTag('input', TextHelper::HTML_LEAF, $attrs);
?>
2014-04-27 14:44:06 +02:00
<?= ucfirst(PostSafety::toDisplayString($safety)) ?>
</label>
2013-10-22 00:17:06 +02:00
<?php endif ?>
<?php endforeach ?>
</div>
</div>
2014-02-16 16:03:13 +01:00
<div class="form-row endless-scrolling">
<label for="endless-scrolling">Endless scrolling:</label>
2013-10-22 00:17:06 +02:00
<div class="input-wrapper">
<label>
<?php
$attrs = [];
$attrs['type'] = 'checkbox';
$attrs['id'] = 'endless-scrolling';
$attrs['name'] = 'endless-scrolling';
if ($this->context->transport->user->hasEnabledEndlessScrolling())
$attrs['checked'] = 'checked';
echo TextHelper::htmlTag('input', TextHelper::HTML_LEAF, $attrs);
?>
2013-10-22 00:17:06 +02:00
Enabled
</label>
</div>
</div>
2014-02-16 16:03:13 +01:00
<div class="form-row post-tag-titles">
<label for="post-tag-titles">Tags in thumbs:</label>
<div class="input-wrapper">
<label>
<?php
$attrs = [];
$attrs['type'] = 'checkbox';
$attrs['id'] = 'post-tag-titles';
$attrs['name'] = 'post-tag-titles';
if ($this->context->transport->user->hasEnabledPostTagTitles())
$attrs['checked'] = 'checked';
echo TextHelper::htmlTag('input', TextHelper::HTML_LEAF, $attrs);
?>
Enabled
</label>
</div>
</div>
2014-02-16 16:03:13 +01:00
<div class="form-row hide-disliked-posts">
<label for="hide-disliked-posts">Hide down-voted:</label>
<div class="input-wrapper">
<label>
<?php
$attrs = [];
$attrs['type'] = 'checkbox';
$attrs['id'] = 'hide-disliked-posts';
$attrs['name'] = 'hide-disliked-posts';
if ($this->context->transport->user->hasEnabledHidingDislikedPosts())
$attrs['checked'] = 'checked';
echo TextHelper::htmlTag('input', TextHelper::HTML_LEAF, $attrs);
?>
Enabled
</label>
</div>
</div>
2013-10-22 00:17:06 +02:00
<input type="hidden" name="submit" value="1"/>
2014-04-29 21:35:29 +02:00
<?php \Chibi\View::render('message', $this->context) ?>
2013-10-22 00:17:06 +02:00
2014-02-16 16:03:13 +01:00
<div class="form-row">
<label></label>
<button class="submit" type="submit">Update settings</button>
2013-10-22 00:17:06 +02:00
</div>
</form>