Optimalization: simplified tabs structure
This commit is contained in:
parent
e4b4c5d273
commit
5e58488f3e
10 changed files with 140 additions and 126 deletions
|
@ -322,6 +322,38 @@ button:hover {
|
|||
|
||||
|
||||
|
||||
.tabs ul {
|
||||
list-style-type: none;
|
||||
margin: -4px 0 1em 0;
|
||||
padding: 0;
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.tabs li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.tabs li a {
|
||||
display: inline-block;
|
||||
padding: 0.5em 1em;
|
||||
margin: 5px 0 -1px 0;
|
||||
vertical-align: middle;
|
||||
border: 1px none;
|
||||
border-bottom: 1px solid #ccc;
|
||||
color: silver;
|
||||
}
|
||||
.tabs li.selected a {
|
||||
border: 1px solid #ccc;
|
||||
border-bottom: none;
|
||||
color: inherit;
|
||||
background: white;
|
||||
}
|
||||
|
||||
.tabs li a:focus {
|
||||
color: firebrick;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.alert {
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
|
|
|
@ -34,7 +34,6 @@ class IndexController
|
|||
throw new SimpleException('Invalid tab');
|
||||
$this->context->path = TextHelper::absolutePath($this->config->help->paths[$tab]);
|
||||
$this->context->stylesheets []= 'index-help.css';
|
||||
$this->context->stylesheets []= 'tabs.css';
|
||||
$this->context->subTitle = 'help';
|
||||
$this->context->tab = $tab;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,6 @@ class PostController
|
|||
$this->context->viewName = 'post-list-wrapper';
|
||||
$this->context->stylesheets []= 'post-small.css';
|
||||
$this->context->stylesheets []= 'post-list.css';
|
||||
$this->context->stylesheets []= 'tabs.css';
|
||||
$this->context->stylesheets []= 'paginator.css';
|
||||
$this->context->scripts []= 'post-list.js';
|
||||
if ($this->context->user->hasEnabledEndlessScrolling())
|
||||
|
@ -189,7 +188,6 @@ class PostController
|
|||
public function uploadAction()
|
||||
{
|
||||
$this->context->stylesheets []= 'upload.css';
|
||||
$this->context->stylesheets []= 'tabs.css';
|
||||
$this->context->scripts []= 'upload.js';
|
||||
$this->context->subTitle = 'upload';
|
||||
PrivilegesHelper::confirmWithException(Privilege::UploadPost);
|
||||
|
|
|
@ -9,7 +9,6 @@ class TagController
|
|||
public function listAction($filter = null)
|
||||
{
|
||||
$this->context->stylesheets []= 'tag-list.css';
|
||||
$this->context->stylesheets []= 'tabs.css';
|
||||
$this->context->subTitle = 'tags';
|
||||
$this->context->viewName = 'tag-list-wrapper';
|
||||
|
||||
|
@ -34,7 +33,6 @@ class TagController
|
|||
public function mergeAction()
|
||||
{
|
||||
$this->context->stylesheets []= 'tag-list.css';
|
||||
$this->context->stylesheets []= 'tabs.css';
|
||||
$this->context->subTitle = 'tags';
|
||||
$this->context->viewName = 'tag-list-wrapper';
|
||||
|
||||
|
@ -78,7 +76,6 @@ class TagController
|
|||
public function renameAction()
|
||||
{
|
||||
$this->context->stylesheets []= 'tag-list.css';
|
||||
$this->context->stylesheets []= 'tabs.css';
|
||||
$this->context->subTitle = 'tags';
|
||||
$this->context->viewName = 'tag-list-wrapper';
|
||||
|
||||
|
@ -113,7 +110,6 @@ class TagController
|
|||
public function massTagRedirectAction()
|
||||
{
|
||||
$this->context->stylesheets []= 'tag-list.css';
|
||||
$this->context->stylesheets []= 'tabs.css';
|
||||
$this->context->subTitle = 'tags';
|
||||
$this->context->viewName = 'tag-list-wrapper';
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ class UserController
|
|||
$this->context->transport->user = $user;
|
||||
$this->context->handleExceptions = true;
|
||||
$this->context->viewName = 'user-view';
|
||||
$this->context->stylesheets []= 'tabs.css';
|
||||
$this->context->stylesheets []= 'user-view.css';
|
||||
$this->context->subTitle = $user->name;
|
||||
}
|
||||
|
|
|
@ -4,8 +4,7 @@ $firstTab = !empty($tabs) ? array_keys($tabs)[0] : null;
|
|||
?>
|
||||
|
||||
<?php if (count($tabs) > 1): ?>
|
||||
<div class="tabs">
|
||||
<nav>
|
||||
<nav class="tabs">
|
||||
<ul>
|
||||
<?php foreach ($tabs as $tab => $text): ?>
|
||||
<?php if ($tab == $this->context->tab): ?>
|
||||
|
@ -20,7 +19,6 @@ $firstTab = !empty($tabs) ? array_keys($tabs)[0] : null;
|
|||
<?php endforeach ?>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echo TextHelper::parseMarkdown(file_get_contents($this->context->path)) ?>
|
||||
|
|
|
@ -11,8 +11,7 @@ if ($this->context->route->simpleActionName == 'favorites') $activeTab = 2;
|
|||
if ($this->context->source == 'mass-tag') $activeTab = 3;
|
||||
?>
|
||||
|
||||
<div class="tabs">
|
||||
<nav>
|
||||
<nav class="tabs">
|
||||
<ul>
|
||||
<?php foreach ($tabs as $i => $tab): ?>
|
||||
<?php list($name, $url) = $tab ?>
|
||||
|
@ -28,6 +27,5 @@ if ($this->context->source == 'mass-tag') $activeTab = 3;
|
|||
<?php endforeach ?>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<?php $this->renderFile('post-list') ?>
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
|
||||
<div id="inner-content">
|
||||
<div id="upload-step1">
|
||||
<div class="tabs">
|
||||
<nav>
|
||||
<nav class="tabs">
|
||||
<ul>
|
||||
<li class="selected file">
|
||||
<a href="#">
|
||||
|
@ -26,7 +25,6 @@
|
|||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="tab file">
|
||||
<input type=file multiple style="display: none"/>
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
<?php if (PrivilegesHelper::confirm(Privilege::MassTag)) $tabs['mass-tag-redirect'] = 'Mass tag'; ?>
|
||||
|
||||
<?php if (count(array_diff($tabs, ['list'])) > 1): ?>
|
||||
<div class="tabs">
|
||||
<nav>
|
||||
<nav class="tabs">
|
||||
<ul>
|
||||
<?php foreach ($tabs as $tab => $name): ?>
|
||||
<?php if ($this->context->route->simpleActionName == $tab): ?>
|
||||
|
@ -21,7 +20,6 @@
|
|||
<?php endforeach ?>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($this->context->route->simpleActionName == 'merge'): ?>
|
||||
|
|
|
@ -112,8 +112,7 @@
|
|||
</div>
|
||||
|
||||
<div id="inner-content">
|
||||
<div class="tabs">
|
||||
<nav>
|
||||
<nav class="tabs">
|
||||
<ul>
|
||||
<?php if ($this->context->transport->tab == 'favs'): ?>
|
||||
<li class="selected favs">
|
||||
|
@ -172,7 +171,6 @@
|
|||
<?php endif ?>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<?php if (isset($this->context->transport->posts)): ?>
|
||||
<?php $this->renderFile('post-list') ?>
|
||||
|
|
Loading…
Reference in a new issue