修改osp的show界面,建立框架

This commit is contained in:
fanqiang 2014-04-03 14:41:04 +08:00
parent cfa5532598
commit e8de48dd24
12 changed files with 463 additions and 47 deletions

View File

@ -1,4 +1,7 @@
class OpenSourceProjectsController < ApplicationController
helper :sort
include SortHelper
# GET /open_source_projects
# GET /open_source_projects.json
def index
@ -21,6 +24,33 @@ class OpenSourceProjectsController < ApplicationController
# GET /open_source_projects/1.json
def show
@open_source_project = OpenSourceProject.find(params[:id])
sort_init 'updated_at', 'desc'
sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
'replies' => "#{RelativeMemo.table_name}.replies_count",
'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
@memo = RelativeMemo.new(:open_source_project => @open_source_project)
@topic_count = @open_source_project.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@memos = @open_source_project.topics.
reorder("#{RelativeMemo.table_name}.sticky DESC").
includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
order(sort_clause).
all
# @offset, @limit = api_offset_and_limit({:limit => 10})
# @forum = Forum.find(params[:id])
# @memos_all = @forum.topics
# @topic_count = @memos_all.count
# @topic_pages = Paginator.new @topic_count, @limit, params['page']
# @offset ||= @topic_pages.offset
# @memos = @memos_all.offset(@offset).limit(@limit).all
respond_to do |format|
format.html {

View File

@ -0,0 +1,123 @@
class RelativeMemosController < ApplicationController
helper :sort
include SortHelper
# GET /open_source_projects
# GET /open_source_projects.json
def index
# per_page_option = 10
#
# @open_source_projects = OpenSourceProject.all
#
# @os_project_count = @open_source_projects.count
# @os_project_pages = Paginator.new @os_project_count, per_page_option, params['page']
#
# @open_source_projects = OpenSourceProject.all
#
# respond_to do |format|
# format.html # index.html.erb
# format.json { render json: @open_source_projects }
# end
end
# GET /open_source_projects/1
# GET /open_source_projects/1.json
def show
# @open_source_project = OpenSourceProject.find(params[:id])
#
# sort_init 'updated_at', 'desc'
# sort_update 'created_at' => "#{RelativeMemo.table_name}.created_at",
# 'replies' => "#{RelativeMemo.table_name}.replies_count",
# 'updated_at' => "COALESCE (last_replies_relative_memos.created_at, #{RelativeMemo.table_name}.created_at)"
#
# @memo = RelativeMemo.new(:open_source_project => @open_source_project)
# @topic_count = @open_source_project.topics.count
# @topic_pages = Paginator.new @topic_count, per_page_option, params['page']
# @memos = @open_source_project.topics.
# reorder("#{RelativeMemo.table_name}.sticky DESC").
# includes(:last_reply).
# limit(@topic_pages.per_page).
# offset(@topic_pages.offset).
# order(sort_clause).
# all
# @offset, @limit = api_offset_and_limit({:limit => 10})
# @forum = Forum.find(params[:id])
# @memos_all = @forum.topics
# @topic_count = @memos_all.count
# @topic_pages = Paginator.new @topic_count, @limit, params['page']
# @offset ||= @topic_pages.offset
# @memos = @memos_all.offset(@offset).limit(@limit).all
# respond_to do |format|
# format.html {
# render :layout => "base_opensource_p"
# }
# format.json { render json: @open_source_project }
# end
end
# GET /open_source_projects/new
# GET /open_source_projects/new.json
def new
@open_source_project = OpenSourceProject.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @open_source_project }
end
end
# GET /open_source_projects/1/edit
def edit
@open_source_project = OpenSourceProject.find(params[:id])
end
# POST /open_source_projects
# POST /open_source_projects.json
def create
@open_source_project = OpenSourceProject.new(params[:open_source_project])
respond_to do |format|
if @open_source_project.save
format.html { redirect_to @open_source_project, notice: 'Open source project was successfully created.'}
format.json { render json: @open_source_project, status: :created, location: @open_source_project }
else
format.html { render action: "new" }
format.json { render json: @open_source_project.errors, status: :unprocessable_entity }
end
end
end
# PUT /open_source_projects/1
# PUT /open_source_projects/1.json
def update
@open_source_project = OpenSourceProject.find(params[:id])
respond_to do |format|
if @open_source_project.update_attributes(params[:open_source_project])
format.html { redirect_to @open_source_project, notice: 'Open source project was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: "edit" }
format.json { render json: @open_source_project.errors, status: :unprocessable_entity }
end
end
end
# DELETE /open_source_projects/1
# DELETE /open_source_projects/1.json
def destroy
@open_source_project = OpenSourceProject.find(params[:id])
@open_source_project.destroy
respond_to do |format|
format.html { redirect_to open_source_projects_url }
format.json { head :no_content }
end
end
end

View File

@ -1,10 +1,25 @@
class OpenSourceProject < ActiveRecord::Base
attr_accessible :String
include Redmine::SafeAttributes
has_many :topics, :class_name => 'RelativeMemo', :foreign_key => 'osp_id', :conditions => "#{RelativeMemo.table_name}.parent_id IS NULL", :order => "#{RelativeMemo.table_name}.created_at DESC", :dependent => :destroy
has_many :relative_memos, :dependent => :destroy
has_many :tags, :through => :project_tags, :class_name => 'Tag'
has_many :project_tags, :class_name => 'ProjectTags'
acts_as_taggable
def short_description(length = 255)
description.gsub(/^(.{#{length}}[^\n\r]*).*$/m, '\1...').strip if description
end
def reset_counters!
self.class.reset_counters!(id)
end
def self.reset_counters!(id)
osp_id = id.to_i
update_all("topic_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NULL)," +
" memo_count = (SELECT COUNT(*) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id} AND parent_id IS NOT NULL)," +
" last_memo_id = (SELECT MAX(id) FROM #{RelativeMemo.table_name} WHERE osp_id=#{osp_id})",
["id = ?", osp_id])
end
end

View File

@ -1,3 +1,152 @@
class RelativeMemo < ActiveRecord::Base
# attr_accessible :title, :body
include Redmine::SafeAttributes
belongs_to :open_source_project, :class_name => "OpenSourceProject", :foreign_key => 'osp_id'
belongs_to :author, :class_name => "User", :foreign_key => 'author_id'
has_many :tags, :through => :project_tags, :class_name => 'Tag'
has_many :project_tags, :class_name => 'ProjectTags'
acts_as_taggable
validates_presence_of :osp_id, :subject
#validates :content, presence: true
# validates_length_of :subject, maximum: 50
#validates_length_of :content, maximum: 3072
validate :cannot_reply_to_locked_topic, :on => :create
acts_as_tree :counter_cache => :replies_count, :order => "#{RelativeMemo.table_name}.created_at ASC"
acts_as_attachable
belongs_to :last_reply, :class_name => 'RelativeMemo', :foreign_key => 'last_reply_id'
# acts_as_searchable :column => ['subject', 'content'],
# #:include => { :forum => :p}
# #:project_key => "#{Forum.table_name}.project_id"
# :date_column => "#{table_name}.created_at"
# acts_as_event :title => Proc.new {|o| "#{o.forum.name}: #{o.subject}"},
# :datetime => :updated_at,
# # :datetime => :created_at,
# :description => :content,
# :author => :author,
# :type => Proc.new {|o| o.parent_id.nil? ? 'Memo' : 'Reply'},
# :url => Proc.new {|o| {:controller => 'memos', :action => 'show', :forum_id => o.forum_id}.merge(o.parent_id.nil? ? {:id => o.id} : {:id => o.parent_id, :r => o.id, :anchor => "reply-#{o.id}"})}
# acts_as_activity_provider :author_key => :author_id,
# :func => 'memos',
# :timestamp => 'created_at'
# :find_options => {:type => 'memos'}
# acts_as_watchable
safe_attributes "author_id",
"subject",
"content",
"osp_id",
"last_memo_id",
"lock",
"sticky",
"parent_id",
"replies_count",
"is_quote"
after_create :add_author_as_watcher, :reset_counters!
# after_update :update_memos_forum
after_destroy :reset_counters!
# after_create :send_notification
# after_save :plusParentAndForum
# after_destroy :minusParentAndForum
# scope :visible, lambda { |*args|
# includes(:forum => ).where()
# }
def cannot_reply_to_locked_topic
errors.add :base, l(:label_memo_locked) if root.locked? && self != root
end
# def update_memos_forum
# if forum_id_changed?
# Message.update_all({:board_id => board_id}, ["id = ? OR parent_id = ?", root.id, root.id ])
# Forum.reset_counters!(forum_id_was)
# Forum.reset_counters!(forum_id)
# end
# end
def reset_counters!
if parent && parent.id
RelativeMemo.update_all({:last_reply_id => parent.children.maximum(:id)}, {:id => parent.id})
parent.update_attribute(:updated_at, Time.now)
end
forum.reset_counters!
end
def sticky?
sticky == 1
end
def replies
RelativeMemo.where("parent_id = ?", id)
end
def locked?
self.lock
end
def editable_by? user
# user && user.logged? || (self.author == usr && usr.allowed_to?(:edit_own_messages, project))
user.admin?
end
# def destroyable_by? user
# (user && user.logged? && (Forum.find(self.forum_id).creator_id == user.id) ) || user.admin?
# #self.author == user || user.admin?
# end
def deleted_attach_able_by? user
(user && user.logged? && (self.author == user) ) || user.admin?
end
private
def add_author_as_watcher
Watcher.create(:watchable => self.root, :user => author)
end
def send_notification
if Setting.notified_events.include?('message_posted')
Mailer.message_posted(self).deliver
end
end
# def plusParentAndForum
# @forum = Forum.find(self.forum_id)
# @forum.memo_count = @forum.memo_count.to_int + 1
# @forum.last_memo_id = self.id
# if self.parent_id
# @parent_memo = Memo.find_by_id(self.parent_id)
# @parent_memo.last_reply_id = self
# @parent_memo.replies_count = @parent_memo.replies_count.to_int + 1
# @parent_memo.save
# else
# @forum.topic_count = @forum.topic_count.to_int + 1
# end
# @forum.save
# end
# def minusParentAndForum
# @forum = Forum.find(self.forum_id)
# @forum.memo_count = @forum.memo_count.to_int - 1
# @forum.memo_count = 0 if @forum.memo_count.to_int < 0
# # @forum.last_memo_id = Memo.reorder('created_at ASC').find_all_by_forum_id(self.forum_id).last.id
# if self.parent_id
# @parent_memo = Memo.find_by_id(self.parent_id)
# # @parent_memo.last_reply_id = Memo.reorder('created_at ASC').find_all_by_parent_id(self.parent_id).last.id
# @parent_memo.replies_count = @parent_memo.replies_count.to_int - 1
# @parent_memo.replies_count = 0 if @parent_memo.replies_count.to_int < 0
# @parent_memo.save
# else
# @forum.topic_count = @forum.topic_count.to_int - 1
# @forum.topic_count = 0 if @forum.topic_count.to_int < 0
# end
# @forum.save
# end
end

View File

@ -5,7 +5,7 @@
<% if memos.any? %>
<% memos.each do |topic| %>
<table class="content-text-list">
<tr><td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) %></td>
<tr><td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%></td>
<td>
<table width="630px" border="0">
<tr>

View File

@ -103,7 +103,7 @@
<!-- added by william -for tag -->
<div class="user_tags">
<div id="tags">
<%= render :partial => 'tags/tag', :locals => {:obj => @open_source_project,:object_flag => "2"}%>
<%= render :partial => 'tags/tag', :locals => {:obj => @open_source_project,:object_flag => "7"}%>
</div>
</div>
<!-- tag -->
@ -114,10 +114,10 @@
</div>
</div>
<div id="content">
<div id="content"><%#=
<div class="tabs_new">
</div>
</div>%>
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>

View File

@ -51,7 +51,7 @@
<div class="licences">
<%= content_tag('span', "数据更新时间") %><%= content_tag('span', format_time(project.created_at)) %>
</div>
</div>
</div>
<div class="tags">
<div id="tags">
<%= image_tag( "/images/sidebar/tags.png") %>

View File

@ -0,0 +1,57 @@
<!-- added by fq -->
<!--display the board-->
<div class="borad-topic-count">
共有 <%= link_to memos.count %> 个贴子
</div>
<div style="padding-top: 10px">
<% if memos.any? %>
<% memos.each do |topic| %>
<table class="content-text-list">
<tr>
<td colspan="2" valign="top" width="50" ><%= link_to image_tag(url_to_avatar(topic.author), :class => "avatar"), user_path(topic.author) if topic.author%></td>
<td>
<table width="630px" border="0">
<tr>
<td valign="top" width="500px" class="<%= topic.sticky ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>"><%= link_to h(topic.subject), open_source_project_relative_memo_path(topic.open_source_project, topic) %></td>
<td align="right" rowspan="3">
<table class="borad-count">
<tr>
<td align="center" class="borad-count-digit"><%= link_to (topic.replies_count), forum_memo_path(topic.open_source_project, topic) %></td>
</tr>
<tr>
<td align="center">回答</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" ><span class="font_description"> </span></td>
</tr>
<tr>
<td align="left" colspan="2" ><span class="font_lighter"><%#= authoring topic.created_at, topic.author %>
<br />
</span></td>
</tr>
<tr>
<td align="left" colspan="2" ><span class="font_lighter"><%= @open_source_project.url%> </span></td>
</tr>
<tr><td align="left" colspan="2">
<%= image_tag( "/images/sidebar/tags.png") %>
<%= render :partial => 'tags/tag_name', :locals => {:obj => topic,:object_flag => "9",:non_list_all => true }%>
</td></tr>
</table></td>
</tr>
</table>
<% end %>
<div class="pagination">
<%#= pagination_links_full @topic_pages, @topic_count %>
</div>
<% else %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %>
</div>

View File

@ -1,10 +1,54 @@
<p id="notice"><%= notice %></p>
<!-- added by fq -->
<div id="add-memo" class='lz' style="display: none; padding: 20px;">
<h3><%=l(:label_memo_new)%></h3>
<% if User.current.logged? %>
<%= labelled_form_for(@memo, :url => forum_memos_path(@forum), :html => {:multipart => true} ) do |f| %>
<% if @memo.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@memo.errors.count, "error") %> prohibited this memo from being saved:</h2>
<p>
<b>String:</b>
<%= @open_source_project.name %>
</p>
<ul>
<% @memo.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="actions" style="max-width:680px">
<p><%= f.text_field :subject, :required => true%></p>
<p style="max-width:680px"><%= f.text_area :content, :required => true, :id => 'editor02' %></p>
<script type="text/javascript">var ckeditor=CKEDITOR.replace('editor02');</script>
<br/>
<p>
<%= l(:label_attachment_plural) %><br />
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>
</p>
<%= f.submit :value => l(:label_memo_create) %>
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-memo").hide(); return false;' %>
</div>
<% end %>
<% end %>
</div>
<!--modified by huang-->
<% #= link_to '发布帖子', new_forum_memo_path(@forum), :class => 'icon icon-add' %>
<span>
<%= link_to l(:label_memo_new_from_forum), new_forum_memo_path(@forum), :class => 'icon icon-add',
:onclick => 'showAndScrollTo("add-memo", "memo_subject"); return false;' if User.current.logged? %>
</span>
<%= link_to 'Edit', edit_open_source_project_path(@open_source_project) %> |
<%= link_to 'Back', open_source_projects_path %>
<div class="contextual-borad">
<%#= link_to(
image_tag('edit.png')+l(:label_forum_edit),
{:action => 'edit', :id => @forum},
:method => 'get',
:title => l(:button_edit)
) if @forum.editable_by?(User.current) %>
<%#= link_to(
image_tag('delete.png')+'删除讨论区',
{:action => 'destroy', :id => @forum},
:method => :delete,
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if @forum.destroyable_by?(User.current) %>
</div>
<%= render :partial => 'open_source_projects/show_topics', :locals => {:memos => @memos} %>

View File

View File

@ -6,6 +6,8 @@
4 代表是bid类型
5 代表是forum类型
6 代表是Attachment类型
7 代表是OpenSourceProject类型
8 代表是RelativeMemo类型
#end%>
<!-- 3 代表的是issue 当是issue是 处理方式与前2个对象不同 -->
<% if object_flag == '3' %>

View File

@ -20,14 +20,16 @@ RedmineApp::Application.routes.draw do
collection do
match 'search', via: [:get, :post]
end
resources :relative_memos do
end
end
match 'course', :to => 'welcome#course', :via => :get
resources :stores do
collection do
match 'search', via: [:get, :post]
end
end
end
resources :forums do
@ -44,21 +46,20 @@ RedmineApp::Application.routes.draw do
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'
@ -103,7 +104,6 @@ RedmineApp::Application.routes.draw do
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'
@ -113,21 +113,21 @@ RedmineApp::Application.routes.draw do
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
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 '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 '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
@ -141,13 +141,13 @@ RedmineApp::Application.routes.draw do
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
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]
#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]
@ -203,7 +203,6 @@ RedmineApp::Application.routes.draw do
post 'reopen'
match 'copy', :via => [:get, :post]
end
#by young
match '/member', :controller => 'projects', :action => 'member', :as => 'member', :via => :get
@ -212,7 +211,6 @@ RedmineApp::Application.routes.draw do
# 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
@ -220,7 +218,7 @@ RedmineApp::Application.routes.draw do
# 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
match '/watcherlist', :controller=>'projects', :action=> 'watcherlist', :as => 'watcherlist', :via => :get #add by huang
# matche '/news', :controller => 'news', :action => 'index', :as => 'news', :via => :get
#end
@ -270,7 +268,7 @@ RedmineApp::Application.routes.draw do
resources :repositories, :except => [:index, :show] do
member do
get 'newrepo', :via => [:get, :post]
# get 'create', :via=>[:get, :post]
# get 'create', :via=>[:get, :post]
end
end
match 'wiki/index', :controller => 'wiki', :action => 'index', :via => :get
@ -447,8 +445,6 @@ RedmineApp::Application.routes.draw 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]
@ -464,7 +460,7 @@ RedmineApp::Application.routes.draw do
match 'uploads', :to => 'attachments#upload', :via => :post
# Added by Tao
match 'upload_avatar', :to => 'avatar#upload', :via => :post
match 'upload_avatar', :to => 'avatar#upload', :via => :post
# Endof Tao's code
get 'robots.txt', :to => 'welcome#robots'
@ -479,7 +475,7 @@ RedmineApp::Application.routes.draw do
end
end
end
##############测试留言功能 fq
post 'words/new', :to => 'words#new'
post 'words/create', :to => 'words#create'
@ -503,7 +499,7 @@ RedmineApp::Application.routes.draw do
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
@ -517,24 +513,24 @@ RedmineApp::Application.routes.draw do
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'
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'
@ -544,10 +540,10 @@ RedmineApp::Application.routes.draw do
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
@ -558,6 +554,6 @@ RedmineApp::Application.routes.draw do
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'
end