This commit is contained in:
sw 2014-07-05 11:21:27 +08:00
commit 6365d01051
21 changed files with 119 additions and 117 deletions

View File

@ -60,7 +60,7 @@ class AttachmentsController < ApplicationController
:disposition => (@attachment.image? ? 'inline' : 'attachment') :disposition => (@attachment.image? ? 'inline' : 'attachment')
end end
rescue => e rescue => e
redirect_to "http://forge.trustie.net/file_not_found.html" redirect_to "http://" + (Setting.host_name.to_s) +"/file_not_found.html"
end end
#更新资源文件类型 #更新资源文件类型

View File

@ -42,7 +42,7 @@ class ProjectsController < ApplicationController
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches] before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar] before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
before_filter :file, :statistics, :watcherlist before_filter :file, :statistics, :watcherlist
before_filter :find_project_repository, :only => [:show]
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去 # 除非项目内人员,不可查看成员, TODO: 完了写报表里去
before_filter :memberAccess, only: :member before_filter :memberAccess, only: :member
@ -78,6 +78,14 @@ class ProjectsController < ApplicationController
### added by william ### added by william
include ActsAsTaggableOn::TagsHelper include ActsAsTaggableOn::TagsHelper
def find_project_repository
unless @project.repositories.nil?
@project.repositories.each do |repository|
repository.fetch_changesets if Setting.autofetch_changesets?
end
end
end
def enterprise_course def enterprise_course
session[:enterprise_college] = 2 session[:enterprise_college] = 2
respond_to do |format| respond_to do |format|

View File

@ -141,27 +141,26 @@ module WelcomeHelper
Course.active.visible. Course.active.visible.
joins(:memberships). joins(:memberships).
group('members.course_id'). group('members.course_id').
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum
else else
if school_id.nil? if school_id.nil?
Course.active.visible. Course.active.visible.
joins(:memberships). joins(:memberships).
where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.id). where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.id).
group('members.course_id'). group('members.course_id').
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum
else else
if school_id == "0" if school_id == "0"
Course.active.visible. Course.active.visible.
joins(:memberships). joins(:memberships).
group('members.course_id'). group('members.course_id').
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum
else else
Course.active.visible. Course.active.visible.
joins(:memberships). joins(:memberships).
where("#{Course.table_name}.school_id = ?", school_id). where("#{Course.table_name}.school_id = ?", school_id).
group('members.course_id'). group('members.course_id').
reorder("courses.time DESC, COUNT(members.course_id) DESC").take sum reorder("courses.created_at DESC, COUNT(members.course_id) DESC").take sum
end end
end end
end end

View File

@ -46,6 +46,8 @@ class Mailer < ActionMailer::Base
when :Project when :Project
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Course
course_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Contest when :Contest
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}") show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :User when :User
@ -54,9 +56,10 @@ class Mailer < ActionMailer::Base
Rails.logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}" Rails.logger.error "[Builds a Mail::Message ERROR] journalsForMessage's jour is unkown type, journalsForMessage.id = #{journals_for_message.id}"
return -1 return -1
end end
#如果是直接留言并且留言对象是Project并且Project类型是课程 # modify by nwb
if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Project && journals_for_message.jour.project_type == 1 #如果是直接留言并且留言对象是课程
project = journals_for_message.jour if !journals_for_message.at_user && journals_for_message.jour.class.to_s.to_sym == :Course
course = journals_for_message.jour
@author = journals_for_message.user @author = journals_for_message.user
#课程的教师 #课程的教师
@teachers = searchTeacherAndAssistant journals_for_message.jour @teachers = searchTeacherAndAssistant journals_for_message.jour

View File

@ -57,7 +57,7 @@
<td style="width: 50%"> <td style="width: 50%">
<div id = "what_is_project_div" style="display: none"> <div id = "what_is_project_div" style="display: none">
<p>项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。</p> <p>项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。</p>
<p>项目托管平台:<a href="http://forge.trustie.net/">http://forge.trustie.net/</a> </p> <p>项目托管平台:<%= link_to Setting.protocol + "://" + Setting.host_name + "/", home_path %> </p>
<%= link_to "我要创建项目",new_project_path(course: 0, project_type: 0), :target => '_blank'%> <%= link_to "我要创建项目",new_project_path(course: 0, project_type: 0), :target => '_blank'%>
</div> </div>
</td> </td>

View File

