解决一些bug; 增加已设为首页标签
This commit is contained in:
parent
66bf50098a
commit
5eceb3d841
|
@ -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|
|
||||
|
|
|
@ -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 %>
|
||||
<span class="red_homework_btn_cir ml5">已设为首页</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostTitle hidden m_w530 fl">
|
||||
|
|
|
@ -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 %>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -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 %>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -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 %>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -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 %>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue