This commit is contained in:
cxt 2015-09-30 09:58:41 +08:00
commit f25baeca2d
7 changed files with 18 additions and 12 deletions

View File

@ -358,6 +358,7 @@ class UsersController < ApplicationController
#导入作业
def user_import_homeworks
@select_course = params[:select_course] ? 1 : 0
@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
respond_to do |format|
format.js
@ -377,6 +378,7 @@ class UsersController < ApplicationController
homework = HomeworkCommon.find_by_id params[:checkMenu]
homework_detail_programing = homework.homework_detail_programing
@homework = HomeworkCommon.new
@select_course = params[:select_course] || 0
if homework
@homework.name = homework.name
@homework.description = homework.description

View File

@ -158,11 +158,11 @@
</div>
<div class="cl"></div>
<div class="fontGrey2 mt10"><span id="forum_desc_span" style="word-break:normal; width:auto; display:block; white-space:pre-wrap;word-wrap : break-word ;overflow: hidden ;"><%= @forum.description.html_safe%></span>
<%#if @forum.creator.id == User.current.id%>
<!--<a href="javascript:void(0);" onclick="edit_desc();">-->
<%#= image_tag('signature_edit.png',{:width=>12,:height=>12})%>
<!--</a>-->
<%#end%>
<%if @forum.creator.id == User.current.id%>
<a href="javascript:void(0);" onclick="edit_desc();">
<%= image_tag('signature_edit.png',{:width=>12,:height=>12})%>
</a>
<%end%>
</div>
<div class="mt15">
<div id="forum_tag_list">

View File

@ -10,6 +10,7 @@
<% end%>
</div>
<%= form_tag(user_select_homework_users_path, :multipart => true,:remote => true,:name=>"select_homework_form",:id=>'select_homework_form') do %>
<input type="hidden" name="select_course" value="<%= @select_course%>">
<div class="homeworkListForm mb10 " id="homework_list_form_show">
<%= render :partial => 'users/show_user_homework_form', :locals => {:user_homeworks => @user_homeworks}%>
</div>

View File

@ -16,7 +16,7 @@
<div class="cl"></div>
<div class=" mt10">
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
<%= link_to("导入作业", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true) unless edit_mode%>
<div class="calendar_div fl">
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
<%= calendar_for('homework_end_time')%>

View File

@ -2,7 +2,9 @@
hideModal('#coursesChoosePopup');
$("#homework_name").val("<%= @homework.name%>");
$("#homework_end_time").val("<%= @homework.end_time%>");
$("#course_id").val("<%= @homework.course_id%>");
<% if @select_course == "0"%>
$("#course_id").val("<%= @homework.course_id%>");
<% end%>
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true })%>");
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
$("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>");

View File

@ -314,7 +314,7 @@ a.un_work_edit{color: white; display:block; padding:1px 5px; background-color: d
.normaltab a { color:#64bdd9 ; }
.hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;}
.dis{display:block; }
.undis{display:none;}
.c_red{ color:#de030d;}
input.c_red {padding:0px; text-align:center; border:0;}
.f_12{ font-size:12px;}
@ -512,9 +512,7 @@ a:hover.st_add{ color:#ff8e15;}
.courses_text{ border:1px solid #64bdd9; height:100px;width:532px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
.upimg{ border:1px solid #eaeaea; display:block; width:60px; height:60px; padding:1px;}
.upimg:hover{ border:1px solid #64bdd9; }
.upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;}
.upbtn:hover{color:#64bdd9;cursor: pointer;}
.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
/* 功能倒计时*/
.w_img{ float:left; margin:10px 10px 15px 0px;}
.w_p{ float:left; color:#15bccf; font-size:16px; font-weight:bold; margin-top:70px; }

View File

@ -269,7 +269,10 @@ a:hover.bgreen_n_btn{background:#08a384;}
.nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;}
.more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;}
/*.upbtn{ margin:42px 0 0 10px; border:none; color:#999; }*/
.upbtn{ margin:40px 0 0 15px; display:block; padding:2px 5px; border:1px solid #eaeaea;}
.upbtn:hover{color:#64bdd9;cursor: pointer;}
.upload_file{margin-left: -60px;margin-top: 40px;width: 50px;position: absolute;height: 24px;opacity: 0;cursor: pointer}
.undis{display:none;}
.red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;}
.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;}
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;}