[#369] fix main page

This commit is contained in:
Alexander Machehin 2014-05-12 16:02:48 +06:00
parent 225de8d440
commit ed21e0475b
4 changed files with 16 additions and 16 deletions

View File

@ -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') {

View File

@ -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

View File

@ -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'

View File

@ -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