Merge branch 'szzh' into develop

This commit is contained in:
huang 2015-10-10 14:33:03 +08:00
commit b053f16f0f
34 changed files with 425 additions and 301 deletions

View File

@ -134,8 +134,12 @@ class FilesController < ApplicationController
if sort == ""
sort = "created_on DESC"
end
if keywords != "%%"
resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' AND filename LIKE :like ", like: "%#{keywords}%").
reorder(sort)
else
resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' "). reorder(sort)
end
#resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC")
end
@ -547,7 +551,7 @@ class FilesController < ApplicationController
q = "%#{@q.strip}%"
@result = find_course_attache q,@course,sort
@result = visable_attachemnts @result
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)}
@result = @result.select{|attachment| attachment.tag_list.include?(@tag_name)} unless @tag_name.blank?
@searched_attach = paginateHelper @result,10
@tag_list = get_course_tag_list @course

View File

@ -113,12 +113,8 @@ class IssuesController < ApplicationController
def show
# 当前用户查看指派给他的缺陷消息,则设置消息为已读
query = @issue.forge_messages
query.each do |m|
if m.user_id == User.current.id
m.update_attribute(:viewed, true)
end
end
query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first
query.update_attribute(:viewed, true) unless query.nil?
# 缺陷状态更新
query_journals = @issue.journals
query_journals.each do |query_journal|

View File

@ -382,7 +382,10 @@ class ProjectsController < ApplicationController
end
else
email = params[:mail]
Mailer.send_invite_in_project(email, @project, User.current).deliver
first_name = params[:first_name]
last_name = params[:last_name]
gender = params[:gender]
Mailer.send_invite_in_project(email, @project, User.current, first_name, last_name, gender).deliver
@is_zhuce = false
flash[:notice] = l(:notice_email_sent, :value => email)
end
@ -656,14 +659,10 @@ class ProjectsController < ApplicationController
# Delete @project
def destroy
@project_to_destroy = @project
if api_request? || params[:confirm]
@project_to_destroy.destroy
respond_to do |format|
format.html { redirect_to admin_projects_url }
format.api { render_api_ok }
end
else
render :layout => "base_projects"
@project_to_destroy.destroy
respond_to do |format|
format.html { redirect_to admin_projects_url }
format.api { render_api_ok }
end
# hide project in layout
@project = nil

View File

@ -244,13 +244,18 @@ class TagsController < ApplicationController
@taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type) unless @taggable_id.blank?
@obj = get_object(@taggable_id,params[:taggableType]) unless @taggable_id.blank?
if @taggable_id.blank? #如果没有传tag_id那么直接更新tag_name就好了。但是要防止 重命名后的tag存在。
#看重命名后的tag是否存在。如果存在的话只需要更改taggings里边的id,
if @rename_tag
@taggings = ActsAsTaggableOn::Tagging.where(" `taggings`.`tag_id` = #{ @tag_id} AND `taggings`.`taggable_type` = 'Attachment' ")#find_by_tag_id_and_taggable_type(@tag_id,@taggable_type)
@taggings.each { |t| t.update_attributes({:tag_id=> @rename_tag.id}) if t.tag_id != @rename_tag.id }
ActsAsTaggableOn::Tag.find(@tag_id).update_attributes(:name=>@rename_tag_name)#并且将该tag改名
else #如果不存在那么就直接更新该tag名称为新的名称
(ActsAsTaggableOn::Tag.find_by_name(@tag_name)).update_attributes(:name=>@rename_tag_name)
if @course_id
course = Course.find @course_id
if course
course.attachments.each do |attachment|
taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,attachment.id,attachment.class)
if taggings
taggings.delete
attachment.tag_list.add(@rename_tag_name.split(","))
attachment.save
end
end
end
end
else
if(@rename_tag.nil?) #这次命名的是新的tag

View File

@ -112,7 +112,7 @@ class UsersController < ApplicationController
case params[:type]
when nil
@message_alls = []
messages = MessageAll.where("user_id =?" ,@user).order("created_at desc")
messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user, "SystemMessage", "SystemMessage").order("created_at desc")
messages.each do |message_all|
@message_alls << message_all.message
end
@ -121,49 +121,37 @@ class UsersController < ApplicationController
messages = MessageAll.where("user_id =?", @user).order("created_at desc")
messages.each do |message_all|
# 在点击或者刷新消息列表后未读的消息存放在数组
if message_all.message.viewed == 0
if message_all.message_type != "SystemMessage" && message_all.message.viewed == 0
@message_alls << message_all.message
end
end
# when 'system_messages'
# @message_alls = SystemMessage.order("created_at desc").all
when 'apply'
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc")
#课程相关消息
when 'homework'
@message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage') and user_id =?", @user).order("created_at desc")
when 'course_message'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user).order("created_at desc")
# when 'forge_message'
# @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
# @message_alls_count = @message_alls.count
when 'course_news'
# 课程通知包含发布的通知和回复的通知
@message_alls = CourseMessage.where("course_message_type =? or course_message_type =?", "News", "Comment").where("user_id =?", @user).order("created_at desc")
#@user_course_messages_count = @user_course_messages.count
# when 'forge_news'
# @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "News", @user).order("created_at desc")
# @message_alls_count = @message_alls.count
# when 'course_news_reply'
# @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
# when 'forge_news_reply'
# @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Comment", @user).order("created_at desc")
# @message_alls_count = @message_alls.count
# when 'poll'
# @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
# @message_alls_count = @message_alls.count
# when 'works_reviewers'
# @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "StudentWorksScore", @user).order("created_at desc")
# @message_alls_count = @message_alls.count
# when 'works_reply'
# @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
# @message_alls_count = @message_alls.count
when 'poll'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user).order("created_at desc")
#项目相关消息
when 'issue'
@message_alls = ForgeMessage.where("forge_message_type =? or forge_message_type =?" , "Issue", "Journal").where("user_id=?", @user).order("created_at desc")
# when 'issue_update' # 缺陷状态更新、留言
# @message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Journal", @user).order("created_at desc")
# @message_alls_count = @message_alls.count
when 'forge_message'
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?", "Message", @user).order("created_at desc")
when 'forge_news'
@message_alls = ForgeMessage.where("forge_message_type in (?,?) and user_id =?", "News", "Comment", @user).order("created_at desc")
when 'apply'
@message_alls = ForgeMessage.where("forge_message_type in ('ProjectInvite', 'AppliedProject') and user_id =?", @user).order("created_at desc")
#贴吧消息
when 'forum'
@message_alls = MemoMessage.where("memo_type =? and user_id =?", "Memo", @user).order("created_at desc")
#用户留言
when 'user_feedback'
@message_alls = UserFeedbackMessage.where("journals_for_message_type =? and user_id =?", "JournalsForMessage", @user).order("created_at desc")
else
@ -187,12 +175,8 @@ class UsersController < ApplicationController
message_new_time.onclick_time = Time.now
message_new_time.save
else
# 24小时内显示
contrast_time = Time.now - 86400
message_time.update_attributes(:onclick_time => Time.now)
end
# 24小时内显示系统消息
@user_system_messages = SystemMessage.where("created_at >?", contrast_time).order("created_at desc")
end
# 消息设置为已读

