Merge branch 'develop' into hjq_beidou

This commit is contained in:
huang 2016-06-12 13:49:58 +08:00
commit 1a1fde778f
74 changed files with 883 additions and 904 deletions

2
.gitignore vendored
View File

@ -6,6 +6,8 @@
/config/database.yml
/config/configuration.yml
/config/additional_environment.rb
/config/menu.yml
/config/wechat.yml
/files/*
/log/*

View File

@ -41,7 +41,7 @@ class OrgDocumentCommentsController < ApplicationController
@org_subfield = OrgSubfield.where(:id => @document.org_subfield_id).first
@subfield_content = @organization.org_subfields.order("priority")
respond_to do |format|
format.html {render :layout => @organization.switch_type ? 'base_org_custom' : 'base_org'}
format.html {render :layout => (@organization.switch_type && @document && !@document.org_subfield_id.blank?) ? 'base_org_custom' : 'base_org'}
end
end
@ -96,7 +96,12 @@ class OrgDocumentCommentsController < ApplicationController
def add_reply_in_doc
@document = OrgDocumentComment.find(params[:id]).root
@comment = OrgDocumentComment.new(:organization_id => @document.organization_id, :creator_id => User.current.id, :reply_id => params[:id])
@comment.content = params[:org_content]
if params[:org_comment].blank?
@comment.content = params[:org_content]
else
@comment.content = params[:org_comment][:org_content]
end
@document.children << @comment
@document.save
respond_to do |format|

View File

@ -29,7 +29,7 @@ class OrganizationsController < ApplicationController
helper :issues
include UsersHelper
include OrganizationsHelper
before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout, :teachers, :students, :projects, :courses]
before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout, :teachers, :students, :projects, :courses, :acts]
# before_filter :allow_as_admin, :only => [:students, :teachers, :projects, :courses, :acts]
layout 'base_org'
def index
@ -107,7 +107,7 @@ class OrganizationsController < ApplicationController
if @organization.org_subfields.where(:field_type => "Compact", :hide => 0).count > 0
@acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and
((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')})))
order by updated_at desc limit 6;")
order by created_at desc limit 6;")
end
render :layout => 'base_org_custom'
else
@ -265,6 +265,19 @@ class OrganizationsController < ApplicationController
end
def acts
@subfield_content = @organization.org_subfields.order("priority")
@org_subfield = OrgSubfield.where(:id => params[:org_subfield_id]).first
shield_project_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Project'").map(&:shield_id)
shield_course_ids = ShieldActivity.where("container_type='Organization' and container_id=#{@organization.id} and shield_type='Course'").map(&:shield_id)
project_ids = (@organization.projects.map(&:id) - shield_project_ids) << 0
course_ids = (@organization.courses.map(&:id) - shield_course_ids) << 0
@org_acts = UserActivity.find_by_sql("SELECT * FROM `user_activities` where act_type in ('HomeworkCommon', 'News', 'Message', 'Issue') and
((container_type = 'Course' and container_id in (#{course_ids.join(',')})) or (container_type = 'Project' and container_id in (#{project_ids.join(',')})))
order by created_at desc limit 6;")
respond_to do |format|
format.html{render :layout => 'base_org_custom'}
format.js
end
end
def searchmember_by_name members, name

View File

@ -100,7 +100,7 @@ class UsersController < ApplicationController
else
@user_activity_id = -1
end
@is_in_course = params[:is_in_course]
@is_in_course = params[:is_in_course].to_i
@course_activity = params[:course_activity].to_i
end
respond_to do |format|
@ -123,6 +123,20 @@ class UsersController < ApplicationController
end
#未读消息弹窗
def user_messages_unviewed
@message_alls = []
messages = MessageAll.where("user_id =?", User.current.id).includes(:message).order("created_at desc")
onclick_time = User.current.onclick_time.onclick_time
messages.each do |message_all|
# 未读的消息存放在数组
if (message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0) || (message_all.message_type == "SystemMessage"&& !message_all.message.nil? && message_all.message.created_at > onclick_time)
@message_alls << message_all.message
break if @message_alls.length == 5
end
end
end
# 用户消息
# 说明: homework 发布作业message讨论区 news新闻 poll问卷works_reviewers作品评阅works_reply:作品回复,exercise:课程测验
# issue问题journal缺陷状态更新 forum公共贴吧: user_feedback: 用户留言; new_reply:新闻回复comment
@ -3222,6 +3236,38 @@ class UsersController < ApplicationController
end
end
def all_journals
if params[:type].present?
case params[:type]
when 'OrgDocumentComment'
obj = OrgDocumentComment.where('id = ?', params[:id].to_i).first
@journals = obj.children.reorder("created_at desc")
when 'Message'
obj = Message.where('id = ?', params[:id].to_i).first
@journals = obj.children.reorder("created_on desc")
when 'News'
obj = News.where('id = ?', params[:id].to_i).first
@journals = obj.comments.reorder("created_on desc")
when 'JournalsForMessage'
obj = JournalsForMessage.where('id = ?', params[:id].to_i).first
@journals = obj.children.reorder("created_on desc")
when 'Issue'
obj = Issue.where('id = ?', params[:id].to_i).first
@journals = obj.journals.reorder("created_on desc")
when 'BlogComment'
obj = BlogComment.where('id = ?', params[:id].to_i).first
@journals = obj.children.reorder("created_on desc")
when 'HomeworkCommon'
obj = HomeworkCommon.where('id = ?', params[:id].to_i).first
@journals = obj.journals_for_messages.reorder("created_on desc")
@is_in_course = params[:is_in_course].to_i if params[:is_in_course]
@course_activity = params[:course_activity].to_i if params[:course_activity]
@is_teacher = User.current.allowed_to?(:as_teacher,obj.course)
@user_activity_id = params[:user_activity_id].to_i if params[:user_activity_id]
end
end
end
private
def find_user

View File

@ -6,7 +6,7 @@ class WechatsController < ActionController::Base
# default text responder when no other match
on :text do |request, content|
request.reply.text "您的意见已收到" # Just echo
request.reply.text "您的意见已收到,感谢您的反馈!" # Just echo
end
# When receive 'help', will trigger this responder
@ -121,7 +121,7 @@ class WechatsController < ActionController::Base
on :fallback, respond: 'fallback message'
on :click, with: 'FEEDBACK' do |request, key|
request.reply.text "如有反馈问题,请直接切入至输入框,发微信给我们即可"
request.reply.text "如有反馈问题,请直接切换至输入框,发微信给我们即可"
end
on :click, with: 'MY_NEWS' do |request, key|
@ -179,7 +179,7 @@ class WechatsController < ActionController::Base
raise "此微信号已绑定用户, 不能重复绑定" if user_binded?(openid)
user, last_login_on = User.try_to_login(params[:username], params[:password])
raise "用户名或密码错误,请重新登录" unless user
raise "用户名或密码错误,请重新输入" unless user
#补全用户信息
raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat

View File

@ -105,13 +105,26 @@ module OrganizationsHelper
def org_time_by_type obj
case obj.act_type
when "Message"
obj.act.updated_on
obj.act.created_on
when "News"
obj.act.created_on
when "HomeworkCommon"
obj.act.updated_at
obj.act.created_at
when "Issue"
obj.act.updated_on
obj.act.created_on
end
end
def org_reply_count_type obj
case obj.act_type
when "HomeworkCommon"
obj.act.journals_for_messages.count
when "Issue"
obj.act.journals.count
when "Message"
obj.act.children.count
when "News"
obj.act.comments_count
end
end
@ -124,6 +137,8 @@ module OrganizationsHelper
obj.org_act.parent_id.nil? ? obj.org_act.subject : obj.org_act.parent.subject
when "News"
obj.org_act.title
when "Issue"
obj.org_act.subject
end
end

View File

@ -76,6 +76,18 @@ class BlogComment < ActiveRecord::Base
def project
end
def creator_user
self.author
end
def created_time
self.created_at
end
def content_detail
self.content
end
#博客回复微信模板消息
# def blog_wechat_message
# ws = WechatService.new

View File

@ -104,4 +104,16 @@ class Comment < ActiveRecord::Base
end
end
def creator_user
self.author
end
def created_time
self.created_on
end
def content_detail
self.comments
end
end

View File

@ -137,6 +137,18 @@ class Journal < ActiveRecord::Base
end
##
def creator_user
self.user
end
def created_time
self.created_on
end
def content_detail
self.notes
end
private
def split_private_notes

View File

@ -329,4 +329,16 @@ class JournalsForMessage < ActiveRecord::Base
down_course_score_num(self.jour.course_id, self.user_id, "HomeworkCommon")
end
end
def creator_user
self.user
end
def created_time
self.created_on
end
def content_detail
self.notes
end
end

View File

@ -221,6 +221,18 @@ class Message < ActiveRecord::Base
update_org_activity(self.class, self.id)
end
def creator_user
self.author
end
def created_time
self.created_on
end
def content_detail
self.content
end
private
def add_author_as_watcher

View File

@ -35,4 +35,15 @@ class OrgDocumentComment < ActiveRecord::Base
end
def creator_user
self.creator
end
def created_time
self.created_at
end
def content_detail
self.content
end
end

View File

@ -52,23 +52,6 @@
</style>
<% course_activities.includes(:course_act).each do |activity| if course_activities %>
<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 () {
sd_create_editor_from_data(<%= activity.id%>, null, "100%", "<%= activity.class.to_s %>");
});

View File

@ -1,22 +1,5 @@
<% issue_list(issues) do |issue, level| -%>
<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 () {
sd_create_editor_from_data(<%= issue.id%>, null, "100%", "<%= issue.class.name %>");
});

View File

@ -4,7 +4,7 @@
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="https://forge.trustie.net/projects/2/feedback" class="f_grey mw20" target="_blank"><%= l(:label_contact_us)%></a>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_recruitment_information)%></a>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "https://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey mw20" target="_blank"><%= l(:label_forums)%></a>|</li>
<li class="fl"><a href="javascript:void:(0);" class="f_grey ml20" target="_blank"><%= l(:label_language)%></a>
<select class="languageBox">

View File

@ -4,7 +4,7 @@
<li class="fl"><a href="<%= about_us_path %>" class="f_grey mw20" target="_blank"><%= l(:label_about_us)%></a>|</li>
<li class="fl"><a href="<%= agreement_path %>" class="f_grey mw20" target="_blank">服务协议</a>|</li>
<li class="fl" style="display: none"><span class="f_grey mw20" title="暂未开放"><%= l(:label_recruitment_information)%></span>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "https://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<li class="fl"><%= link_to l(:label_surpport_group), "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "f_grey mw20", :target=>"_blank" %>|</li>
<li class="fl"><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="f_grey mw20" target="_blank" ><%= l(:label_forums)%></a></li>
</ul>

View File

@ -78,12 +78,15 @@
</ul>
</div>
<div class="navHomepageNews">
<div class="navHomepageNews" id="user_messages">
<%= link_to "", user_message_path(User.current), :class => "homepageNewsIcon", :target =>"_Blank", :title => "您的所有消息" %>
<% if User.current.count_new_message.to_i >0 %>
<div ><%= link_to User.current.count_new_message , user_message_path(User.current), :class => "newsActive", :target =>"_Blank" %></div>
<% end %>
<%#= link_to User.current.count_new_message, user_message_path(User.current), :class => "homepageNewsIcon" %>
<!--<div class="shadowbox_news undis" id="user_messages_list">
<%#=render :partial => 'layouts/message_loading' %>
</div>-->
</div>
</div>
@ -95,6 +98,16 @@
$("#navHomepageSearchType").hide();
});
/*$("#user_messages").mouseenter(function(){
$("#user_messages_list").show();
$.get('<%#=user_messages_unviewed_users_path %>');
$("#ajax-indicator").hide();
}).mouseleave(function(){
$("#user_messages_list").hide();
$("#user_messages_list").html("<%#=escape_javascript(render :partial => 'layouts/message_loading') %>");
});*/
$("#navHomepageProfile").mouseenter(function(){
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
$("#topnav_login_list").show();

View File

@ -0,0 +1,6 @@
<font></font>
<div style="margin: 5px auto;width:150px;">
<img class="mr5 fl mt2" src="/images/loading.gif">
<span class="fl">正在加载中,请稍后...</span>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,74 @@
<font></font>
<h4 class="shadowbox_news_title">未读消息</h4>
<ul class="shadowbox_news_list">
<%# user_messages = User.current.user_messages_unviewed %>
<% messages.each do |ma| %>
<% if ma.class == SystemMessage %>
<li><a href="<%=user_system_messages_path(User.current) %>" target="_blank" title="Trustie平台 发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%>"><span class="shadowbox_news_user">Trustie平台 </span>发布新消息:<%= ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject%></a></li>
<% elsif ma.class == CourseMessage %>
<% if ma.course_message_type == "News" %>
<li><a href="<%=news_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 发布了通知:<%= ma.course_message.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>发布了通知:<%= ma.course_message.title%></a></li>
<% elsif ma.course_message_type == "Comment" %>
<li><a href="<%=news_path(ma.course_message.commented.id) %>" target="_blank" title="<%=ma.course_message.author.show_name %> 评论了通知:<%=ma.course_message.commented.title%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span>评论了通知:<%= ma.course_message.commented.title%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status.nil? %>
<li><a href="<%= (!User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil?) ? new_student_work_path(:homework => ma.course_message.id) : student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布了课程作业:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布了课程作业:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>发布的作业:作业标题:<%= ma.course_message.name%>的截止日期快到了</a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 启动了作业匿评:作业标题:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>启动了作业匿评:作业标题:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 4 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %>老师 启动作业匿评失败:<%= ma.course_message.name%>(失败原因提交作品的人数低于2人)"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %>老师 </span>启动作业匿评失败:<%= ma.course_message.name%>(失败原因提交作品的人数低于2人)</a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 5 %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.id) %>" target="_blank" title="<%=User.find(ma.apply_user_id).show_name %> 申请引用作业:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=User.find(ma.apply_user_id).show_name %> </span>申请引用作业:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "HomeworkCommon" && ma.status == 6 %>
<li><a href="<%= (User.current.member_of_course?(ma.course_message.course) || User.current.admin? || (ma.course_message.is_open == 1 && ma.course_message.course.is_public == 1)) ? student_work_index_path(:homework => ma.course_message.id) : 'javascript:void(0)' %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:<%= ma.course_message.name%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%= ma.apply_result == 1 ? '同意' : '拒绝'%>引用作业:<%= ma.course_message.name%></a></li>
<% elsif ma.course_message_type == "ApplyResource" && ma.status == 0 %>
<% if ma.course_message.container_type == "Course" %>
<% href = course_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "Project" %>
<% href = project_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "OrgSubfield" %>
<% href = org_subfield_files_path(ma.course_message.container_id) %>
<% else %>
<% href = 'javascript:void(0)' %>
<% end %>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.user.show_name %> 申请引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>申请引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
<% elsif ma.course_message_type == "ApplyResource" && ma.status == 1 %>
<% if ma.course_message.container_type == "Course" %>
<% href = course_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "Project" %>
<% href = project_files_path(ma.course_message.container_id) %>
<% elsif ma.course_message.container_type == "OrgSubfield" %>
<% href = org_subfield_files_path(ma.course_message.container_id) %>
<% else %>
<% href = 'javascript:void(0)' %>
<% end %>
<li><a href="<%= href %>" target="_blank" title="<%=User.find(ma.course_message.apply_user_id).show_name %> <%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%>"><span class="shadowbox_news_user"><%=User.find(ma.course_message.apply_user_id).show_name %> </span><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源:<%= ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)%></a></li>
<% elsif ma.course_message_type == "Poll" %>
<li><a href="<%= poll_path(ma.course_message.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name %>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>发布了问卷:<%= ma.course_message.polls_name.nil? ? "未命名问卷" : ma.course_message.polls_name%></a></li>
<% elsif ma.course_message_type == "Message" %>
<% content = ma.course_message.parent_id.nil? ? ma.course_message.subject : ma.course_message.content.html_safe %>
<% href = course_boards_path(ma.course_message.course, :parent_id => ma.course_message.parent_id ? ma.course_message.parent_id : ma.course_message.id, :topic_id => ma.course_message.id) %>
<li><a href="<%= href %>" target="_blank" title="<%=ma.course_message.author.show_name %> <%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%>"><span class="shadowbox_news_user"><%=ma.course_message.author.show_name %> </span><%= ma.course_message.parent_id.nil? ? "发布了课程帖子:" : "评论了课程帖子:" %><%= content%></a></li>
<% elsif ma.course_message_type == "StudentWorksScore" %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.student_work.homework_common_id) %>" target="_blank" title="<%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> <%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%>"><span class="shadowbox_news_user"><%=ma.course_message.reviewer_role == 3 ? '匿名用户' : ma.course_message.user.show_name+"老师" %> </span><%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %><%= ma.content.html_safe if !ma.content.nil?%></a></li>
<% elsif ma.course_message_type == "JournalsForMessage" %>
<% if ma.course_message.jour_type == 'Course' %>
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在课程中留言了:<%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在课程中留言了:<%= ma.course_message.notes.html_safe%></a></li>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= ma.course_message.notes.html_safe%></a></li>
<% else %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> 回复了作品评论:<%= ma.course_message.notes%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %><%=ma.course_message.user.allowed_to?(:as_teacher, ma.course) ? '老师' : '同学' %> </span>回复了作品评论:<%= ma.course_message.notes%></a></li>
<% end %>
<% end %>
<% end %>
<% end %>
<!--<li><span class="shadowbox_news_user">教辅测试老师</span><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试老师</a><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试老师</a><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试辅测试老辅测试老老师</a><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试老师</a><a href="#" target="_blank"><span class="c_red">【课程通知】</span>发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
<li><a href="#" target="_blank" class="shadowbox_news_user">教辅测试老师</a><a href="#" target="_blank">发布的作业作业标题0525发布布的作业作业标题0525发布布的作业作业标题0525发布普...</a></li>
-->
</ul>
<%= link_to '查看全部', user_message_path(User.current), :class => "shadowbox_news_all", :target =>"_Blank" %>

