diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index c54a419cb..6507b3178 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -21,29 +21,32 @@ class CoursesController < ApplicationController before_filter :toggleCourse, only: [:finishcourse, :restartcourse] before_filter :require_login, :only => [:join, :unjoin] - before_filter :allow_join, :only => [:join] + #before_filter :allow_join, :only => [:join] def join if User.current.logged? - course = Course.find(params[:object_id]) - unless User.current.member_of_course? course - if params[:course_password] == course.password - members = [] - members << Member.new(:role_ids => [10], :user_id => User.current.id) - course.members << members - StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id]) - @state = 0 - else - @state = 1 - end + course = Course.find_by_id params[:object_id] + if course + @state = 4 else - @state = 3 + unless (allow_join && User.current.member_of_course?(course)) + if params[:course_password] == course.password + members = [] + members << Member.new(:role_ids => [10], :user_id => User.current.id) + course.members << members + StudentsForCourse.create(:student_id => User.current.id, :course_id => params[:object_id]) + @state = 0 + else + @state = 1 + end + else + @state = 3 + end end else - @state = 4 + @state = 5 end respond_to do |format| - # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}} format.js { render :partial => 'set_join', :locals => {:user => User.current, :course => Course.find(params[:object_id]), :object_id => params[:object_id]} } end rescue Exception => e diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 89ad42c17..313afa1c7 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -113,7 +113,7 @@ class FilesController < ApplicationController end if order_by.count == 1 - sort += "#{Attachment.table_name}.#{attribute} desc " + sort += "#{Attachment.table_name}.#{attribute} asc " elsif order_by.count == 2 sort += "#{Attachment.table_name}.#{attribute} #{order_by[1]} " end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index c9550add3..0c1f65317 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -113,7 +113,7 @@ class RepositoriesController < ApplicationController @root_path=RepositoriesHelper::ROOT_PATH @repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git" @project_path=@root_path+"htdocs/"+@repository_name - @repository_tag=params[:repository][:upassword] + @repository_tag=params[:repository][:upassword] || params[:repository][:password] @repo_name=User.current.login.to_s+"_"+params[:repository][:identifier] logger.info "htpasswd -mb "+@root_path+"user.passwd "+@repo_name+": "+@repository_tag logger.info "the value of create repository"+@root_path+": "+@repository_name+": "+@project_path+": "+@repo_name diff --git a/app/views/common/403.html b/app/views/common/403.html index 39df9d70e..826d43067 100644 --- a/app/views/common/403.html +++ b/app/views/common/403.html @@ -31,8 +31,8 @@ a:hover{ } 没有访问权限!建议您
diff --git a/app/views/common/404.html b/app/views/common/404.html index f4ec0e8f0..ce92d7e4c 100644 --- a/app/views/common/404.html +++ b/app/views/common/404.html @@ -31,8 +31,8 @@ a:hover{ } 页面不见了!建议您 diff --git a/app/views/courses/_join_private_course.html.erb b/app/views/courses/_join_private_course.html.erb index 60223922f..2d36e2ece 100644 --- a/app/views/courses/_join_private_course.html.erb +++ b/app/views/courses/_join_private_course.html.erb @@ -1,60 +1,75 @@ - - + + + + +只要持有课程ID和密码,就课快速加入所在课程。课程页面搜索不到的私有课程只能从此通道进入哦!
diff --git a/app/views/files/_course_show_all_attachment.html.erb b/app/views/files/_course_show_all_attachment.html.erb index 15ef36580..3ce583cb8 100644 --- a/app/views/files/_course_show_all_attachment.html.erb +++ b/app/views/files/_course_show_all_attachment.html.erb @@ -17,7 +17,7 @@ <%#= sort_header_tag('created_on', :caption => l(:label_date), :default_order => 'desc', :scope => "col", :id => "vzebra-comedy") %> <%= sort_header_tag('size', :caption => l(:field_filesize), :default_order => 'desc', :scope => "col", :id => "vzebra-children",:class => "tableth") %> <%= sort_header_tag('attach_type', :caption => l(:attachment_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-attachmenttype",:class => "tableth") %> - <%= sort_header_tag('content_type', :caption => l(:attachment_sufix_browse), :default_order => 'desc', :scope => "col", :id => "vzebra-contenttype",:class => "tableth") %> + <%= content_tag('th', l(:attachment_sufix_browse), id: 'vzebra-contenttype', class: 'tableth', style: 'color: black')%> <%= sort_header_tag('field_file_dense', :caption => l(:field_file_dense), :default_order => 'desc', :scope => "col", :id => "vzebra-field_file_dense",:class => "tableth") %> <%= sort_header_tag('downloads', :caption => l(:field_downloads), :default_order => 'desc', :scope => "col", :id => "vzebra-action",:class => "tableth") %> <%= sort_header_tag('operation', :caption => "", :scope => "col", :id => "vzebra-children",:class => "tableth") %> diff --git a/app/views/forums/_form.html.erb b/app/views/forums/_form.html.erb index 4679420f4..0db5a0f70 100644 --- a/app/views/forums/_form.html.erb +++ b/app/views/forums/_form.html.erb @@ -19,8 +19,11 @@
+ <%= f.text_area :description, :required => true, :id => 'editor01' %> +
+ +(<%= l(:label_forums_max_length) %>)
<%= l(:field_identifier) %> | -<%= l(:field_repository_is_default) %> | -<%= l(:label_scm) %> | -<%= l(:label_repository_path) %> | +<%= l(:field_identifier) %> | +<%= l(:field_repository_is_default) %> | +<%= l(:label_scm) %> | +<%= l(:label_repository_path) %> |
---|