socialforge/app/views/layouts/new_base_user.html.erb

206 lines
10 KiB
Plaintext
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
2015-08-18 11:47:22 +08:00
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'new_user', 'user_leftside','prettify','users',:media => 'all' %>
2015-08-18 11:47:22 +08:00
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'prettify'%>
2015-08-18 11:47:22 +08:00
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
</head>
<body>
<div class="navContainer">
2015-08-21 15:40:38 +08:00
<% is_current_user = User.current.logged? && User.current == @user%>
2015-08-18 11:47:22 +08:00
<% if User.current.logged? %>
<%= render :partial => 'layouts/logined_header' %>
<% else%>
<%= render :partial => 'layouts/unlogin_header' %>
<% end%>
</div>
2015-09-24 16:30:14 +08:00
<div class="cl"></div>
<div class="homepageContentContainer">
2015-09-11 09:20:43 +08:00
<!--div class="homepageRightBannerImg"></div-->
2015-09-10 10:26:16 +08:00
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft" id="LSide">
<div class="homepagePortraitContainer">
2015-08-29 10:13:32 +08:00
<div class="homepagePortraitImage fl" id="homepage_portrait_image">
<%= image_tag(url_to_avatar(@user),width:"78", height: "78", :id=>'nh_user_tx') %>
<% if User.current.logged?%>
2015-08-21 15:40:38 +08:00
<% if is_current_user%>
<div id="edit_user_file_btn" class="none">
<div class="homepageEditProfile">
2015-08-19 17:14:19 +08:00
<a href="<%= url_for(:controller => 'my', :action => 'clear_user_avatar_temp') %>" data-remote="true" class="homepageEditProfileIcon"></a>
</div>
</div>
<% end %>
<% end%>
</div>
2015-08-29 14:08:38 +08:00
<div class="fl ml10">
<p class="homepageImageName hidden db mb5">
<%= @user.login %>
2015-08-29 10:13:32 +08:00
</p>
2015-08-21 15:40:38 +08:00
<% if (@user.user_extensions && (@user.user_extensions.identity != 2) ) %>
2015-08-29 10:13:32 +08:00
<span class="<%= @user.user_extensions.gender == 1 ? 'homepageImageSexWomen' : 'homepageImageSexMan' %> "></span>
2015-08-21 15:40:38 +08:00
<% end %>
<div class="cl"></div>
2015-08-29 18:51:35 +08:00
<% if @user.user_extensions && @user.user_extensions.identity %>
2015-08-31 15:21:09 +08:00
<p class="mb8 c_dark f14">
2015-08-29 18:54:34 +08:00
<%= get_user_roll @user %>
2015-08-29 18:51:35 +08:00
</p>
<% end%>
2015-08-29 14:46:30 +08:00
<div id="watch_user_btn_div">
2015-08-29 14:37:53 +08:00
<%= render :partial => 'layouts/user_watch_btn', :locals => {:target => @user} %>
</div>
</div>
2015-08-29 10:13:32 +08:00
<div class="cl"></div>
<div>
2015-08-28 16:10:05 +08:00
<div class="homepageSignature break_word">
2015-08-21 16:29:25 +08:00
<p id="user_brief_introduction_show">
<%= render :partial => 'layouts/user_brief_introduction', :locals => {:user => @user} %>
</p>
</div>
2015-08-28 14:50:48 +08:00
<textarea class="homepageSignatureTextarea none" placeholder="请编辑签名" id="user_brief_introduction_edit" onblur="edit_user_introduction('<%= edit_brief_introduction_user_path(@user.id)%>');"><%= @user.user_extensions.brief_introduction %></textarea>
</div>
<div>
<div class="homepageImageBlock">
2015-08-26 11:41:32 +08:00
<div id="watch_user_number_div">
<%= link_to User.watched_by(@user.id).count.to_s, {:controller=>"users", :action=>"user_watchlist",:id=>@user.id},:class=>"homepageImageNumber" %>
</div>
<div class="homepageImageText">关注</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
2015-08-26 11:41:32 +08:00
<div id="fans_user_number_div">
<%= link_to @user.watcher_users.count.to_s, {:controller=>"users", :action=>"user_fanslist",:id=>@user.id},:class=>"homepageImageNumber", :id => "user_fans_number"%>
</div>
<div class="homepageImageText">粉丝</div>
</div>
<div class="homepageVerDiv"></div>
<div class="homepageImageBlock">
<div>
<%= link_to(format("%.2f" ,get_option_number(@user,1).total_score ).to_i,
{:controller => 'users', :action => 'show_new_score', :remote => true, :id => @user.id }, :class => 'homepageImageNumber',:id => 'user_score') %>
</div>
<div class="homepageImageText">积分</div>
</div>
<div class="cl"></div>
</div>
</div>
<div class="homepageLeftMenuContainer">
<div class="homepageLeftMenuBlock">
<%= link_to "动态",user_activities_path(@user.id),:class => "homepageMenuText"%>
</div>
<div class="homepageLeftMenuBlock">
2015-08-29 11:33:58 +08:00
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
<% if is_current_user%>
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
2015-09-18 14:31:19 +08:00
<%=link_to "", new_course_path(:host=> Setting.host_course), :class => "homepageMenuSetting fr", :title => "新建课程"%>
<% else%>
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true, :title => "加入课程"%>
<% end%>
<% end%>
</div>
<% 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)%>
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
<ul>
2015-08-24 14:44:22 +08:00
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
</ul>
</div>
<div class="homepageLeftMenuBlock">
2015-08-29 11:33:58 +08:00
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
<% if is_current_user%>
2015-09-18 14:31:19 +08:00
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :title => "新建项目"%>
<% end%>
</div>
<% 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)%>
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" id="homepageLeftMenuForge">
<ul>
2015-08-24 14:53:35 +08:00
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
</ul>
</div>
<div class="homepageLeftMenuBlock">
2015-08-26 15:49:05 +08:00
<!--<a href="javascript:void(0);" class="homepageMenuText">留言</a>-->
2015-09-18 14:31:19 +08:00
<%= link_to '留言',feedback_path(@user, :host=> Setting.host_user),:class=>'homepageMenuText'%>
</div>
</div>
<div class="homepageLeftLabelContainer">
<div class="project_Label_New">
<span class="homepageLabelText">标签</span>
<div class="tag_h ml10" >
2015-08-19 16:32:05 +08:00
<%= render :partial => 'tags/user_tag', :locals => {:obj => @user,:object_flag => "1"}%>
</div>
<div class="cl"></div>
</div>
</div>
</div>
2015-08-28 17:27:51 +08:00
<div class="homepageRight">
2015-08-18 11:47:22 +08:00
<%= yield %>
</div>
</div>
<%= render :partial => 'layouts/new_feedback' %>
</div>
2015-08-25 09:29:19 +08:00
<div class="cl"></div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
2015-08-19 17:14:19 +08:00
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="nh_tx_dialog_html" class="white_content" style="display:none;">
<div>
<div><a href="javascript:hideModal();" class="box_close"></a></div>
<div class="cl"></div>
<div class="pro_new">
<h3 class="box_h3 mb10">头像设置</h3>
<div class="uppicBox">
2015-08-29 12:04:35 +08:00
<input type="button" class="uppic_btn" onclick="$('#upload_user_image').click();" value="浏览.."/>
2015-08-19 17:14:19 +08:00
<%= file_field_tag 'avatar[image]',
2015-08-29 12:04:35 +08:00
:id => "upload_user_image",
:style => 'display:none;',#added by young
2015-08-19 17:14:19 +08:00
:size => "1",
:multiple => false,
:onchange => 'addInputAvatar(this);',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:file_type => Redmine::Configuration['pic_types'].to_s,
:type_support_message => l(:error_pic_type),
:upload_path => upload_avatar_path(:format => 'js'),
:description_placeholder => nil ,# l(:label_optional_description)
:source_type => @user.class.to_s,
:source_id => @user.id.to_s
} %>
<!--<br/>-->
<!--<span>只支持jpg,png,gif,大小不超过5M</span>-->
</div>
<div class="showpicBox">
<p>预览</p>
<%= image_tag(url_to_avatar(@user), :style=>"width:96px;height:96px;",:class=>"mb5 mt10",:nhname=>'avatar_image') %>
<span >96px*96px</span> <br />
<div class="mb20"></div>
<%= image_tag(url_to_avatar(@user), :style=>"width:48px;height:48px;",:class=>"mb5",:nhname=>'avatar_image') %>
<br />
<span>48px*48px</span> <br />
</div>
<div class="cl mb10"></div>
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取&nbsp;&nbsp;消</a>
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10 f14">确&nbsp;&nbsp;定</a>
2015-08-19 17:14:19 +08:00
</div><!--talknew end-->
<div class="cl"></div>
</div><!--floatbox end-->
</div>
</body>
</html>