From 41ee4b838d67bd03e6c414e91db3d4c779546aab Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Mon, 9 Oct 2017 14:15:03 +0800 Subject: [PATCH 01/30] =?UTF-8?q?=E7=95=99=E8=A8=80=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E6=89=80=E6=9C=89=E5=A4=B4=E5=83=8F=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E4=B8=BA=E5=9C=86=E5=BD=A2=20=E5=B9=B3=E5=8F=B0=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E5=8F=AA=E6=9C=89=E4=B8=80=E4=B8=AA=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=97=B6=E5=8E=BB=E6=8E=89=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E7=9A=84=E5=8F=89=E5=8F=89=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_user_journalsformessage.html.erb | 2 +- public/javascripts/edu/application.js | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index 448069e02..f0315ed8a 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -1,7 +1,7 @@
- <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %> + <%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50",:class => "bor-radius-all"), user_path(activity.user), :alt => "用户头像" %> <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
diff --git a/public/javascripts/edu/application.js b/public/javascripts/edu/application.js index fb7f18587..628fbe723 100644 --- a/public/javascripts/edu/application.js +++ b/public/javascripts/edu/application.js @@ -319,16 +319,18 @@ function delete_confirm_box_4(url, str){ } //提示框:只有一个按钮,点击关闭弹框 +// function notice_sure_box(str){ - var htmlvalue = '

提示

'+ + var htmlvalue = '

提示

'+ '

' + str + '

'; pop_box_new(htmlvalue, 480, 140); } //提示框:只有一个确定按钮,点击关闭弹框 +// function notice_box(str){ - var htmlvalue = '

提示

'+ + var htmlvalue = '

提示

'+ '

' + str + '

'+ '确定
'; pop_box_new(htmlvalue, 480, 140); @@ -336,48 +338,54 @@ function notice_box(str){ // 长提示框:只有一个确定按钮,点击关闭弹框 +// function long_notice_box(str){ - var htmlvalue = '

提示

'+ + var htmlvalue = '

提示

'+ '

' + str + '

'+ '确定
'; pop_box_new(htmlvalue, 575, 140); } // 长提示框:只有一个“知道啦”按钮,点击关闭弹框 +// function yes_notice_box(str){ - var htmlvalue = '

提示

'+ + var htmlvalue = '

提示

'+ '

' + str + '

'; pop_box_new(htmlvalue, 575, 200); } //提示框:只有一个知道啦按钮,点击打开新窗口 +// function sure_box_redirect(url, str){ - var htmlvalue = '

提示

'+ + var htmlvalue = '

提示

'+ '

' + str + '

'; pop_box_new(htmlvalue, 480, 140); } //提示框:只有一个知道啦按钮,点击打开新窗口 +// function sure_box_redirect_without_newtab(url, str){ - var htmlvalue = '

提示

'+ + var htmlvalue = '

提示

'+ '

' + str + '

'; pop_box_new(htmlvalue, 480, 140); } //提示框:只有一个确定按钮,点击跳转 +// function notice_box_redirect(url, str){ - var htmlvalue = '

提示

'+ + var htmlvalue = '

提示

'+ '

' + str + '

'+ '确定
'; pop_box_new(htmlvalue, 480, 140); } //提示框:只有一个确定按钮,点击跳转(局部刷新) +// function notice_box_redirect_remote(url, str){ - var htmlvalue = '

提示

'+ + var htmlvalue = '

提示

'+ '

' + str + '