View File

@ -107,7 +107,7 @@ class Mailer < ActionMailer::Base
# author: alan
# 邀请未注册用户加入项目
# 功能: 在加入项目的同时自动注册用户
def send_invite_in_project(email, project, invitor)
def send_invite_in_project(email, project, invitor, first_name, last_name, gender)
@email = email
@subject = "#{invitor.name} #{l(:label_invite_project)} #{project.name} "
@password = newpass(6)
@ -116,7 +116,7 @@ class Mailer < ActionMailer::Base
login = login.sub(/%40/,'@')
us = UsersService.new
# 自动激活用户
user = us.register_auto(login, email, @password)
user = us.register_auto(login, email, @password, first_name, last_name, gender)
InviteList.create(:user_id => user.id, :project_id => project.id, :mail =>email)
User.current = user unless User.current.nil?
@user = user

View File

@ -5,4 +5,15 @@ class SystemMessage < ActiveRecord::Base
validates :subject, presence: true
# validates :description, presence: true
validates_length_of :description, maximum: 10000
has_many :message_alls, :class_name => 'MessageAll',:as =>:message, :dependent => :destroy
# 系统消息放置总消息列表
after_create :add_system_message
def add_system_message
if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
self.message_alls << MessageAll.new(:user_id => self.user_id)
end
end
end

View File

@ -47,12 +47,16 @@ class UsersService
end
# 自动注册功能 FOR邮件邀请
def register_auto(login,mail,password)
def register_auto(login, mail, password, first_name, last_name, gender)
mail_notification = "day"
@user = User.new
@user.admin = false
@user.register
@user.login = login
@user.mail = mail
@user.firstname = first_name
@user.lastname = last_name
@user.mail_notification = mail_notification
password_confirmation = password
should_confirmation_password = true
if !password.blank? && !password_confirmation.blank? && should_confirmation_password
@ -65,6 +69,7 @@ class UsersService
@user = automatically_register_lock(@user)
if @user.id != nil
ue = @user.user_extensions ||= UserExtensions.new
ue.gender = gender
ue.user_id = @user.id
ue.save
end

View File

@ -65,7 +65,7 @@
<%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %>
<%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %>
<%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %>
<%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del') %>
<%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del', :onClick=>"delcfm()" ) %>
</td>
</tr>
<% end %>
@ -74,3 +74,11 @@
</div>
<% html_title(l(:label_project_plural)) -%>
<script>
function delcfm() {
if (!confirm("删除项目会一并删除项目的关联信息,确认要删除吗?")) {
window.event.returnValue = false;
}
}
</script>

View File

@ -55,6 +55,7 @@
</div>
<div class="cl"></div>
<div class="tag_h">
<!-- container_type = 1 代表是课程里的资源 -->
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
</div>

View File

@ -44,6 +44,7 @@
</div>
<div class="cl"></div>
<div class="tag_h">
<!-- container_type = 2 代表是项目里的资源 -->
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6"} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6"} %>
</div>

View File

@ -1,13 +1,17 @@
<span class="files_tag_icon" >
<a title="双击可编辑"
onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(course)%>','','<%= @q%>','<%= course.id%>');"
>全部</a></span>
<% unless tag_list.nil?%>
<% tag_list.each do |k,v|%>
<% if tag_name && tag_name == k%>
<!-- 鼠标不能移动是因为 href="javascript:void(0);"导致的 -->
<span> <a class="files_tag_select" ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>×<%= v%></a></span>
<span> <a class="files_tag_select" ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>(<%= v%>)</a></span>
<% else%>
<span class="files_tag_icon" >
<a title="双击可编辑"
onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(course)%>','<%= k%>','<%= @q%>','<%= course.id%>');"
ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>×<%= v%></a></span>
ondblclick="rename_tag($(this),'<%= k %>','',<%= 6 %>);"><%= k%>(<%= v%>)</a></span>
<% end%>
<% end%>
<% end%>

View File

