commit
38c3422b83
@ -0,0 +1,152 @@
|
|||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
class AtController < ApplicationController
|
||||||
|
respond_to :json
|
||||||
|
|
||||||
|
def show
|
||||||
|
@logger = Logger.new(Rails.root.join('log', 'at.log').to_s)
|
||||||
|
users = find_at_users(params[:type], params[:id])
|
||||||
|
@users = users
|
||||||
|
@users = users.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id } if users
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
def find_at_users(type, id)
|
||||||
|
@logger.info("#{type}, #{id}")
|
||||||
|
case type
|
||||||
|
when "Issue"
|
||||||
|
find_issue(id)
|
||||||
|
when 'Project'
|
||||||
|
find_project(id)
|
||||||
|
when 'Course'
|
||||||
|
find_course(id)
|
||||||
|
when 'Activity', 'CourseActivity', 'ForgeActivity','UserActivity', 'OrgActivity','PrincipalActivity'
|
||||||
|
find_activity(id, type)
|
||||||
|
when 'Attachment'
|
||||||
|
find_attachment(id)
|
||||||
|
when 'Message'
|
||||||
|
find_message(id)
|
||||||
|
when 'HomeworkCommon'
|
||||||
|
find_homework(id)
|
||||||
|
when 'Topic'
|
||||||
|
find_topic(id)
|
||||||
|
else
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_topic(id)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_issue(id)
|
||||||
|
#1. issues list persons
|
||||||
|
#2. project persons
|
||||||
|
issue = Issue.find(id)
|
||||||
|
journals = issue.journals
|
||||||
|
at_persons = journals.map(&:user) + issue.project.users
|
||||||
|
at_persons.uniq { |u| u.id }.delete_if { |u| u.id == User.current.id }
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_project(id)
|
||||||
|
at_persons = Project.find(id).users
|
||||||
|
at_persons.delete_if { |u| u.id == User.current.id }
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_course(id)
|
||||||
|
at_persons = Course.find(id).users
|
||||||
|
at_persons.delete_if { |u| u.id == User.current.id }
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_activity(id, type)
|
||||||
|
|
||||||
|
## 基本上是本类型中的 加上所属类型的用户
|
||||||
|
case type
|
||||||
|
when 'Activity'
|
||||||
|
activity = Activity.find(id)
|
||||||
|
(find_at_users(activity.act_type, activity.act_id) ||[]) +
|
||||||
|
(find_at_users(activity.activity_container_type, activity.activity_container_id) || [])
|
||||||
|
when 'CourseActivity'
|
||||||
|
activity = CourseActivity.find(id)
|
||||||
|
(find_at_users(activity.course_act_type, activity.course_act_id) || []) + (find_course(activity.course.id) || [])
|
||||||
|
when 'ForgeActivity'
|
||||||
|
activity = ForgeActivity.find(id)
|
||||||
|
(find_at_users(activity.forge_act_type, activity.forge_act_id) ||[]) +
|
||||||
|
(find_project(activity.project_id) || [])
|
||||||
|
when 'UserActivity'
|
||||||
|
activity = UserActivity.find(id)
|
||||||
|
(find_at_users(activity.act_type, activity.act_id) || []) +
|
||||||
|
(find_at_users(activity.container_type, activity.container_id) || [])
|
||||||
|
when 'OrgActivity'
|
||||||
|
activity = OrgActivity.find(id)
|
||||||
|
(find_at_users(activity.org_act_type, activity.org_act_id) || []) +
|
||||||
|
(find_at_users(activity.container_type, activity.container_id) || [])
|
||||||
|
when 'PrincipalActivity'
|
||||||
|
activity = PrincipalActivity.find(id)
|
||||||
|
find_at_users(activity.principal_act_type, activity.principal_act_id)
|
||||||
|
else
|
||||||
|
nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
#作业应该是关联课程,取课程的用户列表
|
||||||
|
def find_homework(id)
|
||||||
|
homework = HomeworkCommon.find(id)
|
||||||
|
find_course(homework.course_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_attachment(id)
|
||||||
|
attachment = Attachment.find(id)
|
||||||
|
find_at_users(attachment.container_type, attachment.container_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
#Message
|
||||||
|
def find_message(id)
|
||||||
|
message = Message.find(id)
|
||||||
|
at_persons = message.board.messages.map(&:author)
|
||||||
|
(at_persons || []) + (find_project(message.board.project_id)||[])
|
||||||
|
end
|
||||||
|
|
||||||
|
#News
|
||||||
|
def find_news(id)
|
||||||
|
find_project(News.find(id).project_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
#JournalsForMessage
|
||||||
|
def find_journals_for_message(id)
|
||||||
|
jounrnal = JournalsForMessage.find(id)
|
||||||
|
find_at_users(jounrnal.jour_type, jounrnal.jour_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
#Poll
|
||||||
|
def find_poll(id)
|
||||||
|
end
|
||||||
|
|
||||||
|
#Journal
|
||||||
|
def find_journal(id)
|
||||||
|
journal = Journal.find(id)
|
||||||
|
find_at_users(journal.journalized_type, journal.journalized_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
#Document
|
||||||
|
def find_document(id)
|
||||||
|
find_project(Document.find(id).project_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
#ProjectCreateInfo
|
||||||
|
def find_project_create_info(id)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
#Principal
|
||||||
|
def find_principal(id)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
#BlogComment
|
||||||
|
def find_blog_comment(id)
|
||||||
|
blog = BlogComment.find(id).blog
|
||||||
|
blog.users
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,102 @@
|
|||||||
|
#coding=utf-8
|
||||||
|
|
||||||
|
class AtMessage < ActiveRecord::Base
|
||||||
|
belongs_to :user
|
||||||
|
belongs_to :sender, class_name: "User", foreign_key: "sender_id"
|
||||||
|
attr_accessible :at_message, :container, :viewed, :user_id, :sender_id
|
||||||
|
belongs_to :at_message, polymorphic: true
|
||||||
|
belongs_to :container, polymorphic: true
|
||||||
|
|
||||||
|
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
|
||||||
|
validates :user_id, :sender_id, :at_message_id, :at_message_type, presence: true
|
||||||
|
|
||||||
|
after_create :add_user_message
|
||||||
|
|
||||||
|
scope :unviewed, ->(type, id){
|
||||||
|
where(at_message_type: type, at_message_id:id, viewed: false)
|
||||||
|
}
|
||||||
|
|
||||||
|
def viewed!
|
||||||
|
update_attribute :viewed, true
|
||||||
|
end
|
||||||
|
|
||||||
|
def at_valid?
|
||||||
|
return true if at_message_type == 'Issue'
|
||||||
|
return true if 'Journal' == at_message_type
|
||||||
|
return true if 'JournalsForMessage' == at_message_type
|
||||||
|
return true if 'Message' == at_message_type
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_user_message
|
||||||
|
if MessageAll.where(message_type: self.class.name,message_id: self.id).empty?
|
||||||
|
self.message_alls << MessageAll.new(:user_id => self.user_id)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def subject
|
||||||
|
case at_message_type
|
||||||
|
when "Issue"
|
||||||
|
"新建问题: " + at_message.subject
|
||||||
|
when "Journal"
|
||||||
|
"问题留言: " + at_message.journalized.subject
|
||||||
|
when 'Message'
|
||||||
|
if(at_message.topic?)
|
||||||
|
"发布新帖: "
|
||||||
|
else
|
||||||
|
"回复帖子: "
|
||||||
|
end + at_message.subject
|
||||||
|
when 'JournalsForMessage'
|
||||||
|
"作业留言: " + at_message.jour.description
|
||||||
|
else
|
||||||
|
logger.error "error type: #{at_message_type}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def description
|
||||||
|
case at_message_type
|
||||||
|
when "Issue"
|
||||||
|
at_message.description
|
||||||
|
when "Journal"
|
||||||
|
at_message.notes
|
||||||
|
when 'Message'
|
||||||
|
at_message.content
|
||||||
|
when "JournalsForMessage"
|
||||||
|
at_message.notes
|
||||||
|
else
|
||||||
|
logger.error "error type: #{at_message_type}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def author
|
||||||
|
case at_message_type
|
||||||
|
when "Issue"
|
||||||
|
at_message.author
|
||||||
|
when "Journal"
|
||||||
|
at_message.user
|
||||||
|
when 'Message'
|
||||||
|
at_message.author
|
||||||
|
when 'JournalsForMessage'
|
||||||
|
at_message.user
|
||||||
|
else
|
||||||
|
logger.error "error type: #{at_message_type}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def url
|
||||||
|
case at_message_type
|
||||||
|
when "Issue"
|
||||||
|
{controller: :issues, action: :show, id: at_message}
|
||||||
|
when "Journal"
|
||||||
|
{controller: :issues, action: :show, id: at_message.journalized}
|
||||||
|
when 'Message'
|
||||||
|
{controller: :boards, action: :show, project_id: at_message.board.project, id: at_message.board}
|
||||||
|
when 'JournalsForMessage'
|
||||||
|
{controller: :homework_common, action: :index, course: at_message.jour.course_id}
|
||||||
|
else
|
||||||
|
logger.error "error type: #{at_message_type}"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
@ -0,0 +1,6 @@
|
|||||||
|
[
|
||||||
|
<% @users && @users.each_with_index do |person,index| %>
|
||||||
|
{"id":<%=index%>, "userid": <%=person.id%>, "name": "<%=person.show_name%>", "login": "<%=person.login%>", "searchKey": "<%=person.get_at_show_name%>"}
|
||||||
|
<%= index != @users.size-1 ? ',' : '' %>
|
||||||
|
<% end %>
|
||||||
|
]
|
@ -1,7 +1,7 @@
|
|||||||
<% if @in_user_center%>
|
<% if @in_user_center%>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||||
<% else%>
|
<% else%>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'blogs/article', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||||
<% end %>
|
<% end %>
|
@ -1,10 +1,10 @@
|
|||||||
alert('关闭成功');
|
alert('关闭成功');
|
||||||
<% if @user_activity_id == -1 %>
|
<% if @user_activity_id == -1 %>
|
||||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
|
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
|
||||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
|
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", 'UserActivity');
|
||||||
<% end %>
|
<% end %>
|
||||||
/*
|
/*
|
||||||
$("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/
|
$("#<%#= @homework.id %>_stop_anonymous_comment").replaceWith('');*/
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
|
||||||
|
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
@ -1,2 +1,2 @@
|
|||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/user_blog', :locals => {:activity => @article,:user_activity_id =>@user_activity_id}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
|
|
||||||
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
$("#organization_document_<%= @act.id %>").replaceWith("<%= escape_javascript(render :partial => 'organizations/show_org_document', :locals => {:document => @document,:flag => params[:flag], :act => @act}) %>");
|
||||||
init_activity_KindEditor_data(<%= @act.id %>,"","87%");
|
init_activity_KindEditor_data(<%= @act.id %>,"","87%", "<%=@act.class.to_s%>");
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<% if @user_activity_id == -1 %>
|
<% if @user_activity_id == -1 %>
|
||||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
|
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => "users/user_homework_detail",:locals => {:homework_common => @homework, :is_in_course => @is_in_course})%>");
|
||||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
|
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@course_activity}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||||
<% end %>
|
<% end %>
|
@ -1,8 +1,8 @@
|
|||||||
clickCanel();
|
clickCanel();
|
||||||
<% if @user_activity_id %>
|
<% if @user_activity_id %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:course_activity=>@courae_activity}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||||
<% else %>
|
<% else %>
|
||||||
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
|
$("#homework_common_<%= @homework.id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework,:is_in_course => @is_in_course}) %>");
|
||||||
init_activity_KindEditor_data(<%= @homework.id%>,"","87%");
|
init_activity_KindEditor_data(<%= @homework.id%>,"","87%", "<%=@homework.class.to_s%>");
|
||||||
<% end %>
|
<% end %>
|
@ -0,0 +1,21 @@
|
|||||||
|
<% if AtMessage === ma && ma.at_valid? %>
|
||||||
|
<ul class="homepageNewsList fl">
|
||||||
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"),user_path(ma.author) %></a></li>
|
||||||
|
<li class="homepageNewsPubType fl">
|
||||||
|
<span class="newsBlue homepageNewsPublisher"><%= ma.author.login %></span><span class="homepageNewsType fl">提到了你:</span>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsContent fl">
|
||||||
|
<%= link_to ma.subject.html_safe, ma.url,
|
||||||
|
:class =>"#{ma.viewed? ? "newsGrey" : "newsBlack"}",
|
||||||
|
:onmouseover =>"message_titile_show($(this),event)",
|
||||||
|
:onmouseout => "message_titile_hide($(this))" %></li>
|
||||||
|
<div style="display: none" class="message_title_red system_message_style">
|
||||||
|
<p><strong>标题:</strong><%= ma.subject %></p>
|
||||||
|
<% unless ma.description.nil? %>
|
||||||
|
<div class="fl"><strong>内容:</strong></div>
|
||||||
|
<div class="ml36"><%= ma.description.html_safe %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
@ -1,7 +1,7 @@
|
|||||||
<% if @user_activity_id %>
|
<% if @user_activity_id %>
|
||||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>");
|
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id,:course_activity => @course_activity}) %>");
|
||||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%", "UserActivity");
|
||||||
<% elsif @homework_common_id && @is_in_course %>
|
<% elsif @homework_common_id && @is_in_course %>
|
||||||
$("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>");
|
$("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>");
|
||||||
init_activity_KindEditor_data(<%= @homework_common_id%>,"","87%");
|
init_activity_KindEditor_data(<%= @homework_common_id%>,"","87%", "HomeworkCommon");
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -1,235 +0,0 @@
|
|||||||
# = Redmine configuration file
|
|
||||||
#
|
|
||||||
# Each environment has it's own configuration options. If you are only
|
|
||||||
# running in production, only the production block needs to be configured.
|
|
||||||
# Environment specific configuration options override the default ones.
|
|
||||||
#
|
|
||||||
# Note that this file needs to be a valid YAML file.
|
|
||||||
# DO NOT USE TABS! Use 2 spaces instead of tabs for identation.
|
|
||||||
#
|
|
||||||
# == Outgoing email settings (email_delivery setting)
|
|
||||||
#
|
|
||||||
# === Common configurations
|
|
||||||
#
|
|
||||||
# ==== Sendmail command
|
|
||||||
#
|
|
||||||
# production:
|
|
||||||
# email_delivery:
|
|
||||||
# delivery_method: :sendmail
|
|
||||||
#
|
|
||||||
# ==== Simple SMTP server at localhost
|
|
||||||
#
|
|
||||||
# production:
|
|
||||||
# email_delivery:
|
|
||||||
# delivery_method: :smtp
|
|
||||||
# smtp_settings:
|
|
||||||
# address: smtp.163.com
|
|
||||||
# port: 25
|
|
||||||
#
|
|
||||||
# ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
|
|
||||||
#
|
|
||||||
# production:
|
|
||||||
# email_delivery:
|
|
||||||
# delivery_method: :smtp
|
|
||||||
# smtp_settings:
|
|
||||||
# address: smtp.gmail.com
|
|
||||||
# port: 587
|
|
||||||
# authentication: :login
|
|
||||||
# domain: 'foo.com'
|
|
||||||
# user_name: senluowanxiangt@gmail.com
|
|
||||||
# password: 1913TXBja
|
|
||||||
#
|
|
||||||
# ==== SMTP server at example.com using PLAIN authentication
|
|
||||||
#
|
|
||||||
# production:
|
|
||||||
# email_delivery:
|
|
||||||
# delivery_method: :smtp
|
|
||||||
# smtp_settings:
|
|
||||||
# address: smtp.gmail.com
|
|
||||||
# port: 587
|
|
||||||
# authentication: :plain
|
|
||||||
# domain: 'example.com'
|
|
||||||
# user_name: senluowanxiangt@gmail.com
|
|
||||||
# password: 1913TXBja
|
|
||||||
#
|
|
||||||
# ==== SMTP server at using TLS (GMail)
|
|
||||||
#
|
|
||||||
# This might require some additional configuration. See the guides at:
|
|
||||||
# http://www.redmine.org/projects/redmine/wiki/EmailConfiguration
|
|
||||||
#
|
|
||||||
# production:
|
|
||||||
# email_delivery:
|
|
||||||
# delivery_method: :smtp
|
|
||||||
# smtp_settings:
|
|
||||||
# enable_starttls_auto: true
|
|
||||||
# address: smtp.gmail.com
|
|
||||||
# port: 587
|
|
||||||
# domain: "smtp.gmail.com" # 'your.domain.com' for GoogleApps
|
|
||||||
# authentication: :plain
|
|
||||||
# user_name: senluowanxiangt@gmail.com
|
|
||||||
# password: 1913TXBja
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# === More configuration options
|
|
||||||
#
|
|
||||||
# See the "Configuration options" at the following website for a list of the
|
|
||||||
# full options allowed:
|
|
||||||
#
|
|
||||||
# http://wiki.rubyonrails.org/rails/pages/HowToSendEmailsWithActionMailer
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
default:
|
|
||||||
email_delivery:
|
|
||||||
delivery_method: :smtp
|
|
||||||
smtp_settings:
|
|
||||||
address: mail.trustie.net
|
|
||||||
port: 25
|
|
||||||
domain: mail.trustie.net
|
|
||||||
authentication: :login
|
|
||||||
user_name: "mail@trustie.net"
|
|
||||||
password: "loong2010"
|
|
||||||
|
|
||||||
# Absolute path to the directory where attachments are stored.
|
|
||||||
# The default is the 'files' directory in your Redmine instance.
|
|
||||||
# Your Redmine instance needs to have write permission on this
|
|
||||||
# directory.
|
|
||||||
# Examples:
|
|
||||||
# attachments_storage_path: /var/redmine/files
|
|
||||||
# attachments_storage_path: D:/redmine/files
|
|
||||||
attachments_storage_path:
|
|
||||||
|
|
||||||
# Configuration of the autologin cookie.
|
|
||||||
# autologin_cookie_name: the name of the cookie (default: autologin)
|
|
||||||
# autologin_cookie_path: the cookie path (default: /)
|
|
||||||
# autologin_cookie_secure: true sets the cookie secure flag (default: false)
|
|
||||||
autologin_cookie_name: "autologin_trustie"
|
|
||||||
autologin_cookie_path:
|
|
||||||
autologin_cookie_secure:
|
|
||||||
|
|
||||||
# Configuration of SCM executable command.
|
|
||||||
#
|
|
||||||
# Absolute path (e.g. /usr/local/bin/hg) or command name (e.g. hg.exe, bzr.exe)
|
|
||||||
# On Windows + CRuby, *.cmd, *.bat (e.g. hg.cmd, bzr.bat) does not work.
|
|
||||||
#
|
|
||||||
# On Windows + JRuby 1.6.2, path which contains spaces does not work.
|
|
||||||
# For example, "C:\Program Files\TortoiseHg\hg.exe".
|
|
||||||
# If you want to this feature, you need to install to the path which does not contains spaces.
|
|
||||||
# For example, "C:\TortoiseHg\hg.exe".
|
|
||||||
#
|
|
||||||
# Examples:
|
|
||||||
# scm_subversion_command: svn # (default: svn)
|
|
||||||
# scm_mercurial_command: C:\Program Files\TortoiseHg\hg.exe # (default: hg)
|
|
||||||
# scm_git_command: /usr/local/bin/git # (default: git)
|
|
||||||
# scm_cvs_command: cvs # (default: cvs)
|
|
||||||
# scm_bazaar_command: bzr.exe # (default: bzr)
|
|
||||||
# scm_darcs_command: darcs-1.0.9-i386-linux # (default: darcs)
|
|
||||||
#
|
|
||||||
scm_subversion_command:
|
|
||||||
scm_mercurial_command:
|
|
||||||
scm_git_command:
|
|
||||||
scm_cvs_command:
|
|
||||||
scm_bazaar_command:
|
|
||||||
scm_darcs_command:
|
|
||||||
|
|
||||||
# Absolute path to the SCM commands errors (stderr) log file.
|
|
||||||
# The default is to log in the 'log' directory of your Redmine instance.
|
|
||||||
# Example:
|
|
||||||
# scm_stderr_log_file: /var/log/redmine_scm_stderr.log
|
|
||||||
scm_stderr_log_file:
|
|
||||||
|
|
||||||
# Key used to encrypt sensitive data in the database (SCM and LDAP passwords).
|
|
||||||
# If you don't want to enable data encryption, just leave it blank.
|
|
||||||
# WARNING: losing/changing this key will make encrypted data unreadable.
|
|
||||||
#
|
|
||||||
# If you want to encrypt existing passwords in your database:
|
|
||||||
# * set the cipher key here in your configuration file
|
|
||||||
# * encrypt data using 'rake db:encrypt RAILS_ENV=production'
|
|
||||||
#
|
|
||||||
# If you have encrypted data and want to change this key, you have to:
|
|
||||||
# * decrypt data using 'rake db:decrypt RAILS_ENV=production' first
|
|
||||||
# * change the cipher key here in your configuration file
|
|
||||||
# * encrypt data using 'rake db:encrypt RAILS_ENV=production'
|
|
||||||
database_cipher_key:
|
|
||||||
|
|
||||||
# Set this to false to disable plugins' assets mirroring on startup.
|
|
||||||
# You can use `rake redmine:plugins:assets` to manually mirror assets
|
|
||||||
# to public/plugin_assets when you install/upgrade a Redmine plugin.
|
|
||||||
#
|
|
||||||
#mirror_plugins_assets_on_startup: false
|
|
||||||
|
|
||||||
# Your secret key for verifying cookie session data integrity. If you
|
|
||||||
# change this key, all old sessions will become invalid! Make sure the
|
|
||||||
# secret is at least 30 characters and all random, no regular words or
|
|
||||||
# you'll be exposed to dictionary attacks.
|
|
||||||
#
|
|
||||||
# If you have a load-balancing Redmine cluster, you have to use the
|
|
||||||
# same secret token on each machine.
|
|
||||||
#secret_token: 'change it to a long random string'
|
|
||||||
|
|
||||||
# Absolute path (e.g. /usr/bin/convert, c:/im/convert.exe) to
|
|
||||||
# the ImageMagick's `convert` binary. Used to generate attachment thumbnails.
|
|
||||||
imagemagick_convert_command: '/home/pdl/redmine-2.3.2-0/common/bin/convert'
|
|
||||||
|
|
||||||
# Configuration of RMagcik font.
|
|
||||||
#
|
|
||||||
# Redmine uses RMagcik in order to export gantt png.
|
|
||||||
# You don't need this setting if you don't install RMagcik.
|
|
||||||
#
|
|
||||||
# In CJK (Chinese, Japanese and Korean),
|
|
||||||
# in order to show CJK characters correctly,
|
|
||||||
# you need to set this configuration.
|
|
||||||
#
|
|
||||||
# Because there is no standard font across platforms in CJK,
|
|
||||||
# you need to set a font installed in your server.
|
|
||||||
#
|
|
||||||
# This setting is not necessary in non CJK.
|
|
||||||
#
|
|
||||||
# Examples for Japanese:
|
|
||||||
# Windows:
|
|
||||||
# rmagick_font_path: C:\windows\fonts\msgothic.ttc
|
|
||||||
# Linux:
|
|
||||||
# rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
|
|
||||||
#
|
|
||||||
rmagick_font_path:
|
|
||||||
|
|
||||||
# Maximum number of simultaneous AJAX uploads
|
|
||||||
#max_concurrent_ajax_uploads: 2
|
|
||||||
#pic_types: "bmp,jpeg,jpg,png,gif"
|
|
||||||
|
|
||||||
repository_root_path: '/tmp/htdocs'
|
|
||||||
judge_server: 'http://judge.trustie.net/'
|
|
||||||
|
|
||||||
# Git's url
|
|
||||||
gitlab_address: 'http://gitfast.trustie.net'
|
|
||||||
|
|
||||||
# specific configuration options for production environment
|
|
||||||
# that overrides the default ones
|
|
||||||
production:
|
|
||||||
# CJK support
|
|
||||||
rmagick_font_path: /usr/share/fonts/ipa-mincho/ipam.ttf
|
|
||||||
judge_server: 'http://192.168.80.21:8080/'
|
|
||||||
repository_root_path: '/home/pdl/redmine-2.3.2-0/apache2/htdocs'
|
|
||||||
cookie_domain: ".trustie.net"
|
|
||||||
email_delivery:
|
|
||||||
delivery_method: :smtp
|
|
||||||
smtp_settings:
|
|
||||||
address: mail.trustie.net
|
|
||||||
port: 25
|
|
||||||
domain: mail.trustie.net
|
|
||||||
authentication: :login
|
|
||||||
user_name: "mail@trustie.net"
|
|
||||||
password: "loong2010"
|
|
||||||
|
|
||||||
# specific configuration options for development environment
|
|
||||||
# that overrides the default ones
|
|
||||||
development:
|
|
||||||
email_delivery:
|
|
||||||
delivery_method: :smtp
|
|
||||||
smtp_settings:
|
|
||||||
address: mail.trustie.net
|
|
||||||
port: 25
|
|
||||||
domain: mail.trustie.net
|
|
||||||
authentication: :login
|
|
||||||
user_name: "mail@trustie.net"
|
|
||||||
password: "loong2010"
|
|
@ -1,9 +0,0 @@
|
|||||||
Gitlab.configure do |config|
|
|
||||||
# config.endpoint = 'http://192.168.41.130:3000/trustie/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
|
|
||||||
# config.private_token = 'cK15gUDwvt8EEkzwQ_63' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
|
|
||||||
config.endpoint = 'http://gitfast.trustie.net/api/v3' # API endpoint URL, default: ENV['GITLAB_API_ENDPOINT']
|
|
||||||
config.private_token = 'fPc_gBmEiSANve8TCfxW' # user's private token, default: ENV['GITLAB_API_PRIVATE_TOKEN']
|
|
||||||
# Optional
|
|
||||||
# config.user_agent = 'Custom User Agent' # user agent, default: 'Gitlab Ruby Gem [version]'
|
|
||||||
# config.sudo = 'user' # username for sudo mode, default: nil
|
|
||||||
end
|
|
@ -0,0 +1,13 @@
|
|||||||
|
class DeleteValidateCourseContributor < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
course_contributors = CourseContributorScore.where("course_id>? and created_at<? ", 450, "2015-12-15 19:51:48")
|
||||||
|
course_contributors.delete_all
|
||||||
|
c170 = CourseContributorScore.where("course_id =?", 170)
|
||||||
|
c170.delete_all
|
||||||
|
c436 = CourseContributorScore.where("course_id =?", 436)
|
||||||
|
c436.delete_all
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,9 @@
|
|||||||
|
class DeleteExerciseUser < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
eus=ExerciseUser.where("score is null and status=?",0)
|
||||||
|
eus.delete_all
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,15 @@
|
|||||||
|
class CreateAtMessages < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :at_messages do |t|
|
||||||
|
t.references :user
|
||||||
|
t.integer :at_message_id
|
||||||
|
t.string :at_message_type
|
||||||
|
t.boolean :viewed, :default => false
|
||||||
|
t.string :container_type
|
||||||
|
t.integer :container_id
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
add_index :at_messages, :user_id
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddSenderToAtMessage < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :at_messages, :sender_id, :integer
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,15 @@
|
|||||||
|
class DeleteValidProject < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
projects = Project.where("project_type =?", 1)
|
||||||
|
begin
|
||||||
|
projects.each do |p|
|
||||||
|
p.delete
|
||||||
|
end
|
||||||
|
rescue => e
|
||||||
|
logger.error "Delete project failed ====>#{e}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
end
|
||||||
|
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue