diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 2d1d0bba7..dc4ccbc67 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -30,13 +30,15 @@ class BoardsController < ApplicationController def index @boards = @project.boards.includes(:last_message => :author).all # show the board if there is only one + unless @project.project_type == 1 if @boards.size == 1 @board = @boards.first show end + end if @project.project_type == 1 - render :layout => 'base_courses' - else + render :layout => 'base_courses' + else render :layout => false if request.xhr? end end @@ -85,12 +87,10 @@ class BoardsController < ApplicationController end end - def create + def create @board = @project.boards.build @board.safe_attributes = params[:board] - if @project.project_type == 1 - render :layout => 'base_courses' - end + if @board.save flash[:notice] = l(:notice_successful_create) #Modified by young diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 0a40e3d0e..ba6faa650 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -31,11 +31,13 @@ + <% unless User.current.logged? && (!Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) %>

<% options = {:author => true, :deletable => attach_delete(homework)} %> <%= render :partial => 'attachments/links', :locals => {:attachments => homework.attachments, :options => options} %>

+ <% end %> diff --git a/app/views/boards/index.html.erb b/app/views/boards/index.html.erb index c7e4f5b54..614066613 100644 --- a/app/views/boards/index.html.erb +++ b/app/views/boards/index.html.erb @@ -1,5 +1,5 @@
- <% if User.current.logged? %> + <% if User.current.logged? && User.current.member_of?(@project) %> <%= link_to l(:label_board_new), new_project_board_path(@project), :class => 'icon icon-add' %> <% end %>
diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 145457a61..7bcb78ad5 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -210,20 +210,23 @@