diff --git a/app/controllers/shield_activities_controller.rb b/app/controllers/shield_activities_controller.rb
index 7f4f4eebf..b2d5191b3 100644
--- a/app/controllers/shield_activities_controller.rb
+++ b/app/controllers/shield_activities_controller.rb
@@ -15,7 +15,7 @@ class ShieldActivitiesController < ApplicationController
end
end
- def destroy
+ def show_acts
if params[:org_id]
if params[:project_id]
ShieldActivity.where("container_type='Organization' and container_id=#{params[:org_id].to_i} and shield_type='Project' and shield_id=#{params[:project_id]}").each do |act|
diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb
index cd701d804..8c5d493d7 100644
--- a/app/views/blogs/_article.html.erb
+++ b/app/views/blogs/_article.html.erb
@@ -46,6 +46,9 @@
<% end %>
TO
<%= link_to activity.blog.name+" | 博客", user_blogs_path(:user_id=>activity.author_id,:host=>Setting.host_user), :class => "newsBlue ml15 mr5"%>
+ <% if activity.blog.homepage_id and activity.id == activity.blog.homepage_id %>
+ 已设为首页
+ <% end %>
diff --git a/app/views/layouts/_org_courses.html.erb b/app/views/layouts/_org_courses.html.erb
index f98c6a40d..b2bd8e428 100644
--- a/app/views/layouts/_org_courses.html.erb
+++ b/app/views/layouts/_org_courses.html.erb
@@ -14,7 +14,7 @@
<% if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
- <%= link_to "显示动态", {:controller => 'shield_activities', :action => 'destroy', :org_id => org_id, :course_id => course.id}, :method => 'delete',:class => 'postOptionLink',:remote => true %>
+ <%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
diff --git a/app/views/layouts/_org_projects.html.erb b/app/views/layouts/_org_projects.html.erb
index a5a5ea730..00c5db642 100644
--- a/app/views/layouts/_org_projects.html.erb
+++ b/app/views/layouts/_org_projects.html.erb
@@ -13,7 +13,7 @@
<% if ShieldActivity.where("container_type='Organization' and container_id=#{org_id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
- <%= link_to "显示动态", {:controller => 'shield_activities', :action => 'destroy', :org_id => org_id, :project_id => project.id},:method => 'delete',:class => 'postOptionLink',:remote => true %>
+ <%= link_to "显示动态", show_acts_shield_activities_path(:org_id => org_id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
diff --git a/app/views/layouts/_user_courses.html.erb b/app/views/layouts/_user_courses.html.erb
index 8dd0de64e..1becb1a33 100644
--- a/app/views/layouts/_user_courses.html.erb
+++ b/app/views/layouts/_user_courses.html.erb
@@ -13,7 +13,7 @@
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
- <%= link_to "显示动态", {:controller => 'shield_activities', :action => 'destroy', :user_id => user.id, :course_id => course.id},:method => 'delete',:class => 'postOptionLink',:remote => true %>
+ <%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :course_id => course.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
diff --git a/app/views/layouts/_user_projects.html.erb b/app/views/layouts/_user_projects.html.erb
index ffde51e9c..88be91d70 100644
--- a/app/views/layouts/_user_projects.html.erb
+++ b/app/views/layouts/_user_projects.html.erb
@@ -12,7 +12,7 @@
<% if ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count == 0 %>
<%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %>
- <%= link_to "显示动态", {:controller => 'shield_activities', :action => 'destroy', :user_id => user.id, :project_id => project.id},:method => 'delete',:class => 'postOptionLink',:remote => true %>
+ <%= link_to "显示动态", show_acts_shield_activities_path(:user_id => user.id, :project_id => project.id),:method => 'delete',:class => 'postOptionLink',:remote => true %>
<% end %>
diff --git a/app/views/shield_activities/destroy.js.erb b/app/views/shield_activities/show_acts.js.erb
similarity index 100%
rename from app/views/shield_activities/destroy.js.erb
rename to app/views/shield_activities/show_acts.js.erb
diff --git a/config/routes.rb b/config/routes.rb
index 1c1b82277..28464b12b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -31,7 +31,11 @@ RedmineApp::Application.routes.draw do
# Enable Grack support
# mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post]
- resources :shield_activities
+ resources :shield_activities do
+ collection do
+ delete 'show_acts'
+ end
+ end
resources :organizations do
member do
get 'setting'#, :action => 'settings', :as => 'settings'