@ -246,36 +246,63 @@
tagId = id;
taggableType = type;
width = parseInt(domEle.css('width').replace('px','')) >=100 ? parseInt(domEle.css('width').replace('px','')) : 100
domEle.html('<input name="" id="renameTagName" maxlength="<%=Setting.tags_max_length%>" minlength="<%= Setting.tags_min_length%>" style="width:'+width +'px;" value="'+name+'"/>');
domEle.html('<input name="" id="renameTagName" maxlength="<%=Setting.tags_max_length%>" minlength="<%= Setting.tags_min_length%>" style="width:'+width +'px;" value="'+name+'"/>');
domEle.parent().css("border","1px solid #ffffff");
$("#renameTagName").focus();
}
//监听所有的单击事件
$(document.body).click(function(e){
isdb = false; //这是单击
node = document.elementFromPoint(e.clientX, e.clientY);
if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了
isdb = true; //为了防止在编辑的时候又去单击其他tag去过滤。导致tag过滤不可用
return;
}
if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
$(function(){
$("#renameTagName").live("blur",function(){
updateTagName();
}).live("keypress",function(e){
if (e.keyCode == '13') {
updateTagName();
}
});
});
}else{ //否则就要更新tag名称了
// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ 去掉询问
$.post(
'<%= update_tag_name_path %>',
{"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>}
)
// }else{
// ele.parent().css("border","");
// ele.parent().html(tagNameHtml);
// }
}
}
});
//执行修改TAGName方法
function updateTagName(){
if(isdb){
isdb = false;
if($("#renameTagName").val() == tagName){ //如果值一样,则恢复原来的状态
ele.parent().css("border","");
ele.parent().html(tagNameHtml);
}
else{
$.post(
'<%= update_tag_name_path %>',
{"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>}
);
}
}
}
// $(document.body).click(function(e){
// isdb = false; //这是单击
// node = document.elementFromPoint(e.clientX, e.clientY);
// if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了
// isdb = true; //为了防止在编辑的时候又去单击其他tag去过滤。导致tag过滤不可用
// return;
// }
// if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
// if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
// ele.parent().css("border","");
// ele.parent().html(tagNameHtml);
//
// }else{ //否则就要更新tag名称了
//// if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){ 去掉询问
// $.post(
// '<%= update_tag_name_path %>',
// {"taggableId": tagId, "taggableType": taggableType, "tagName": tagName, "renameName": $("#renameTagName").val().trim(),"courseId":<%= @course.id%>}
// )
//// }else{
//// ele.parent().css("border","");
//// ele.parent().html(tagNameHtml);
//// }
// }
// }
// });
<%end %>
</script>

View File

@ -21,6 +21,7 @@
<div class="postDetailReply">
<a href="<%= forum_memo_path(topic.forum, topic)%>" class="postReplyIcon mr5" target="_blank"></a>
<%= link_to (topic.replies_count), forum_memo_path(topic.forum, topic),:target =>'_blank',:class=>'linkGrey2' %>
<a href="javascript:void(0);" class="linkGrey2 disablePostLikeIcon ml10 mt20" style="cursor: default" title="点赞人数" > <%= get_praise_num(topic)%></a>
</div>
<div class="cl"></div>
</div>

View File

@ -5,15 +5,15 @@
<div class="fl">
<ul>
<li class="navHomepageMenu fl">
<%= link_to "首页",user_activities_path(User.current.id), :class => "c_white f16 db"%>
<%= link_to "首页",user_activities_path(User.current.id), :class => "c_white f16 db p10"%>
</li>
<li class="navHomepageMenu fl">
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>User.current.id,:type=>1)%>" class="c_white f16 db">资源库</a></li>
<a href="<%=url_for(:controller => 'users', :action => 'user_resource',:id=>User.current.id,:type=>1)%>" class="c_white f16 db p10">资源库</a></li>
<li class="navHomepageMenu fl">
<%= link_to "作业", user_homeworks_user_path(User.current.id), :class => "c_white f16 db"%>
<%= link_to "作业", user_homeworks_user_path(User.current.id), :class => "c_white f16 db p10"%>
</li>
<li class="navHomepageMenu fl mr30">
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16 db">帮助中心</a>
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16 db p10">帮助中心</a>
</li>
</ul>
</div>
@ -112,7 +112,7 @@
$("#navHomepageSearchType").hide();
});
$("#user_avatar img").mouseenter(function(){
$("#navHomepageProfile").mouseenter(function(){
$("#homepageProfileMenuIcon").addClass("homepageProfileMenuIconhover");
$("#topnav_login_list").show();
});

View File

@ -1,95 +1,95 @@
<div class="navHomepage">
<div class="navHomepageLogo fl">
<%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), signin_path%>
</div>
<div class="fl">
<ul>
<li class="navHomepageMenu fl mr40">
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16">帮助中心</a>
</li>
</ul>
</div>
<script>
function search(doc){
//alert(1)
// val = $('input:radio[name="search_type"]:checked').val();
// alert(2)
// $("#search_type").val(val);
// alert(3)
$(doc).parent().submit();
}
<% type = type%>
$(function (){
if('<%= type %>' != null && '<%= type %>' == 'courses' ){
$('input:radio[value="courses"]').attr('checked','checked');
}
if('<%= type %>' != null && '<%= type %>' == 'projects' ){
$('input:radio[value="projects"]').attr('checked','checked');
}
if('<%= type %>' != null && '<%= type %>' == 'users' ){
$('input:radio[value="users"]').attr('checked','checked');
}
});
function search_in_header(obj){
var name = $.trim($('#navHomepageSearchInput').val());
if (name != "" && name.length != 0) {
$('#type').val($('input[type=radio]:checked').val());
obj.parent().submit();
}
}
function search_in_header_I(e,obj){
var name = $.trim($('#navHomepageSearchInput').val());
if (e.keyCode == '13' && name != "" && name.length != 0) {
$('#type').val($('input[type=radio]:checked').val());
obj.parent().submit();
}
}
</script>
<div class="fl" id="navHomepageSearch">
<!--<form class="navHomepageSearchBox">-->
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词进行搜索" onkeypress="search_in_header_I(event,$(this));"/>
<input type="hidden" name="search_type" id="type" value=""/>
<input type="text" style="display: none;"/>
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
<% end %>
<div class="navSearchTypeBox" id="navHomepageSearchType">
<div class="fl mr15 mt8">
<input type="radio" value="courses" name="search_type" checked/>
课程
</div>
<div class="fl mr15 mt8">
<input type="radio" value="projects" name="search_type" />
项目
</div>
<div class="fl mr15 mt8">
<input type="radio" value="users" name="search_type" />
用户
</div>
<div id="navSearchAlert" class="fr mr10">
<span class="c_red">请选择搜索类型</span>
</div>
</div>
</div>
<div id="loginInButton" class="fr ml20">
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a>
</div>
<div id="loginSignButton" class="fr">
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a>
</div>
</div>
<script type="text/javascript">
//搜索相关
$("#navHomepageSearch").mouseover(function(){
$("#navHomepageSearchType").show();
}).mouseout(function(){
$("#navHomepageSearchType").hide();
});
</script>
<div class="navHomepage">
<div class="navHomepageLogo fl">
<%=link_to image_tag("../images/nav_logo.png",width:"51px", height: "45px",class: "mt3"), signin_path%>
</div>
<div class="fl">
<ul>
<li class="navHomepageMenu fl mr40">
<a href="http://forge.trustie.net/forums/1/memos/1168" class="c_white f16 p10">帮助中心</a>
</li>
</ul>
</div>
<script>
function search(doc){
//alert(1)
// val = $('input:radio[name="search_type"]:checked').val();
// alert(2)
// $("#search_type").val(val);
// alert(3)
$(doc).parent().submit();
}
<% type = type%>
$(function (){
if('<%= type %>' != null && '<%= type %>' == 'courses' ){
$('input:radio[value="courses"]').attr('checked','checked');
}
if('<%= type %>' != null && '<%= type %>' == 'projects' ){
$('input:radio[value="projects"]').attr('checked','checked');
}
if('<%= type %>' != null && '<%= type %>' == 'users' ){
$('input:radio[value="users"]').attr('checked','checked');
}
});
function search_in_header(obj){
var name = $.trim($('#navHomepageSearchInput').val());
if (name != "" && name.length != 0) {
$('#type').val($('input[type=radio]:checked').val());
obj.parent().submit();
}
}
function search_in_header_I(e,obj){
var name = $.trim($('#navHomepageSearchInput').val());
if (e.keyCode == '13' && name != "" && name.length != 0) {
$('#type').val($('input[type=radio]:checked').val());
obj.parent().submit();
}
}
</script>
<div class="fl" id="navHomepageSearch">
<!--<form class="navHomepageSearchBox">-->
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
<input type="text" name="q" value="<%= name.nil? ? "" : name%>" id="navHomepageSearchInput" class="navHomepageSearchInput" placeholder="请输入关键词进行搜索" onkeypress="search_in_header_I(event,$(this));"/>
<input type="hidden" name="search_type" id="type" value=""/>
<input type="text" style="display: none;"/>
<a href="javascript:void(0);" class="homepageSearchIcon" onclick="search_in_header($(this));"></a>
<% end %>
<div class="navSearchTypeBox" id="navHomepageSearchType">
<div class="fl mr15 mt8">
<input type="radio" value="courses" name="search_type" checked/>
课程
</div>
<div class="fl mr15 mt8">
<input type="radio" value="projects" name="search_type" />
项目
</div>
<div class="fl mr15 mt8">
<input type="radio" value="users" name="search_type" />
用户
</div>
<div id="navSearchAlert" class="fr mr10">
<span class="c_red">请选择搜索类型</span>
</div>
</div>
</div>
<div id="loginInButton" class="fr ml20">
<a href="<%= signin_path(:login=>true) %>" class="c_white db">登录</a>
</div>
<div id="loginSignButton" class="fr">
<a href="<%= signin_path(:login=>false) %>" class="c_white db">注册</a>
</div>
</div>
<script type="text/javascript">
//搜索相关
$("#navHomepageSearch").mouseover(function(){
$("#navHomepageSearchType").show();
}).mouseout(function(){
$("#navHomepageSearchType").hide();
});
</script>

View File

@ -224,13 +224,15 @@
<%= link_to issues_journal.user, user_activities_url(issues_journal.user,:token => @token.value), :class => "wmail_name",
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_project_issue_update) %></span>
<% if issues_journal.notes.blank? || issues_journal.notes.nil? %>
<%= link_to truncate(issues_journal.issue.subject.html_safe, length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% else %>
<%= link_to truncate(issues_journal.notes.html_safe, length: 30,omission: '...'),issue_url(issues_journal.issue, :token => @token.value),
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% end %>
<%= link_to truncate(issues_journal.issue.subject, length:30,omission:'...'),issue_url(issues_journal.issue, :token => @token.value),
:style => "color:#2E8DD7;float:left;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))"
%>
<div style="display: none">
<div class="fl"><strong>更新内容:</strong></div>
<div class="ml60"><%= issues_journal.notes.html_safe %></div>
</div>
<span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(issues_journal.created_on) %></span>
</li>
<% end %>
@ -290,9 +292,9 @@
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_wiki_mail_notification) %></span>
<% unless wikicontent.page.nil? %>
<%= link_to truncate(wikicontent.text.html_safe, length: 30,omission: '...'), project_wiki_url(wikicontent.page.wiki,:token => @token.value),
<%= link_to wikicontent.text.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, project_wiki_url(wikicontent.page.wiki,:token => @token.value),
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
:style => "color:#2E8DD7;float:left; max-width:400px;height:23px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<% end %>
<span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(wikicontent.updated_on) %></span>
</li>
@ -405,9 +407,9 @@
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"%>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_send_course_journals_for_messages) %></span>
<%= link_to truncate(project_journal_message.notes.html_safe,length: 30,omission: '...'), project_feedback_url(project_journal_message.project,:token => @token.value),
<%= link_to project_journal_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe, project_feedback_url(project_journal_message.project,:token => @token.value),
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; max-width:400px; max-height:30px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(project_journal_message.created_on) %></span>
</li>
@ -437,9 +439,9 @@
:style => "color:#2E8DD7; float:left;display:block; margin-right:5px; margin-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;" %>
<span class="wmail_txt" style="float:left; margin-right:5px;color:#ACAEB1;"><%= l(:label_show_your_message) %></span>
<%= link_to truncate(user_journal_message.notes,length: 30,omission: '...'),feedback_url(@user,:token => @token.value),
<%= link_to user_journal_message.notes.gsub("<p>","").gsub("</p>","").gsub("<br />","").html_safe,feedback_url(@user,:token => @token.value),
:class => 'wmail_info',
:style => "color:#2E8DD7;float:left; font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
:style => "color:#2E8DD7;float:left; max-width:400px; max-height:30px;font-weight:normal;margin-right:5px; display:block;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;"
%>
<span class="wmail_date" style="color:#6e6e6e; float:left;display:block; margin-left:40px;"><%= format_time(user_journal_message.created_on) %></span></li>
@ -520,3 +522,15 @@
</div>
</div>
<script>
function message_titile_show(obj,e)
{
obj.next("div").show();
obj.next("div").css("top",e.pageY).css("left",e.pageX).css("position","absolute");
}
function message_titile_hide(obj)
{
obj.next("div").hide();
}
</script>

