修正课程讨论区、课程通知等创建时BUG修正
This commit is contained in:
parent
99c9f81aea
commit
917288c84c
|
@ -68,6 +68,9 @@ class MessagesController < ApplicationController
|
|||
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
||||
render_attachment_warning_if_needed(@message)
|
||||
redirect_to board_message_path(@board, @message)
|
||||
else
|
||||
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||
render :action => 'new', :layout => layout_file
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -116,7 +116,7 @@ class NewsController < ApplicationController
|
|||
flash[:notice] = l(:notice_successful_create)
|
||||
redirect_to project_news_index_path(@project)
|
||||
else
|
||||
layout_file = (@project.project_type == 1) ? 'base_courses' : 'base_projects'
|
||||
layout_file = @project ? 'base_projects' : 'base_courses'
|
||||
render :action => 'new', :layout => layout_file
|
||||
end
|
||||
elsif @course
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<% if @project %>
|
||||
<h3><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> » <%= l(:label_message_new) %></h3>
|
||||
<% elsif @course %>
|
||||
<h3><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :course_id => @course, :id => @board %> » <%= l(:label_message_new) %></h3>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%= error_messages_for @news %>
|
||||
<div class="add_frame_header" >
|
||||
<% str = (@project.project_type == 1) ? l(:bale_news_notice) : l(:label_news_new) %>
|
||||
<% str = @project ? l(:bale_news_notice) : l(:label_news_new) %>
|
||||
<%= str %>
|
||||
</div>
|
||||
<div class="box tabular">
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
<!-- <h3><%=l(:label_news_new)%></h3> -->
|
||||
|
||||
<% if @project %>
|
||||
<%= labelled_form_for @news, :url => project_news_index_path(@project),
|
||||
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
||||
<%= render :partial => 'news/form', :locals => {:f => f} %>
|
||||
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
|
||||
<%= preview_link preview_news_path(:project_id => @project), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
||||
<% end %>
|
||||
<% elsif @course %>
|
||||
<%= labelled_form_for @news, :url => course_news_index_path(@course),
|
||||
:html => {:id => 'news-form', :multipart => true} do |f| %>
|
||||
<%= render :partial => 'news/form', :locals => {:f => f} %>
|
||||
<%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
|
||||
<%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
|
Loading…
Reference in New Issue