导入作业弹框

This commit is contained in:
sw 2015-08-27 16:03:41 +08:00
parent cc76c13700
commit cb5abc6d74
7 changed files with 109 additions and 15 deletions

View File

@ -45,14 +45,15 @@ class UsersController < ApplicationController
:activity_new_score_index, :influence_new_score_index, :score_new_index,:update_score,:user_activities,:user_projects_index,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,
:user_resource,:user_resource_create,:user_resource_delete,:rename_resource,:search_user_course,:add_exist_file_to_course,
:search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project,:user_messages,:edit_brief_introduction,:user_new_homework]
:search_user_project,:resource_preview,:resource_search,:add_exist_file_to_project,:user_messages,:edit_brief_introduction,:user_new_homework,:user_import_homeworks]
#edit has been deleted by huang, 2013-9-23
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
:user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
:watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction]
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
:user_import_homeworks]
before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
@ -310,7 +311,15 @@ class UsersController < ApplicationController
respond_to do |format|
format.js
format.html {render :layout => 'new_base_user'}
end
end
#导入作业
def user_import_homeworks
@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc")
respond_to do |format|
format.js
end
end
def user_new_homework

View File

@ -0,0 +1,33 @@
<div class="cl"></div>
<div class="coursesChoosePopup">
<div>
<div class="sendText">导入作业</div>
</div>
<div >
<form class="coursesSearchBox">
<input type="text" name="serach" placeholder="输入作业名称进行搜索" class="searchCoursesPopup" />
<a href="javascript:void(0);" class="searchIconPopup"></a>
</form>
</div>
<div class="homeworkListForm mb10">
<% @user_homeworks.each do |homework|%>
<ul class="homeworkPublish">
<li class="fl">
<input name="checkMenu" type="radio" class="courseSendCheckbox"/>
</li>
<li class="sendCourseName fl hidden w450">
<%= homework.name%>
</li>
</ul>
<div class="homeworkPublishTime">
创建时间:<%= format_date homework.created_at%>
</div>
<% end%>
</div>
<div>
<div class="courseSendSubmit"><a href="javascript:void(0);" class="sendSourceText">确定</a></div>
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText">取消</a></div>
</div>
<div class="cl"></div>
</div>

View File

@ -7,7 +7,7 @@
<div class="cl"></div>
<div class=" mt10">
<a href="javascript:void(0);" class="BlueCirBtn fl mr10">导入作业</a>
<%= link_to "导入作业", user_import_homeworks_user_path(User.current.id),:class => "BlueCirBtn fl mr10",:remote => true%>
<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 || (Time.now + 3600 * 24).strftime('%Y-%m-%d')%>" >
<%= calendar_for('homework_end_time')%>

View File

@ -0,0 +1,7 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_user_homeworks') %>');
showModal('ajax-modal', '580px');
$('#ajax-modal').css('height','300px').css("width","580px");
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
"<a href='javascript:void(0)' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","20%").css("left","25%");

View File

@ -326,6 +326,7 @@ RedmineApp::Application.routes.draw do
match 'user_feedback4show', :to => 'users#user_feedback4show', :via => :get
match 'user_visitorlist', :to => 'users#user_visitorlist', :via => :get
match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
get 'user_import_homeworks'
match 'watch_projects', :to => 'users#watch_projects', :via => :get
#
# added by bai

View File

