Merge branch 'develop' into yuanke

This commit is contained in:
yuanke 2016-06-08 09:41:18 +08:00
commit ec39c16c66
52 changed files with 745 additions and 308 deletions

View File

@ -1,6 +1,6 @@
class OrgDocumentCommentsController < ApplicationController
before_filter :find_organization, :only => [:new, :create, :show, :index]
before_filter :authorize_allowed, :only => [:create]
before_filter :authorize_allowed, :only => [:create, :add_reply]
helper :attachments,:organizations
layout 'base_org'
@ -38,6 +38,11 @@ class OrgDocumentCommentsController < ApplicationController
def show
@document = OrgDocumentComment.find(params[:id])
@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'}
end
end
def index
@ -91,7 +96,7 @@ 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_comment][:org_content]
@comment.content = params[:org_content]
@document.children << @comment
@document.save
respond_to do |format|

View File

@ -28,8 +28,9 @@ class OrganizationsController < ApplicationController
helper :project_score
helper :issues
include UsersHelper
before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout, :teachers, :students, :projects, :courses]
before_filter :allow_as_admin, :only => [:students, :teachers, :projects, :courses, :acts]
include OrganizationsHelper
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
@ -77,8 +78,12 @@ class OrganizationsController < ApplicationController
def show
# 组织新类型 show_mode判断标准 1为新类型0为旧
if @organization.switch_type && params[:org_subfield_id].nil? && params[:list] .nil?
if @organization.switch_type && params[:list] .nil?
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
unless params[:org_subfield_id].nil?
@org_subfield = OrgSubfield.where(:id => params[:org_subfield_id]).first
@subfield_acts = get_subfield_acts(@org_subfield)
end
@subfield_content = @organization.org_subfields.order("priority")
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)
@ -102,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 created_at desc limit 6;")
order by updated_at desc limit 6;")
end
render :layout => 'base_org_custom'
else
@ -175,7 +180,7 @@ class OrganizationsController < ApplicationController
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comptec").first : OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
if @type == "courses" || @type.nil?
if @type.blank?
@org_teachers = User.find_by_sql("select u.*, ue.technical_title, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity=0 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc")
elsif @type == "famous"
@ -199,7 +204,7 @@ class OrganizationsController < ApplicationController
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Compstu").first : OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
if @type == "courses" || @type.nil?
if @type.blank?
@org_students = User.find_by_sql("select u.*, ue.student_id, ue.school_id,(select count(*) from courses where courses.tea_id = u.id) as course_count
from users u, user_extensions ue where u.id = ue.user_id and ue.identity= 1 and concat(lastname,firstname,login) like '%#{q}%' order by course_count desc")
elsif @type == "famous"
@ -235,7 +240,7 @@ class OrganizationsController < ApplicationController
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Comppro").first : OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
if @type.nil?
if @type.blank?
@containers = Project.find_by_sql("select p.*, (select count(*) from forge_activities where forge_activities.project_id = p.id) as project_count
from projects p where p.status =1 and p.is_public =1 and name like '%#{q}%' order by project_count desc;")
elsif @type == "famous"
@ -249,7 +254,7 @@ class OrganizationsController < ApplicationController
q = params[:search].nil? ? "" : "#{params[:search].strip}"
@field = params[:org_subfield_id].nil? ? OrgSubfield.where("organization_id =? and field_type =?", params[:id].to_i, "Compstu").first : OrgSubfield.find(params[:org_subfield_id])
@type = params[:type]
if @type.nil?
if @type.blank?
@containers = Course.find_by_sql("select c.*, (select count(*) from course_activities where course_activities.course_id = c.id) as course_count
from courses c where c.is_delete =0 and c.is_public =1 and name like '%#{q}%' order by course_count desc;")
elsif @type == "famous"
@ -260,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 updated_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

@ -325,13 +325,10 @@ update
def show
## TODO: the below will move to filter, done.
if !User.current.member_of?(@project)
if @project.hidden_repo
render_403
return -1
end
if !User.current.member_of?(@project) && @project.hidden_repo
render_403
return
end
@entries = @repository.entries(@path, @rev)
@changeset = @repository.find_changeset_by_name(@rev)
if request.xhr?

View File

@ -1,9 +1,9 @@
class SubDocumentCommentsController < ApplicationController
before_filter :find_subdomain_and_subfield, :only => [:new, :create, :show, :index, :destroy, :edit]
before_filter :find_subfield_content, :only => [:show, :index]
before_filter :authorize_allowed, :only => [:create]
before_filter :authorize_allowed, :only => [:create, :add_reply]
helper :attachments,:organizations
layout 'base_sub_domain'
layout 'base_org_custom'
def new
@sub_document_comment = SubDocumentComment.new
@ -41,7 +41,7 @@ class SubDocumentCommentsController < ApplicationController
if @organization.is_public? || User.current.admin? || User.current.member_of_org?(@organization)
@document = SubDocumentComment.find(params[:id])
respond_to do |format|
format.html {render :layout => @organization.switch_type ? 'base_sub_domain' : 'base_org'}
format.html {render :layout => @organization.switch_type ? 'base_org_custom' : 'base_org'}
end
else
render_403
@ -58,7 +58,7 @@ class SubDocumentCommentsController < ApplicationController
@offset ||= @atta_pages.offset
@documents = paginateHelper @documents,20
respond_to do |format|
format.html {render :layout => @organization.switch_type ? 'base_sub_domain' : 'base_org'}
format.html {render :layout => @organization.switch_type ? 'base_org_custom' : 'base_org'}
end
else
render_403

View File

@ -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

View File

@ -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|

View File

@ -1080,7 +1080,7 @@ module ApplicationHelper
elsif @user
title << @user.try(:realname)
else
title << User.current.try(:realname)
title << (User.current.id == 2 ? "未登录" : User.current.try(:realname))
end
if first_page.nil? || first_page.web_title.nil?
title << Setting.app_title unless Setting.app_title == title.last

View File

@ -66,52 +66,102 @@ module OrganizationsHelper
def org_user_by_type obj
case obj.act_type
when "Message"
user = obj.act.author
obj.act.author
when "News"
user = obj.act.author
obj.act.author
when "HomeworkCommon"
user = obj.act.user
obj.act.user
when "Issue"
user = obj.act.author
obj.act.author
end
end
def org_title_by_type obj
case obj.act_type
when "Message"
user = obj.act.parent_id.nil? ? obj.act.subject : obj.act.parent.subject
obj.act.parent_id.nil? ? obj.act.subject : obj.act.parent.subject
when "News"
user = obj.act.title
obj.act.title
when "HomeworkCommon"
user = obj.act.name
obj.act.name
when "Issue"
user = obj.act.subject
obj.act.subject
end
end
def org_content_by_type obj
case obj.act_type
when "Message"
user = obj.act.parent_id.nil? ? obj.act.content : obj.act.parent.content
obj.act.parent_id.nil? ? obj.act.content : obj.act.parent.content
when "News"
user = obj.act.description
obj.act.description
when "HomeworkCommon"
user = obj.act.description
obj.act.description
when "Issue"
user = obj.act.description
obj.act.description
end
end
def org_time_by_type obj
case obj.act_type
when "Message"
time = obj.act.updated_on
obj.act.updated_on
when "News"
user = obj.act.created_on
obj.act.created_on
when "HomeworkCommon"
user = obj.act.updated_at
obj.act.updated_at
when "Issue"
user = obj.act.updated_on
obj.act.updated_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
# 组织的栏目类型标题
def subfield_title_type obj
case obj.org_act_type
when "OrgDocumentComment"
obj.org_act.title
when "Message"
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
# 组织的栏目类型时间
def subfield_time_type obj
case obj.org_act_type
when "OrgDocumentComment"
obj.org_act.updated_at
when "Message"
obj.org_act.updated_on
when "News"
obj.org_act.created_on
end
end
def subfield_reply_count_type obj
case obj.org_act_type
when "OrgDocumentComment"
obj.org_act.children.count
when "Message"
obj.org_act.children.count
when "News"
obj.org_act.comments_count
end
end
@ -178,17 +228,19 @@ module OrganizationsHelper
# 系统栏目只有管理员才能看到
def subfield_to_addmin?(org)
if User.current.admin?
@organization.org_subfields.order("priority")
else
@organization.org_subfields.select { |os| (os.field_type != "Comptec" && os.field_type != "Compstu" && os.field_type != "Comppro" && os.field_type != "Compcou" && os.field_type != "Compact") }.sort_by {|os| os.priority}
end
# if User.current.admin?
@organization.org_subfields.order("priority")
# else
# @organization.org_subfields.select { |os| (os.field_type != "Comptec" && os.field_type != "Compstu" && os.field_type != "Comppro" && os.field_type != "Compcou" && os.field_type != "Compact") }.sort_by {|os| os.priority}
# end
end
def get_subfield_acts field
org_subfield = OrgSubfield.find(field.id)
org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0
org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc')
unless field.nil?
org_subfield = OrgSubfield.find(field.id)
org_subfield_ids = org_subfield.org_document_comments.map(&:id) << 0
org_acts = OrgActivity.where("(org_act_type='OrgDocumentComment'and org_act_id in (#{org_subfield_ids.join(",")})) || (container_type='OrgSubfield' and container_id=#{org_subfield.id})").order('updated_at desc')
end
end
def allow_to_create?(org, type)

View File

@ -13,7 +13,7 @@
<span class="attachment">
<%= link_to truncate(@attachment.filename,length: 35, omission: '...'),
download_named_attachment_path(@attachment.id, @attachment.filename),
:title => @attachment.filename+"\n"+@attachment.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:300px;",:class => "linkBlue f14 fb link_file_a2 fl" %>
:title => @attachment.filename+"\n"+@attachment.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis; max-width:280px;",:class => "linkBlue f14 fb link_file_a2 fl" %>
</span>
<span class="fr">版本号:当前</span>
<div class="cl"></div>

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,13 @@
<div class="sn-row sn-bg-grey2">
<div class="sn-footer">
<ul class="sn-footer-link">
<li class="sn-mr50"><a href="<%= about_us_path %>" class="sn-link-white sn-f18">关于我们</a></li>
<li class="sn-mr50"><a href="<%= agreement_path %>" class="sn-link-white sn-f18">服务协议</a></li>
<li class="sn-mr50"><a href="http://forge.trustie.net/forums/1/memos/1168" class="sn-link-white sn-f18">帮助中心</a></li>
<li><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="sn-link-white sn-f18">在线报名</a></li>
</ul>
<div class="sn-contact">联系人:魏小姐 | 电 话0731-84761282 | 传 真0731-84761268 | 邮 箱office@gnssopenlab.org</div>
<div class="sn-address">地 址湖南省长沙市开福区东风路89号观园大厦23层<br />
卫星导航仿真与测试开放实验室</div>
</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

@ -9,16 +9,16 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'new_user', 'public', 'org_custom','jquery/jquery-ui-1.9.2' %>
<%= stylesheet_link_tag 'new_user', 'public', 'org_custom','jquery/jquery-ui-1.9.2', 'org2' %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
<!-- MathJax的配置 -->
<%=render :partial => "math_js" %>
<%#=render :partial => "math_js" %>
</head>
<body style="background: #fff">
<% update_visiti_count @organization %>
<header id="por_header">
<%= render :partial => 'org_custom_header', :locals => {:subfield_content => @subfield_content} %>
<%= render :partial => 'organizations/org_custom_header', :locals => {:subfield_content => @subfield_content} %>
</header>
<%# 内容开始 %>

View File

@ -160,30 +160,14 @@
<div style="clear:both;"></div>
<footer>
<!--footer-->
<div class="sn-row sn-bg-grey2">
<div class="sn-footer">
<ul class="sn-footer-link">
<li class="sn-mr50"><a href="<%= about_us_path %>" class="sn-link-white sn-f18">关于我们</a></li>
<li class="sn-mr50"><a href="<%= agreement_path %>" class="sn-link-white sn-f18">服务协议</a></li>
<li class="sn-mr50"><a href="http://forge.trustie.net/forums/1/memos/1168" class="sn-link-white sn-f18">帮助中心</a></li>
<li><a href="<%= forums_path(:reorder_complex=>'desc')%>" class="sn-link-white sn-f18">在线报名</a></li>
</ul>
<div class="sn-contact">联系人:魏小姐 | 电 话0731-84761282 | 传 真0731-84761268 | 邮 箱office@gnssopenlab.org</div>
<div class="sn-address">地 址湖南省长沙市开福区东风路89号观园大厦23层<br />
卫星导航仿真与测试开放实验室</div>
</div>
</div>
<%= render :partial => "layouts/org_custom_footer" %>
</footer>
</div>
<!--页面底部-->
<div class="cl"></div>
<div id="ajax-modal" style="display:none;"></div>
<div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span>
</div>
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
</body>
</html>

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

@ -0,0 +1,111 @@
<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;
<%=link_to @org_subfield.name, organization_path(@organization, :org_subfield_id => @org_subfield.id), :class => "sn-link-grey2" %> &gt;
<a class = "sn-link-grey2" ><%= @document.title %></a>
</div>
</div>
<div class="sn-inner-newslist mt15">
<h2 class="sn-inner-newsh2 sn-hidden"><%= @document.title %></h2>
<div class="sn-inner-newscon">
<p class=" sn-inner-psmall">来源:<%= @org_subfield.name %> 发布时间:<%= format_date(@document.created_at) %></p>
<p class=" sn-inner-pcon"><%= @document.content.html_safe %></p>
</div>
</div>
<!--回复-->
<% if User.current.logged? %>
<% comments_for_doc = @document.children.reorder("created_at desc") %>
<% count = @document.children.count() %>
<div class="sn-replybox">
<h2 class="sn-reply-h2">留言板<span class="sn-fr sn-f14 sn-font-grey3 sn-mt10"><%= count %>条留言</span></h2>
<%= form_for :org_comment, :url => {:action => 'add_reply_in_doc',:controller => 'org_document_comments', :id => @document.id, :flag => true}, :html => {:multipart => true, :id => 'message_form', :class => "sn-reply-form", } do |f| %>
<textarea class="sn-reply-text" name="org_content" id="text_submain"></textarea>
<%#= f.kindeditor :sub_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor', :class => "sn-reply-text" %>
<div class="sn-reply-btnbox">
<a href="javascript:void(0)" onclick = "org_new_files_upload()" class = "submit-btn">发表</a>
</div>
<p id="sub_domain_reply" style="display: none;color: #ff0000">内容不能为空</p>
<%#= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %>
<% end %>
<div class="sn-reply-comment">
<h2 class="sn-comment-h2">全部评论</h2>
<div id="newstyle_reply_div_<%= @document.id %>" style="display:<%= count == 0 ? 'none' : 'block' %>">
<% comments_for_doc.each_with_index do |reply,i| %>
<div class="sn-comment-listbox">
<a href="javascript:void(0)" class="sn-reply-userpic fl"><img src="images/img-news-con.jpg" width="824" height="522" alt="" /></a>
<%= link_to User.find(reply.creator_id).realname, user_url_in_org(reply.creator_id), :class => "sn-reply-username fl" %><span class="fl"><%= time_from_now(reply.created_at) %></span>
<div class="fl sn-reply-usertxt ">
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => reply.id, :content=> reply.content} %>
<%#= reply.content.html_safe unless reply.content.nil? %>
</div>
<!--<a href="javascript:void(0)" target="_blank" class="sn-reply-zan fl">100</a>-->
<div class="cl"></div>
</div>
<% end %>
</div>
<% if count > 3 %>
<div class="sn-reply-more">
<a id="reply_btn_<%= @document.id %>" onclick="expand_reply('#newstyle_reply_div_<%= @document.id %>','#reply_btn_<%= @document.id%>')" data-count="<%= count %>" data-init="0" href="javascript:void(0)" value="show_help">
展开更多
</a>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<script>
$(document).ready(function(){
var replyCount = $(".sn-comment-listbox").size();
if (replyCount >3){
for(var i= 3; i < replyCount+1; i++){
$(".sn-comment-listbox").eq(i).hide();
}
}
});
function expand_reply(container, btnid) {
var target = $(container).children();
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 regexName_submain(content) {
var name = $.trim($("#name").val());
if (name.length == 0) {
$("#project_name_span").text(content);
$("#project_name_span").css('color', '#ff0000');
$("#project_name_span").focus();
return false;
}
else {
$("#project_name_span").text("");
return true;
}
}
function org_new_files_upload(){
var name = $.trim($("#text_submain").val());
// content = $("#text_submain").val();
if (name.length == 0) {
$("#sub_domain_reply").show();
}
else {
$("#message_form").submit();
}
}
</script>

View File

@ -1,72 +1,75 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"create_kindeditor",'blog' %>
<script>
$(function() {
sd_create_editor_from_data(<%= @document.id%>,null,"100%", "<%=@document.class.to_s%>");
showNormalImage('message_description_<%= @document.id %>');
});
</script>
<div class="resources" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>;" id="organization_document_<%= @document.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo">
<%= link_to User.find(@document.creator_id), user_url_in_org(@document.creator_id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %>
|
<% if @document.organization.home_id == @document.id %>
<span style="color:#269ac9;">首页</span>
<% else %>
<span style="color:#269ac9;">组织文章</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">
发布时间:<%= format_activity_day(@document.created_at) %> <%= format_time(@document.created_at, false) %></div>
<% unless @document.content.blank? %>
<div class="homepagePostIntro" style="width:640px;" id="intro_content_<%= @document.id%>">
<%= @document.content.html_safe %>
<% if @organization.switch_type %>
<%= render :partial => 'show_custom_org_document_comment' %>
<% else %>
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"create_kindeditor",'blog' %>
<script>
$(function() {
sd_create_editor_from_data(<%= @document.id%>,null,"100%", "<%=@document.class.to_s%>");
showNormalImage('message_description_<%= @document.id %>');
});
</script>
<div class="resources" style="margin-top:<%= User.current.logged? ? '0px':'10px' %>;" id="organization_document_<%= @document.id %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(User.find(@document.creator_id)), :width => 45, :heigth => 45), user_url_in_org(@document.creator_id) %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo">
<%= link_to User.find(@document.creator_id), user_url_in_org(@document.creator_id), :class => "newsBlue mr15" %>
TO&nbsp;&nbsp;<%= link_to @document.organization.name, organization_path(@document.organization), :class => "newsBlue" %>
|
<% if @document.organization.home_id == @document.id %>
<span style="color:#269ac9;">首页</span>
<% else %>
<span style="color:#269ac9;">组织文章</span>
<% end %>
</div>
<% end %>
<div class=" fl">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @document} %>
<%#= link_to_attachments_course @document, :author => false %>
</div>
<!-- <%# if defined?(home_id) %>
<div class="homepagePostTitle postGrey"><%= link_to @document.title, org_document_comment_path(:id => @document.id, :organization_id => @document.organization.id) %></div>
<div class="homepagePostDate">
发布时间:<%= format_activity_day(@document.created_at) %> <%= format_time(@document.created_at, false) %></div>
<% unless @document.content.blank? %>
<div class="homepagePostIntro" style="width:640px;" id="intro_content_<%= @document.id%>">
<%= @document.content.html_safe %>
</div>
<% end %>
<div class=" fl">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @document} %>
<%#= link_to_attachments_course @document, :author => false %>
</div>
<!-- <%# if defined?(home_id) %>
<div style="float:right;">最后编辑:<%#= User.find() %></div>
<%# end %>-->
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(@document.organization_id) || User.current.id == @document.creator_id) %>
<div class="homepagePostSetting">
<ul>
<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>
<% end %>
</li>
<li>
<%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :flag => 1), :class => "postOptionLink" %>
</li>
<li>
<%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :detail_page => 1), :method => 'delete',
:data => {:confirm => l(:text_are_you_sure)},
:remote => true, :class => 'postOptionLink' %>
<% if User.current.admin? || User.current.admin_of_org?(Organization.find(@document.organization_id) || User.current.id == @document.creator_id) %>
<div class="homepagePostSetting">
<ul>
<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>
<% end %>
</li>
<li>
<%= link_to "编辑文章", edit_org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :flag => 1), :class => "postOptionLink" %>
</li>
<li>
<%= link_to "删除文章", org_document_comment_path(:id => @document.id, :organization_id => @document.organization_id, :detail_page => 1), :method => 'delete',
:data => {:confirm => l(:text_are_you_sure)},
:remote => true, :class => 'postOptionLink' %>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="cl"></div>
<% end %>
</div>
</div>
<% comments_for_doc = @document.children.reorder("created_at desc") %>
<% count = @document.children.count() %>
</div>
<div class="cl"></div>
<% end %>
</div>
</div>
<% comments_for_doc = @document.children.reorder("created_at desc") %>
<% count = @document.children.count() %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= @document.id %>">
<%# if count > 0 %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= @document.id %>">
<%# if count > 0 %>
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
<sapn class="mr15"><%= count>0 ? "#{count}" : "" %></sapn><span style="color: #cecece;">▪</span>
@ -123,50 +126,51 @@
<% end %>
</div>
<div class="cl"></div>
<%# end %>
<%# if User.current.logged?%>
<%# end %>
<%# if User.current.logged?%>
<div class="talkWrapMsg" nhname="about_talk_reply">
<em class="talkWrapArrow"></em>
<div class="cl"></div>
<div class="talkConIpt ml5 mb10" id="reply<%= @document.id %>">
<%= form_for :org_comment, :url => {:action => 'add_reply_in_doc',:controller => 'org_document_comments', :id => @document.id}, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%= f.kindeditor :org_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor' %>
<%= f.kindeditor :org_content,:width=>'99%',:height => '100px;',:editor_id=>'message_content_editor' %>
<%= link_to l(:button_cancel), "javascript:void(0)", :onclick => 'message_content_editor.html("");', :class => " grey_btn fr c_white mt10 mr5" %>
<%= link_to l(:button_reply), "javascript:void(0)", :onclick => "message_content_editor.sync();$('#message_form').submit();", :class => "blue_btn fr c_white mt10 mb10", :style => "margin-right: 5px;" %>
<% end %>
<div class="cl"></div>
</div>
</div>
<%# end %>
</div>
</div>
<%# end %>
</div>
</div>
<script type="text/javascript">
$(function(){
$("#intro_content_<%= @document.id%> p,#intro_content_<%= @document.id%> span,#intro_content_<%= @document.id%> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
<script type="text/javascript">
$(function(){
$("#intro_content_<%= @document.id%> p,#intro_content_<%= @document.id%> span,#intro_content_<%= @document.id%> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
autoUrl('intro_content_<%= @document.id %>');
});
autoUrl('intro_content_<%= @document.id %>');
});
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) {
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();
}
}
}
</script>
</script>
<% end %>

