diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index bb25f1404..14deb6c65 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -725,6 +725,16 @@ class ShixunsController < ApplicationController end end + def fork_list + @shixuns = Shixun.where(:fork_from => @shixun.id) + @shixuns_count = @shixuns.count + @limit = 16 + @is_remote = true + @shixun_pages = Paginator.new @shixuns_count, @limit, params['page'] || 1 + @offset ||= @shixun_pages.offset + @shixuns = paginateHelper @shixuns, @limit + end + def show respond_to do |format| format.html{redirect_to shixun_challenges_path(@shixun)} diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb index fd6eb661f..162eb239b 100644 --- a/app/views/attachments/_activity_attach.html.erb +++ b/app/views/attachments/_activity_attach.html.erb @@ -1,15 +1,15 @@ <% if activity.attachments.any? %> <% activity.attachments.each do |attachment| %>
  • - + - <%= link_to_short_attachment attachment,:length=> 58, :class => 'link-color-grey', :download => true %> + <%= link_to_short_attachment attachment,:length=> 58, :class => 'color-grey', :download => true %> ( <%= number_to_human_size attachment.filesize %>) <% user_name = attachment.author.show_real_name.empty? ? attachment.author : attachment.author.show_real_name %> - <%= link_to h(truncate(user_name, length: 15, omission: '...')),user_path(attachment.author),:class => "link-color-grey" %>, + <%= link_to h(truncate(user_name, length: 15, omission: '...')),user_path(attachment.author),:class => "color-grey" %>, <%= format_time(attachment.created_on) %> diff --git a/app/views/courses/_course_activity_content.html.erb b/app/views/courses/_course_activity_content.html.erb index 87d5c9252..0efd322d4 100644 --- a/app/views/courses/_course_activity_content.html.erb +++ b/app/views/courses/_course_activity_content.html.erb @@ -22,7 +22,7 @@ <% end %>
  • <% end %> -
    +
    新建
    @@ -90,7 +90,7 @@ <% question_list.each_with_index do |exercise_question, i| %>
    -

    第<%= i + 1 %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>

    +

    第<%= i + 1 %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>

    <%= exercise_question.question_title.html_safe %>
    <% case exercise_question.question_type %> diff --git a/app/views/exercise/_exercise_student_result.html.erb b/app/views/exercise/_exercise_student_result.html.erb index e399fa778..9839585be 100644 --- a/app/views/exercise/_exercise_student_result.html.erb +++ b/app/views/exercise/_exercise_student_result.html.erb @@ -46,7 +46,7 @@
    <% @exercise.exercise_questions.where(:question_type => [1, 2, 3]).each_with_index do |eq, index| %> <% is_correct = answer_is_correct(eq, user) %> - <%= eq.question_number %> + <%= eq.question_number %> <% end %>
    @@ -57,7 +57,7 @@
    <% @exercise.exercise_questions.where(:question_type => 4).each_with_index do |eq, index| %> <% ea = User.current.exercise_answer.where(:exercise_question_id => eq.id).first %> - <%= eq.question_number %> + <%= eq.question_number %> <% end %>
    @@ -66,7 +66,7 @@ <% @exercise.exercise_questions.each_with_index do |exercise_question, i| %>
    -

    第<%= exercise_question.question_number %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>分<%= question_commit_status exercise_question, @exercise_user.user %>

    +

    第<%= exercise_question.question_number %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>分<%= question_commit_status exercise_question, @exercise_user.user %>

    <% if exercise_question.question_type != 4 %> <% is_correct = answer_is_correct(exercise_question, user) %>

    <%= is_correct ? exercise_question.question_score : 0 %>

    diff --git a/app/views/exercise/_new_question.html.erb b/app/views/exercise/_new_question.html.erb index 8aff26709..169230966 100644 --- a/app/views/exercise/_new_question.html.erb +++ b/app/views/exercise/_new_question.html.erb @@ -2,10 +2,11 @@ <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %> -单选题 -多选题 -填空题 -简答题 ++ 单选题 ++ 多选题 ++ 填空题 ++ 简答题 +
    diff --git a/app/views/exercise/student_exercise_list.html.erb b/app/views/exercise/student_exercise_list.html.erb index 103fafdb3..45e999a73 100644 --- a/app/views/exercise/student_exercise_list.html.erb +++ b/app/views/exercise/student_exercise_list.html.erb @@ -31,17 +31,46 @@
      -
    • +
    • 答题统计
    • + <% if @is_teacher %> + <% if false%> +
    • + 试卷预览 +
    • +
    • + 设置 +
    • + <% end %> + <%= link_to "导出成绩", student_exercise_list_exercise_path(@exercise, :course_id => @course.id, :format => 'xls'), :id => "export_exercise_work", :class => "fr white-btn orange-btn ml10 mt10 mr15" %> + <% else %> + <% if false%> +
    • + 查看设置 +
    • + <% end %> +

      + <% ex_user = @exercise.exercise_users.where(:user_id => User.current).first %> + <% if ex_user %> + <% if ex_user.commit_status > 0 %> + <%= link_to '查看答题', ex_user.commit_status == 1 ? exercise_path(@exercise,:user_id => User.current.id) : show_student_result_exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %> + <% else %> + <% if @exercise.exercise_status == 2 %> + <%= link_to (ex_user.start_at.nil? ? "开始答题" : "继续答题"), exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %> + <% end %> + <% end %> + <% end %> +

      + <% end %>
    <% if @is_teacher %>
  • - <%= link_to "导出成绩", student_exercise_list_exercise_path(@exercise, :course_id => @course.id, :format => 'xls'), :id => "export_exercise_work", :class => "fr white-btn orange-btn ml10 mt8" %> -
    + +
    @@ -86,29 +115,32 @@ <% elsif User.current.member_of_course?(@exercise.course) %> -

    - <% ex_user = @exercise.exercise_users.where(:user_id => User.current).first %> - <% if ex_user %> - <% if ex_user.commit_status > 0 %> - 你已提交 - <%= link_to '查看答题', ex_user.commit_status == 1 ? exercise_path(@exercise,:user_id => User.current.id) : show_student_result_exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr" %> - <% else %> - 你未提交 - <% if @exercise.exercise_status == 2 %> - <%= link_to (ex_user.start_at.nil? ? "开始答题" : "继续答题"), exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr" %> +

    +

    + <% ex_user = @exercise.exercise_users.where(:user_id => User.current).first %> + <% if ex_user %> + <% if ex_user.commit_status > 0 %> + 你已提交 + <%#= link_to '查看答题', ex_user.commit_status == 1 ? exercise_path(@exercise,:user_id => User.current.id) : show_student_result_exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr" %> + <% else %> + 你未提交 + <%# if @exercise.exercise_status == 2 %> + <%#= link_to (ex_user.start_at.nil? ? "开始答题" : "继续答题"), exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr" %> + <%# end %> <% end %> <% end %> - <% end %> -

    -

    - (<%= @has_commit_count %>人已交) - <% if @exercise.exercise_status == 2 && @exercise.end_time > Time.now %> - <% end_time = @exercise.end_time.to_time.to_i %> - 答题剩余时间:<%= (end_time - Time.now.to_i) / (24*60*60) %><%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%>小时<%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%> - <% elsif @exercise.exercise_status == 3 %> - 提交已截止 - <% end %> -

    +

    + +

    + (<%= @has_commit_count %>人已交) + <% if @exercise.exercise_status == 2 && @exercise.end_time > Time.now %> + <% end_time = @exercise.end_time.to_time.to_i %> + 答题剩余时间:<%= (end_time - Time.now.to_i) / (24*60*60) %><%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%>小时<%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%> + <% elsif @exercise.exercise_status == 3 %> + 提交已截止 + <% end %> +

    +
    <% end %>
    @@ -116,4 +148,12 @@
    -
    \ No newline at end of file +
  • + \ No newline at end of file diff --git a/app/views/exercise/update_question_num.js.erb b/app/views/exercise/update_question_num.js.erb index d1284e659..6f5f7bb5f 100644 --- a/app/views/exercise/update_question_num.js.erb +++ b/app/views/exercise/update_question_num.js.erb @@ -29,4 +29,6 @@ $("#show_poll_questions_<%= @exercise_question.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:exercise_question => @exercise_question}) %>"); <% elsif @exercise_question.question_type == 4%> $("#show_poll_questions_<%= @exercise_question.id %>").html("<%= escape_javascript(render :partial => 'show_multi', :locals => {:exercise_question => @exercise_question}) %>"); -<% end%> \ No newline at end of file +<% end%> +$(".data-tip-down").html(""); +$(".data-tip-down").hide(); \ No newline at end of file diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index a3cbaa03e..1908b49c5 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -1,7 +1,7 @@

    - <%= @user.show_name %> > 论坛 + <%= @user.show_name %> > 讨论区

    @@ -11,19 +11,19 @@
  • <%= @user.show_name %>
  • -
  • <%= @user.login %>
  • +
  • <%= @user.login %>
    • -
    • <%= @memos_praise_count %>
      被赞
    • -
    • <%= @my_memos_count %>
      回复/评论
    • -
    • <%= @my_forums_count %>
      主题
    • +
    • <%= @memos_praise_count %>
      被赞
    • +
    • <%= @my_memos_count %>
      回复/评论
    • +
    • <%= @my_forums_count %>
      主题
    -

    问吧

    +

    帖子

    + 新话题
    @@ -38,7 +38,7 @@ <%= memo.subject %> <% if memo.sticky %> - + <% end %>

    <%= memo.content.html_safe %>
    @@ -47,10 +47,16 @@ <%= time_from_now memo.updated_at %>

    - <%= memo.viewed_count %> - <%= get_praise_num(memo) %> - <%= Memo.where(:root_id => memo.id).count %> - + <% if memo.viewed_count > 0%> + <%= memo.viewed_count %> + <% end %> + <% if get_praise_num(memo) > 0%> + <%= get_praise_num(memo) %> + <% end %> + <% if Memo.where(:root_id => memo.id).count > 0%> + <%= Memo.where(:root_id => memo.id).count %> + <% end %> +

    diff --git a/app/views/homework_common/_homework_index_list.html.erb b/app/views/homework_common/_homework_index_list.html.erb index 4b957b505..45c197d31 100644 --- a/app/views/homework_common/_homework_index_list.html.erb +++ b/app/views/homework_common/_homework_index_list.html.erb @@ -21,6 +21,11 @@ <% allow_late = homework_common.allow_late ? '已开启补交' : '未开启补交' %> <%= allow_late %> <% end %> + + <% if false %> + 未提交 + <% end %> +

    diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index 18fce614e..b255a3fcf 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -82,8 +82,8 @@ <% end %> <% unless (is_teacher || is_TA || is_TE || is_ST) %> -

    -

    <%= link_to "加入课堂", join_private_courses_courses_path, :remote => true, :method => "post", :class => 'color_white' %>

    +
    +

    <%= link_to "加入课堂", join_private_courses_courses_path, :remote => true, :method => "post", :class => 'white-btn orange-btn' %>

    <% end %> diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 6a638ac62..9cd984987 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -18,7 +18,7 @@
  • <%= link_to "全部实训", shixuns_path, :class => "new-nav-a font-16" %>
  • <%= link_to "实训路径", subjects_path, :class => "new-nav-a font-16" %>
  • <%= link_to "在线课堂", courses_path, :class => "new-nav-a font-16" %>
  • -
  • <%= link_to "论坛", forums_path, :class => "new-nav-a font-16" %>
  • +
  • <%= link_to "讨论区", forums_path, :class => "new-nav-a font-16" %>
  • diff --git a/app/views/memos/_common_reply_box.html.erb b/app/views/memos/_common_reply_box.html.erb index cec0cdcfc..12074bbb1 100644 --- a/app/views/memos/_common_reply_box.html.erb +++ b/app/views/memos/_common_reply_box.html.erb @@ -69,8 +69,8 @@

    <% if comment.creator_user == User.current %> 删除 + | <% end %> - | <%= link_to( '回复'.html_safe, {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => memo.class.to_s, :user_activity_id => memo.id}, diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index addf53876..7a32dd01b 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -5,11 +5,11 @@

    - <%= @user.show_name %> > 讨论 + <%= @user.show_name %> > 讨论区

    - 讨论详情 + 帖子详情

    diff --git a/app/views/messages/_common_reply_box.html.erb b/app/views/messages/_common_reply_box.html.erb index afd027cea..0141e316c 100644 --- a/app/views/messages/_common_reply_box.html.erb +++ b/app/views/messages/_common_reply_box.html.erb @@ -38,29 +38,8 @@ <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %>
    -
    -
    - <%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %> - <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> -
    -

    - <% if is_teacher || comment.creator_user == User.current%> - 删除 - <% end %> - | - <%= link_to( - '回复'.html_safe, - {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id}, - :remote => true, - :method => 'get', - :title => l(:button_reply),:class => "color-grey") %> - | - - <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - -

    -
    -
    + +
    <% if !comment.parent.nil? && !comment.parent.parent.nil? %> <% parents_rely = [] %> @@ -95,6 +74,29 @@
    <%= comment.content_detail.html_safe %>
    + +
    +
    + <%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %> + <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> +
    +

    + <% if is_teacher || comment.creator_user == User.current%> + 删除 + <% end %> + | + <%= link_to( + '回复'.html_safe, + {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id}, + :remote => true, + :method => 'get', + :title => l(:button_reply),:class => "color-grey") %> + | + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +

    +
    diff --git a/app/views/shixuns/_shixun_top.html.erb b/app/views/shixuns/_shixun_top.html.erb index 6234c0673..9cf93f24a 100644 --- a/app/views/shixuns/_shixun_top.html.erb +++ b/app/views/shixuns/_shixun_top.html.erb @@ -1,10 +1,24 @@ <% update_visiti_count @shixun %>
    -

    - <%= @shixun.owner.try(:show_name) %> - /

    <%= @shixun.name %>

    -

    +
    +

    + <%= @shixun.owner.try(:show_name) %> + /

    <%= @shixun.name %>

    +

    + <% if @shixun.fork_from.present? %> + <% fork_shixun = Shixun.find(@shixun.fork_from) %> +
    + forked from <%= fork_shixun.owner.try(:show_name) %>/<%= fork_shixun.name %> + <% end %> + +
    + <% unless User.current.manager_of_shixun?(@shixun) %> + <%= @shixun.language %> + <%= @shixun.shixun_trainee %> + <%= @shixun.shixun_major_courses.blank? ? "" : CourseList.where(:id => @shixun.shixun_major_courses.map(&:course_list_id)).map(&:name).join("、") %> + <% end %> +
    <% myshixun = Myshixun.where(:user_id => User.current.id, :shixun_id => @shixun.id).first %> <% if allow_shixun_exec(@shixun) %> @@ -36,21 +50,19 @@ 已关闭 <% end %> <% if (@shixun.can_copy && User.current.user_extensions.try(:identity) == 0 && User.current.professional_certification) %> -
    - <%= Shixun.where(:fork_from => @shixun.id).count %> - - Fork - + - - <% end %> + <% end %> <% end %>
    - <% unless User.current.manager_of_shixun?(@shixun) %> - <%= @shixun.language %> - <%= @shixun.shixun_trainee %> - <%= @shixun.shixun_major_courses.blank? ? "" : CourseList.where(:id => @shixun.shixun_major_courses.map(&:course_list_id)).map(&:name).join("、") %> - <% end %>