组织下的链接问题

This commit is contained in:
ouyangxuhua 2016-03-15 13:49:44 +08:00
parent 098844a910
commit b716e593b5
2 changed files with 11 additions and 4 deletions

View File

@ -3014,6 +3014,13 @@ def logout_url_without_domain
Setting.host_name + "/logout"
end
def signin_url_without_domain
Setting.host_name + "/login?login=true"
end
def register_url_without_domain
Setting.host_name + "/login?login=false"
end
#判断是否为默认的组织栏目
def is_default_field? field
(field.name == 'activity' || field.name == 'course' || field.name == 'project') && field.field_type == 'default'

View File

@ -44,14 +44,14 @@
</li>
<% if User.current.logged? %>
<li class="navOrgMenu fr" id="orgUser" style="cursor:pointer;">
<%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), request.local? ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %>
<%= link_to User.current, (request.local? || request.subdomain.blank?) ? user_path(User.current):("https://www.trustie.net/users/" + User.current.id.to_s),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %>
<%= link_to image_tag(url_to_avatar(User.current),:width => '23',:height => '23'), user_url_in_org(User.current.id),:alt => '用户头像', :target => '_blank',:style=>'border-radius:3px; vertical-align:top; margin-top:3px; display:inline-block; margin-right:3px;' %>
<%= link_to User.current, user_url_in_org(User.current.id),:id => "orgUserName",:class => 'fontGrey2 f14 mr5',:target => '_blank' %>
<%= link_to "退出",logout_url_without_domain, :class =>"menuGrey", :method => 'post', :rel => "nofollow" %>
</li>
<!--<li class="navOrgMenu fr"><%#=link_to User.current, user_path(User.current), :class => "linkGrey8 f14" %></li>-->
<% else %>
<li class="navOrgMenu fr"><a href="<%= (request.local? || request.subdomain.blank?) ? signin_path(:login=>true):'https://www.trustie.net/login?login=true' %>" class="linkGrey8 f14">登录</a></li>
<li class="navOrgMenu fr"><a href="<%= (request.local? || request.subdomain.blank?) ? signin_path(:login=>false):'https://www.trustie.net/login?login=false' %>" class="linkGrey8 f14 mr15">注册</a></li>
<li class="navOrgMenu fr"><a href="<%= signin_url_without_domain %>" class="linkGrey8 f14">登录</a></li>
<li class="navOrgMenu fr"><a href="<%= register_url_without_domain %>" class="linkGrey8 f14 mr15">注册</a></li>
<% end %>
</ul>
<!--<div class="navHomepageProfile">