View File

@ -44,9 +44,39 @@
}
function verifyLastName() {
var last_name = $.trim($('#last_name').val());
if(last_name.length > 30)
{
$("#valid_email").text("用户姓氏过长,最长为30个字符");
return false;
}
else
{
$("#valid_email").text("");
return true;
}
}
function verifyFirstName() {
var first_name = $.trim($('#first_name').val());
if(first_name.length > 30)
{
$("#valid_email").text("用户名字过长,最长为30个字符");
return false;
}
else
{
$("#valid_email").text("");
return true;
}
}
function senderEmail(obj)
{
if(verifyAddress())
if(verifyAddress() && verifyFirstName() && verifyLastName() )
{
obj.parent().submit();
}
@ -79,6 +109,15 @@
<li>
<%= text_field_tag 'mail', '', :class => "fb_item fl", :placeholder => l(:label_input_email), :onkeyup => "this.value=this.value.replace(' ','')", :style => "ime-mode:disabled;", :onblur => "verifyAddress(this);" %>
</li>
<li>
<%= text_field_tag 'last_name', '', :class => "fb_item_first_name fl", :placeholder => l(:label_input_email_lastname), :onkeyup => "this.value=this.value.replace(' ','')", :onblur => "verifyLastName(this);" %>
</li>
<li>
<%= text_field_tag 'first_name', '', :class => "fb_item_last_name fl", :placeholder => l(:label_input_email_firstname), :onkeyup => "this.value=this.value.replace(' ','')", :onblur => "verifyFirstName(this);" %>
</li>
<li>
<select class="fb_item_gender fl" id="gender" name="gender"><option value="">性别</option><option value="0">男</option><option value="1">女</option></select>
</li>
</ul>
<div class="cl"></div>
<a href="#" class="btn_free" onclick="senderEmail($(this));">

View File

@ -46,7 +46,7 @@
) do |f| %>
<% roles.each do |role| %>
<ul style="text-align: left;" >
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
<%= radio_button_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
<!--编辑时候显示成员,中英文切换后面需从数据库的角度优化-->
<% if User.current.language == "zh" %>
@ -64,11 +64,11 @@
<!--<br/>-->
<% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %>
<div>
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<div class="pt5">
<a href="javascript:void(0)" class="project_member_btn" onclick="$('#member-<%= member.id%>-roles-form').submit();" style="margin-right: 10px;">
<%= l(:button_change)%>
</a>
<a href="javascript:void(0)" class="member_btn" onclick="$('#member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(30)">
<a href="javascript:void(0)" class="project_member_btn" onclick="$('#member-<%= member.id%>-roles-form').hide();$(this).parent().parent().parent().parent().height(30)">
<%= l(:button_cancel)%>
</a>
</div>
@ -138,7 +138,7 @@
</li>
<% roles.each do |role| %>
<li>
<%= check_box_tag 'membership[role_ids][]', role.id %>
<%= radio_button_tag 'membership[role_ids][]', role.id %>
<% if User.current.language == "zh" %>
<% if role.id == 3 %>
<label >管理人员</label>
@ -154,7 +154,7 @@
<% end %>
</ul>
<div class="cl mb10"></div>
<a href="javascript:void(0)" class="member_btn" onclick="$(this).parent().parent().submit();">
<a href="javascript:void(0)" class="project_member_btn_right" onclick="$(this).parent().parent().submit();">
新增成员
</a>
</div>

