diff --git a/app/api/mobile/entities/user.rb b/app/api/mobile/entities/user.rb index 9112e7ec5..6b0064036 100644 --- a/app/api/mobile/entities/user.rb +++ b/app/api/mobile/entities/user.rb @@ -34,6 +34,8 @@ module Mobile user_expose :img_url #昵称 expose :nickname + #真名 + expose :realname #性别 user_expose :gender #我的二维码 diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 8710b624e..c0e99d546 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -418,12 +418,27 @@ class CoursesController < ApplicationController end + def search_member + if User.current.allowed_to?(:as_teacher,@course) || User.current.admin + q = "#{params[:name].strip}" + @roles = Role.givable.all[3..5] + if q.nil? || q == "" + @members = @course.member_principals.includes(:roles, :principal).all.sort + else + @members = searchmember_by_name(@course.member_principals.includes(:roles, :principal).all.sort,q) + end + + else + render_403 + end + end + def create cs = CoursesService.new @course = cs.create_course(params,User.current)[:course] if @course.new_record? respond_to do |format| - format.html { render :action => 'new', :layout => 'base' } #Added by young + format.html { render :action => 'new', :layout => 'new_base' } #Added by young format.api { render_validation_errors(@course) } end else @@ -493,7 +508,7 @@ class CoursesController < ApplicationController respond_to do |format| format.html { - render :layout => 'base' + render :layout => 'new_base' } format.api { } diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 1ca3e2fcf..8b1c8ba32 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -23,7 +23,7 @@ class FilesController < ApplicationController before_filter :auth_login1, :only => [:index] before_filter :logged_user_by_apptoken,:only => [:index] before_filter :find_project_by_project_id#, :except => [:getattachtype] - before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:search_project,:quote_resource_show_project] + before_filter :authorize, :except => [:getattachtype,:quote_resource_show,:search,:search_project,:quote_resource_show_project,:search_tag_attachment] helper :sort include SortHelper @@ -51,6 +51,7 @@ class FilesController < ApplicationController @sort = "" @order = "" @is_remote = true + @q = params[:name].strip if params[:sort] order_by = params[:sort].split(":") @sort = order_by[0] @@ -60,19 +61,27 @@ class FilesController < ApplicationController sort = "#{@sort} #{@order}" end + # show_attachments [@course] + begin q = "%#{params[:name].strip}%" #(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank? if params[:insite] - @result = find_public_attache q,sort - @result = visable_attachemnts_insite @result,@course - @searched_attach = paginateHelper @result,10 + if q == "%%" + @result = [] + @searched_attach = paginateHelper @result,10 + else + @result = find_public_attache q,sort + @result = visable_attachemnts_insite @result,@course + @searched_attach = paginateHelper @result,10 + end else @result = find_course_attache q,@course,sort @result = visable_attachemnts @result @searched_attach = paginateHelper @result,10 - end + @tag_list = get_course_tag_list @course + end #rescue Exception => e # #render 'stores' # redirect_to search_course_files_url @@ -273,6 +282,8 @@ class FilesController < ApplicationController show_attachments @containers + @tag_list = attachment_tag_list @all_attachments + render :layout => 'base_courses' end @@ -346,6 +357,27 @@ class FilesController < ApplicationController Mailer.run.attachments_added(attachments[:files]) end + if params[:course_attachment_type] && params[:course_attachment_type] != "5" + case params[:course_attachment_type] + when "1" + tag_name = l(:label_courseware) + when "2" + tag_name = l(:label_software) + when "3" + tag_name = l(:label_media) + when "4" + tag_name = l(:label_code) + else + tag_name = "" + end + if !attachments.empty? && attachments[:files] && tag_name != "" + attachments[:files].each do |attachment| + attachment.tag_list.add(tag_name) + attachment.save + end + end + end + # TODO: 临时用 nyan sort_init 'created_on', 'desc' sort_update 'created_on' => "#{Attachment.table_name}.created_on", @@ -356,6 +388,7 @@ class FilesController < ApplicationController @containers = [Course.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@course.id)] show_attachments @containers + @tag_list = attachment_tag_list @all_attachments @attachtype = 0 @contenttype = 0 @@ -489,8 +522,31 @@ class FilesController < ApplicationController format.html end end + end + #查找指定TAG的按条件过滤的资源列表,只有课程内搜索有此功能 + def search_tag_attachment + @q,@tag_name,@order = params[:q],params[:tag_name] + @is_remote = true + if params[:sort] + order_by = params[:sort].split(":") + @sort = order_by[0] + if order_by.count > 1 + @order = order_by[1] + end + sort = "#{@sort} #{@order}" + end + q = "%#{@q.strip}%" + @result = find_course_attache q,@course,sort + @result = visable_attachemnts @result + @result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} + @searched_attach = paginateHelper @result,10 + @tag_list = get_course_tag_list @course + respond_to do |format| + format.js + # format.html + end end end diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index c90d078e2..a589ce144 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -314,7 +314,7 @@ class HomeworkAttachController < ApplicationController def edit bid = @homework.bid - if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0) && (User.current.admin? || User.current.member_of_course?(bid.courses.first)) + if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 2) && (User.current.admin? || User.current.member_of_course?(bid.courses.first)) get_homework_member @homework else render_403 :message => :notice_not_authorized @@ -347,7 +347,7 @@ class HomeworkAttachController < ApplicationController def destroy bid = @homework.bid - if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0) && (User.current.admin? || User.current == @homework.user) + if (bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 0) && (User.current.admin? || User.current == @homework.user) if @homework.destroy #respond_to do |format| # format.html { redirect_to course_for_bid_url @homework.bid } diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index e26901320..253faa2b1 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -220,11 +220,18 @@ class TagsController < ApplicationController @tag = ActsAsTaggableOn::Tag.find_by_id(@tag_id) @tag.delete unless @tag.nil? end + + if @obj && @object_flag == '6' && @obj.container.kind_of?(Course) + @course = @obj.container + @tag_list = get_course_tag_list @course + @select_tag_name = params[:select_tag_name] + end # end end end def tag_save + @select_tag_name = params[:tag_for_save][:tag_name] @tags = params[:tag_for_save][:name] @obj_id = params[:tag_for_save][:object_id] @obj_flag = params[:tag_for_save][:object_flag] @@ -263,6 +270,10 @@ class TagsController < ApplicationController else logger.error "#{__FILE__}:#{__LINE__} ===> #{@obj.errors.try(:full_messages)}" end + if @obj && @obj_flag == '6' && @obj.container.kind_of?(Course) + @course = @obj.container + @tag_list = @tag_list = get_course_tag_list @course + end respond_to do |format| format.js format.html diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 095d0ada5..15c34c6ee 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2036,12 +2036,12 @@ module ApplicationHelper def anonymous_comment_link(bid, course) link = case bid.comment_status when 0 - confirm_info = "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n" + confirm_info = "开启匿评后学生将不能对作品进行提交、修改、删除等操作\n" confirm_info += anonymous_comment_notice(bid,course) confirm_info += '是否确定开启匿评?' link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => confirm_info, disable_with: '加载中...' when 1 - confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作业列表\n" + confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作品列表\n" confirm_info += anonymous_comment_notice(bid,course) confirm_info += '是否确定关闭匿评?' link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => confirm_info @@ -2057,7 +2057,7 @@ module ApplicationHelper @student_size ||= searchStudent(course).size @homework_size = bid.homeworks.size percent = @homework_size.to_f / (@student_size == 0 ? 1 : @student_size) - confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n" + confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n" when 1 @homework_evaluations = 0 bid.homeworks.map { |homework| @homework_evaluations += homework.homework_evaluations.count} @@ -2074,7 +2074,7 @@ module ApplicationHelper bid.homeworks.map { |homework| @has_evaluations += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count} percent = @has_evaluations.to_f / (@homework_evaluations == 0 ? 1 : @homework_evaluations) - confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作业,已评价#{@has_evaluations}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n" + confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作品,已评价#{@has_evaluations}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n" end confirm_info end @@ -2097,4 +2097,23 @@ module ApplicationHelper request.env["HTTP_USER_AGENT"] =~ /MSIE 8.0/ end + + #获取指定资源列表的TAG的集合以及每个TAG的数量,降序排序 + def attachment_tag_list attachments + tag_list = Hash.new + attachments.each do |attachment| + attachment.tag_list.map{|tag| tag_list.has_key?(tag) ? tag_list[tag] = tag_list[tag] + 1 : tag_list[tag] = 1} + end + tag_list.sort {|a,b| b[1]<=>a[1]} + end + + #获取课程资源的TAG云 + def get_course_tag_list course + all_attachments = course.attachments.select{|attachment| attachment.is_public? || + (attachment.container_type == "Course" && User.current.member_of_course?(course))|| + attachment.author_id == User.current.id + } + tag_list = attachment_tag_list all_attachments + tag_list + end end diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 5b311acd7..2e06e3a43 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -762,7 +762,11 @@ module CoursesHelper if user_homework && user_homework.empty? link_to l(:label_commit_homework), new_exercise_book_path(bid),:class => 'fr mr10 work_edit' else - "作业已交".html_safe + if bid.comment_status == 1 && bid.open_anonymous_evaluation == 1 + "#{l(:label_edit_homework)}".html_safe + else + link_to l(:label_edit_homework), edit_homework_attach_path(user_homework.first.id),:class => 'fr mr10 work_edit' + end end end diff --git a/app/helpers/files_helper.rb b/app/helpers/files_helper.rb index 3c8ed63d4..d69f13a29 100644 --- a/app/helpers/files_helper.rb +++ b/app/helpers/files_helper.rb @@ -120,6 +120,12 @@ module FilesHelper result end + def get_attachments_by_tag attachments,tag + attachments.each do |attachment| + attachment.tag_list.include?(tag) + end + end + def visable_attachemnts_insite attachments,obj result = [] if obj.is_a?(Course) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index aa216d755..e91883bee 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -40,9 +40,9 @@ class CoursesService end @courses = courses_all.visible(current_user) if params[:name].present? - @courses_all = @courses.like(params[:name]) + @courses_all = @courses.like(params[:name]).order("created_at desc") else - @courses_all = @courses; + @courses_all = @courses.order("created_at desc"); end @courses_all course_list = [] @@ -198,7 +198,7 @@ class CoursesService @course.school_id = current_user.user_extensions.school_id @course.setup_time = params[:setup_time] @course.endup_time = params[:endup_time] - @course.class_period = params[:class_period] + @course.class_period = params[:class_period].to_i params[:course][:is_public] ? @course.is_public = 1 : @course.is_public = 0 params[:course][:open_student] ? @course.open_student = 1 : @course.open_student = 0 end @@ -245,7 +245,7 @@ class CoursesService #course.safe_attributes = params[:course] course.time = params[:time] course.term = params[:term] - course.class_period = params[:class_period] + course.class_period = params[:class_period].to_i params[:course][:is_public] ? course.is_public = 1 : course.is_public = 0 params[:course][:open_student] ? course.open_student = 1 : course.open_student = 0 if course.save diff --git a/app/services/users_service.rb b/app/services/users_service.rb index 63dd725cd..c1f716fd1 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -77,7 +77,7 @@ class UsersService gender = @user.user_extensions.gender.nil? ? 0 : @user.user_extensions.gender work_unit = get_user_work_unit @user location = get_user_location @user - {:id => @user.id, :img_url => img_url, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction} + {:id => @user.id, :img_url => img_url,:realname => @user.realname, :nickname => @user.login, :gender => gender, :work_unit => work_unit, :mail => @user.mail, :location => location, :brief_introduction => @user.user_extensions.brief_introduction} end #忘记密码 diff --git a/app/views/bids/_alert_anonyoms.html.erb b/app/views/bids/_alert_anonyoms.html.erb index 6467b3f27..2f1c443f4 100644 --- a/app/views/bids/_alert_anonyoms.html.erb +++ b/app/views/bids/_alert_anonyoms.html.erb @@ -39,28 +39,28 @@ <% if @bid.comment_status == 0%>

