This commit is contained in:
huang 2016-06-17 11:29:49 +08:00
parent fea21fe7cd
commit d0791253d9
8 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the QualityAnalyses controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -645,7 +645,7 @@ class ProjectsController < ApplicationController
params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0
params[:project][:hidden_repo] ? @project.hidden_repo = 1 : @project.hidden_repo = 0
# 更新公开私有时同步gitlab公开私有
unless @project.gpid.nil?
if !@project.gpid.nil? && @project.is_public != (params[:project][:is_public] == "on" ? true : false)
g = Gitlab.client
params[:project][:is_public] ? g.edit_project(@project.gpid, 20, params[:branch]) : g.edit_project(@project.gpid, 0, params[:branch])
end

View File

@ -0,0 +1,15 @@
class QualityAnalysesController < ApplicationController
before_filter :find_project_by_project_id#, :except => [:getattachtype]
layout "base_projects"
def index
end
# Find project of id params[:project_id]
def find_project_by_project_id
@project = Project.find(params[:project_id])
rescue ActiveRecord::RecordNotFound
render_404
end
end

View File

@ -0,0 +1,2 @@
module QualityAnalysesHelper
end

View File

@ -782,6 +782,13 @@ RedmineApp::Application.routes.draw do
end
end
resources :quality_analyses, :only => [:index] do
collection do
end
member do
end
end
# resources :files, :only => [:index, :new, :create] do
# member do
# match "quote_resource_show_project",:via => [:get]

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe QualityAnalysesController, :type => :controller do
end