View File

@ -95,7 +95,7 @@
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= reply.content.html_safe%></div>
<div class="homepagePostReplyContent" id="activity_description_<%= reply.id %>"><%= h reply.content%></div>
</div>
<script type="text/javascript">
$(function(){

View File

@ -6,23 +6,6 @@
<% if all_news %>
<% all_news.each do |news| %>
<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();
}

View File

@ -1,4 +1,4 @@
<% if @organization.switch_type %>
<% if @organization.switch_type && @document && !@document.org_subfield_id.blank? %>
<%= render :partial => 'show_custom_org_document_comment' %>
<% else %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"create_kindeditor",'blog' %>
@ -23,6 +23,9 @@
<% else %>
<span style="color:#269ac9;">组织文章</span>
<% end %>
<% if @document.organization.home_id == @document.id %>
<span class="red_homework_btn_cir ml5">已设为首页</span>
<% end %>
</div>
<div class="homepagePostTitle postGrey"><%= link_to @document.title, org_document_comment_path(:id => @document.id, :organization_id => @document.organization.id) %></div>
<div class="homepagePostDate">
@ -45,8 +48,14 @@
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
<% if @document.organization.home_id == @document.id %>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">取消首页</a>
<% end %>
<% else %>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => @document.organization_id, :home_id => @document.id}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
<% end %>
<% end %>
</li>
<li>

