diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index c234eb17b..0b2ae02b3 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -60,7 +60,7 @@ class AttachmentsController < ApplicationController
:disposition => (@attachment.image? ? 'inline' : 'attachment')
end
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
#更新资源文件类型
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index b357ac44f..92186710c 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -42,7 +42,7 @@ class ProjectsController < ApplicationController
before_filter :authorize_global, :only => [:new, :create,:view_homework_attaches]
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy, :calendar]
before_filter :file, :statistics, :watcherlist
-
+ before_filter :find_project_repository, :only => [:show]
# 除非项目内人员,不可查看成员, TODO: 完了写报表里去
before_filter :memberAccess, only: :member
@@ -78,6 +78,14 @@ class ProjectsController < ApplicationController
### added by william
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
session[:enterprise_college] = 2
respond_to do |format|
diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb
index 1004a49ad..4ff5a48e4 100644
--- a/app/helpers/welcome_helper.rb
+++ b/app/helpers/welcome_helper.rb
@@ -141,27 +141,26 @@ module WelcomeHelper
Course.active.visible.
joins(:memberships).
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
if school_id.nil?
Course.active.visible.
joins(:memberships).
where("#{Course.table_name}.school_id = ?", User.current.user_extensions.school.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
if school_id == "0"
Course.active.visible.
joins(:memberships).
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
Course.active.visible.
joins(:memberships).
where("#{Course.table_name}.school_id = ?", school_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
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 81ef95c85..09db4de97 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -46,6 +46,8 @@ class Mailer < ActionMailer::Base
when :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}")
+ when :Course
+ course_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Contest
show_contest_contest_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
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}"
return -1
end
- #如果是直接留言并且留言对象是Project并且Project类型是课程
- 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
+ # modify by nwb
+ #如果是直接留言并且留言对象是课程
+ 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
#课程的教师
@teachers = searchTeacherAndAssistant journals_for_message.jour
diff --git a/app/views/bids/_homework.html.erb b/app/views/bids/_homework.html.erb
index a013facbc..f3578e713 100644
--- a/app/views/bids/_homework.html.erb
+++ b/app/views/bids/_homework.html.erb
@@ -57,7 +57,7 @@
项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。
- 项目托管平台:http://forge.trustie.net/
+ 项目托管平台:<%= link_to Setting.protocol + "://" + Setting.host_name + "/", home_path %>
<%= link_to "我要创建项目",new_project_path(course: 0, project_type: 0), :target => '_blank'%>
|
diff --git a/app/views/courses/_course.html.erb b/app/views/courses/_course.html.erb
index 80cd7df9d..ef8f37566 100644
--- a/app/views/courses/_course.html.erb
+++ b/app/views/courses/_course.html.erb
@@ -17,9 +17,9 @@
<% @admin = @course.course_infos%>
<%if @admin&&@admin.first&&@admin.first.user&&@admin.first.user.user_extensions%>
- <%# unless @course.course_extra.school.nil? %>
- <%= @course.teacher.user_extensions.school.try(:name) %>
- <%# end %>
+ <% unless @course.teacher.user_extensions.school.nil? %>
+ <%= link_to @course.teacher.user_extensions.school.try(:name), school_course_list_path(@course.teacher.user_extensions.school) %>
+ <% end %>
<% end %>
diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb
index c29903d78..ecc4306f7 100644
--- a/app/views/courses/index.html.erb
+++ b/app/views/courses/index.html.erb
@@ -24,7 +24,7 @@
- <%= link_to request.host()+"/course", :controller => 'courses', :action => 'index', :course_type => 1 %> |
+ <%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index', :course_type => 1 %> |
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index', :course_type => 1 %> |
diff --git a/app/views/courses/search.html.erb b/app/views/courses/search.html.erb
index 96f8c227d..25b45e0db 100644
--- a/app/views/courses/search.html.erb
+++ b/app/views/courses/search.html.erb
@@ -22,7 +22,7 @@
- <%= link_to "forge.trustie.net/courses", :controller => 'courses', :action => 'index'%> |
+ <%= link_to request.host() + "/courses", :controller => 'courses', :action => 'index'%> |
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> |
diff --git a/app/views/git_usage/ch_usage.html.erb b/app/views/git_usage/ch_usage.html.erb
index 5fca6b156..330ab9b5e 100644
--- a/app/views/git_usage/ch_usage.html.erb
+++ b/app/views/git_usage/ch_usage.html.erb
@@ -143,7 +143,7 @@ body table tr td span6 {
在桌面上点击鼠标右键,选择TortoiseGit的Settings进行设置 |
- Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到, 其中的name和email要和forge.trustie.net上的登陆名和邮箱保持一致
+ | Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到, 其中的name和email要和<%= Setting.host_name %>上的登陆名和邮箱保持一致
,方便代码贡献统计 )。 |
@@ -313,7 +313,7 @@ body table tr td span6 {
$git config --global user.name “your_name”
$git config --global user.email “your_email”
Name和Email是用来设置自己的用户名和联系方式的(user.name和user.email必须填写,这些将在版本库提交时用到,
- 其中的name和email要和forge.trustie.net上的登陆名和密码保持一致
+ 其中的name和email要和<%= Setting.host_name %>上的登陆名和密码保持一致
,方便代码贡献统计 )。 |
diff --git a/app/views/git_usage/en_usage.html.erb b/app/views/git_usage/en_usage.html.erb
index ce202c792..237895d23 100644
--- a/app/views/git_usage/en_usage.html.erb
+++ b/app/views/git_usage/en_usage.html.erb
@@ -143,7 +143,7 @@ body table tr td span6 {
Right-click on the desktop and select the "Settings" in the "TortoiseGit"
- 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, the name and email must be the same with login name and email you registed in the forge.trustie.net
+ 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, the name and email must be the same with login name and email you registed in the <%= Setting.host_name %>
).
Then you can customize the "Context Menu":
Please check the "Clone","Sync" and "Commit" options in the "Context Menu",
@@ -306,7 +306,7 @@ body table tr td span6 {
| $git config --global user.name “your_name”M
$git config --global user.email “your_email”
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,
- the name and email must be the same with login name and email you registed in the forge.trustie.net
+ the name and email must be the same with login name and email you registed in the <%= Setting.host_name %>
). |
diff --git a/app/views/layouts/_base_footer.html.erb b/app/views/layouts/_base_footer.html.erb
index ec7516689..2fc383440 100644
--- a/app/views/layouts/_base_footer.html.erb
+++ b/app/views/layouts/_base_footer.html.erb
@@ -12,7 +12,7 @@
<%=l(:label_copyright)%>@2007~2014
-
+
diff --git a/app/views/layouts/_bootstrap_base_footer.html.erb b/app/views/layouts/_bootstrap_base_footer.html.erb
index 2bda28bdd..a2fdd6208 100644
--- a/app/views/layouts/_bootstrap_base_footer.html.erb
+++ b/app/views/layouts/_bootstrap_base_footer.html.erb
@@ -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=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/"%>
diff --git a/app/views/mailer/journals_for_message_add.html.erb b/app/views/mailer/journals_for_message_add.html.erb
index 43c5b9ae8..1aa8e45f8 100644
--- a/app/views/mailer/journals_for_message_add.html.erb
+++ b/app/views/mailer/journals_for_message_add.html.erb
@@ -1,5 +1,5 @@
尊敬的用户,<%= @user %>给你留言了:
<%= @message %>
点击链接查看最新回复<%= link_to(@url, @url) %>
-
<%= link_to(l(:lable_not_receive_mail),"http://forge.trustie.net/my/account")%>
+
<%= link_to(l(:lable_not_receive_mail),"http://" + Setting.host_name + "/my/account")%>
diff --git a/app/views/projects/search.html.erb b/app/views/projects/search.html.erb
index b1bd3d41e..36117e0bb 100644
--- a/app/views/projects/search.html.erb
+++ b/app/views/projects/search.html.erb
@@ -24,7 +24,7 @@
- <%= link_to "forge.trustie.net/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> |
+ <%= link_to request.host() + "/projects", :controller => 'projects', :action => 'course', :project_type => 1 %> |
<%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_course_practice), :controller => 'projects', :action => 'course', :project_type => 1 %> |
diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb
index b4f767a5c..04fb4eb7c 100644
--- a/app/views/projects/show.html.erb
+++ b/app/views/projects/show.html.erb
@@ -1,91 +1,77 @@
<% if @events_by_day.size >0 %>
-
-
-
- <%= l(:label_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
-
-
- <% @events_by_day.keys.sort.reverse.each do |day| %>
-
- <% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
-
-
-
- <%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%> |
-
-
-
-
- <%= h(e.project) if @project.nil? || @project.id != e.project.id %>
-
- <% 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_date_from_to, :start => format_date(@date_to - @days), :end => format_date(@date_to-1)) %>
+
- <%= l(:label_new_activity) %>
-
- <%= 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 %>
- |
-
-
-
-
- <%= h(truncate(strip_tags(e.event_description).gsub(/ /,' '), length: 30, omission:'...')) %>
- |
-
-
- <%= l :label_activity_time %>: <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %> |
- <% if e.event_type == "issue" %>
- <%= link_to l(:label_find_all_comments), issue_path(e) %> <%= l(:label_comments_count, :count => e.journals.count)%> |
- <% end %>
-
- |
-
-
-
-
- <% end %>
-
+ <% @events_by_day.keys.sort.reverse.each do |day| %>
+ <% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
+
+
+ <%= image_tag(url_to_avatar(e.event_author), :class => "avatar")%>
+
+
+ <%= h(e.project) if @project.nil? || @project.id != e.project.id %>
+
+ <% 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 %>
- <% end -%>
-
+ <%= l(:label_new_activity) %>
+
+ <%= 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 %>
-
-
- <%end%>
+
+ <%= h(truncate(strip_tags(e.event_description).gsub(/ /,' '), length: 30, omission:'...')) %>
+
+
+
<%= l :label_activity_time %>: <%= format_activity_day(day) %> <%= format_time(e.event_datetime, false) %>
+ <% if e.event_type == "issue" %>
+
+ <%= link_to l(:label_find_all_comments), issue_path(e) %> <%= l(:label_comments_count, :count => e.journals.count)%>
+
+ <% end %>
+
+
+
-
-
-
- <%= image_tag(url_to_avatar(@user), :class => "avatar") %> |
-
-
-
-
- <%
- #判断是否显示真名
- 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 %>
- <% end %>
- <%= l(:label_user_create_project) %> <%= link_to @project.name %> ! |
-
-
- <%= l :label_update_time %>: <%= format_time(@project.created_on) %>
- | |
-
-
+ <% end %>
+ <% end -%>
+ <% if(@events_pages.page == @events_pages.last_page) %>
+
+
+ <%= image_tag(url_to_avatar(@user), :class => "avatar") %>
+
+
+
+ <% 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 %>
+ <% end %>
+ <%#= l(:label_new_activity) %>
+
+ <%= l(:label_user_create_project) %> <%= link_to @project.name %>
!
+
+
+
+ <%= l :label_activity_time %>: <%= format_time(@project.created_on) %>
+
+
+
+ <% end %>
+<%end%>
+
diff --git a/app/views/welcome/_link_to_another.html.erb b/app/views/welcome/_link_to_another.html.erb
index bda48e753..14640897c 100644
--- a/app/views/welcome/_link_to_another.html.erb
+++ b/app/views/welcome/_link_to_another.html.erb
@@ -1,6 +1,6 @@
\ No newline at end of file
diff --git a/app/views/welcome/course.html.erb b/app/views/welcome/course.html.erb
index e79cc12cf..624bd01d6 100644
--- a/app/views/welcome/course.html.erb
+++ b/app/views/welcome/course.html.erb
@@ -73,7 +73,7 @@
新开课程
<% if @school_id %>
- <% school_course = find_miracle_course(10, 7, @school_id) %>
+ <% school_course = find_miracle_course(10,7, @school_id) %>
<% else %>
<%school_course=[]%>
<% end %>
@@ -138,6 +138,7 @@