View File

@ -16,7 +16,9 @@
<div class="block-title">资源</div>
</div>
</div>
<a href="javascript:void(0);" class="fr teacher-select" onclick="admin_hide_org($(this),'<%= container.id %>');" id="hide_<%= container.id %>"><%= container.class == Course ? (container.is_excellent == 0 ? "设为精品" : "取消精品") : (container.hot ==0 ? "设为热门" : "取消热门") %></a>
<% if User.current.admin? %>
<a href="javascript:void(0);" class="fr teacher-select" onclick="admin_hide_org($(this),'<%= container.id %>');" id="hide_<%= container.id %>"><%= container.class == Course ? (container.is_excellent == 0 ? "设为精品" : "取消精品") : (container.hot ==0 ? "设为热门" : "取消热门") %></a>
<% end %>
</div>
<div class="cl"></div>
</div>

View File

@ -63,8 +63,28 @@
<% end %>
</ul>
</div>
<% elsif field.field_type == "Comptec" %>
<li>
<%= link_to "#{field.name}", teachers_organization_path(@organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "sn-link-white", :target => "_blank" %>
</li>
<% elsif field.field_type == "Compstu" %>
<li>
<%= link_to "#{field.name}", students_organization_path(@organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "sn-link-white", :target => "_blank" %>
</li>
<% elsif field.field_type == "Comppro" %>
<li>
<%= link_to "#{field.name}", projects_organization_path(@organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "sn-link-white", :target => "_blank" %>
</li>
<% elsif field.field_type == "Compcou" %>
<li>
<%= link_to "#{field.name}", courses_organization_path(@organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "sn-link-white", :target => "_blank" %>
</li>
<% elsif field.field_type == "Compact" %>
<li>
<%= link_to "#{field.name}", acts_organization_path(@organization, :org_subfield_id => field.id), :class => "sn-link-white", :target => "_blank" %>
</li>
<% elsif field.field_type == "Resource" && field.hide == 0 %>
<li class="nav-element">
<li>
<%= link_to field.name, org_subfield_files_path(field), :class => "sn-link-white", :target => "_blank" %>
</li>
<% end %>

View File

@ -117,27 +117,23 @@
<a href="javascript:void(0);" class="homepageLeftMenuMoreIcon" onclick="$('#PostDomain_<%= field.id %>').slideToggle();" style="border-bottom: 1px solid #ddd;"></a>
</li>
<% end %>
<% elsif field.field_type == "Comptec" && User.current.admin? %>
<% elsif field.field_type == "Comptec" %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<%= link_to "#{field.name}", teachers_organization_path(organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Compstu" && User.current.admin? %>
<% elsif field.field_type == "Compstu" %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Compstu" && User.current.admin? %>
<% elsif field.field_type == "Comppro" %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", students_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<%= link_to "#{field.name}", projects_organization_path(organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Comppro" && User.current.admin? %>
<% elsif field.field_type == "Compcou" %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", projects_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<%= link_to "#{field.name}", courses_organization_path(organization, :org_subfield_id => field.id, :type => "#{User.current.admin? ? "" : "famous"}"), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Compcou" && User.current.admin? %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", courses_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>
<% elsif field.field_type == "Compact" && User.current.admin? %>
<% elsif field.field_type == "Compact" %>
<div class="homepageLeftMenuBlock">
<%= link_to "#{field.name}", acts_organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
</div>

View File

@ -21,7 +21,7 @@
<div class="block-title">资源数</div>
</div>
</div>
<% if User.current.admin_of_org?(@organization) %>
<% if User.current.admin? %>
<a href="javascript:void(0);" class="fr teacher-select" onclick="hide($(this),'<%= org_student.id %>');" id="hide_<%= org_student.id %>"><%= org_student.excellent_student ==0 ? "设为学霸" : "取消设置" %></a>
<% end %>
</div>

View File

@ -28,15 +28,8 @@
<div class="block-title">资源数</div>
</div>
</div>
<% if User.current.admin_of_org?(@organization) %>
<% if User.current.admin? %>
<a href="javascript:void(0);" class="fr teacher-select" onclick="hide($(this),'<%= org_teacher.id %>');" id="hide_<%= org_teacher.id %>"><%= org_teacher.excellent_teacher==0?"设为名师":"取消设置" %></a>
<!--<a href="javascript:void(0);" class="fr teacher-select">设为名师</a>-->
<% else %>
<!--<%# if(org_teacher.watched_by?(User.current)) %>-->
<!--<%#= link_to "取消关注",watch_path(:object_type=> 'user',:object_id=>org_teacher.id,:target_id=>org_teacher.id),:class => "fr teacher-select", :method => "delete",:remote => "true", :title => "取消关注"%>-->
<!--<%# else %>-->
<!--<%#= link_to "添加关注",watch_path(:object_type=> 'user',:object_id=>org_teacher.id,:target_id=>org_teacher.id),:class => "fr teacher-select", :method => "post",:remote => "true", :title => "添加关注"%>-->
<!--<%# end %>-->
<% end %>
</div>
<div class="cl"></div>

View File

@ -0,0 +1,45 @@
<% if @subfield_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>
<% @subfield_acts.each do |act| %>
<% title = subfield_title_type(act) %>
<% time = subfield_time_type(act) %>
<% reply_count = subfield_reply_count_type(act) %>
<% document = act.org_act %>
<li>
<div class="sn-circle fl"></div>
<% if act.org_act_type == "OrgDocumentComment" %>
<%=link_to title, org_document_comment_path(act.org_act, :organization_id => @organization.id), :class => "sn-newslist-titile fl", :target => "_blank" %>
<% elsif act.org_act_type == "News" %>
<%=link_to title, news_path(act.org_act), :class => "sn-newslist-titile fl", :target => "_blank" %>
<% elsif act.org_act_type == "Message" %>
<%=link_to title, board_message_path(act.org_act.board.id, act.org_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

@ -115,17 +115,21 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
</div>
<div class="homepagePostReplyInputContainer">
<div nhname='new_message_<%= act.id %>' style="display:none;">
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
<div nhname='toolbar_container_<%= act.id %>'></div>
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
<% if User.current.logged? %>
<div nhname='new_message_<%= act.id %>' style="display:none;">
<%= form_for('new_form', :url => add_reply_org_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
<div nhname='toolbar_container_<%= act.id %>'></div>
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="org_content"></textarea>
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= act.id %>'></p>
<% end %>
</div>
<div class="cl"></div>
<p nhname='contentmsg_<%= act.id %>'></p>
<% end %>
</div>
<% else %>
<%= render :partial => "users/show_unlogged" %>
<% end %>
</div>
<div class="cl"></div>
</div>

View File

@ -89,7 +89,11 @@
<li class="orgListOperation">
<a href="javascript:void(0);" class="linkGrey fr ml5 mr10" onclick="hide($(this),'<%= field.id %>');" id="hide_<%= field.id %>"><%= field.hide==0?"隐藏":"可见" %></a>
<span class="fr">|</span>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %>
<% if (field.field_type == "Comptec" || field.field_type == "Compstu" || field.field_type == "Comppro" || field.field_type == "Compcou" || field.field_type == "Compact") && !User.current.admin? %>
<span class = "linkGrey fr ml5 mr5">默认</span>
<% else %>
<%= link_to "删除", org_subfield_path(field), :method => 'delete', :remote => true, :confirm => "您确定删除吗?", :class => "linkGrey fr ml5 mr5" %>
<% end %>
<span class="fr">|</span>
<a href="javascript:void(0);" class="linkGrey fr ml5 mr5" onclick="edit('#subfield_show_<%= field.id %>','#subfield_edit_<%= field.id %>');">编辑</a>
<% unless field.field_type == "Resource" || field.field_type == "Comptec" || field.field_type == "Compstu" || field.field_type == "Comppro" || field.field_type == "Compcou" || field.field_type == "Compact" %>

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

@ -1,3 +1,3 @@
$("#org_container_list").html('<%= escape_javascript( render :partial => 'organizations/org_container', :locals => {:containers => @containers})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#org_student_search").attr('href','<%= courses_organization_path(@organization, :type => @type) %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => true, :flag => true %>');
//$("#org_student_search").attr('href','<%#= courses_organization_path(@organization, :type => @type) %>');

View File

@ -1,3 +1,2 @@
$("#org_container_list").html('<%= escape_javascript( render :partial => 'organizations/org_container', :locals => {:containers => @containers})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#org_student_search").attr('href','<%= projects_organization_path(@organization, :type => @type) %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @container_count, :per_page_links => false, :remote => true, :flag => true %>');

View File

@ -1,6 +1,11 @@
<%# 区分两种模式 params[:org_subfield_id] 不为空的时候则跳到栏目%>
<% if @organization.switch_type && params[:org_subfield_id].nil? %>
<%= render :partial => 'show_custom' %>
<% if @organization.switch_type %>
<% if params[:org_subfield_id].nil? %>
<%= render :partial => 'show_custom' %>
<% else %>
<%#= 单个栏目模式二中显示 %>
<%= render :partial => 'show_custom_org_subfield' %>
<% end %>
<% else %>
<%= javascript_include_tag "jquery.infinitescroll.js" %>

View File

@ -1,3 +1,2 @@
$("#org_students_list").html('<%= escape_javascript( render :partial => 'organizations/org_students_list', :locals => {:org_students => @org_students})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @students_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#org_student_search").attr('href','<%= students_organization_path(@organization, :type => @type) %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @students_count, :per_page_links => false, :remote => true, :flag => true %>');

View File

@ -1,3 +1,2 @@
$("#org_teachers_list").html('<%= escape_javascript( render :partial => 'organizations/org_teachers_list', :locals => {:org_teachers => @org_teachers})%>');
$("#pages").html('<%= pagination_links_full @atta_pages, @teachers_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#org_teacher_search").attr('href','<%= teachers_organization_path(@organization, :type => @type) %>');
$("#pages").html('<%= pagination_links_full @atta_pages, @teachers_count, :per_page_links => false, :remote => true, :flag => true %>');

View File

@ -123,17 +123,20 @@
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33", :alt => "用户头像"), user_url_in_org(User.current.id) %>
</div>
<div class="homepagePostReplyInputContainer">
<div nhname='new_message_<%= act.id %>' style="display:none;">
<%= form_for('new_form', :url => add_reply_org_subfield_sub_domain_sub_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
<div nhname='toolbar_container_<%= act.id %>'></div>
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="sub_content"></textarea>
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= act.id %>'></p>
<% end %>
</div>
<% if User.current.logged? %>
<div nhname='new_message_<%= act.id %>' style="display:none;">
<%= form_for('new_form', :url => add_reply_org_subfield_sub_domain_sub_document_comment_path(:id => document.id, :act_id => act.id, :flag => flag), :method => "post", :remote => true) do |f| %>
<input type="hidden" name="org_activity_id" value="<%= act.id %>"/>
<div nhname='toolbar_container_<%= act.id %>'></div>
<textarea placeholder="有问题或建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= act.id %>' name="sub_content"></textarea>
<a id="new_message_submit_btn_<%= act.id %>" href="javascript:void(0)" class="blue_n_btn fr" style="display:none;margin-top:6px;line-height:18px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= act.id %>'></p>
<% end %>
</div>
<% else %>
<%= render :partial => "users/show_unlogged" %>
<% end %>
</div>
<div class="cl"></div>
</div>

View File

@ -0,0 +1,3 @@
<div class="visitor-box fontGrey2">
<%= link_to "登录", signin_path, :class => "linkBlue", :target => "_blank" %>后可添加回复
</div>

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 @@
$("#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,6 +546,7 @@ 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'
end

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,8 @@
class DeleteAnonymousOrg < ActiveRecord::Migration
def up
OrgDocumentComment.where(:organization_id => 23, :creator_id => 2).delete_all
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 => 20160601073753) do
ActiveRecord::Schema.define(:version => 20160606064856) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false

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

@ -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

@ -1619,3 +1619,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

@ -178,3 +178,6 @@ a.teacher-select {font-size:13px; color:#fff; padding:3px 18px; background-color
a.teacher-select:hover {background-color:#297fb8;}
a.follow-button {font-size:13px; color:#272727; padding:3px 5px; background-color:#f2efef;}
a.follow-button:hover {background-color:#c1c1c1;}
/*组织未登录提示*/
.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;}

View File

@ -1,14 +1,6 @@
@charset "utf-8";
/* CSS Document */
/* 样式重置 */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.9; background:#f2f2f2;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;cellspacing:0; cellpadding:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{color:#000;text-decoration:none;}
a:hover,a:active{color:#24366e;}
.sn-fl {float:left;}
.sn-fr {float:right;}
.sn-cl {clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
@ -166,17 +158,17 @@ a.more-btn{ display:block; width:185px; height:30px; text-align:center; backgrou
/* 内页新闻列表 */
.sn-inner-body{ width:100%; background-color:#fff;}
.sn-innner-content{ width:1200px; margin:0 auto;}
.sn-innner-content{ width:1000px; margin:0 auto;}
.sn-inner-newsh2{ font-size:20px; font-weight:normal; padding-bottom:5px; border-bottom:1px dashed #eee;}
.sn-circle{ margin:18px 5px 0 5px ;border:1px solid #24366e; width:5px; height:5px; -webkit-border-radius:50px; -moz-border-radius:50px; -o-border-radius:50px; border-radius:50px; }
.sn-inner-newslist ul li{ line-height:42px; font-size:15px; border-bottom:1px solid #eee;}
.sn-inner-newslist a{font-size:15px; color:#888;}
.sn-inner-newslist a:hover{ color:#24366e;}
a.sn-newslist-titile{ font-size:15px;width:840px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
a.sn-newslist-titile{ font-size:15px;width:700px; display:block;overflow:hidden;white-space:nowrap; text-overflow:ellipsis;}
a:hover.sn-newslist-reply,a:hover.sn-newslist-zan{ color:#379be9;}
/* 内页新闻展示 */
.sn-inner-newscon{ width:1200px; padding:5px 0 50px; border-bottom:1px solid #e8e8e8; margin-bottom:30px; color:#999; font-size:14px; }
.sn-inner-newscon{ width:1000px; padding:5px 0 50px; border-bottom:1px solid #e8e8e8; margin-bottom:30px; color:#999; font-size:14px; }
.sn-inner-pcon{text-indent:2em; overflow:hidden;}
.sn-inner-newscon img{ display:block; max-width:830px; margin:25px auto 5px;}
.sn-inner-psmall{ color:#999; font-size:12px; margin-bottom:15px;}
@ -186,8 +178,8 @@ a:hover.sn-newslist-zan{ background:url(../images/zan.gif) 0 -21px no-repeat; }
/* 留言 */
.sn-replybox{ margin-bottom:100px;}
.sn-reply-h2{ font-size:18px; font-weight:normal; color:#24366e; margin-bottom:6px;}
.sn-reply-form{ width:1200px;height:180px; border:1px solid #e8e8e8; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; background:#fff; margin-bottom:20px; }
.sn-reply-text{ width:1200px; height:130px; background:#fff; border:none; resize:none;}
.sn-reply-form{ width:1000px;height:180px; border:1px solid #e8e8e8; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; background:#fff; margin-bottom:20px; }
.sn-reply-text{ width:1000px; height:130px; background:#fff; border:none; resize:none;}
.sn-reply-btnbox{border-top:1px solid #e8e8e8; height:48px;}
a.submit-btn{ display:block; color:#fff; text-align:center; font-size:14px; line-height:27px; width:79px; height:27px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px; background:#24366e; margin:8px 0 0 10px;}
a:hover.submit-btn{ color:#16275c; color:#fff;}
@ -196,10 +188,10 @@ a:hover.submit-btn{ color:#16275c; color:#fff;}
.sn-reply-userpic img{ width:40px; height:40px;-webkit-border-radius:50px; -moz-border-radius:50px; -o-border-radius:50px; border-radius:50px;}
a.sn-reply-zan{ display:block; background:url(../images/zan.gif) 0 4px no-repeat; width:54px; height:16px; padding-left:12px; color:#999; }
a:hover.sn-reply-zan{ background:url(../images/zan.gif) 0 -32px no-repeat; }
.sn-comment-listbox{ padding:23px 0; width:1200px;border-bottom:1px solid #e8e8e8;}
.sn-comment-listbox{ padding:23px 0; width:1000px;border-bottom:1px solid #e8e8e8;}
a.sn-reply-username { color:#24366e; margin-right:15px; }
.sn-reply-usertxt{ width:1145px; font-size:14px; }
.sn-reply-more{ width:1200px; height:25px; background:#ddd; text-align:center; line-height:25px;}
.sn-reply-usertxt{ width:945px; font-size:14px; }
.sn-reply-more{ width:1000px; height:25px; background:#ddd; text-align:center; line-height:25px;}
/*用户图像*/
.topnav_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 1px;}

View File

@ -1149,3 +1149,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;}

View File

@ -1,4 +1,7 @@
#RSide{ min-height:1px;}
/* 左侧信息*/
.users_info{background:#fff; padding:10px; width:230px; padding-right:0px; margin-bottom:10px; }
.pic_head{ width:214px; height:214px; border:1px solid #cbcbcb; padding:2px; position:relative;}