'+ '确定
'; pop_box_new(htmlvalue, 480, 140); From ef6c3a443a5c551aa7de30e0d19ae9fa1e32c17f Mon Sep 17 00:00:00 2001 From: XuCheng642 <287102909@qq.com> Date: Mon, 9 Oct 2017 15:16:34 +0800 Subject: [PATCH 02/30] =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E5=92=8C=E7=82=B9?= =?UTF-8?q?=E8=B5=9E=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 2 +- .../_shixun_authorization_list.html.erb | 1 - app/views/memos/_common_reply_box.html.erb | 6 +- app/views/messages/_common_reply_box.html.erb | 6 +- .../praise_tread/_activity_praise.html.erb | 10 +- app/views/praise_tread/_edu_praise.html.erb | 12 +- .../student_work/_common_reply_box.html.erb | 6 +- .../_programing_work_show.html.erb | 348 +++++++++--------- .../student_work/_shixun_work_show.html.erb | 5 +- public/javascripts/edu/application.js | 2 +- 10 files changed, 210 insertions(+), 188 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index ca8c7f1a3..3470c1e9f 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -1532,7 +1532,7 @@ end @sub_type = 5 @type = trial_authorization_status params[:type] # sql = select * from apply_actions where dealer_id is null - @authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type,:dealer_id =>'').order("created_at desc") + @authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type, :dealer_id =>'').order("created_at desc") search = params[:search] unless search.blank? @authorizations = @authorizations.where(:container_id => Shixun.where(:id => @authorizations.map(&:container_id)).where("name like '%#{search}%'").map(&:id)).order("created_at desc") diff --git a/app/views/managements/_shixun_authorization_list.html.erb b/app/views/managements/_shixun_authorization_list.html.erb index 756e8b4ae..059994224 100644 --- a/app/views/managements/_shixun_authorization_list.html.erb +++ b/app/views/managements/_shixun_authorization_list.html.erb @@ -32,7 +32,6 @@
<% end %> -
    diff --git a/app/views/memos/_common_reply_box.html.erb b/app/views/memos/_common_reply_box.html.erb index cec0cdcfc..452a07be3 100644 --- a/app/views/memos/_common_reply_box.html.erb +++ b/app/views/memos/_common_reply_box.html.erb @@ -1,5 +1,9 @@
    -

    全部回复(<%= count %>)

    +

    全部回复 + <% unless count == 0 %> + (<%= count %>) + <% end %> +

    回复 diff --git a/app/views/messages/_common_reply_box.html.erb b/app/views/messages/_common_reply_box.html.erb index afd027cea..4917e5388 100644 --- a/app/views/messages/_common_reply_box.html.erb +++ b/app/views/messages/_common_reply_box.html.erb @@ -1,5 +1,9 @@

    -

    全部回复(<%= count %>)

    +

    全部回复 + <% unless count == 0 %> + (<%= count %>) + <% end %> +

    回复 diff --git a/app/views/praise_tread/_activity_praise.html.erb b/app/views/praise_tread/_activity_praise.html.erb index 8bbb6b6b8..ba0b379f0 100644 --- a/app/views/praise_tread/_activity_praise.html.erb +++ b/app/views/praise_tread/_activity_praise.html.erb @@ -2,19 +2,23 @@ + :type => type }) %>' data-remote="true" class="white-btn orange-btn" data-tip-down="点赞"> 赞 <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> + <% unless get_praise_num(activity) == 0%> <%= get_praise_num(activity) %> + <% end %> <% else %> + :type => type }) %>' data-remote="true" class="white-btn orange-bg-btn" data-tip-down ="取消点赞" > 赞 - <%= get_praise_num(activity) %> + <% unless get_praise_num(activity) == 0%> + <%= get_praise_num(activity) %> + <% end %> <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> diff --git a/app/views/praise_tread/_edu_praise.html.erb b/app/views/praise_tread/_edu_praise.html.erb index 0704eebad..26a8dc3be 100644 --- a/app/views/praise_tread/_edu_praise.html.erb +++ b/app/views/praise_tread/_edu_praise.html.erb @@ -2,19 +2,23 @@ + :type => type }) %>' data-remote="true" class="fr mr5 color-grey" data-tip-down="点赞"> 赞 <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> - <%= get_praise_num(activity) %> + <% unless get_praise_num(activity)==0 %> + <%= get_praise_num(activity) %> + <% end %> <% else %> + :type => type }) %>' data-remote="true" class="fr mr5 color-orange03" data-tip-down="取消点赞" > 赞 - <%= get_praise_num(activity) %> + <% unless get_praise_num(activity)==0 %> + <%= get_praise_num(activity) %> + <% end %> <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> diff --git a/app/views/student_work/_common_reply_box.html.erb b/app/views/student_work/_common_reply_box.html.erb index 094ff93cd..75f1ee563 100644 --- a/app/views/student_work/_common_reply_box.html.erb +++ b/app/views/student_work/_common_reply_box.html.erb @@ -1,5 +1,9 @@

    -

    全部回复(<%= count %>)

    +

    全部回复 + <% unless count == 0 %> + (<%= count %>) + <% end %> +

    回复 diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 880d6b842..1f1a019ea 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -1,174 +1,174 @@ -

    -
    -
      -
    • - 上交时间: - <%=format_time work.commit_time %> - 收起 -
    • - - <% if work.user == User.current && @homework.end_time >= Time.now %> - -
    • - <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> -
    • -
    • - <%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%> -
    • - <% end%> - <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%> - -
    • - <%= render :partial => 'student_work_praise',:locals => {:work => work} %> -
    • - <% end%> -
      - -
    • - 编程代码: -
      - -
      -
      -
      -
      -
    • - -
      -
    • - - 测试结果: - -
      - <% work.student_work_tests.each_with_index do |test, index| %> -
      -

      - 第<%= work.student_work_tests.count - index%>次测试 -

      - - <%= format_time(test.created_at).to_s %> - -
      -
      - <% if test.status.to_i == -2 %> -
      - <%= test.results.first %> -
      - <% else %> -
      -
      - <% test.results.reverse.each_with_index do |x, i| %> - <% unless x.nil? %> - <%= %> -
      - 测试<%=test.results.size-i%> - <% if x["status"].to_i != 0 %> - <% if x["status"].to_i == 2 %> - 超时! - <% else %> - 测试错误! - <% end %> - - 查看 - - - 耗时: -
      <%=x["time_used"]==0?1:x["time_used"]%>毫秒
      -
      - <% else %> - 测试正确! -   - 耗时: -
      <%=x["time_used"]==0?1:x["time_used"]%>毫秒
      -
      - <% end %> -
      - <% if x["status"].to_i != 0 %> -
      -
      -   - 您的输出: -
      <%=x["result"].force_encoding("UTF-8")%> 
      - 正确输出: -
      <%=x["output"].force_encoding("UTF-8")%>
      -
      -
      -

      - 收起 -

      -
      - <% end %> - <% end %> - <% end %> -
      -
      - <% end %> - <% end %> -
      -
      -
    • - -
    • - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> - -
        - <%= render :partial => 'add_score',:locals => {:work => work, :score => score, :is_member_work => false}%> -
      - <% end%> -
      -
    • -
    - -
    - <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %> -
    -
    - -
    - <%= render :partial => 'student_work_score_records', :locals => {:student_work_scores => student_work_scores, :is_member_work => false} %> -
    -
    - - 收起 -
    -
    - +
    +
    +
      +
    • + 上交时间: + <%=format_time work.commit_time %> + 收起 +
    • + + <% if work.user == User.current && @homework.end_time >= Time.now %> + +
    • + <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> +
    • +
    • + <%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%> +
    • + <% end%> + <% if @homework.homework_detail_manual.comment_status == 3 && work.user != User.current%> + +
    • + <%= render :partial => 'student_work_praise',:locals => {:work => work} %> +
    • + <% end%> +
      + +
    • + 编程代码: +
      + +
      +
      +
      +
      +
    • + +
      +
    • + + 测试结果: + +
      + <% work.student_work_tests.each_with_index do |test, index| %> +
      +

      + 第<%= work.student_work_tests.count - index%>次测试 +

      + + <%= format_time(test.created_at).to_s %> + +
      +
      + <% if test.status.to_i == -2 %> +
      + <%= test.results.first %> +
      + <% else %> +
      +
      + <% test.results.reverse.each_with_index do |x, i| %> + <% unless x.nil? %> + <%= %> +
      + 测试<%=test.results.size-i%> + <% if x["status"].to_i != 0 %> + <% if x["status"].to_i == 2 %> + 超时! + <% else %> + 测试错误! + <% end %> + + 查看 + + + 耗时: +
      <%=x["time_used"]==0?1:x["time_used"]%>毫秒
      +
      + <% else %> + 测试正确! +   + 耗时: +
      <%=x["time_used"]==0?1:x["time_used"]%>毫秒
      +
      + <% end %> +
      + <% if x["status"].to_i != 0 %> +
      +
      +   + 您的输出: +
      <%=x["result"].force_encoding("UTF-8")%> 
      + 正确输出: +
      <%=x["output"].force_encoding("UTF-8")%>
      +
      +
      +

      + 收起 +

      +
      + <% end %> + <% end %> + <% end %> +
      +
      + <% end %> + <% end %> +
      +
      +
    • + +
    • + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> + +
        + <%= render :partial => 'add_score',:locals => {:work => work, :score => score, :is_member_work => false}%> +
      + <% end%> +
      +
    • +
    + +
    + <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %> +
    +
    + +
    + <%= render :partial => 'student_work_score_records', :locals => {:student_work_scores => student_work_scores, :is_member_work => false} %> +
    +
    + + 收起 +
    +
    + diff --git a/app/views/student_work/_shixun_work_show.html.erb b/app/views/student_work/_shixun_work_show.html.erb index 20d266e12..30bcecc83 100644 --- a/app/views/student_work/_shixun_work_show.html.erb +++ b/app/views/student_work/_shixun_work_show.html.erb @@ -10,7 +10,10 @@ / <%= link_to @shixun.name, shixun_path(@shixun), :class => "edu-info-dark fl", :target => "_blank" %>

    - 经验值:<%= @myshixun.total_score %> +
    + 经验值:<%= @myshixun.total_score %> +
    +
    <%= link_to image_tag(url_to_avatar(@work.user), :width =>"50", :height => "50", :alt=>"头像", :style => "width:50px; height:50px;"), user_path(@work.user), :class => "fl edu-work-user-img", :target => "_blank" %> diff --git a/public/javascripts/edu/application.js b/public/javascripts/edu/application.js index fb7f18587..467aca2e2 100644 --- a/public/javascripts/edu/application.js +++ b/public/javascripts/edu/application.js @@ -192,7 +192,7 @@ function pop_box_new(value, Width, Height){ $(document.body).append(container); $("#popupWrap").html(value); $("#popupWrap").show(); - $('#popupWrap').css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed","z-index":"99999","background-color":"#fff"}); + $('#popupWrap').css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed","z-index":"999","background-color":"#fff"}); $('#popupWrap').find("a[class*='pop_close']").click(function(){ $("#popupWrap").hide(); }); From c94e1ff0798523be4d7e59abe793f0188705d279 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 10 Oct 2017 14:50:29 +0800 Subject: [PATCH 03/30] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E5=A4=96=E5=8A=A0Issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attachments/_activity_attach.html.erb | 6 +- .../courses/_course_activity_content.html.erb | 2 +- app/views/forums/index.html.erb | 28 ++- app/views/layouts/_course_base_info.html.erb | 4 +- app/views/layouts/_logined_header.html.erb | 2 +- app/views/memos/_common_reply_box.html.erb | 2 +- app/views/memos/show.html.erb | 4 +- app/views/student_work/index.html.erb | 192 ++++++++++-------- public/stylesheets/css/edu-public.css | 9 +- public/stylesheets/css/taskstyle.css | 12 +- 10 files changed, 145 insertions(+), 116 deletions(-) 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 %> -
    +
    新建
    • 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/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/student_work/index.html.erb b/app/views/student_work/index.html.erb index 6f6e2511d..56721b607 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -111,97 +111,107 @@
-
+
+
+
+ <%= @homework.description.html_safe %> +
+
-
-
- <%= @homework.description.html_safe %> -
-
-
    - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @homework} %> -
