socialforge/app/views/files/_attachment_history_popub.h...

67 lines
3.0 KiB
Plaintext

<table class="muban_table mb15" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>资源名称</th>
<th >下载数</th>
<th>引用数</th>
<th>版本号</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<th ><p class="popup_ziyuan_title fl"><%= @attachment.filename %></p><span class="muban_icons_blue ml5 fl mt12">当前版本</span></th>
<th><%= @attachment.downloads %></th>
<th><%= @attachment.try(:quotes).to_i %></th>
<th><%= format_time(@attachment.created_on) %></th>
<!--<th></th>-->
</tr>
<% @attachment_histories.each do |history| %>
<tr>
<th ><p class="popup_ziyuan_title">
<%= link_to history.filename, download_history_attachment_path(history.id, history.filename), :title => history.filename+"\n"+history.description.to_s %></p>
</th>
<th><%= history.downloads %></th>
<th><%= history.try(:quotes).to_i %></th>
<th><%= format_time(history.created_on) %></th>
<!--<th>-->
<%#= link_to( '删除资源', attachment_path(history.attachment, :history_id => history, :type => "history"),
# :remote => true,
# :data => {:confirm => l(:text_are_you_sure)},
# :method => :delete,
# :class => "postOptionLink",
:class => "btn") if allow_to_delete_attachment(history) %>
<!--</th>-->
</tr>
<% end %>
</tbody>
</table>
<%= form_tag(upload_attachment_version_path, :multipart => true,:remote => !ie8?,:name=>"upload_form",:id=>'upload_form') do %>
<%= hidden_field_tag :old_attachment_id,@attachment.id %>
<div>
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
</span>
</div>
<div class="clear mb10">
<input type="hidden" name="attachment_type" value="1">
<%= render :partial => 'attachments/upload_attachment_new_version' %>
<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="cl"></div>
<textarea style="resize:none" type="text" placeholder="请在此编辑资源描述" name="description" class="mr15 mb10 muban_textarea" ><%= @attachment.description %></textarea>
<div class="clear mb15">
<a href="javascript:void(0);" id="upload_files_cancle_btn" class="btn fr" onclick="attachment_fresh_for_destroy()">取消</a>
<%#= submit_tag '确定', :onclick => 'upload_attachment_version(event);', :onfocus => 'this.blur()', :id => 'upload_files_submit_btn', :class => 'btn btn-blue fr mr5' %>
<a href="javascript:void(0);" onclick = "upload_attachment_version(event);" onfocus = 'this.blur()' id = 'upload_files_submit_btn' class = 'btn btn-blue fr mr5' >确定</a>
</div>
<% end %>
<script>
function attachment_fresh_for_destroy(){
hideModal();
$(".re_search").submit();
}
</script>