diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b6cd47924..dbc39f950 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -823,8 +823,11 @@ module ApplicationHelper
def select_option_helper option
tmp = Hash.new
tmp={"" => ""}
- option.each do |project|
- tmp[project.name] = project.id
+ if option.nil?
+ else
+ option.each do |project|
+ tmp[project.name] = project.id
+ end
end
tmp
end
@@ -1168,25 +1171,27 @@ module ApplicationHelper
objects = objects.first
end
# end
- objects = objects.map {|o| o.is_a?(String) ? instance_variable_get("@#{o}") : o}.compact
- errors = objects.map {|o| o.errors.full_messages}.flatten
- if errors.any?
- html << "
\n"
- errors.each do |error|
+ if objects != nil
+ objects = objects.map {|o| o.is_a?(String) ? instance_variable_get("@#{o}") : o}.compact
+ errors = objects.map {|o| o.errors.full_messages}.flatten
+ if errors.any?
+ html << "\n"
+ errors.each do |error|
+ ###by xianbo
+ if(error!=l(:label_repository_path_not_null))
+ html << "#{h error} \n"
+ end
+ ###xianbo
+ end
###by xianbo
- if(error!=l(:label_repository_path_not_null))
- html << "#{h error} \n"
+ unless params[:repository].nil?
+ if params[:repository][:upassword]==""
+ html << ""+ l(:label_password_not_null) +" \n"
+ end
end
###xianbo
+ html << " \n"
end
- ###by xianbo
- unless params[:repository].nil?
- if params[:repository][:upassword]==""
- html << ""+ l(:label_password_not_null) +" \n"
- end
- end
- ###xianbo
- html << " \n"
end
html.html_safe
end
diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb
new file mode 100644
index 000000000..830bcd314
--- /dev/null
+++ b/app/views/contests/_new_softapplication.html.erb
@@ -0,0 +1,96 @@
+<%#= error_messages_for 'softapplication' %>
+<%= form_for Softapplication.new, :url => softapplications_path do |f| %>
+
+ <%= hidden_field_tag 'contest_id', @contest.id %>
+
+ <%= l(:label_work_name) %>
+ * :
+ <%= f.text_field :name, :required => true, :size => 60, :style => "width:350px;" %>
+
+
+
+
+
+
+
+ <%= l(:label_running_platform) %>
+ * :
+ <%= f.text_field :android_min_version_available, :required => true, :size => 60, :style => "width:350px;" %>
+
+
+
+
+
+
+
+ <%= l(:label_work_type) %>
+ * :
+
+
+ <%#= select_tag 'app_type_name', work_type_opttion, {:name => 'app_type_name',:style => "width:358px;"} %>
+
+ <%= f.select :app_type_name,work_type_opttion, {},{:style => "width:358px;",:onchange => "selectChange(this)"} %>
+ <%#= f.text_field :app_type_name, :required => true, :size => 60, :style => "width:400px;" %>
+
+
+ <%#= f.text_field :other_input, :required => true, :size => 60, :style => "width:100px;" %>
+
+
+
+
+
+
+
+
+ <%= l(:label_work_description) %>
+ * :
+ <%= f.text_field :description, :required => true, :size => 60, :style => "width:350px;" %>
+
+
+
+
+
+
+
+ <%= l(:label_softapplication_developers) %>
+ * :
+ <%= f.text_field :application_developers, :required => true, :size => 60, :style => "width:350px;" %>
+
+
+
+
+
+
+
+ <%= l(:label_work_deposit_project) %>:
+ <%= select_tag 'project', options_for_select(select_option_helper(@option)), :name => 'project', :class => 'grayline2',:style => "width:358px;" %>
+ <%= link_to l(:label_create_new_projects),{:controller => 'projects',:action => 'new',course: 0, project_type: 0,host: Setting.project_domain}, :target => '_blank' %>
+
+
+
+
+
+
+
+ <%= l(:label_upload_softworkpacket_photo) %>
+
+ <%#= render_flash_messages %>
+
+ <%= render :partial => 'attachments/form' %>
+
+
+
+ 1、<%= l(:label_upload_softapplication_packets_mustpacketed) %>
+
+ 2、<%= l(:label_upload_softapplication_photo_condition) %>
+
+
+
+
+
+ <%= submit_tag l(:button_create) %>
+ <%= submit_tag l(:button_cancel), :name => nil, :onclick => "cancel();",
+ :type => 'button', :class => "enterprise", :onmouseout => "this.style.backgroundPosition = 'left top'",
+ :onmouseover => "this.style.backgroundPosition = 'left -30px'" %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/contests/show_attendingcontest.html.erb b/app/views/contests/show_attendingcontest.html.erb
index f6b684e5f..415897492 100644
--- a/app/views/contests/show_attendingcontest.html.erb
+++ b/app/views/contests/show_attendingcontest.html.erb
@@ -88,7 +88,7 @@
<%= l(:label_attending_contest) %>:
- <%= link_to l(:label_new_attendingcontest_work), "javascript:void(0);", onclick: "$('#put-project-form').toggle();" %>
+ <%= link_to l(:label_new_attendingcontest_work), "javascript:void(0);", onclick: "$('#put-project-form').slideToggle();" %>
<% else %>
@@ -99,102 +99,8 @@
<% end %>
-