parent
75e68aea5a
commit
28c1ce68b4
7 changed files with 36 additions and 9 deletions
|
@ -96,8 +96,11 @@ body {
|
|||
margin-right: -1px;
|
||||
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
#top-nav li.safety a:after {
|
||||
content: ' ';
|
||||
}
|
||||
#top-nav li.safety span {
|
||||
visibility: hidden;
|
||||
display: none;
|
||||
}
|
||||
#top-nav li.safety a:hover { opacity: .7; }
|
||||
#top-nav li.safety a.inactive { opacity: 1; }
|
||||
|
|
|
@ -6,3 +6,15 @@
|
|||
width: 140px;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
.posts .post-type-flash img {
|
||||
border-color: #dd5;
|
||||
box-shadow: 0.25em 0.25em #eeb, 0.1em 0.1em 0.5em 0.1em rgba(238,238,187,0.5);
|
||||
}
|
||||
|
||||
.posts a:focus img,
|
||||
.posts a:hover img {
|
||||
border: 1px solid firebrick;
|
||||
box-shadow: 0.25em 0.25em pink;
|
||||
opacity: .9;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,18 @@ class TextHelper
|
|||
return $string;
|
||||
}
|
||||
|
||||
public static function camelCaseToHumanCase($string, $ucfirst = false)
|
||||
{
|
||||
$string = preg_replace_callback('/[A-Z]/', function($x)
|
||||
{
|
||||
return ' ' . strtolower($x[0]);
|
||||
}, $string);
|
||||
$string = trim($string);
|
||||
if ($ucfirst)
|
||||
$string = ucfirst($string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
public static function resolveConstant($constantName, $className = null)
|
||||
{
|
||||
$constantName = self::kebabCaseToCamelCase($constantName);
|
||||
|
|
|
@ -68,9 +68,9 @@
|
|||
<ul>
|
||||
<?php foreach (PostSafety::getAll() as $safety): ?>
|
||||
<?php if (PrivilegesHelper::confirm($this->context->user, Privilege::ListPosts, PostSafety::toString($safety))): ?>
|
||||
<li class="safety-<?php echo strtolower(PostSafety::toString($safety)) ?>">
|
||||
<a href="<?php echo \Chibi\UrlHelper::route('user', 'toggle-safety', ['safety' => $safety]) ?>" class="<?php echo $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>" title="Searching <?php echo strtolower(PostSafety::ToString($safety)) ?> posts: <?php echo $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>">
|
||||
<span><?php echo PostSafety::toString($safety) ?></span>
|
||||
<li class="safety-<?php echo TextHelper::camelCaseToHumanCase(PostSafety::toString($safety)) ?>">
|
||||
<a href="<?php echo \Chibi\UrlHelper::route('user', 'toggle-safety', ['safety' => $safety]) ?>" class="<?php echo $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>" title="Searching <?php echo TextHelper::camelCaseToHumanCase(PostSafety::ToString($safety)) ?> posts: <?php echo $this->context->user->hasEnabledSafety($safety) ? 'enabled' : 'disabled' ?>">
|
||||
<span><?php echo TextHelper::camelCaseToHumanCase(PostSafety::toString($safety), true) ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<?php else: ?>
|
||||
<div class="posts paginator-content">
|
||||
<?php foreach ($this->context->transport->posts as $post): ?>
|
||||
<a href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $post['id']]) ?>">
|
||||
<a class="post post-type-<?php echo TextHelper::camelCaseToHumanCase(PostType::toString($post['type'])) ?>" href="<?php echo \Chibi\UrlHelper::route('post', 'view', ['id' => $post['id']]) ?>">
|
||||
<img src="<?php echo \Chibi\UrlHelper::route('post', 'thumb', ['id' => $post['id']]) ?>" alt="@<?php echo $post['id'] ?>"/>
|
||||
</a>
|
||||
<?php endforeach ?>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
<div class="key-value safety">
|
||||
<span class="key">Safety:</span>
|
||||
<span class="value" title="<?php echo $val = PostSafety::toString($this->context->transport->post->safety) ?>">
|
||||
<span class="value" title="<?php echo $val = TextHelper::camelCaseToHumanCase(PostSafety::toString($this->context->transport->post->safety)) ?>">
|
||||
<?php echo $val ?>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -209,7 +209,7 @@
|
|||
<?php foreach (PostSafety::getAll() as $safety): ?>
|
||||
<label>
|
||||
<input type="radio" name="safety" value="<?php echo $safety ?>" <?php if ($this->context->transport->post->safety == $safety) echo 'checked="checked"' ?>/>
|
||||
<?php echo PostSafety::toString($safety) ?>
|
||||
<?php echo TextHelper::camelCaseToHumanCase(PostSafety::toString($safety), true) ?>
|
||||
</label>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<div class="key-value access-rank">
|
||||
<span class="key">Access rank:</span>
|
||||
<span class="value" title="<?php echo $val = strtolower(AccessRank::toString($this->context->transport->user->access_rank)) ?>"><?php echo $val ?></span>
|
||||
<span class="value" title="<?php echo $val = TextHelper::camelCaseToHumanCase(AccessRank::toString($this->context->transport->user->access_rank)) ?>"><?php echo $val ?></span>
|
||||
</div>
|
||||
|
||||
<?php if ($this->context->user->id == $this->context->transport->user->id): ?>
|
||||
|
@ -206,7 +206,7 @@
|
|||
<?php else: ?>
|
||||
<option value="<?php echo $rank ?>">
|
||||
<?php endif ?>
|
||||
<?php echo AccessRank::toString($rank) ?>
|
||||
<?php echo TextHelper::camelCaseToHumanCase(AccessRank::toString($rank)) ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
|
|
Loading…
Reference in a new issue