@@ -22,7 +26,12 @@
- <%= link_to homework.user, user_path(homework.user)%> 已提交 |
+ <%= link_to homework.user, user_path(homework.user)%> 已提交 |
+
+ <% if Time.parse(@bid.deadline.to_s) < Time.parse(homework.attachments[0].created_on.to_s) %>
+ 迟交
+ <% end %>
+ |
diff --git a/app/views/bids/_list_projects.html.erb b/app/views/bids/_list_projects.html.erb
index 304bab413..41c5ab9d1 100644
--- a/app/views/bids/_list_projects.html.erb
+++ b/app/views/bids/_list_projects.html.erb
@@ -147,6 +147,13 @@
<%= format_time b_project.created_at%>
|
+
+
+ <% if Time.parse(@bid.deadline.to_s) < Time.parse(b_project.created_at.to_s) %>
+ 迟交
+ <% end %>
+ |
+
|
diff --git a/app/views/bids/show_project.html.erb b/app/views/bids/show_project.html.erb
index 4b4d7040b..d22ddded6 100644
--- a/app/views/bids/show_project.html.erb
+++ b/app/views/bids/show_project.html.erb
@@ -1,6 +1,6 @@
-<% if @bid.homework_type == 1%>
+<% if @bid.homework_type == Bid::HomeworkFile %>
<%= render :partial => 'homework' %>
<% else %>
diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb
index f3f0524ae..677416a6d 100644
--- a/app/views/forums/show.html.erb
+++ b/app/views/forums/show.html.erb
@@ -2,7 +2,7 @@
<%=l(:label_memo_new)%>
<% if User.current.logged? %>
- <%= labelled_form_for(@memo, :url => forum_memos_path(@forum), :html => {:multipart => true} ) do |f| %>
+ <%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %>
<% if @memo.errors.any? %>
<%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:
diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb
index 422f2dbd7..0c1867a98 100644
--- a/app/views/layouts/_base_footer.html.erb
+++ b/app/views/layouts/_base_footer.html.erb
@@ -1,20 +1,31 @@
-
+
<%= render :partial => 'layouts/base_footer'%>
-
<%= l(:label_loading) %>
-
+
diff --git a/app/views/memos/_reply_box.html.erb b/app/views/memos/_reply_box.html.erb
index a8991b572..e0c6acf13 100644
--- a/app/views/memos/_reply_box.html.erb
+++ b/app/views/memos/_reply_box.html.erb
@@ -1,4 +1,4 @@
-<%= form_for(@mome_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %>
+<%= form_for(@memo_new, url: forum_memos_path, :html => {:multipart => true}) do |f| %>
<%= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb
index d085c01d2..6ea5b17bc 100644
--- a/app/views/memos/show.html.erb
+++ b/app/views/memos/show.html.erb
@@ -1,7 +1,7 @@
- <%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
- <%=link_to @memo.author.name, user_path(@memo.author) %>
+ <%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>
+ <%=link_to @memo.author.name, user_path(@memo.author) %>
diff --git a/app/views/my/account.html.erb b/app/views/my/account.html.erb
index cca7b8546..6ff37ed7c 100644
--- a/app/views/my/account.html.erb
+++ b/app/views/my/account.html.erb
@@ -1,3 +1,20 @@
+
+
+
<%= link_to(l(:button_change_password), {:action => 'password'}, :class => 'icon icon-passwd') if @user.change_password_allowed? %>
<%= call_hook(:view_my_account_contextual, :user => @user)%>
@@ -61,13 +78,23 @@
<% end %>
- <% unless @user.user_extensions.nil?%>
- <%= l(:field_occupation)%> <%= text_field_tag "occupation", @user.user_extensions.occupation, :class => 'occupation'%>
+
+
+
+
+ <%= l(:field_occupation) %> *<%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onchange => "get_options(this.value)" %>
+
+ <%= select_tag "occupation", options_for_select([['安徽大学','安徽大学'],['合肥工业大学','合肥工业大学'],['中国科技大学','中国科技大学']]) %>
+
+
+
diff --git a/app/views/projects/_course_form.html.erb b/app/views/projects/_course_form.html.erb
index ff45f2375..ca736b05a 100644
--- a/app/views/projects/_course_form.html.erb
+++ b/app/views/projects/_course_form.html.erb
@@ -1,4 +1,19 @@
-
+
+
<% object = [] %>
@@ -269,10 +284,12 @@
+
+
+ <%=l(:label_new_course_school)%>*
+ <%= select_tag "province", options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province), :onclick => "get_options(this.value)" %>
-
-
- <%= select_tag 'school', options_from_collection_for_select(School.all, :id, :name)%>
+ <%= select_tag "occupation", options_for_select([['安徽大学','安徽大学'],['合肥工业大学','合肥工业大学'],['中国科技大学','中国科技大学']]) %>
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
index 565a31383..493280647 100644
--- a/app/views/repositories/show.html.erb
+++ b/app/views/repositories/show.html.erb
@@ -22,6 +22,7 @@
:class => 'repository' + (repo == @repository ? ' selected' : '')
}.join(' | ').html_safe %>)
<% else %>
+ 项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码
建立版本库文件夹,打开命令行执行如下:
git init
@@ -30,11 +31,22 @@
git remote add origin <%= @repos_url%>
git push -u origin master:master
- 已经有本地库,打开命令行执行如下:
+ 已经有本地库,还没有配置远程地址,打开命令行执行如下:
git remote add origin <%= @repos_url%>
+ git add .
+ git commit -m "first commit"
git push -u origin master:matser
+
+ 从网上获取别人的开源版本库,转交到trustie网站上,打开命令行执行如下:
+
+ git remote add trustie <%= @repos_url%>
+ git add .
+ git commit -m "first commit"
+ git push -u trustie master:matser
+ <%= link_to "李海提供", user_path(646)%>
+
<% end %>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
diff --git a/app/views/test/courselist.html.erb b/app/views/test/courselist.html.erb
new file mode 100644
index 000000000..61cd69e13
--- /dev/null
+++ b/app/views/test/courselist.html.erb
@@ -0,0 +1,42 @@
+
+<% @courses.each do |course| %>
+
+ <%= course.name %>
+
+ <% course.homeworks.each do |homework| %>
+ <% homeworks_attach_path = [] %>
+
+ <%= link_to homework.name, respond_path(homework) %>(<%=homework.homeworks.count %>)<%#Bid%>
+
+ <%= link_to "package", test_zip_path(:homework_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%>)
+
+ <% homeworks_attach_path << attach.storage_path %>
+ <% end %>
+ <% end %>
+
+ <%# 所有作业的文件列表%>
+
+
+ <% end %>
+
+
+<% end %>
diff --git a/app/views/test/zip.html.erb b/app/views/test/zip.html.erb
new file mode 100644
index 000000000..8992b9bb2
--- /dev/null
+++ b/app/views/test/zip.html.erb
@@ -0,0 +1 @@
+<%= debug @paths.to_yaml %>
\ No newline at end of file
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 6c4cd3e6b..c1b5bba9f 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -245,7 +245,7 @@
-
+
当前网站状态 |
活跃项目:<%=@projectCount%>个 |
diff --git a/app/views/zipdown/assort.html.erb b/app/views/zipdown/assort.html.erb
new file mode 100644
index 000000000..c9056b4fa
--- /dev/null
+++ b/app/views/zipdown/assort.html.erb
@@ -0,0 +1,2 @@
+Download Status:
+<%= @error.class %>
\ No newline at end of file
diff --git a/config/locales/zh.yml b/config/locales/zh.yml
index a006ae53c..2423b8485 100644
--- a/config/locales/zh.yml
+++ b/config/locales/zh.yml
@@ -741,6 +741,7 @@ zh:
label_latest_revision_plural: 最近的修订版本
label_view_revisions: 查看修订
label_view_all_revisions: 查看所有修订
+ label_no_file_uploaded: 未上传文件
label_max_size: 最大文件大小
label_sort_highest: 置顶
label_sort_higher: 上移
@@ -1746,6 +1747,7 @@ zh:
label_exit_course: 退出课程
label_new_join: 加入
label_new_course_password: 课程密码
+ label_new_course_school: 开课学校
label_new_course_description: 课程描述
label_new_join_order: 请输入课程密码
label_task_submit_form_accessory: 作业最终以附件形式提交
diff --git a/config/routes.rb b/config/routes.rb
index ec3440cec..8e7a2501e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,561 +1,577 @@
-# Redmine - project management software
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write tobthe Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-RedmineApp::Application.routes.draw do
- resources :stores do
- collection do
- match 'search', via: [:get, :post]
- end
- end
-
- resources :forums do
- collection do
- match 'search_forum', :via => [:get, :post]
- end
- member do
- match 'search_memo', :via => [:get, :post]
- end
- resources :memos do
- collection do
- get "quote"
- end
- end
- end
-
-
- resources :shares
-
- #added by william
- get "tags/index"
-
- get "tags/show"
-
- get "praise_tread/praise_plus"
-
- get "praise_tread/tread_plus"
- #end
-
- root :to => 'welcome#index', :as => 'home'
-
- #added by baiyu
- match 'git_usage/ch_usage', :controller => 'git_usage', :action => 'ch_usage', :via => :get, :as => 'ch_usage'
- match 'git_usage/en_usage', :controller => 'git_usage', :action => 'en_usage', :via => :get, :as => 'en_usage'
- #added by nie
- match '/projects/search', :controller => 'projects', :action => 'search', :via => [:get, :post]
- match '/users/search', :controller => 'users', :action => 'search', :via => [:get, :post]
- #end
- match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
- match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
- match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
- match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
- match 'account/activate', :to => 'account#activate', :via => :get
-
- match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put]
- match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put]
- match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put]
- match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put]
-
- match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
- match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
-
- # boards
- match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
- get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
- match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
- get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
-
- post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
- post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
- post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
- post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
- # boards end
- post 'bids/homework_destroy', :to => 'bids#homework_destroy'
-
- # Misc issue routes. TODO: move into resources
- match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
- match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
- match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
- match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
-
- match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
- match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
- match '/journals/destroy/:id', :to => 'journals#destroy', :id => /\d+/, :via => [:get, :post]
-
-
- get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
- get '/issues/gantt', :to => 'gantts#show'
-
- get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
- get '/issues/calendar', :to => 'calendars#show'
-
- get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
- get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
- post '/users/:id/user_activities', :to => 'users#show', :as => "user_activities"
-
- #added by young
- resources :users do
- member do
- match 'user_projects', :to => 'users#user_projects', :via => :get
- match 'user_activities', :to => 'users#show', :via => :get, :as => "user_activities"
- match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback"
- match 'watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
- match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info'
- match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
- match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
- match 'user_courses', :to => 'users#user_courses', :via => :get
- match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
- match 'watch_projects', :to => 'users#watch_projects', :via => :get
- # added by bai
- match 'show_score', :to => 'users#show_score', :via => :get
- match 'topic_score_index', :controller => 'users', :action => 'topic_score_index', :via => [:get, :post]
- match 'project_score_index', :to => 'users#project_score_index', :via => :get
- match 'activity_score_index', :to => 'users#activity_score_index', :via => :get
- match 'influence_score_index', :to => 'users#influence_score_index', :via => :get
- match 'score_index', :to => 'users#score_index', :via => :get
-
- match 'show_projects_score', :to => 'projects#show_projects_score', :via => [:get, :post]
- match 'issue_score_index', :to => 'projects#issue_score_index', :via => [:get, :post]
- match 'news_score_index', :to => 'projects#news_score_index', :via => [:get, :post]
- match 'file_score_index', :to => 'projects#file_score_index', :via => [:get, :post]
- match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post]
- match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post]
- # end
- end
- end
- match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback"
- match 'users/:id/user_projects', :controller => 'users', :action => 'user_projects', :via => :get
- #match 'user/:id/watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
-
- #end
- match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
- match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
- match 'my/page', :controller => 'my', :action => 'page', :via => :get
- match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
- match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
- match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
- match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
- match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
- match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
- match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
- match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
-
- resources :users
- match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
- match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete
- match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
- ################# added by william
- match 'users/tag_save', :to => 'users#tag_save', :via => :post, :as => 'tag'
-
- post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
- delete 'watchers/watch', :to => 'watchers#unwatch'
- get 'watchers/new', :to => 'watchers#new'
- post 'watchers', :to => 'watchers#create'
- post 'watchers/append', :to => 'watchers#append'
- delete 'watchers', :to => 'watchers#destroy'
- get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user'
- # Specific routes for issue watchers API
- post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
- delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
-
- resources :bids, :only=>[:edit,:update,:show] do
- member do
- match 'homework_ajax_modal'
- end
- end
- resources :projects do
- member do
- post 'finishcourse'
- post 'restartcourse'
- get 'settings(/:tab)', :action => 'settings', :as => 'settings'
- #by young
- get 'member', :controller => 'projects', :action => 'member', :as => 'member'
- get 'file', :action => 'file', :as => 'file'
- get 'statistics', :action => 'statistics', :as => 'statistics'
- get 'feedback', :action => 'feedback', :as => 'project_feedback'
- get 'watcherlist', :action=> 'watcherlist'
- match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang
- get 'homework', :action => 'homework', :as => 'homework'
- get 'new_homework', :action => 'new_homework', :as => 'new_homework'
- #get 'news', :action => 'news', :as => 'news'
- #end
- post 'modules'
- post 'archive'
- post 'unarchive'
- post 'close'
- post 'reopen'
- match 'copy', :via => [:get, :post]
- end
-
-
- #by young
- match '/member', :controller => 'projects', :action => 'member', :as => 'member', :via => :get
- match '/file', :controller => 'projects', :action => 'file', :as => 'file', :via => :get
- match '/statistics', :controller => 'projects', :action => 'statistics', :as => 'statistics', :via => :get
- # match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
- match '/homework', :controller => 'projects', :action => 'homework', :as => 'homework', :via => :get
-
-
- # match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
- # match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
- # match '/', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
- # get 'projects/:project_id/show', :to => 'projects#show', :as => 'project_show'
- # get 'projects/:project_id/repository', :to => 'repositories#show', :as => 'project_repository'
-
- # match '/show', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
- match '/watcherlist', :controller=>'projects', :action=> 'watcherlist', :as => 'watcherlist', :via => :get #add by huang
- # matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get
- #end
-
- resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
- collection do
- get 'autocomplete'
- end
- end
-
- resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
-
- get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
- resources :issues, :only => [:index, :new, :create] do
- resources :time_entries, :controller => 'timelog' do
- collection do
- get 'report'
- end
- end
- end
- # issue form update
- match 'issues/update_form', :controller => 'issues', :action => 'update_form', :via => [:put, :post], :as => 'issue_form'
-
- resources :files, :only => [:index, :new, :create]
-
- resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
- collection do
- put 'close_completed'
- end
- end
- get 'versions.:format', :to => 'versions#index'
- get 'roadmap', :to => 'versions#index', :format => false
- get 'versions', :to => 'versions#index'
-
- resources :news, :except => [:show, :edit, :update, :destroy]
- resources :time_entries, :controller => 'timelog' do
- get 'report', :on => :collection
- end
- resources :queries, :only => [:new, :create]
- resources :issue_categories, :shallow => true
- resources :documents, :except => [:show, :edit, :update, :destroy]
- resources :boards
- resources :repositories, :shallow => true, :except => [:index, :show] do
- member do
- match 'committers', :via => [:get, :post]
- end
- end
- resources :repositories, :except => [:index, :show] do
- member do
- get 'newrepo', :via => [:get, :post]
- # get 'create', :via=>[:get, :post]
- end
- end
- match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
- resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
- member do
- get 'rename'
- post 'rename'
- get 'history'
- get 'diff'
- match 'preview', :via => [:post, :put]
- post 'protect'
- post 'add_attachment'
- end
- collection do
- get 'export'
- get 'date_index'
- end
- end
- match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
- get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
- delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
- get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
- get 'wiki/:id/:version/diff', :to => 'wiki#diff'
- end
-
- resources :issues do
- collection do
- match 'bulk_edit', :via => [:get, :post]
- post 'bulk_update'
- end
- resources :time_entries, :controller => 'timelog' do
- collection do
- get 'report'
- end
- end
- resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
- end
- match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
-
- resources :queries, :except => [:show]
-
- resources :news, :only => [:index, :show, :edit, :update, :destroy]
- match '/news/:id/comments', :to => 'comments#create', :via => :post
- match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
-
- resources :versions, :only => [:show, :edit, :update, :destroy] do
- post 'status_by', :on => :member
- end
-
- resources :documents, :only => [:show, :edit, :update, :destroy] do
- post 'add_attachment', :on => :member
- end
-
- match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
-
- resources :time_entries, :controller => 'timelog', :except => :destroy do
- collection do
- get 'report'
- get 'bulk_edit'
- post 'bulk_update'
- end
- end
- match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
- # TODO: delete /time_entries for bulk deletion
- match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
-
- get 'projects/:id/activity', :to => 'activities#index'
- get 'projects/:id/activity.:format', :to => 'activities#index'
- get 'activity', :to => 'activities#index'
-
- # repositories routes
- get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
- get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
-
- get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', :to => 'repositories#changes'
-
- get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
- get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
- post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
- delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
- get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
- get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))',
- :controller => 'repositories',
- :format => false,
- :constraints => {
- :action => /(browse|show|entry|raw|annotate|diff)/,
- :rev => /[a-z0-9\.\-_]+/
- }
-
- get 'projects/:id/repository/statistics', :to => 'repositories#stats'
- get 'projects/:id/repository/graph', :to => 'repositories#graph'
-
- get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes'
-
- get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
- get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
- get 'projects/:id/repository/revision', :to => 'repositories#revision'
- post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
- delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
- get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))',
- :controller => 'repositories',
- :format => false,
- :constraints => {
- :action => /(browse|show|entry|raw|annotate|diff)/,
- :rev => /[a-z0-9\.\-_]+/
- }
- get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
- :controller => 'repositories',
- :action => /(browse|show|entry|raw|changes|annotate|diff)/
- get 'projects/:id/repository/:action(/*path(.:ext))',
- :controller => 'repositories',
- :action => /(browse|show|entry|raw|changes|annotate|diff)/
-
- get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
- get 'projects/:id/repository', :to => 'repositories#show', :path => nil
-
- # additional routes for having the file name at the end of url
- get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
- get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
- get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
- get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
- get 'attachments/autocomplete'
- match 'attachments/autocomplete', :to => 'attachments#autocomplete', via: [:post]
- post 'attachments/relationfile', to: 'attachments#add_exist_file_to_project', as: 'attach_relation'
- resources :attachments, :only => [:show, :destroy]
-
- resources :groups do
- member do
- get 'autocomplete_for_user'
- end
- end
-
- match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users'
- match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user'
- match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post
- match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post
-
- resources :trackers, :except => :show do
- collection do
- match 'fields', :via => [:get, :post]
- end
- end
- resources :issue_statuses, :except => :show do
- collection do
- post 'update_issue_done_ratio'
- end
- end
- resources :custom_fields, :except => :show
- resources :roles do
- collection do
- match 'permissions', :via => [:get, :post]
- end
- end
- resources :enumerations, :except => :show
- match 'enumerations/:type', :to => 'enumerations#index', :via => :get
-
- get 'projects/:id/search', :controller => 'search', :action => 'index'
- get 'search', :controller => 'search', :action => 'index'
-
- match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post
-
- match 'admin', :controller => 'admin', :action => 'index', :via => :get
- match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
- match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
- match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
- match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
- match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post
-
- resources :auth_sources do
- member do
- get 'test_connection', :as => 'try_connection'
- end
- collection do
- get 'autocomplete_for_new_user'
- end
- end
-
-
-
- match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
- match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
- match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
- match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
- match 'settings', :controller => 'settings', :action => 'index', :via => :get
- match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
- match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
-
- match 'sys/projects', :to => 'sys#projects', :via => :get
- match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
- match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get
-
- match 'uploads', :to => 'attachments#upload', :via => :post
- # Added by Tao
- match 'upload_avatar', :to => 'avatar#upload', :via => :post
- # Endof Tao's code
- get 'robots.txt', :to => 'welcome#robots'
-
- Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
- file = File.join(plugin_dir, "config/routes.rb")
- if File.exists?(file)
- begin
- instance_eval File.read(file)
- rescue Exception => e
- puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
- exit 1
- end
- end
- end
-
- ##############测试留言功能 fq
- post 'words/new', :to => 'words#new'
- post 'words/create', :to => 'words#create'
- post 'words/append', :to => 'words#append'
- post 'words/create_reply', :to => 'words#create_reply'
- delete 'words/destroy', :to => 'words#destroy'
- get 'words/more', :to => 'words#more'
- get 'words/back', :to=> 'words#back'
- ############## fq
- post 'calls/create', :to => 'bids#create'
- delete 'calls/destroy', :to => 'bids#destroy'
- match 'calls/new', :controller => 'bids', :action => 'new', :via => [:get , :post]
- get 'calls/more', :to => 'bids#more'
- get 'calls/back', :to=> 'bids#back'
- match 'calls/new_bid', :controller => 'bids', :action => 'new_bid'
- match 'contest/new_contest', :controller => 'bids', :action => 'new_contest' #huang
- match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid'
- match 'calls/:id/show_project_homework', :controller => 'bids', :action => 'show_project_homework', :as => 'project_for_bid_homework' # by huang
- match 'calls/:id/add', :controller => 'bids', :action => 'add'
- match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework', via: :post
- match 'calls/:id/new_submit_homework', to: 'bids#new_submit_homework', via: :get, as: 'new_submit_homework'
- match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond'
- match 'words/:id/leave_project_message', :controller => 'words', :action => 'leave_project_message'
-
- match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
- match 'calls/create_bid', :to => 'bids#create_bid'
- match 'contest/create_contest', :to => 'bids#create_contest' #huang
- match 'calls/create_homework', :to => 'bids#create_homework'
- match 'calls/:id/homework_respond', :to => 'bids#homework_respond'
- match 'calls/:id/homework_statistics', :to => 'bids#homework_statistics'
- match 'calls/:id/fork', :to => 'bids#fork', :as => 'fork'
- match 'calls/:id/create_fork', :to => 'bids#create_fork'
- match 'project/enterprise_course', :to => 'projects#enterprise_course'
- match 'project/course_enterprise', :to => 'projects#course_enterprise'
- match 'calls/:id/show_course', :to => 'bids#show_course', :as => 'show_course'
- match 'calls/:id/show_bid_project', :to => 'bids#show_bid_project', :as => 'show_bid_project'
- match 'calls/:id/show_bid_user', :to => 'bids#show_bid_user', :as => 'show_bid_user'
-
- match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
-
- post 'join_in/join', :to => 'courses#join', :as => 'join'
- delete 'join_in/join', :to => 'courses#unjoin'
- post 'calls/:id/join_in_contest', :to => 'bids#join_in_contest', :as => 'join_in_contest'
- delete 'calls/:id/join_in_contest', :to => 'bids#unjoin_in_contest'
- match 'calls/:id/show_participator', :to => 'bids#show_participator' #bai
- match 'calls/:id/update_contest', :to => 'bids#update_contest' #bai
- match 'calls/:id/settings', :to => 'bids#settings' #bai
-
- delete 'attachment/:id', :to => 'attachments#delete_homework'
- match 'new_join', :to => 'projects#new_join', :as => 'try_join'
- match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
- match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
- match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post]
- match 'project/course', :to => 'projects#course', :as => 'course'
-
- #added by william
- # match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results'
- # match 'calls/:id/set_prizes',:controller => 'bids',:action => 'set_prizes',:as => 'set_prizes'
- match 'calls/:id/set_reward',:controller => 'bids',:action => 'set_reward',:as => 'set_reward'
-
- ## 测试用
- match 'test/index', :controller => 'test', :action => 'index'
- # added by young
- match 'calls', :controller => 'bids', :action => 'index'
-
- match 'calls/:id', :controller => 'bids', :action => 'show', :as => 'respond'
- match 'contest', :controller => 'bids', :action => 'contest', :as => 'contest'
-
- ######added by nie
- match 'tags/show_projects_tags',:to => 'tags#show_projects_tags'
- ########### added by liuping
- match 'tags/add_tag',:to => 'tags#add_tag',:as=>"add_tag"
- match 'tags/delete_tag',:to => 'tags#delete_tag',:as=>"add_tag"
- match 'tags/show_all',:to => 'tags#show_all'
- match 'parise_tread/praise_plus',:to => 'parise_tread#praise_plus',:as=>"praise"
- match 'parise_tread/tread_plus',:to => 'parise_tread#tread_plus',:as=>"tread"
- match 'tags/delete',:to=>'tags#delete'
- match 'tags/remove_tag',:to=>'tags#remove_tag',:as=>"remove_tag"
-
- match 'words/add_brief_introdution', :controller => 'words', :action => 'add_brief_introdution'
-
- get ':controller(/:action(/:id))'
-end
+# Redmine - project management software
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write tobthe Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+RedmineApp::Application.routes.draw do
+ namespace :zipdown do
+ match 'assort'
+ end
+ namespace :test do
+ match 'courselist'
+ match 'zip'
+ end
+
+ resources :stores do
+ collection do
+ match 'search', via: [:get, :post]
+ end
+ end
+
+ resources :forums do
+ collection do
+ match 'search_forum', :via => [:get, :post]
+ end
+ member do
+ post 'create_memo'
+ match 'search_memo', :via => [:get, :post]
+ end
+ resources :memos do
+ collection do
+ get "quote"
+ end
+ end
+ end
+
+
+ resources :shares
+
+ #added by william
+ get "tags/index"
+
+ get "tags/show"
+
+ get "praise_tread/praise_plus"
+
+ get "praise_tread/tread_plus"
+ #end
+
+ root :to => 'welcome#index', :as => 'home'
+
+ #added by baiyu
+ match 'git_usage/ch_usage', :controller => 'git_usage', :action => 'ch_usage', :via => :get, :as => 'ch_usage'
+ match 'git_usage/en_usage', :controller => 'git_usage', :action => 'en_usage', :via => :get, :as => 'en_usage'
+ #added by nie
+ match '/projects/search', :controller => 'projects', :action => 'search', :via => [:get, :post]
+ match '/users/search', :controller => 'users', :action => 'search', :via => [:get, :post]
+ #end
+ match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
+ match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
+ match 'account/register', :to => 'account#register', :via => [:get, :post], :as => 'register'
+ match 'account/lost_password', :to => 'account#lost_password', :via => [:get, :post], :as => 'lost_password'
+ match 'account/activate', :to => 'account#activate', :via => :get
+
+ match '/news/preview', :controller => 'previews', :action => 'news', :as => 'preview_news', :via => [:get, :post, :put]
+ match '/issues/preview/new/:project_id', :to => 'previews#issue', :as => 'preview_new_issue', :via => [:get, :post, :put]
+ match '/issues/preview/edit/:id', :to => 'previews#issue', :as => 'preview_edit_issue', :via => [:get, :post, :put]
+ match '/issues/preview', :to => 'previews#issue', :as => 'preview_issue', :via => [:get, :post, :put]
+
+ match 'projects/:id/wiki', :to => 'wikis#edit', :via => :post
+ match 'projects/:id/wiki/destroy', :to => 'wikis#destroy', :via => [:get, :post]
+
+ # boards
+ match 'boards/:board_id/topics/new', :to => 'messages#new', :via => [:get, :post], :as => 'new_board_message'
+ get 'boards/:board_id/topics/:id', :to => 'messages#show', :as => 'board_message'
+ match 'boards/:board_id/topics/quote/:id', :to => 'messages#quote', :via => [:get, :post]
+ get 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
+
+ post 'boards/:board_id/topics/preview', :to => 'messages#preview', :as => 'preview_board_message'
+ post 'boards/:board_id/topics/:id/replies', :to => 'messages#reply'
+ post 'boards/:board_id/topics/:id/edit', :to => 'messages#edit'
+ post 'boards/:board_id/topics/:id/destroy', :to => 'messages#destroy'
+ # boards end
+ post 'bids/homework_destroy', :to => 'bids#homework_destroy'
+
+ # Misc issue routes. TODO: move into resources
+ match '/issues/auto_complete', :to => 'auto_completes#issues', :via => :get, :as => 'auto_complete_issues'
+ match '/issues/context_menu', :to => 'context_menus#issues', :as => 'issues_context_menu', :via => [:get, :post]
+ match '/issues/changes', :to => 'journals#index', :as => 'issue_changes', :via => :get
+ match '/issues/:id/quoted', :to => 'journals#new', :id => /\d+/, :via => :post, :as => 'quoted_issue'
+
+ match '/journals/diff/:id', :to => 'journals#diff', :id => /\d+/, :via => :get
+ match '/journals/edit/:id', :to => 'journals#edit', :id => /\d+/, :via => [:get, :post]
+ match '/journals/destroy/:id', :to => 'journals#destroy', :id => /\d+/, :via => [:get, :post]
+
+
+ get '/projects/:project_id/issues/gantt', :to => 'gantts#show', :as => 'project_gantt'
+ get '/issues/gantt', :to => 'gantts#show'
+
+ get '/projects/:project_id/issues/calendar', :to => 'calendars#show', :as => 'project_calendar'
+ get '/issues/calendar', :to => 'calendars#show'
+
+ get 'projects/:id/issues/report', :to => 'reports#issue_report', :as => 'project_issues_report'
+ get 'projects/:id/issues/report/:detail', :to => 'reports#issue_report_details', :as => 'project_issues_report_details'
+ post '/users/:id/user_activities', :to => 'users#show', :as => "user_activities"
+
+ #added by young
+ resources :users do
+ member do
+ match 'user_projects', :to => 'users#user_projects', :via => :get
+ match 'user_activities', :to => 'users#show', :via => :get, :as => "user_activities"
+ match 'user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "user_newfeedback"
+ match 'watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
+ match 'info', :to => 'users#info', :via => [:get , :post], :as => 'user_info'
+ match 'user_watchlist', :to => 'users#user_watchlist', :via => :get, :as => "user_watchlist" #add by huang
+ match 'user_fanslist', :to => 'users#user_fanslist', :via => :get, :as => "user_fanslist" #add by huang
+ match 'user_courses', :to => 'users#user_courses', :via => :get
+ match 'user_homeworks', :to => 'users#user_homeworks', :via => :get
+ match 'watch_projects', :to => 'users#watch_projects', :via => :get
+ # added by bai
+ match 'show_score', :to => 'users#show_score', :via => :get
+ match 'topic_score_index', :controller => 'users', :action => 'topic_score_index', :via => [:get, :post]
+ match 'project_score_index', :to => 'users#project_score_index', :via => :get
+ match 'activity_score_index', :to => 'users#activity_score_index', :via => :get
+ match 'influence_score_index', :to => 'users#influence_score_index', :via => :get
+ match 'score_index', :to => 'users#score_index', :via => :get
+
+ match 'show_projects_score', :to => 'projects#show_projects_score', :via => [:get, :post]
+ match 'issue_score_index', :to => 'projects#issue_score_index', :via => [:get, :post]
+ match 'news_score_index', :to => 'projects#news_score_index', :via => [:get, :post]
+ match 'file_score_index', :to => 'projects#file_score_index', :via => [:get, :post]
+ match 'code_submit_score_index', :to => 'projects#code_submit_score_index', :via => [:get, :post]
+ match 'projects_topic_score_index', :to => 'projects#projects_topic_score_index', :via => [:get, :post]
+ # end
+ end
+ end
+ match 'users/:id/user_newfeedback', :to => 'users#user_newfeedback', :via => :get, :as => "feedback"
+ match 'users/:id/user_projects', :controller => 'users', :action => 'user_projects', :via => :get
+ #match 'user/:id/watch_calls', :controller => 'users', :action => 'watch_bids', :via => [:get , :post]
+
+ #end
+ match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :post]
+ match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
+ match 'my/page', :controller => 'my', :action => 'page', :via => :get
+ match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
+ match 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :via => :post
+ match 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :via => :post
+ match 'my/password', :controller => 'my', :action => 'password', :via => [:get, :post]
+ match 'my/page_layout', :controller => 'my', :action => 'page_layout', :via => :get
+ match 'my/add_block', :controller => 'my', :action => 'add_block', :via => :post
+ match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post
+ match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post
+
+ resources :users
+ match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership'
+ match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete
+ match 'users/:id/memberships', :to => 'users#edit_membership', :via => :post, :as => 'user_memberships'
+ ################# added by william
+ match 'users/tag_save', :to => 'users#tag_save', :via => :post, :as => 'tag'
+
+ post 'watchers/watch', :to => 'watchers#watch', :as => 'watch'
+ delete 'watchers/watch', :to => 'watchers#unwatch'
+ get 'watchers/new', :to => 'watchers#new'
+ post 'watchers', :to => 'watchers#create'
+ post 'watchers/append', :to => 'watchers#append'
+ delete 'watchers', :to => 'watchers#destroy'
+ get 'watchers/autocomplete_for_user', :to => 'watchers#autocomplete_for_user'
+ # Specific routes for issue watchers API
+ post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
+ delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
+
+ resources :bids, :only=>[:edit,:update,:show] do
+ member do
+ match 'homework_ajax_modal'
+ end
+ end
+ resources :projects do
+ member do
+ post 'finishcourse'
+ post 'restartcourse'
+ get 'settings(/:tab)', :action => 'settings', :as => 'settings'
+ #by young
+ get 'member', :controller => 'projects', :action => 'member', :as => 'member'
+ get 'file', :action => 'file', :as => 'file'
+ get 'statistics', :action => 'statistics', :as => 'statistics'
+ get 'feedback', :action => 'feedback', :as => 'project_feedback'
+ get 'watcherlist', :action=> 'watcherlist'
+ match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang
+ get 'homework', :action => 'homework', :as => 'homework'
+ get 'new_homework', :action => 'new_homework', :as => 'new_homework'
+ #get 'news', :action => 'news', :as => 'news'
+ #end
+ post 'modules'
+ post 'archive'
+ post 'unarchive'
+ post 'close'
+ post 'reopen'
+ match 'copy', :via => [:get, :post]
+ end
+
+
+ #by young
+ match '/member', :controller => 'projects', :action => 'member', :as => 'member', :via => :get
+ match '/file', :controller => 'projects', :action => 'file', :as => 'file', :via => :get
+ match '/statistics', :controller => 'projects', :action => 'statistics', :as => 'statistics', :via => :get
+ # match '/investor', :controller => 'projects', :action => 'investor', :as => 'investor', :via => :get
+ match '/homework', :controller => 'projects', :action => 'homework', :as => 'homework', :via => :get
+
+
+ # match '/activity', :controller => 'activities', :action => 'index', :as => 'activity', :via => :get
+ # match '/repository', :controller => 'repositories', :action => 'show', :repository_id => nil, :path => nil, :rev => nil, :as => 'repository', :via => :get
+ # match '/', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
+ # get 'projects/:project_id/show', :to => 'projects#show', :as => 'project_show'
+ # get 'projects/:project_id/repository', :to => 'repositories#show', :as => 'project_repository'
+
+ # match '/show', :controller => 'projects', :action => 'show', :as => 'project_show', :via => :get
+ match '/watcherlist', :controller=>'projects', :action=> 'watcherlist', :as => 'watcherlist', :via => :get #add by huang
+ # matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get
+ #end
+
+ resources :memberships, :shallow => true, :controller => 'members', :only => [:index, :show, :new, :create, :update, :destroy] do
+ collection do
+ get 'autocomplete'
+ end
+ end
+
+ resource :enumerations, :controller => 'project_enumerations', :only => [:update, :destroy]
+
+ get 'issues/:copy_from/copy', :to => 'issues#new', :as => 'copy_issue'
+ resources :issues, :only => [:index, :new, :create] do
+ resources :time_entries, :controller => 'timelog' do
+ collection do
+ get 'report'
+ end
+ end
+ end
+ # issue form update
+ match 'issues/update_form', :controller => 'issues', :action => 'update_form', :via => [:put, :post], :as => 'issue_form'
+
+ resources :files, :only => [:index, :new, :create]
+
+ resources :versions, :except => [:index, :show, :edit, :update, :destroy] do
+ collection do
+ put 'close_completed'
+ end
+ end
+ get 'versions.:format', :to => 'versions#index'
+ get 'roadmap', :to => 'versions#index', :format => false
+ get 'versions', :to => 'versions#index'
+
+ resources :news, :except => [:show, :edit, :update, :destroy]
+ resources :time_entries, :controller => 'timelog' do
+ get 'report', :on => :collection
+ end
+ resources :queries, :only => [:new, :create]
+ resources :issue_categories, :shallow => true
+ resources :documents, :except => [:show, :edit, :update, :destroy]
+ resources :boards
+ resources :repositories, :shallow => true, :except => [:index, :show] do
+ member do
+ match 'committers', :via => [:get, :post]
+ end
+ end
+ resources :repositories, :except => [:index, :show] do
+ member do
+ get 'newrepo', :via => [:get, :post]
+ # get 'create', :via=>[:get, :post]
+ end
+ end
+ match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
+ resources :wiki, :except => [:index, :new, :create], :as => 'wiki_page' do
+ member do
+ get 'rename'
+ post 'rename'
+ get 'history'
+ get 'diff'
+ match 'preview', :via => [:post, :put]
+ post 'protect'
+ post 'add_attachment'
+ end
+ collection do
+ get 'export'
+ get 'date_index'
+ end
+ end
+ match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
+ get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
+ delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
+ get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
+ get 'wiki/:id/:version/diff', :to => 'wiki#diff'
+ end
+
+ resources :issues do
+ collection do
+ match 'bulk_edit', :via => [:get, :post]
+ post 'bulk_update'
+ end
+ resources :time_entries, :controller => 'timelog' do
+ collection do
+ get 'report'
+ end
+ end
+ resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy]
+ end
+ match '/issues', :controller => 'issues', :action => 'destroy', :via => :delete
+
+ resources :queries, :except => [:show]
+
+ resources :news, :only => [:index, :show, :edit, :update, :destroy]
+ match '/news/:id/comments', :to => 'comments#create', :via => :post
+ match '/news/:id/comments/:comment_id', :to => 'comments#destroy', :via => :delete
+
+ resources :versions, :only => [:show, :edit, :update, :destroy] do
+ post 'status_by', :on => :member
+ end
+
+ resources :documents, :only => [:show, :edit, :update, :destroy] do
+ post 'add_attachment', :on => :member
+ end
+
+ match '/time_entries/context_menu', :to => 'context_menus#time_entries', :as => :time_entries_context_menu, :via => [:get, :post]
+
+ resources :time_entries, :controller => 'timelog', :except => :destroy do
+ collection do
+ get 'report'
+ get 'bulk_edit'
+ post 'bulk_update'
+ end
+ end
+ match '/time_entries/:id', :to => 'timelog#destroy', :via => :delete, :id => /\d+/
+ # TODO: delete /time_entries for bulk deletion
+ match '/time_entries/destroy', :to => 'timelog#destroy', :via => :delete
+
+ get 'projects/:id/activity', :to => 'activities#index'
+ get 'projects/:id/activity.:format', :to => 'activities#index'
+ get 'activity', :to => 'activities#index'
+
+ # repositories routes
+ get 'projects/:id/repository/:repository_id/statistics', :to => 'repositories#stats'
+ get 'projects/:id/repository/:repository_id/graph', :to => 'repositories#graph'
+
+ get 'projects/:id/repository/:repository_id/changes(/*path(.:ext))', :to => 'repositories#changes'
+
+ get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision'
+ get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision'
+ post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue'
+ delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
+ get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
+ get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))',
+ :controller => 'repositories',
+ :format => false,
+ :constraints => {
+ :action => /(browse|show|entry|raw|annotate|diff)/,
+ :rev => /[a-z0-9\.\-_]+/
+ }
+
+ get 'projects/:id/repository/statistics', :to => 'repositories#stats'
+ get 'projects/:id/repository/graph', :to => 'repositories#graph'
+
+ get 'projects/:id/repository/changes(/*path(.:ext))', :to => 'repositories#changes'
+
+ get 'projects/:id/repository/revisions', :to => 'repositories#revisions'
+ get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision'
+ get 'projects/:id/repository/revision', :to => 'repositories#revision'
+ post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue'
+ delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
+ get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))',
+ :controller => 'repositories',
+ :format => false,
+ :constraints => {
+ :action => /(browse|show|entry|raw|annotate|diff)/,
+ :rev => /[a-z0-9\.\-_]+/
+ }
+ get 'projects/:id/repository/:repository_id/:action(/*path(.:ext))',
+ :controller => 'repositories',
+ :action => /(browse|show|entry|raw|changes|annotate|diff)/
+ get 'projects/:id/repository/:action(/*path(.:ext))',
+ :controller => 'repositories',
+ :action => /(browse|show|entry|raw|changes|annotate|diff)/
+
+ get 'projects/:id/repository/:repository_id', :to => 'repositories#show', :path => nil
+ get 'projects/:id/repository', :to => 'repositories#show', :path => nil
+
+ # additional routes for having the file name at the end of url
+ get 'attachments/:id/:filename', :to => 'attachments#show', :id => /\d+/, :filename => /.*/, :as => 'named_attachment'
+ get 'attachments/download/:id/:filename', :to => 'attachments#download', :id => /\d+/, :filename => /.*/, :as => 'download_named_attachment'
+ get 'attachments/download/:id', :to => 'attachments#download', :id => /\d+/
+ get 'attachments/thumbnail/:id(/:size)', :to => 'attachments#thumbnail', :id => /\d+/, :size => /\d+/, :as => 'thumbnail'
+ get 'attachments/autocomplete'
+ match 'attachments/autocomplete', :to => 'attachments#autocomplete', via: [:post]
+ post 'attachments/relationfile', to: 'attachments#add_exist_file_to_project', as: 'attach_relation'
+ resources :attachments, :only => [:show, :destroy]
+
+ resources :groups do
+ member do
+ get 'autocomplete_for_user'
+ end
+ end
+
+ match 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :via => :post, :as => 'group_users'
+ match 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :via => :delete, :as => 'group_user'
+ match 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :via => :post
+ match 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :via => :post
+
+ resources :trackers, :except => :show do
+ collection do
+ match 'fields', :via => [:get, :post]
+ end
+ end
+ resources :issue_statuses, :except => :show do
+ collection do
+ post 'update_issue_done_ratio'
+ end
+ end
+ resources :custom_fields, :except => :show
+ resources :roles do
+ collection do
+ match 'permissions', :via => [:get, :post]
+ end
+ end
+ resources :enumerations, :except => :show
+ match 'enumerations/:type', :to => 'enumerations#index', :via => :get
+
+ get 'projects/:id/search', :controller => 'search', :action => 'index'
+ get 'search', :controller => 'search', :action => 'index'
+
+ match 'mail_handler', :controller => 'mail_handler', :action => 'index', :via => :post
+
+ match 'admin', :controller => 'admin', :action => 'index', :via => :get
+ match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get
+ match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get
+ match 'admin/info', :controller => 'admin', :action => 'info', :via => :get
+ match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get
+ match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post
+
+ resources :auth_sources do
+ member do
+ get 'test_connection', :as => 'try_connection'
+ end
+ collection do
+ get 'autocomplete_for_new_user'
+ end
+ end
+
+
+
+ match 'workflows', :controller => 'workflows', :action => 'index', :via => :get
+ match 'workflows/edit', :controller => 'workflows', :action => 'edit', :via => [:get, :post]
+ match 'workflows/permissions', :controller => 'workflows', :action => 'permissions', :via => [:get, :post]
+ match 'workflows/copy', :controller => 'workflows', :action => 'copy', :via => [:get, :post]
+ match 'settings', :controller => 'settings', :action => 'index', :via => :get
+ match 'settings/edit', :controller => 'settings', :action => 'edit', :via => [:get, :post]
+ match 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :via => [:get, :post], :as => 'plugin_settings'
+
+ match 'sys/projects', :to => 'sys#projects', :via => :get
+ match 'sys/projects/:id/repository', :to => 'sys#create_project_repository', :via => :post
+ match 'sys/fetch_changesets', :to => 'sys#fetch_changesets', :via => :get
+
+ match 'uploads', :to => 'attachments#upload', :via => :post
+ # Added by Tao
+ match 'upload_avatar', :to => 'avatar#upload', :via => :post
+ # Endof Tao's code
+ get 'robots.txt', :to => 'welcome#robots'
+
+ Dir.glob File.expand_path("plugins/*", Rails.root) do |plugin_dir|
+ file = File.join(plugin_dir, "config/routes.rb")
+ if File.exists?(file)
+ begin
+ instance_eval File.read(file)
+ rescue Exception => e
+ puts "An error occurred while loading the routes definition of #{File.basename(plugin_dir)} plugin (#{file}): #{e.message}."
+ exit 1
+ end
+ end
+ end
+
+ ##############测试留言功能 fq
+ post 'words/new', :to => 'words#new'
+ post 'words/create', :to => 'words#create'
+ post 'words/append', :to => 'words#append'
+ post 'words/create_reply', :to => 'words#create_reply'
+ delete 'words/destroy', :to => 'words#destroy'
+ get 'words/more', :to => 'words#more'
+ get 'words/back', :to=> 'words#back'
+ ############## fq
+ post 'calls/create', :to => 'bids#create'
+ delete 'calls/destroy', :to => 'bids#destroy'
+ match 'calls/new', :controller => 'bids', :action => 'new', :via => [:get , :post]
+ get 'calls/more', :to => 'bids#more'
+ get 'calls/back', :to=> 'bids#back'
+ match 'calls/new_bid', :controller => 'bids', :action => 'new_bid'
+ match 'contest/new_contest', :controller => 'bids', :action => 'new_contest' #huang
+ match 'calls/:id/show_project', :controller => 'bids', :action => 'show_project', :as => 'project_for_bid'
+ match 'calls/:id/show_project_homework', :controller => 'bids', :action => 'show_project_homework', :as => 'project_for_bid_homework' # by huang
+ match 'calls/:id/add', :controller => 'bids', :action => 'add'
+ match 'calls/:id/add_homework', :controller => 'bids', :action => 'add_homework', via: :post
+ match 'calls/:id/new_submit_homework', to: 'bids#new_submit_homework', via: :get, as: 'new_submit_homework'
+ match 'words/add_project_respond', :controller => 'words', :action => 'add_project_respond'
+ match 'words/:id/leave_project_message', :controller => 'words', :action => 'leave_project_message'
+
+ match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
+ match 'calls/create_bid', :to => 'bids#create_bid'
+ match 'contest/create_contest', :to => 'bids#create_contest' #huang
+ match 'calls/create_homework', :to => 'bids#create_homework'
+ match 'calls/:id/homework_respond', :to => 'bids#homework_respond'
+ match 'calls/:id/homework_statistics', :to => 'bids#homework_statistics'
+ match 'calls/:id/fork', :to => 'bids#fork', :as => 'fork'
+ match 'calls/:id/create_fork', :to => 'bids#create_fork'
+ match 'project/enterprise_course', :to => 'projects#enterprise_course'
+ match 'project/course_enterprise', :to => 'projects#course_enterprise'
+ match 'calls/:id/show_course', :to => 'bids#show_course', :as => 'show_course'
+ match 'calls/:id/show_bid_project', :to => 'bids#show_bid_project', :as => 'show_bid_project'
+ match 'calls/:id/show_bid_user', :to => 'bids#show_bid_user', :as => 'show_bid_user'
+
+ match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
+
+ post 'join_in/join', :to => 'courses#join', :as => 'join'
+ delete 'join_in/join', :to => 'courses#unjoin'
+ post 'calls/:id/join_in_contest', :to => 'bids#join_in_contest', :as => 'join_in_contest'
+ delete 'calls/:id/join_in_contest', :to => 'bids#unjoin_in_contest'
+ match 'calls/:id/show_participator', :to => 'bids#show_participator' #bai
+ match 'calls/:id/update_contest', :to => 'bids#update_contest' #bai
+ match 'calls/:id/settings', :to => 'bids#settings' #bai
+
+ delete 'attachment/:id', :to => 'attachments#delete_homework'
+ match 'new_join', :to => 'projects#new_join', :as => 'try_join'
+ match 'new_join_in_contest', :to => 'bids#new_join', :as => 'try_join_in_contest'
+ match 'projects/:id/respond', :to => 'projects#project_respond', :via => :post
+ match 'calls/:id/manage',:to => 'bids#manage',:via => [:get,:post]
+ match 'project/course', :to => 'projects#course', :as => 'course'
+
+ #added by william
+ # match 'calls/:id/set_results',:controller => 'bids', :action => 'set_results',:via => [:get,:post],:as => 'set_results'
+ # match 'calls/:id/set_prizes',:controller => 'bids',:action => 'set_prizes',:as => 'set_prizes'
+ match 'calls/:id/set_reward',:controller => 'bids',:action => 'set_reward',:as => 'set_reward'
+
+ # added by young
+ match 'calls', :controller => 'bids', :action => 'index'
+
+ match 'calls/:id', :controller => 'bids', :action => 'show', :as => 'respond'
+ match 'contest', :controller => 'bids', :action => 'contest', :as => 'contest'
+
+
+ ########################
+ ##added by wen##########
+ #######confusing########
+ post 'school/get_options/:province', :to => 'school#get_options'
+ get 'school/get_options/:province', :to => 'school#get_options'
+
+
+
+ ######added by nie
+ match 'tags/show_projects_tags',:to => 'tags#show_projects_tags'
+ ########### added by liuping
+ match 'tags/add_tag',:to => 'tags#add_tag',:as=>"add_tag"
+ match 'tags/delete_tag',:to => 'tags#delete_tag',:as=>"add_tag"
+ match 'tags/show_all',:to => 'tags#show_all'
+ match 'parise_tread/praise_plus',:to => 'parise_tread#praise_plus',:as=>"praise"
+ match 'parise_tread/tread_plus',:to => 'parise_tread#tread_plus',:as=>"tread"
+ match 'tags/delete',:to=>'tags#delete'
+ match 'tags/remove_tag',:to=>'tags#remove_tag',:as=>"remove_tag"
+
+ match 'words/add_brief_introdution', :controller => 'words', :action => 'add_brief_introdution'
+
+ get ':controller(/:action(/:id))'
+end
diff --git a/db/migrate/20140415090718_remove_schoolid_from_courses.rb b/db/migrate/20140415090718_remove_schoolid_from_courses.rb
new file mode 100644
index 000000000..96b3a4ace
--- /dev/null
+++ b/db/migrate/20140415090718_remove_schoolid_from_courses.rb
@@ -0,0 +1,11 @@
+class RemoveSchoolidFromCourses < ActiveRecord::Migration
+ def up
+ remove_column :courses, :school_id
+
+ end
+
+ def down
+ add_column :courses, :school_id, :integer
+
+ end
+end
diff --git a/db/migrate/20140415090829_add_school_name_to_courses.rb b/db/migrate/20140415090829_add_school_name_to_courses.rb
new file mode 100644
index 000000000..1c9175e12
--- /dev/null
+++ b/db/migrate/20140415090829_add_school_name_to_courses.rb
@@ -0,0 +1,6 @@
+class AddSchoolNameToCourses < ActiveRecord::Migration
+ def change
+ add_column :courses, :school_name, :string
+
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 9584fa817..a5cb5409c 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 => 20140320022724) do
+ActiveRecord::Schema.define(:version => 20140415090829) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@@ -157,6 +157,38 @@ ActiveRecord::Schema.define(:version => 20140320022724) do
add_index "comments", ["author_id"], :name => "index_comments_on_author_id"
add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type"
+ create_table "contesting_projects", :force => true do |t|
+ t.integer "project_id"
+ t.string "contest_id"
+ t.integer "user_id"
+ t.string "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "reward"
+ end
+
+ create_table "contesting_softapplications", :force => true do |t|
+ t.integer "softapplication_id"
+ t.integer "contest_id"
+ t.integer "user_id"
+ t.string "description"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "reward"
+ end
+
+ create_table "contests", :force => true 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.datetime "created_on", :null => false
+ t.datetime "updated_on", :null => false
+ end
+
create_table "courses", :force => true do |t|
t.integer "tea_id"
t.string "name"
@@ -173,7 +205,7 @@ ActiveRecord::Schema.define(:version => 20140320022724) do
t.string "setup_time"
t.string "endup_time"
t.string "class_period"
- t.integer "school_id"
+ t.string "school_name"
end
create_table "custom_fields", :force => true do |t|
@@ -354,6 +386,13 @@ ActiveRecord::Schema.define(:version => 20140320022724) do
add_index "issues", ["status_id"], :name => "index_issues_on_status_id"
add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id"
+ create_table "join_in_competitions", :force => true do |t|
+ t.integer "user_id"
+ t.integer "competition_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "join_in_contests", :force => true do |t|
t.integer "user_id"
t.integer "bid_id"
@@ -645,6 +684,21 @@ ActiveRecord::Schema.define(:version => 20140320022724) do
t.string "description"
end
+ create_table "softapplications", :force => true 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.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.integer "contest_id"
+ t.integer "softapplication_id"
+ t.integer "is_public"
+ t.string "application_developers"
+ end
+
create_table "students_for_courses", :force => true do |t|
t.integer "student_id"
t.integer "course_id"
@@ -758,6 +812,16 @@ ActiveRecord::Schema.define(:version => 20140320022724) do
add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id"
+ create_table "user_scores", :force => true do |t|
+ t.integer "user_id", :null => false
+ t.integer "collaboration"
+ t.integer "influence"
+ t.integer "skill"
+ t.integer "active"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
create_table "user_statuses", :force => true do |t|
t.integer "changesets_count"
t.integer "watchers_count"
diff --git a/lib/tasks/rubyzip.rake b/lib/tasks/rubyzip.rake
new file mode 100644
index 000000000..349ced29b
--- /dev/null
+++ b/lib/tasks/rubyzip.rake
@@ -0,0 +1,38 @@
+desc "nyan ruby zip operation"
+task :zip do
+ puts "input rake zip:clean_tmp will removed tmp/*.zip ."
+end
+
+namespace :zip do
+ desc "ruby zip sweeper"
+ task :clean_tmp do
+ unless File.exist?(Dir.pwd+"/tmp/archiveZip")
+ puts "tmp/archiveZip folder is not exist. "
+ next
+ end
+
+ puts "ruby zip sweeping..."
+ Dir.chdir('tmp/archiveZip') do
+ Dir['*'].select do |file|
+ if file =~ /archive_\d+\.zip/
+ File.delete(file)
+ puts "#{file} is deleted."
+ end
+ end
+ end
+ puts "ruby zip sweeping is done."
+ end
+end
+
+desc "create tmp file, to test"
+file 'tmp/test.yml' do
+ require 'yaml'
+ var = {
+ :name => "name",
+ :age => "age",
+ :agent => "agent"
+ }
+ File.open('tmp/test.yml', 'w') do |f|
+ f.write YAML.dump({'conf' => var })
+ end
+end
\ No newline at end of file
diff --git a/public/images/footer_logo/buaa_scse.jpg b/public/images/footer_logo/buaa_scse.jpg
new file mode 100644
index 000000000..68ebbc1d3
Binary files /dev/null and b/public/images/footer_logo/buaa_scse.jpg differ
diff --git a/public/images/footer_logo/inforbus.jpg b/public/images/footer_logo/inforbus.jpg
new file mode 100644
index 000000000..f3249be16
Binary files /dev/null and b/public/images/footer_logo/inforbus.jpg differ
diff --git a/public/images/footer_logo/iscas.jpg b/public/images/footer_logo/iscas.jpg
new file mode 100644
index 000000000..a26ccad38
Binary files /dev/null and b/public/images/footer_logo/iscas.jpg differ
diff --git a/public/images/footer_logo/nudt.jpg b/public/images/footer_logo/nudt.jpg
new file mode 100644
index 000000000..15adbbfd9
Binary files /dev/null and b/public/images/footer_logo/nudt.jpg differ
diff --git a/public/images/footer_logo/pdl.jpg b/public/images/footer_logo/pdl.jpg
new file mode 100644
index 000000000..15adbbfd9
Binary files /dev/null and b/public/images/footer_logo/pdl.jpg differ
diff --git a/public/images/footer_logo/peking_eecs.jpg b/public/images/footer_logo/peking_eecs.jpg
new file mode 100644
index 000000000..e00692bc5
Binary files /dev/null and b/public/images/footer_logo/peking_eecs.jpg differ
diff --git a/public/javascripts/attachments.js b/public/javascripts/attachments.js
index 7b8394fe8..3d1520f84 100644
--- a/public/javascripts/attachments.js
+++ b/public/javascripts/attachments.js
@@ -7,14 +7,14 @@ function addFile(inputEl, file, eagerUpload) {
var attachmentId = addFile.nextAttachmentId++;
- var fileSpan = $('', { id: 'attachments_' + attachmentId });
+ var fileSpan = $('', { 'id': 'attachments_' + attachmentId, 'class':'attachment' });
fileSpan.append(
- $('', { type: 'text', 'class': 'filename readonly', name: 'attachments[' + attachmentId + '][filename]', readonly: 'readonly'} ).val(file.name),
- $('', { type: 'text', 'class': 'description', name: 'attachments[' + attachmentId + '][description]', maxlength: 255, placeholder: $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload),
- $(' ').attr({ href: "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload)
+ $('', { 'type': 'text', 'class': 'filename readonly', 'name': 'attachments[' + attachmentId + '][filename]', 'readonly': 'readonly'} ).val(file.name),
+ $('', { 'type': 'text', 'class': 'description', 'name': 'attachments[' + attachmentId + '][description]', 'maxlength': 255, 'placeholder': $(inputEl).data('description-placeholder') } ).toggle(!eagerUpload),
+ $(' ').attr({ 'href': "#", 'class': 'remove-upload', 'data-confirm' : "您确定要删除吗?" }).click(removeFile).toggle(!eagerUpload)
).appendTo('#attachments_fields');
-
+
if(eagerUpload) {
ajaxUpload(file, attachmentId, fileSpan, inputEl);
}
@@ -63,6 +63,22 @@ function ajaxUpload(file, attachmentId, fileSpan, inputEl) {
}
form.dequeue('upload');
});
+
+ //gcm files count and add delete_all link
+
+ var count=$('#attachments_fields>span').length;
+ $('#upload_file_count').html("已上传"+""+count+""+"个文件");
+
+ if(count>=1){
+ var add_attachs=$('.add_attachment');
+ var delete_all=$('.remove_all');
+ if(delete_all.length<1){
+ add_attachs.append($(" ").attr({"href":"javascript:void(0)", 'class': 'remove_all',"onclick": "removeAll()"}));
+ }
+ }
+
+ //gcm
+
}
var progressSpan = $('').insertAfter(fileSpan.find('input.filename'));
@@ -84,6 +100,16 @@ function removeFile() {
return false;
}
+//gcm delete all file
+function removeAll(){
+ if(confirm("您确定要删除所有文件吗?")){
+ $(".remove-upload").removeAttr("data-confirm");
+ $(".remove-upload").click();
+ }
+// return false;
+}
+//gcm
+
function uploadBlob(blob, uploadUrl, attachmentId, options) {
var actualOptions = $.extend({
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index e60316841..c3572f930 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -1727,7 +1727,7 @@ ul.properties li span {font-style:italic;}
/*end*/
.autoscroll {overflow-x: auto; padding:1px; margin-bottom: 1.2em;}
-#user_login, #user_firstname, #user_lastname, #user_mail, #my_account_form select, #user_form select, #user_identity_url { width: 60%; }
+/*#user_login, #user_firstname, #user_lastname, #user_mail, #my_account_form select, #user_form select, #user_identity_url { width: 45%; }*/
#workflow_copy_form select { width: 200px; }
table.transitions td.enabled {background: #bfb;}
@@ -1821,6 +1821,11 @@ span.required {color: #bb0000;}
a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block; padding-left:16px;}
a.remove-upload:hover {text-decoration:none !important;}
+/*gcm upload file count and deleteall*/
+#upload_file_count #count {color:red; font-size:1.5em;}
+span.add_attachment .remove_all {background:none;background: url(../images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block;position:absolute;right:21px;text-decoration:none;}
+
+
div.fileover { background-color: lavender; }
div.attachments { margin-top: 12px; }
diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css
index c68e36cd7..cc321a425 100644
--- a/public/themes/redpenny-master/stylesheets/application.css
+++ b/public/themes/redpenny-master/stylesheets/application.css
@@ -456,6 +456,7 @@ ul.projects li.root
width:auto;
float:center;
min-height:800px;
+ border: 1px solid #ffffff;
}
/*by huang*/
@@ -981,7 +982,8 @@ hr
}
p
{
- font-size: 13px
+ font-size: 13px;
+ position:relative;/*gcm*/
}
/*end*/
div.issue
@@ -1906,6 +1908,10 @@ input[type="submit"], .button_submit {
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.2), 0px 1px 0px rgb(255, 255, 255);
cursor: pointer;
}
+.button_submit_font_white{
+ color: white !important ;
+ font-weight: 400;
+}
input[type="button-submit"] {
padding-bottom: 5px;
diff --git a/test/functional/zipdown_controller_test.rb b/test/functional/zipdown_controller_test.rb
new file mode 100644
index 000000000..f74dcc1c0
--- /dev/null
+++ b/test/functional/zipdown_controller_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class ZipdownControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
diff --git a/test/unit/helpers/zipdown_helper_test.rb b/test/unit/helpers/zipdown_helper_test.rb
new file mode 100644
index 000000000..ca30cb362
--- /dev/null
+++ b/test/unit/helpers/zipdown_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class ZipdownHelperTest < ActionView::TestCase
+end
|