@ -7,6 +7,7 @@ table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{color:#7f7f7f;text-decoration:none;}
a:hover,a:active{color:#000;}
.pInline {margin:0px; padding:0px; display:inline-block;}
/*常用*/
/*#RSide{ background:#fff;}*/
@ -76,6 +77,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.ml100{ margin-left:100px;}
.ml110{ margin-left:110px;}
.ml150 { margin-left:150px;}
.mr-5 {margin-right:-5px;}
.mr5{ margin-right:5px;}
.mr45 {margin-right:45px;}
.mr55{ margin-right:55px;}
@ -85,11 +87,15 @@ h4{ font-size:14px; color:#3b3b3b;}
.mr30{ margin-right:30px;}
.mr40{ margin-right:40px;}
.mw20{ margin: 0 20px;}
.mt-4 {margin-top:-4px;}
.mt0 {margin-top:0px !important;}
.mt3{ margin-top:3px;}
.mt5{ margin-top:5px;}
.mt8{ margin-top:8px;}
.mt10{ margin-top:10px !important;}
.mt12 { margin-top:12px;}
.mt15 {margin-top:15px;}
.mt19 {margin-top:19px !important;}
.mb4{ margin-bottom:4px;}
.mb5{ margin-bottom:5px;}
.mb8 {margin-bottom:8px;}
@ -97,12 +103,14 @@ h4{ font-size:14px; color:#3b3b3b;}
.mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;}
.w20{ width:20px;}
.w50 {width:50px;}
.w60{ width:60px;}
.w70{ width:70px;}
.w90{ width:90px;}
.w210{ width:210px;}
.w150{ width:150px;}
.w280{ width:280px;}
.w350 {width:350px;}
.w430{ width:470px;}
.w520{ width:520px;}
.w543{ width:543px;}
@ -116,6 +124,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.h50{ height:50px;}
.h70{ height:70px;}
.h150{ height:150px;}
.p10 {padding-left:10px; padding-right:10px;}
/* Font & background Color */
a.b_grey{ background: #F5F5F5;}
@ -158,6 +167,14 @@ a.c_green{ color:#28be6c;}
.b_green{background:#28be6c;}
.b_w{ background:#fff;}
/*add by Tim*/
a.linkBlue {color:#269ac9;}
a.linkBlue:hover {color:#297fb8;}
a.buttonBlue {background-color:#269ac9;}
a.buttonBlue:hover {background-color:#297fb8;}
a.linkGrey {color:#484848;}
a.linkGrey:hover {color:#269ac9;}
/* commonBtn */
.grey_btn{ background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;}
a.grey_btn{ background:#d9d9d9; color:#656565; font-weight:normal; text-align:center;padding:2px 10px;}
@ -272,7 +289,7 @@ li.menuArrow:hover {background:url(../images/item.png) -20px -70px no-repeat;}
a.topnav_login_box:hover {color:#a1ebff;}
.navRow1 {margin:0; padding:0;}
.navRow2 {margin:0; padding:0;}
.topnav_login_list{ border:1px solid #15bccf; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2;}
.topnav_login_list{ border:1px solid #269ac9; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2;}
.topnav_login_list a{color:#15bccf;}
.topnav_login_list li{ }
@ -473,7 +490,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
.homepageRight {width:750px; float:left; margin-top:15px; margin-bottom:10px;}
.homepagePortraitContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top:15px; padding-bottom:15px;}
.homepagePortraitImage {width:206px; height:206px; padding:2px; margin:15px 14px 10px 14px; position:relative; border:1px solid #cbcbcb;}
.homepagePortraitImage:hover {border:1px solid #15bccf;}
.homepagePortraitImage:hover {border:1px solid #297fb8;}
.homepageFollow {background:url(../images/homepage_icon.png) -10px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;}
.homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;}
.homepageEditProfile {width:20px; height:20px; border-radius:2px; background-color:#888888; position:absolute; right:9px; bottom:9px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;}
@ -510,7 +527,7 @@ a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;}
.homepageNewsPortrait {width:40px; display:block; margin-top:7px;}
.homepageNewsPublisher {width:80px; max-width:80px; margin-right:10px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;}
.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;height:49px; max-height:49px; }
.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; }
.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;}
a.homepageWhite {color:#ffffff;}
a.homepageWhite:hover {color:#a1ebff}
@ -536,8 +553,9 @@ a.homepagePostTypeNotice {background:url(../images/homepage_icon.png) -87px -280
a.homepagePostTypeForum {background:url(../images/homepage_icon.png) -10px -310px no-repeat; padding-left:23px;}
a.homepagePostTypeQuiz {background:url(../images/homepage_icon.png) -90px -124px no-repeat; padding-left:23px;}
a.homepagePostTypeQuestion {background:url(../images/homepage_icon.png) -10px -273px no-repeat; padding-left:23px;}
a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -10px -360px no-repeat; padding-left:23px;}
a.postTypeGrey {color:#888888;}
a.postTypeGrey:hover {color:#15bccf;}
a.postTypeGrey:hover {color:#269ac9;}
.homepagePostBrief {width:710px; margin:20px auto 0px auto; position:relative;}
.homepagePostPortrait {float:left; width:90px;}
.homepagePostDes {float:left; width:600px; margin-left:20px;}
@ -595,9 +613,9 @@ a:hover.gz_btn{ color:#ff5722;}
#signUpBox {display:none; margin-top:79px;}
#loginSignButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;}
#loginInButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;}
#loginSignButton:hover {background-color:#0ea6b7;}
#loginInButton:hover {background-color:#0ea6b7;}
.loginContentContainer {width:100%; background-color:#15bccf; margin-top:1px; height:580px;}
#loginSignButton:hover {background-color:#297fb8;}
#loginInButton:hover {background-color:#297fb8;}
.loginContentContainer {width:100%; background-color:#269ac9; margin-top:1px; height:580px;}
.loginContent {width:1000px; margin:0px auto;}
.loginLeft {width:595px; float:left;}
.loginLogo {padding-left:208px; padding-top:155px;}
@ -605,17 +623,19 @@ a:hover.gz_btn{ color:#ff5722;}
.loginRight {width:405px; float:left;}
.loginChooseBox {width:405px; height:54px; background-color:#ffffff; padding-top:18px;}
.loginChooseList {width:350px; height:30px; font-size:14px; margin:0px auto;}
.loginChoose {width:55px; height:30px; border-bottom:1px solid #8ad2da; text-align:center;}
.loginChoose {width:55px; height:30px; border-bottom:1px solid #269ac9; text-align:center; font-weight:bold;}
a.loginChooseTab {color:#484848; height:30px; display:block;}
.loginInButton {width:315px; height:40px; background-color:#15bccf; margin-left:46px; font-size:14px; text-align:center; line-height:40px; vertical-align:middle; margin-top:20px;}
.loginUpButton {width:315px; height:40px; background-color:#15bccf; margin-left:46px; font-size:14px; text-align:center; line-height:40px; vertical-align:middle; margin-top:30px;}
.loginInButton {width:315px; height:40px; background-color:#269ac9; margin-left:46px; font-size:14px; text-align:center; line-height:40px; vertical-align:middle; margin-top:20px;}
.loginInButton:hover {background-color:#297fb8;}
.loginUpButton {width:315px; height:40px; background-color:#269ac9; margin-left:46px; font-size:14px; text-align:center; line-height:40px; vertical-align:middle; margin-top:30px;}
.loginUpButton:hover {background-color:#297fb8;}
.loginChooseBorder {width:295px; height:30px; border-bottom:1px solid #e3e3e3;}
.loginChoose:hover {border-bottom:1px solid #8ad2da;}
.loginSign {width:405px; background-color:#ffffff;}
.loginSignBox {width:308px; height:38px; margin-left:46px; border:1px solid #98a1a6; outline:none;}
.loginSignOption {margin-left:46px; margin-top:15px;}
.loginIn {width:405px; background-color:#ffffff; padding-bottom:30px;}
.loginSignAlert {font-size:12px; margin-left:60px;}
.loginSignAlert {font-size:12px; color:#fc0000; margin-left:60px;}
.loginSignRow {height:60px; min-height:60px;}
/*关注列表*/
@ -631,6 +651,30 @@ ul.list_watch{
.feedBack {width:728px; background-color:#ffffff; padding:10px; border:1px solid #dddddd;float: right}
/*课程选择弹窗*/
.coursesChoosePopup {width:530px; height:auto; padding-left:20px; padding-bottom:35px; background-color:#ffffff;}
.coursesSearchBox {border:1px solid #e6e6e6; width:515px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
.searchCoursesPopup {border:none; outline:none; background-color:#ffffff; width:470px; height:25px; padding-left:10px; display:inline-block; float:left;}
.searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -273px no-repeat; display:inline-block; float:left;}
.searchIconPopup:hover {background:url(../images/homepage_icon.png) -180px -314px no-repeat;}
/*导入作业弹窗*/
.homeworkPublish {width:500px; height:15px; line-height:15px;}
.homeworkPublishTime {font-size:12px; color:#b1b1b1; margin-left:22px; margin-bottom:8px;}
.homeworkListForm{min-height: 160px;width: 550px;overflow: scroll;overflow-x: hidden;}
.w450{width: 450px;}
/*引用资源库弹窗*/
.referenceResourcesPopup {width:710px; height:auto; border:3px solid #269ac9; padding-left:20px; padding-right:20px; padding-bottom:35px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;}
.referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;}
.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
.searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;}
.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -170px -135px no-repeat; display:inline-block; float:left;}
.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -170px -190px no-repeat;}
.referenceResourceType {font-size:14px; width:355px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;}
.referenceTypeActive {background-color:#269ac9; color:#ffffff !important;}
a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}
/*20150826忘记密码 LB*/
.BgBox{ width:968px; border:1px solid #dddddd; background:#fff; padding:15px; padding-top:10px;margin: 20px auto}

View File

@ -442,7 +442,7 @@ color: #000000;
{
width:auto;
/*float:center;*/
min-height:800px;
/*min-height:800px;*/
}
/*by huang*/