老师布置作业界面

This commit is contained in:
sw 2015-08-26 13:56:37 +08:00
parent 757da1ec0a
commit ccfa93be66
6 changed files with 148 additions and 57 deletions

View File

@ -0,0 +1,65 @@
<div class="fl">
<span id="attachments_fields" class="attachments_fields">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% container.saved_attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
<%= link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<% end %>
<% end %>
</span>
<% project = project %>
<span class="add_attachment" style="font-weight:normal;">
<%= button_tag l(:button_browse), :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()',:class => 'sub_btn', :style => ie8? ? 'display:none' : '' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => ie8? ? '' : 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => ie8? ? '' : 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js',:project =>project),
:description_placeholder => l(:label_optional_description),
:field_is_public => l(:field_is_public),
:are_you_sure => l(:text_are_you_sure),
:file_count => l(:label_file_count),
:delete_all_files => l(:text_are_you_sure_all)
} %>
<span id="upload_file_count">
<%= l(:label_no_file_uploaded)%>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>
</div>
<textarea class="InputBox fl W120 " placeholder="截止日期"></textarea>
<a href="javascript:void(0);" class="fl mr10">
<img src="../images/Calendar.png" width="16" height="15" class="calendarContainer calendar1" />
</a>
<a href="javascript:void(0);" class="fl mr10">
<img src="../images/Calendar_hover.png" width="16" height="15" class="calendarContainer calendar1Active" />
</a>

View File

@ -0,0 +1,56 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<div class="HomeWorkCon">
<div class="mt15">
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox W700" maxlength="255" onkeyup="regex_homework_name();" placeholder="请输入作业标题" value="<%= homework.name%>" >
</div>
<div class="cl"></div>
<div class=" mt10">
<a href="javascript:void(0);" class="BlueCirBtn fl mr10">导入作业</a>
<input type="text" name="homework_common[end_time]" id="homework_end_time" placeholder="截止日期" class="InputBox fl W120" readonly="readonly" value="<%= homework.end_time%>" >
<%= calendar_for('homework_end_time')%>
<!--<div class="fl DateBorder mr10">-->
<!--<a href="javascript:void(0);" class="pic_date "></a>-->
<!--</div>-->
<!--<textarea class="InputBox fl W120 " placeholder="发布日期"></textarea>-->
<!--<div class="fl DateBorder" >-->
<!--<a href="javascript:void(0);" class="pic_date "></a>-->
<!--</div>-->
</div>
<div class="cl"></div>
<div class="mt10">
<% if edit_mode %>
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:height => "150px",:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
<% else %>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:height => "150px" %>
<% end %>
</div>
<div class="cl"></div>
<div class="mt10">
<input type="text" class="InputBox W700 SearchIcon" placeholder="发送到课程" />
</div>
<div class="cl"></div>
<div class="mt10">
<%= render :partial => 'attachments/new_form', :locals => {:container => homework} %>
</div>
<div class="cl"></div>
<div class="mt5">
<a href="javascript:void(0);" class="AnnexBtn fl mt3">上传附件</a>
<a href="javascript:void(0);" class="FilesBtn fl mr15 mt3">资源库</a>
<a href="javascript:void(0);" class="BlueCirBtnMini fr">发送</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" class=" fr mr10 mt3">取消</a>
</div>
<div class="cl"></div>
<!--<div class="mt10">-->
<!--<a href="javascript:void(0);" class=" fl DropBtn">高级功能</a>-->
<!--<div class="DropLine" ></div>-->
<!--<div class="cl"></div>-->
<!--</div>-->
</div>
<div class="cl"></div>

View File

@ -19,54 +19,10 @@
<div class="RightBanner">
<div class="NewsBannerName">发布作业</div>
</div>
<div class="HomeWorkCon">
<div class="mt15">
<textarea class="InputBox W700 " placeholder="请输入作业标题"></textarea>
</div>
<div class=" mt10">
<a href="javascript:void(0);" class="BlueCirBtn fl mr10">导入作业</a>
<textarea class="InputBox fl W120 " placeholder="截止日期"></textarea>
<div class="fl DateBorder mr10">
<a href="javascript:void(0);" class="pic_date "></a>
</div>
<textarea class="InputBox fl W120 " placeholder="发布日期"></textarea>
<div class="fl DateBorder" >
<a href="javascript:void(0);" class="pic_date "></a>
</div>
<div class="cl"></div>
</div>
<div class="mt10">
<textarea class="InputBox W700" placeholder="请输入作业描述"></textarea>
</div>
<div class="mt10">
<textarea class="InputBox W700 SearchIcon" placeholder="发送到课程"></textarea>
</div>
<div class="mt10">
<span class="pic_img fl "></span>
<a href="javascript:void(0);" class=" fl FilesName02">
附件名称附件名称附件名称附件名称附件附件名称件名称附件名称附件附件名称附件名称件名称附件名称附件附件名称附件名称件名称附件名称附件附件名称附件名称件名称附件名称附件附件名称附件名称附件附件名称附件名附件名称附件附件名称.png123KB
</a>
<span class="pic_del fl "></span>
<div class="cl"></div>
<span class="pic_files fl "></span>
<a href="javascript:void(0);" class=" fl FilesName02">附件名称.zip123KB</a>
<span class="pic_del fl "></span>
<div class="cl"></div>
</div>
<div class="mt5">
<a href="javascript:void(0);" class="AnnexBtn fl mt3">上传附件</a>
<a href="javascript:void(0);" class="FilesBtn fl mr15 mt3">资源库</a>
<a href="javascript:void(0);" class="BlueCirBtnMini fr">发送</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" class=" fr mr10 mt3">取消</a>
<div class="cl"></div>
</div>
<div class="mt10">
<a href="javascript:void(0);" class=" fl DropBtn">高级功能</a>
<div class="DropLine" ></div>
<div class="cl"></div>
</div>
</div>
<% homework = HomeworkCommon.new %>
<%= labelled_form_for homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
<%= render :partial => 'users/user_homework_form', :locals => { :homework => homework,:f => f,:edit_mode => false } %>
<% end%>
</div><!----HomeWork end-->
<% end%>

View File

@ -11,6 +11,9 @@ $(function(){
$("#edit_user_file_btn").hide();
$("#watch_user_btn").hide();
});
//日历选择样式
//$(".ui-datepicker-trigger").replaceWith("<div class='fl DateBorder mr10'><img class='ui-datepicker-trigger'></div>")
});
//编辑个人简介

View File

@ -834,6 +834,17 @@ a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflo
.ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; }
.DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;}
/*日历选择图*/
img.ui-datepicker-trigger {
display:block;
background:url(../images/public_icon.png) -31px 0 no-repeat;
cursor: pointer;
vertical-align: middle;
width:16px;
height:15px;
float:left;
}

View File

@ -135,16 +135,16 @@ a:hover.c_lgrey{ color:#3ca5c6;}
.users_r_h2{background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;}
a.hidepic>img{display:none;}
/*a.hidepic>img{display:none;}*/
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )}
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
.cr{clear: right;}
/*div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}*/
/*span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}*/
/*span.ke-toolbar-icon-url{background-image:url( ../images/public_icon.png )}*/
/*div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}*/
/*span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}*/
/*span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}*/
/*div.ke-toolbar .ke-outline{border:none;}*/
/*.cr{clear: right;}*/
div.content{padding-top:10px;}
.pcontent>.school_list,.content>.school_list { padding-left: 5px;}