From f21767cb16464368064508c74e61a0cb7bcb8c38 Mon Sep 17 00:00:00 2001 From: moon Date: Mon, 17 Nov 2014 16:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=B6=E4=BB=96=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 9 +++------ app/views/users/_my_joinedcourse.html.erb | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 3981c5b6b..5381e8757 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -271,8 +271,7 @@ class CoursesController < ApplicationController @issue_custom_fields = IssueCustomField.sorted.all @trackers = Tracker.sorted.all - if User.current.user_extensions.identity == 0 - if @course.save + if @course.save #unless User.current.admin? r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first m = Member.new(:user => User.current, :roles => [r]) @@ -298,15 +297,13 @@ class CoursesController < ApplicationController } format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'courses', :action => 'show', :id => @course.id) } end - else + else #@course.destroy respond_to do |format| format.html { render :action => 'new', :layout => 'base' } #Added by young format.api { render_validation_errors(@course) } end - end - end - + end end def course diff --git a/app/views/users/_my_joinedcourse.html.erb b/app/views/users/_my_joinedcourse.html.erb index 315204e7a..74be37b55 100644 --- a/app/views/users/_my_joinedcourse.html.erb +++ b/app/views/users/_my_joinedcourse.html.erb @@ -8,12 +8,13 @@

<%= l(:label_project_cousre_studentun) %><%= link_to"#{l(:label_course_join_student)}",{:controller=>'courses',:action=>'index'}, :class => 'icon icon-add' %> + <%= link_to "#{l(:label_course_new)}", {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>

<% end %> <% else %>