Merge branch 'develop' of http://repository.trustie.net/xianbo/trustie2 into develop
This commit is contained in:
commit
298bf037ad
|
@ -239,6 +239,13 @@ class OrganizationsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def logout
|
||||
logout_user
|
||||
respond_to do |format|
|
||||
format.html {redirect_to organization_path(params[:id])}
|
||||
end
|
||||
end
|
||||
|
||||
def search_projects
|
||||
@organization = Organization.find(params[:id])
|
||||
condition = '%%'
|
||||
|
|
|
@ -46,12 +46,15 @@ class ForgeActivity < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def add_org_activity
|
||||
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
|
||||
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
|
||||
org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first
|
||||
if org_activity
|
||||
org_activity.created_at = self.created_at
|
||||
org_activity.save
|
||||
end
|
||||
else
|
||||
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
|
||||
org_activity = OrgActivity.where("org_act_type = 'Message' and org_act_id = #{self.forge_act.parent.id}").first
|
||||
org_activity.created_at = self.created_at
|
||||
org_activity.save
|
||||
else
|
||||
OrgActivity.create(:user_id => self.user_id,
|
||||
:org_act_id => self.forge_act_id,
|
||||
|
@ -62,6 +65,7 @@ class ForgeActivity < ActiveRecord::Base
|
|||
:updated_at => self.updated_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def destroy_user_activity
|
||||
user_activity = UserActivity.where("act_type = '#{self.forge_act_type.to_s}' and act_id = '#{self.forge_act_id}'")
|
||||
|
|
|
@ -186,7 +186,7 @@ class Message < ActiveRecord::Base
|
|||
# Description
|
||||
def act_as_forge_activity
|
||||
# 如果project为空,那么就是课程相关的消息
|
||||
if !self.board.project.nil?
|
||||
if !self.board.project.nil? && self.parent_id.nil?
|
||||
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
|
||||
:project_id => self.board.project.id)
|
||||
end
|
||||
|
|
|
@ -46,12 +46,13 @@
|
|||
<li class="navOrgMenu fr" id="orgSwitch" style="cursor:pointer;">
|
||||
<span class="orgMenuArrow" id="orgArrow">
|
||||
<ul class="org_login_list" style="display:none;">
|
||||
<li> <%= link_to "个人主页",user_path(User.current), :class => "linkGrey8" %></li>
|
||||
<li><%= link_to "退出",signout_path, :class =>"linkGrey8", :method => 'post', :rel => "nofollow" %></li>
|
||||
<li> <%= link_to "个人主页",user_path(User.current), :class => "linkGrey8", :target => "_blank" %></li>
|
||||
<li><%= link_to "退出",logout_organization_path(@organization), :class =>"linkGrey8", :method => 'post', :rel => "nofollow" %></li>
|
||||
<!--<li><%#= link_to "退出",signout_path, :class =>"linkGrey8", :method => 'post', :rel => "nofollow" %></li>-->
|
||||
</ul>
|
||||
</span>
|
||||
</li>
|
||||
<li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;"><%=link_to User.current, user_path(User.current), :class => "linkGrey8 f14", :id => "orgUserName" %></li>
|
||||
<li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;"><a href="javascript:void(0);" class="linkGrey8 f14" id="orgUserName"><%= User.current %></a></li>
|
||||
<!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>-->
|
||||
<% else %>
|
||||
<li class="navOrgMenu fr"><a href="<%= signin_path(:login=>true) %>" class="linkGrey8 f14">登录</a></li>
|
||||
|
|
|
@ -4,11 +4,6 @@
|
|||
<li class="orgListRole fb">状态</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgListUser">组织首页</li>
|
||||
<li class="orgListUser">默认</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<ul class="orgListRow">
|
||||
<li class="orgListUser">动态</li>
|
||||
<li class="orgListUser">默认</li>
|
||||
|
|
|
@ -46,6 +46,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'search_projects'
|
||||
post 'join_project_menu'
|
||||
post 'join_projects'
|
||||
post 'logout'
|
||||
end
|
||||
collection do
|
||||
get 'check_uniq'
|
||||
|
|
Loading…
Reference in New Issue