Split long lines in views
This commit is contained in:
parent
60208407ea
commit
da1f5d8ab2
31 changed files with 519 additions and 157 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit c660801c2b1d9dcd1807270f2a3ad18dcdcabc6f
|
Subproject commit b6097259d4da7f337718c1afe9a285daa7185f19
|
|
@ -32,14 +32,14 @@
|
||||||
.comment .delete {
|
.comment .delete {
|
||||||
font-size: small;
|
font-size: small;
|
||||||
}
|
}
|
||||||
.comment .edit:before,
|
.comment .edit a:before,
|
||||||
.comment .delete:before {
|
.comment .delete a:before {
|
||||||
margin-left: 0.2em;
|
margin-left: 0.2em;
|
||||||
content: ' [';
|
content: ' [';
|
||||||
color: silver;
|
color: silver;
|
||||||
}
|
}
|
||||||
.comment .edit:after,
|
.comment .edit a:after,
|
||||||
.comment .delete:after {
|
.comment .delete a:after {
|
||||||
content: ']';
|
content: ']';
|
||||||
color: silver;
|
color: silver;
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ footer a {
|
||||||
|
|
||||||
|
|
||||||
#sidebar .key {
|
#sidebar .key {
|
||||||
padding-right: 0.5em;
|
padding-right: 0.3em;
|
||||||
}
|
}
|
||||||
#sidebar .key-value {
|
#sidebar .key-value {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
code {
|
||||||
font-size: 11pt;
|
font-size: 11pt;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre strong {
|
code strong {
|
||||||
background: #fee;
|
background: #fee;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,15 @@ embed {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#sidebar .score a:first-of-type:before {
|
||||||
|
content: '[';
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
#sidebar .score a:last-of-type:after {
|
||||||
|
content: ']';
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
#sidebar .left a,
|
#sidebar .left a,
|
||||||
#sidebar .right a {
|
#sidebar .right a {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -140,7 +149,7 @@ i.icon-fav {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.hl-option span {
|
.hl-option span {
|
||||||
padding-left: 0.6em;
|
padding-left: 0.4em;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.permalink .ext:after {
|
.permalink .ext:after {
|
||||||
|
|
|
@ -222,13 +222,6 @@ class TextHelper
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function secureWhitespace($text)
|
|
||||||
{
|
|
||||||
$text = str_replace(["\r\n", "\r", "\n"], ' ', $text);
|
|
||||||
$text = str_replace(' ', ' ', $text);
|
|
||||||
return $text;
|
|
||||||
}
|
|
||||||
|
|
||||||
const HTML_OPEN = 1;
|
const HTML_OPEN = 1;
|
||||||
const HTML_CLOSE = 2;
|
const HTML_CLOSE = 2;
|
||||||
const HTML_LEAF = 3;
|
const HTML_LEAF = 3;
|
||||||
|
|
|
@ -4,7 +4,10 @@ CustomAssetViewDecorator::addStylesheet('auth.css');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="<?= \Chibi\UrlHelper::route('auth', 'login') ?>" class="auth" method="post">
|
<form action="<?= \Chibi\UrlHelper::route('auth', 'login') ?>" class="auth" method="post">
|
||||||
<p>If you don't have an account yet,<br/><a href="<?= \Chibi\UrlHelper::route('user', 'registration'); ?>">click here</a> to create a new one.</p>
|
<p>
|
||||||
|
If you don't have an account yet,<br/>
|
||||||
|
<a href="<?= \Chibi\UrlHelper::route('user', 'registration'); ?>">click here</a> to create a new one.
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="name">User name:</label>
|
<label for="name">User name:</label>
|
||||||
|
@ -22,10 +25,7 @@ CustomAssetViewDecorator::addStylesheet('auth.css');
|
||||||
<button class="submit" type="submit">Log in</button>
|
<button class="submit" type="submit">Log in</button>
|
||||||
|
|
||||||
<input type="hidden" name="remember" value="0"/>
|
<input type="hidden" name="remember" value="0"/>
|
||||||
<label>
|
<label><input type="checkbox" name="remember" value="1"/> Remember me</label>
|
||||||
<input type="checkbox" name="remember" value="1"/>
|
|
||||||
Remember me
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,11 @@ CustomAssetViewDecorator::addStylesheet('comment-edit.css');
|
||||||
CustomAssetViewDecorator::addScript('comment-edit.js');
|
CustomAssetViewDecorator::addScript('comment-edit.js');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="<?= \Chibi\UrlHelper::route('comment', 'add', ['postId' => $this->context->transport->post->id]) ?>" method="post" class="add-comment">
|
<form
|
||||||
|
action="<?= \Chibi\UrlHelper::route('comment', 'add', ['postId' => $this->context->transport->post->id]) ?>"
|
||||||
|
method="post"
|
||||||
|
class="add-comment">
|
||||||
|
|
||||||
<h1>add comment</h1>
|
<h1>add comment</h1>
|
||||||
|
|
||||||
<div class="preview"></div>
|
<div class="preview"></div>
|
||||||
|
|
|
@ -3,13 +3,19 @@ CustomAssetViewDecorator::addStylesheet('comment-edit.css');
|
||||||
CustomAssetViewDecorator::addScript('comment-edit.js');
|
CustomAssetViewDecorator::addScript('comment-edit.js');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="<?= \Chibi\UrlHelper::route('comment', 'edit', ['id' => $this->context->transport->comment->id]) ?>" method="post" class="edit-comment">
|
<form
|
||||||
|
action="<?= \Chibi\UrlHelper::route('comment', 'edit', ['id' => $this->context->transport->comment->id]) ?>"
|
||||||
|
method="post"
|
||||||
|
class="edit-comment">
|
||||||
|
|
||||||
<h1>edit comment</h1>
|
<h1>edit comment</h1>
|
||||||
|
|
||||||
<div class="preview"></div>
|
<div class="preview"></div>
|
||||||
|
|
||||||
<div class="form-row text">
|
<div class="form-row text">
|
||||||
<div class="input-wrapper"><textarea name="text" cols="50" rows="3"><?= TextHelper::secureWhitespace($this->context->transport->comment->text) ?></textarea></div>
|
<div class="input-wrapper">
|
||||||
|
<textarea name="text" cols="50" rows="3"><?= $this->context->transport->comment->text ?></textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="submit" value="1"/>
|
<input type="hidden" name="submit" value="1"/>
|
||||||
|
|
|
@ -17,17 +17,20 @@ CustomAssetViewDecorator::setSubTitle('comments');
|
||||||
<?php foreach ($this->context->transport->posts as $post): ?>
|
<?php foreach ($this->context->transport->posts as $post): ?>
|
||||||
<div class="comment-group">
|
<div class="comment-group">
|
||||||
<div class="post-wrapper">
|
<div class="post-wrapper">
|
||||||
<?php $this->context->post = $post ?>
|
<?php
|
||||||
|
$this->context->post = $post;
|
||||||
|
$comments = array_reverse($post->getComments());
|
||||||
|
$commentsToDisplay = array_slice($comments, 0, $this->config->comments->maxCommentsInList);
|
||||||
|
?>
|
||||||
<?= $this->renderFile('post-small') ?>
|
<?= $this->renderFile('post-small') ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="comments">
|
<div class="comments">
|
||||||
<?php $comments = array_reverse($post->getComments()) ?>
|
<?php foreach ($commentsToDisplay as $comment): ?>
|
||||||
<?php foreach (array_slice($comments, 0, $this->config->comments->maxCommentsInList) as $comment): ?>
|
|
||||||
<?php $this->context->comment = $comment ?>
|
<?php $this->context->comment = $comment ?>
|
||||||
<?= $this->renderFile('comment-small') ?>
|
<?= $this->renderFile('comment-small') ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|
||||||
<?php if (count($comments) > $this->config->comments->maxCommentsInList): ?>
|
<?php if (count($comments) > count($commentsToDisplay)): ?>
|
||||||
<a href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
|
||||||
<span class="hellip">(more…)</span>
|
<span class="hellip">(more…)</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -12,7 +12,9 @@ CustomAssetViewDecorator::addScript('comment-edit.js');
|
||||||
<img src="<?= htmlspecialchars($commenter->getAvatarUrl(40)) ?>" alt="<?= $commenter->name ?>"/>
|
<img src="<?= htmlspecialchars($commenter->getAvatarUrl(40)) ?>" alt="<?= $commenter->name ?>"/>
|
||||||
</a>
|
</a>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<img src="<?= \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>" alt="<?= UserModel::getAnonymousName() ?>">
|
<img
|
||||||
|
src="<?= \Chibi\UrlHelper::absoluteUrl('/media/img/pixel.gif') ?>"
|
||||||
|
alt="<?= UserModel::getAnonymousName() ?>">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -32,7 +34,9 @@ CustomAssetViewDecorator::addScript('comment-edit.js');
|
||||||
<?= TextHelper::formatDate($this->context->comment->commentDate, false) ?>
|
<?= TextHelper::formatDate($this->context->comment->commentDate, false) ?>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::EditComment, PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::EditComment,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?>
|
||||||
<span class="edit">
|
<span class="edit">
|
||||||
<a href="<?= \Chibi\UrlHelper::route('comment', 'edit', ['id' => $this->context->comment->id]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('comment', 'edit', ['id' => $this->context->comment->id]) ?>">
|
||||||
edit
|
edit
|
||||||
|
@ -40,9 +44,13 @@ CustomAssetViewDecorator::addScript('comment-edit.js');
|
||||||
</span>
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::DeleteComment, PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?>
|
<?php if (
|
||||||
|
PrivilegesHelper::confirm(Privilege::DeleteComment,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($commenter))): ?>
|
||||||
<span class="delete">
|
<span class="delete">
|
||||||
<a class="simple-action confirmable" href="<?= \Chibi\UrlHelper::route('comment', 'delete', ['id' => $this->context->comment->id]) ?>" data-confirm-text="Are you sure you want to delete this comment?">
|
<a href="<?= \Chibi\UrlHelper::route('comment', 'delete', ['id' => $this->context->comment->id]) ?>"
|
||||||
|
class="simple-action confirmable"
|
||||||
|
data-confirm-text="Are you sure you want to delete this comment?">
|
||||||
delete
|
delete
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -12,8 +12,12 @@ CustomAssetViewDecorator::addStylesheet('index-index.css');
|
||||||
|
|
||||||
<?php if (!empty($this->context->featuredPost)): ?>
|
<?php if (!empty($this->context->featuredPost)): ?>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<?php $this->context->imageLink = \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->featuredPost->id]) ?>
|
<?php
|
||||||
<?php $this->context->transport->post = $this->context->featuredPost ?>
|
$this->context->transport->post = $this->context->featuredPost;
|
||||||
|
$this->context->imageLink = \Chibi\UrlHelper::route('post', 'view', [
|
||||||
|
'id' => $this->context->featuredPost->id]);
|
||||||
|
?>
|
||||||
|
|
||||||
<?= $this->renderFile('post-file-render') ?>
|
<?= $this->renderFile('post-file-render') ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -34,10 +38,14 @@ CustomAssetViewDecorator::addStylesheet('index-index.css');
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="right">
|
<div class="right">
|
||||||
Featured 
|
Featured
|
||||||
<?php if ($this->context->featuredPostUser): ?>
|
<?php if ($this->context->featuredPostUser): ?>
|
||||||
by <a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>"><?= $this->context->featuredPostUser->name ?></a>, 
|
by
|
||||||
|
<a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->featuredPostUser->name]) ?>">
|
||||||
|
<?= $this->context->featuredPostUser->name ?>
|
||||||
|
</a>,
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)) ?>
|
<?php $x = round((time() - $this->context->featuredPostDate) / (24 * 3600.)) ?>
|
||||||
<?php if ($x == 0): ?>
|
<?php if ($x == 0): ?>
|
||||||
today
|
today
|
||||||
|
|
|
@ -35,6 +35,7 @@ else
|
||||||
'Content-Type',
|
'Content-Type',
|
||||||
$this->context->transport->mimeType);
|
$this->context->transport->mimeType);
|
||||||
|
|
||||||
|
|
||||||
if (strtotime($ifModifiedSince) == $lastModified or $eTagHeader == $eTag)
|
if (strtotime($ifModifiedSince) == $lastModified or $eTagHeader == $eTag)
|
||||||
{
|
{
|
||||||
header('HTTP/1.1 304 Not Modified');
|
header('HTTP/1.1 304 Not Modified');
|
||||||
|
|
|
@ -16,7 +16,10 @@ CustomAssetViewDecorator::addScript('core.js');
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var lastSearchQuery = <?= json_encode(isset($this->context->transport->lastSearchQuery) ? $this->context->transport->lastSearchQuery : '') ?>;
|
var lastSearchQuery = <?= json_encode(
|
||||||
|
isset($this->context->transport->lastSearchQuery)
|
||||||
|
? $this->context->transport->lastSearchQuery
|
||||||
|
:'') ?>;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<nav id="top-nav">
|
<nav id="top-nav">
|
||||||
|
|
|
@ -3,21 +3,28 @@ CustomAssetViewDecorator::setSubTitle('logs (' . $name . ')');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (empty($this->context->transport->lines)): ?>
|
<?php if (empty($this->context->transport->lines)): ?>
|
||||||
<p class="alert alert-warning">This log is empty. <a href="<?= \Chibi\UrlHelper::route('log', 'list') ?>">Go back</a></p>
|
<p class="alert alert-warning">
|
||||||
|
This log is empty. <a href="<?= \Chibi\UrlHelper::route('log', 'list') ?>">Go back</a>
|
||||||
|
</p>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php
|
<?php
|
||||||
CustomAssetViewDecorator::addStylesheet('logs.css');
|
CustomAssetViewDecorator::addStylesheet('logs.css');
|
||||||
CustomAssetViewDecorator::addScript('logs.js');
|
CustomAssetViewDecorator::addScript('logs.js');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="<?= \Chibi\UrlHelper::route('log', 'view', ['name' => $this->context->transport->name]) ?>" method="get">
|
<form method="get"
|
||||||
|
action="<?= \Chibi\UrlHelper::route('log', 'view', ['name' => $this->context->transport->name]) ?>">
|
||||||
|
|
||||||
Keep only lines that contain:
|
Keep only lines that contain:
|
||||||
|
|
||||||
<input type="text" name="query" value="<?= htmlspecialchars($this->context->transport->filter) ?>" placeholder="any text…"/>
|
<input type="text"
|
||||||
|
name="query"
|
||||||
|
value="<?= htmlspecialchars($this->context->transport->filter) ?>"
|
||||||
|
placeholder="any text…"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="paginator-content">
|
<div class="paginator-content">
|
||||||
<pre><?= $this->context->transport->lines ?></pre>
|
<code><?= $this->context->transport->lines ?></code>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php $this->renderFile('paginator') ?>
|
<?php $this->renderFile('paginator') ?>
|
||||||
|
|
|
@ -1,12 +1,30 @@
|
||||||
<form action="<?= \Chibi\UrlHelper::route('post', 'edit', ['id' => $this->context->transport->post->id]) ?>" method="post" enctype="multipart/form-data" class="edit-post">
|
<form method="post"
|
||||||
|
action="<?= \Chibi\UrlHelper::route('post', 'edit', ['id' => $this->context->transport->post->id]) ?>"
|
||||||
|
enctype="multipart/form-data"
|
||||||
|
class="edit-post">
|
||||||
|
|
||||||
<h1>edit post</h1>
|
<h1>edit post</h1>
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::EditPostSafety, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
|
||||||
|
<input type="hidden"
|
||||||
|
name="edit-token"
|
||||||
|
id="edit-token"
|
||||||
|
value="<?= htmlspecialchars($this->context->transport->post->getEditToken()) ?>"/>
|
||||||
|
|
||||||
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::EditPostSafety,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
||||||
|
|
||||||
<div class="form-row safety">
|
<div class="form-row safety">
|
||||||
<label>Safety:</label>
|
<label>Safety:</label>
|
||||||
<div class="input-wrapper">
|
<div class="input-wrapper">
|
||||||
<?php foreach (PostSafety::getAll() as $safety): ?>
|
<?php foreach (PostSafety::getAll() as $safety): ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="safety" value="<?= $safety ?>" <?php if ($this->context->transport->post->safety == $safety) echo 'checked="checked"' ?>/>
|
<input type="radio"
|
||||||
|
name="safety"
|
||||||
|
<?php if ($this->context->transport->post->safety == $safety): ?>
|
||||||
|
checked="checked"
|
||||||
|
<?php endif ?>
|
||||||
|
value="<?= $safety ?>"/>
|
||||||
<?= ucfirst(PostSafety::toDisplayString($safety)) ?>
|
<?= ucfirst(PostSafety::toDisplayString($safety)) ?>
|
||||||
</label>
|
</label>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
@ -14,41 +32,80 @@
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::EditPostTags, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::EditPostTags,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
||||||
|
|
||||||
<div class="form-row tags">
|
<div class="form-row tags">
|
||||||
<label for="tags">Tags:</label>
|
<label for="tags">Tags:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="tags" id="tags" placeholder="enter some tags…" value="<?= join(',', array_map(function($tag) { return htmlspecialchars($tag->name); }, $this->context->transport->post->getTags())) ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="text"
|
||||||
|
name="tags"
|
||||||
|
id="tags"
|
||||||
|
placeholder="enter some tags…"
|
||||||
|
value="<?= join(',', array_map(function($tag) {
|
||||||
|
return htmlspecialchars($tag->name);
|
||||||
|
}, $this->context->transport->post->getTags())) ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="edit-token" id="edit-token" value="<?= htmlspecialchars($this->context->transport->post->getEditToken()) ?>"/>
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::EditPostSource, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
<?php if (
|
||||||
|
PrivilegesHelper::confirm(Privilege::EditPostSource,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
||||||
|
|
||||||
<div class="form-row source">
|
<div class="form-row source">
|
||||||
<label for="source">Source:</label>
|
<label for="source">Source:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="source" id="source" value="<?= htmlspecialchars($this->context->transport->post->source) ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="text"
|
||||||
|
name="source"
|
||||||
|
id="source"
|
||||||
|
value="<?= htmlspecialchars($this->context->transport->post->source) ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::EditPostRelations, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
<?php if (
|
||||||
|
PrivilegesHelper::confirm(Privilege::EditPostRelations,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
||||||
|
|
||||||
<div class="form-row thumb">
|
<div class="form-row thumb">
|
||||||
<label for="relations">Relations:</label>
|
<label for="relations">Relations:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="relations" id="relations" placeholder="id1,id2,…" value="<?= join(',', array_map(function($post) { return $post->id; }, $this->context->transport->post->getRelations())) ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="text"
|
||||||
|
name="relations"
|
||||||
|
id="relations"
|
||||||
|
placeholder="id1,id2,…"
|
||||||
|
value="<?= join(',', array_map(function($post) {
|
||||||
|
return $post->id;
|
||||||
|
}, $this->context->transport->post->getRelations())) ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::EditPostFile, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
<?php if (
|
||||||
|
PrivilegesHelper::confirm(Privilege::EditPostFile,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
||||||
|
|
||||||
<div class="form-row url">
|
<div class="form-row url">
|
||||||
<label for="url">File:</label>
|
<label for="url">File:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="url" id="url" placeholder="Some url…"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="text" name="url" id="url" placeholder="Some url…"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row file">
|
<div class="form-row file">
|
||||||
<label for="file"></label>
|
<label for="file"></label>
|
||||||
<div class="input-wrapper"><input type="file" name="file" id="file"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="file" name="file" id="file"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::EditPostThumb, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
<?php if (
|
||||||
|
PrivilegesHelper::confirm(Privilege::EditPostThumb,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
||||||
|
|
||||||
<div class="form-row thumb">
|
<div class="form-row thumb">
|
||||||
<label for="thumb">Thumb:</label>
|
<label for="thumb">Thumb:</label>
|
||||||
<div class="input-wrapper">
|
<div class="input-wrapper">
|
||||||
|
|
|
@ -15,19 +15,33 @@
|
||||||
|
|
||||||
<?php elseif ($post->type == PostType::Flash): ?>
|
<?php elseif ($post->type == PostType::Flash): ?>
|
||||||
|
|
||||||
<object type="<?= $post->mimeType ?>" width="<?= $post->imageWidth ?>" height="<?= $post->imageHeight ?>" data="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>">
|
<object
|
||||||
|
type="<?= $post->mimeType ?>"
|
||||||
|
width="<?= $post->imageWidth ?>"
|
||||||
|
height="<?= $post->imageHeight ?>"
|
||||||
|
data="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>">
|
||||||
|
|
||||||
<param name="movie" value="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>"/>
|
<param name="movie" value="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>"/>
|
||||||
<param name="wmode" value="opaque"/>
|
<param name="wmode" value="opaque"/>
|
||||||
|
|
||||||
</object>
|
</object>
|
||||||
|
|
||||||
<?php elseif ($post->type == PostType::Youtube): ?>
|
<?php elseif ($post->type == PostType::Youtube): ?>
|
||||||
|
|
||||||
<iframe style="width: 800px; height: 600px; border: 0;" src="//www.youtube.com/embed/<?= $post->fileHash ?>?wmode=opaque" allowfullscreen></iframe>
|
<iframe
|
||||||
|
style="width: 800px; height: 600px; border: 0;"
|
||||||
|
src="//www.youtube.com/embed/<?= $post->fileHash ?>?wmode=opaque"
|
||||||
|
allowfullscreen>
|
||||||
|
|
||||||
|
</iframe>
|
||||||
|
|
||||||
<?php elseif ($post->type == PostType::Video): ?>
|
<?php elseif ($post->type == PostType::Video): ?>
|
||||||
|
|
||||||
<video style="max-width: 100%" controls>
|
<video style="max-width: 100%" controls>
|
||||||
<source type="<?= $post->mimeType ?>" src="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>">
|
<source
|
||||||
|
type="<?= $post->mimeType ?>"
|
||||||
|
src="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>">
|
||||||
|
|
||||||
Your browser doesn't support HTML5 <video> tag.
|
Your browser doesn't support HTML5 <video> tag.
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,13 @@ if (PrivilegesHelper::confirm(Privilege::MassTag))
|
||||||
{
|
{
|
||||||
$tabs []= ['Mass tag', \Chibi\UrlHelper::route('post', 'list', [
|
$tabs []= ['Mass tag', \Chibi\UrlHelper::route('post', 'list', [
|
||||||
'source' => 'mass-tag',
|
'source' => 'mass-tag',
|
||||||
'query' => isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '',
|
'query' => isset($this->context->transport->searchQuery)
|
||||||
'page' => isset($this->context->transport->paginator) ? $this->context->transport->paginator->page : 1])];
|
? htmlspecialchars($this->context->transport->searchQuery)
|
||||||
|
: '',
|
||||||
|
'page' => isset($this->context->transport->paginator)
|
||||||
|
? $this->context->transport->paginator->page
|
||||||
|
: 1])];
|
||||||
|
|
||||||
if ($this->context->source == 'mass-tag')
|
if ($this->context->source == 'mass-tag')
|
||||||
$activeTab = count($tabs) - 1;
|
$activeTab = count($tabs) - 1;
|
||||||
}
|
}
|
||||||
|
@ -42,12 +47,17 @@ if (PrivilegesHelper::confirm(Privilege::MassTag))
|
||||||
<nav class="tabs">
|
<nav class="tabs">
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach ($tabs as $i => $tab): ?>
|
<?php foreach ($tabs as $i => $tab): ?>
|
||||||
<?php list($name, $url) = $tab ?>
|
<?php
|
||||||
<?php if ($i == $activeTab): ?>
|
list($name, $url) = $tab;
|
||||||
<li class="selected <?= TextCaseConverter::convert($name, TextCaseConverter::BLANK_CASE, TextCaseConverter::SPINAL_CASE) ?>">
|
$classes = [];
|
||||||
<?php else: ?>
|
$classes []= TextCaseConverter::convert($name,
|
||||||
<li class="<?= TextCaseConverter::convert($name, TextCaseConverter::BLANK_CASE, TextCaseConverter::SPINAL_CASE) ?>">
|
TextCaseConverter::BLANK_CASE,
|
||||||
<?php endif ?>
|
TextCaseConverter::SPINAL_CASE);
|
||||||
|
if ($i == $activeTab)
|
||||||
|
$classes []= 'selected';
|
||||||
|
?>
|
||||||
|
|
||||||
|
<li class="<?= join(' ', $classes) ?>">
|
||||||
<a href="<?= $url ?>">
|
<a href="<?= $url ?>">
|
||||||
<?= $name ?>
|
<?= $name ?>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -3,8 +3,12 @@ CustomAssetViewDecorator::addStylesheet('post-list.css');
|
||||||
CustomAssetViewDecorator::addScript('post-list.js');
|
CustomAssetViewDecorator::addScript('post-list.js');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (isset($this->context->source) and $this->context->source == 'mass-tag' and PrivilegesHelper::confirm(Privilege::MassTag)): ?>
|
<?php if (isset($this->context->source)
|
||||||
|
and $this->context->source == 'mass-tag'
|
||||||
|
and PrivilegesHelper::confirm(Privilege::MassTag)): ?>
|
||||||
|
|
||||||
<?php $this->renderFile('tag-mass-tag') ?>
|
<?php $this->renderFile('tag-mass-tag') ?>
|
||||||
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,17 +27,30 @@ if ($masstag)
|
||||||
|
|
||||||
<div class="<?= implode(' ', $classNames) ?>">
|
<div class="<?= implode(' ', $classNames) ?>">
|
||||||
<?php if ($masstag): ?>
|
<?php if ($masstag): ?>
|
||||||
<a class="toggle-tag" href="<?= \Chibi\UrlHelper::route('post', 'toggle-tag', ['id' => $this->context->post->id, 'tag' => $this->context->additionalInfo, 'enable' => '_enable_']) ?>" data-text-tagged="Tagged" data-text-untagged="Untagged">
|
<a class="toggle-tag"
|
||||||
|
href="<?= \Chibi\UrlHelper::route('post', 'toggle-tag', [
|
||||||
|
'id' => $this->context->post->id,
|
||||||
|
'tag' => $this->context->additionalInfo,
|
||||||
|
'enable' => '_enable_']) ?>"
|
||||||
|
data-text-tagged="Tagged"
|
||||||
|
data-text-untagged="Untagged">
|
||||||
|
|
||||||
<?= in_array('tagged', $classNames) ? 'Tagged' : 'Untagged' ?>
|
<?= in_array('tagged', $classNames) ? 'Tagged' : 'Untagged' ?>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
<a class="link"
|
||||||
<?php if ($this->context->user->hasEnabledPostTagTitles()): ?>
|
<?php if ($this->context->user->hasEnabledPostTagTitles()): ?>
|
||||||
<a title="<?= TextHelper::reprTags($this->context->post->getTags()) ?>" class="link" href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
|
title="<?= TextHelper::reprTags($this->context->post->getTags()) ?>"
|
||||||
<?php else: ?>
|
|
||||||
<a class="link" href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<img class="thumb" src="<?= \Chibi\UrlHelper::route('post', 'thumb', ['name' => $this->context->post->name]) ?>" alt="@<?= $this->context->post->id ?>"/>
|
href="<?= \Chibi\UrlHelper::route('post', 'view', ['id' => $this->context->post->id]) ?>">
|
||||||
|
|
||||||
|
<img
|
||||||
|
class="thumb"
|
||||||
|
src="<?= \Chibi\UrlHelper::route('post', 'thumb', ['name' => $this->context->post->name]) ?>"
|
||||||
|
alt="@<?= $this->context->post->id ?>"/>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$x =
|
$x =
|
||||||
[
|
[
|
||||||
|
@ -46,6 +59,7 @@ if ($masstag)
|
||||||
'favs' => $this->context->post->favCount,
|
'favs' => $this->context->post->favCount,
|
||||||
];
|
];
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php if (!empty($x)): ?>
|
<?php if (!empty($x)): ?>
|
||||||
<div class="info-bar">
|
<div class="info-bar">
|
||||||
<?php foreach ($x as $key => $val): ?>
|
<?php foreach ($x as $key => $val): ?>
|
||||||
|
@ -55,7 +69,7 @@ if ($masstag)
|
||||||
<span>
|
<span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<i class="icon-<?= $key ?>"></i>
|
<i class="icon-<?= $key ?>"></i>
|
||||||
<?= $val ?>
|
<?= $val ?>
|
||||||
</span>
|
</span>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,6 +9,7 @@ CustomAssetViewDecorator::addScript('../lib/tagit/jquery.tagit.js');
|
||||||
<div id="sidebar">
|
<div id="sidebar">
|
||||||
<div class="unit">
|
<div class="unit">
|
||||||
<h1>file upload</h1>
|
<h1>file upload</h1>
|
||||||
|
|
||||||
<p>Use tags to describe uploaded images. Try to specify characters, their look and shows they are from.</p>
|
<p>Use tags to describe uploaded images. Try to specify characters, their look and shows they are from.</p>
|
||||||
<p>Set proper visibility setting if the image isn’t safe for work or you’re not sure it’s 100% <span class="safety-safe">safe</span>.</p>
|
<p>Set proper visibility setting if the image isn’t safe for work or you’re not sure it’s 100% <span class="safety-safe">safe</span>.</p>
|
||||||
<p>Only registered users can view <span class="safety-sketchy">sketchy</span> or <span class="safety-unsafe">NSFW</span> content.</p>
|
<p>Only registered users can view <span class="safety-sketchy">sketchy</span> or <span class="safety-unsafe">NSFW</span> content.</p>
|
||||||
|
@ -79,8 +80,16 @@ CustomAssetViewDecorator::addScript('../lib/tagit/jquery.tagit.js');
|
||||||
<?php $checked = false ?>
|
<?php $checked = false ?>
|
||||||
<?php foreach (PostSafety::getAll() as $safety): ?>
|
<?php foreach (PostSafety::getAll() as $safety): ?>
|
||||||
<label>
|
<label>
|
||||||
<input type="radio" name="safety" value="<?= $safety ?>"<?php if (!$checked) echo ' checked="checked"' ?>/>
|
<input
|
||||||
|
type="radio"
|
||||||
|
name="safety"
|
||||||
|
<?php if (!$checked): ?>
|
||||||
|
checked="checked"
|
||||||
|
<?php endif ?>
|
||||||
|
value="<?= $safety ?>" />
|
||||||
|
|
||||||
<?= ucfirst(PostSafety::toDisplayString($safety)) ?>
|
<?= ucfirst(PostSafety::toDisplayString($safety)) ?>
|
||||||
|
|
||||||
<?php $checked = true ?>
|
<?php $checked = true ?>
|
||||||
</label>
|
</label>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
@ -94,12 +103,16 @@ CustomAssetViewDecorator::addScript('../lib/tagit/jquery.tagit.js');
|
||||||
|
|
||||||
<div class="form-row tags">
|
<div class="form-row tags">
|
||||||
<label>Tags:</label>
|
<label>Tags:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="tags" placeholder="enter some tags…"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="text" name="tags" placeholder="enter some tags…"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row source">
|
<div class="form-row source">
|
||||||
<label>Source:</label>
|
<label>Source:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="source" placeholder="where did you get this from? (optional)"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="text" name="source" placeholder="where did you get this from? (optional)"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="submit" value="1"/>
|
<input type="hidden" name="submit" value="1"/>
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
CustomAssetViewDecorator::setSubTitle('showing ' . TextHelper::reprPost($this->context->transport->post) . ' – ' . TextHelper::reprTags($this->context->transport->post->getTags()));
|
$subTitle = sprintf('showing %s –%s',
|
||||||
|
TextHelper::reprPost($this->context->transport->post),
|
||||||
|
TextHelper::reprTags($this->context->transport->post->getTags()));
|
||||||
|
CustomAssetViewDecorator::setSubTitle($subTitle);
|
||||||
CustomAssetViewDecorator::addStylesheet('post-view.css');
|
CustomAssetViewDecorator::addStylesheet('post-view.css');
|
||||||
CustomAssetViewDecorator::addScript('post-view.js');
|
CustomAssetViewDecorator::addScript('post-view.js');
|
||||||
CustomAssetViewDecorator::addStylesheet('../lib/tagit/jquery.tagit.css');
|
CustomAssetViewDecorator::addStylesheet('../lib/tagit/jquery.tagit.css');
|
||||||
|
@ -14,7 +17,10 @@ $editPostPrivileges = [
|
||||||
$editPostPrivileges = array_fill_keys($editPostPrivileges, false);
|
$editPostPrivileges = array_fill_keys($editPostPrivileges, false);
|
||||||
foreach (array_keys($editPostPrivileges) as $privilege)
|
foreach (array_keys($editPostPrivileges) as $privilege)
|
||||||
{
|
{
|
||||||
if (PrivilegesHelper::confirm($privilege, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader())))
|
if (PrivilegesHelper::confirm(
|
||||||
|
$privilege,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader())))
|
||||||
|
|
||||||
$editPostPrivileges[$privilege] = true;
|
$editPostPrivileges[$privilege] = true;
|
||||||
}
|
}
|
||||||
$canEditAnything = count(array_filter($editPostPrivileges)) > 0;
|
$canEditAnything = count(array_filter($editPostPrivileges)) > 0;
|
||||||
|
@ -49,7 +55,10 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
|
||||||
<?php if (!empty($this->context->transport->lastSearchQuery)): ?>
|
<?php if (!empty($this->context->transport->lastSearchQuery)): ?>
|
||||||
<div class="text">
|
<div class="text">
|
||||||
Current search:<br/>
|
Current search:<br/>
|
||||||
<a href="<?= \Chibi\UrlHelper::route('post', 'list', ['query' => $this->context->transport->lastSearchQuery]) ?>"><?= $this->context->transport->lastSearchQuery ?></a>
|
<a href="<?= \Chibi\UrlHelper::route('post', 'list', [
|
||||||
|
'query' => $this->context->transport->lastSearchQuery]) ?>">
|
||||||
|
<?= $this->context->transport->lastSearchQuery ?>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -61,12 +70,8 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
|
||||||
<?php uasort($tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); }) ?>
|
<?php uasort($tags, function($a, $b) { return strnatcasecmp($a->name, $b->name); }) ?>
|
||||||
<?php foreach ($tags as $tag): ?>
|
<?php foreach ($tags as $tag): ?>
|
||||||
<li title="<?= $tag->name ?>">
|
<li title="<?= $tag->name ?>">
|
||||||
<a href="<?= \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('post', 'list', ['query' => $tag->name]) ?>"><?= $tag->name ?></a>
|
||||||
<?= $tag->name ?>
|
<span class="count"><?= TextHelper::useDecimalUnits($tag->getPostCount()) ?></span>
|
||||||
</a>
|
|
||||||
<span class="count">
|
|
||||||
<?= TextHelper::useDecimalUnits($tag->getPostCount()) ?>
|
|
||||||
</span>
|
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -130,10 +135,8 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
|
||||||
<span class="value">
|
<span class="value">
|
||||||
<?= $this->context->transport->post->score ?>
|
<?= $this->context->transport->post->score ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::ScorePost, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
|
||||||
[
|
|
||||||
<?php $scoreLink = function($score) { return \Chibi\UrlHelper::route('post', 'score', ['id' => $this->context->transport->post->id, 'score' => $score]); } ?>
|
<?php $scoreLink = function($score) { return \Chibi\UrlHelper::route('post', 'score', ['id' => $this->context->transport->post->id, 'score' => $score]); } ?>
|
||||||
|
<?php if (PrivilegesHelper::confirm(Privilege::ScorePost, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->post->getUploader()))): ?>
|
||||||
<?php if ($this->context->score === 1): ?>
|
<?php if ($this->context->score === 1): ?>
|
||||||
<a class="simple-action selected" href="<?= $scoreLink(0) ?>">
|
<a class="simple-action selected" href="<?= $scoreLink(0) ?>">
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
@ -150,7 +153,7 @@ $canEditAnything = count(array_filter($editPostPrivileges)) > 0;
|
||||||
<a class="simple-action" href="<?= $scoreLink(-1) ?>">
|
<a class="simple-action" href="<?= $scoreLink(-1) ?>">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
down
|
down
|
||||||
</a>]
|
</a>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,17 +4,50 @@
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="mass-tag-query">Search query:</label>
|
<label for="mass-tag-query">Search query:</label>
|
||||||
<div class="input-wrapper"><input class="autocomplete" type="text" name="query" id="mass-tag-query" value="<?= isset($this->context->massTagQuery) ? htmlspecialchars($this->context->massTagQuery) : '' ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
class="autocomplete"
|
||||||
|
type="text"
|
||||||
|
name="query"
|
||||||
|
id="mass-tag-query"
|
||||||
|
value="<?= isset($this->context->massTagQuery)
|
||||||
|
? htmlspecialchars($this->context->massTagQuery)
|
||||||
|
: '' ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="mass-tag-tag">Tag:</label>
|
<label for="mass-tag-tag">Tag:</label>
|
||||||
<div class="input-wrapper"><input class="autocomplete" type="text" name="tag" id="mass-tag-tag" value="<?= isset($this->context->massTagTag) ? htmlspecialchars($this->context->massTagTag) : '' ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
class="autocomplete"
|
||||||
|
type="text"
|
||||||
|
name="tag"
|
||||||
|
id="mass-tag-tag"
|
||||||
|
value="<?= isset($this->context->massTagTag)
|
||||||
|
? htmlspecialchars($this->context->massTagTag)
|
||||||
|
: '' ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="old-page" value="<?= isset($this->context->transport->paginator) ? htmlspecialchars($this->context->transport->paginator->page) : '' ?>"/>
|
<input
|
||||||
<input type="hidden" name="old-query" value="<?= isset($this->context->massTagQuery) ? htmlspecialchars($this->context->massTagQuery) : '' ?>"/>
|
type="hidden"
|
||||||
<input type="hidden" name="submit" value="1"/>
|
name="old-page"
|
||||||
|
value="<?= isset($this->context->transport->paginator)
|
||||||
|
? htmlspecialchars($this->context->transport->paginator->page)
|
||||||
|
: '' ?>"/>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="hidden"
|
||||||
|
name="old-query"
|
||||||
|
value="<?= isset($this->context->massTagQuery)
|
||||||
|
? htmlspecialchars($this->context->massTagQuery)
|
||||||
|
: '' ?>"/>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type="hidden"
|
||||||
|
name="submit"
|
||||||
|
value="1"/>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label></label>
|
<label></label>
|
||||||
|
|
|
@ -4,12 +4,16 @@
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="merge-source-tag">Source tag:</label>
|
<label for="merge-source-tag">Source tag:</label>
|
||||||
<div class="input-wrapper"><input class="autocomplete" type="text" name="source-tag" id="merge-source-tag"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input class="autocomplete" type="text" name="source-tag" id="merge-source-tag"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="merge-target-tag">Target tag:</label>
|
<label for="merge-target-tag">Target tag:</label>
|
||||||
<div class="input-wrapper"><input class="autocomplete" type="text" name="target-tag" id="merge-target-tag"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input class="autocomplete" type="text" name="target-tag" id="merge-target-tag"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="submit" value="1"/>
|
<input type="hidden" name="submit" value="1"/>
|
||||||
|
|
|
@ -4,12 +4,16 @@
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="rename-source-tag">Source tag:</label>
|
<label for="rename-source-tag">Source tag:</label>
|
||||||
<div class="input-wrapper"><input class="autocomplete" type="text" name="source-tag" id="rename-source-tag"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input class="autocomplete" type="text" name="source-tag" id="rename-source-tag"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="rename-target-tag">Target tag:</label>
|
<label for="rename-target-tag">Target tag:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="target-tag" id="rename-target-tag"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="text" name="target-tag" id="rename-target-tag"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="submit" value="1"/>
|
<input type="hidden" name="submit" value="1"/>
|
||||||
|
|
|
@ -63,7 +63,9 @@
|
||||||
$registerNavItem(
|
$registerNavItem(
|
||||||
'Users',
|
'Users',
|
||||||
\Chibi\UrlHelper::route('user', 'list'),
|
\Chibi\UrlHelper::route('user', 'list'),
|
||||||
$activeController == 'user' and $activeAction != 'registration' and (!isset($this->context->route->arguments['name']) or $this->context->route->arguments['name'] != $this->context->user->name));
|
$activeController == 'user' and $activeAction != 'registration' and
|
||||||
|
(!isset($this->context->route->arguments['name']) or
|
||||||
|
$this->context->route->arguments['name'] != $this->context->user->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->context->loggedIn)
|
if (!$this->context->loggedIn)
|
||||||
|
@ -83,7 +85,8 @@
|
||||||
$registerNavItem(
|
$registerNavItem(
|
||||||
'My account',
|
'My account',
|
||||||
\Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->user->name]),
|
\Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->user->name]),
|
||||||
$activeController == 'user' and isset($this->context->route->arguments['name']) and $this->context->route->arguments['name'] == $this->context->user->name);
|
$activeController == 'user' and isset($this->context->route->arguments['name']) and
|
||||||
|
$this->context->route->arguments['name'] == $this->context->user->name);
|
||||||
|
|
||||||
$registerNavItem(
|
$registerNavItem(
|
||||||
'Log out',
|
'Log out',
|
||||||
|
@ -113,12 +116,21 @@
|
||||||
<li class="safety">
|
<li class="safety">
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach (PostSafety::getAll() as $safety): ?>
|
<?php foreach (PostSafety::getAll() as $safety): ?>
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::ListPosts, PostSafety::toString($safety))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::ListPosts,
|
||||||
|
PostSafety::toString($safety))): ?>
|
||||||
|
|
||||||
<li class="safety-<?= TextCaseConverter::convert(PostSafety::toString($safety), TextCaseConverter::CAMEL_CASE, TextCaseConverter::SPINAL_CASE) ?>">
|
<li class="safety-<?= TextCaseConverter::convert(PostSafety::toString($safety), TextCaseConverter::CAMEL_CASE, TextCaseConverter::SPINAL_CASE) ?>">
|
||||||
<a href="<?= \Chibi\UrlHelper::route('user', 'toggle-safety', ['safety' => $safety]) ?>" class="<?= $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>" title="Searching <?= PostSafety::toDisplayString($safety) ?> posts: <?= $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>">
|
|
||||||
|
<a class="<?= $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>"
|
||||||
|
href="<?= \Chibi\UrlHelper::route('user', 'toggle-safety', ['safety' => $safety]) ?>"
|
||||||
|
title="Searching <?= PostSafety::toDisplayString($safety) ?> posts: <?= $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>">
|
||||||
|
|
||||||
<span><?= ucfirst(PostSafety::toDisplayString($safety)) ?></span>
|
<span><?= ucfirst(PostSafety::toDisplayString($safety)) ?></span>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -127,7 +139,14 @@
|
||||||
|
|
||||||
<li class="search">
|
<li class="search">
|
||||||
<form name="search" action="<?= \Chibi\UrlHelper::route('post', 'list') ?>" method="get">
|
<form name="search" action="<?= \Chibi\UrlHelper::route('post', 'list') ?>" method="get">
|
||||||
<input class="autocomplete" type="search" name="query" placeholder="Search…" value="<?= isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '' ?>"/>
|
|
||||||
|
<input
|
||||||
|
class="autocomplete"
|
||||||
|
type="search"
|
||||||
|
name="query"
|
||||||
|
placeholder="Search…"
|
||||||
|
value="<?= isset($this->context->transport->searchQuery) ? htmlspecialchars($this->context->transport->searchQuery) : '' ?>"/>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
<form action="<?= \Chibi\UrlHelper::route('user', 'delete', ['name' => $this->context->transport->user->name]) ?>" method="post" class="delete confirmable" autocomplete="off" data-confirm-text="Are you sure you want to delete your account?">
|
<form
|
||||||
|
action="<?= \Chibi\UrlHelper::route('user', 'delete', ['name' => $this->context->transport->user->name]) ?>"
|
||||||
|
method="post"
|
||||||
|
class="delete confirmable"
|
||||||
|
autocomplete="off"
|
||||||
|
data-confirm-text="Are you sure you want to delete your account?">
|
||||||
|
|
||||||
<?php if ($this->context->user->id == $this->context->transport->user->id): ?>
|
<?php if ($this->context->user->id == $this->context->transport->user->id): ?>
|
||||||
<div class="form-row current-password">
|
<div class="form-row current-password">
|
||||||
<label for="current-password">Current password:</label>
|
<label for="current-password">Current password:</label>
|
||||||
<div class="input-wrapper"><input type="password" name="current-password" id="current-password" placeholder="Current password"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input type="password" name="current-password" id="current-password" placeholder="Current password"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
|
|
@ -2,43 +2,91 @@
|
||||||
<?php if ($this->context->user->id == $this->context->transport->user->id): ?>
|
<?php if ($this->context->user->id == $this->context->transport->user->id): ?>
|
||||||
<div class="form-row current-password">
|
<div class="form-row current-password">
|
||||||
<label for="current-password">Current password:</label>
|
<label for="current-password">Current password:</label>
|
||||||
<div class="input-wrapper"><input type="password" name="current-password" id="current-password" placeholder="Current password"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
name="current-password"
|
||||||
|
id="current-password"
|
||||||
|
placeholder="Current password"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserName, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::ChangeUserName,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
||||||
|
|
||||||
<div class="form-row nickname">
|
<div class="form-row nickname">
|
||||||
<label for="name">Name:</label>
|
<label for="name">Name:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="name" id="name" placeholder="New name…" value="<?= htmlspecialchars($this->context->suppliedName) ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="name"
|
||||||
|
id="name"
|
||||||
|
placeholder="New name…"
|
||||||
|
value="<?= htmlspecialchars($this->context->suppliedName) ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserEmail, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::ChangeUserEmail,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
||||||
|
|
||||||
<div class="form-row email">
|
<div class="form-row email">
|
||||||
<label for="name">E-mail:</label>
|
<label for="name">E-mail:</label>
|
||||||
<div class="input-wrapper"><input type="text" name="email" id="email" placeholder="New e-mail…" value="<?= htmlspecialchars($this->context->suppliedEmail) ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
name="email"
|
||||||
|
id="email"
|
||||||
|
placeholder="New e-mail…"
|
||||||
|
value="<?= htmlspecialchars($this->context->suppliedEmail) ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserPassword, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
<?php if (
|
||||||
|
PrivilegesHelper::confirm(Privilege::ChangeUserPassword,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
||||||
|
|
||||||
<div class="form-row password1">
|
<div class="form-row password1">
|
||||||
<label for="password1">New password:</label>
|
<label for="password1">New password:</label>
|
||||||
<div class="input-wrapper"><input type="password" name="password1" id="password1" placeholder="New password…" value="<?= htmlspecialchars($this->context->suppliedPassword1) ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
name="password1"
|
||||||
|
id="password1"
|
||||||
|
placeholder="New password…"
|
||||||
|
value="<?= htmlspecialchars($this->context->suppliedPassword1) ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row password2">
|
<div class="form-row password2">
|
||||||
<label for="password2"></label>
|
<label for="password2"></label>
|
||||||
<div class="input-wrapper"><input type="password" name="password2" id="password2" placeholder="New password… (repeat)" value="<?= htmlspecialchars($this->context->suppliedPassword2) ?>"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
name="password2"
|
||||||
|
id="password2"
|
||||||
|
placeholder="New password… (repeat)"
|
||||||
|
value="<?= htmlspecialchars($this->context->suppliedPassword2) ?>"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserAccessRank, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::ChangeUserAccessRank,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
||||||
|
|
||||||
<div class="form-row access-rank">
|
<div class="form-row access-rank">
|
||||||
<label for="access-rank">Access rank:</label>
|
<label for="access-rank">Access rank:</label>
|
||||||
<div class="input-wrapper"><select name="access-rank" id="access-rank">
|
<div class="input-wrapper">
|
||||||
|
<select name="access-rank" id="access-rank">
|
||||||
<?php foreach (AccessRank::getAll() as $rank): ?>
|
<?php foreach (AccessRank::getAll() as $rank): ?>
|
||||||
<?php if ($rank == AccessRank::Nobody) continue ?>
|
<?php if ($rank == AccessRank::Nobody) continue ?>
|
||||||
<?php if (($this->context->suppliedAccessRank != '' and $rank == $this->context->suppliedAccessRank) or ($this->context->suppliedAccessRank == '' and $rank == $this->context->transport->user->accessRank)): ?>
|
<?php if (($this->context->suppliedAccessRank != '' and $rank == $this->context->suppliedAccessRank)
|
||||||
|
or ($this->context->suppliedAccessRank == '' and $rank == $this->context->transport->user->accessRank)): ?>
|
||||||
<option value="<?= $rank ?>" selected="selected">
|
<option value="<?= $rank ?>" selected="selected">
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<option value="<?= $rank ?>">
|
<option value="<?= $rank ?>">
|
||||||
|
@ -46,7 +94,8 @@
|
||||||
<?= AccessRank::toDisplayString($rank) ?>
|
<?= AccessRank::toDisplayString($rank) ?>
|
||||||
</option>
|
</option>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</select></div>
|
</select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
|
|
|
@ -14,25 +14,59 @@ CustomAssetViewDecorator::setSubTitle('registration form');
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="name">User name:</label>
|
<label for="name">User name:</label>
|
||||||
<div class="input-wrapper"><input type="text" id="name" name="name" value="<?= htmlspecialchars($this->context->suppliedName) ?>" placeholder="e.g. darth_vader" autocomplete="off"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="name"
|
||||||
|
name="name"
|
||||||
|
value="<?= htmlspecialchars($this->context->suppliedName) ?>"
|
||||||
|
placeholder="e.g. darth_vader"
|
||||||
|
autocomplete="off"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="password1">Password:</label>
|
<label for="password1">Password:</label>
|
||||||
<div class="input-wrapper"><input type="password" id="password1" name="password1" value="<?= htmlspecialchars($this->context->suppliedPassword1) ?>" placeholder="e.g. <?= str_repeat('●', 8) ?>" autocomplete="off"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
id="password1"
|
||||||
|
name="password1"
|
||||||
|
value="<?= htmlspecialchars($this->context->suppliedPassword1) ?>"
|
||||||
|
placeholder="e.g. <?= str_repeat('●', 8) ?>"
|
||||||
|
autocomplete="off"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="password2">Password (repeat):</label>
|
<label for="password2">Password (repeat):</label>
|
||||||
<div class="input-wrapper"><input type="password" id="password2" name="password2" value="<?= htmlspecialchars($this->context->suppliedPassword2) ?>" placeholder="e.g. <?= str_repeat('●', 8) ?>" autocomplete="off"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="password"
|
||||||
|
id="password2"
|
||||||
|
name="password2"
|
||||||
|
value="<?= htmlspecialchars($this->context->suppliedPassword2) ?>"
|
||||||
|
placeholder="e.g. <?= str_repeat('●', 8) ?>"
|
||||||
|
autocomplete="off"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="email">E-mail address:</label>
|
<label for="email">E-mail address:</label>
|
||||||
<div class="input-wrapper"><input type="text" id="email" name="email" value="<?= htmlspecialchars($this->context->suppliedEmail) ?>" placeholder="e.g. vader@empire.gov" autocomplete="off"/></div>
|
<div class="input-wrapper">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="email"
|
||||||
|
name="email"
|
||||||
|
value="<?= htmlspecialchars($this->context->suppliedEmail) ?>"
|
||||||
|
placeholder="e.g. vader@empire.gov" autocomplete="off"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p id="email-info">Your e-mail will be used to show your <a href="http://gravatar.com/">Gravatar</a>.<br/>Leave blank for random Gravatar.</p>
|
<p id="email-info">
|
||||||
|
Your e-mail will be used to show your <a href="http://gravatar.com/">Gravatar</a>.<br/>
|
||||||
|
Leave blank for random Gravatar.
|
||||||
|
</p>
|
||||||
|
|
||||||
<?php $this->renderFile('message') ?>
|
<?php $this->renderFile('message') ?>
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,12 @@
|
||||||
CustomAssetViewDecorator::addStylesheet('auth.css');
|
CustomAssetViewDecorator::addStylesheet('auth.css');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="<?= \Chibi\UrlHelper::route($this->context->route->simpleControllerName, $this->context->route->simpleActionName) ?>" method="post" class="auth" autocomplete="off">
|
<form
|
||||||
|
method="post"
|
||||||
|
action="<?= \Chibi\UrlHelper::route($this->context->route->simpleControllerName, $this->context->route->simpleActionName) ?>"
|
||||||
|
class="auth"
|
||||||
|
autocomplete="off">
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label>User:</label>
|
<label>User:</label>
|
||||||
<div class="input-wrapper">
|
<div class="input-wrapper">
|
||||||
|
|
|
@ -6,7 +6,9 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
<div id="sidebar">
|
<div id="sidebar">
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name]) ?>">
|
||||||
<img src="<?= htmlspecialchars($this->context->transport->user->getAvatarUrl(140)) ?>" alt="<?= $this->context->transport->user->name ?>">
|
<img
|
||||||
|
src="<?= htmlspecialchars($this->context->transport->user->getAvatarUrl(140)) ?>"
|
||||||
|
alt="<?= $this->context->transport->user->name ?>"/>
|
||||||
</a>
|
</a>
|
||||||
<h1><?= $this->context->transport->user->name ?></h1>
|
<h1><?= $this->context->transport->user->name ?></h1>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,26 +18,41 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
|
|
||||||
<div class="key-value join-date">
|
<div class="key-value join-date">
|
||||||
<span class="key">Joined:</span>
|
<span class="key">Joined:</span>
|
||||||
<span class="value" title="<?= TextHelper::formatDate($this->context->transport->user->joinDate, true) ?>">
|
<span
|
||||||
|
class="value"
|
||||||
|
title="<?= TextHelper::formatDate($this->context->transport->user->joinDate, true) ?>">
|
||||||
|
|
||||||
<?= TextHelper::formatDate($this->context->transport->user->joinDate, false) ?>
|
<?= TextHelper::formatDate($this->context->transport->user->joinDate, false) ?>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="key-value last-login">
|
<div class="key-value last-login">
|
||||||
<span class="key">Last login:</span>
|
<span class="key">Last login:</span>
|
||||||
<span class="value" title="<?= TextHelper::formatDate($this->context->transport->user->lastLoginDate, true) ?>">
|
<span
|
||||||
|
class="value"
|
||||||
|
title="<?= TextHelper::formatDate($this->context->transport->user->lastLoginDate, true) ?>">
|
||||||
|
|
||||||
<?= TextHelper::formatDate($this->context->transport->user->lastLoginDate, false) ?>
|
<?= TextHelper::formatDate($this->context->transport->user->lastLoginDate, false) ?>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="key-value access-rank">
|
<div class="key-value access-rank">
|
||||||
<span class="key">Access rank:</span>
|
<span class="key">Access rank:</span>
|
||||||
<span class="value" title="<?= $val = AccessRank::toDisplayString($this->context->transport->user->accessRank) ?>">
|
<span
|
||||||
|
class="value"
|
||||||
|
title="<?= $val = AccessRank::toDisplayString($this->context->transport->user->accessRank) ?>">
|
||||||
|
|
||||||
<?= $val ?>
|
<?= $val ?>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::ViewUserEmail, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::ViewUserEmail,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
||||||
|
|
||||||
<div class="key-value email">
|
<div class="key-value email">
|
||||||
<span class="key">E-mail:</span>
|
<span class="key">E-mail:</span>
|
||||||
<span class="value" title="<?= $val = ($this->context->transport->user->emailUnconfirmed
|
<span class="value" title="<?= $val = ($this->context->transport->user->emailUnconfirmed
|
||||||
|
@ -59,9 +76,13 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
foreach (array_keys($userModificationPrivileges) as $privilege)
|
foreach (array_keys($userModificationPrivileges) as $privilege)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (PrivilegesHelper::confirm($privilege, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user)))
|
if (PrivilegesHelper::confirm(
|
||||||
|
$privilege,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user)))
|
||||||
|
{
|
||||||
$userModificationPrivileges[$privilege] = true;
|
$userModificationPrivileges[$privilege] = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$canModifyAnything = count(array_filter($userModificationPrivileges)) > 0;
|
$canModifyAnything = count(array_filter($userModificationPrivileges)) > 0;
|
||||||
|
|
||||||
$options = [];
|
$options = [];
|
||||||
|
@ -72,21 +93,27 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
[
|
[
|
||||||
'class' => 'edit',
|
'class' => 'edit',
|
||||||
'text' => 'Edit account settings',
|
'text' => 'Edit account settings',
|
||||||
'link' => \Chibi\UrlHelper::route('user', 'edit', ['name' => $this->context->transport->user->name, 'tab' => 'edit']),
|
'link' => \Chibi\UrlHelper::route('user', 'edit', [
|
||||||
|
'name' => $this->context->transport->user->name, 'tab' => 'edit']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PrivilegesHelper::confirm(Privilege::AcceptUserRegistration) and !$this->context->transport->user->staffConfirmed and $this->config->registration->staffActivation)
|
if (PrivilegesHelper::confirm(Privilege::AcceptUserRegistration)
|
||||||
|
and !$this->context->transport->user->staffConfirmed
|
||||||
|
and $this->config->registration->staffActivation)
|
||||||
{
|
{
|
||||||
$options []=
|
$options []=
|
||||||
[
|
[
|
||||||
'class' => 'accept-registration',
|
'class' => 'accept-registration',
|
||||||
'text' => 'Accept registration',
|
'text' => 'Accept registration',
|
||||||
'simple-action' => \Chibi\UrlHelper::route('user', 'accept-registration', ['name' => $this->context->transport->user->name]),
|
'simple-action' => \Chibi\UrlHelper::route('user', 'accept-registration', [
|
||||||
|
'name' => $this->context->transport->user->name]),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PrivilegesHelper::confirm(Privilege::FlagUser, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user)))
|
if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::FlagUser,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user)))
|
||||||
{
|
{
|
||||||
if ($this->context->flagged)
|
if ($this->context->flagged)
|
||||||
{
|
{
|
||||||
|
@ -103,13 +130,16 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
[
|
[
|
||||||
'class' => 'flag',
|
'class' => 'flag',
|
||||||
'text' => 'Flag for moderator attention',
|
'text' => 'Flag for moderator attention',
|
||||||
'simple-action' => \Chibi\UrlHelper::route('user', 'flag', ['name' => $this->context->transport->user->name]),
|
'simple-action' => \Chibi\UrlHelper::route('user', 'flag', [
|
||||||
|
'name' => $this->context->transport->user->name]),
|
||||||
'data-confirm-text' => 'Are you sure you want to flag this user?',
|
'data-confirm-text' => 'Are you sure you want to flag this user?',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PrivilegesHelper::confirm(Privilege::BanUser, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user)))
|
if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::BanUser,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user)))
|
||||||
{
|
{
|
||||||
if (!$this->context->transport->user->banned)
|
if (!$this->context->transport->user->banned)
|
||||||
{
|
{
|
||||||
|
@ -117,7 +147,8 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
[
|
[
|
||||||
'class' => 'ban',
|
'class' => 'ban',
|
||||||
'text' => 'Ban user',
|
'text' => 'Ban user',
|
||||||
'simple-action' => \Chibi\UrlHelper::route('user', 'ban', ['name' => $this->context->transport->user->name]),
|
'simple-action' => \Chibi\UrlHelper::route('user', 'ban', [
|
||||||
|
'name' => $this->context->transport->user->name]),
|
||||||
'data-confirm-text' => 'Are you sure you want to ban this user?',
|
'data-confirm-text' => 'Are you sure you want to ban this user?',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -127,19 +158,23 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
[
|
[
|
||||||
'class' => 'unban',
|
'class' => 'unban',
|
||||||
'text' => 'Unban user',
|
'text' => 'Unban user',
|
||||||
'simple-action' => \Chibi\UrlHelper::route('user', 'unban', ['name' => $this->context->transport->user->name]),
|
'simple-action' => \Chibi\UrlHelper::route('user', 'unban', [
|
||||||
|
'name' => $this->context->transport->user->name]),
|
||||||
'data-confirm-text' => 'Are you sure you want to unban this user?',
|
'data-confirm-text' => 'Are you sure you want to unban this user?',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PrivilegesHelper::confirm(Privilege::DeleteUser, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user)))
|
if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::DeleteUser,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user)))
|
||||||
{
|
{
|
||||||
$options []=
|
$options []=
|
||||||
[
|
[
|
||||||
'class' => 'delete',
|
'class' => 'delete',
|
||||||
'text' => 'Delete account',
|
'text' => 'Delete account',
|
||||||
'link' => \Chibi\UrlHelper::route('user', 'delete', ['name' => $this->context->transport->user->name, 'tab' => 'delete']),
|
'link' => \Chibi\UrlHelper::route('user', 'delete', [
|
||||||
|
'name' => $this->context->transport->user->name, 'tab' => 'delete']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +191,10 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="favs">
|
<li class="favs">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name, 'tab' => 'favs', 'page' => 1]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('user', 'view', [
|
||||||
|
'name' => $this->context->transport->user->name,
|
||||||
|
'tab' => 'favs',
|
||||||
|
'page' => 1]) ?>">
|
||||||
Favs
|
Favs
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -166,18 +204,25 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="uploads">
|
<li class="uploads">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<a href="<?= \Chibi\UrlHelper::route('user', 'view', ['name' => $this->context->transport->user->name, 'tab' => 'uploads', 'page' => 1]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('user', 'view', [
|
||||||
|
'name' => $this->context->transport->user->name,
|
||||||
|
'tab' => 'uploads',
|
||||||
|
'page' => 1]) ?>">
|
||||||
Uploads
|
Uploads
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::ChangeUserSettings, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::ChangeUserSettings,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
||||||
|
|
||||||
<?php if ($this->context->transport->tab == 'settings'): ?>
|
<?php if ($this->context->transport->tab == 'settings'): ?>
|
||||||
<li class="selected settings">
|
<li class="selected settings">
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="settings">
|
<li class="settings">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<a href="<?= \Chibi\UrlHelper::route('user', 'settings', ['name' => $this->context->transport->user->name]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('user', 'settings', [
|
||||||
|
'name' => $this->context->transport->user->name]) ?>">
|
||||||
Browsing settings
|
Browsing settings
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -189,19 +234,23 @@ CustomAssetViewDecorator::addStylesheet('user-view.css');
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="edit">
|
<li class="edit">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<a href="<?= \Chibi\UrlHelper::route('user', 'edit', ['name' => $this->context->transport->user->name]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('user', 'edit', [
|
||||||
|
'name' => $this->context->transport->user->name]) ?>">
|
||||||
Account settings
|
Account settings
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php if (PrivilegesHelper::confirm(Privilege::DeleteUser, PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
<?php if (PrivilegesHelper::confirm(
|
||||||
|
Privilege::DeleteUser,
|
||||||
|
PrivilegesHelper::getIdentitySubPrivilege($this->context->transport->user))): ?>
|
||||||
<?php if ($this->context->transport->tab == 'delete'): ?>
|
<?php if ($this->context->transport->tab == 'delete'): ?>
|
||||||
<li class="selected delete">
|
<li class="selected delete">
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<li class="delete">
|
<li class="delete">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<a href="<?= \Chibi\UrlHelper::route('user', 'delete', ['name' => $this->context->transport->user->name]) ?>">
|
<a href="<?= \Chibi\UrlHelper::route('user', 'delete', [
|
||||||
|
'name' => $this->context->transport->user->name]) ?>">
|
||||||
Delete account
|
Delete account
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
Loading…
Reference in a new issue