View File

@ -53,9 +53,9 @@
<% if act.container_type == 'Project' %>
<% case act.org_act_type.to_s %>
<% when 'Issue' %>
<%= render :partial => 'organizations/org_project_issue', :locals => {:activity => Issue.find(act.org_act_id),:user_activity_id =>act.id} %>
<%= render :partial => 'users/project_issue', :locals => {:activity => Issue.find(act.org_act_id),:user_activity_id =>act.id} %>
<% when 'Message' %>
<%= render :partial => 'organizations/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
<%= render :partial => 'users/project_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id, :is_course=>0, :is_board=>0} %>
<% when 'Project'%>
<%= render :partial => 'organizations/project_create', :locals => {:activity => act,:user_activity_id =>act.id} %>
<% end %>
@ -63,24 +63,24 @@
<% if act.container_type == 'Course' %>
<% case act.org_act_type.to_s %>
<% when 'HomeworkCommon' %>
<%= render :partial => 'org_course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id,:course_activity => 0} %>
<%= render :partial => 'users/course_homework', :locals => {:activity => HomeworkCommon.find(act.org_act_id),:user_activity_id =>act.id,:course_activity => 0} %>
<% when 'News' %>
<%= render :partial => 'org_course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %>
<%= render :partial => 'users/course_news', :locals => {:activity => News.find(act.org_act_id),:user_activity_id =>act.id} %>
<% when 'Message'%>
<%= render :partial => 'org_course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id} %>
<%= render :partial => 'users/course_message', :locals => {:activity => Message.find(act.org_act_id),:user_activity_id =>act.id,:is_course=>0,:is_board=>0} %>
<% when 'Poll' %>
<%= render :partial => 'org_course_poll', :locals => {:activity => Poll.find(act.org_act_id), :user_activity_id => act.id} %>
<%= render :partial => 'users/course_poll', :locals => {:activity => Poll.find(act.org_act_id), :user_activity_id => act.id} %>
<% when 'Course'%>
<%= render :partial => 'org_course_create', :locals => {:activity => Course.find(act.org_act_id), :user_activity_id => act.id} %>
<%= render :partial => 'users/course_create', :locals => {:activity => Course.find(act.org_act_id), :user_activity_id => act.id} %>
<% end %>
<% end %>
<% if act.container_type == 'OrgSubfield' %>
<% if act.org_act_type == 'Message' and act.org_act_id and Message.where("id=#{act.org_act_id}").count > 0 %>
<% message = Message.find(act.org_act_id) %>
<% if !message.board.course_id.nil? %>
<%= render :partial => 'org_course_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
<%= render :partial => 'users/course_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
<% elsif message.board.project_id != -1 %>
<%= render :partial => 'organizations/project_message', :locals => {:activity => message,:user_activity_id =>act.id} %>
<%= render :partial => 'users/project_message', :locals => {:activity => message,:user_activity_id =>act.id,:is_course=>0,:is_board=>0} %>
<% elsif message.board.org_subfield_id %>
<%= render :partial => 'organizations/org_subfield_message', :locals => {:activity => message, :user_activity_id => act.id} %>
<% end %>

View File

