diff --git a/Gemfile.lock b/Gemfile.lock index 355ca422d..66d3dfb4e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -91,6 +91,10 @@ GEM descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) diff-lcs (1.2.5) + dnsruby (1.57.0) + email_verifier (0.0.7) + dnsruby (>= 1.5) + rails (>= 3.0.0) equalizer (0.0.9) erubis (2.7.0) execjs (2.2.1) @@ -166,6 +170,7 @@ GEM mysql2 (0.3.11-x86-mingw32) nenv (0.2.0) net-ldap (0.3.1) + newrelic_rpm (3.9.9.275) nokogiri (1.6.3) mini_portile (= 0.6.0) nokogiri (1.6.3-x86-mingw32) @@ -315,6 +320,7 @@ DEPENDENCIES capybara (~> 2.4.1) coderay (~> 1.0.6) coffee-rails (~> 3.2.1) + email_verifier factory_girl (~> 4.4.0) faker fastercsv (~> 1.5.0) @@ -330,6 +336,7 @@ DEPENDENCIES mocha (~> 1.1.0) mysql2 (= 0.3.11) net-ldap (~> 0.3.1) + newrelic_rpm nokogiri (~> 1.6.3) paperclip (~> 3.5.4) rack-mini-profiler! diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb deleted file mode 100644 index c15b6dc8f..000000000 --- a/app/controllers/enterprises_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -class EnterprisesController < ApplicationController - layout 'project_base' - def index - @enterprises = Project.find_by_sql("select enterprise_name from projects") - end -end diff --git a/app/controllers/originizations_controller.rb b/app/controllers/originizations_controller.rb new file mode 100644 index 000000000..033f9d8ec --- /dev/null +++ b/app/controllers/originizations_controller.rb @@ -0,0 +1,6 @@ +class OriginizationsController < ApplicationController + layout 'project_base' + def index + @enterprises = Project.find_by_sql("select distinct(enterprise_name) from projects") + end +end diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 6c28ec502..b1138f964 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -25,10 +25,10 @@ class WelcomeController < ApplicationController before_filter :entry_select, :only => [:index] def index - unless params[:enterprise].nil? - @enterprise = params[:enterprise] - @enterprise_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @enterprise]) - @e_count = @enterprise_projects.count + unless params[:originization].nil? + @originization = params[:originization] + @originization_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @originization]) + @e_count = @originization_projects.count if @e_count < 10 part_count = 10 -@e_count # @part_projects = find_all_hot_project part_count, order diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index b329e4c27..6c5385115 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -7,6 +7,7 @@ class ZipdownController < ApplicationController SAVE_FOLDER = "#{Rails.root}/files" OUTPUT_FOLDER = "#{Rails.root}/tmp/archiveZip" + def assort if params[:obj_class] == "Bid" bid = Bid.find params[:obj_id] diff --git a/app/helpers/enterprises_helper.rb b/app/helpers/originizations_helper.rb similarity index 100% rename from app/helpers/enterprises_helper.rb rename to app/helpers/originizations_helper.rb diff --git a/app/models/course.rb b/app/models/course.rb index c986597b3..610f52f71 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -35,7 +35,7 @@ class Course < ActiveRecord::Base acts_as_nested_set :order => 'name', :dependent => :destroy acts_as_attachable :view_permission => :view_course_files, :delete_permission => :manage_files - + validates_presence_of :password, :term,:name validates_format_of :class_period, :with =>/^[1-9]\d*$/ validates_format_of :name,:with =>/^[^ ]+[a-zA-Z0-9_\u4e00-\u9fa5\s\S]+$/ diff --git a/app/views/account/email_valid.html.erb b/app/views/account/email_valid.html.erb index e6bc2a2db..1aecc6904 100644 --- a/app/views/account/email_valid.html.erb +++ b/app/views/account/email_valid.html.erb @@ -1,7 +1,7 @@
-