parent
2f8ef03d32
commit
bfcb68efab
|
@ -30,10 +30,12 @@ class BoardsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@boards = @project.boards.includes(:last_message => :author).all
|
@boards = @project.boards.includes(:last_message => :author).all
|
||||||
# show the board if there is only one
|
# show the board if there is only one
|
||||||
|
unless @project.project_type == 1
|
||||||
if @boards.size == 1
|
if @boards.size == 1
|
||||||
@board = @boards.first
|
@board = @boards.first
|
||||||
show
|
show
|
||||||
end
|
end
|
||||||
|
end
|
||||||
if @project.project_type == 1
|
if @project.project_type == 1
|
||||||
render :layout => 'base_courses'
|
render :layout => 'base_courses'
|
||||||
else
|
else
|
||||||
|
@ -88,9 +90,7 @@ class BoardsController < ApplicationController
|
||||||
def create
|
def create
|
||||||
@board = @project.boards.build
|
@board = @project.boards.build
|
||||||
@board.safe_attributes = params[:board]
|
@board.safe_attributes = params[:board]
|
||||||
if @project.project_type == 1
|
|
||||||
render :layout => 'base_courses'
|
|
||||||
end
|
|
||||||
if @board.save
|
if @board.save
|
||||||
flash[:notice] = l(:notice_successful_create)
|
flash[:notice] = l(:notice_successful_create)
|
||||||
#Modified by young
|
#Modified by young
|
||||||
|
|
|
@ -31,11 +31,13 @@
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" width="580px" >
|
<td colspan="2" width="580px" >
|
||||||
|
<% 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) %>
|
||||||
<p class="font_description">
|
<p class="font_description">
|
||||||
<% options = {:author => true, :deletable => attach_delete(homework)} %>
|
<% options = {:author => true, :deletable => attach_delete(homework)} %>
|
||||||
<%= render :partial => 'attachments/links',
|
<%= render :partial => 'attachments/links',
|
||||||
:locals => {:attachments => homework.attachments, :options => options} %>
|
:locals => {:attachments => homework.attachments, :options => options} %>
|
||||||
</p>
|
</p>
|
||||||
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="contextual">
|
<div class="contextual">
|
||||||
<% 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' %>
|
<%= link_to l(:label_board_new), new_project_board_path(@project), :class => 'icon icon-add' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -210,16 +210,19 @@
|
||||||
<div class="tabs_new">
|
<div class="tabs_new">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview)%>
|
<%= link_to l(:label_course_overview), project_path(@project), :class => link_class(:overview) %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Task')%>
|
<%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Task')%>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to l(:label_course_board), { :controller => 'boards', :action => 'index', :project_id => @project}, :class => link_class(:boards) %>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
|
<%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news)%>
|
<%= link_to l(:label_course_news), {:controller => 'news', :action => 'index', :project_id => @project}, :class => link_class(:news) %>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class('Feedback')%>
|
<%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class('Feedback')%>
|
||||||
|
|
|
@ -623,6 +623,7 @@ zh:
|
||||||
label_homework_commit: 提交作业 #huang
|
label_homework_commit: 提交作业 #huang
|
||||||
label_homework_info: 作业情况 #huang
|
label_homework_info: 作业情况 #huang
|
||||||
label_course_news: 课程通知
|
label_course_news: 课程通知
|
||||||
|
label_course_board: 讨论区
|
||||||
label_version: 版本
|
label_version: 版本
|
||||||
label_version_new: 新建版本
|
label_version_new: 新建版本
|
||||||
label_version_plural: 版本
|
label_version_plural: 版本
|
||||||
|
|
Loading…
Reference in New Issue