@ -17,9 +17,9 @@
<% @admin = @course.course_infos%> <% @admin = @course.course_infos%>
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%> <%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
<!-- <%= @admin.first.user.user_extensions.occupation %> --> <!-- <%= @admin.first.user.user_extensions.occupation %> -->
<%# unless @course.course_extra.school.nil? %> <% unless @course.teacher.user_extensions.school.nil? %>
<%= @course.teacher.user_extensions.school.try(:name) %> <%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %>
<%# end %> <% end %>
<% end %> <% end %>
</p> </p>
<p > <p >

View File

@ -24,7 +24,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/course", :controller => 'courses', :action => 'index', :course_type => 1 %> </a></td> <td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index', :course_type => 1 %> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index', :course_type => 1 %></td> <td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index', :course_type => 1 %></td>
</tr> </tr>
</table> </table>

View File

@ -22,7 +22,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><a><%= link_to "forge.trustie.net/courses", :controller => 'courses', :action => 'index'%> </a></td> <td style="padding-left: 8px"><a><%= link_to request.host() + "/courses", :controller => 'courses', :action => 'index'%> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %></td> <td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %></td>
</tr> </tr>
</table> </table>

View File

@ -143,7 +143,7 @@ body table tr td span6 {
<td><p >在桌面上点击鼠标右键选择TortoiseGit的Settings进行设置</p></td> <td><p >在桌面上点击鼠标右键选择TortoiseGit的Settings进行设置</p></td>
</tr> </tr>
<tr> <tr>
<td align="left">Name和Email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到,<span5> 其中的name和email要和forge.trustie.net上的登陆名和邮箱保持一致</span5> <td align="left">Name和Email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到,<span5> 其中的name和email要和<%= Setting.host_name %>上的登陆名和邮箱保持一致</span5>
,方便代码贡献统计 )。 </td> ,方便代码贡献统计 )。 </td>
</tr> </tr>
<tr> <tr>
@ -313,7 +313,7 @@ body table tr td span6 {
<td><p ><span>$git&nbsp;config&nbsp;--global&nbsp;user.name&nbsp;&#8220;your_name&#8221;</span></p> <td><p ><span>$git&nbsp;config&nbsp;--global&nbsp;user.name&nbsp;&#8220;your_name&#8221;</span></p>
<p><span>$git&nbsp;config&nbsp;--global&nbsp;user.email&nbsp;&#8220;your_email&#8221;&nbsp;</span> </p> <p><span>$git&nbsp;config&nbsp;--global&nbsp;user.email&nbsp;&#8220;your_email&#8221;&nbsp;</span> </p>
<p>Name和Email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到, <p>Name和Email是用来设置自己的用户名和联系方式的user.name和user.email必须填写这些将在版本库提交时用到,
<span5> 其中的name和email要和forge.trustie.net上的登陆名和密码保持一致</span5> <span5> 其中的name和email要和<%= Setting.host_name %>上的登陆名和密码保持一致</span5>
,方便代码贡献统计 )。</p></td> ,方便代码贡献统计 )。</p></td>
</tr> </tr>

View File

@ -143,7 +143,7 @@ body table tr td span6 {
<table width="900" border="0"> <table width="900" border="0">
<tr> <tr>
<td><p>Right-click on the desktop and select the &quot;Settings&quot; in the &quot;TortoiseGit&quot;</p> <td><p>Right-click on the desktop and select the &quot;Settings&quot; in the &quot;TortoiseGit&quot;</p>
<p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository, <span5> the name and email must be the same with login name and email you registed in the forge.trustie.net</span5> <p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository, <span5> the name and email must be the same with login name and email you registed in the <%= Setting.host_name %></span5>
). </p> ). </p>
<p>Then you can customize the &quot;Context Menu&quot;:</p> <p>Then you can customize the &quot;Context Menu&quot;:</p>
<p>Please check the &quot;<span>Clone</span>&quot;,&quot;<span>Sync</span>&quot; and &quot;<span>Commit</span>&quot; options in the &quot;<span>Context Menu</span>&quot;,</p> <p>Please check the &quot;<span>Clone</span>&quot;,&quot;<span>Sync</span>&quot; and &quot;<span>Commit</span>&quot; options in the &quot;<span>Context Menu</span>&quot;,</p>
@ -306,7 +306,7 @@ body table tr td span6 {
<td><p><span>$git config --global user.name &ldquo;your_name&rdquo;M</span></p> <td><p><span>$git config --global user.name &ldquo;your_name&rdquo;M</span></p>
<p><span>$git config --global user.email &ldquo;your_email&rdquo;</span> </p> <p><span>$git config --global user.email &ldquo;your_email&rdquo;</span> </p>
<p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository, <p>User name and email are used to set your own user name and contact information( user.name and user.email must be completed because these will be used when submitting the repository,
<span5> the name and email must be the same with login name and email you registed in the forge.trustie.net</span5> <span5> the name and email must be the same with login name and email you registed in the <%= Setting.host_name %></span5>
). </p></td> ). </p></td>
</tr> </tr>
</table> </table>

