性别的判断

This commit is contained in:
sw 2015-08-21 15:40:38 +08:00
parent 8ef6225084
commit d942cc3123
2 changed files with 9 additions and 5 deletions

View File

@ -18,6 +18,7 @@
<body>
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user%>
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
@ -32,7 +33,7 @@
<div class="homepagePortraitImage" id="homepage_portrait_image">
<%= image_tag(url_to_avatar(@user),width:"206", height: "206", :id=>'nh_user_tx') %>
<% if User.current.logged?%>
<% if User.current == @user%>
<% if is_current_user%>
<div id="edit_user_file_btn" class="none">
<div class="homepageEditProfile">
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
@ -49,8 +50,10 @@
<div class="homepageImageName hidden">
<%= @user.login %>
</div>
<div class="homepageImageSex"></div>
<%= link_to "编辑资料", my_account_path, :class => "fr gz_btn mr10"%>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<div class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></div>
<% end %>
<%= link_to("编辑资料", my_account_path, :class => "fr gz_btn mr10") if is_current_user%>
<div class="cl"></div>
</div>
<div>
@ -63,7 +66,7 @@
</a>
</p>
<% else%>
<% if User.current == @user%>
<% if is_current_user%>
<p>
这位童鞋很懒,什么也没有留下~&nbsp;
<a href="javascript:void(0);">

View File

@ -410,7 +410,8 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
.homepageEditProfile {width:20px; height:20px; border-radius:2px; background-color:#888888; position:absolute; right:9px; bottom:9px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;}
.homepageEditProfileIcon {background:url(../images/homepage_icon.png) -11px -35px no-repeat; width:20px; height:20px; display:block;}
.homepageImageName {font-size:16px; color:#484848; margin-left:15px; height:21px; float:left;max-width: 100px;}
.homepageImageSex {width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
.homepageImageSexMan {width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
.homepageImageSexWomen {width: 20px;height: 20px;background: url(../images/homepage_icon.png) -10px -149px no-repeat;float: left;}
.homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;}
.homepageImageBlock {margin:0 auto; width:78px; float:left; text-align:center; display:inline-block;}
.homepageImageNumber {font-size:12px; color:#484848;}