2014-07-18 16:39:39 +08:00
|
|
|
|
<% @nav_dispaly_project_label = 1
|
|
|
|
|
@nav_dispaly_forum_label = 1 %>
|
2014-03-26 08:24:12 +08:00
|
|
|
|
<%= stylesheet_link_tag 'welcome' %>
|
2014-04-26 09:03:25 +08:00
|
|
|
|
<%= javascript_include_tag 'welcome' %>
|
|
|
|
|
<script type="text/javascript" language="javascript">
|
2013-12-28 10:48:10 +08:00
|
|
|
|
|
|
|
|
|
$(function(){
|
2014-01-03 10:29:29 +08:00
|
|
|
|
$("#main").find("a").attr("target", "_blank");
|
2014-05-17 15:15:33 +08:00
|
|
|
|
setCss();
|
2013-12-28 10:48:10 +08:00
|
|
|
|
});
|
2014-05-17 15:15:33 +08:00
|
|
|
|
//设置div居中
|
|
|
|
|
function setCss()
|
|
|
|
|
{
|
|
|
|
|
var mainBar = $('#main-content-bar')[0];
|
|
|
|
|
var topHeight = mainBar.offsetHeight;
|
|
|
|
|
var welcomeLeft = $('#welcome_left')[0];
|
|
|
|
|
var leftHeight = welcomeLeft.offsetHeight;
|
|
|
|
|
var searchbar = $('#search-bar')[0];
|
|
|
|
|
var searchHeight = searchbar.offsetHeight;
|
|
|
|
|
welcomeLeft.style.marginTop = (topHeight - leftHeight)/2 + "px";
|
|
|
|
|
searchbar.style.marginTop = (topHeight - searchHeight)/2 + "px";
|
|
|
|
|
//alert((topHeight - leftHeight)/2 );
|
|
|
|
|
}
|
2014-03-28 14:55:34 +08:00
|
|
|
|
// 给主页用户弹新页面
|
|
|
|
|
$(document).ready(function($) {
|
|
|
|
|
$("#loggedas").find("a").attr("target", "_blank");
|
|
|
|
|
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
|
|
|
|
|
});
|
2013-08-16 22:53:28 +08:00
|
|
|
|
</script>
|
2014-01-24 15:45:13 +08:00
|
|
|
|
|
2014-01-24 15:01:15 +08:00
|
|
|
|
<div class='top_bar'>
|
2014-09-16 09:54:55 +08:00
|
|
|
|
<%#= render partial: 'wei_xin' %>
|
2014-05-17 15:15:33 +08:00
|
|
|
|
<div class="main-content-bar" id="main-content-bar">
|
2014-07-25 14:02:23 +08:00
|
|
|
|
<div style="float: left;padding-left:15px ">
|
2014-07-10 17:38:04 +08:00
|
|
|
|
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
|
|
|
|
|
<% if get_avatar?(@first_page) %>
|
2014-07-25 16:05:33 +08:00
|
|
|
|
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
|
2014-07-10 17:38:04 +08:00
|
|
|
|
<% else %>
|
2014-07-25 16:05:33 +08:00
|
|
|
|
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
|
2014-07-10 17:38:04 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
|
2014-09-16 09:54:55 +08:00
|
|
|
|
</div>
|
2014-05-17 15:15:33 +08:00
|
|
|
|
<div class="welcome_left" id="welcome_left">
|
2014-07-11 11:41:54 +08:00
|
|
|
|
<% unless @first_page.nil? %>
|
2014-07-25 10:01:02 +08:00
|
|
|
|
<%= @first_page.description.html_safe %>
|
2014-07-11 11:41:54 +08:00
|
|
|
|
<% end %>
|
2014-01-24 15:01:15 +08:00
|
|
|
|
</div>
|
2014-05-17 15:15:33 +08:00
|
|
|
|
<div class="search-bar" id="search-bar">
|
2014-09-16 09:54:55 +08:00
|
|
|
|
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
|
2014-01-24 15:01:15 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style="clear:both"></div>
|
|
|
|
|
|
2014-03-24 10:18:42 +08:00
|
|
|
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
2014-09-16 11:52:05 +08:00
|
|
|
|
<h3 style="margin-left: 5px; color: #e8770d;">
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<strong><%= l(:lable_hot_projects)%></strong>
|
2014-09-16 11:52:05 +08:00
|
|
|
|
</h3>
|
|
|
|
|
<span style="margin-top: -20px;float: right; display: block;">
|
|
|
|
|
<% if User.current.logged? %>
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<%= link_to(l(:label_project_new), {:controller => 'projects',
|
|
|
|
|
:action => 'new',
|
|
|
|
|
:course => 0,
|
|
|
|
|
:project_type =>( @project_type||=0)},
|
|
|
|
|
:class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %>
|
2014-09-16 11:52:05 +08:00
|
|
|
|
<% end %>
|
|
|
|
|
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<%= link_to l(:label_more), { :controller => 'projects',
|
|
|
|
|
:action => 'index',
|
|
|
|
|
:project_type => 0,
|
|
|
|
|
:host => Setting.project_domain},
|
|
|
|
|
:target => "_blank" %>
|
|
|
|
|
</span>
|
2014-03-24 10:18:42 +08:00
|
|
|
|
<div class="d-p-projectlist-box">
|
|
|
|
|
<ul class="d-p-projectlist">
|
2014-07-16 14:22:12 +08:00
|
|
|
|
<% @projects.map do |project| %>
|
2014-08-28 17:30:08 +08:00
|
|
|
|
<li style="overflow:auto;word-break:break-all;height:100%;word-wrap: break-word;" class='<%= cycle("odd", "even") %>'>
|
2014-03-24 10:18:42 +08:00
|
|
|
|
<div style="float: left;">
|
|
|
|
|
<%= image_tag(get_project_avatar(project), :class => "avatar-4") %>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 上左下右 -->
|
|
|
|
|
<div style="float: left; margin-left: 10px; width: 380px;">
|
2014-09-01 14:41:11 +08:00
|
|
|
|
<% unless project.is_public %>
|
2014-09-04 09:46:24 +08:00
|
|
|
|
<span class="private_project"><%= l(:label_private) %></span>
|
2014-09-01 14:41:11 +08:00
|
|
|
|
<% end %>
|
2014-03-24 10:18:42 +08:00
|
|
|
|
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}" )%>
|
|
|
|
|
(<%= link_to "#{projectCount(project)}人", project_member_path(project) ,:course =>'0' %>)
|
|
|
|
|
</div>
|
2014-07-18 09:21:09 +08:00
|
|
|
|
<div style=" float: left;margin:5px; margin-left: 10px; width: 380px;">
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<span class='font_lighter' title ='<%=project.short_description%>'>
|
|
|
|
|
<%=project.description.truncate(100, omission: '...')%>
|
|
|
|
|
</span>
|
2014-03-24 10:18:42 +08:00
|
|
|
|
</div>
|
2014-07-18 09:21:09 +08:00
|
|
|
|
<div >
|
2014-08-15 17:43:10 +08:00
|
|
|
|
<%= content_tag "span", l(:label_project_score)+ ":" + red_project_scores(project).to_i.to_s,
|
2014-07-18 09:21:09 +08:00
|
|
|
|
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300;",
|
2014-03-24 10:18:42 +08:00
|
|
|
|
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
|
|
|
|
:class => "tooltip",
|
|
|
|
|
:id => "tooltip-#{project.id}" %>
|
2013-12-23 19:45:51 +08:00
|
|
|
|
</div>
|
|
|
|
|
</li>
|
2014-07-11 14:51:33 +08:00
|
|
|
|
<!--<%#end %> -->
|
2014-03-24 10:18:42 +08:00
|
|
|
|
<% end; reset_cycle %>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2013-11-28 08:34:20 +08:00
|
|
|
|
</div>
|
2013-12-23 19:45:51 +08:00
|
|
|
|
|
2013-11-27 15:37:43 +08:00
|
|
|
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
2013-12-28 10:48:10 +08:00
|
|
|
|
<ul class="user-welcome-message-list">
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<h3 style="color: rgb(21, 188, 207)"><strong><%= l(:lable_user_active)%></strong></h3>
|
|
|
|
|
<span style="margin-top: -20px;float: right; display: block;"><%= link_to l(:label_more), { :controller => 'users', :action => 'index'}, :target => "_blank" %></span>
|
2014-03-21 20:25:41 +08:00
|
|
|
|
<div class="user-message-box-list" style="margin-top: 10px;">
|
2014-06-12 15:20:14 +08:00
|
|
|
|
<%activities = find_all_activities%>
|
2014-09-16 11:52:05 +08:00
|
|
|
|
<% activities.each do |event| %>
|
|
|
|
|
<!--<%# cache cache_key_for_event(event) do %> -->
|
|
|
|
|
<li style="display: block;height:60px; padding-bottom: 4px;">
|
|
|
|
|
<div class="inner-right" style="float: left; height: 100%; ">
|
|
|
|
|
<%= image_tag url_to_avatar(event.event_author), :class => "avatar-3" %>
|
|
|
|
|
</div>
|
|
|
|
|
|
2014-10-10 09:53:58 +08:00
|
|
|
|
<div class="inner-right" style="float: right; width:86%; height: 100%; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" >
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<span style="color: green;">
|
|
|
|
|
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author),
|
|
|
|
|
:style => "color:green;", :target => "_blank" %>
|
|
|
|
|
</span>
|
|
|
|
|
<%= show_user_content event %>
|
|
|
|
|
<p style="margin-top: 4px;">
|
|
|
|
|
<span style="color: rgb(172, 174, 177)">
|
|
|
|
|
<%= l(:field_updated_on) %>
|
|
|
|
|
<%= time_tag_welcome event.event_datetime %>前
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
<span style="float: right; color: rgb(172, 174, 177);">
|
|
|
|
|
<%= show_event_reply event %>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
2014-09-16 11:52:05 +08:00
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
<% end %>
|
2013-12-23 19:45:51 +08:00
|
|
|
|
</div>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
2013-12-28 10:48:10 +08:00
|
|
|
|
|
2014-03-27 10:53:45 +08:00
|
|
|
|
<div class="right" style="float: right; width: 48%; ">
|
2014-03-21 15:17:14 +08:00
|
|
|
|
<ul class="welcome-message-list">
|
2014-07-19 14:31:25 +08:00
|
|
|
|
<!--<%# cache 'forum_links' do %> -->
|
2014-03-21 20:25:41 +08:00
|
|
|
|
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
|
2014-03-27 10:53:45 +08:00
|
|
|
|
<h3 style="color: rgb(21, 188, 207);">
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<strong><%= l(:lable_bar_active)%></strong>
|
|
|
|
|
<%= link_to l(:label_my_question) , newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
|
|
|
|
<%= link_to l(:label_my_feedback) , suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE" }%>
|
|
|
|
|
</h3>
|
|
|
|
|
<span style="margin-top: -30px;float: right; display: block;"><%= link_to l(:label_more), forums_path %></span>
|
2014-03-21 15:17:14 +08:00
|
|
|
|
</div>
|
2014-05-06 17:04:24 +08:00
|
|
|
|
<div class="welcome-box-list-new memo_activity">
|
2014-06-12 15:20:14 +08:00
|
|
|
|
<% topics = find_new_forum_topics(7) %>
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
|
2014-07-19 14:31:25 +08:00
|
|
|
|
<!--<%# cache cache_key_for_topic(topic) do %> -->
|
2014-09-16 14:05:45 +08:00
|
|
|
|
<li class="message-brief-intro">
|
|
|
|
|
<div class='memo_title text_nowrap'>
|
|
|
|
|
<%= link_to '['+topic.forum.name + ']',forum_path(topic.forum),:class => 'memo_Bar_title' %>
|
|
|
|
|
<%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url,title: topic.subject %>
|
|
|
|
|
</div>
|
|
|
|
|
<div class='memo_attr'>
|
|
|
|
|
<span class='memo_timestamp'>
|
|
|
|
|
<%= "#{l(:label_updated_time, value: time_tag_welcome(topic_last_time topic))}".html_safe %>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="memo_author">
|
|
|
|
|
<%= l(:label_question_sponsor)%>:
|
|
|
|
|
<%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="memo_last_person">
|
|
|
|
|
<%= l(:label_final_reply)%>:
|
|
|
|
|
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
|
|
|
|
|
<%=link_to topic.last_reply.author.login.truncate(10, omission: '...'),user_path(topic.last_reply.author),title: topic.last_reply.author.login%>
|
|
|
|
|
<% end %>
|
|
|
|
|
</span>
|
|
|
|
|
<span class="memo_reply">
|
|
|
|
|
<%= l(:label_reply)%>
|
|
|
|
|
(<%= link_to topic.try(:replies_count), topic.event_url %>)
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
2014-07-19 14:31:25 +08:00
|
|
|
|
<!--<%#end %> --> <!-- cache -->
|
2014-06-13 08:35:37 +08:00
|
|
|
|
<% end %>
|
2014-03-21 15:17:14 +08:00
|
|
|
|
</div>
|
|
|
|
|
</ul>
|
2014-04-26 09:03:25 +08:00
|
|
|
|
</div>
|
2013-08-16 22:53:28 +08:00
|
|
|
|
|
2014-04-04 21:43:06 +08:00
|
|
|
|
<div class="clearfix"></div>
|
2014-05-19 16:12:06 +08:00
|
|
|
|
<%= render partial: 'link_to_another' %>
|