@ -88,46 +88,15 @@
</span>
</div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'Message',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<% end %>
</div>
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
<% replies_all_i = 0 %>
<% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.children.reorder("created_on desc").each do |reply| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= reply.id %>');
autoUrl('reply_content_<%= reply.id %>');
});
</script>
<% replies_all_i=replies_all_i+1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_url_in_org(reply.author_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if reply.try(:author).try(:realname) == ' ' %>
<%= link_to reply.try(:author), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to reply.try(:author).try(:realname), user_url_in_org(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -70,48 +70,17 @@
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'News',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_url_in_org(comment.author_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:author).try(:realname), user_url_in_org(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -1,13 +1,15 @@
<% if @subfield_acts.blank? %>
<% else %>
<div class="sn-inner-body">
<div class="sn-innner-content">
<div class="sn-row sn-bg-white">
<div class="sn-font-grey3 f14">
您的位置:<%= link_to "首页", organization_path(@organization), :class => "sn-link-grey2" %> &gt;
<a class = "sn-link-grey2"><%= @org_subfield.name %></a>
</div>
</div>
<div class="sn-inner-body">
<div class="sn-innner-content">
<div class="sn-row sn-bg-white">
<div class="sn-font-grey3 f14">
您的位置:<%= link_to "首页", organization_path(@organization), :class => "sn-link-grey2" %> &gt;
<a class = "sn-link-grey2"><%= @org_subfield.name %></a>
</div>
</div>
<% if @subfield_acts.blank? %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<div class="sn-inner-newslist mt15">
<h2 class="sn-inner-newsh2"><%= @org_subfield.name %></h2>
<ul>
@ -33,12 +35,13 @@
</ul>
<!--<div>-->
<!--<ul class="sn-inner-pages" id="pages" style="margin-top: 5px;">-->
<!--<%#= pagination_links_full @atta_pages, @atta_count, :per_page_links => true, :remote => @is_remote, :flag => true %>-->
<!--<div class="cl"></div>-->
<!--</ul>-->
<!--<ul class="sn-inner-pages" id="pages" style="margin-top: 5px;">-->
<!--<%#= pagination_links_full @atta_pages, @atta_count, :per_page_links => true, :remote => @is_remote, :flag => true %>-->
<!--<div class="cl"></div>-->
<!--</ul>-->
<!--</div>-->
</div>
</div>
</div>
<% end %>
<% end %>
</div>
</div>

View File

@ -6,7 +6,7 @@
</div>
<div class="homepagePostDes">
<div class="homepagePostTo">
<%= link_to User.find(document.creator_id), user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
<%= link_to document.creator.show_name, user_url_in_org(document.creator.id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to document.organization.name, organization_path(document.organization), :class => "newsBlue" %>
|
<span style="color:#269ac9;"><%= document.org_subfield_id.nil? ? "组织文章" :"#{OrgSubfield.find(document.org_subfield_id).name}" %></span>
@ -41,8 +41,14 @@
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
<% if document.organization.home_id == document.id %>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'cancel_homepage', :id => document.organization_id, :home_id => document.id}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">取消首页</a>
<% end %>
<% else %>
<%= form_for('new_form', :url => {:controller => 'organizations', :action => 'set_homepage', :id => document.organization_id, :home_id => document.id, :show_homepage => 1}, :method => "put", :remote => true) do |f| %>
<a href="javascript:void(0);" class="postOptionLink" onclick="$(this).parent().submit();">设为首页</a>
<% end %>
<% end %>
</li>
<li>
@ -61,7 +67,7 @@
<% end %>
</div>
</div>
<% comments_for_doc = document.children.reorder("created_at desc") %>
<% comments_for_doc = document.children.reorder("created_at desc").limit(3) %>
<% count = document.children.count() %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
@ -74,41 +80,14 @@
</div>
<% if count > 3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
<a id="reply_btn_<%= document.id %>" onclick="expand_reply('#reply_div_<%= document.id %> li','#reply_btn_<%=document.id%>',<%= document.id %>,'OrgDocumentComment',<%= document.id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
展开更多
</a>
</div>
<% end %>
</div>
<div class="homepagePostReplyContainer" id="reply_div_<%= document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
<ul>
<% reply_id = 0 %>
<% comments_for_doc.each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% reply_id += 1 %>
<li style="display:<%= reply_id > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait"><%= link_to image_tag(url_to_avatar(User.find(comment.creator_id)), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_id) %></div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<%= link_to User.find(comment.creator_id), user_url_in_org(comment.creator_id), :class => "newsBlue mr10 f14" %>
<%= format_activity_day(comment.created_at) %> <%= format_time(comment.created_at, false) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<% unless comment.content.blank? %>
<div class="homepagePostReplyContent" id="reply_content_<%= comment.id %>"><%= comment.content.html_safe %></div>
<% end %>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments_for_doc}%>
</div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= act.id %>">
@ -138,22 +117,6 @@
</div>
<script type="text/javascript">
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(){
user_card_show_hide();
});

View File

@ -73,7 +73,7 @@
<li class="orgListType"><%= org_subfield_type field %></li>
<li class="orgListCatalog hidden">
<% if Secdomain.where("sub_type=2 and pid=?", @organization.id).count > 0 %>
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3; width:30px; margin-left:20px;" title="双击可编辑">
<div id="sub_dir_show_<%= field.id %>" ondblclick="edit_dir('#sub_dir_show_<%= field.id %>','#sub_dir_edit_<%= field.id %>');" style="cursor:pointer;background-color:#fffce6;color: #0d90c3; width:75px;overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" title="双击可编辑">
<%= field.subfield_subdomain_dir.nil? ? '未设置': field.subfield_subdomain_dir.name %>
</div>
<% else %>

View File

@ -0,0 +1,52 @@
<% if @org_acts.blank? %>
<p class="fontGrey2 f14 mt10 mb5">该模块暂时没有相关内容</p>
<% else %>
<div class="sn-inner-body">
<div class="sn-innner-content">
<div class="sn-row sn-bg-white">
<div class="sn-font-grey3 f14">
您的位置:<%= link_to "首页", organization_path(@organization), :class => "sn-link-grey2" %> &gt;
<a class = "sn-link-grey2"><%= @org_subfield.name %></a>
</div>
</div>
<div class="sn-inner-newslist mt15">
<h2 class="sn-inner-newsh2"><%= @org_subfield.name %></h2>
<ul>
<% @org_acts.each do |obj| %>
<% user = org_user_by_type(obj) %>
<% title = org_title_by_type(obj) %>
<% content = org_content_by_type(obj) %>
<% time = org_time_by_type(obj) %>
<% reply_count = org_reply_count_type(obj) %>
<li>
<div class="sn-circle fl"></div>
<% if obj.act_type == "Message" %>
<%= link_to title, board_message_path(obj.act.board.id, obj.act.id), :class => "sn-newslist-titile fl", :target => "_blank" %>
<% elsif obj.act_type == "News" %>
<%= link_to title, news_path(obj.act.id), :class => "sn-newslist-titile fl", :target => "_blank" %>
<% elsif obj.act_type == "HomeworkCommon" %>
<%= link_to title, student_work_index_url_in_org(obj.act.id), :class => "sn-newslist-titile fl", :target => "_blank" %>
<% elsif obj.act_type == "Issue" %>
<%= link_to title, issue_path(obj.act.id), :class => "sn-newslist-titile fl", :target => "_blank" %>
<% end %>
<span class=" txt-grey fr"><%= format_date(time) %></span>
<span class="sn-newslist-reply fr mr10 txt-grey">回复(<%= reply_count %></span>
<div class="cl"></div>
</li>
<% end %>
</ul>
<!--<div>-->
<!--<ul class="sn-inner-pages" id="pages" style="margin-top: 5px;">-->
<!--<%#= pagination_links_full @atta_pages, @atta_count, :per_page_links => true, :remote => @is_remote, :flag => true %>-->
<!--<div class="cl"></div>-->
<!--</ul>-->
<!--</div>-->
</div>
</div>
</div>
<% end %>

View File

@ -75,9 +75,9 @@
<div class="orgRow mb10 mt5">
<span style="margin-left:10px;" >显示模式&nbsp;: </span>
<input type="radio" id="show_mode_ordinary" value="0" name="show_mode" style="margin-left:5px;" <%= @organization.show_mode == 0 ? "checked" : "" %> />
<label for="show_mode_ordinary">社区模式一</label>
<label for="show_mode_ordinary">简介模式</label>
<input type="radio" id="show_mode_special" value="1" name="show_mode" style="margin-left:10px;" <%= @organization.show_mode == 1 ? "checked" : "" %> />
<label for="show_mode_special">社区模式二</label>
<label for="show_mode_special">门户模式</label>
</div>
<div class="orgRow mb10 mt5"><span style="margin-left:38px;" >公开&nbsp;: </span>
<input type="checkbox" id="is_public" onclick="disable_down($(this), $('#allow_download'),$('#allow_down_hint'));" name="organization[is_public]" <%= @organization.is_public ? 'checked': ''%> class="ml3" />

View File

@ -50,23 +50,6 @@
<% unless forge_acts.empty? %>
<% forge_acts.each do |activity| -%>
<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 () {
sd_create_editor_from_data(<%= activity.id %>, null, "100%", "<%= activity.class.to_s %>");
});

View File

@ -50,48 +50,17 @@
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'News',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -1,14 +1,18 @@
<table class="hwork-table-wrap">
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
<!--
<table class="hwork-table-wrap" id="homework_table" onmouseenter="<%#= @homework.homework_type == 3 ? '' : 'resizeable_table(2,4,1,1)' %>">
-->
<table class="hwork-table-wrap" id="homework_table">
<tr class="b_grey hworkH30">
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
<th class="hworkList50">&nbsp;</th>
<% if @homework.homework_type != 3 %>
<th class="hworkList260" style="text-align:left;">作品名称</th>
<th class="hworkList80">
<span class="HomeworkStuTitle f14 fb fl">姓名</span>
<th class="hworkList260 hide-text" style="text-align:left;">作品名称</th>
<th class="hworkList80 hide-text">
<span class="HomeworkStuTitle f14 fb">姓名</span>
</th>
<th class="hworkList80">
<span class="HomeworkStuTitle f14 fb fl">学号</span>
<th class="hworkList80 hide-text">
<span class="HomeworkStuTitle f14 fb">学号</span>
</th>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<th class="hworkList260" style="text-align:left;">作品名称</th>

View File

@ -1,67 +1,71 @@
<table class="hwork-table-wrap">
<tr class="b_grey hworkH30" style="border-bottom:1px solid #eaeaea;">
<!--
<table class="hwork-table-wrap" id="homework_table" onmouseenter="<%#= @homework.homework_type == 3 ? '' : 'resizeable_table(2,4,11,11)' %>">
-->
<table class="hwork-table-wrap" id="homework_table">
<tr class="b_grey hworkH30">
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
<th class="hworkList50">&nbsp;</th>
<% if @homework.homework_type != 3 %>
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pr10' : 'hworkList130 pr10'%>" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pr10">
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl #{@homework.anonymous_comment == 1 ? 'ml35' : 'ml18'}" ,:remote => true%>
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pl5 pr5 hide-text' : 'hworkList130 pl5 pr5 hide-text'%>" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pl5 pr5 hide-text">
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
<% if @show_all && @order == "lastname"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pr10">
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml30" ,:remote => true%>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pl5 pr5 hide-text">
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
<% if @show_all && @order == "student_id"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<th class="hworkList130 pr10" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList220' : 'hworkList160'%>">
<th class="hworkList130 pl5 pr5" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList210' : 'hworkList160'%>">
<span class="c_dark f14 fb">关联项目</span>
</th>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList340' : 'hworkList290' %> pr10" style="text-align:left;">作品名称</th>
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList340' : 'hworkList290' %> pl5 pr5" style="text-align:left;">作品名称</th>
<% end %>
<th class="hworkList130">
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
<% if @show_all && @order == "created_at"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<th class="hworkList50">
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10" ,:remote => true%>
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
<% if @show_all && @order == "teacher_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<th class="hworkList50">
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
<% if @show_all && @order == "teaching_asistant_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<% if @homework.homework_type == 2%>
<th class="hworkList50">
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
<% if @show_all && @order == "system_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<% end%>
<% if @homework.anonymous_comment == 0%>
<th class="hworkList50">
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
<% if @show_all && @order == "student_score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
<% end %>
<th class="hworkList50">
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10",:remote => true%>
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
<% if @show_all && @order == "score"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
<% end%>
</th>
</tr>

View File

@ -12,11 +12,11 @@
<%= link_to student_work_name,"javascript:void(0)" ,:title => student_work_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
</div>
</td>
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10 student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStName100' : 'hworkStName'%> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.show_name%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
<%= student_work.user.show_name%>
</td>
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkStID90' : 'hworkStID'%> pr10 float-none student_work_<%= student_work.id%>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
<span style="width:80px;" class="hidden fl"><%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%></span>
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
</td>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">

View File

@ -1,5 +1,6 @@
<% content_for :header_tags do %>
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
<%= javascript_include_tag "resizeable_table" %>
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<% end %>

View File

@ -1,2 +1,4 @@
$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>");
$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>");
$("#homework_student_work_list").html("<%= escape_javascript(render :partial => 'student_work/student_work_list') %>");
$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :group => @group, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => 'export_student_work') %>");
/*
$("th").each(function(){$(this).css("width",$(this).width()-1);});*/