View File

@ -2,8 +2,8 @@
<% if @tags.size > 0 %>
<% @tags.each do |tag| %>
<span class="re_tag f_l" style="cursor: pointer" > <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<a title="双击可编辑" ondblclick="rename_tag($(this),'<%= tag %>',<%= obj.id%>,<%= object_flag%>);"><%= tag %></a>
<span class="re_tag f_l" style="cursor:<%= obj.container_type == 'Course' ? 'pointer' :'default' %> " > <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
<a title="<%= obj.container_type == 'Course' ? '双击可编辑' : '' %> " ondblclick="rename_tag($(this),'<%= tag %>',<%= obj.id%>,<%= object_flag%>);"><%= tag %></a>
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
<% case object_flag %>
<% when '10' %>

View File

@ -10,7 +10,7 @@
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO
<%= link_to activity.project.name.to_s+" | 项目缺陷", project_issues_path(activity.project), :class => "newsBlue ml15"%>
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div>
<div class="homepagePostTitle break_word">
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey" %>

View File

@ -191,8 +191,10 @@
<div style="display: none" class="message_title_red system_message_style">
<p>
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher, ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败,作业详情如下:
<%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败,
失败原因提交作品的人数低于2人
</p>
<p>作业详情如下:</p>
<p>课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
<p>作业标题:<span style="color:Red;"><%= ma.course_message.name %></span></p>
</div>

View File

@ -0,0 +1,30 @@
<% if ma.class == SystemMessage %>
<%# @user_system_messages.each do |usm| %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span>
</li>
<span style="color: red;float: left">【系统消息】</span>
<li class="homepageSystenMessageContent fl">
<%= link_to ma.subject.blank? ? (ma.content.nil? ? ma.description.html_safe : ma.content.html_safe) : ma.subject, user_system_messages_path(User.current),
:id => "content_link_#{ma.id}",
:onmouseover =>"message_titile_show($(this),event);",
:onmouseout => "message_titile_hide($(this));"
%>
</li>
<div style="display:none;" class="message_title_red system_message_style">
<% unless ma.subject.blank? %>
<p><strong>标题:</strong><%= ma.subject %></p>
<% end %>
<% if (!ma.description.blank?) || (!ma.content.blank?) %>
<div class="fl"><strong>内容:</strong></div><div class="ml36"><%= ma.description.nil? ? ma.content.html_safe : ma.description.html_safe %></div>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<%# end %>
<% end %>

View File

