diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 8891f5955..33ee058da 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,6 +1,6 @@ class ProjectsController < ApplicationController before_filter :authenticate_user!, :except => :auto_build - before_filter :find_project, :only => [:show, :edit, :update, :destroy, :build, :process_build] + before_filter :find_project, :only => [:show, :edit, :update, :destroy, :build, :process_build, :add_collaborators] before_filter :get_paths, :only => [:new, :create, :edit, :update] before_filter :check_global_access, :except => :auto_build @@ -102,6 +102,15 @@ class ProjectsController < ApplicationController end end + def add_collaborators + if request.post? + # some stuff + redirect_to project_path(@project) + else + # display template + end + end + protected def get_paths diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index ba3c5c14f..1b9283185 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -7,6 +7,7 @@ .content %h2.title= t("layout.projects.edit_header") + = link_to '(' + t("layout.projects.add_collaborators") + ')', add_collaborators_project_path(@project) .inner = form_for @project, :html => { :class => :form } do |f| = render :partial => "form", :locals => {:f => f} diff --git a/config/locales/ru.yml b/config/locales/ru.yml index f1054ba53..5d2723e7e 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -181,6 +181,7 @@ ru: current_project_header: Текущий проект current_build_lists: Текущие сборки build_button: Начать сборку + add_collaborators: Добавить коллабораторов groups: list: Список diff --git a/config/routes.rb b/config/routes.rb index 4caae68a0..1188f0e54 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -80,6 +80,9 @@ Rosa::Application.routes.draw do member do get :build post :process_build + + get :add_collaborators + post :add_collaborators end collection do get :auto_build