项目 主页 资源上传 不要翻页,直接弹出资源弹出框

This commit is contained in:
lizanle 2015-11-02 15:21:53 +08:00
parent b762a639ea
commit 4c174781b1
4 changed files with 16 additions and 5 deletions

View File

@ -8,9 +8,9 @@
<%= form_tag(project_files_path(project), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %> <%= form_tag(project_files_path(project), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> --> <!-- <label style="margin-top:3px;"><#%= l(:label_file_upload)%></label> -->
<%= render :partial => 'attachement_list',:locals => {:project => project} %> <%= render :partial => 'files/attachement_list',:locals => {:project => project} %>
<div class="cl"></div> <div class="cl"></div>
<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%= l(:button_cancel)%></a> <a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="hideModal();"><%= l(:button_cancel)%></a>
<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a> <a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%= l(:button_confirm)%></a>
<% end %> <% end %>
</div> </div>

View File

@ -22,7 +22,7 @@ $("#attachments_fields").children().remove();
$("#upload_file_count").text("未上传文件"); $("#upload_file_count").text("未上传文件");
$('#upload_file_div').slideToggle('slow'); $('#upload_file_div').slideToggle('slow');
<% if @project %> <% if @project %>
closeModal(); hideModal();
$("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>'); $("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>');
$("#project_files_count_info").html("<%= @all_attachments.count%>"); $("#project_files_count_info").html("<%= @all_attachments.count%>");
$("#project_files_count_nav").html("(<%= @all_attachments.count%>)") $("#project_files_count_nav").html("(<%= @all_attachments.count%>)")

View File

@ -13,7 +13,7 @@
<%= javascript_heads %> <%= javascript_heads %>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %> <%= stylesheet_link_tag 'public', 'pleft', 'project','prettify','jquery/jquery-ui-1.9.2','header','repository' %>
<%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move' %> <%= javascript_include_tag 'cookie','project', 'header','prettify','select_list_move','attachments' %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags --> <!-- page specific tags -->
<%= yield :header_tags -%> <%= yield :header_tags -%>
@ -223,6 +223,16 @@
} }
); );
} }
function project_files_upload()
{
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'files/upload_show_project',:locals => {:project => @project}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal()' style='margin-left: 480px;'><img src='/images/bid/close.png' width='26px' height='26px' /></a>");
$('#ajax-modal').parent().css("top","40%").css("left","36%");
$('#ajax-modal').parent().addClass("popbox_polls");
}
</script> </script>
</div> </div>
<div id="fade" class="black_overlay">123</div> <div id="fade" class="black_overlay">123</div>

View File

@ -34,7 +34,8 @@
<%= link_to "(#{attaments_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %> <%= link_to "(#{attaments_num})", project_files_path(@project), :class => "subnav_num c_orange",:id=>'project_files_count_nav' %>
<% end %> <% end %>
<% if User.current.member_of?(@project) %> <% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %> <%#= link_to "+"+l(:label_upload_source), project_files_path(@project,:flag => true), :class => "subnav_green ml95" %>
<a class="subnav_green m195" href="javascript:void(0);" onclick="project_files_upload();">+上传资源</a>
<% end %> <% end %>
</div> </div>
<% end %> <% end %>