-<% if @homework.homework_type == 3 %> -
-
-

分组要求

-
-
-

分组人数: <%= @homework.homework_detail_group.min_num %> - <%= @homework.homework_detail_group.max_num %> 人

- 注:任一成员都可以提交作品,提交作品时需要关联同组成员,组内成员作品共享。 -
-
-<% end %> - -<% if @homework.homework_type == 2 %> - <% samples = @homework.homework_samples %> - <% unless samples.empty? %> -
-
-

输入输出样例:<%= samples.count %> 组

-
-
- <% samples.each_with_index do |sample, index| %> -
-
    -
  • - - 样例<%= index + 1 %> -
  • -
  • - -
    -
    <%=sample.input.blank? ? " " : sample.input %>
    -
    -
  • -
  • - -
    -
    <%=sample.output.blank? ? " " : sample.output %>
    -
    -
  • -
-
- <% end %> -
-
+ <% if false%> +
+

+ 作业说明: + 编辑 + 保存 +

+

兴趣的信息,利用所学到的有关“协议与编码器”/解码器/转换器/处理器”的思维,为该类信息设计协议

+

+
<% end %> - <% if @is_teacher %> -
-
-

测试集:<%=@homework.homework_tests.count %> 组

-
-
- - - - - - - - - - <% @homework.homework_tests.each_with_index do |test, i| %> +
    + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @homework} %> +
