parent
2f8ef03d32
commit
bfcb68efab
|
@ -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
|
||||
|
|
|
@ -31,11 +31,13 @@
|
|||
|
||||
<tr>
|
||||
<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">
|
||||
<% options = {:author => true, :deletable => attach_delete(homework)} %>
|
||||
<%= render :partial => 'attachments/links',
|
||||
:locals => {:attachments => homework.attachments, :options => options} %>
|
||||
</p>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<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' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -210,20 +210,23 @@
|
|||
<div class="tabs_new">
|
||||
<ul>
|
||||
<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>
|
||||
<%= link_to l(:label_homework), {:controller => 'projects', :action => 'homework'}, :class => link_class('Task')%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_course_board), { :controller => 'boards', :action => 'index', :project_id => @project}, :class => link_class(:boards) %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to l(:label_course_file), project_files_path(@project), :class => link_class(:files)%>
|
||||
</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>
|
||||
<%= link_to l(:label_course_feedback), project_feedback_path(@project), :class => link_class('Feedback')%>
|
||||
</li>
|
||||
</li>
|
||||
<!-- <li><%= link_to(l(:label_course_repository), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => nil, :path => nil, :rev => nil, :course => 1 })%></li> -->
|
||||
<% if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, @project.id).first.roles&Role.where('id = ? or id = ?', 7, 9)).size >0))%>
|
||||
|
||||
|
|
|
@ -623,6 +623,7 @@ zh:
|
|||
label_homework_commit: 提交作业 #huang
|
||||
label_homework_info: 作业情况 #huang
|
||||
label_course_news: 课程通知
|
||||
label_course_board: 讨论区
|
||||
label_version: 版本
|
||||
label_version_new: 新建版本
|
||||
label_version_plural: 版本
|
||||
|
|
Loading…
Reference in New Issue