将原有的新建参赛作品时弹出新页面变为了本页弹出下拉框

This commit is contained in:
wanglinchun 2014-05-09 22:13:54 +08:00
parent bc07f4c9e5
commit 7d33bb9b2d
2 changed files with 11 additions and 6 deletions

View File

@ -562,9 +562,9 @@ class ContestsController < ApplicationController
@contest = Contest.find(params[:id]) @contest = Contest.find(params[:id])
@user = @contest.author @user = @contest.author
end end
rescue rescue
render_404 render_404
end end
end end

View File

@ -53,6 +53,11 @@
function cancel() { function cancel() {
$("#put-bid-form").hide(); $("#put-bid-form").hide();
} }
function cancel() {
$("#put-project-form").hide();
}
</script> </script>
<!--参赛步骤--> <!--参赛步骤-->
@ -67,9 +72,9 @@
</div> </div>
<div style="padding-left: 82px; "> <div style="padding-left: 82px; ">
<span style="padding-top: 50px">步骤1</span> <span style="padding-top: 50px">步骤1</span>
<span><%= link_to '新建参赛作品', new_softapplication_path(:target=>'_blank'), :target=>'_blank' %></span> <span><%#= link_to '新建参赛作品', new_softapplication_path(:target=>'_blank'), :target=>'_blank' %></span>
<span><%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span> <span><%= link_to '新建参赛作品', "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %></span>
<span style="font-size: 12px; color: grey">(先点击“新建参赛作品”, 然后返回本页继续步骤2即可。)</span> <span style="font-size: 12px; color: grey">(先点击“新建参赛作品”,然后刷新页面再继续步骤2。)</span>
</div> </div>
<div style="padding-left: 82px; "> <div style="padding-left: 82px; ">
<span style="padding-top: 50px">步骤2</span> <span style="padding-top: 50px">步骤2</span>
@ -79,7 +84,7 @@
<!--点击新建参赛作品弹出框--> <!--点击新建参赛作品弹出框-->
<div id="put-project-form" style="display: none; padding-left: 83px; width: 70%"> <div id="put-project-form" style="display: none; padding-left: 83px; width: 70%">
<%= form_for "project_for_save", :remote=>true, :url => {:controller => 'softapplications', :action => 'new'}, :complete => '$("#put-bid-form").hide();' do |f| %> <%= form_for Softapplication.new, :remote=>true, :url => softapplications_path, :complete => '$("#put-bid-form").hide();' do |f| %>
<fieldset class="contes-new-box", style="padding-left: 36px"> <fieldset class="contes-new-box", style="padding-left: 36px">
<tr style="width:700px; margin-left: -10px"> <tr style="width:700px; margin-left: -10px">
@ -142,7 +147,7 @@
</fieldset> </fieldset>
</fieldset></br> </fieldset></br>
<div class="align-center", style="padding-top: -3px; padding-bottom: 8px"> <div class="align-center", style="padding-top: -3px; padding-bottom: 8px">
<%= submit_tag l(:button_create), :onclick => "return true" %> <%= submit_tag l(:button_create), :onclick => "cancel();" %>
</div> </div>
<% end %> <% end %>
</div> </div>