2014-07-18 16:39:39 +08:00
|
|
|
<% @nav_dispaly_course_all_label = 1
|
|
|
|
@nav_dispaly_forum_label = 1
|
|
|
|
@nav_dispaly_course_label = nil
|
|
|
|
@nav_dispaly_store_all_label = 1 %>
|
2014-04-23 21:20:03 +08:00
|
|
|
<%= stylesheet_link_tag 'welcome' %>
|
2014-04-26 09:03:25 +08:00
|
|
|
<%= javascript_include_tag 'welcome' %>
|
2014-05-12 16:01:13 +08:00
|
|
|
<script type="text/javascript" language="javascript" xmlns="http://www.w3.org/1999/html"
|
2014-05-13 10:30:15 +08:00
|
|
|
xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
|
|
|
|
|
2014-07-04 09:10:17 +08:00
|
|
|
$(function () {
|
2014-05-13 10:30:15 +08:00
|
|
|
$("#main").find("a").attr("target", "_blank");
|
2014-05-17 15:15:33 +08:00
|
|
|
setCss();
|
2014-05-13 10:30:15 +08:00
|
|
|
});
|
|
|
|
|
2014-05-17 15:15:33 +08:00
|
|
|
//设置div居中
|
2014-07-04 09:10:17 +08:00
|
|
|
function setCss() {
|
2014-05-17 15:15:33 +08:00
|
|
|
var mainBar = $('#main-content-bar')[0];
|
|
|
|
var topHeight = mainBar.offsetHeight;
|
|
|
|
var welcomeLeft = $('#welcome_left')[0];
|
2014-07-04 09:10:17 +08:00
|
|
|
var leftHeight = welcomeLeft.offsetHeight;
|
2014-05-17 15:15:33 +08:00
|
|
|
var searchbar = $('#search-bar')[0];
|
|
|
|
var searchHeight = searchbar.offsetHeight;
|
2014-07-04 09:10:17 +08:00
|
|
|
welcomeLeft.style.marginTop = (topHeight - leftHeight) / 2 + "px";
|
|
|
|
searchbar.style.marginTop = (topHeight - searchHeight) / 2 + "px";
|
2014-05-17 15:15:33 +08:00
|
|
|
//alert((topHeight - leftHeight)/2 );
|
|
|
|
}
|
2014-05-13 10:30:15 +08:00
|
|
|
// 给主页用户弹新页面
|
2014-07-04 09:10:17 +08:00
|
|
|
$(document).ready(function ($) {
|
2014-05-13 10:30:15 +08:00
|
|
|
$("#loggedas").find("a").attr("target", "_blank");
|
|
|
|
//$("#content .tabs_new~ .pagination").find("a").removeAttr("target");
|
2014-04-23 21:20:03 +08:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div class='top_bar'>
|
2014-05-13 10:30:15 +08:00
|
|
|
<div id="identifier-pannel" style="display:none">
|
|
|
|
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
|
|
|
|
<div class="weixin-content">微信扫码</div>
|
|
|
|
</div>
|
2014-05-17 15:15:33 +08:00
|
|
|
<div class="main-content-bar" id="main-content-bar">
|
2014-07-25 16:05:33 +08:00
|
|
|
<div style="float: left;padding-left:15px">
|
|
|
|
<%= image_tag(@logoLink, width:@course_page.image_width,height: @course_page.image_height) %>
|
2014-04-25 09:29:18 +08:00
|
|
|
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
2014-07-04 09:10:17 +08:00
|
|
|
<div class="course welcome_left" id="welcome_left">
|
2014-07-03 17:28:13 +08:00
|
|
|
<span class="font_welcome_school"> <% if @school_id.nil? and User.current.user_extensions.school.nil? %>
|
2014-07-04 09:10:17 +08:00
|
|
|
<% else %>
|
2014-07-03 17:28:13 +08:00
|
|
|
<% if @school_id == "0" %>
|
2014-05-13 10:30:15 +08:00
|
|
|
<% else %>
|
2014-07-03 17:28:13 +08:00
|
|
|
<% if @school_id.nil? %>
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= link_to School.find(User.current.user_extensions.school.id).name, options={:action => 'course', :school_id => User.current.user_extensions.school.id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
|
|
|
|
<br/>
|
2014-04-29 09:49:51 +08:00
|
|
|
<% else %>
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= link_to School.find(@school_id).name, options={:action => 'course', :school_id => @school_id}, html_options={:class => 'font_welcome_school', :method => 'get'} %>
|
|
|
|
<br/>
|
2014-04-29 09:49:51 +08:00
|
|
|
<% end %>
|
2014-04-25 09:29:18 +08:00
|
|
|
<% end %>
|
2014-04-29 09:49:51 +08:00
|
|
|
<% end %> </span>
|
2014-07-11 11:41:54 +08:00
|
|
|
<% unless @course_page.nil? %>
|
|
|
|
<span class="font_welcome_trustie"><%= @course_page.title %> </span>
|
|
|
|
|
2014-07-03 17:28:13 +08:00
|
|
|
<% if @school_id.nil? and User.current.user_extensions.school.nil? %>
|
2014-07-11 11:41:54 +08:00
|
|
|
<span class="font_welcome_tdescription">, <%= @course_page.description %></span>
|
2014-05-13 10:30:15 +08:00
|
|
|
<% else %>
|
2014-07-03 17:28:13 +08:00
|
|
|
<% if @school_id == "0" %>
|
2014-07-11 11:41:54 +08:00
|
|
|
<span class="font_welcome_tdescription">, <%= @course_page.description %></span>
|
2014-05-13 10:30:15 +08:00
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2014-07-11 11:41:54 +08:00
|
|
|
<% end %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
2014-05-17 15:15:33 +08:00
|
|
|
<div class="search-bar" id="search-bar">
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= render :partial => "search_course", :locals => {:project_type => Project::ProjectType_course} %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
|
|
|
<div style="clear: both;"></div>
|
|
|
|
</div>
|
2014-04-23 21:20:03 +08:00
|
|
|
</div>
|
|
|
|
|
2014-05-13 10:30:15 +08:00
|
|
|
<div style="clear:both"></div>
|
2014-04-23 21:20:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
2014-05-13 10:30:15 +08:00
|
|
|
<h3><strong>新开课程</strong></h3>
|
2014-07-04 09:10:17 +08:00
|
|
|
<% if @school_id %>
|
2014-07-05 09:33:52 +08:00
|
|
|
<% school_course = find_miracle_course(10,7, @school_id) %>
|
2014-07-04 09:10:17 +08:00
|
|
|
<% else %>
|
|
|
|
<%school_course=[]%>
|
|
|
|
<% end %>
|
|
|
|
<% if (school_course.count == 0) %>
|
2014-07-03 15:30:52 +08:00
|
|
|
<span><%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %></span>
|
2014-07-04 09:10:17 +08:00
|
|
|
|
2014-05-13 10:30:15 +08:00
|
|
|
<div class="d-p-projectlist-box">
|
|
|
|
<ul class="d-p-projectlist">
|
2014-05-10 15:33:18 +08:00
|
|
|
|
2014-05-13 10:30:15 +08:00
|
|
|
</ul>
|
|
|
|
<ul class="d-p-projectlist">
|
|
|
|
<h1></h1>
|
2014-07-04 09:10:17 +08:00
|
|
|
|
2014-07-07 09:37:45 +08:00
|
|
|
<% if User.current.logged? %>
|
|
|
|
<p id="errorExplanation">
|
|
|
|
该学校未开设任何课程,您可以查看其他学校课程
|
|
|
|
</p>
|
|
|
|
<% end %>
|
2014-07-04 09:10:17 +08:00
|
|
|
|
2014-05-13 10:30:15 +08:00
|
|
|
<h1></h1>
|
2014-07-04 09:10:17 +08:00
|
|
|
<% find_all_new_hot_course(9, @school_id).map do |course| %>
|
2014-07-30 16:03:23 +08:00
|
|
|
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>>
|
2014-05-13 10:30:15 +08:00
|
|
|
<div class='avatar'>
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
|
|
|
<!-- 上左下右 -->
|
2014-07-04 09:10:17 +08:00
|
|
|
<div class='desc_item'>
|
2014-05-13 10:30:15 +08:00
|
|
|
<span class=''>
|
2014-07-04 09:10:17 +08:00
|
|
|
<% if (course.school == nil) %>
|
2014-05-13 10:30:15 +08:00
|
|
|
|
|
|
|
<% else %>
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
|
2014-05-13 10:30:15 +08:00
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
<span class='font_bolder'>
|
2014-05-23 10:59:52 +08:00
|
|
|
<%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
|
2014-05-10 15:33:18 +08:00
|
|
|
<%#=course.try(:teacher).try(:name)%>
|
2014-05-13 10:30:15 +08:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class='desc_item text_nowrap' style="width: 310px;">
|
2014-07-04 09:10:17 +08:00
|
|
|
[<%= get_course_term course %>]
|
|
|
|
<%= link_to(course.name, course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
|
|
|
|
(<%= "#{studentCount(course)}人" %>)
|
|
|
|
<% files_count = course.attachments.count.to_s %>
|
|
|
|
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
|
|
|
</li>
|
2014-05-10 15:33:18 +08:00
|
|
|
<% end %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% else %>
|
2014-05-19 10:00:24 +08:00
|
|
|
<% if school_course.count < 9 %>
|
|
|
|
<span>
|
2014-07-03 15:30:52 +08:00
|
|
|
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => nil} %>
|
2014-05-19 10:00:24 +08:00
|
|
|
</span>
|
|
|
|
<% else %>
|
|
|
|
<span>
|
2014-07-03 17:28:13 +08:00
|
|
|
<%= link_to "更多>>", {:controller => 'courses', :action => 'index', :school_id => @school_id} %>
|
2014-05-19 10:00:24 +08:00
|
|
|
</span>
|
|
|
|
<% end %>
|
2014-05-13 10:30:15 +08:00
|
|
|
<div class="d-p-projectlist-box">
|
|
|
|
<ul class="d-p-projectlist">
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
<ul class="d-p-projectlist">
|
2014-07-04 09:10:17 +08:00
|
|
|
<% school_course.map do |course| %>
|
2014-07-05 09:33:52 +08:00
|
|
|
<% if course.school%>
|
2014-07-30 16:03:23 +08:00
|
|
|
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>>
|
2014-05-13 10:30:15 +08:00
|
|
|
<div class='avatar'>
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
|
|
|
<!-- 上左下右 -->
|
2014-07-04 09:10:17 +08:00
|
|
|
<div class='desc_item'>
|
2014-05-13 10:30:15 +08:00
|
|
|
<span class=''>
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</span>
|
|
|
|
<span class='font_bolder'>
|
2014-05-23 10:59:52 +08:00
|
|
|
<%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</span>
|
|
|
|
</div>
|
2014-07-04 09:10:17 +08:00
|
|
|
<div class='desc_item text_nowrap' style="width: 310px;">
|
|
|
|
[<%= get_course_term course %>]
|
|
|
|
<%= link_to(course.name, course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
|
|
|
|
(<%= "#{studentCount(course)}人" %>)
|
|
|
|
<% files_count = course.attachments.count.to_s %>
|
|
|
|
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
2014-05-19 17:56:39 +08:00
|
|
|
|
2014-05-13 10:30:15 +08:00
|
|
|
<div class='join_course_link'>
|
2014-07-04 09:10:17 +08:00
|
|
|
<% if !course_endTime_timeout?(course) %>
|
|
|
|
<div>
|
|
|
|
<%= join_in_course(course, User.current) %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</li>
|
2014-07-05 09:33:52 +08:00
|
|
|
<%end%>
|
2014-07-04 09:10:17 +08:00
|
|
|
<% end; reset_cycle %>
|
2014-05-19 10:00:24 +08:00
|
|
|
<% if school_course.count < 9 %>
|
2014-07-04 09:10:17 +08:00
|
|
|
<li>
|
|
|
|
<h1></h1>
|
|
|
|
|
|
|
|
<p id="errorExplanation">
|
|
|
|
该学校开设课程较少,您可以查看其他学校课程
|
|
|
|
</p>
|
|
|
|
</li>
|
|
|
|
<% find_all_new_hot_course(9 - school_course.count, @school_id).map do |course| %>
|
2014-07-30 16:03:23 +08:00
|
|
|
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s.gsub(/<\/?.*?>/,"") %>>
|
2014-07-04 09:10:17 +08:00
|
|
|
<div class='avatar'>
|
|
|
|
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
|
|
|
|
</div>
|
|
|
|
<!-- 上左下右 -->
|
|
|
|
<div class='desc_item'>
|
2014-05-19 10:00:24 +08:00
|
|
|
<span class=''>
|
2014-07-04 09:10:17 +08:00
|
|
|
<% if (course.school == nil) %>
|
2014-05-19 10:00:24 +08:00
|
|
|
|
|
|
|
<% else %>
|
2014-06-19 15:31:30 +08:00
|
|
|
<!-- modified by zjc 添加超链接 -->
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= link_to course.school.name.try(:gsub, /(.+)$/, '\1:'), options={:action => 'course', :school_id => course.school.id}, html_options={:method => 'get'} %>
|
2014-05-19 10:00:24 +08:00
|
|
|
<% end %>
|
|
|
|
</span>
|
|
|
|
<span class='font_bolder'>
|
|
|
|
<%= link_to(course.try(:teacher).try(:name), user_path(course.teacher)) %>
|
|
|
|
</span>
|
2014-07-04 09:10:17 +08:00
|
|
|
</div>
|
|
|
|
<div class='desc_item text_nowrap' style="width: 310px;">
|
|
|
|
[<%= get_course_term course %>]
|
|
|
|
<%= link_to(course.name, course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
|
|
|
|
<%= "#{studentCount(course)}人" %> )
|
|
|
|
<% files_count = course.attachments.count.to_i.to_s %>
|
|
|
|
(<%= link_to "#{files_count}份", course_files_path(course) %>资料)
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2014-05-19 10:00:24 +08:00
|
|
|
<% end %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2014-04-23 21:20:03 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
2014-05-13 10:30:15 +08:00
|
|
|
<h3 style="padding-bottom:0px ;margin-left: 5px; color: #e8770d;">
|
|
|
|
<strong>问题和反馈动态</strong>
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= link_to "我要提问", newbie_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE"} %>
|
|
|
|
<%= link_to "我要反馈", suggestion_send_path, {:class => 'orangeButton idea_btn', :style => "color: #EEEEEE"} %>
|
2014-05-13 10:30:15 +08:00
|
|
|
</h3>
|
|
|
|
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", forums_path %></span>
|
2014-07-04 09:10:17 +08:00
|
|
|
|
2014-05-13 10:30:15 +08:00
|
|
|
<div class="d-p-projectlist-box">
|
|
|
|
<ul class="d-p-projectlist">
|
2014-07-04 09:10:17 +08:00
|
|
|
<% find_new_forum_topics(10).each do |topic| %>
|
2014-05-13 10:30:15 +08:00
|
|
|
<li class="message-brief-intro" style="min-height: 65px; line-height:2em; ">
|
2014-07-04 09:10:17 +08:00
|
|
|
<div style="display: inline-block; width: 100%;">
|
2014-05-26 08:56:16 +08:00
|
|
|
<span class="memo_activity text_nowrap" style="color:gray; display: inline-block; margin-bottom:6px; background: url('/images/list-icon.png') no-repeat scroll ;background-position: left center;">
|
2014-07-04 09:10:17 +08:00
|
|
|
<%= link_to '['+topic.forum.name + ']', forum_path(topic.forum), :class => 'memo_Bar_title' %><%= link_to topic.subject.truncate(30, omission: '...'), topic.event_url, :class => "gray", :style => "font-size: 10pt !important;" %>
|
2014-04-23 21:20:03 +08:00
|
|
|
</span>
|
2014-07-04 09:10:17 +08:00
|
|
|
|
2014-05-21 18:52:15 +08:00
|
|
|
<div class='memo_activity 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">
|
2014-07-28 15:06:54 +08:00
|
|
|
楼主: <%= link_to topic.author.login.truncate(10, omission: '...'),user_path(topic.author),title: topic.author.login %>
|
2014-05-21 18:52:15 +08:00
|
|
|
</span>
|
|
|
|
<span class="memo_last_person">
|
2014-07-28 15:06:54 +08:00
|
|
|
最后回复:<% 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 %>
|
2014-05-21 18:52:15 +08:00
|
|
|
</span>
|
|
|
|
<span class="memo_reply">
|
|
|
|
回复(<%= link_to topic.try(:replies_count), topic.event_url %>)
|
|
|
|
</span>
|
|
|
|
</div>
|
2014-05-13 10:30:15 +08:00
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2014-04-23 21:20:03 +08:00
|
|
|
</div>
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
2014-05-19 16:12:06 +08:00
|
|
|
<%= render partial: 'link_to_another' %>
|