parent
89b9a5c09d
commit
421f86cdaf
@ -0,0 +1,30 @@
|
||||
|
||||
|
||||
<!--<button name="button" class="sub_btn" onclick="_file.click()" onmouseover="this.focus()" style="<%#= ie8? ? 'display:none' : ''%>" type="button" ><%#= l(:label_browse) %></button>-->
|
||||
<a href="javascript:void(0);" class="uploadIcon f14" name="button" onclick="_file.click()" onmouseover="" style="<%= ie8? ? 'display:none' : ''%>">
|
||||
<span class="chooseFile">选择文件</span></a>
|
||||
<%= 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'),
|
||||
: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)
|
||||
} %>
|
||||
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
|
||||
|
||||
<!--<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) %>
|
||||
<!--)-->
|
@ -0,0 +1,43 @@
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
var popupHeight = $(".resourceUploadPopup").outerHeight(true);
|
||||
$(".resourceUploadPopup").css("marginTop",-popupHeight/2);
|
||||
|
||||
|
||||
$(".resourcePopupClose").click(function(){
|
||||
$(".resourceUploadPopup").css("display","none");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div class="resourceUploadPopup"><span class="uploadText">上传资源 </span>
|
||||
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose"></a></div>
|
||||
<div class="uploadBoxContainer">
|
||||
<div class="uploadBox"><a href="javascript:void(0);" class="uploadIcon f14"><span class="chooseFile">选择文件</span></a></div>
|
||||
<div class="uploadResourceIntr">
|
||||
<div class="uploadResourceName">(未选择文件)</div>
|
||||
<div class="uploadResourceIntr2">您可以上传小于<span class="c_red">50MB</span>的文件</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<select class="uploadType">
|
||||
<option value="">资源类型</option>
|
||||
<option value="课件资源">课件资源</option>
|
||||
<option value=“"项目资源">项目资源</option>
|
||||
<option value="附件">附件</option>
|
||||
<option value="无">无</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<input type="text" name="" placeholder="关键词" class="uploadKeyword" />
|
||||
</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>
|
||||
|
@ -0,0 +1,17 @@
|
||||
<% if attachments.nil? || attachments.empty? %>
|
||||
<% else %>
|
||||
<% attachments.each do |attach| %>
|
||||
<ul>
|
||||
<li class="resourcesListName fl">
|
||||
<!--<a href="javascript:void(0);" class="resourcesBlack"><%#=truncate(attach.filename,:length=>18)%></a>-->
|
||||
<%= link_to truncate(attach.filename,:length=>18), download_named_attachment_path(attach.id, attach.filename),
|
||||
:title => attach.filename+"\n"+attach.description.to_s,:class=>'resourcesBlack'%>
|
||||
</li>
|
||||
<li class="resourcesListSize fl"><%= number_to_human_size(attach.filesize) %></li>
|
||||
<li class="resourcesListType fl"><%= get_resource_type(attach.container_type)%></li>
|
||||
<li class="resourcesListUploader fl"><%=User.find(attach.author_id).realname %></li>
|
||||
<li class="resourcesListTime fl"><%= format_date(attach.created_on) %></li>
|
||||
<li style="display: none"><%= attach.id %></li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
@ -0,0 +1,53 @@
|
||||
<div class="resourceUploadPopup"><span class="uploadDialogText">上传资源 </span>
|
||||
<div class="resourcePopupClose"> <a href="javascript:void(0);" class="resourceClose" onclick="closeModal();"></a></div>
|
||||
<div class="uploadBoxContainer">
|
||||
<%= form_tag(user_resource_create_user_path, :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
|
||||
<div>
|
||||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<script>alert('<% container%>')</script>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>" class="attachment">
|
||||
<%= 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 => 'remove-upload')%>
|
||||
<%= if attachment.id.nil?
|
||||
#待补充代码
|
||||
else
|
||||
link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload')
|
||||
end
|
||||
%>
|
||||
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
|
||||
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
</div>
|
||||
<div class="uploadBox">
|
||||
|
||||
<input type="hidden" name="attachment_type" value="1">
|
||||
<%= render :partial => 'attachment_list' %>
|
||||
<div class="cl"></div>
|
||||
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
|
||||
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
|
||||
|
||||
</div>
|
||||
<div class="uploadResourceIntr">
|
||||
<div class="uploadResourceName"><span id="upload_file_count">(未选择文件)</span></div>
|
||||
<div class="uploadResourceIntr2">您可以上传小于<span class="c_red">50MB</span>的文件</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div style="margin-top: 10px" >
|
||||
<div class="courseSendSubmit">
|
||||
<!--<a href="javascript:void(0);" class="sendSourceText" onclick="">确定</a>-->
|
||||
<%= submit_tag '确定',:onclick=>'submit_files();',:onfocus=>'this.blur()',:class=>'sendSourceText' %>
|
||||
</div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="closeModal();">取消</a></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
@ -0,0 +1 @@
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
@ -0,0 +1 @@
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
@ -0,0 +1,3 @@
|
||||
|
||||
closeModal();
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
@ -0,0 +1 @@
|
||||
$("#resources_list").html('<%= escape_javascript( render :partial => 'resources_list' ,:locals=>{ :attachments => @attachments})%>');
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
Loading…
Reference in new issue