View File

@ -12,7 +12,7 @@
<span class="footer_text_link"><%= link_to l(:label_organizers_information),"http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span> <span class="footer_text_link"><%= link_to l(:label_organizers_information),"http://www.nudt.edu.cn/ArticleShow.asp?ID=47",:target=>"_blank"%></span>
<span class="footer_text_link"><%= link_to l(:label_organizers_information_institute), "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span> <span class="footer_text_link"><%= link_to l(:label_organizers_information_institute), "http://www.nudt.edu.cn/ArticleShow.asp?ID=41", :target => "_blank" %></span>
<span id="copyright"><%=l(:label_copyright)%>@2007~2014</span> <span id="copyright"><%=l(:label_copyright)%>@2007~2014</span>
<span id="contact_us" class="footer_text_link"><%= link_to l(:label_contact_us),"http://forge.trustie.net/projects/2/member", :target=>"_blank" %></span> <span id="contact_us" class="footer_text_link"><%= link_to l(:label_contact_us),"http://" + Setting.host_name + "/projects/2/member", :target=>"_blank" %></span>
<span id="record"class="footer_text_link"><%= link_to l(:label_record),"http://www.miibeian.gov.cn/", :target => "_blank" %></span> <span id="record"class="footer_text_link"><%= link_to l(:label_record),"http://www.miibeian.gov.cn/", :target => "_blank" %></span>
</p> </p>

View File

@ -5,7 +5,7 @@
主办单位: 主办单位:
<%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47"%> <%= link_to "国防科学技术大学并行与分布处理国家重点实验室","http://www.nudt.edu.cn/ArticleShow.asp?ID=47"%>
<%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41"%> <%= link_to "计算机科学与技术系", "http://www.nudt.edu.cn/ArticleShow.asp?ID=41"%>
<%= link_to "联系我们","http://forge.trustie.net/projects/2/member"%> <%= link_to "联系我们","http://" + Setting.host_name + "/projects/2/member"%>
<%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%> <%= link_to "湘ICP备09019772","http://www.miibeian.gov.cn/"%>
</div> </div>
<div class="center"> <div class="center">

View File

@ -1,5 +1,5 @@
<em>尊敬的用户,<%= @user %>给你留言了:</em> <em>尊敬的用户,<%= @user %>给你留言了:</em>
<div><%= @message %></div> <div><%= @message %></div>
<h1>点击链接查看最新回复<%= link_to(@url, @url) %></h1> <h1>点击链接查看最新回复<%= link_to(@url, @url) %></h1>
&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<h4><%= link_to(l(:lable_not_receive_mail),"http://forge.trustie.net/my/account")%></h4> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<h4><%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%></h4>

View File

@ -24,7 +24,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="padding-left: 8px"><a><%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> </a></td> <td style="padding-left: 8px"><a><%= link_to request.host() + "/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> </a></td>
<td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course', :project_type => 1 %></td> <td ><%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course', :project_type => 1 %></td>
</tr> </tr>
</table> </table>

View File

