From 5e58488f3e5ed863e2443507f8955757ba207cbc Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 30 Nov 2013 00:03:59 +0100 Subject: [PATCH] Optimalization: simplified tabs structure --- public_html/media/css/core.css | 32 ++++++++++ src/Controllers/IndexController.php | 1 - src/Controllers/PostController.php | 2 - src/Controllers/TagController.php | 4 -- src/Controllers/UserController.php | 1 - src/Views/index-help.phtml | 32 +++++----- src/Views/post-list-wrapper.phtml | 34 +++++----- src/Views/post-upload.phtml | 30 +++++---- src/Views/tag-list-wrapper.phtml | 32 +++++----- src/Views/user-view.phtml | 98 ++++++++++++++--------------- 10 files changed, 140 insertions(+), 126 deletions(-) diff --git a/public_html/media/css/core.css b/public_html/media/css/core.css index 533c6333..dabe8a8b 100644 --- a/public_html/media/css/core.css +++ b/public_html/media/css/core.css @@ -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; diff --git a/src/Controllers/IndexController.php b/src/Controllers/IndexController.php index cfafa486..dba5b861 100644 --- a/src/Controllers/IndexController.php +++ b/src/Controllers/IndexController.php @@ -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; } diff --git a/src/Controllers/PostController.php b/src/Controllers/PostController.php index 56bc69d7..14fded91 100644 --- a/src/Controllers/PostController.php +++ b/src/Controllers/PostController.php @@ -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); diff --git a/src/Controllers/TagController.php b/src/Controllers/TagController.php index 5d9d7cbd..1df13082 100644 --- a/src/Controllers/TagController.php +++ b/src/Controllers/TagController.php @@ -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'; diff --git a/src/Controllers/UserController.php b/src/Controllers/UserController.php index 6a26ecad..b8f2de4e 100644 --- a/src/Controllers/UserController.php +++ b/src/Controllers/UserController.php @@ -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; } diff --git a/src/Views/index-help.phtml b/src/Views/index-help.phtml index f4093364..427e946f 100644 --- a/src/Views/index-help.phtml +++ b/src/Views/index-help.phtml @@ -4,23 +4,21 @@ $firstTab = !empty($tabs) ? array_keys($tabs)[0] : null; ?> 1): ?> -
- -
+ context->path)) ?> diff --git a/src/Views/post-list-wrapper.phtml b/src/Views/post-list-wrapper.phtml index 49fc6702..85c90cb6 100644 --- a/src/Views/post-list-wrapper.phtml +++ b/src/Views/post-list-wrapper.phtml @@ -11,23 +11,21 @@ if ($this->context->route->simpleActionName == 'favorites') $activeTab = 2; if ($this->context->source == 'mass-tag') $activeTab = 3; ?> -
- -
+ renderFile('post-list') ?> diff --git a/src/Views/post-upload.phtml b/src/Views/post-upload.phtml index b81caba7..84b5af9e 100644 --- a/src/Views/post-upload.phtml +++ b/src/Views/post-upload.phtml @@ -10,23 +10,21 @@
- +
  • + + Upload from URL + +
  • + +
    diff --git a/src/Views/tag-list-wrapper.phtml b/src/Views/tag-list-wrapper.phtml index 82feaed5..f1c33ab7 100644 --- a/src/Views/tag-list-wrapper.phtml +++ b/src/Views/tag-list-wrapper.phtml @@ -5,23 +5,21 @@ 1): ?> -
    - -
    + context->route->simpleActionName == 'merge'): ?> diff --git a/src/Views/user-view.phtml b/src/Views/user-view.phtml index a9de809d..34c1815f 100644 --- a/src/Views/user-view.phtml +++ b/src/Views/user-view.phtml @@ -112,67 +112,65 @@
    -
    -
    + + Delete account + + + + + context->transport->posts)): ?> renderFile('post-list') ?>