parent
d4fb5665df
commit
cf2689917b
@ -0,0 +1,255 @@
|
|||||||
|
<script type="text/javascript" language="javascript">
|
||||||
|
function clearInfo(id, content) {
|
||||||
|
var text = $('#' + id);
|
||||||
|
if (text.val() == content) {
|
||||||
|
$('#' + id).val('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function(){
|
||||||
|
$("#main").find("a").attr("target", "_blank");
|
||||||
|
});
|
||||||
|
|
||||||
|
function showInfo(id, content) {
|
||||||
|
var text = $('#' + id);
|
||||||
|
if (text.val() == '') {
|
||||||
|
$('#' + id).val(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function (){
|
||||||
|
window.onload = function(){
|
||||||
|
function fixedBar(id, options){
|
||||||
|
var ele = document.getElementById(id);
|
||||||
|
if(!ele) return;
|
||||||
|
if(/msie (\d+\.\d+)/i.test(navigator.userAgent)){
|
||||||
|
var pageHeight=window.innerHeight;
|
||||||
|
var d=document;
|
||||||
|
if(typeof pageHeight!="number"){
|
||||||
|
if(document.compatMode=="CSS1Compat"){
|
||||||
|
pageHeight=document.documentElement.clientHeight;
|
||||||
|
}else{
|
||||||
|
pageHeight=document.body.clientHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
|
||||||
|
if(options.addclass) ele.className = options.addclass;
|
||||||
|
ele.style.position= 'absolute';
|
||||||
|
|
||||||
|
if(options.show){
|
||||||
|
ele.style.top = 0 + "px";
|
||||||
|
ele.style.display= 'block';
|
||||||
|
}
|
||||||
|
|
||||||
|
window.attachEvent('onscroll' , function (){
|
||||||
|
|
||||||
|
var ieScrollTop=window.pageYOffset || d.documentElement.scrollTop || d.body.scrollTop;
|
||||||
|
|
||||||
|
ele.style.top = 0 + "px";
|
||||||
|
if(options.autoHidden){
|
||||||
|
if(ieScrollTop==0){
|
||||||
|
ele.style.display="none";
|
||||||
|
}else{
|
||||||
|
ele.style.display="block";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
var ele = document.getElementById(id);
|
||||||
|
if(typeof pageHeight!="number"){
|
||||||
|
if(document.compatMode=="CSS1Compat"){
|
||||||
|
pageHeight=document.documentElement.clientHeight;
|
||||||
|
}else{
|
||||||
|
pageHeight=document.body.clientHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(options.show) ele.style.display= 'block';
|
||||||
|
ele.style.top = 0 +'px';
|
||||||
|
window.addEventListener('scroll',function (){
|
||||||
|
if(options.autoHidden){
|
||||||
|
if(baidu.page.getScrollTop()==0){
|
||||||
|
ele.style.display="none";
|
||||||
|
}else{
|
||||||
|
ele.style.display="block";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fixedBar('backTopBtn' , {autoHidden: true, top : 186});
|
||||||
|
fixedBar('identifier-pannel' , {autoHidden: false , top : 956 , show : true});
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<div class='top_bar'>
|
||||||
|
<div id="identifier-pannel" style="display:none">
|
||||||
|
<%= image_tag '/images/qrweixin.jpg', size: '150x150', alt: 'trustie', class: "weixin" %>
|
||||||
|
<div class="weixin-content">微信扫码</div>
|
||||||
|
</div>
|
||||||
|
<div class="main-content-bar">
|
||||||
|
<div class="welcome_left" >
|
||||||
|
<span class="font_welcome_trustie"><%= l(:label_welcome_trustie) %> </span><span class="font_welcome_tdescription">, <%= l(:label_welcome_trustie_description) %></span>
|
||||||
|
</div>
|
||||||
|
<div class="search-bar">
|
||||||
|
<%= render :partial => "search_bar"%>
|
||||||
|
</div>
|
||||||
|
<div style="clear: both;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="clear:both"></div>
|
||||||
|
|
||||||
|
|
||||||
|
<%= stylesheet_link_tag 'welcome' %>
|
||||||
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||||
|
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门课程</strong></h3>
|
||||||
|
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :project_sort_type => 1}, :target => "_blank" %></span>
|
||||||
|
<div class="d-p-projectlist-box">
|
||||||
|
<ul class="d-p-projectlist">
|
||||||
|
<% find_all_hot_course.map do |project| break if(project == find_all_hot_course[5]) %>
|
||||||
|
<li style="background-image:none;">
|
||||||
|
<div style="float: left;">
|
||||||
|
<% if get_avatar?(project)%>
|
||||||
|
<%= image_tag(url_to_avatar(project), :class => "avatar-4") %>
|
||||||
|
<% else %>
|
||||||
|
<%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar-4") %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div style="float: left; margin-left: 10px; width: 360px;">
|
||||||
|
<p class="layout">
|
||||||
|
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}", :target => "_blank" )%>
|
||||||
|
<span style="cursor: pointer; display: inline-block; float: right; color: #ec6300; white-space: nowrap;">学生人数:<%= link_to "#{studentCount(project)}", project_member_path(project, :role => 2) ,:course =>'1', :target => "_blank" %></span>
|
||||||
|
</p>
|
||||||
|
<p class="layout-1" >
|
||||||
|
<%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||||
|
<h3 style="margin-left: 5px; color: #e8770d;"><strong>我的课程</strong></h3>
|
||||||
|
<span style="margin-top: -20px;float: right; display: block;"><%= (link_to "更多>>", {:controller => 'projects', :action => 'course', :project_type => 1, :project_sort_type => 1}) if User.current.login? %></span>
|
||||||
|
<div class="d-p-projectlist-box">
|
||||||
|
<ul class="d-p-projectlist" style="height:200px;">
|
||||||
|
<%if !User.current.login?%>
|
||||||
|
<li style="background-image:none;">
|
||||||
|
请<%=link_to "登录", signin_path %>后查看
|
||||||
|
</li>
|
||||||
|
<%else%>
|
||||||
|
<% find_all_hot_course(2).map do |project| %>
|
||||||
|
<li style="background-image:none;">
|
||||||
|
<div style="float: left;">
|
||||||
|
<% if get_avatar?(project)%>
|
||||||
|
<%= image_tag(url_to_avatar(project), :class => "avatar-4") %>
|
||||||
|
<% else %>
|
||||||
|
<%= image_tag('../images/avatars/Project/course.jpg', :class => "avatar-4") %>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<div style="float: left; margin-left: 10px; width: 360px;">
|
||||||
|
<p class="layout">
|
||||||
|
<%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name",:title => "#{project.name}", :target => "_blank" )%>
|
||||||
|
<span style="cursor: pointer; display: inline-block; float: right; color: #ec6300; white-space: nowrap;">学生人数:<%= link_to "#{studentCount(project)}", project_member_path(project, :role => 2) ,:course =>'1', :target => "_blank" %></span>
|
||||||
|
</p>
|
||||||
|
<p class="layout-1" >
|
||||||
|
<%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<% end -%>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="web_status">
|
||||||
|
<h3 style="margin-left: 5px; color: #e8770d;"><strong>当前网站状态</strong></h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>课程总量: 15</td>
|
||||||
|
<td>教师数量: 6</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>用户总量: 810</td>
|
||||||
|
<td>学生数量: 233</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>资源总量: 0810</td>
|
||||||
|
<td> </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div style="text-align: right; padding-right: 20px">
|
||||||
|
<%= link_to "意见反馈" , '#', {:class => 'orangeButton', :style => "color: #EEEEEE" }%>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="clearfix"></div>
|
||||||
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
|
||||||
|
<h3 style="margin-left: 5px; color: #e8770d;"><strong>热门项目</strong></h3>
|
||||||
|
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", { :controller => 'projects', :action => 'index', :project_type => 0}, :target => "_blank" %></span>
|
||||||
|
<div class="d-p-projectlist-box">
|
||||||
|
<ul class="d-p-projectlist">
|
||||||
|
<% find_all_hot_project(6).map do |project| %>
|
||||||
|
<li style="background-image:none;">
|
||||||
|
<div style="float: left;">
|
||||||
|
<%= image_tag url_to_avatar(project), :class => "avatar-4" %>
|
||||||
|
</div>
|
||||||
|
<div style="float: left; margin-left: 10px; width: 360px;">
|
||||||
|
<p class="layout">
|
||||||
|
<span style="display: inline-block; width: 250px;"><%= link_to( project.name, project_path(project.id), :class => "d-g-blue d-p-project-name", :title => "#{project.name}", :target => "_blank" )%></span>
|
||||||
|
<%= content_tag "span", show_grade(project),
|
||||||
|
:style => "cursor: pointer; display: inline-block; float: right; color: #ec6300; ",
|
||||||
|
:title => "项目得分,综合考虑了项目的各项活动,反映了该项目的活跃程度",
|
||||||
|
:class => "tooltip",
|
||||||
|
:id => "tooltip-#{project.id}" %>
|
||||||
|
</p>
|
||||||
|
<p class="layout-1" >
|
||||||
|
<%= content_tag "span", project.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => project.description %>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject" style="float: right;">
|
||||||
|
<h3 style="margin-left: 5px; color: color: (51, 119, 51);"><strong>热门竞赛</strong></h3>
|
||||||
|
<span style="margin-top: -20px;float: right; display: block;"><%= link_to "更多>>", {:controller => 'bids', :action => 'contest', :project_type => 1}, :target => "_blank" %></span>
|
||||||
|
<div class="d-p-projectlist-box">
|
||||||
|
<ul class="d-p-projectlist">
|
||||||
|
<% find_all_hot_contest.map do |contest| break if(contest == find_all_hot_contest[5]) %>
|
||||||
|
<li style="background-image:none;">
|
||||||
|
<p class="layout">
|
||||||
|
<span style = "background: url('/images/007.gif') no-repeat scroll ;background-position: left center;"><%= link_to( contest.name, respond_path(contest.id), :class => "d-g-blue d-p-project-name", :title => "#{contest.name}",
|
||||||
|
:style => "margin-left: 28px;", :target => "_blank") %></span>
|
||||||
|
</p>
|
||||||
|
<p class="layout-1" >
|
||||||
|
<%= content_tag "span", contest.description.truncate(50, omission: '...'), :class => "d-p-project-intro" , :title => contest.description %>
|
||||||
|
</p>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="clr">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<br/><br/><br/><br/><br/><br/><br/>
|
||||||
|
<div style="padding-top: 40px"></div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,69 @@
|
|||||||
|
# Redmine - project management software
|
||||||
|
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or
|
||||||
|
# modify it under the terms of the GNU General Public License
|
||||||
|
# as published by the Free Software Foundation; either version 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
require File.expand_path('../../test_helper', __FILE__)
|
||||||
|
|
||||||
|
class CourseTest < ActiveSupport::TestCase
|
||||||
|
def setup
|
||||||
|
@course_1 = Course.new
|
||||||
|
course_now.id = 1
|
||||||
|
course_now.tea_id = 1
|
||||||
|
course_now.name = 'course1'
|
||||||
|
course_now.state = 1234
|
||||||
|
course_now.time = 2012
|
||||||
|
course_now.term = '秋季学期'
|
||||||
|
course_now.password = 1234
|
||||||
|
course_now.class_period = 40
|
||||||
|
|
||||||
|
@course_2 = Course.new
|
||||||
|
course_now.id = 2
|
||||||
|
course_now.tea_id = 1
|
||||||
|
course_now.name = 'course2'
|
||||||
|
course_now.state = 1234
|
||||||
|
course_now.time = 2013
|
||||||
|
course_now.term = '秋季学期'
|
||||||
|
course_now.password = 1234
|
||||||
|
course_now.class_period = 40
|
||||||
|
|
||||||
|
@course_3 = Course.new
|
||||||
|
course_now.id = 3
|
||||||
|
course_now.tea_id = 1
|
||||||
|
course_now.name = 'course3'
|
||||||
|
course_now.state = 1234
|
||||||
|
course_now.time = 2014
|
||||||
|
course_now.term = '秋季学期'
|
||||||
|
course_now.password = 1234
|
||||||
|
course_now.class_period = 40
|
||||||
|
|
||||||
|
@course_now = Course.new
|
||||||
|
course_now.id = 4
|
||||||
|
course_now.tea_id = 1
|
||||||
|
course_now.name = 'course4'
|
||||||
|
course_now.state = 1234
|
||||||
|
course_now.time = 2013
|
||||||
|
course_now.term = '秋季学期'
|
||||||
|
course_now.password = 1234
|
||||||
|
course_now.class_period = 40
|
||||||
|
end
|
||||||
|
|
||||||
|
test 'test course whether out of date.' do
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def teardown
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in new issue