From 0b3c26c94788ec9444331505d4d0a8ccc67ee287 Mon Sep 17 00:00:00 2001 From: Wedge Date: Tue, 24 May 2016 17:01:22 +0300 Subject: [PATCH] Remove top white bar, few bugfixes --- .../controllers/rosa_abf_controller.js | 31 ++++++++--------- app/assets/stylesheets/rdash.css | 5 ++- app/views/layouts/application.html.slim | 23 ++----------- app/views/layouts/menu/_new_bottom.html.haml | 11 ------- app/views/layouts/menu/_new_bottom.html.slim | 7 ++++ app/views/layouts/menu/_new_top.html.slim | 33 ++++++++++++++++++- .../projects/build_lists/index.html.slim | 3 ++ .../projects/projects/index.json.jbuilder | 10 +++--- config/locales/menu.en.yml | 5 ++- nano.save | 10 ++++++ 10 files changed, 82 insertions(+), 56 deletions(-) delete mode 100644 app/views/layouts/menu/_new_bottom.html.haml create mode 100644 app/views/layouts/menu/_new_bottom.html.slim create mode 100644 nano.save diff --git a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js index 716b6e375..5e0bb2f51 100644 --- a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js +++ b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js @@ -1,5 +1,5 @@ -RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotificationsHelper', '$timeout', - function($scope, LocalesHelper, SoundNotificationsHelper, $timeout) { +RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotificationsHelper', '$timeout', '$cookies', + function($scope, LocalesHelper, SoundNotificationsHelper, $timeout, $cookies) { $scope.hideAlerts = false; $scope.init = function(locale, sound_notifications) { @@ -8,23 +8,24 @@ RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotifi SoundNotificationsHelper.enabled(sound_notifications); $timeout(function() { $scope.hideAlerts = true; }, 5000); } - var mobileView = 992; - $scope.getWidth = function() { - return window.innerWidth; - }; + if(typeof $cookies.get('toggle') == 'undefined') { + var mobileView = 992; - $scope.$watch($scope.getWidth, function(newValue, oldValue) { - if (newValue >= mobileView) { - $scope.toggle = true; - } - else { - $scope.toggle = false; - } - }); + if (window.innerWidth >= mobileView) { + $scope.toggle = true; + } + else { + $scope.toggle = false; + } + } + else { + $scope.toggle = $cookies.get('toggle') == 'true' ? true : false; + } $scope.toggleSidebar = function() { - $scope.toggle = !$scope.toggle; + $scope.toggle = !$scope.toggle; + $cookies.put("toggle", $scope.toggle); }; }]); diff --git a/app/assets/stylesheets/rdash.css b/app/assets/stylesheets/rdash.css index faf15eab6..5a3424606 100644 --- a/app/assets/stylesheets/rdash.css +++ b/app/assets/stylesheets/rdash.css @@ -493,7 +493,7 @@ ul.sidebar .sidebar-list .menu-icon { padding-left: 0; } .top-space { - margin-top: 15px; + padding-top: 15px; } .bottom-space { margin-bottom: 15px; @@ -543,4 +543,7 @@ table tbody tr.group-end td { } table { margin-bottom: 0 !important; +} +.no-indent { + text-indent: 0; } \ No newline at end of file diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index 52eb47467..e439485d3 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -23,36 +23,17 @@ html = image_tag('logo-mini.png', alt: 'ABF') span class="menu-icon glyphicon glyphicon-transfer" == render 'layouts/menu/new_top' + == render 'layouts/menu/new_bottom' .content-wrapper .page-content - .row.header - .col-md-12 - .user.pull-right - - if current_user - .item.dropdown(uib-dropdown) - a(uib-dropdown-toggle) - = image_tag avatar_url(current_user), alt: 'avatar' - ul.dropdown-menu.dropdown-menu-right - li.link= link_to current_user.uname, current_user - li.link= link_to t('layout.settings.label'), profile_settings_path - li.divider - li.link= link_to t('layout.logout'), destroy_user_session_path, method: :delete - - else - ul.nav.navbar-nav.navbar-account - li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path - li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path - .meta - .page - = form_tag search_index_path, method: 'get', role: 'search', class: 'navbar-left' do - = text_field_tag 'query', @query, placeholder: t('layout.search.header'), class: 'form-control' - == yield :submenu if content_for?(:submenu) == render 'layouts/noscript' == render "layouts/flashes" == yield + script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js" type="text/javascript" script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" type="text/javascript" script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-resource.min.js" type="text/javascript" diff --git a/app/views/layouts/menu/_new_bottom.html.haml b/app/views/layouts/menu/_new_bottom.html.haml deleted file mode 100644 index c60795278..000000000 --- a/app/views/layouts/menu/_new_bottom.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%footer.offset10 - %ul - %li= t('bottom_menu.copyright', year: Date.today.year) - %li · - %li= link_to t('bottom_menu.about'), t('bottom_menu.about_url') - %li · - %li= link_to t('bottom_menu.contacts'), t('bottom_menu.contacts_url') - %li · - %li= link_to t('bottom_menu.tos'), tos_url - %li · - %li= link_to t('bottom_menu.support'), contact_url \ No newline at end of file diff --git a/app/views/layouts/menu/_new_bottom.html.slim b/app/views/layouts/menu/_new_bottom.html.slim new file mode 100644 index 000000000..e3ba555d6 --- /dev/null +++ b/app/views/layouts/menu/_new_bottom.html.slim @@ -0,0 +1,7 @@ +.sidebar-footer + .col-xs-4 + = link_to t('bottom_menu.about'), t('bottom_menu.about_url') + .col-xs-4 + = link_to t('bottom_menu.contacts'), t('bottom_menu.contacts_url') + .col-xs-4 + = link_to t('bottom_menu.support'), contact_url \ No newline at end of file diff --git a/app/views/layouts/menu/_new_top.html.slim b/app/views/layouts/menu/_new_top.html.slim index 5d027cc1c..ec214508d 100644 --- a/app/views/layouts/menu/_new_top.html.slim +++ b/app/views/layouts/menu/_new_top.html.slim @@ -1,7 +1,38 @@ +li.sidebar-list + div.form-inline.no-indent + = form_tag search_index_path, method: 'get', role: 'search' do + = text_field_tag 'query', @query, placeholder: t('layout.search.header'), class: 'form-control', ng_show: 'toggle' -if current_user + li.sidebar-title + span + = t 'top_menu_labels.navigation' - (collection = t 'top_menu').each do |base, title| - if policy(base.to_s.singularize.to_sym).index? li.sidebar-list a href=send("#{base}_path") = title - span.menu-icon.fa class=top_menu_icon(base) \ No newline at end of file + span.menu-icon.fa class=top_menu_icon(base) + li.sidebar-title + span + = t 'top_menu_labels.account' + li.sidebar-list + a href=url_for(current_user) + = current_user.uname + span.menu-icon.fa.fa-user + li.sidebar-list + a href=profile_settings_path + = t('layout.settings.label') + span.menu-icon.fa.fa-wrench + li.sidebar-list + a href=destroy_user_session_path data-method='delete' + = t('layout.logout') + span.menu-icon.fa.fa-sign-out +-else + li.sidebar-list + a href=new_user_registration_path + = t('layout.devise.shared_links.sign_up') + span.menu-icon.fa.fa-key + li.sidebar-list + a href=new_user_session_path + = t('layout.devise.shared_links.sign_in') + span.menu-icon.fa.fa-user \ No newline at end of file diff --git a/app/views/projects/build_lists/index.html.slim b/app/views/projects/build_lists/index.html.slim index cbbc07c41..727eb6bfe 100644 --- a/app/views/projects/build_lists/index.html.slim +++ b/app/views/projects/build_lists/index.html.slim @@ -4,6 +4,9 @@ rd-widget rd-widget-header title="Build Lists {{::widgetTitle}}" icon="fa-gears" .form-inline.pull-right ng-init="autoreload=true" + - if @project and policy(@project.build_lists.build).create? + a.btn.btn-default href=new_project_build_list_path(@project) + = t('layout.build_lists.new_header') button ng-model="autoreload" ng-click="setAutoreload(autoreload)" class="btn btn-default" uib-btn-checkbox="" = t 'layout.autoreload_page' button class="btn btn-default" ng-click="openFilters()" ng-disabled="isRequest" diff --git a/app/views/projects/projects/index.json.jbuilder b/app/views/projects/projects/index.json.jbuilder index 7306bffb8..5a9e74fad 100644 --- a/app/views/projects/projects/index.json.jbuilder +++ b/app/views/projects/projects/index.json.jbuilder @@ -1,10 +1,8 @@ json.projects do json.array!(@projects) do |item| - json.cache! item, expires_in: 1.minutes do - json.name_with_owner item.name_with_owner - json.project_link project_build_lists_path(item.name_with_owner) - json.new_build_list_link new_project_build_list_path(item.name_with_owner) - json.edit_link edit_project_path(item) if policy(item).update? - end + json.name_with_owner item.name_with_owner + json.project_link project_build_lists_path(item.name_with_owner) + json.new_build_list_link new_project_build_list_path(item.name_with_owner) + json.edit_link edit_project_path(item) if policy(item).update? end end \ No newline at end of file diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index 5947b5fe6..73e624dd8 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -3,6 +3,9 @@ en: repositories: Repositories personal_repository: My repository products: Products + top_menu_labels: + navigation: navigation + account: account top_menu: projects: Projects build_lists: Build Lists @@ -11,7 +14,7 @@ en: statistics: Statistics bottom_menu: copyright: OMV © %{year} - about: About the company + about: About about_url: https://www.openmandriva.org/About?lang=en contacts: Contacts contacts_url: https://www.openmandriva.org/Join-contribute?lang=en diff --git a/nano.save b/nano.save new file mode 100644 index 000000000..45f5f899b --- /dev/null +++ b/nano.save @@ -0,0 +1,10 @@ +lrwxrwxrwx 1 root root 10 Apr 23 02:32 11e23878-9b3e-45a7-8de8-7a33fa8f5d4c -> ../../sdb2 +lrwxrwxrwx 1 root root 11 May 21 21:55 2006-12-30-02-00-07-00 -> ../../loop0 +lrwxrwxrwx 1 root root 10 Apr 23 02:32 2c7ae06f-87a0-477a-a5c7-acd09f471755 -> ../../sda2 +lrwxrwxrwx 1 root root 10 Apr 23 02:32 3E22EBBF22EB7A73 -> ../../sda4 +lrwxrwxrwx 1 root root 10 Apr 23 02:32 6ca55aef-2473-4c39-83be-317b9f1da030 -> ../../sda1 +lrwxrwxrwx 1 root root 10 Apr 23 02:32 7baa994f-d615-4666-a8fd-9f6b453b753f -> ../../sdb4 +lrwxrwxrwx 1 root root 10 May 23 11:14 99a481e0-cdfb-4ceb-914c-921010fb90ea -> ../../sde1 +lrwxrwxrwx 1 root root 10 Apr 23 02:32 C000D88600D884B6 -> ../../sda3 +lrwxrwxrwx 1 root root 10 Apr 23 02:32 D0882CA9882C8FD0 -> ../../sdb3 +lrwxrwxrwx 1 root root 10 Apr 23 02:32 d7695def-44a8-4694-a3d7-07810637e37a -> ../../sdb1