开启匿评功能

- 开启匿评后学生将不能对作业进行 + 开启匿评后学生将不能对作品进行 修改、删除 等操作,目前有 <%= totle_size%>个 学生,共提交了 <%= cur_size %> - 份作业,占 + 份作品,占 <%= percent %>%, 是否确定开启匿评?

<% elsif @bid.comment_status == 1 %>

关闭匿评功能

- 关闭匿评后学生将不能对作业进行 + 关闭匿评后学生将不能对作品进行 匿评 - ,且作业列表将会 + ,且作品列表将会 公开, 目前分配了 <%= totle_size%>份 - 匿评作业,已评了 + 匿评作品,已评了 <%= cur_size %> - 份作业,占 + 份作品,占 <%= percent %>%, 是否确定关闭匿评?

diff --git a/app/views/bids/_bid_homework_show.html.erb b/app/views/bids/_bid_homework_show.html.erb index 386c03b6d..1ecf8be90 100644 --- a/app/views/bids/_bid_homework_show.html.erb +++ b/app/views/bids/_bid_homework_show.html.erb @@ -10,7 +10,7 @@ var hour=Math.floor((leftsecond-day1*24*60*60)/3600); var minute=Math.floor((leftsecond-day1*24*60*60-hour*3600)/60); var second=Math.floor(leftsecond-day1*24*60*60-hour*3600-minute*60); - $("#"+divname).html("作业提交还剩 : " + $("#"+divname).html("作品提交还剩 : " +day1+"  " +hour+"  " +minute+"  " diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 577cd280f..c0ae219a5 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -70,7 +70,7 @@

下载文件包太大,分成多个下载包

diff --git a/app/views/bids/_new_homework_form.html.erb b/app/views/bids/_new_homework_form.html.erb index 129bcec5e..aeb9a5c41 100644 --- a/app/views/bids/_new_homework_form.html.erb +++ b/app/views/bids/_new_homework_form.html.erb @@ -44,7 +44,7 @@
  • - <%= l(:button_create)%> + <%= l(:button_create)%> <%= link_to l(:button_cancel), homework_course_path(@course), :class => "blue_btn grey_btn fl c_white"%>
  • diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb index abcbbfe5b..8974c3089 100644 --- a/app/views/courses/_course.html.erb +++ b/app/views/courses/_course.html.erb @@ -33,6 +33,15 @@ <% end %>

    +

    + <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%> + <%= get_course_term @course %> +

    +

    + <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> + <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %> +

    +
    @@ -71,15 +80,13 @@
    -
    - <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%> - <%= get_course_term @course %> -
    + <%= content_tag "span","#{l(:label_duration_time)}:", :class => "course-font"%> + <%= get_course_term @course %>
    - <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> - <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %> + <%= content_tag "span", "#{l(:label_course_brief_introduction)}:", :class => "course-font" %> + <%= content_tag "div", course.short_description, :class => "brief_introduction", :title => course.short_description %>
    diff --git a/app/views/courses/_course_members.html.erb b/app/views/courses/_course_members.html.erb index 38ef7e9db..c093d4b2f 100644 --- a/app/views/courses/_course_members.html.erb +++ b/app/views/courses/_course_members.html.erb @@ -1,3 +1,4 @@ +
    • diff --git a/app/views/courses/_course_teacher.html.erb b/app/views/courses/_course_teacher.html.erb index 89a3eea7e..587d9d2da 100644 --- a/app/views/courses/_course_teacher.html.erb +++ b/app/views/courses/_course_teacher.html.erb @@ -1,6 +1,6 @@
      - 加入时间 + 加入时间
      <% members.each do |member| %> diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index 60c10dff6..a773b6147 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -26,9 +26,9 @@
    • <%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%> <% if @score_sort_by == 'desc' %> - + <% else %> - + <% end %>
    • diff --git a/app/views/courses/_member_list_detail.html.erb b/app/views/courses/_member_list_detail.html.erb index bc6cbd242..1067f709d 100644 --- a/app/views/courses/_member_list_detail.html.erb +++ b/app/views/courses/_member_list_detail.html.erb @@ -4,7 +4,7 @@
      <% next if member.new_record? %> - <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %> + <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 40, :height => 40)) %>
        <% if @canShowCode %> <% if member.user.show_name == '' && member.user.user_extensions.student_id == '' %> diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index e7d282256..30b77ee50 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -32,7 +32,7 @@ <% end %> -
      • 加入时间
      • +
      • 加入时间
      diff --git a/app/views/courses/new.html.erb b/app/views/courses/new.html.erb index 0ea51d5f4..75979d9f3 100644 --- a/app/views/courses/new.html.erb +++ b/app/views/courses/new.html.erb @@ -25,8 +25,9 @@
    • - + 显示明码 +
      学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
    • diff --git a/app/views/courses/search_member.js.erb b/app/views/courses/search_member.js.erb new file mode 100644 index 000000000..c34a08aaf --- /dev/null +++ b/app/views/courses/search_member.js.erb @@ -0,0 +1 @@ +$('#course_members_setting').html('<%= escape_javascript(render :partial => 'courses/course_members') %>'); \ No newline at end of file diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index acc6c12a5..e68be7141 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -39,8 +39,9 @@
    • - + 显示明码 +
      学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。
    • @@ -71,7 +72,21 @@
    - <%= render :partial => "course_members" %> +
    + <%= form_tag({:controller => 'courses', :action => 'search_member'},:id => "course_member_search_form", :method => :get, :class => "search_form_course",:remote => true) do %> + + <%= text_field_tag 'name', params[:name], :placeholder => "昵称、学号、姓名搜索", :class => "search_text fl" %> + + <%= l(:label_search)%> + +
    + + <% end %> +
    +
    +
    + <%= render :partial => "course_members" %> +
    \ No newline at end of file diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 1cc117dd6..1d2c42457 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -40,7 +40,7 @@


    - <%= l :label_create_time %>: : <%= format_time(@course.created_at) %> + <%= l :label_create_time %> : <%= format_time(@course.created_at) %>

    diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 44dd50c5e..7b2acd875 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -1,7 +1,23 @@
    @@ -44,7 +59,15 @@ <%= submit_tag "全站搜索", :class => "re_schbtn b_lblue",:name => "insite",:id => "insite",:onmouseover => "presscss('insite')",:onmouseout =>"buttoncss()" %> <% end %> <% if is_course_teacher(User.current,@course) %> - 上传资源 + +

    + 上传: + 课件 |  + 软件 |  + 媒体 |  + 代码 |  + 其他 +

    <% end %>
    diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index 3946b1da1..888910ac1 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -14,40 +14,46 @@

    + +
    + <%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => course,:tag_name => @tag_name}%> +
    +
    +
    <% curse_attachments.each do |file| %> <% if file.is_public? || User.current.member_of_course?(course) %>
    - <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> + <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s,:class => "c_dblue f_14 f_b f_l hiddent" %> <% if User.current.logged? %> <% if (is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file) %> - <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %> + <%= link_to("选入我的其他课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <% if delete_allowed && file.container_id == @course.id && file.container_type == "Course" %> - <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> + <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open c_blue",:method => :post %> <% else %> <% end %> <% else %> - <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select",:remote => true) if has_course?(User.current,file) %> + <%= link_to("选入我的课程",quote_resource_show_course_file_path(@course,file),:class => "f_l re_select c_lorange",:remote => true) if has_course?(User.current,file) %> <% end %> <% else %> <% end %>
    -

    文件大小:<%= number_to_human_size(file.filesize) %>

    +

    文件大小:<%= number_to_human_size(file.filesize) %>

    <%= link_to( l(:button_delete), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,:class => "f_r re_de") if delete_allowed && file.container_id == @course.id && file.container_type == "Course"%>

    <%= time_tag(file.created_on).html_safe %><%= l(:label_bids_published_ago) %>  |  下载<%= file.downloads %>  |  引用<%= file.quotes.nil? ? 0:file.quotes %>

    - <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %> - <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %> + <%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %> + <%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
    diff --git a/app/views/files/_tag_yun.html.erb b/app/views/files/_tag_yun.html.erb new file mode 100644 index 000000000..9db34ece4 --- /dev/null +++ b/app/views/files/_tag_yun.html.erb @@ -0,0 +1,9 @@ +<% unless tag_list.nil?%> + <% tag_list.each do |k,v|%> + <% if tag_name && tag_name == k%> + <%= k%>×<%= v%> + <% else%> + <%= k%>×<%= v%> + <% end%> + <% end%> +<% end%> \ No newline at end of file diff --git a/app/views/files/_upload_show.html.erb b/app/views/files/_upload_show.html.erb index 959fcb7bf..e11a4bf38 100644 --- a/app/views/files/_upload_show.html.erb +++ b/app/views/files/_upload_show.html.erb @@ -7,7 +7,7 @@ <%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> - + <%= render :partial => 'attachement_list',:locals => {:course => course} %>
    <%= l(:button_cancel)%> diff --git a/app/views/files/search_tag_attachment.js.erb b/app/views/files/search_tag_attachment.js.erb new file mode 100644 index 000000000..50f46d2f5 --- /dev/null +++ b/app/views/files/search_tag_attachment.js.erb @@ -0,0 +1 @@ +$("#course_list").html("<%= escape_javascript(render :partial => 'course_list',:locals => {course: @course,all_attachments: @result,sort:@sort,order:@order,curse_attachments:@searched_attach})%>"); \ No newline at end of file diff --git a/app/views/files/upload_file_show.js.erb b/app/views/files/upload_file_show.js.erb index 72fed67a9..71f8f831e 100644 --- a/app/views/files/upload_file_show.js.erb +++ b/app/views/files/upload_file_show.js.erb @@ -1,10 +1,10 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'upload_show',:locals => {}) %>'); -showModal('ajax-modal', '513px'); -$('#ajax-modal').css('height','569px'); -$('#ajax-modal').siblings().remove(); -//$('#ajax-modal').before("" + -// ""); -$('#ajax-modal').parent().css("top","").css("left",""); -$('#ajax-modal').parent().addClass("alert_box"); \ No newline at end of file +//$('#ajax-modal').html('<%#= escape_javascript(render :partial => 'upload_show',:locals => {}) %>'); +//showModal('ajax-modal', '513px'); +//$('#ajax-modal').css('height','569px'); +//$('#ajax-modal').siblings().remove(); +////$('#ajax-modal').before("" + +//// ""); +//$('#ajax-modal').parent().css("top","").css("left",""); +//$('#ajax-modal').parent().addClass("alert_box"); \ No newline at end of file diff --git a/app/views/homework_attach/_history.erb b/app/views/homework_attach/_history.erb index 686cdffd2..e99160f22 100644 --- a/app/views/homework_attach/_history.erb +++ b/app/views/homework_attach/_history.erb @@ -5,7 +5,7 @@ <% if journals.size > 0 %> <% for journal in journals %>
    - +
    diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index fca25e8ee..0b81bb138 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -15,7 +15,7 @@
  • <% if homework.name == nil || homework.name == "" %> - <% homework_filename = homework.user.name + "提交的作业" %> + <% homework_filename = homework.user.name + "提交的作品" %> <% else %> <% homework_filename = homework.name %> <% end %> @@ -55,7 +55,7 @@ <% if is_my_homework %> - <% if bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 %> + <% if bid.comment_status == 0 || bid.open_anonymous_evaluation == 0 || bid.comment_status == 2 %>
  • <%= link_to l(:button_edit), edit_homework_attach_path(homework) %> <% if homework.user == User.current || User.current.admin? %> @@ -69,7 +69,7 @@ <% end %>
  • <% else %> -
  • +
  • <%= l(:button_edit) %> <% if homework.user == User.current || User.current.admin? %> diff --git a/app/views/homework_attach/_homeworks_list.html.erb b/app/views/homework_attach/_homeworks_list.html.erb index d2121c85f..3444eca36 100644 --- a/app/views/homework_attach/_homeworks_list.html.erb +++ b/app/views/homework_attach/_homeworks_list.html.erb @@ -47,9 +47,9 @@ <%= link_to User.current.login, user_path(User.current), :title => User.current.login%>
  • -
  • 您还没交作业,请创建作业!
  • +
  • 您还没提交作品,请点击提交作品按钮:)
  • - <%= link_to "提交作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %> + <%= link_to "提交作品", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
  • diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index f277cbaa6..dc384834c 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -35,7 +35,7 @@ <%= l(:label_courses_community)%> -

    +

    <%= l(:label_user_location) %> : <%= link_to l(:field_homepage), home_path %> > @@ -49,7 +49,7 @@