个人主页基本页面布局完成

This commit is contained in:
sw 2015-08-19 16:32:05 +08:00
parent a536af8fa3
commit e64c15a026
2 changed files with 33 additions and 37 deletions

View File

@ -10,7 +10,7 @@
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_public', 'user_leftside', :media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_public', 'user_leftside', :media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= javascript_include_tag "bootstrap","user"%> <%= javascript_include_tag "bootstrap"%>
<%= heads_for_theme %> <%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %> <%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%> <%= yield :header_tags -%>
@ -51,12 +51,9 @@
<% end%> <% end%>
</div> </div>
<div> <div>
<div class="homepageImageName"> <div class="homepageImageName hidden">
<%= @user.login %> <%= @user.login %>
</div> </div>
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
<span class="<%= @user.user_extensions.gender==1?'icon_female':'icon_male' %> fl mt3 ml5"></span>
<% end %>
<div class="homepageImageSex"></div> <div class="homepageImageSex"></div>
<%= link_to "编辑资料", my_account_path, :class => "fr gz_btn mr10"%> <%= link_to "编辑资料", my_account_path, :class => "fr gz_btn mr10"%>
<div class="cl"></div> <div class="cl"></div>
@ -119,13 +116,19 @@
</div> </div>
<div class="homepageLeftMenuCourses"> <div class="homepageLeftMenuCourses">
<ul> <ul>
<% @user.courses.visible%> <% courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">课程名称一</a></li> <% courses.each do |course|%>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">课程名称二</a></li> <li class="homepageLeftMenuCoursesLine">
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">课程名称三</a></li> <a href="<%= url_for(:controller => 'courses', :action=>"show", :id=>course.id, :host=>Setting.host_course) %>" class="coursesLineGrey">
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">课程名称四</a></li> <%= course.name %>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">课程名称五</a></li> </a>
<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li> </li>
<% end %>
<% if courses.size == 5%>
<li class="homepageLeftMenuMore">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a>
</li>
<% end%>
</ul> </ul>
</div> </div>
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">
@ -136,12 +139,19 @@
</div> </div>
<div class="homepageLeftMenuCourses"> <div class="homepageLeftMenuCourses">
<ul> <ul>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称一</a></li> <% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称二</a></li> <% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称三</a></li> <li class="homepageLeftMenuCoursesLine">
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称四</a></li> <a href="<%= url_for(:controller => 'projects', :action=>"show", :id=>project.id, :host=>Setting.host_name) %>" class="coursesLineGrey">
<li class="homepageLeftMenuCoursesLine"><a href="javascript:void(0);" class="coursesLineGrey">项目名称五</a></li> <%= project.name %>
<li class="homepageLeftMenuMore"><a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a></li> </a>
</li>
<% end %>
<% if projects.size == 5%>
<li class="homepageLeftMenuMore">
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon"></a>
</li>
<% end%>
</ul> </ul>
</div> </div>
<div class="homepageLeftMenuBlock"> <div class="homepageLeftMenuBlock">
@ -152,23 +162,7 @@
<div class="project_Label_New"> <div class="project_Label_New">
<span class="homepageLabelText">标签</span> <span class="homepageLabelText">标签</span>
<div class="tag_h ml10" > <div class="tag_h ml10" >
<span class="re_tag f_l "> <%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
<a href="javascript:void(0);" class="pt5">分布计算</a>
<span class="del">
<a href="javascript:void(0);" data-remote="true">x</a>
</span>
</span>
<span class="re_tag f_l" >
<a href="javascript:void(0);">2014春季学期</a>
<span class="del">
<a href="3" data-remote="true">x</a>
</span>
</span>
<a href="javascript:void(0)" class="yellowBtn f_l" onclick="$('#add_tag01').slideToggle();">+ 添加标签</a>
<span id="add_tag01" style="display:none; vertical-align: middle;" class="ml10 f_l">
<input type="text" name="" size="20" class="isTxt w90 f_l" maxlength="100" />
<input type="button" class="submit f_l" onclick="addTag();" />
</span>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

View File

@ -9,6 +9,8 @@ a:link,a:visited{color:#7f7f7f;text-decoration:none;}
a:hover,a:active{color:#000;} a:hover,a:active{color:#000;}
/*常用*/ /*常用*/
.hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.break_word{ word-break:break-all; word-wrap: break-word;}
select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; } select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; }
.sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; background:#dbdbdb;} .sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; background:#dbdbdb;}
.sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;} .sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
@ -409,8 +411,8 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
.homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} .homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;}
.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;} .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;} .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; margin-right:8px; height:20px; float:left;} .homepageImageName {font-size:16px; color:#484848; margin-left:15px; height:21px; float:left;max-width: 100px;}
.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} .homepageImageSex {width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
.homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;} .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;} .homepageImageBlock {margin:0 auto; width:78px; float:left; text-align:center; display:inline-block;}
.homepageImageNumber {font-size:12px; color:#484848;} .homepageImageNumber {font-size:12px; color:#484848;}