@ -1,91 +1,77 @@
<% if @events_by_day.size >0 %> <% if @events_by_day.size >0 %>
<div class="content-title-top-avtive"> <div class="content-title-top-avtive">
<!-- <h3><%= @author.nil? ? l(:label_activity) : l(:label_user_activity, link_to_user(@author)).html_safe %></h3> --> <p class="subtitle">
<p class="subtitle"> <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
<%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %> </p>
</p>
<% @events_by_day.keys.sort.reverse.each do |day| %>
<div>
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
<div>
<table class="underline-evreycontent" style="font-size: 14px;">
<tr>
<td colspan="2" valign="top" width="50" ><%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%></td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top">
<strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
<span class="font_lighter">
<% if @canShowRealName %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>(<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>)
<% else %>
<%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% end %>
<%= l(:label_new_activity) %> </span> <% @events_by_day.keys.sort.reverse.each do |day| %>
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %> <div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;">
</td> <div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
</tr> <%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%>
<tr> </div>
<td colspan="2" width="580px" > <div class="activity-content" style="padding:5px 5px 5px 70px;">
<p class="info-break"> <strong> <%= h(e.project) if @project.nil? || @project.id != e.project.id %></strong>
<%= h(truncate(strip_tags(e.event_description).gsub(/&nbsp;/,' '), length: 30, omission:'...')) %> <span class="activity-title font_lighter">
</p></td> <% if @canShowRealName %>
</tr> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>(<%= link_to_user(e.event_author,@canShowRealName) if e.respond_to?(:event_author) %>)
<tr> <% else %>
<td align="left"><span class="font_lighter"> <%= l :label_activity_time %>&nbsp; <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span></td> <%= link_to_user(e.event_author) if e.respond_to?(:event_author) %>
<% if e.event_type == "issue" %> <% end %>
<td align="right"><span> <%= link_to l(:label_find_all_comments), issue_path(e) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count)%></span></td>
<% end %>
</tr>
</table></td>
</tr>
</table>
</div>
<% end %>
</div>
<% end -%> <%= l(:label_new_activity) %>
</span>
<%= link_to "#{eventToLanguageCourse(e.event_type, @project)}: "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Project)) ? project_files_path(e.container) : e.event_url %>
<div class="activity_description info-break" style="font-size: 13px;">
</div> <%= h(truncate(strip_tags(e.event_description).gsub(/&nbsp;/,' '), length: 30, omission:'...')) %>
<%end%> </div>
<div class="activity_status" style="position:relative; padding-top: 3px;">
<span class="font_lighter"> <%= l :label_activity_time %>&nbsp; <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %></span>
<% if e.event_type == "issue" %>
<div class="" style="display:inline-block;position:absolute; right:2%;">
<span> <%= link_to l(:label_find_all_comments), issue_path(e) %> </span><span class="font_lighter"><%= l(:label_comments_count, :count => e.journals.count)%></span>
</div>
<% end %>
</div>
</div>
</div>
<div class="font_description"> <% end %>
<table width="660"> <% end -%>
<tr> <% if(@events_pages.page == @events_pages.last_page) %>
<td><%= image_tag(url_to_avatar(@user), :class => "avatar") %></td> <div class="activity-item underline-evreycontent" style="font-size: 14px;line-height:1.5em;">
<td colspan="2"> <div class="activity-avatar" style="float: left; margin:3px; height: 100%;">
<table width="580"> <%= image_tag(url_to_avatar(@user), :class => "avatar") %>
<tr> </div>
<td > <div class="activity-content" style="padding:5px 5px 5px 70px;">
<% <span class="activity-title font_lighter">
#判断是否显示真名 <% if @canShowRealName %>
if @canShowRealName <%= link_to (h @user.try(:name)), user_path(@user) if @user %>(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>)
%> <% else %>
<%= link_to (h @user.try(:name)), user_path(@user) if @user %>(<%= link_to (h @user.try(:realname)), user_path(@user) if @user %>) <%= link_to (h @user.try(:name)), user_path(@user) if @user %>
<% else %> <% end %>
<%= link_to (h @user.try(:name)), user_path(@user) if @user %> <%#= l(:label_new_activity) %>
<% end %> </span>
<%= l(:label_user_create_project) %> <%= link_to @project.name %><strong> !</strong></td> <%= l(:label_user_create_project) %> <%= link_to @project.name %><strong> !</strong>
</tr> <div class="activity_description info-break" style="font-size: 13px;">
<tr> </div>
<td class="font_lighter" style="float: right"><%= l :label_update_time %>: <%= format_time(@project.created_on) %> <div class="activity_status" style="position:relative; padding-top: 3px;">
</table></td> <span class="font_lighter"><%= l :label_activity_time %>: <%= format_time(@project.created_on) %></span>
</tr> </div>
</table> </div>
</div>
<% end %>
</div> </div>
<%end%>
<div class="pagination"> <div class="pagination">
<ul> <ul>
<%= pagination_links_full @events_pages%> <%= pagination_links_full @events_pages%>
<% #binding.pry %>
</ul> </ul>
</div> </div>

View File

