socialforge/app/views/welcome/index.html.erb

156 lines
7.0 KiB
Plaintext
Raw Normal View History

<% @nav_dispaly_forum_label = 1 %>
2014-10-23 18:49:14 +08:00
<%= stylesheet_link_tag 'welcome' %>
<%= javascript_include_tag 'welcome' %>
<script type="text/javascript" language="javascript">
2015-01-30 14:11:35 +08:00
$(function() {
$("#main").find("a").attr("target", "_blank");
setCss();
});
//设置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-10-23 18:49:14 +08:00
// 给主页用户弹新页面
$(document).ready(function($) {
$("#loggedas").find("a").attr("target", "_blank");
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
2015-01-30 14:11:35 +08:00
});
2014-10-23 18:49:14 +08:00
</script>
<div class='top_bar'>
2015-01-30 14:11:35 +08:00
<%#= render partial: 'wei_xin' %>
2014-10-23 18:49:14 +08:00
<div class="main-content-bar" id="main-content-bar">
<div style="float: left;padding-left:15px ">
2015-01-30 14:11:35 +08:00
<!-- <#%= image_tag(get_project_avatar(@first_page), size: "75x75") %> -->
2015-01-31 15:43:35 +08:00
<% if @organization.nil? %>
2015-01-30 14:11:35 +08:00
<% if get_avatar?(@first_page) %>
<%= image_tag(url_to_avatar(@first_page), width:@first_page.image_width,height: @first_page.image_height) %>
<% else %>
<%= image_tag '/images/transparent.png', width:@first_page.image_width,height: @first_page.image_height %>
2015-01-30 14:11:35 +08:00
<% end %>
<% else %>
<%= image_tag(url_to_avatar(@organization), width:@first_page.image_width,height: @first_page.image_height) %>
2015-01-30 14:11:35 +08:00
<% end %>
2014-10-23 18:49:14 +08:00
</div>
2015-01-31 17:27:52 +08:00
<div class="welcome_left" id="welcome_left">
2015-01-31 15:43:35 +08:00
<% if @organization.nil? %>
2015-01-30 14:11:35 +08:00
<% unless @first_page.nil? %>
<%= @first_page.description.html_safe %>
<% end %>
<% else %>
<span class="font_welcome_school" style="color: #E8770D">
<%= @organization.name %>
</span>
<br/>
<span class="font_welcome_trustie">
2015-01-31 17:14:01 +08:00
<%= @enterprise_page.title %>
</span>
2015-01-30 14:11:35 +08:00
<% end %>
</div>
<div class="search-bar" id="search-bar">
<%= render :partial => "search_project", :locals => {:project_type => 0}%>
</div>
<div style="clear: both;"></div>
2014-10-23 18:49:14 +08:00
</div>
</div>
2015-01-30 14:11:35 +08:00
<div style="clear:both"></div>
2014-10-23 18:49:14 +08:00
<div id="J_Slide" class="d-p-index-box d-p-index-hot">
2015-01-30 14:11:35 +08:00
<h3 style="margin-left: 5px; color: #e8770d;"><strong> <%= l(:lable_hot_projects)%> </strong></h3>
<span style="margin-top: -20px;float: right; display: block;"> <% if User.current.logged? %>
<%= 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) %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= link_to l(:label_join_project), join_project_projects_path ,:remote => true, :class => 'icon icon-add' %>
&nbsp;&nbsp;&nbsp;&nbsp;
<% end %> </span>
2014-10-23 18:49:14 +08:00
<div class="d-p-projectlist-box">
<ul class="d-p-projectlist">
2015-01-30 14:11:35 +08:00
<!-- 如果企业版参数正确,这进入企业版页面 -->
2015-01-31 15:43:35 +08:00
<% if @organization.nil? %>
2015-01-30 14:11:35 +08:00
<% @projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end; reset_cycle %>
<!-- 企业版项目 -->
<% else %>
<% if @part_projects.empty? %>
<% @projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>
<% else %>
<% @organization_projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>
<li>
<h1></h1>
<div id="errorExplanation">
<%= l(:label_part_enterprise_tips) %>
</div>
<h1></h1>
</li>
<% @part_projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>
<% end %>
<% end %>
2014-10-23 18:49:14 +08:00
</ul>
</div>
</div>
2015-03-07 17:08:36 +08:00
<div class="right" style="float: right; width: 48%; padding-top: 8px;">
2014-10-23 18:49:14 +08:00
<ul class="welcome-message-list">
<div class="forum-topic" style="height: 25px; width: 98%; margin-left: 2px;">
2015-01-30 14:11:35 +08:00
<h3 style="color: rgb(21, 188, 207);"><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(:button_more), forums_path %> </span>
2014-10-23 18:49:14 +08:00
</div>
<div class="welcome-box-list-new memo_activity">
2015-03-07 17:08:36 +08:00
<% topics = find_new_forum_topics(12) %>
2014-10-23 18:49:14 +08:00
<% topics.includes(:forum, :last_reply, :author).each do |topic|%>
2015-01-31 10:48:09 +08:00
<li class="message-brief-intro" style="line-height:1.4em;">
2014-10-23 18:49:14 +08:00
<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'>
2015-01-07 09:27:44 +08:00
<%#= "#{l(:field_updated_on, value: format_time(topic_last_time topic))}" %>
<%= l(:field_updated_on) %>
<%= format_time topic_last_time topic %>
2014-10-23 18:49:14 +08:00
</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">
<% unless (topic.last_reply.nil? || topic.last_reply.author.nil?) %>
<%= l(:label_final_reply)%>
2014-10-23 18:49:14 +08:00
<%=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>
2015-01-07 09:27:44 +08:00
<%end %>
2014-10-23 18:49:14 +08:00
</div>
</ul>
2015-01-30 14:11:35 +08:00
</div>
2014-10-23 18:49:14 +08:00
<div class="clearfix"></div>
<%= render partial: 'link_to_another' %>