diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index af6fbd632..e6efca1e8 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -94,7 +94,7 @@ class ApplicationController < ActionController::Base Setting.check_cache # Find the current user User.current = find_current_user - logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger + #logger.info(" Current user: " + (User.current.logged? ? "#{User.current.login} (id=#{User.current.id})" : "anonymous")) if logger end # Returns the current user or nil if no user is logged in @@ -300,7 +300,7 @@ class ApplicationController < ActionController::Base render_404 end - #根据course_id找project + #锟斤拷锟絚ourse_id锟斤拷project def find_project_by_course_id @bid = Bid.find params[:course_id] @project = @bid.courses[0] @@ -354,7 +354,7 @@ class ApplicationController < ActionController::Base end #added by nwb - #获取课程 + #锟斤拷取锟轿筹拷 def find_course @course= Course.find(params[:id]) rescue ActiveRecord::RecordNotFound diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 5dbb4f2bb..c234eb17b 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -161,7 +161,13 @@ class AttachmentsController < ApplicationController end def autocomplete - @project = Project.find_by_id(params[:project_id]) + # modify by nwb + if params[:project_id] + @project = Project.find_by_id(params[:project_id]) + elsif params[:course_id] + @course = Course.find_by_id(params[:course_id]) + end + respond_to do |format| format.js end @@ -197,6 +203,35 @@ class AttachmentsController < ApplicationController end end + def add_exist_file_to_course + class_id = params[:class_id] + attachments = params[:attachment][:attach] + + obj = Course.find_by_id(class_id) + attachments.collect do |attach_id| + ori = Attachment.find_by_id(attach_id) + next if ori.blank? + attach_copied_obj = ori.copy + attach_copied_obj.tag_list.add(ori.tag_list) # tag鍏宠仈 + attach_copied_obj.container = obj + attach_copied_obj.created_on = Time.now + attach_copied_obj.author_id = User.current.id + @obj = obj + @save_flag = attach_copied_obj.save + @save_message = attach_copied_obj.errors.full_messages + end + + respond_to do |format| + format.js + end + rescue NoMethodError + @save_flag = false + @save_message = [] << l(:error_attachment_empty) + respond_to do |format| + format.js + end + end + private def find_project @attachment = Attachment.find(params[:id]) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index a90ca1d12..5f20d2cef 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -496,7 +496,12 @@ class BidsController < ApplicationController @homework = HomeworkAttach.new #@homework_list = @bid.homeworks #澧炲姞浣滀笟鎸夎瘎鍒嗘帓搴忥紝 - @homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC") + #@homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC") + @homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, + (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{@bid.courses.first.teacher.id}) AS t_score, + (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id <> #{@bid.courses.first.teacher.id}) AS s_score + FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY + (CASE WHEN t_score IS NULL THEN 0 ELSE t_score * 0.6 END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * 0.4 END) DESC,created_at ASC") if params[:student_id].present? @temp = [] @homework_list.each do |pro| @@ -805,7 +810,10 @@ class BidsController < ApplicationController @homework = @bid @course = Course.find_by_id(params[:course_id]) @course_id = @course.id - + #respond_to do |format| + # format.html { redirect_to new_homework_course_path(params[:course_id]),:layout => 'base_courses'} + # format.api { render_validation_errors(@bid) } + #end render file: 'courses/new_homework', layout: 'base_courses' end end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index e0daa44f4..7cd46b65a 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -489,19 +489,9 @@ class CoursesController < ApplicationController # 鏂板缓浣滀笟 def new_homework - if (User.current.logged? && - (User.current.admin? || - ( - !Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.nil? && - ( - Member.where('user_id = ? and course_id = ?', User.current.id, @course.id).first.roles && - ( Role.where(id: [3, 4, 7, 9]).size > 0 ) - ) - ) - ) - ) - @homework = Bid.new - @homework.safe_attributes = params[:bid] + @homework = Bid.new + @homework.safe_attributes = params[:bid] + if (User.current.logged? && User.current.member_of_course?(Course.find params[:id] )) render :layout => 'base_courses' else render_404 diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 76be02409..5ddebe707 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -122,7 +122,7 @@ class MembersController < ApplicationController user_ids = attrs.delete(:user_ids) user_ids.each do |user_id| members << Member.new(:role_ids => params[:membership][:role_ids], :user_id => user_id) - user_grades << UserGrade.new(:user_id => user_id, :course_id => @course.id) + #user_grades << UserGrade.new(:user_id => user_id, :course_id => @course.id) if (params[:membership][:role_ids] && params[:membership][:role_ids][0] == "3") course_info << CourseInfo.new(:user_id => user_id, :course_id => @course.id) end diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 4c0d91884..0216d529d 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -256,14 +256,14 @@ class TagsController < ApplicationController # 鑾峰彇鏈夋煇绫诲璞$殑tag鎬绘暟 def get_tags_size - @issues_tags_num = Issue.tag_counts.size - @projects_tags_num = Project.tag_counts.size - @users_tags_num = User.tag_counts.size - @bids_tags_num = Bid.tag_counts.size - forum_tags_num = Forum.tag_counts.size - attachment_tags_num = Attachment.tag_counts.size - @open_source_projects_num = OpenSourceProject.tag_counts.size - @contests_tags_num = Contest.tag_counts.size + @issues_tags_num = ActsAsTaggableOn::Tagging.where(taggable_type:"Issue").count + @projects_tags_num = ActsAsTaggableOn::Tagging.where(taggable_type:"Project").count + @users_tags_num = ActsAsTaggableOn::Tagging.where(taggable_type:"User").count + @bids_tags_num = ActsAsTaggableOn::Tagging.where(taggable_type:"Bid").count + forum_tags_num = ActsAsTaggableOn::Tagging.where(taggable_type:"Forum").count + attachment_tags_num = ActsAsTaggableOn::Tagging.where(taggable_type:"Attachment").count + @open_source_projects_num = ActsAsTaggableOn::Tagging.where(taggable_type:"OpenSourceProject").count + @contests_tags_num = ActsAsTaggableOn::Tagging.where(taggable_type:"Contest").count return @users_tags_num,@projects_tags_num,@issues_tags_num,@bids_tags_num, forum_tags_num, attachment_tags_num, @contests_tags_num, @open_source_projects_num end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index f78112c21..144e86f4f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -52,6 +52,7 @@ class UsersController < ApplicationController helper :custom_fields include CustomFieldsHelper include AvatarHelper + include WordsHelper # added by liuping 鍏虫敞 @@ -235,7 +236,10 @@ class UsersController < ApplicationController def user_newfeedback @jours = @user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') @jours.update_all(:is_readed => true, :status => false) - + @jours.each do |journal| + fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false) + end + @limit = 10 @feedback_count = @jours.count @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb index 52a7f585a..a4f53c100 100644 --- a/app/controllers/words_controller.rb +++ b/app/controllers/words_controller.rb @@ -56,7 +56,8 @@ class WordsController < ApplicationController reply_user_id = params[:reference_user_id] reply_id = params[:reference_message_id] # 鏆傛椂涓嶅疄鐜 content = params[:user_notes] - options = {:user_id => author_id, + options = {:user_id => author_id, + :status => true, :m_parent_id => parent_id, :m_reply_id => reply_id, :reply_id => reply_user_id, diff --git a/app/helpers/attachments_helper.rb b/app/helpers/attachments_helper.rb index aa6a5f7f5..3e61b2a44 100644 --- a/app/helpers/attachments_helper.rb +++ b/app/helpers/attachments_helper.rb @@ -115,7 +115,7 @@ module AttachmentsHelper s = content_tag('div', attachments_check_box_tags('attachment[attach][]', searched_attach), :id => 'attachments') links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false) {|text, parameters, options| - link_to text, attachments_autocomplete_path( parameters.merge(:q => params[:q], :format => 'js')), :remote => true } + link_to text, attachments_autocomplete_path( parameters.merge(:project_id=>project.id,:q => params[:q], :format => 'js')), :remote => true } return s + content_tag('div', content_tag('ul', links), :class => 'pagination') @@ -133,6 +133,35 @@ module AttachmentsHelper # return searched_attach.to_json end + # add by nwb + def render_attachments_for_new_course(course, limit=nil) + # 鏌ヨ鏉′欢 + params[:q] ||= "" + filename_condition = params[:q].strip + + attachAll = Attachment.scoped + + # 闄ゅ幓褰撳墠璇剧▼鐨勬墍鏈夎祫婧 + nobelong_attach = Attachment.where("!(container_type = '#{course.class}' and container_id = #{course.id})") unless course.blank? + + # 鎼滅储鍩熺‘瀹 + domain = course.nil? ? attachAll : nobelong_attach + + # 鎼滅储鍒扮殑璧勬簮 + searched_attach = domain.where("filename LIKE :like ", like:"%#{filename_condition}%").limit(limit).order('created_on desc') + searched_attach = private_filter searched_attach + searched_attach = paginateHelper(searched_attach, 10) + + #testattach = Attachment.public_attachments + + s = content_tag('div', attachments_check_box_tags('attachment[attach][]', searched_attach), :id => 'attachments') + links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false) {|text, parameters, options| + link_to text, attachments_autocomplete_path( parameters.merge(:course_id=>course.id,:q => params[:q], :format => 'js')), :remote => true } + + return s + content_tag('div', content_tag('ul', links), :class => 'pagination') + + end + def attachments_check_box_tags(name, attachs) s = '' attachs.each do |attach| @@ -144,18 +173,22 @@ module AttachmentsHelper def private_filter resultSet result = resultSet.to_a.dup + # modify by nwb + #娣诲姞瀵硅绋嬭祫婧愭枃浠剁殑鍒ゆ柇 resultSet.map { |res| if(res.container.nil? || (res.container.class.to_s=="Project" && res.container.is_public == false) || - (res.container.has_attribute?(:project) && res.container.project.is_public == false) || + (res.container.has_attribute?(:project) && res.container.project && res.container.project.is_public == false) || (res.container.class.to_s=="HomeworkAttach" && res.container.bid.reward_type == 3) || - false + (res.container.class.to_s=="Course" && res.container.is_public == false) || + (res.container.has_attribute?(:course) && res.container.course && res.container.course.is_public == false) ) result.delete(res) end } result end + include Redmine::Pagination def paginateHelper obj, pre_size=10 @obj_count = obj.count diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 35fd6ee08..048933e40 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -235,6 +235,7 @@ module WelcomeHelper def show_grade project grade = 0 begin + #ActiveRecord::Base.connection.execute("CALL sp_project_status_cursor();")#鎵ц瀛樺偍杩囩▼閫熷害鎱 grade = project.project_status.grade if project && project.project_status rescue Exception => e logger.error "Logger.Error [WelcomeHelper] ===> #{e}" diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 94f8f7c95..116e2de9a 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -68,6 +68,106 @@ class Attachment < ActiveRecord::Base before_save :be_user_score # user_score after_destroy :delete_from_disk + # add by nwb + # 鑾峰彇鎵鏈夊彲鍏紑鐨勮祫婧愭枃浠跺垪琛 + scope :public_attachments, lambda { + #joins(Project.table_name).where("container_type = 'Project' and ") + joins("LEFT JOIN #{Project.table_name} ON #{Attachment.table_name}.container_type='Project' AND #{Project.table_name}.id = #{Attachment.table_name}.container_id and #{Project.table_name}.is_public=1 " + + " LEFT JOIN #{Document.table_name} ON #{Attachment.table_name}.container_type='Project' AND #{Document.table_name}.project_id in "+self.public_project_id + + " LEFT JOIN #{Issue.table_name} ON #{Attachment.table_name}.container_type='Project' AND #{Issue.table_name}.project_id in "+self.public_project_id + + " LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Project' AND #{Version.table_name}.project_id in "+self.public_project_id + + " LEFT JOIN #{WikiPage.table_name} ON #{Attachment.table_name}.container_type='WikiPage' AND #{WikiPage.table_name}.parent_id in "+self.public_wiki_id + + " LEFT JOIN #{Message.table_name} ON #{Attachment.table_name}.container_type='Message' AND #{Message.table_name}.parent_id in "+self.public_board_id + + " LEFT JOIN #{Course.table_name} ON #{Attachment.table_name}.container_type='Course' AND #{Course.table_name}.is_public=1 " + + " LEFT JOIN #{News.table_name} ON #{Attachment.table_name}.container_type='News' AND (#{News.table_name}.project_id in "+self.public_project_id + " OR #{News.table_name}.course_id in " + self.public_course_id + ")" + + " LEFT JOIN #{HomeworkAttach.table_name} ON #{Attachment.table_name}.container_type='HomeworkAttach' AND #{HomeworkAttach.table_name}.bid_id in "+self.public_bid_id) + } + + # add by nwb + # 鍏紑鐨勯」鐩甶d鍒楄〃 + def self.public_project_id + idlist = "(" + projects=Project.all_public + count = projects.count + for i in 0...count + project = projects[i] + idlist+="'" + project.id.to_s + "'" + if i != count-1 + idlist+="," + end + end + idlist += ")" + idlist + end + + # add by nwb + # 鍏紑鐨勮绋媔d鍒楄〃 + def self.public_course_id + idlist = "(" + courses=Course.all_public + count = courses.count + for i in 0...count + course = courses[i] + idlist+="'" + course.id.to_s + "'" + if i != count-1 + idlist = idlist + "," + end + end + idlist += ")" + idlist + end + + # add by nwb + # 鍏紑鐨剋iki id鍒楄〃 + def self.public_wiki_id + idlist = "(" + wikis=Wiki.where("project_id in " + public_project_id) + count = wikis.count + for i in 0...count + wiki = wikis[i] + idlist+="'" + wiki.id.to_s + "'" + if i != count-1 + idlist = idlist + "," + end + end + idlist += ")" + idlist + end + + # add by nwb + # 鍏紑鐨刡oard id鍒楄〃 + def self.public_board_id + idlist = "(" + boards=Board.where("project_id in " + public_project_id + " or course_id in " + public_course_id) + count = boards.count + for i in 0...count + board = boards[i] + idlist+="'" + board.id.to_s + "'" + if i != count-1 + idlist = idlist + "," + end + end + idlist += ")" + idlist + end + + # add by nwb + # 鍏紑鐨刡id id鍒楄〃 + def self.public_bid_id + idlist = "(" + bids=Bid.where("reward_type=3") + count = bids.count + for i in 0...count + bid = bids[i] + idlist+="'" + bid.id.to_s + "'" + if i != count-1 + idlist = idlist + "," + end + end + idlist += ")" + idlist + end + # Returns an unsaved copy of the attachment def copy(attributes=nil) copy = self.class.new @@ -179,6 +279,7 @@ class Attachment < ActiveRecord::Base File.join(self.class.storage_path, disk_directory.to_s, disk_filename.to_s) end + #鏍囬 def title title = filename.to_s if description.present? diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 58880919e..9551ff28b 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -15,8 +15,8 @@ class JournalsForMessage < ActiveRecord::Base "m_reply_id" # 鍥炲鏌愮暀瑷鐨勭暀瑷id(a鐣欒█鍥炲浜哹鐣欒█锛岃繖鏄痓鐣欒█鐨刬d) acts_as_tree :foreign_key => 'm_parent_id', :counter_cache => :m_reply_count, :order => "#{JournalsForMessage.table_name}.created_on ASC" - belongs_to :project, - :foreign_key => 'jour_id', + belongs_to :project, + :foreign_key => 'jour_id', :conditions => "#{self.table_name}.jour_type = 'Project' " belongs_to :course, :foreign_key => 'jour_id', @@ -117,6 +117,15 @@ class JournalsForMessage < ActiveRecord::Base update_all("m_reply_count = #{count.to_i}", ["id = ?", journals_for_messages.m_parent_id]) end + #濡傛灉鏄湪椤圭洰涓暀瑷鍒欒繑鍥炶椤圭洰鍚﹀垯杩斿洖nil - zjc + def project + if self.jour_type == 'Project' + Project.find(self.jour_id) + else + nil + end + end + # 鏇存柊鐢ㄦ埛鍒嗘暟 -by zjc def be_user_score #鏂板缓浜嗙暀瑷鍥炲 diff --git a/app/models/user.rb b/app/models/user.rb index 30d86f5df..6138f9b56 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -202,7 +202,8 @@ class User < Principal where(nil) else pattern = "%#{arg.to_s.strip.downcase}%" - where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) + #where(" LOWER(concat(lastname, firstname)) LIKE :p ", :p => pattern) + where(" LOWER(login) LIKE :p ", :p => pattern) end } @@ -576,15 +577,16 @@ class User < Principal # Find a user account by matching the exact login and then a case-insensitive # version. Exact matches will be given priority. #閫氳繃鐢ㄦ埛鍚嶆煡鎵剧浉搴旂殑鐢ㄦ埛锛岃嫢娌℃湁鍖归厤鍒帮紝鍒欎笉鍖哄垎澶у皬鍐欒繘琛屾煡璇 + #淇敼锛氫笉鍐嶅尮閰嶄笉鍖哄垎澶у皬鍐欐儏鍐 -zjc def self.find_by_login(login) if login.present? login = login.to_s # First look for an exact match user = where(:login => login).all.detect {|u| u.login == login} - unless user - # Fail over to case-insensitive if none was found - user = where("LOWER(login) = ?", login.downcase).first - end + #unless user + # # Fail over to case-insensitive if none was found + # user = where("LOWER(login) = ?", login.downcase).first + #end user end end diff --git a/app/models/user_grade.rb b/app/models/user_grade.rb index ea951eadd..074aa516a 100644 --- a/app/models/user_grade.rb +++ b/app/models/user_grade.rb @@ -2,4 +2,37 @@ class UserGrade < ActiveRecord::Base # attr_accessible :title, :body attr_accessible :user_id, :project_id, :grade belongs_to :project + before_save :correct_score + validates_uniqueness_of :user_id, :scope => [:project_id] + #validate :my_validation + + #淇鍒嗘暟 + #鍒嗘暟灏忎簬0鏃朵慨姝d负0 + #鍒嗘暟澶т簬绛変簬0鏃朵笉淇 -by zjc + def correct_score + if !self.grade.nil? && self.grade < 0 + self.grade = 0 + end + end + + #def self.exit_user_and_project(user,project) + # unless user.nil? || project.nil? + # if user.class.to_s == 'User' && project.class.to_s == 'Project' + # user_grade = UserGrade.find_by_user_id_and_project_id(user.id,project.id) + # user_grade + # else + # nil + # end + # else + # nil + # end + #end + + #def my_validation + # if user_id.nil? || project_id.nil? + # errors[:Base] << "鐢ㄦ埛鍜岄」鐩笉鑳戒负绌" + # elsif UserGrade.exit_user_and_project(user_id,project_id) + # errors[:Base] << "褰撳墠璁板綍宸插瓨鍦" + # end + #end end diff --git a/app/views/attachments/add_exist_file_to_course.js.erb b/app/views/attachments/add_exist_file_to_course.js.erb new file mode 100644 index 000000000..58e5690ef --- /dev/null +++ b/app/views/attachments/add_exist_file_to_course.js.erb @@ -0,0 +1,17 @@ +<% if @save_flag %> + window.location.reload(); +<% else %> + // alert('娣诲姞鏂囦欢澶辫触:\n<%=@save_message[0]%>'); + $('#ajax-modal').html('
<%= l(:label_term) %> * | @@ -236,7 +237,8 @@ ".html_safe %>
diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index b30785e1b..6e49fcdea 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -25,11 +25,12 @@
<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %>
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
- -<%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%> +<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %> +
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}") %><%= calendar_for('bid_deadline')%>
<%= f.select :is_evaluation, is_evaluation_option %>
diff --git a/app/views/courses/finishcourse.js.erb b/app/views/courses/finishcourse.js.erb index e67426953..75c2b774d 100644 --- a/app/views/courses/finishcourse.js.erb +++ b/app/views/courses/finishcourse.js.erb @@ -4,7 +4,7 @@ console.debug('璇剧▼淇敼鎴愬姛锛氱粨鏉熸椂闂存敼涓<%=Course.find_by_extra(@c <% end %> $('#content-title-top-div').html("<%= j(render partial: 'users/my_course_ex', :locals => {:memberships => @memberships,:user=>@user, :memberships_doing=>@memberships_doing,:memberships_done=>@memberships_done} )%>") -//$('#finish_course_ <%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>") +$('#finish_course_<%=@course.id%>').replaceWith("<%= j(render partial: 'courses/set_course_time', :locals => {:course => @course} )%>") <% else %> alert('鏉冮檺涓嶈冻锛岃缃け璐ワ紝璇峰湪璁哄潧鎻愪氦闂锛岀瓑寰呯鐞嗗憳澶勭悊銆'); <% end %> diff --git a/app/views/courses/new_homework.html.erb b/app/views/courses/new_homework.html.erb index ec25cef0f..b3fff9e5f 100644 --- a/app/views/courses/new_homework.html.erb +++ b/app/views/courses/new_homework.html.erb @@ -1,6 +1,6 @@+ <% if attachmenttypes.any? %> + <%= l(:attachment_type) %> + <%= select_tag "attachment_type", + options_from_collection_for_select(attachmenttypes, "id", + "typeName", 2), {style: 'width:100px'} %> + <% end %> +
<% end %> - <% if attachmenttypes.any? %> -
+
<%= f.text_field :subject,:size => 60, :style => "width: 99%;", :id => "message_subject" %>
diff --git a/app/views/praise_tread/_praise_tread.html.erb b/app/views/praise_tread/_praise_tread.html.erb index 2b859cf76..e0ad6fd9b 100644 --- a/app/views/praise_tread/_praise_tread.html.erb +++ b/app/views/praise_tread/_praise_tread.html.erb @@ -101,7 +101,7 @@