新建课程逻辑修改

This commit is contained in:
nwb 2014-06-04 14:09:37 +08:00
parent d4bc8139a3
commit 0f5c996278
2 changed files with 21 additions and 0 deletions

View File

@ -67,6 +67,18 @@ class CoursesController < ApplicationController
return courses return courses
end end
def new
@course_type = params[:course_type] ||= params[:course]
@issue_custom_fields = IssueCustomField.sorted.all
@trackers = Tracker.sorted.all
@course = Course.new
@course.safe_attributes = params[:course]
render :layout => 'base'
end
def desc_sort_course_by_avtivity(activity_count,courses) def desc_sort_course_by_avtivity(activity_count,courses)
return courses if activity_count.size<2 return courses if activity_count.size<2
(activity_count.size-2).downto(0) do |i| (activity_count.size-2).downto(0) do |i|

View File

@ -0,0 +1,9 @@
<%= labelled_form_for @course do |f| %>
<h3><%=l(:label_course_new)%></h3>
<div class="box tabular">
<%= render :partial => 'course_form', :locals => { :f => f } %>
<span style="padding-left: 60px"><%= submit_tag l(:button_create), :class => "enterprise"%></span>
<!-- <%= submit_tag l(:button_create_and_continue), :name => 'course_continue' %> -->
<%= javascript_tag "$('#course_name').focus();" %>
</div>
<% end %>