szurubooru/src/Views/user-settings.phtml

91 lines
2.6 KiB
PHTML
Raw Normal View History

2013-10-22 00:17:06 +02:00
<form action="<?php echo \Chibi\UrlHelper::route('user', 'settings', ['name' => $this->context->transport->user->name]) ?>" method="post" class="settings aligned">
<div class="safety">
2013-11-18 14:00:54 +01:00
<label class="left">Safety:</label>
2013-10-22 00:17:06 +02:00
<div class="input-wrapper">
<?php foreach (PostSafety::getAll() as $safety): ?>
<?php if (PrivilegesHelper::confirm(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);
?>
<?php echo TextHelper::camelCaseToHumanCase(PostSafety::toString($safety), true) ?>
</label>
2013-10-22 00:17:06 +02:00
<?php endif ?>
<?php endforeach ?>
</div>
</div>
<div class="endless-scrolling">
2013-11-18 14:00:54 +01:00
<label class="left" 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>
<div class="post-tag-titles">
<label class="left" 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>
<div class="hide-disliked-posts">
<label class="left" 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"/>
2013-11-16 18:40:26 +01:00
<?php $this->renderFile('message') ?>
2013-10-22 00:17:06 +02:00
<div>
<label class="left">&nbsp;</label>
<button class="submit" type="submit">Update settings</button>
2013-10-22 00:17:06 +02:00
</div>
</form>