+ <%= link_to "package", zipdown_assort_path(obj_class: homework.class, obj_id: homework.id) %>
<% homework.homeworks.each do |homeattach|%><%#homework.class == Bid %>
<% homeattach.attachments.each do |attach|%>
<%= link_to_attachment attach, author: true, :download => true %> (<%=attach.author%>)
diff --git a/app/views/welcome/contest.html.erb b/app/views/welcome/contest.html.erb
index 6a0a8413f..f3d7f092e 100644
--- a/app/views/welcome/contest.html.erb
+++ b/app/views/welcome/contest.html.erb
@@ -1,9 +1,232 @@
+<%= stylesheet_link_tag 'welcome' %>
+
+
+
+
-
- 正在升级中。。。。。。。。。。。。
+
+ <%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
+
微信扫码
+
+
+
+
+ <%= l(:label_welcome_trustie) %><%= l(:label_welcome_trustie_contest) %> , <%= l(:label_welcome_trustie_contest_description) %>
+
+
+
+
+
+ <%= form_tag({controller: 'contests', action: 'index'}, method: :get) do %>
+ <%= text_field_tag 'name', params[:name], placeholder:'请输入要搜索的关键字', name: "name", :class => 'blueinputbar', :style => 'width:240px; padding-right:50px;'%>
+
+ <%= hidden_field_tag 'project_type', params[:project_type] %>
+ <%= submit_tag l(:label_search), :class => "enterprise" , :name => nil%>
+ <% end %>
+
+
+
-
+
+
+
+
+
+
最新热门竞赛
+
<%= link_to "更多>>", {:controller => 'contests', :action => 'index', :host => Setting.contest_domain}, :target => "_blank" %>
+
+
+ <% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
+
+
+
+ <%= image_tag('/images/039.gif')%>
+
+
+
+ <%= link_to(contest.name, show_contest_contest_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}", :target => "_blank") %>
+
+
+
+ ><%=contest.description.truncate(50, omission: '...')%>
+
+
+
+ <%= l(:label_contest_project, :count => contest.contesting_projects.count) %>(<%= link_to(contest.contesting_projects.count, show_project_contest_path(contest)) %>)
+ <%= l(:label_contest_softapplication, :count => contest.contesting_softapplications.count) %>(<%= link_to(contest.contesting_softapplications.count, show_softapplication_contest_path(contest)) %>)
+
+
+
+ <% end; reset_cycle %>
+
+
+
+
+
+
+
+
+ 问题和反馈动态
+ <%= link_to "我要提问" , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
+ <%= link_to "我要反馈" , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
+
+
<%= link_to "更多>>", forums_path %>
+
+
+ <% find_new_forum_topics(11).each do |topic|%>
+ -
+
+
+ <%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray" , :style => "font-size: 10pt !important;" %>
+
+
+ <%= l(:field_updated_on) %><%=time_tag_welcome(topic_last_time topic)%>前
+
+ 由 <%= link_to topic.author ? topic.author : 'Anonymous', user_path(topic.author_id), :style => "font-size: 9pt !important; color: rgb(17, 102, 173);" %> 发表
+
+ 回复(<%= link_to (topic.parent ? topic.parent.replies_count : topic.replies_count), topic.event_url %>)
+
+
+ <% end %>
+
+
+
+
+
+
最新参赛应用
+
+
+
+ <% find_all_hot_softapplication.map do |softapplication| break if(softapplication == find_all_hot_softapplication[5]) %>
+
+
+
+ <%= image_tag('/images/009.gif')%>
+
+
+
+ <%= link_to(softapplication.name, softapplication_path(softapplication.id), :class => "d-g-blue d-p-project-name", :title => "#{softapplication.name}", :target => "_blank") %>
+
+
+
+ ><%=softapplication.description.truncate(50, omission: '...')%>
+
+
+
+ 发布时间:<%=format_time softapplication.created_at %>
+
+
+
+ <% end; reset_cycle %>
+
+
+
+
+
+
+
diff --git a/app/views/words/destroy.js.erb b/app/views/words/destroy.js.erb
index c583e0449..c2262a270 100644
--- a/app/views/words/destroy.js.erb
+++ b/app/views/words/destroy.js.erb
@@ -1,6 +1,6 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
-<% elsif (['Principal','Project', 'Bid'].include? @journal_destroyed.jour_type)%>
+<% elsif (['Principal','Project', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();
diff --git a/config/application.rb b/config/application.rb
index 593eed64e..d37a9eae2 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,6 +1,7 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
+require 'sprockets/railtie'
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index 2423b8485..5cc7b7d8d 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -1550,8 +1550,10 @@ zh:
label_welcome_trustie: Trustie
label_welcome_trustie_project: 在线项目托管平台
label_welcome_trustie_course: 在线课程实践平台
+ label_welcome_trustie_contest: 在线竞赛实战平台
label_welcome_trustie_project_description: 面向中国大学生与软件从业者,提供社交化的项目管理、代码托管、资源共享、合作交流。
label_welcome_trustie_course_description: 面向中国高校教师与大学生,提供社交化的课程管理、资源共享、合作实验、协同研究。
+ label_welcome_trustie_contest_description: 面向中国大学生与编程爱好者,提供社交化的竞赛管理、应用管理、代码托管、合作交流。
label_user_project: 项目
label_user_course: 课程
label_user_homework: 作业
@@ -1813,3 +1815,42 @@ zh:
label_contest_reason: 参赛宣言:
label_notification: 通知
label_sumbit_empty: 搜索内容不能为空
+
+ #add by linchun (竞赛相关)
+ label_upload_files: 上传文件
+ label_upload_softwarepackage: 上传软件包
+ label_upload_cuttingphoto: 上传截图
+ label_contests_reward_method: 奖励方式
+ label_system_platform: 系统平台
+ label_nextstep: 下一步
+ label_participate: 参赛者
+ label_contest_project: 参赛项目
+ label_contest_softapplication: 参赛应用
+ label_contest_response: 用户反馈
+ label_contest_watchers: 关注人员
+ label_contest_application: 参赛应用
+ button_contesting_as_project: 我要参赛(新建项目)
+ button_contesting_as_application: 我要参赛(发布应用)
+ label_release_softapplication: 发布应用
+ label_upload_softapplication_packets: 上传应用软件包
+ label_upload_softapplication_photo: 上传产品截图
+ label_upload_softapplication_photo_condition: 截图至少上传2张,至多4张;格式为gif/jpg/png, 尺寸480*800, 每张小于2M
+ label_softapplication_name: 应用名称
+ label_softapplication_description: 应用简介
+ label_softapplication_type: 应用分类
+ label_softapplication_version_available: 适配版本
+ label_softapplication_developer: 上传人员
+ label_softapplication_developers: 开发人员
+ label_softapplication_name_condition: 25个汉字以内(50个字符)
+ label_user_login_softapplication_board: 您还没有登录,请登录后参与应用评价。
+ label_contest_description_no: 暂无描述。
+ label_no_contest_softapplication: 暂无参赛应用
+ label_button_ok: 确定
+ label_tags_contest: 竞赛标签
+ label_tags_contest: 竞赛名称
+ label_tags_contest_description: 竞赛描述
+ label_release_add_contest_succeed: 该应用发布并添加成功.
+ label_add_contest_succeed_fail: 添加失败,该应用已参赛.
+
+
+
diff --git a/config/routes.rb b/config/routes.rb
index 8e7a2501e..17e09f5a8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -23,7 +23,41 @@ RedmineApp::Application.routes.draw do
match 'courselist'
match 'zip'
end
-
+ ##new added by linchun #以发布应用的形式参与竞赛
+ resources :softapplications do
+
+ collection do
+ match 'new_message', via: :get
+ end
+ member do
+ match 'create_message' , via: :post
+ end
+ end
+
+ ## new added by linchun #新竞赛相关
+ resources :contests, only: [:index] do
+ collection do
+ match 'new_contest' , via: :get
+ match 'join_in_contest' , via: :post
+ match 'unjoin_in_contest' , via: :delete
+ match 'create_contest' , via: :post
+ match 'new_join' , via: :post
+ match 'new' , via: :post
+ end
+ member do
+ match 'add_softapplication'
+ match 'update_contest' , via: [:put]
+ match 'show_contest' , via: :get
+ match 'show_project' , via: :get
+ match 'show_softapplication', via: :get
+ match 'show_participator' , via: :get
+ match 'add' , via: [:get, :post]
+ match 'add_softapplication' , via: [:get, :post]
+ match 'create' , via: :post
+ match 'settings' , via: [:get, :post]
+ end
+ end
+
resources :stores do
collection do
match 'search', via: [:get, :post]
@@ -549,7 +583,7 @@ RedmineApp::Application.routes.draw do
match 'calls', :controller => 'bids', :action => 'index'
match 'calls/:id', :controller => 'bids', :action => 'show', :as => 'respond'
- match 'contest', :controller => 'bids', :action => 'contest', :as => 'contest'
+ match 'contest', :controller => 'bids', :action => 'contests', :as => 'contest' #modified @20140403
########################
diff --git a/db/migrate/20140327071420_create_contests.rb b/db/migrate/20140327071420_create_contests.rb
new file mode 100644
index 000000000..0ec04a6c5
--- /dev/null
+++ b/db/migrate/20140327071420_create_contests.rb
@@ -0,0 +1,15 @@
+class CreateContests < ActiveRecord::Migration
+ def change
+ create_table :contests do |t|
+ t.string :name
+ t.integer :budget
+ t.integer :author_id
+ t.date :deadline
+ t.string :description
+ t.integer :commit
+ t.string :password
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140327073052_create_contesting_projects.rb b/db/migrate/20140327073052_create_contesting_projects.rb
new file mode 100644
index 000000000..b9dc336b2
--- /dev/null
+++ b/db/migrate/20140327073052_create_contesting_projects.rb
@@ -0,0 +1,12 @@
+class CreateContestingProjects < ActiveRecord::Migration
+ def change
+ create_table :contesting_projects do |t|
+ t.integer :project_id
+ t.string :contest_id
+ t.integer :user_id
+ t.string :description
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140327082704_change_created_at_of_contests_to_created_on.rb b/db/migrate/20140327082704_change_created_at_of_contests_to_created_on.rb
new file mode 100644
index 000000000..32d52d35a
--- /dev/null
+++ b/db/migrate/20140327082704_change_created_at_of_contests_to_created_on.rb
@@ -0,0 +1,11 @@
+class ChangeCreatedAtOfContestsToCreatedOn < ActiveRecord::Migration
+ def self.up
+ rename_column :contests, :created_at, :created_on
+ rename_column :contests, :updated_at, :updated_on
+ end
+
+ def self.down
+ rename_column :contests, :created_on, :created_at
+ rename_column :contests, :updated_on, :updated_at
+ end
+end
diff --git a/db/migrate/20140401121611_add_reward_to_contesting_projects.rb b/db/migrate/20140401121611_add_reward_to_contesting_projects.rb
new file mode 100644
index 000000000..8ac71c94b
--- /dev/null
+++ b/db/migrate/20140401121611_add_reward_to_contesting_projects.rb
@@ -0,0 +1,5 @@
+class AddRewardToContestingProjects < ActiveRecord::Migration
+ def change
+ add_column :contesting_projects, :reward, :string
+ end
+end
diff --git a/db/migrate/20140402023357_create_join_in_competitions.rb b/db/migrate/20140402023357_create_join_in_competitions.rb
new file mode 100644
index 000000000..b7fba87f1
--- /dev/null
+++ b/db/migrate/20140402023357_create_join_in_competitions.rb
@@ -0,0 +1,10 @@
+class CreateJoinInCompetitions < ActiveRecord::Migration
+ def change
+ create_table :join_in_competitions do |t|
+ t.integer :user_id
+ t.integer :competition_id
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140404030103_create_softapplications.rb b/db/migrate/20140404030103_create_softapplications.rb
new file mode 100644
index 000000000..f9094d9c9
--- /dev/null
+++ b/db/migrate/20140404030103_create_softapplications.rb
@@ -0,0 +1,14 @@
+class CreateSoftapplications < ActiveRecord::Migration
+ def change
+ create_table :softapplications do |t|
+ t.string :name
+ t.string :description
+ t.integer :app_type_id
+ t.string :app_type_name
+ t.string :android_min_version_available
+ t.integer :user_id
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140410015850_add_contest_id_to_softapplications.rb b/db/migrate/20140410015850_add_contest_id_to_softapplications.rb
new file mode 100644
index 000000000..b7b73a4aa
--- /dev/null
+++ b/db/migrate/20140410015850_add_contest_id_to_softapplications.rb
@@ -0,0 +1,5 @@
+class AddContestIdToSoftapplications < ActiveRecord::Migration
+ def change
+ add_column :softapplications, :contest_id, :integer
+ end
+end
diff --git a/db/migrate/20140410020848_add_softapplication_id_to_softapplications.rb b/db/migrate/20140410020848_add_softapplication_id_to_softapplications.rb
new file mode 100644
index 000000000..e4a51f535
--- /dev/null
+++ b/db/migrate/20140410020848_add_softapplication_id_to_softapplications.rb
@@ -0,0 +1,5 @@
+class AddSoftapplicationIdToSoftapplications < ActiveRecord::Migration
+ def change
+ add_column :softapplications, :softapplication_id, :integer
+ end
+end
diff --git a/db/migrate/20140411003234_create_contesting_softapplications.rb b/db/migrate/20140411003234_create_contesting_softapplications.rb
new file mode 100644
index 000000000..118b518f5
--- /dev/null
+++ b/db/migrate/20140411003234_create_contesting_softapplications.rb
@@ -0,0 +1,12 @@
+class CreateContestingSoftapplications < ActiveRecord::Migration
+ def change
+ create_table :contesting_softapplications do |t|
+ t.integer :softapplication_id
+ t.integer :contest_id
+ t.integer :user_id
+ t.string :description
+
+ t.timestamps
+ end
+ end
+end
diff --git a/db/migrate/20140411004155_add_reward_to_contesting_softapplications.rb b/db/migrate/20140411004155_add_reward_to_contesting_softapplications.rb
new file mode 100644
index 000000000..e5e3db183
--- /dev/null
+++ b/db/migrate/20140411004155_add_reward_to_contesting_softapplications.rb
@@ -0,0 +1,5 @@
+class AddRewardToContestingSoftapplications < ActiveRecord::Migration
+ def change
+ add_column :contesting_softapplications, :reward, :string
+ end
+end
diff --git a/db/migrate/20140411005214_add_is_public_to_softapplications.rb b/db/migrate/20140411005214_add_is_public_to_softapplications.rb
new file mode 100644
index 000000000..15d81699e
--- /dev/null
+++ b/db/migrate/20140411005214_add_is_public_to_softapplications.rb
@@ -0,0 +1,5 @@
+class AddIsPublicToSoftapplications < ActiveRecord::Migration
+ def change
+ add_column :softapplications, :is_public, :integer
+ end
+end
diff --git a/db/migrate/20140414012423_add_applicationdevelopers_to_softapplications.rb b/db/migrate/20140414012423_add_applicationdevelopers_to_softapplications.rb
new file mode 100644
index 000000000..2a4ad1081
--- /dev/null
+++ b/db/migrate/20140414012423_add_applicationdevelopers_to_softapplications.rb
@@ -0,0 +1,5 @@
+class AddApplicationdevelopersToSoftapplications < ActiveRecord::Migration
+ def change
+ add_column :softapplications, :application_developers, :string
+ end
+end
diff --git a/db/migrate/20140417085550_rename_courses_column_school_name.rb b/db/migrate/20140417085550_rename_courses_column_school_name.rb
new file mode 100644
index 000000000..9a7d81067
--- /dev/null
+++ b/db/migrate/20140417085550_rename_courses_column_school_name.rb
@@ -0,0 +1,9 @@
+class RenameCoursesColumnSchoolName < ActiveRecord::Migration
+ def up
+ rename_column :courses, :school_name, :school_id
+ end
+
+ def down
+ rename_column :courses, :school_id, :school_name
+ end
+end
diff --git a/db/migrate/20140417090022_change_courses_column_school_id.rb b/db/migrate/20140417090022_change_courses_column_school_id.rb
new file mode 100644
index 000000000..813dbfdf9
--- /dev/null
+++ b/db/migrate/20140417090022_change_courses_column_school_id.rb
@@ -0,0 +1,9 @@
+class ChangeCoursesColumnSchoolId < ActiveRecord::Migration
+ def up
+ change_column :courses, :school_id, :integer
+ end
+
+ def down
+ change_column :courses, :school_id, :string
+ end
+end
diff --git a/db/migrate/20140417091429_add_school_id_to_user_extensions.rb b/db/migrate/20140417091429_add_school_id_to_user_extensions.rb
new file mode 100644
index 000000000..f97e8b9e3
--- /dev/null
+++ b/db/migrate/20140417091429_add_school_id_to_user_extensions.rb
@@ -0,0 +1,5 @@
+class AddSchoolIdToUserExtensions < ActiveRecord::Migration
+ def change
+ add_column :user_extensions, :school_id, :integer
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a5cb5409c..b4a9ba972 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20140415090829) do
+ActiveRecord::Schema.define(:version => 20140417091429) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -23,6 +23,15 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
+ create_table "apply_project_masters", :force => true do |t|
+ t.integer "user_id"
+ t.string "apply_type"
+ t.integer "apply_id"
+ t.integer "status"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "attachments", :force => true do |t|
t.integer "container_id"
t.string "container_type", :limit => 30
@@ -62,6 +71,20 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type"
+ create_table "bak_mentioned", :primary_key => "Id", :force => true do |t|
+ t.string "this_real_name", :limit => 1000
+ t.integer "is_mentioned_in"
+ t.string "context", :limit => 2000
+ end
+
+ add_index "bak_mentioned", ["this_real_name", "is_mentioned_in"], :name => "name_mention", :length => {"this_real_name"=>900, "is_mentioned_in"=>nil}
+ add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name"
+ add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_2"
+ add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_3", :length => {"this_real_name"=>900}
+ add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_4"
+ add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_5"
+ add_index "bak_mentioned", ["this_real_name"], :name => "this_real_name_6"
+
create_table "biding_projects", :force => true do |t|
t.integer "project_id"
t.integer "bid_id"
@@ -101,6 +124,11 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
add_index "boards", ["project_id"], :name => "boards_project_id"
+ create_table "categories", :primary_key => "Id", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "proj_categories"
+ end
+
create_table "changes", :force => true do |t|
t.integer "changeset_id", :null => false
t.string "action", :limit => 1, :default => "", :null => false
@@ -205,7 +233,7 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
t.string "setup_time"
t.string "endup_time"
t.string "class_period"
- t.string "school_name"
+ t.integer "school_id"
end
create_table "custom_fields", :force => true do |t|
@@ -265,6 +293,14 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id"
+ create_table "eco_projects", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.integer "eco_proj_id"
+ t.datetime "date_collected"
+ end
+
+ add_index "eco_projects", ["proj_id"], :name => "proj_id"
+
create_table "enabled_modules", :force => true do |t|
t.integer "project_id"
t.string "name", :null => false
@@ -286,6 +322,137 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
+ create_table "events", :primary_key => "event_id", :force => true do |t|
+ t.string "job_name"
+ t.datetime "event_time"
+ t.string "event_type", :limit => 20
+ end
+
+ create_table "fm_article", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "article_title", :limit => 16777215
+ t.text "article_link", :limit => 16777215
+ t.text "article_time", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_article", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_bugtracker_link", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_bugtracker_link", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_datametric_link", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_datametric_link", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_dependency_link", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_dependency_link", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_download_link", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "download_link", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_download_link", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_heartbeat", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.float "popularity_score", :limit => 12
+ t.float "vitality_score", :limit => 12
+ t.integer "subscription"
+ t.integer "voting_score"
+ t.integer "voting_count"
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_heartbeat", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_license", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_license", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_mailinglist_link", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_mailinglist_link", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_operating_system", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_operating_system", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_programming_language", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_programming_language", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_project_spotlight", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.text "project_name", :limit => 16777215
+ t.text "project_spotlight_link", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_project_spotlight", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_release", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.text "release_version", :limit => 16777215
+ t.text "release_time", :limit => 16777215
+ t.text "release_tag", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_release", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_submit", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "submitter", :limit => 16777215
+ t.text "submitter_link", :limit => 16777215
+ t.text "submit_time", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_submit", ["proj_id"], :name => "proj_id"
+
+ create_table "fm_summary", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.text "description", :limit => 16777215
+ t.datetime "date_collected"
+ end
+
+ add_index "fm_summary", ["proj_id"], :name => "proj_id"
+
create_table "forums", :force => true do |t|
t.string "name", :null => false
t.string "description", :default => ""
@@ -518,6 +685,22 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
add_index "news", ["created_on"], :name => "index_news_on_created_on"
add_index "news", ["project_id"], :name => "news_project_id"
+ create_table "no_uses", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.string "no_use_type"
+ t.integer "no_use_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "ohloh_tagged", :force => true do |t|
+ t.integer "proj_id", :default => 0, :null => false
+ t.string "description", :limit => 100, :null => false
+ t.datetime "date_collected"
+ end
+
+ add_index "ohloh_tagged", ["proj_id"], :name => "proj_id"
+
create_table "open_id_authentication_associations", :force => true do |t|
t.integer "issued"
t.integer "lifetime"
@@ -533,6 +716,19 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
t.string "salt", :null => false
end
+ create_table "open_source_projects", :force => true do |t|
+ t.string "name"
+ t.text "description"
+ t.integer "commit_count", :default => 0
+ t.integer "code_line", :default => 0
+ t.integer "users_count", :default => 0
+ t.date "last_commit_time"
+ t.string "url"
+ t.date "date_collected"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "praise_tread_caches", :force => true do |t|
t.integer "object_id", :null => false
t.string "object_type"
@@ -612,6 +808,23 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
add_index "queries", ["project_id"], :name => "index_queries_on_project_id"
add_index "queries", ["user_id"], :name => "index_queries_on_user_id"
+ create_table "relative_memos", :force => true do |t|
+ t.integer "osp_id", :null => false
+ t.integer "parent_id"
+ t.string "subject", :null => false
+ t.text "content", :null => false
+ t.integer "author_id"
+ t.integer "replies_count", :default => 0
+ t.integer "last_reply_id"
+ t.boolean "lock", :default => false
+ t.boolean "sticky", :default => false
+ t.boolean "is_quote", :default => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "viewed_count_crawl", :default => 0
+ t.integer "viewed_count_local", :default => 0
+ end
+
create_table "repositories", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.string "url", :default => "", :null => false
@@ -764,6 +977,22 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id"
add_index "tokens", ["value"], :name => "tokens_value", :unique => true
+ create_table "tprojects", :force => true do |t|
+ t.string "name", :limit => 1000, :default => "0"
+ t.text "description", :limit => 16777215
+ t.string "commit_count", :limit => 100, :default => "0"
+ t.string "code_line", :limit => 100
+ t.string "last_commit_time", :limit => 100
+ t.string "url", :limit => 1000
+ t.datetime "date_collected"
+ t.string "created_at", :limit => 100
+ t.string "updated_at", :limit => 100
+ t.integer "proj_id", :null => false
+ t.string "user_count", :limit => 100
+ end
+
+ add_index "tprojects", ["proj_id"], :name => "proj_id"
+
create_table "trackers", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false
t.boolean "is_in_chlog", :default => false, :null => false
@@ -789,6 +1018,7 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
t.string "teacher_realname"
t.string "student_realname"
t.string "location_city"
+ t.integer "school_id"
end
create_table "user_grades", :force => true do |t|
@@ -820,6 +1050,9 @@ ActiveRecord::Schema.define(:version => 20140415090829) do
t.integer "active"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
+ t.integer "level"
+ t.integer "file"
+ t.integer "issue"
end
create_table "user_statuses", :force => true do |t|
diff --git a/lib/redmine.rb b/lib/redmine.rb
index 0ede4d1d8..43e47a26a 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -276,6 +276,16 @@ Redmine::MenuManager.map :bid_menu do |menu|
# menu.push :result, { :controller => 'bids', :action => 'show_results' },
# :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }
end
+###new add by linchun
+Redmine::MenuManager.map :contest_menu do |menu|
+ menu.push :respond, :show_contest_contest_path, :caption => :label_user_response
+ # menu.push :project, :show_project_contest_path, :caption => :label_contest_project
+ menu.push :application, :show_softapplication_contest_path, :caption => :label_contest_application
+ # menu.push :result, { :controller => 'bids', :action => 'show_results' },
+ # :caption => :label_bidding_results,:if => Proc.new{ |p| User.current.id == p }
+end
+
+####
Redmine::MenuManager.map :application_menu do |menu|
# Empty
end
diff --git a/public/images/008.jpg b/public/images/008.jpg
new file mode 100644
index 000000000..378e72164
Binary files /dev/null and b/public/images/008.jpg differ
diff --git a/public/images/009.gif b/public/images/009.gif
new file mode 100644
index 000000000..b90b130fb
Binary files /dev/null and b/public/images/009.gif differ
diff --git a/public/images/android_0.jpg b/public/images/android_0.jpg
new file mode 100644
index 000000000..6aadab331
Binary files /dev/null and b/public/images/android_0.jpg differ
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 2845c3ce0..3067b0f23 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1,3 +1,4 @@
+//= require_directory ./rateable
/* Redmine - project management software
Copyright (C) 2006-2013 Jean-Philippe Lang */
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index c3572f930..678346bb3 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -9,6 +9,14 @@ h4, .wiki h3 {font-size: 13px;}
h4 {border-bottom: 1px dotted #bbb;}
/*huang*/
/*current position*/
+.contest_count{
+ width: 20%;
+ height: 60px;
+ border: 1px solid #15bccf;
+ border-radius: 5px 5px 5px 5px;
+ float:right;
+}
+
.top-content{
background-color: #f7f7f7;
height: 56px;
@@ -2698,4 +2706,38 @@ div.repos_explain{
margin-left: -220px;
}
+/* new linchun compitition */
+.contest_underline{
+ margin:1;
+ padding:1;
+ width:900px;
+ height:0.5px;
+ background-color:#aaa;
+ overflow:hidden
+}
+.underline-contests_one{
+ margin-bottom: 10px;
+ border-bottom: 1px dashed rgb(204, 204, 204);
+ width: 930px;
+}
+.underline-contests_two{
+ margin-bottom: 10px;
+ border-bottom: 1px dashed rgb(204, 204, 204);
+ width: 660px;
+}
+.underline-contests_three{
+ margin-bottom: 10px;
+ border-bottom: 1px dashed rgb(204, 204, 204);
+ width: 688px;
+}
+.contest-star{
+ color: #bb0000;
+}
+
+.contes-new-box{
+ background: #fcfcfc;
+ padding-left: 85px;
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
diff --git a/test/fixtures/contesting_softapplications.yml b/test/fixtures/contesting_softapplications.yml
new file mode 100644
index 000000000..4b64c8b03
--- /dev/null
+++ b/test/fixtures/contesting_softapplications.yml
@@ -0,0 +1,13 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ softapplication_id: 1
+ contest_id: 1
+ user_id: 1
+ description: MyString
+
+two:
+ softapplication_id: 1
+ contest_id: 1
+ user_id: 1
+ description: MyString
diff --git a/test/fixtures/softapplications.yml b/test/fixtures/softapplications.yml
new file mode 100644
index 000000000..0ab48299f
--- /dev/null
+++ b/test/fixtures/softapplications.yml
@@ -0,0 +1,17 @@
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+one:
+ name: MyString
+ description: MyString
+ app_type_id: 1
+ app_type_name: MyString
+ android_min_version_available: MyString
+ user_id: 1
+
+two:
+ name: MyString
+ description: MyString
+ app_type_id: 1
+ app_type_name: MyString
+ android_min_version_available: MyString
+ user_id: 1
diff --git a/test/functional/softapplications_controller_test.rb b/test/functional/softapplications_controller_test.rb
new file mode 100644
index 000000000..8c5611cb9
--- /dev/null
+++ b/test/functional/softapplications_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class SoftapplicationsControllerTest < ActionController::TestCase
+ setup do
+ @softapplication = softapplications(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:softapplications)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create softapplication" do
+ assert_difference('Softapplication.count') do
+ post :create, softapplication: { android_min_version_available: @softapplication.android_min_version_available, app_type_id: @softapplication.app_type_id, app_type_name: @softapplication.app_type_name, description: @softapplication.description, name: @softapplication.name, user_id: @softapplication.user_id }
+ end
+
+ assert_redirected_to softapplication_path(assigns(:softapplication))
+ end
+
+ test "should show softapplication" do
+ get :show, id: @softapplication
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @softapplication
+ assert_response :success
+ end
+
+ test "should update softapplication" do
+ put :update, id: @softapplication, softapplication: { android_min_version_available: @softapplication.android_min_version_available, app_type_id: @softapplication.app_type_id, app_type_name: @softapplication.app_type_name, description: @softapplication.description, name: @softapplication.name, user_id: @softapplication.user_id }
+ assert_redirected_to softapplication_path(assigns(:softapplication))
+ end
+
+ test "should destroy softapplication" do
+ assert_difference('Softapplication.count', -1) do
+ delete :destroy, id: @softapplication
+ end
+
+ assert_redirected_to softapplications_path
+ end
+end
diff --git a/test/unit/contesting_softapplication_test.rb b/test/unit/contesting_softapplication_test.rb
new file mode 100644
index 000000000..0c1364caa
--- /dev/null
+++ b/test/unit/contesting_softapplication_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ContestingSoftapplicationTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/unit/helpers/softapplications_helper_test.rb b/test/unit/helpers/softapplications_helper_test.rb
new file mode 100644
index 000000000..ad8173602
--- /dev/null
+++ b/test/unit/helpers/softapplications_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class SoftapplicationsHelperTest < ActionView::TestCase
+end
diff --git a/test/unit/softapplication_test.rb b/test/unit/softapplication_test.rb
new file mode 100644
index 000000000..b3872eec5
--- /dev/null
+++ b/test/unit/softapplication_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class SoftapplicationTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end