@ -1,6 +1,6 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="linkother"> <div class="linkother">
<a href="http://forge.trustie.net" class="link_other_item"><%=l(:label_projects_management_platform)%></a> <a href="http://<%= Setting.host_name%>" class="link_other_item"><%=l(:label_projects_management_platform)%></a>
<a href="http://course.trustie.net" class="link_other_item"><%=l(:label_courses_management_platform)%></a> <a href="http://<%= Setting.host_course%>" class="link_other_item"><%=l(:label_courses_management_platform)%></a>
<a href="http://contest.trustie.net" class="link_other_item"><%=l(:label_contests_management_platform)%></a> <a href="http://<%= Setting.host_contest%>" class="link_other_item"><%=l(:label_contests_management_platform)%></a>
</div> </div>

View File

@ -73,7 +73,7 @@
<div id="J_Slide" class="d-p-index-box d-p-index-hotproject"> <div id="J_Slide" class="d-p-index-box d-p-index-hotproject">
<h3><strong>新开课程</strong></h3> <h3><strong>新开课程</strong></h3>
<% if @school_id %> <% if @school_id %>
<% school_course = find_miracle_course(10, 7, @school_id) %> <% school_course = find_miracle_course(10,7, @school_id) %>
<% else %> <% else %>
<%school_course=[]%> <%school_course=[]%>
<% end %> <% end %>
@ -138,6 +138,7 @@
</ul> </ul>
<ul class="d-p-projectlist"> <ul class="d-p-projectlist">
<% school_course.map do |course| %> <% school_course.map do |course| %>
<% if course.school%>
<li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s %>> <li class='<%= cycle("odd", "even") %>' title=<%= course.description.to_s %>>
<div class='avatar'> <div class='avatar'>
<%= image_tag(get_course_avatar(course), :class => "avatar-4") %> <%= image_tag(get_course_avatar(course), :class => "avatar-4") %>
@ -167,6 +168,7 @@
<% end %> <% end %>
</div> </div>
</li> </li>
<%end%>
<% end; reset_cycle %> <% end; reset_cycle %>
<% if school_course.count < 9 %> <% if school_course.count < 9 %>
<li> <li>

View File

@ -700,7 +700,7 @@ RedmineApp::Application.routes.draw do
#######confusing######## #######confusing########
get 'welcome/search', to: 'welcome#search' get 'welcome/search', to: 'welcome#search'
get 'school/index', to: 'school#index' get 'school/index', to: 'school#index'
get 'course/:school_id', to: 'welcome#course', :as => 'school_course_list' get 'school/:school_id', to: 'welcome#course', :as => 'school_course_list'
#get 'course/:school_id', to: 'welcome#course' #get 'course/:school_id', to: 'welcome#course'
post 'school/get_options/:province', :to => 'school#get_options' post 'school/get_options/:province', :to => 'school#get_options'
get 'school/get_options/:province', :to => 'school#get_options' get 'school/get_options/:province', :to => 'school#get_options'

View File

@ -71,6 +71,10 @@ default_language:
default: zh default: zh
host_name: host_name:
default: forge.trustie.net default: forge.trustie.net
host_course:
default: course.trustie.net
host_contest:
default: contest.trustie.net
protocol: protocol:
default: http default: http
feeds_limit: feeds_limit:

View File

@ -796,18 +796,18 @@ ActiveRecord::Schema.define(:version => 20140704034832) do
create_table "relative_memos", :force => true do |t| create_table "relative_memos", :force => true do |t|
t.integer "osp_id" t.integer "osp_id"
t.integer "parent_id" t.integer "parent_id"
t.string "subject", :null => false t.string "subject", :null => false
t.text "content", :limit => 16777215, :null => false t.text "content", :null => false
t.integer "author_id" t.integer "author_id"
t.integer "replies_count", :default => 0 t.integer "replies_count", :default => 0
t.integer "last_reply_id" t.integer "last_reply_id"
t.boolean "lock", :default => false t.boolean "lock", :default => false
t.boolean "sticky", :default => false t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0 t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0 t.integer "viewed_count_local", :default => 0
t.string "url" t.string "url"
t.string "username" t.string "username"
t.string "userhomeurl" t.string "userhomeurl"

View File

@ -2,8 +2,8 @@ module Redmine
module Info module Info
class << self class << self
def app_name; 'Trustie' end def app_name; 'Trustie' end
def url; 'http://forge.trustie.net/' end def url; 'http://'+ Setting.host_name + '/' end
def help_url; 'http://forge.trustie.net/forums' end def help_url; 'http://'+ Setting.host_name + '/forums' end
def versioned_name; "#{app_name} #{Redmine::VERSION}" end def versioned_name; "#{app_name} #{Redmine::VERSION}" end
def environment def environment