szurubooru/src/Views/user-settings.phtml
Marcin Kurczewski d01a087b30 Cosmetic changes
2014-01-27 09:21:52 +01:00

90 lines
2.6 KiB
PHTML

<form action="<?php echo \Chibi\UrlHelper::route('user', 'settings', ['name' => $this->context->transport->user->name]) ?>" method="post" class="settings aligned">
<div class="safety">
<label class="left">Safety:</label>
<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>
<?php endif ?>
<?php endforeach ?>
</div>
</div>
<div class="endless-scrolling">
<label class="left" for="endless-scrolling">Endless scrolling:</label>
<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);
?>
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>
<input type="hidden" name="submit" value="1"/>
<?php $this->renderFile('message') ?>
<div>
<label class="left">&nbsp;</label>
<button class="submit" type="submit">Update settings</button>
</div>
</form>