commit
6193dc8f0a
@ -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.name} 中留言"
|
||||||
|
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 %>
|
@ -0,0 +1,70 @@
|
|||||||
|
<%= content_for(:header_tags) do %>
|
||||||
|
<%= import_ke(enable_at: false, prettify: false) %>
|
||||||
|
<%= javascript_include_tag "init_activity_KindEditor" %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
/*回复框*/
|
||||||
|
.homepagePostReplyInputContainer .ke-toolbar {display: none; width: 400px; border: none; background: none; padding: 0px 0px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-toolbar-icon {line-height: 26px; font-size: 14px; padding-left: 26px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-toolbar-icon-url {background-image: url(/images/public_icon.png)}
|
||||||
|
.homepagePostReplyInputContainer .ke-outline {padding: 0px 0px; line-height: 26px; font-size: 14px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-icon-emoticons {background-position: 0px -671px; width: 50px; height: 26px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-icon-emoticons:hover {background-position: -79px -671px; width: 50px; height: 26px;}
|
||||||
|
.homepagePostReplyInputContainer .ke-outline {border: none;}
|
||||||
|
.homepagePostReplyInputContainer .ke-inline-block {display: none;}
|
||||||
|
.homepagePostReplyInputContainer .ke-container {float: left;}
|
||||||
|
</style>
|
||||||
|
<% if topics%>
|
||||||
|
<% topics.each do |topic| %>
|
||||||
|
<script>
|
||||||
|
function expand_reply(container, btnid) {
|
||||||
|
var target = $(container);
|
||||||
|
var btn = $(btnid);
|
||||||
|
if (btn.data('init') == '0') {
|
||||||
|
btn.data('init', 1);
|
||||||
|
btn.html('收起回复');
|
||||||
|
target.show();
|
||||||
|
} else {
|
||||||
|
btn.data('init', 0);
|
||||||
|
btn.html('展开更多');
|
||||||
|
target.hide();
|
||||||
|
target.eq(0).show();
|
||||||
|
target.eq(1).show();
|
||||||
|
target.eq(2).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function expand_reply_input(id) {
|
||||||
|
$(id).toggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
init_activity_KindEditor_data(<%= topic.id%>, null, "87%");
|
||||||
|
showNormalImage('activity_description_<%= topic.id %>');
|
||||||
|
/*var description_images=$("div#activity_description_<%#= topic.id %>").find("img");
|
||||||
|
if (description_images.length>0) {
|
||||||
|
for (var i=0; i<description_images.length; i++){
|
||||||
|
var image=$(description_images[i]);
|
||||||
|
var element=$("<a></a>").attr("href",image.attr('src'));
|
||||||
|
image.wrap(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$('#activity_description_<%#= topic.id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});*/
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<% if topic %>
|
||||||
|
<%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
<% if topics.count == 10 %>
|
||||||
|
<div id="show_more_course_topic" class="loadMore mt10 f_grey">展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %></div>
|
||||||
|
<% end %>
|
||||||
|
<% end%>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#show_more_course_topic").mouseover(function () {
|
||||||
|
$("#more_topic_link").click();
|
||||||
|
});
|
||||||
|
</script>
|
@ -1 +1 @@
|
|||||||
$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show',:locals => {:topics => @topics, :page => @page} )%>");
|
$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show_detail',:locals => {:topics => @topics, :page => @page} )%>");
|
@ -1 +1,8 @@
|
|||||||
clickCanel();
|
clickCanel();
|
||||||
|
<% if @user_activity_id != -1 %>
|
||||||
|
$("#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%", "UserActivity");
|
||||||
|
<% else %>
|
||||||
|
$("#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%", "<%=@homework.class.to_s%>");
|
||||||
|
<% end %>
|
@ -1,10 +1,12 @@
|
|||||||
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%");
|
$("#evaluation_end_time_<%=@homework.id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
|
||||||
|
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%");
|
$("#evaluation_end_time_<%=@user_activity_id %>").html("匿评关闭时间:<%=format_time(Time.now) %>");
|
||||||
|
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,6 +1,7 @@
|
|||||||
$("#homepageLeftMenuCourses").html("");
|
//$("#homepageLeftMenuCourses").html("");
|
||||||
$("#homepageLeftMenuCourses").append("<ul>");
|
//$("#homepageLeftMenuCourses").append("<ul>");
|
||||||
$("#homepageLeftMenuCourses").append("<%= escape_javascript(render :partial => 'layouts/org_courses',
|
//$("#homepageLeftMenuCourses").append("<%#= escape_javascript(render :partial => 'layouts/org_courses',
|
||||||
:locals=>{:courses=>@organization.courses.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
:locals=>{:courses=>@organization.courses.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
||||||
$("#homepageLeftMenuCourses").append("</ul>");
|
//$("#homepageLeftMenuCourses").append("</ul>");
|
||||||
$("#homepageLeftMenuCourses").show();
|
//$("#homepageLeftMenuCourses").show();
|
||||||
|
location.reload();
|
@ -1,6 +1,7 @@
|
|||||||
$("#homepageLeftMenuProjects").html("");
|
//$("#homepageLeftMenuProjects").html("");
|
||||||
$("#homepageLeftMenuProjects").append("<ul>");
|
//$("#homepageLeftMenuProjects").append("<ul>");
|
||||||
$("#homepageLeftMenuProjects").append("<%= escape_javascript(render :partial => 'layouts/org_projects',
|
//$("#homepageLeftMenuProjects").append("<%#= escape_javascript(render :partial => 'layouts/org_projects',
|
||||||
:locals=>{:projects=>@organization.projects.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
:locals=>{:projects=>@organization.projects.reorder('created_at').uniq.limit(5),:org_id=>@organization.id,:page=> 1}) %>");
|
||||||
$("#homepageLeftMenuProjects").append("</ul>");
|
//$("#homepageLeftMenuProjects").append("</ul>");
|
||||||
$("#homepageLeftMenuProjects").show();
|
//$("#homepageLeftMenuProjects").show();
|
||||||
|
location.reload();
|
@ -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 != -1 %>
|
||||||
$("#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 %>
|
||||||
|
@ -0,0 +1,235 @@
|
|||||||
|
# = 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"
|
@ -0,0 +1,9 @@
|
|||||||
|
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,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
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue