diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/projects_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/application_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/commits_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/keys_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/merge_requests_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/refs_controller.rb | 23 | ||||
-rw-r--r-- | app/controllers/team_members_controller.rb | 2 |
8 files changed, 35 insertions, 9 deletions
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index 813e135b77f..2c6363c6f3e 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -52,6 +52,12 @@ class Admin::ProjectsController < ApplicationController def update @admin_project = Project.find_by_code(params[:id]) + owner_id = params[:project][:owner_id] + + if owner_id + @admin_project.owner = User.find(owner_id) + end + if @admin_project.update_attributes(params[:project]) redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' else diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 00ab93a153d..5a5b4aeb8d4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -95,4 +95,8 @@ class ApplicationController < ActionController::Base response.headers["Pragma"] = "no-cache" response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" end + + def render_full_content + @full_content = true + end end diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb index a938461fed1..e2853dd6cf6 100644 --- a/app/controllers/commits_controller.rb +++ b/app/controllers/commits_controller.rb @@ -29,6 +29,8 @@ class CommitsController < ApplicationController @line_notes = project.commit_line_notes(@commit) + render_full_content + respond_to do |format| format.html format.js { respond_with_notes } diff --git a/app/controllers/keys_controller.rb b/app/controllers/keys_controller.rb index 33c6958d6ab..ce49e3e72c6 100644 --- a/app/controllers/keys_controller.rb +++ b/app/controllers/keys_controller.rb @@ -1,6 +1,6 @@ class KeysController < ApplicationController layout "profile" - respond_to :js + respond_to :js, :html def index @keys = current_user.keys.all diff --git a/app/controllers/merge_requests_controller.rb b/app/controllers/merge_requests_controller.rb index 3456a0a7fcb..9ab62f5e72c 100644 --- a/app/controllers/merge_requests_controller.rb +++ b/app/controllers/merge_requests_controller.rb @@ -39,6 +39,8 @@ class MergeRequestsController < ApplicationController @notes = @merge_request.notes.inc_author.order("created_at DESC").limit(20) @note = @project.notes.new(:noteable => @merge_request) + render_full_content + respond_to do |format| format.html format.js { respond_with_notes } diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 6bd72a860b3..7f9e6866d89 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -68,7 +68,8 @@ class ProjectsController < ApplicationController def show return render "projects/empty" unless @project.repo_exists? && @project.has_commits? - limit = (params[:limit] || 20).to_i + limit = (params[:limit] || 10).to_i + @activities = @project.activities(limit)#updates_wo_repo(limit) end diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb index 2f887a4ebe1..0e062fc6697 100644 --- a/app/controllers/refs_controller.rb +++ b/app/controllers/refs_controller.rb @@ -8,16 +8,27 @@ class RefsController < ApplicationController before_filter :ref before_filter :define_tree_vars, :only => [:tree, :blob] + before_filter :render_full_content + layout "project" def switch - new_path = if params[:destination] == "tree" - tree_project_ref_path(@project, params[:ref]) - else - project_commits_path(@project, :ref => params[:ref]) - end + respond_to do |format| + format.html do + new_path = if params[:destination] == "tree" + tree_project_ref_path(@project, params[:ref]) + else + project_commits_path(@project, :ref => params[:ref]) + end - redirect_to new_path + redirect_to new_path + end + format.js do + @ref = params[:ref] + define_tree_vars + render "tree" + end + end end # diff --git a/app/controllers/team_members_controller.rb b/app/controllers/team_members_controller.rb index c05602f9a80..ab51c19e0c8 100644 --- a/app/controllers/team_members_controller.rb +++ b/app/controllers/team_members_controller.rb @@ -40,7 +40,7 @@ class TeamMembersController < ApplicationController @team_member.destroy respond_to do |format| - format.html { redirect_to root_path } + format.html { redirect_to team_project_path(@project) } format.js { render :nothing => true } end end |