diff --git a/app/assets/javascripts/angular-new/controllers/activity_controller.js b/app/assets/javascripts/angular-new/controllers/activity_controller.js index baa0c9051..f91922d68 100644 --- a/app/assets/javascripts/angular-new/controllers/activity_controller.js +++ b/app/assets/javascripts/angular-new/controllers/activity_controller.js @@ -1,6 +1,6 @@ RosaABF.controller('ActivityCtrl', ['$scope', '$http', '$timeout', '$q', '$filter', function($scope, $http, $timeout, $q, $filter) { - $scope.activity_tab = { title: 'activity_menu.activity_feed', active: true, filter: 'all', + $scope.activity_tab = { title: 'activity_menu.activity_feed', active: false, filter: 'all', all: {}, code: {}, tracker: {}, build: {}, wiki: {} }; $scope.tracker_tab = { title: 'activity_menu.tracker', content: [] , active: false, filter: { all: true, assigned: false, created: false, name: 'all', @@ -13,6 +13,18 @@ RosaABF.controller('ActivityCtrl', ['$scope', '$http', '$timeout', '$q', '$filte sort: { sort: 'updated', direction: 'desc', updated_class: 'fa-chevron-up' }, status: 'open', pagination: { page: 1, total_count: 0 } }; + $scope.init = function(active_tab) { + if(active_tab === 'activity') { + $scope.activity_tab.active = true; + } + else if(active_tab === 'issues') { + $scope.tracker_tab.active = true; + } + else if(active_tab === 'pull_requests') { + $scope.pull_requests_tab.active = true; + }; + }; + $scope.getContent = function(tab){ var cur_tab = $scope.$eval(tab+'_tab'); if (tab === 'activity') { diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index e7a4e3f28..bc56f0848 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -13,7 +13,7 @@ class HomeController < ApplicationController @activity_feeds = @activity_feeds.paginate page: current_page respond_to do |format| - format.html { request.xhr? ? render('_list', layout: false) : render('activity') } + format.html { render 'activity' } format.json {} format.atom end @@ -57,7 +57,7 @@ class HomeController < ApplicationController .paginate page: current_page respond_to do |format| - format.html { request.xhr? ? render('issues', layout: 'with_sidebar') : render('issues', layout: 'application') } + format.html { render 'activity' } format.json { render 'issues' } end end diff --git a/app/views/home/activity.html.haml b/app/views/home/activity.html.haml index c8ef80ec8..4de87df0a 100644 --- a/app/views/home/activity.html.haml +++ b/app/views/home/activity.html.haml @@ -7,7 +7,7 @@ / - content_for :sidebar, render('sidebar') / - render 'top_menu' - %div{ 'ng-controller' => 'ActivityCtrl', 'cg-busy' => "'activity'" } + %div{ 'ng-controller' => 'ActivityCtrl', 'cg-busy' => "'activity'", 'ng-init' => "init('#{action_name}')" } %tabset.offset20 = render 'activity_tab' = render 'tracker_and_pulls_tabs' diff --git a/app/views/home/issues.html.haml b/app/views/home/issues.html.haml deleted file mode 100644 index cfd2b1a29..000000000 --- a/app/views/home/issues.html.haml +++ /dev/null @@ -1,12 +0,0 @@ --set_meta_tags title: t("home.#{action_name}.title") --render 'top_menu' --content_for :sidebar do - =form_tag send("#{action_name}_path"), id: 'filter_issues', method: :get do - .bordered - %table - -%w[all assigned created].each do |filter| - %tr - %td.width18=radio_button_tag :myradio, filter, filter == @filter, {id: 'myradio1', class: 'niceRadio', name: 'filter'} - %td.width135=t("layout.#{action_name}.#{filter}") - %td.width30.right=instance_variable_get("@#{filter}_issues").not_closed_or_merged.count -=render 'projects/issues/issues_table', issues: @issues