diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index 233a2b308..b725b9fc2 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -2,9 +2,7 @@ class TagsController < ApplicationController before_filter :require_admin,:only => :show - #Added by nie - #before_filter :require_login,:only => :add_tag - #end + include ProjectsHelper include IssuesHelper include UsersHelper @@ -78,5 +76,10 @@ class TagsController < ApplicationController def show end + + def show_all + @tags = ActsAsTaggableOn::Tag.find(:all) + @tags = @tags.to_a + end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9c335ad6d..d415566a6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -20,6 +20,9 @@ class UsersController < ApplicationController before_filter :require_admin, :except => [:show, :index,:tag_save, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info, :user_watchlist, :user_fanslist] before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_bids, :info] accept_api_auth :index, :show, :create, :update, :destroy + + #william + before_filter :require_login,:only=>[:tag_save] helper :sort include SortHelper diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 343b41265..ea87f47bf 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -26,6 +26,7 @@ module ApplicationHelper include GravatarHelper::PublicMethods include Redmine::Pagination::Helper include AvatarHelper + ## added by william include PraiseTreadHelper extend Forwardable diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 4ecc33690..06ea865c7 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -377,7 +377,7 @@ module IssuesHelper # this method is used to get all projects that tagged one tag # added by william def get_issues_by_tag(tag_name) - Issue.tagged_with(tag_name) + Issue.tagged_with(tag_name).by_join_date end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index cbe57d1c7..d4738a831 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -85,7 +85,7 @@ module ProjectsHelper # this method is used to get all projects that tagged one tag # added by william def get_projects_by_tag(tag_name) - Project.tagged_with(tag_name) + Project.tagged_with(tag_name).by_join_date end end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 9b6f85d2a..1f32990c1 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -58,7 +58,7 @@ module UsersHelper # this method is used to get all projects that tagged one tag # added by william def get_users_by_tag(tag_name) - User.tagged_with(tag_name) + User.tagged_with(tag_name).by_join_date end end diff --git a/app/models/issue.rb b/app/models/issue.rb index 5ecadb672..8d6f6e7c5 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -60,7 +60,8 @@ class Issue < ActiveRecord::Base ###########################added by william acts_as_taggable - + scope :by_join_date, order("created_at DESC") + ##end DONE_RATIO_OPTIONS = %w(issue_field issue_status) attr_reader :current_journal diff --git a/app/models/project.rb b/app/models/project.rb index 6c1be04af..47494ff31 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -78,7 +78,7 @@ class Project < ActiveRecord::Base :author => nil ############################added by william acts_as_taggable - + scope :by_join_date, order("created_at DESC") ###################added by liuping 关注 acts_as_watchable diff --git a/app/models/user.rb b/app/models/user.rb index 3d71394a9..373252e14 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -102,7 +102,8 @@ class User < Principal acts_as_customizable ############################added by william - acts_as_taggable + acts_as_taggable + scope :by_join_date, order("created_at DESC") ############################# added by liuping 关注 acts_as_watchable diff --git a/app/views/layouts/_tag.html.erb b/app/views/layouts/_tag.html.erb index 5873c6294..e0e2b49fd 100644 --- a/app/views/layouts/_tag.html.erb +++ b/app/views/layouts/_tag.html.erb @@ -4,7 +4,7 @@ <% if object_flag == '3' %> - <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name'} %> + <%= toggle_link (image_tag "/images/sidebar/add.png"), 'put-tag-form-issue', {:focus => 'name-issue'} %>
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index 2e00961bc..00ff23a0d 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -42,6 +42,7 @@ +