diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-21 04:51:56 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-05-21 04:51:56 +0400 |
commit | 2fca0520e60011b32dc7f612d5826d1bbed250d6 (patch) | |
tree | eae5def1cd6bbd57b9424625f683d93a904dcb7b /plugins | |
parent | d473373a77e6014d58c7224363b879452a10ebd2 (diff) |
refs #5192 order user menu items + some UI tweaks and simplify
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreHome/stylesheets/coreHome.less | 2 | ||||
-rw-r--r-- | plugins/CoreHome/templates/_topBar.twig | 1 | ||||
-rw-r--r-- | plugins/CoreHome/templates/_topBarHelloMenu.twig | 64 | ||||
-rw-r--r-- | plugins/CoreHome/templates/_topBarTopMenu.twig | 69 | ||||
-rw-r--r-- | plugins/Feedback/Menu.php | 4 | ||||
-rw-r--r-- | plugins/ScheduledReports/Menu.php | 7 | ||||
-rw-r--r-- | plugins/Widgetize/Menu.php | 1 | ||||
-rw-r--r-- | plugins/Zeitgeist/stylesheets/ui/_header.less | 5 | ||||
-rw-r--r-- | plugins/ZenMode/angularjs/quick-access/quick-access-directive.js | 2 |
9 files changed, 79 insertions, 76 deletions
diff --git a/plugins/CoreHome/stylesheets/coreHome.less b/plugins/CoreHome/stylesheets/coreHome.less index 6913290281..91d438fed3 100644 --- a/plugins/CoreHome/stylesheets/coreHome.less +++ b/plugins/CoreHome/stylesheets/coreHome.less @@ -219,7 +219,7 @@ a.Piwik_Popover_Error_Back { #userMenu .items { margin-left: -50px; - width: 150px; + width: 160px; } #updateCheckLinkContainer { diff --git a/plugins/CoreHome/templates/_topBar.twig b/plugins/CoreHome/templates/_topBar.twig index 29727e28b4..a26a52ac49 100644 --- a/plugins/CoreHome/templates/_topBar.twig +++ b/plugins/CoreHome/templates/_topBar.twig @@ -1,5 +1,4 @@ {{ postEvent("Template.beforeTopBar", userAlias, userLogin, topMenu) }} <div id="topBars"> - {% include "@CoreHome/_topBarHelloMenu.twig" %} {% include "@CoreHome/_topBarTopMenu.twig" %} </div> diff --git a/plugins/CoreHome/templates/_topBarHelloMenu.twig b/plugins/CoreHome/templates/_topBarHelloMenu.twig deleted file mode 100644 index 4b6736cec3..0000000000 --- a/plugins/CoreHome/templates/_topBarHelloMenu.twig +++ /dev/null @@ -1,64 +0,0 @@ -<div id="topRightBar"> - {% set helloAlias %} - {% if userAlias is not empty %} - {{ userAlias|raw }} - {% else %} - {{ userLogin|raw }} - {% endif %} - {% endset %} - - {% macro userMenuItem(label, menu, currentModule, currentAction) %} - {% if (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %} - <a class="item active" - {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %} - >{{ label|translate }}</a> - {% else %} - <a class="item" - href="index.php{{ menu._url|urlRewriteWithParameters }}" - {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %} - >{{ label|translate }}</a> - {% endif %} - {% endmacro %} - - <span class="topBarElem"> - <div id="userMenu" - title="{{ 'General_HelloUser'|translate(helloAlias|trim)|raw }}" - menu-title="{{ helloAlias|trim }}" - piwik-menudropdown> - - {% if userLogin != 'anonymous' %} - {% if isAdminLayout is defined %} - <a class="item active">{{ 'General_Settings'|translate }}</a> - {% else %} - <a class="item" href="index.php?module=CoreAdminHome">{{ 'General_Settings'|translate }}</a> - {% endif %} - {% endif %} - - {% for lev1UserLabel,lev1UserMenu in userMenu if lev1UserLabel|slice(0,1) != '_' %} - - {% if userLogin != 'anonymous' or not loop.first %} - <hr class="item separator"/> - {% endif %} - - {% if lev1UserMenu._hasSubmenu is defined and lev1UserMenu._hasSubmenu %} - <a class="item disabled category">{{ lev1UserLabel|translate }}</a> - - {% for lev2Label,lev2Menu in lev1UserMenu if lev2Label|slice(0,1) != '_' %} - {{ _self.userMenuItem(lev2Label, lev2Menu, currentModule, currentAction) }} - {% endfor %} - {% else %} - {{ _self.userMenuItem(lev1UserLabel, lev1UserMenu, currentModule, currentAction) }} - {% endif %} - - {% endfor %} - </div> - </span> - - | <span class="topBarElem"> - {% if userLogin == 'anonymous' %} - <a href='index.php?module={{ loginModule }}'>{{ 'Login_LogIn'|translate }}</a> - {% else %} - <a href='index.php?module={{ loginModule }}&action=logout'>{{ 'General_Logout'|translate }}</a> - {% endif %} - </span> -</div> diff --git a/plugins/CoreHome/templates/_topBarTopMenu.twig b/plugins/CoreHome/templates/_topBarTopMenu.twig index 073061992d..622a9fb284 100644 --- a/plugins/CoreHome/templates/_topBarTopMenu.twig +++ b/plugins/CoreHome/templates/_topBarTopMenu.twig @@ -1,4 +1,4 @@ -<div id="topLeftBar"> +<div id="topRightBar"> {% for label,menu in topMenu %} {% if menu._html is defined %} {{ menu._html|raw }} @@ -11,4 +11,69 @@ {% endif %} | {% endfor %} -</div>
\ No newline at end of file + + {% set helloAlias %} + {% if userAlias is not empty %} + {{ userAlias|raw }} + {% else %} + {{ userLogin|raw }} + {% endif %} + {% endset %} + + {% macro userMenuItem(label, menu, currentModule, currentAction) %} + {% if (menu._url.module == currentModule and (menu._url.action is empty or menu._url.action == currentAction)) %} + <a class="item active" + {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %} + >{{ label|translate }}</a> + {% else %} + <a class="item" + href="index.php{{ menu._url|urlRewriteWithParameters }}" + {% if menu._tooltip is defined %}title="{{ menu._tooltip }}"{% endif %} + >{{ label|translate }}</a> + {% endif %} + {% endmacro %} + + <span class="topBarElem"> + <div id="userMenu" + title="{{ 'General_HelloUser'|translate(helloAlias|trim)|raw }}" + menu-title="{{ helloAlias|trim }}" + piwik-menudropdown> + + {% if userLogin != 'anonymous' %} + {% if isAdminLayout is defined %} + <a class="item active">{{ 'General_Settings'|translate }}</a> + {% else %} + <a class="item" href="index.php?module=CoreAdminHome">{{ 'General_Settings'|translate }}</a> + {% endif %} + {% endif %} + + {% for lev1UserLabel,lev1UserMenu in userMenu if lev1UserLabel|slice(0,1) != '_' %} + + {% if userLogin != 'anonymous' or not loop.first %} + <hr class="item separator"/> + {% endif %} + + {% if lev1UserMenu._hasSubmenu is defined and lev1UserMenu._hasSubmenu %} + {% if lev1UserLabel %} + <a class="item disabled category">{{ lev1UserLabel|translate }}</a> + {% endif %} + + {% for lev2Label,lev2Menu in lev1UserMenu if lev2Label|slice(0,1) != '_' %} + {{ _self.userMenuItem(lev2Label, lev2Menu, currentModule, currentAction) }} + {% endfor %} + {% else %} + {{ _self.userMenuItem(lev1UserLabel, lev1UserMenu, currentModule, currentAction) }} + {% endif %} + + {% endfor %} + </div> + </span> + + | <span class="topBarElem"> + {% if userLogin == 'anonymous' %} + <a href='index.php?module={{ loginModule }}'>{{ 'Login_LogIn'|translate }}</a> + {% else %} + <a href='index.php?module={{ loginModule }}&action=logout'>{{ 'General_Logout'|translate }}</a> + {% endif %} + </span> +</div> diff --git a/plugins/Feedback/Menu.php b/plugins/Feedback/Menu.php index 1b352a4b2a..1355636d97 100644 --- a/plugins/Feedback/Menu.php +++ b/plugins/Feedback/Menu.php @@ -17,10 +17,10 @@ class Menu extends \Piwik\Plugin\Menu { $menu->add( 'General_Help', - 'General_Help', + null, array('module' => 'Feedback', 'action' => 'index', 'segment' => false), true, - $order = 20, + $order = 99, $tooltip = Piwik::translate('Feedback_TopLinkTooltip') ); } diff --git a/plugins/ScheduledReports/Menu.php b/plugins/ScheduledReports/Menu.php index b70782ac63..ceeeee14ac 100644 --- a/plugins/ScheduledReports/Menu.php +++ b/plugins/ScheduledReports/Menu.php @@ -26,6 +26,13 @@ class Menu extends \Piwik\Plugin\Menu $menu->add( 'CoreAdminHome_MenuManage', + null, + array('module' => '', 'action' => '', 'segment' => false), + true, + 10 + ); + $menu->add( + 'CoreAdminHome_MenuManage', $this->getTopMenuTranslationKey(), array('module' => 'ScheduledReports', 'action' => 'index', 'segment' => false), true, diff --git a/plugins/Widgetize/Menu.php b/plugins/Widgetize/Menu.php index a60a6e14b5..a4ab4c5541 100644 --- a/plugins/Widgetize/Menu.php +++ b/plugins/Widgetize/Menu.php @@ -18,6 +18,7 @@ class Menu extends \Piwik\Plugin\Menu $tooltip = Piwik::translate('Widgetize_TopLinkTooltip'); $urlParams = array('module' => 'Widgetize', 'action' => 'index', 'segment' => false); + $menu->add('CorePluginsAdmin_MenuPlatform', null, $urlParams, true, 50, $tooltip); $menu->add('CorePluginsAdmin_MenuPlatform', 'General_Widgets', $urlParams, true, 5, $tooltip); } diff --git a/plugins/Zeitgeist/stylesheets/ui/_header.less b/plugins/Zeitgeist/stylesheets/ui/_header.less index 43725d84ec..80a3280eba 100644 --- a/plugins/Zeitgeist/stylesheets/ui/_header.less +++ b/plugins/Zeitgeist/stylesheets/ui/_header.less @@ -53,16 +53,11 @@ font-size: 13px; } -#topLeftBar, #topRightBar { margin-bottom: 4px; float: right; } -#topLeftBar { - margin-right: 5px; -} - .topBarElem { padding: 0 5px; display: inline-block; diff --git a/plugins/ZenMode/angularjs/quick-access/quick-access-directive.js b/plugins/ZenMode/angularjs/quick-access/quick-access-directive.js index 7138baa66e..0456b9d4c4 100644 --- a/plugins/ZenMode/angularjs/quick-access/quick-access-directive.js +++ b/plugins/ZenMode/angularjs/quick-access/quick-access-directive.js @@ -35,7 +35,7 @@ angular.module('piwikApp').directive('piwikQuickAccess', function($rootElement, return menuItems; } - $rootElement.find('#topLeftBar .topBarElem a, #topRightBar .topBarElem a').each(function (index, element) { + $rootElement.find('#topRightBar .topBarElem a').each(function (index, element) { menuItems.push({name: $(element).text(), index: ++menuIndex, category: 'menuCategory'}); $(element).attr('quick_access', menuIndex); }); |