From 0f5c99627854528f582352a3606356cb4bccccc0 Mon Sep 17 00:00:00 2001 From: nwb Date: Wed, 4 Jun 2014 14:09:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 12 ++++++++++++ app/views/courses/new.html.erb | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 app/views/courses/new.html.erb diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 12f730e06..ddeb42538 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -67,6 +67,18 @@ class CoursesController < ApplicationController return courses 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) return courses if activity_count.size<2 (activity_count.size-2).downto(0) do |i| diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb new file mode 100644 index 000000000..81e6ec37a --- /dev/null +++ b/app/views/courses/new.html.erb @@ -0,0 +1,9 @@ +<%= labelled_form_for @course do |f| %> +

<%=l(:label_course_new)%>

+
+ <%= render :partial => 'course_form', :locals => { :f => f } %> + <%= submit_tag l(:button_create), :class => "enterprise"%> + + <%= javascript_tag "$('#course_name').focus();" %> +
+<% end %>