+ <% if @homework.homework_type == 3 %> +
+
+

分组要求

+
+
+

分组人数: <%= @homework.homework_detail_group.min_num %> - <%= @homework.homework_detail_group.max_num %> 人

+ 注:任一成员都可以提交作品,提交作品时需要关联同组成员,组内成员作品共享。 +
+
+ <% end %> + <% if @homework.homework_type == 2 %> + <% samples = @homework.homework_samples %> + <% unless samples.empty? %> +
+
+

输入输出样例:<%= samples.count %> 组

+
+
+ <% samples.each_with_index do |sample, index| %> +
+
    +
  • + + 样例<%= index + 1 %> +
  • +
  • + +
    +
    <%=sample.input.blank? ? " " : sample.input %>
    +
    +
  • +
  • + +
    +
    <%=sample.output.blank? ? " " : sample.output %>
    +
    +
  • +
+
+ <% end %> +
+
+ <% end %> + <% if @is_teacher %> +
+
+

测试集:<%=@homework.homework_tests.count %> 组

+
+
+
序号测试集输入测试集输出
+ - - - + + + - <% end %> - -
<%=i+1 %> -
<%=test.input.blank? ? " " : test.input %>
-
-
<%=test.output.blank? ? " " : test.output %>
-
序号测试集输入测试集输出
-
-
+ + + <% @homework.homework_tests.each_with_index do |test, i| %> + + <%=i+1 %> + +
<%=test.input.blank? ? " " : test.input %>
+ + +
<%=test.output.blank? ? " " : test.output %>
+ + + <% end %> + + +
+
+ <% end %> <% end %> -<% end %> -
- <%= render :partial => 'student_work_replies' %> -
+
+ <%= render :partial => 'student_work_replies' %> +
@@ -376,5 +386,17 @@ return false; } }); + + + + //编辑、保存作业说明 + $(".edit-btn").live("click",function(){ + $(this).siblings(".save-btn").show(); + $(this).hide(); + }) + $(".save-btn").live("click",function(){ + $(this).siblings(".edit-btn").show(); + $(this).hide(); + }) }) \ No newline at end of file diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index d179b2a74..662a10e6d 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -301,9 +301,16 @@ input::-moz-placeholder,textarea::-moz-placeholder { color:#cccccc;} input::-moz-placeholder,textarea::-moz-placeholder { color:#cccccc;} input::-ms-input-placeholder,textarea::-ms-input-placeholder {color:#cccccc;} /*班级讨论区置顶的样式*/ -.btn-cir-red {background: red; color: #fff; font-weight: normal;} .btn-cir {display: inline-block;padding: 0px 5px;border-radius: 25px;line-height: 20px;font-size: 12px;} +.btn-cir:hover{background:#fff;} +.btn-cir-grey{background: #e1e1e1;color: #333;} +.btn-cir-grey:hover{background: #c3c3c3;} +.btn-cir-red{background:red;color: #fff; font-weight: normal;} +.btn-cir-red:hover{background:red;} +.btn-cir-red {background: red; color: #fff; font-weight: normal;} +.btn-cir-orange {background: #ff7500; color: #fff; font-weight: normal;} .btn-top{display: inline-block;padding: 0px 5px;line-height: 20px;font-size: 12px;border-radius: 3px;} +.btn-cir-big{ background: #999;color: #fff;display: inline-block; padding:0px 10px; border-radius:25px; line-height:25px; height: 25px; font-size:12px;} /*圆形绿色背景---------22*/ .panel-inner-icon{width: 22px;height: 22px;line-height: 22px;border-radius: 50%;background: #29bd8b;display: block;text-align: center} /*圆形绿色背景------------------18*/ diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 566f9520a..01f65ab95 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -19,14 +19,9 @@ a.leftnav-box-inner{ display: block; width:77px; border-left:3px solid #292b3a; a:hover.leftnav-box-inner,a.leftnav-active{border-left:3px solid #3498db;color: #fff!important;} a.leftnav-box-reset-inner{ display: block; width:77px; border-left:3px solid #292b3a; background:#292b3a; text-align: center; color:#575f6c;} a:hover.leftnav-box-reset-inner{border-left:3px solid #3498db;color: #fff!important;} -.btn-cir{ background:#575f6c; color:#292b3a;display: inline-block; padding:0px 5px; border-radius:25px; border-radius:15px; line-height:20px; height: 20px; font-size:12px;} -.btn-cir:hover{background:#fff;} -.btn-cir-grey{background: #e1e1e1;color: #333;} -.btn-cir-grey:hover{background: #c3c3c3;} -.btn-cir-red{background:red;color: #fff; font-weight: normal;} -.btn-cir-red:hover{background:red;} -.btn-cir-orange{ background: #ee4a1f; color: #fff;} -.btn-cir-orange:hover{ background: #ee4a1f; color: #fff;} + + + /*右侧头部*/ .rightbar-header{width: 100%; background:#282c37; height:60px; min-width:1000px;} .rightbar-score{ margin-top: 17px; font-size: 14px; margin-right:20px;} @@ -197,7 +192,6 @@ input.knowledge_frame{height:28px;line-height:28px;border:none;background:#f3f5f .-task-ces-top{ padding:5px 15px; background:#515151; color:#bfbfbf;} .-task-ces-info-left{ display: inline-block; width:100px; text-align: right; } .-position-a-r15{ position: absolute; top:5px; right:15px;} -.btn-cir-big{ background: #999;color: #fff;display: inline-block; padding:0px 10px; border-radius:25px; line-height:25px; height: 25px; font-size:12px;} .-task-ml80{ margin-left: 80px;} .page--over { position: fixed;top: 0; left:80px; right: 0; z-index:8000; height:100%; color:#fff;} .-task-list-header{ border-bottom:1px solid #eee; padding:5px 15px; color:#898989; font-size: 14px; font-weight: normal;} From 32a4903efb8b76366d619b38ce6292854c16d9c7 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 10 Oct 2017 15:19:00 +0800 Subject: [PATCH 04/30] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E9=97=AE=E7=AD=94?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_homework_reply_detail.html.erb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/_homework_reply_detail.html.erb b/app/views/student_work/_homework_reply_detail.html.erb index bc072c571..7fe4d4401 100644 --- a/app/views/student_work/_homework_reply_detail.html.erb +++ b/app/views/student_work/_homework_reply_detail.html.erb @@ -1,3 +1,5 @@ + +
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "32", :height => "32"), user_path(comment.creator_user), :target => "_blank", :alt => "用户头像" %>
@@ -7,7 +9,7 @@ autoUrl('reply_content_<%= comment.id %>'); }); -
+
<%= comment.content_detail.html_safe %> @@ -39,4 +41,5 @@
-
\ No newline at end of file +
+
\ No newline at end of file From 594a0a1d4a90b45a49d69f8484c317705d1ad807 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 11 Oct 2017 09:59:20 +0800 Subject: [PATCH 05/30] Fork --- app/views/messages/_common_reply_box.html.erb | 48 ++--- app/views/shixuns/_shixun_top.html.erb | 42 ++-- .../users/_comment_reply_detail.html.erb | 37 ++-- app/views/users/_message_contents.html.erb | 5 +- app/views/users/_message_replies.html.erb | 179 +++++++++--------- public/stylesheets/css/project.css | 6 +- public/stylesheets/css/public.css | 2 +- public/stylesheets/repository.css | 2 +- 8 files changed, 173 insertions(+), 148 deletions(-) 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..9f8ad05bb 100644 --- a/app/views/shixuns/_shixun_top.html.erb +++ b/app/views/shixuns/_shixun_top.html.erb @@ -1,10 +1,22 @@ <% update_visiti_count @shixun %>
-

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

<%= @shixun.name %>

-

+
+

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

<%= @shixun.name %>

+

+ <% if false %> +
+ forked from 胡莎莎/实现新添加一个tab + <% 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 +48,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 %>