View File

@ -0,0 +1,39 @@
<ul>
<% comments.each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<li class="homepagePostReplyContainer" nhname="reply_rec">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %>
<%= format_activity_day(comment.created_time) %> <%= format_time(comment.created_time, false) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<% if !comment.content_detail.blank? || comment.class == Journal %>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<% if comment.class == Journal %>
<% if comment.details.any? %>
<% details_to_strings(comment.details).each do |string| %>
<p><%= string %></p>
<% end %>
<% end %>
<P><%= comment.notes.html_safe %></P>
<% else %>
<%= comment.content_detail.html_safe %>
<% end %>
</div>
<% end %>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>

View File

@ -4,24 +4,5 @@
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
</div>
<% end %>
<!--<span id="reply_praise_count_<%#=comment.id %>" class="orig_index">
<%# if comment.user == User.current %>
<span class="fr likeButton" title="不能自己赞自己哦!"> <span class="likeText">赞</span><span class="likeNum"><%#= get_praise_num(comment) > 0 ? "#{get_praise_num(comment)}" : "" %></span></span>
<%# else %>
<%#=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
<%# end %>
</span>-->
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="orig_right fl">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "content-username" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "content-username" %>
<% end %>
<span class="orig_area"><%= time_from_now(comment.created_on) %></span>
<div class="orig_content "><%= comment.notes.html_safe %></div>
</div>
<div class="cl"></div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => comment} %>
</div>

View File

@ -302,91 +302,17 @@
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply_homework('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'HomeworkCommon',<%=user_activity_id %>,-1,<%=course_activity %>,<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.journals_for_messages.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_edit_<%= comment.id%>').show();" onmouseout="$('#message_edit_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= time_from_now(comment.created_on) %>
</div>
<% unless comment.m_parent_id.nil? %>
<% parents_rely = [] %>
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div id="comment_reply_<%=parents_rely[length - 1].id %>">
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
</div>
<div class="orig_cont_hide clearfix"><span class="orig_icon" >&darr; </span><span class="orig_icon" style="display:none;" > &uarr;</span><%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %></div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>
<% end %>
</div>
<% end %>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => -1, :user_activity_id => user_activity_id, :course_activity=>course_activity},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<!--<a action-type="reply" href="javascript:;" poped="false" class="fr mr20 linkGrey3" title="回复">回复</a>-->
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => -1, :user_activity_id => user_activity_id, :course_activity=>course_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
<% end %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= comment.id%>"></p>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%=render :partial => 'users/homework_replies', :locals => {:comments => comments, :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %>
</div>
<% end %>

View File

@ -43,50 +43,17 @@
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'JournalsForMessage',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% fetch_user_leaveWord_reply(activity).each do |comment| unless fetch_user_leaveWord_reply(activity).nil? %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %>
</div>
</div>
<div class="cl"></div>
</li>
<% end %>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -97,7 +97,7 @@
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count > 3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'Message',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
@ -105,43 +105,10 @@
</div>
<% activity= activity.parent ? activity.parent : activity%>
<% replies_all_i = 0 %>
<% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.children.includes(:author).reorder("created_on desc").each do |reply|%>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= reply.id %>');
autoUrl('reply_content_<%= reply.id %>');
});
</script>
<% replies_all_i=replies_all_i+1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if reply.try(:author).try(:realname) == ' ' %>
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %>
</div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -75,48 +75,17 @@
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'News',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -0,0 +1,78 @@
<ul>
<% comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_edit_<%= comment.id%>').show();" onmouseout="$('#message_edit_<%= comment.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= time_from_now(comment.created_on) %>
</div>
<% unless comment.m_parent_id.nil? %>
<% parents_rely = [] %>
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div>
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>
<% end %>
</div>
<% end %>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth t_txt" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<!--<a action-type="reply" href="javascript:;" poped="false" class="fr mr20 linkGrey3" title="回复">回复</a>-->
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :course_activity => course_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
<% end %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= comment.id%>"></p>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>

View File

@ -10,54 +10,17 @@
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<% if count > 3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
<a id="reply_btn_<%= user_activity_id %>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'Issue',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help">
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.journals.includes(:user, :details).reorder("created_on desc").each do |reply| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= reply.id %>');
autoUrl('reply_content_<%= reply.id %>');
});
</script>
<% replies_all_i=replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33"), user_path(reply.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if reply.try(:user).try(:realname) == ' ' %>
<%= link_to reply.try(:user), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to reply.try(:user).try(:realname), user_path(reply.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%= reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<% if reply.details.any? %>
<% details_to_strings(reply.details).each do |string| %>
<p><%= string %></p>
<% end %>
<% end %>
<P><%= reply.notes.html_safe %></P>
</div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -95,46 +95,15 @@
</div>
<div class="homepagePostReplyBannerTime"><%#=format_date(activity.updated_on)%></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<div class="homepagePostReplyBannerMore"><a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'Message',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >展开更多</a></div>
<% end %>
</div>
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
<% replies_all_i = 0 %>
<% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.children.includes(:author).reorder("created_on desc").each do |reply| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= reply.id %>');
autoUrl('reply_content_<%= reply.id %>');
});
</script>
<% replies_all_i=replies_all_i+1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33"), user_path(reply.author_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if reply.try(:author).try(:realname) == ' ' %>
<%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(reply.created_on) %>
<span id="reply_praise_count_<%=reply.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>reply, :user_activity_id=>reply.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= reply.id %>">
<%= reply.content.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -72,48 +72,17 @@
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'News',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.comments.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.comments.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.comments.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -29,23 +29,6 @@
<% user_activities.each do |user_activity|
if user_activities %>
<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();
}

View File

