解决一些bug; 增加已设为首页标签

This commit is contained in:
ouyangxuhua 2016-01-08 14:42:21 +08:00
parent 66bf50098a
commit 5eceb3d841
8 changed files with 13 additions and 6 deletions

View File

@ -15,7 +15,7 @@ class ShieldActivitiesController < ApplicationController
end end
end end
def destroy def show_acts
if params[:org_id] if params[:org_id]
if params[:project_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| 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|

View File

@ -46,6 +46,9 @@
<% end %> <% end %>
TO TO
<%= link_to activity.blog.name+" | 博客", user_blogs_path(:user_id=>activity.author_id,:host=>Setting.host_user), :class => "newsBlue ml15 mr5"%> <%= 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>
<div class="cl"></div> <div class="cl"></div>
<div class="homepagePostTitle hidden m_w530 fl"> <div class="homepagePostTitle hidden m_w530 fl">

View File

@ -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 %> <% 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 %> <%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %> <% 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 %> <% end %>
</li> </li>
</ul> </ul>

View File

@ -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 %> <% 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 %> <%= link_to "屏蔽动态", shield_activities_path(:org_id => org_id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %> <% 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 %> <% end %>
</li> </li>
</ul> </ul>

View File

@ -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 %> <% 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 %> <%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :course_id => course.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %> <% 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 %> <% end %>
</li> </li>
</ul> </ul>

View File

@ -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 %> <% 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 %> <%= link_to "屏蔽动态", shield_activities_path(:user_id => user.id, :project_id => project.id), :method => 'post',:class => 'postOptionLink',:remote => true %>
<% else %> <% 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 %> <% end %>
</li> </li>
</ul> </ul>

View File

@ -31,7 +31,11 @@ RedmineApp::Application.routes.draw do
# Enable Grack support # Enable Grack support
# mount Trustie::Grack.new, at: '/', constraints: lambda { |request| /[-\/\w\.]+\.git\//.match(request.path_info) }, via: [:get, :post] # 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 resources :organizations do
member do member do
get 'setting'#, :action => 'settings', :as => 'settings' get 'setting'#, :action => 'settings', :as => 'settings'