@ -2,37 +2,39 @@
<div class="NewsBannerName"><%= title_for_message(params[:type]) %></div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="newsType">
<li><%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %></li>
<li><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %></li>
<li><%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %></li>
<%# 课程相关消息 %>
<li><%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %></li>
<li><%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %></li>
<li><%= link_to "课程通知",user_message_path(User.current, :type => 'course_news'), :class => "resourcesGrey" %></li>
<!--<li><%#= link_to "通知回复", user_message_path(User.current, :type => 'course_news_reply'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "课程问卷", user_message_path(User.current, :type => 'poll'), :class => "resourcesGrey" %></a></li>-->
<!--<li><%#= link_to "作品评阅", user_message_path(User.current, :type => 'works_reviewers'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "作品讨论", user_message_path(User.current, :type => 'works_reply'), :class => "resourcesGrey" %></li>-->
<%# 项目相关消息 %>
<li><%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "resourcesGrey" %></li>
<!--<li><%#= link_to "问题更新", user_message_path(User.current, :type => 'issue_update'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "项目讨论区", user_message_path(User.current, :type => 'forge_message'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "项目新闻", user_message_path(User.current, :type => 'forge_news'), :class => "resourcesGrey" %></li>-->
<!--<li><%#= link_to "新闻回复", user_message_path(User.current, :type => 'forge_news_reply'), :class => "resourcesGrey" %></li>-->
<%# 项目相关消息 %>
<li><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %></li>
<%# 系统贴吧 %>
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %></li>
<%# 系统消息 %>
<li><%= link_to "系统消息", user_system_messages_path(User.current), :class => "resourcesGrey" %></li>
<ul class="homepagePostType">
<li>
<ul class="homepagePostTypeHomework fl">
<li><%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %></li>
<li><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %></li>
<li><%= link_to "系统消息", user_system_messages_path(User.current), :class => "resourcesGrey" %></li>
<li><%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %></li>
<li><%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %></li>
<li><%= link_to "课程通知",user_message_path(User.current, :type => 'course_news'), :class => "resourcesGrey" %></li>
<li><%= link_to "课程问卷", user_message_path(User.current, :type => 'poll'), :class => "resourcesGrey" %></a></li>
</ul>
</li>
<li>
<ul class="homepagePostTypeProject fl">
<li><%= link_to "项目任务", user_message_path(User.current, :type => 'issue'), :class => "resourcesGrey" %></li>
<li><%= link_to "项目讨论", user_message_path(User.current, :type => 'forge_message'), :class => "resourcesGrey" %></li>
<li><%= link_to "项目新闻", user_message_path(User.current, :type => 'forge_news'), :class => "resourcesGrey" %></li>
<li><%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %></li>
<li><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %></li>
<%# 系统贴吧 %>
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="resources mt10" id="users_setting">
<div>
<% if @message_alls.count >0 || @user_system_messages.count >0 %>
<% if (!@message_alls.nil? && @message_alls.count >0) %>
<% if params[:type].nil? || params[:type] == "unviewed" %>
<div class="newsReadSetting">
有&nbsp;<span class="c_red"><%= unviewed_message(@user) %></span>&nbsp;条未读
@ -41,40 +43,13 @@
<% end %>
</div>
<% end %>
<%# 系统消息 %>
<% if params[:type] != 'system_messages' %>
<% @user_system_messages.each do |usm| %>
<ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl">
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %></div></a>
</li>
<li class="homepageNewsPubType fl">
<span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span>
</li>
<span style="color: red;float: left">【系统消息】</span>
<li class="homepageSystenMessageContent fl">
<%= link_to usm.subject.blank? ? (usm.content.nil? ? usm.description.html_safe : usm.content.html_safe) : usm.subject, user_system_messages_path(User.current),
:id => "content_link_#{usm.id}",
:onmouseover =>"message_titile_show($(this),event);",
:onmouseout => "message_titile_hide($(this));"
%>
</li>
<div style="display:none;" class="message_title_red system_message_style">
<% unless usm.subject.blank? %>
<p><strong>标题:</strong><%= usm.subject %></p>
<% end %>
<% if (!usm.description.blank?) || (!usm.content.blank?) %>
<div class="fl"><strong>内容:</strong></div><div class="ml36"><%= usm.description.nil? ? usm.content.html_safe : usm.description.html_safe %></div>
<% end %>
</div>
<li class="homepageNewsTime fl"><%= time_tag(usm.created_at).html_safe %> </li>
</ul>
<% end %>
<% end %>
<!--总消息列表-->
<% unless @message_alls.nil? %>
<% @message_alls.each do |ma| %>
<%# 系统消息 %>
<%= render :partial => 'users/user_message_system', :locals => {:ma => ma} %>
<%# 课程消息 %>
<%= render :partial => 'users/user_message_course', :locals => {:ma => ma} %>

View File

@ -2024,7 +2024,11 @@ zh:
label_end_time: 截止时间
label_send_email: 确定发送
label_input_email: 请输入邮箱地址
label_input_email: 请输入邮箱地址(必填)
label_input_email_firstname: 请输入用户名字(可选)
label_input_email_lastname: 请输入用户姓氏(可选)
label_input_email_gender: 请输入用户性别
#api end
project_module_files: 资源库

View File

@ -13,7 +13,7 @@ class Kindeditor::AssetsController < ApplicationController
logger.warn '========= Warning: the owner_id is 0, "delete uploaded files automatically" will not work. =========' if defined?(logger) && @asset.owner_id == 0
@asset.asset_type = @dir
if @asset.save
render :text => ({:error => 0, :url => @asset.asset.url,:asset_id => @asset.id}.to_json)
render :text => ({:error => 0, :url => "http://"+Setting.host_name + "/" + @asset.asset.url,:asset_id => @asset.id}.to_json)
else
show_error(@asset.errors.full_messages)
end

View File

@ -9,7 +9,8 @@ module RailsKindeditor
output << text_area_tag(name, content, input_html)
output << javascript_tag(js_replace(id, options.merge(window_onload: 'true',
:autoHeightMode=>true,
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})'
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})',
emotionsBasePath: 'http://' + Setting.host_name
)))
end
@ -21,7 +22,8 @@ module RailsKindeditor
output_buffer << build_text_area_tag(name, method, self, options, input_html)
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
:autoHeightMode=>true,
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})'
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})',
emotionsBasePath: 'http://' + Setting.host_name
)))
end

View File