@ -56,48 +56,17 @@
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'BlogComment',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% activity.children.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33"), user_path(comment.author_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:author).try(:realname) == ' ' %>
<%= link_to comment.try(:author), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:author).try(:realname), user_path(comment.author_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.content.html_safe %></div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -312,95 +312,17 @@
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=homework_common.id%>" onclick="expand_reply('#reply_div_<%= homework_common.id %> li','#reply_btn_<%=homework_common.id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=homework_common.id%>" onclick="expand_reply_homework('#reply_div_<%= homework_common.id %> li','#reply_btn_<%=homework_common.id%>',<%= homework_common.id %>,'HomeworkCommon',<%=homework_common.id %>,<%=is_in_course %>,-1, -1)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= homework_common.id %>">
<ul>
<% homework_common.journals_for_messages.reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_edit_<%= comment.id%>').show();" onmouseout="$('#message_edit_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= time_from_now(comment.created_on) %>
</div>
<% unless comment.m_parent_id.nil? %>
<% parents_rely = [] %>
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div>
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>
<% end %>
</div>
<% end %>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth t_txt" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %></div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :course_activity => -1},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<!--<a action-type="reply" href="javascript:;" poped="false" class="fr mr20 linkGrey3" title="回复">回复</a>-->
<% if User.current.admin? ||is_teacher || comment.user == User.current%>
<%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :course_activity => -1},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %>
<% end %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= comment.id%>"></p>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%=render :partial => 'users/homework_replies', :locals => {:comments => comments, :is_in_course => is_in_course, :course_activity=> -1, :is_teacher => is_teacher, :user_activity_id => -1} %>
</div>
<% end %>

View File

@ -70,57 +70,17 @@
<div class="homepagePostReplyBannerTime"></div>
<%if count>3 %>
<div class="homepagePostReplyBannerMore">
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>')" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
<a id="reply_btn_<%=user_activity_id%>" onclick="expand_reply('#reply_div_<%= user_activity_id %> li','#reply_btn_<%=user_activity_id%>',<%= activity.id %>,'JournalsForMessage',<%=user_activity_id %>)" data-count="<%= count %>" data-init="0" class=" replyGrey" href="javascript:void(0)" value="show_help" >
展开更多
</a>
</div>
<% end %>
</div>
<% replies_all_i = 0 %>
<% comments = activity.children.reorder("created_on desc").limit(3) %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<ul>
<% fetch_user_leaveWord_reply(activity).reorder("created_on desc").each do |comment| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<% replies_all_i = replies_all_i + 1 %>
<li class="homepagePostReplyContainer" nhname="reply_rec" onmouseover="$('#message_delete_<%= comment.id%>').show();" onmouseout="$('#message_delete_<%= comment.id%>').hide();" style="display:<%= replies_all_i > 3 ? 'none' : '' %>">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
</div>
<div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher">
<% if comment.try(:user).try(:realname) == ' ' %>
<%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% else %>
<%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
<% end %>
<%= format_time(comment.created_on) %>
<span id="reply_praise_count_<%=comment.id %>">
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<div id="message_delete_<%=comment.id %>" style="display: none" class="mr10 fr">
<% if comment.user == User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:user_activity_id => user_activity_id,:is_activity=>is_activity},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %>
<% end %>
</div>
</div>
<div class="homepagePostReplyContent break_word list_style upload_img table_maxWidth" id="reply_content_<%= comment.id %>">
<%= comment.notes.html_safe %>
</div>
</div>
<div class="cl"></div>
</li>
<% end %>
</ul>
<%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
</div>
<% end %>

View File

@ -7,22 +7,6 @@
<% jours.each do |jour|%>
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id)) %>
<script type="text/javascript">
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(){
sd_create_editor_from_data(<%= jour.id%>, null, "100%", "<%=jour.class.to_s%>");
});

View File

@ -259,7 +259,7 @@
'您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请已通过'
:
'您申请引用作业"'+HomeworkCommon.find(ma.course_message_id).name+'"的申请被拒绝' %>
<% if User.current.member_of_course?(ma.course_message.course) || User.current.admin? || ma.course_message.is_open == 1 %>
<% if User.current.member_of_course?(ma.course_message.course) || User.current.admin? || (ma.course_message.is_open == 1 && ma.course_message.course.is_public == 1) %>
<%= link_to link_str, student_work_index_path(:homework => ma.course_message.id), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}", :target => '_blank' %>
<% else %>
<span title='<%=link_str %>' style="color:#4b4b4b; cursor: default;" class="<%= ma.viewed == 0 ? 'newsBlack' : 'newsGrey'%>"><%=link_str %></span>
@ -399,7 +399,7 @@
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<% end %>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user), :target => '_blank' %></a>

View File

@ -0,0 +1,5 @@
<% if params[:type] == 'HomeworkCommon' %>
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/homework_replies', :locals => {:comments => @journals, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>');
<% else %>
$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>');
<% end %>

View File

@ -0,0 +1 @@
$("#user_messages_list").html("<%=escape_javascript(render :partial => 'layouts/show_messages_list', :locals => {:messages => @message_alls}) %>");

View File

@ -1,7 +1,8 @@
<!DOCTYPE html>
<html ng-app="wechat">
<head>
<title>最新动态</title>
<base href="/">
<title>我的动态</title>
<meta charset='utf-8' />
<meta name="keywords" content="" />
<meta name="description" content="" />

View File

@ -1,8 +1,8 @@
button:
-
type: "view"
name: "最新动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://test.course.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
name: "我的动态"
url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx8e1ab05163a28e37&redirect_uri=https://www.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect"
-
type: "click"
name: "意见反馈"
@ -13,8 +13,8 @@ button:
-
type: "view"
name: "进入网站"
url: "https://test.course.trustie.net/"
url: "https://www.trustie.net/"
-
type: "view"
name: "使用手册"
url: "https://test.course.trustie.net/organizations/1/downloads"
url: "https://www.trustie.net/organizations/1/downloads"

View File

@ -546,8 +546,10 @@ RedmineApp::Application.routes.draw do
get 'new_user_commit_homework'
get 'reply_to'
get 'show_all_replies'
get 'user_messages_unviewed'
post "user_commit_homework"
post 'user_select_homework'
get 'all_journals'
end
member do

View File

@ -3,19 +3,25 @@ default: &default
# corpsecret: "corpsecret"
# agentid: 1
# Or if using public account, only need above two line
appid: "wxc09454f171153c2d"
secret: "dff5b606e34dcafe24163ec82c2715f8"
# guange test
#appid: "wxf694495398c7d470"
#secret: "743e038392f1d89540e95f8f7645849a"
appid: "wx8e1ab05163a28e37"
secret: "beb4d3bc4b32b3557811680835357841"
token: "123456"
access_token: "1234567"
encrypt_mode: false # if true must fill encoding_aes_key
encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6"
encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#template
binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU"
journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE"
homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ"
class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk"
binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
production:
<<: *default

View File

@ -0,0 +1,10 @@
class UpdateOrgSubfiledDefault < ActiveRecord::Migration
def up
OrgSubfield.where(:name => "activity").update_all(:status => false)
OrgSubfield.where(:name => "course").update_all(:status => 2)
OrgSubfield.where(:name => "project").update_all(:status => 2)
end
def down
end
end

View File

@ -0,0 +1,8 @@
class UpdateOrgSubfiledResource < ActiveRecord::Migration
def up
OrgSubfield.where(:field_type => "Resource").update_all(:status => 6)
end
def down
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160606064856) do
ActiveRecord::Schema.define(:version => 20160612043259) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false

View File