@ -243,6 +243,7 @@ K.options = {
shadowMode : true,
loadStyleMode : true,
basePath : K.basePath,
emotionsBasePath: 'http://forge.trustie.net', //TODO
themesPath : K.basePath + 'themes/',
langPath : K.basePath + 'lang/',
pluginsPath : K.basePath + 'plugins/',
@ -5459,6 +5460,7 @@ function _editor(options) {
_instances = [];
function _create(expr, options) {
options = options || {};
options.emotionsBasePath = _undef(options.emotionsBasePath,'http://forge.trustie.net') // TODO
options.basePath = _undef(options.basePath, K.basePath);
options.themesPath = _undef(options.themesPath, options.basePath + 'themes/');
options.langPath = _undef(options.langPath, options.basePath + 'lang/');
@ -5623,7 +5625,9 @@ _plugin('core', function(K) {
url:K.addParam('/kindeditor/upload', 'dir=image'),
afterUpload : function(data) {
if (data.error === 0) {
var url = K.formatUrl(data.url, 'absolute');
var url = data.url//K.formatUrl(data.url, 'absolute');
// console.log(url)
self.exec('insertimage', url, 'image','','','1','');
//self.exec('insertimage', url, 'image','','','1','left');
//self.insertHtml('<img src="'+url+'"/>');

View File

@ -9,7 +9,8 @@
KindEditor.plugin('emoticons', function(K) {
var self = this, name = 'emoticons',
path = (self.emoticonsPath || self.pluginsPath + 'emoticons/images/'),
path = self.emotionsBasePath + (self.emoticonsPath || self.pluginsPath + 'emoticons/images/'),
allowPreview = self.allowPreviewEmoticons === undefined ? true : self.allowPreviewEmoticons,
currentPageNum = 1;
self.clickToolbar(name, function() {

View File

@ -4,7 +4,7 @@
.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;}
.navHomepage {width:1000px; height:54px; background-color:#269ac9; margin:0 auto;}
.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;}
.navHomepageMenu {margin-right:20px;display:inline-block;height:54px; line-height:54px; vertical-align:middle; padding:0px 10px;}
.navHomepageMenu {margin-right:20px;display:inline-block;height:54px; line-height:54px; vertical-align:middle;}
.navHomepageMenu:hover {background-color:#297fb8;}
.navHomepageSearchBoxcontainer {margin-top:11px; }
.navHomepageSearchBox {width:380px; border:none; outline:none; height:32px; margin-top:11px; background-color:#ffffff;}
@ -43,9 +43,9 @@ a.homepageImageNumber:hover {color:#15bccf;}
.homepageLeftMenuContainer {width:238px; border:1px solid #dddddd; border-bottom:none; background-color:#ffffff; margin-top:10px;}
.homepageLeftMenuBlock {border-bottom:1px solid #dddddd; height:50px; line-height:50px; vertical-align:middle;}
.homepageLeftMenuCourses {font-size:14px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {padding-left:25px; height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#b3e0ee;}
a.coursesLineGrey {color:#808080; display:block;}
a.coursesLineGrey {padding-left:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#b3e0ee;}

View File

@ -447,8 +447,8 @@ a.resourcesTypeUser {background:url(images/homepage_icon.png) -178px -453px no-r
/*.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#64bdd9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;}*/
/*.resourcesUploadBox:hover {background-color:#0781b4;}*/
/* 个人主页右边部分*/
.homepageSearchIcon {width:30px; height:32px; background:url(images/nav_icon.png) -8px 3px no-repeat; float:left;}
input.homepageSearchIcon:hover {cursor: pointer;background:url(../images/nav_icon.png) -49px 3px no-repeat;}
.homepageSearchIcon {width:30px; height:32px; background:url(images/nav_icon.png) -8px 3px no-repeat; float:left; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
input.homepageSearchIcon:hover {cursor: pointer;background:url(../images/nav_icon.png) -49px 3px no-repeat; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a.homepagePostTypeQuiz {background:url(images/homepage_icon.png) -90px -124px no-repeat; padding-left:23px;}
a.homepagePostTypeAssignment {background:url(images/homepage_icon.png) -93px -318px no-repeat; padding-left:23px;}
a.replyGrey {color:#888888; display:inline-block;}
@ -518,7 +518,7 @@ a.uploadIcon {background:url(images/resource_icon_list.png) 8px -60px no-repeat;
.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;}
.navHomepage {width:1000px; height:54px; background-color:#269ac9; margin:0 auto;}
.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;}
.navHomepageMenu {margin-right:20px;display:inline-block;height:54px; line-height:54px; vertical-align:middle; padding:0px 10px;}
.navHomepageMenu {margin-right:20px;display:inline-block;height:54px; line-height:54px; vertical-align:middle;}
.navHomepageMenu:hover {background-color:#297fb8;}
/*.navHomepageMenu:hover {background-color:#0ea6b7;}*/
.navHomepageSearchBoxcontainer {margin-top:11px; }
@ -549,7 +549,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-
.homepageImageSexMan {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;}
.homepageImageSexWomen {width: 20px;height: 20px;background: url(../images/homepage_icon.png) -10px -149px no-repeat;float: left;}
a.UsersEditBtn{ display:block; width:55px; height:20px; border:1px solid #6d6d6d; color:#fff; background:#888888 url(../images/homepage_icon.png) -11px -35px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.UsersEditBtn{ color:#484848; background:#888888 url(../images/homepage_icon.png) -11px -74px no-repeat;}
a:hover.UsersEditBtn{ color:#484848; background:#888888 url(../images/homepage_icon2.png) -11px -74px no-repeat;}
a.UsersAttBtn{ display:block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -9px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.UsersAttBtn{border:1px solid #888888; }
a.UsersApBtn{ display:block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -177px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
@ -564,9 +564,9 @@ a.homepageImageNumber:hover {color:#269ac9;}
.homepageLeftMenuContainer {width:238px; border:1px solid #dddddd; border-bottom:none; background-color:#ffffff; margin-top:10px;}
.homepageLeftMenuBlock {border-bottom:1px solid #dddddd; height:50px; line-height:50px; vertical-align:middle;}
.homepageLeftMenuCourses {font-size:13px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {padding-left:25px; height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#269ac9;}
a.coursesLineGrey {color:#808080; display:block;}
a.coursesLineGrey {padding-left:25px; color:#808080; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#269ac9;}
@ -802,18 +802,19 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
.postDetailDes p,div,em{word-break: break-all;word-wrap: break-word;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}
.postDetailReply { margin-top:28px; color:#888888; float:right;}
a.postReplyIcon {background:url(images/post_image_list.png) -40px 2px no-repeat; width:18px; height:18px; float:left;}
a.postReplyIcon:hover {background:url(images/post_image_list.png) -40px -29px no-repeat;}
.postDetailReply { margin-top:28px; color:#888888; float:right;display: inline}
.disablePostLikeIcon {background:url(images/post_image_list.png) 0px -42px no-repeat ;float:right; padding-left:18px; padding-right: 5px; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a.postReplyIcon {background:url(images/post_image_list.png) -40px 2px no-repeat; width:18px; height:18px; float:left; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a.postReplyIcon:hover {background:url(images/post_image_list.png) -40px -29px no-repeat; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
.postDetailInput {width:713px; height:28px; border:1px solid #d9d9d9; outline:none !important;}
.postAttIcon {background:url(images/post_image_list.png) 0px -91px no-repeat; width:16px; height:16px; padding-left:20px;}
.postAttIcon:hover {background:url(images/post_image_list.png) 0px -113px no-repeat;}
.postThemeContainer {width:720px;}
.postThemeWrap {width:655px; float:left;position: relative}
.postLikeIcon {background:url(images/post_image_list.png) 0px -42px no-repeat ;float:right; padding-left:18px; margin-top:3px;}
.postLikeIcon:hover {background:url(images/post_image_list.png) 0px -64px no-repeat ;}
a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888;}
a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repeat !important; color:#3598db;}
.postLikeIcon {background:url(images/post_image_list.png) 0px -42px no-repeat ;float:right; padding-left:18px; margin-top:3px; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
.postLikeIcon:hover {background:url(images/post_image_list.png) 0px -64px no-repeat ; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a.AnnexBtn{ background: url(images/homepage_icon2.png) 0px -343px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a:hover.AnnexBtn{background: url(images/homepage_icon2.png) -90px -343px no-repeat !important; color:#3598db; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
.postEdit {background:url(images/post_image_list.png) 0px -94px no-repeat; width:18px; height:18px; display:block; float:left;}
.postDelete {background:url(images/post_image_list.png) -42px -93px no-repeat; width:18px; height:18px; display:block; float:right;}
.pageBanner {width:968px; margin:0px auto; border:1px solid #dddddd; background-color: #FFF; padding: 10px 15px; float:left;}
@ -1065,7 +1066,7 @@ a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflo
.DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;}
a.UsersEditBtn{ display:block; width:55px; height:20px; border:1px solid #6d6d6d; color:#fff; background:#888888 url(../images/homepage_icon.png) -11px -35px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.UsersEditBtn{ color:#484848; background:#888888 url(../images/homepage_icon.png) -11px -74px no-repeat;}
a:hover.UsersEditBtn{ color:#484848; background:#888888 url(../images/homepage_icon2.png) -11px -74px no-repeat;}
a.UsersAttBtn{ display:block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -9px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}
a:hover.UsersAttBtn{border:1px solid #888888; }
a.UsersApBtn{ display:block; width:55px; height:20px; border:1px solid #d3d3d3; color:#888888; background:#f2f3f3 url(../images/homepage_icon2.png) -177px -6px no-repeat; padding-left:25px; line-height:1.9;-moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px;}

View File

@ -44,12 +44,12 @@ pre li,ul,ol {
/* Specify class=linenums on a pre to get line numbering */
ol.linenums { margin-top: 0; margin-bottom: 0;line-height: 15px;margin-left: 0px !important; } /* IE indents via margin-left */
.list_style ol li {
list-style-type: decimal;
margin-left: 10px !important;
}
/*.list_style ol li {*/
/*list-style-type: decimal;*/
/*margin-left: 10px !important;*/
/*}*/
.linenums li {
margin-left: 0px !important;
margin-left: 5px !important;
}
li.L0,
li.L1,

View File

@ -44,7 +44,10 @@ a:hover.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;}
.box_main02{ width:390px; margin:15px auto;}
.box_h3{ color:#15bccf; font-size:16px;}
.box_p{ color:#404040; margin-bottom:5px;}
.fb_item{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:5px; padding-left:5px; width:290px;}
.fb_item{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:5px; padding-left:5px; width:200px;}
.fb_item_first_name{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:5px; padding-left:5px; width:150px;margin-left: 10px;}
.fb_item_last_name{ color:#919191; border:1px solid #919191; height:28px; margin-bottom:5px; padding-left:5px; width:150px;margin-left: 10px;}
.fb_item_gender{ color:#919191; border:1px solid #919191; height:29px; margin-bottom:5px; padding-left:5px; width:58px;margin-left: 10px;}
a.icon_addm{ background:url(../images/img_floatbox.png) 0 -33px no-repeat; width:16px; height:16px; display:block; margin:5px 0 0 5px;}
a:hover.icon_addm{background:url(../images/img_floatbox.png) 0 -61px no-repeat; }
a.icon_removem{ background:url(../images/img_floatbox.png) -22px -33px no-repeat;width:16px; height:16px; display:block; margin:5px 0 0 5px}
@ -542,6 +545,8 @@ blockquote {
.member_search_btn{ background:#15bccf; color:#fff; text-align: center; width:40px; height:22px;border:1px solid #15bccf; padding-top:2px; cursor:pointer;}
.member_search_btn:hover{ background:#0da1b2; border:1px solid #0da1b2;}
a.member_btn{ padding:5px; background:#15bccf; color:#fff;}
a.project_member_btn{ padding:1px 5px; background:#15bccf; color:#fff;}
a.project_member_btn_right{ padding:2px 5px; background:#15bccf; color:#fff;}
a:hover.member_btn{ background:#329cbd;}
.pro_table{ text-align:center; color:#333; margin-bottom:20px;}
.pro_table tr td{ height:30px;}

View File

@ -114,6 +114,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mb10{ margin-bottom:10px !important;}
.mb20{ margin-bottom:20px;}
.pl15{ padding-left:15px;}
.pt5{ padding-top:5px;}
.w20{ width:20px;}
.w40{width: 40px;}
.w45{ width: 45px;}
@ -445,9 +446,9 @@ a.uploadIcon {background:url(../images/resource_icon_list.png) 8px -60px no-repe
.navHomepageSearchBoxcontainer {margin-top:11px; }
.navHomepageSearchBox {width:380px; border:none; outline:none; height:32px; background-color:#ffffff;}
.navHomepageSearchInput {width:345px; height:32px; outline:none; border:none; float:left; padding-left:5px;; margin:0;}
.homepageSearchIcon {width:30px; height:32px; background:url(../images/nav_icon.png) -8px 3px no-repeat; float:left;}
a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-repeat;}
.navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #98a1a6; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px; top:43px;}
.homepageSearchIcon {width:30px; height:32px; background:url(../images/nav_icon.png) -8px 3px no-repeat; float:left; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-repeat; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
.navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #98a1a6; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;}
#navSearchAlert {display:none;}
.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;}
.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;}
@ -478,9 +479,9 @@ a.homepageImageNumber:hover {color:#15bccf;}
.homepageLeftMenuContainer {width:238px; border:1px solid #dddddd; border-bottom:none; background-color:#ffffff; margin-top:10px;}
.homepageLeftMenuBlock {border-bottom:1px solid #dddddd; height:50px; line-height:50px; vertical-align:middle;}
.homepageLeftMenuCourses {font-size:14px; border-bottom:1px solid #dddddd;}
.homepageLeftMenuCoursesLine {padding-left:25px; height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine {height:38px; line-height:38px; vertical-align:middle;}
.homepageLeftMenuCoursesLine:hover {background-color:#b3e0ee;}
a.coursesLineGrey {color:#15bccf; display:block;}
a.coursesLineGrey {padding-left:25px; color:#15bccf; display:block;}
a.coursesLineGrey:hover {color:#ffffff;}
.homepageLeftMenuMore {height:18px;}
.homepageLeftMenuMore:hover {background-color:#b3e0ee;}