@ -815,7 +815,8 @@ function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
startNewline = endNewline = '';
}
}
if (attr !== '') {
//blockquote 单独加上style 之后再改成接口 给别的加上默认的
if (attr !== '' || (tagName === 'blockquote')) {
var attrMap = _getAttrList(full);
if (tagName === 'font') {
var fontStyleMap = {}, fontStyle = '';
@ -877,6 +878,9 @@ function _formatHtml(html, htmlTags, urlType, wellFormatted, indentChar) {
}
});
attr = '';
if (tagName === 'blockquote') {
attrMap['style'] = "margin: 0 0 0 40px; border: none; padding: 0px;background: none;background-color: ;";
}
_each(attrMap, function(key, val) {
if (key === 'style' && val === '') {
return;

View File

@ -46,7 +46,7 @@
.ke-content div.ref .ref_body {margin:0;padding:2px;line-height:20px;color:#666;font-size:9pt;}
.ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;}
.ke-content blockquote{background: none;border: none;padding: 0px;margin: 0 0 0 40px;}
span.at {color:#269ac9;}
span.at a{color:#269ac9;text-decoration: none;}

View File

@ -284,7 +284,7 @@ KindEditor.plugin('table', function(K) {
for (var i = 0; i < rows; i++) {
html += '<tr>';
for (var j = 0; j < cols; j++) {
html += '<td style="border:'+ border+'px solid;border-color:' + borderColor+';text-overflow:inherit;overflow: hidden;white-space: nowrap" >' + (K.IE ? '&nbsp;' : '<br />') + '</td>';
html += '<td style="border:'+ border+'px solid;border-color:' + borderColor+';">' + (K.IE ? '&nbsp;' : '<br />') + '</td>';
}
html += '</tr>';
}

View File

@ -1,7 +1,8 @@
<!DOCTYPE html>
<html ng-app="wechat">
<head>
<title>最新动态</title>
<base href="/">
<title>我的动态</title>
<meta charset='utf-8' />
<meta name="keywords" content="" />
<meta name="description" content="" />

View File

@ -1283,21 +1283,72 @@ function clear_data(k,mdu){
}
}
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(container, btnid, id, type, div_id) {
var target = $(container);
var btn = $(btnid);
if (btn.data('init') == '0') {
btn.data('init', 1);
$.get(
'/users/all_journals',
{
type: type,
id: id,
div_id: div_id
},
function(data) {
}
);
btn.html('收起回复');
//target.show();
} else if(btn.data('init') == '1') {
btn.data('init', 3);
btn.html('展开更多');
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
}
else {
btn.data('init', 1);
btn.html('收起回复');
target.show();
}
}
function expand_reply_homework(container, btnid, id, type, div_id, is_in_course, course_activity, user_activity_id) {
var target = $(container);
var btn = $(btnid);
if (btn.data('init') == '0') {
btn.data('init', 1);
$.get(
'/users/all_journals',
{
type: type,
id: id,
div_id: div_id,
is_in_course: is_in_course,
course_activity: course_activity,
user_activity_id: user_activity_id
},
function(data) {
}
);
btn.html('收起回复');
//target.show();
} else if(btn.data('init') == '1') {
btn.data('init', 3);
btn.html('展开更多');
target.hide();
target.eq(0).show();
target.eq(1).show();
target.eq(2).show();
}
else {
btn.data('init', 1);
btn.html('收起回复');
target.show();
}
}
//by yk 列表描述将文字和起来去掉空格多于100就显示省略号
@ -1347,6 +1398,43 @@ function pop_up_box(value,tWidth,tTop,tLeft){
}
}
//显示的时候根据当前网址是http 还是https 选择视频显示方式直接显示还是弹框
function autoMedia(id){
var rootPath = getRootPath();
function _mediaType(src) {
if (/\.(rm|rmvb)(\?|$)/i.test(src)) {
return 'audio/x-pn-realaudio-plugin';
}
if (/\.(swf|flv)(\?|$)/i.test(src)) {
return 'application/x-shockwave-flash';
}
return 'video/x-ms-asf-plugin';
}
if (rootPath.indexOf("https") < 0){
$("#"+id+" img").each(function(){
if ($(this).attr("class") == "mediaIco"){
var href = $(this).parent().attr("href");
//正则取地址
if (href){
var url = href.split("open('")[1].split("',")[0];
if (url != ""){
var type = _mediaType(url);
//1.video/x-ms-asf-plugin 类型的视频播放不了,2.audio/x-pn-realaudio-plugin没试过3.application/x-shockwave-flash可以播放
if (type != "video/x-ms-asf-plugin"){
var width = 550;
var height = 400;
var html = '<embed src="'+url+'" allowFullScreen="true" quality="high" width="'+width+'" height="'+height+'" align="middle" allowScriptAccess="always" type="'+type+'"></embed>';
$(this).parent().replaceWith(html);
}
}
}
}
});
}
}
//yk 自动识别URL 并加上链接
function autoUrl(id){
if ($("#"+id).children().length > 0 ){
@ -1387,6 +1475,8 @@ function autoUrl(id){
});
$("#"+id).html(html);
}
if(!(!!window.ActiveXObject || "ActiveXObject" in window)){
autoMedia(id);
}
}

View File

@ -0,0 +1,84 @@
/**
* Created by ttang on 2016/5/24.
*/
/*$(document).ready(function(){
$("th").each(function(){
$(this).css("width",$(this).width()-1);
});
resizeable_table = function(colS,colE,p1,p2){
var headerTds = document.getElementById("homework_table").rows[0].cells;
var mousedown = false;
var resizeable = false;
var targetTd;
var screenXStart =0;
var tdWidth = 0;
var headerWidth = 0;
var tblObj = document.getElementById("homework_table");
var tblWidth = tblObj.offsetWidth;
for(var i = colS;i<colE;i++){
addListener(headerTds[i],"mousedown",onmousedown);
addListener(headerTds[i],"mousemove",onmousemove);
addListener(headerTds[i],"mouseup",onmouseup);
}
function onmousedown(event){
if (resizeable == true){
var evt =event||window.event;
mousedown = true;
screenXStart = evt.screenX;
tdWidth = targetTd.offsetWidth;
tdWidth2 = targetTd.nextElementSibling.offsetWidth;
totalWidth = tdWidth + tdWidth2;
}
}
function onmousemove(event){
var evt =event||window.event;
var srcObj = getTarget(evt);
var offsetX = evt.offsetX || (evt.clientX - srcObj.getBoundingClientRect().left);//这个比较关键解决了Firefox无offsetX属性的问题
if (mousedown == true){
var width = (tdWidth + (evt.screenX - screenXStart)) - p1 + "px";//计算后的新的宽度
var width2 = (tdWidth2 - (evt.screenX - screenXStart)) - p2 + "px";
if (parseInt(width)<0 || parseInt(width2)<0 || tdWidth > totalWidth || tdWidth2 > totalWidth){
tartgetTd = null;
resizeable = false;
mousedown = false;
}else{
targetTd.style.width = width;
targetTd.nextElementSibling.style.width = width2;
}
}else{
var trObj = tblObj.rows[0];
if(srcObj.offsetWidth - offsetX <=5){//实际改变本单元格列宽
targetTd=srcObj;
resizeable = true;
for(var i = colS;i<colE;i++){
headerTds[i].style.cursor='col-resize';//修改光标样式
};
}else{
resizeable = false;
mousedown = false;
srcObj.style.cursor='default';
}
}
}
function onmouseup(event){
tartgetTd = null;
resizeable = false;
mousedown = false;
document.body.style.cursor='default';
}
document.body.onmouseup = function(event){
tartgetTd = null;
resizeable = false;
mousedown = false;
document.body.style.cursor='default';
}
function getTarget(evt){
return evt.target || evt.srcElement;
}
function addListener(element,type,listener,useCapture){
element.addEventListener?element.addEventListener(type,listener,useCapture):element.attachEvent("on" + type,listener);
}
}
});
*/

View File

@ -67,43 +67,18 @@ app.factory('rms', function(){
return {save: save, get: get};
});
app.controller('ActivityController',function($anchorScroll, $location,$scope, $http, auth, rms, common){
app.controller('ActivityController',function($anchorScroll, $location,$scope, $http, $timeout, auth, rms, common){
$scope.replaceUrl = function(url){
return url;
};
console.log("ActivityController load");
$scope.page = 0;
$scope.page = rms.get('page') || 0;
$scope.activities = rms.get("activities") || [];
$scope.has_more = rms.get("has_more");
var savePageConfig = function(){
rms.save('current_page', $scope.current_page);
rms.save('has_more', $scope.has_more);
rms.save('activities', $scope.activities);
}
var loadPageConfig = function(){
var current_page = rms.get('current_page');
var has_more = rms.get('has_more');
var activities = rms.get('activities');
if(typeof current_page !== 'undefined'){
$scope.page = current_page;
}
if(typeof has_more !== 'undefined'){
$scope.has_more = has_more;
}
}
var loadActData = function(page){
if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的
loadPageConfig();
var yOffset = rms.get("yoffset");
$location.hash(yOffset);
return;
}
$scope.loadActData = function(page){
$scope.page = page;
$http({
@ -111,38 +86,41 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h
url: apiUrl+ "activities",
data: {openid: auth.openid(), page: page}
}).then(function successCallback(response) {
$scope.current_page = 0;
console.log($scope.current_page);
console.log(response.data.page);
if($scope.current_page < response.data.page) {
if(response.data.page >0) {
$scope.activities = $scope.activities.concat(response.data.data);
} else {
$scope.activities = response.data.data;
}
rms.save("activities", $scope.activities);
$scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
rms.save('has_more', $scope.has_more);
rms.save('page', response.data.page);
console.log(response.data);
rms.save('current_page', $scope.page);
rms.save('has_more', $scope.has_more);
rms.save('activities', $scope.activities);
}, function errorCallback(response) {
});
};
auth.getOpenId().then(
function successCallback(response){
loadActData($scope.page);
}, function errorCallback(response) {
alert("获取openid出错:"+response);
}
);
if($scope.activities.length<=0){
auth.getOpenId().then(
function successCallback(response){
$scope.loadActData(0);
}, function errorCallback(response) {
alert("获取openid出错:"+response);
}
);
} else {
$timeout(function(){
window.scrollTo(0, rms.get("yoffset"));
});
$scope.loadActData = loadActData;
}
//跳到详情页
$scope.goDetail = function(type, act_id,id){
rms.save("yoffset",'act_'+id);
rms.save("yoffset", window.document.body.scrollTop);
$location.path('/'+type+'/'+act_id);
}
@ -153,9 +131,6 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h
$scope.decreasePraise = function(act){
common.decreaseCommonPraise(act);
};
});
app.factory('common', function($http, auth, $routeParams){
@ -522,11 +497,11 @@ app.directive('loadingSpinner', function ($http) {
};
});
app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProvider) {
app.config(['$routeProvider',"$httpProvider", "$locationProvider",function ($routeProvider, $httpProvider, $locationProvider) {
var rootPath = '/assets/wechat/'
//$locationProvider.html5Mode(true);
$routeProvider
.when('/activities', {
.when('/activites', {
templateUrl: rootPath + 'activities.html',
controller: 'ActivityController'
})
@ -559,7 +534,7 @@ app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProv
controller: 'BlogController'
})
.otherwise({
redirectTo: '/activities'
redirectTo: '/activites'
});
//监听异步请求,实现加载中显隐标记

8
public/javascripts/wechat/vue.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -59,7 +59,7 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
.hworkList100 {width:100px; text-align:center;}
.hworkList130 {width:130px; text-align:center;}
.hworkList160 {width:160px; text-align:center;}
.hworkList220 {width:220px; text-align:center;}
.hworkList210 {width:210px; text-align:center;}
.hworkList260 {width:260px; text-align:left;}
.hworkList290 {width:290px; text-align:left;}
.hworkList340 {width:340px; text-align:left;}
@ -108,8 +108,8 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re
.pr10{padding-right: 10px;}
/*20160520作品列表table*/
.hwork-table-wrap {width:720px; border-collapse:collapse; vertical-align:middle;}
.hwork-table-wrap th {font-size:14px; color:#2d2d2d;}
.hwork-table-wrap {width:720px; border-collapse:collapse; vertical-align:middle; table-layout:fixed;}
.hwork-table-wrap th {font-size:14px; color:#2d2d2d; border-bottom:1px solid #e1e1e1;}
/*作业信息*/
.mt-2 {margin-top:-2px;}
@ -152,7 +152,6 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro a{color: #136ec2;}
.homepagePostIntro blockquote{background: none;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
@ -195,7 +194,6 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;}
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.homepagePostReplyContent a{color: #136ec2;}
.homepagePostReplyContent blockquote{background: none;}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
@ -562,6 +560,8 @@ a.exit { height:24px; display:block; width:80px; color:#000000; background:#c3c3
.st_box_top a:hover{ color:#1c9ec7;}
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
a.sort_up{ display: inline-block; width:8px; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat;}
a.sort_down{ display: inline-block; width:8px; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat;}
a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
a:hover.st_img { border:1px solid #1c9ec7; }
.st_boxlist{ border-bottom:1px dashed #CCC; height:43px; margin-bottom:10px; }
@ -1144,7 +1144,6 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin
.postDetailDes ul li{list-style-type: disc;margin-left: 40px;}
.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;}
.postDetailDes a{color: #136ec2;}
.postDetailDes blockquote{background: none;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; }
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}
@ -1264,7 +1263,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.tac {text-align:center;}
.proHelp {background:url(/images/course/hwork_icon.png) -5px -124px no-repeat; display:inline-block; width:15px; height:15px; display:inline-block;}
.hworkPrName {width:160px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:65px; line-height:65px; vertical-align:middle; font-size:12px; color:#888888; text-align:center;}
.hworkPrName2 {width:220px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:65px; line-height:65px; vertical-align:middle; font-size:12px; color:#888888; text-align:center;}
.hworkPrName2 {width:210px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:65px; line-height:65px; vertical-align:middle; font-size:12px; color:#888888; text-align:center;}
.mr150 {margin-right:150px;}
.relatePInfo {text-align: left; position:absolute; background-color:#ffffff; padding:3px 8px; white-space:nowrap; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); z-index:999; color:#585858; cursor:pointer; display:none;}
.captainName {max-width:65px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; display: inline-block;}

View File

@ -683,7 +683,6 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro a{color: #136ec2;}
.homepagePostIntro blockquote{background: none;}
.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
.borderBottomNone {border-bottom:none !important;}
.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
@ -724,7 +723,6 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.homepagePostReplyContent a{color: #136ec2;}
.homepagePostReplyContent blockquote{background: none;}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
@ -870,7 +868,6 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
.postDetailDes ul li{list-style-type: disc;margin-left: 40px;}
.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;}
.postDetailDes a{color: #136ec2;}
.postDetailDes blockquote{background: none;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; } /*line-height: 18px !important;*/
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}
@ -1619,3 +1616,15 @@ ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3
ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
/*.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;}*/
.wlist_select a{background-color: #64bdd9;cursor: default;}
/*消息弹框*/
.shadowbox_news{ width:305px; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position: absolute; left: -131px; top: 45px; z-index: 9999;}
.shadowbox_news_title{ height:40px; line-height:40px;padding-left:10px; font-size:12px; color:#333;border-bottom:1px solid #eee;}
.shadowbox_news font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
.shadowbox_news_list{ max-height:200px; overflow:hidden;}
.shadowbox_news_list a{ color:#999;}
.shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;}
.shadowbox_news_list li:hover{ background-color:#eee;}
span.shadowbox_news_user{ color:#3b94d6;}
a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;}

View File

@ -978,7 +978,6 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro a{color: #136ec2;}
.homepagePostIntro blockquote{background: none;}
.topBorder {
border-top: 1px solid #E4E4E4;
}
@ -1121,7 +1120,6 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;}
.postDetailDes ul li{list-style-type: disc;margin-left: 40px;}
.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;}
.postDetailDes a{color: #136ec2;}
.postDetailDes blockquote{background: none;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}

View File

@ -56,6 +56,7 @@ h4{ font-size:14px; }
.flow_hidden{ width:300px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.white_space{white-space:nowrap;}
.pr {position:relative;}
.hide-text {overflow:hidden; white-space:nowrap;}
/* Spacing */
.ml2{ margin-left:2px;}
@ -617,7 +618,6 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro a{color: #136ec2;}
.homepagePostIntro blockquote{background: none;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
@ -655,7 +655,6 @@ a.postReplyCancel:hover {color:#ffffff;}
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.homepagePostReplyContent a{color: #136ec2;}
.homepagePostReplyContent blockquote{background: none;}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#15bccf;}
@ -1149,3 +1148,14 @@ a.st_down{ display: block; width:8px; float:left; height:13px; background:url(..
/*弹框*/
.apply_content{ border:1px solid #ddd;line-height: 16px; height:80px;width:420px; background:#fff; margin-bottom:10px;}
/*消息弹框*/
.shadowbox_news{ width:305px; background-color:#fff; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position: absolute; left: -131px; top: 45px; z-index: 9999;}
.shadowbox_news_title{ height:40px; line-height:40px;padding-left:10px; font-size:12px; color:#333;border-bottom:1px solid #eee;}
.shadowbox_news font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -15px;left: 140px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
.shadowbox_news_list{ max-height:200px; overflow:hidden;}
.shadowbox_news_list a{ color:#999;}
.shadowbox_news_list li{ height:40px; border-bottom:1px dashed #ebebeb; line-height:40px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis; padding:0 10px;}
.shadowbox_news_list li:hover{ background-color:#eee;}
span.shadowbox_news_user{ color:#3b94d6;}
a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;}