Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop

Conflicts:
	db/schema.rb
This commit is contained in:
cxt 2017-01-20 13:56:34 +08:00
commit 65bfaedb3a
63 changed files with 341 additions and 265 deletions

View File

@ -583,7 +583,7 @@ class ApplicationController < ActionController::Base
uri = URI.parse(back_url)
# do not redirect user to another host or to the login or register page
if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
back_url = back_url.gsub(%r{\/users\/(\d+)},"/users/"+default.id.to_s) if default.is_a?(User)
back_url = back_url.gsub(%r{\/users\/(\D+)},"/users/"+default.to_s) if default.is_a?(User)
redirect_to(back_url)
return
end

View File

@ -177,8 +177,7 @@ class BlogCommentsController < ApplicationController
reply_user_id = params[:reply_id].nil? ? @blogComment.blog.author_id: params[:reply_id].to_i
# 回复的作业与评论的作者不是同一人则发送消息
if ( params[:reply_id].nil? && @blogComment.author.id != @blogComment.blog.author_id )|| (!params[:reply_id].nil? && @blogComment.author.id != params[:reply_id].to_i)
BlogMessage.create(:user_id => reply_user_id, :blog_id => params[:blog_id].to_i, :content => params[:blog_comment][:content],
:blog_commont_id => @blogComment.id, :blog_message_type => "BlogComment", :user_operator_id => @blogComment.author.id)
BlogMessage.create(:user_id => reply_user_id, :blog_id => params[:blog_id].to_i, :content => params[:blog_comment][:content],:blog_message_id => @blogComment.id, :blog_message_type => "BlogComment", :user_operator_id => @blogComment.author.id)
end
respond_to do |format|
format.html {

View File

@ -278,6 +278,15 @@ class CoursesController < ApplicationController
@members = paginateHelper @members, @limit
end
# 显示/隐藏课程"开源检索"的入口
def open_or_close_os_interface
os_status = @course.os_allow == 0 ? 1 : 0
@course.update_attribute(:os_allow, os_status)
respond_to do |format|
format.js
end
end
def valid_ajax
req = Hash.new(false)
req[:message] = ''

View File

@ -58,7 +58,7 @@ class MembersController < ApplicationController
applied_project = @applied_message.applied
user = User.find(@applied_message.applied_user_id)
project = Project.find(applied_project.project_id) if !applied_project.nil?
if user.member_of?(project)|| AppliedMessage.where(:applied_id => @applied_message.applied_id, :status => 1).count == 0
if user.member_of?(project)|| AppliedMessage.where(:applied_id => @applied_message.applied_id, :status => 0).count == 0
@flash_message = "该申请已被其他管理员处理"
# @applied_message.update_attribute(:status, 2)
else
@ -77,7 +77,7 @@ class MembersController < ApplicationController
project.user_grades << user_grades unless user_grades.first.user_id.nil?
# 添加成功后所有管理员收到的消息状态都要更新
applied_messages = AppliedMessage.where(:applied_id => @applied_message.applied_id, :project_id => @applied_message.project_id, :status => 1,
applied_messages = AppliedMessage.where(:applied_id => @applied_message.applied_id, :project_id => @applied_message.project_id, :status => 0,
:applied_type => "AppliedProject")
applied_messages.update_all(:status => 7, :viewed => true)
@applied_message = AppliedMessage.find(params[:applied_message_id])
@ -88,7 +88,7 @@ class MembersController < ApplicationController
ps.send_wechat_join_project_notice user,project,ap_role,0
# 添加成功后,批准人收到消息
# AppliedMessage.create(:user_id => @applied_message.user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,
# :status => 7, :viewed => true, :applied_user_id => @applied_message.applied_user_id, :role => applied_project.role, :project_id => applied_project.project_id)
# :status => 7, :viewed => true, :applied_user_id => @applied_message.applied_user_id, :role => applied_project.role, :project_id => applied_project.project_id)
rescue Exception => e
puts e
end
@ -106,7 +106,7 @@ class MembersController < ApplicationController
applied_project = @applied_message.applied
project = Project.find(@applied_message.project_id) if !applied_project.nil?
user = User.find(@applied_message.applied_user_id)
if user.member_of?(project) || AppliedMessage.where(:applied_id => @applied_message.applied_id, :status => 1).count == 0
if user.member_of?(project) || AppliedMessage.where(:applied_id => @applied_message.applied_id, :status => 0).count == 0
@flash_message = "该申请已被其他管理员处理"
# @applied_message.update_attribute(:status, 2)
else
@ -115,7 +115,7 @@ class MembersController < ApplicationController
:viewed => false, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id)
# 拒绝功后所有管理员收到的消息状态都要更新
applied_messages = AppliedMessage.where(:applied_id => @applied_message.applied_id, :project_id => @applied_message.project_id, :status => 1,
applied_messages = AppliedMessage.where(:applied_id => @applied_message.applied_id, :project_id => @applied_message.project_id, :status => 0,
:applied_type => "AppliedProject")
applied_messages.update_all(:status => 5, :viewed => true)
@applied_message = AppliedMessage.find(params[:applied_message_id])

View File

@ -225,12 +225,7 @@ class MyController < ApplicationController
File.delete(diskfile1) if File.exist?(diskfile1)
end
# 基本资料不完善,无法使用其他功能,完善着可继续使用
if @force
render :layout => 'new_base_user_show'
else
render :layout => 'new_base_user'
end
end
# Destroys user's account

View File

@ -635,24 +635,74 @@ class OrganizationsController < ApplicationController
end
end
def apply_subdomain
@organization = Organization.find(params[:id])
admins = User.where("admin=1")
admins.each do |admin|
OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain].downcase)
organization = Organization.find(params[:id])
@applied_message_count = AppliedMessage.where(:applied_id => organization.id, :name => params[:domain].downcase, :status => 1).count
# 如果申请过该名字,怎不能重复申请
if @applied_message_count > 0
@flag = 1
else
admins = User.where("admin=1")
admins.each do |admin|
AppliedMessage.create(:user_id => admin.id, :applied_id => organization.id, :applied_type => 'Organization', :viewed => 0, :satus => 1, :applied_user_id => User.current.id, :name => params[:domain].downcase)
# OrgMessage.create(:user_id => admin.id, :organization_id => @organization.id, :message_type => 'ApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:domain].downcase)
end
end
end
# stauts: 0申请 2申请人收到已接受消息
# @flag 1申请同名提醒 2操作的时候已经被人提前处理了
def agree_apply_subdomain
@organization = Organization.find(params[:organization_id])
OrgMessage.find(params[:act_id]).update_attribute(:viewed, 1)
if Secdomain.where("pid=? and sub_type=2",@organization.id).count > 0
domain = Secdomain.where("pid=? and sub_type=2",params[:organization_id]).first
Secdomain.update(domain.id, :subname => params[:org_domain])
organization_id = params[:organization_id]
org_domain = params[:org_domain]
@applied_message = AppliedMessage.find(params[:ma_id])
# 处理的时候判断是否有人已经处理了
if @applied_message.status == 0
# 事务处理:消息和数据的创建应该是同步的
ActiveRecord::Base.transaction do
applied_messages = AppliedMessage.where(:applied_type => "Organization", :applied_id => organization_id, :name => org_domain, :status => 0)
applied_messages.update_all(:status => 2, :viewed => true, :updated_at => Time.now)
secdomain = Secdomain.where(:pid => organization_id, :sub_type => 2)
if secdomain.count > 0
domain = Secdomain.where("pid=? and sub_type=2",organization_id).first
Secdomain.update(domain.id, :subname => params[:org_domain])
else
Secdomain.create(:sub_type => 2, :pid => organization_id, :subname => params[:org_domain])
end
# 自己处理自己的消息则不需要另外发送消息
if User.current.id != @applied_message.applied_user_id
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_id => organization_id, :applied_type => 'Organization', :viewed => 0, :satus => 2, :applied_user_id => User.current.id, :name => org_domain.downcase)
end
@applied_message.status = 2
@applied_message.updated_at = Time.now
end
else
Secdomain.create(:sub_type => 2, :pid => params[:organization_id], :subname => params[:org_domain])
@flag = 2
end
if OrgMessage.where("message_type='AgreeApplySubdomain' and organization_id=#{@organization.id} and content=?",params[:org_domain]).count == 0
OrgMessage.create(:user_id => params[:user_id], :organization_id => @organization.id, :message_type => 'AgreeApplySubdomain', :message_id => @organization.id, :sender_id => User.current.id, :viewed => 0, :content => params[:org_domain])
end
# stauts: 0申请 2申请人收到已接受消息 4已拒绝
# @flag 1申请同名提醒 2操作的时候已经被人提前处理了
def refused_apply_subdomain
organization_id = params[:organization_id]
org_domain = params[:org_domain]
@applied_message = AppliedMessage.find(params[:ma_id])
# 多人同时操作处理
secdomain = Secdomain.where(:pid => organization_id, :sub_type => 2)
# 处理过程中,如果已经被其他管理员处理,则弹框提示
if @applied_message.status == 0
# 事务处理:消息和数据的创建应该是同步的
ActiveRecord::Base.transaction do
applied_messages = AppliedMessage.where(:applied_type => "Organization", :applied_id => organization_id, :name => org_domain, :status => 0)
applied_messages.update_all(:status => 4, :viewed => true, :updated_at => Time.now)
# 自己处理自己的消息则不需要另外发送消息
if User.current.id != @applied_message.applied_user_id
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_id => organization_id, :applied_type => 'Organization', :viewed => 0, :satus => 4, :applied_user_id => User.current.id, :name => org_domain.downcase)
end
@applied_message.status = 4
@applied_message.updated_at = Time.now
end
else
@flag = 2
end
end
end

View File

@ -394,7 +394,7 @@ class UsersController < ApplicationController
# 评论后,给回复人发消息(如果是本人就不发)
if comment.author.id != BlogComment.find(comment.reply_id).author_id
BlogMessage.create(:user_id => BlogComment.find(comment.reply_id).author_id,
:blog_commont_id => comment.id,
:blog_message_id => comment.id,
:blog_id => comment.blog_id,
:blog_message_type => "BlogComment",
:content => comment.content,
@ -2049,42 +2049,10 @@ class UsersController < ApplicationController
# @unreview_homework = 1
# 待审批的申请
@applied_message_alls = []
OrgMessage
applied_messages_all = MessageAll.where(:user_id => @user.id, :message_type => ["OrgMessage", "AppliedMessage", "CourseMessage", "ForgeMessage"]).includes(:message)
applied_messages_all.each do |message_all|
mess = message_all.message
if !mess.nil?
if (message_all.message_type == "OrgMessage")
if mess.message_type == "ApplySubdomain" && OrgMessage.where(:organization_id => mess.organization_id, :message_type => "AgreeApplySubdomain").count == 0
@applied_message_alls << mess
end
elsif (message_all.message_type == "AppliedMessage" )
if (mess.applied_type == "AppliedContest" && mess.status == 0) || (mess.applied_type == "StudentWorksScoresAppeal" && mess.status == 0) || (mess.applied_type == "AppliedProject" && mess.status == 1 && AppliedMessage.where("applied_id = #{mess.applied_id} and status != 1").count == 0) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 )
@applied_message_alls << mess
end
elsif message_all.message_type == "CourseMessage"
if mess.course_message_type == "JoinCourseRequest" && mess.status == 0
@applied_message_alls << mess
end
elsif message_all.message_type == "ForgeMessage"
if mess.forge_message_type == "PullRequest" && PullRequest.where(:pull_request_id => mess.forge_message_id, :status => [1, 3]).count > 0 && PullRequest.where(:pull_request_id => mess.forge_message_id).first.user_id != User.current.id
user_id = PullRequest.where(:pull_request_id => mess.forge_message_id, :status => [1, 3]).first.id
if ForgeMessage.where("status in (1,3) and user_id != #{user_id} and pull_request_id = #{mess.forge_message_id}")
@applied_message_alls << mess
end
end
end
end
end
@applied_message_alls_count = @applied_message_alls.count
# org_applied_messages = MessageAll.where(:message_type => "OrgMessage").includes(:message).order("created_at desc")
# org_applied_messages = org_applied_messages.message.map{|message| message.message_type == "ApplySubdomain" and OrgMessage.where(:organization_id => message.organization_id, :message_type => "AgreeApplySubdomain").count == 0}.length
# project_message_applied_count = AppliedMessage.where(:user_id => @user.id, :message_type => "AppliedProject", :status => 1)
# school_message_applied_count = AppliedMessage.where(:user_id => @user.id, :message_type => "ApplyAddSchools", :status => 0)
# course_message_applied_count = CourseMessage.where(:message_type => "JoinCourse", :satus => 0)
# @applied_message_count = org_message_applied_count + project_message_applied_count + school_message_applied_count + course_message_applied_count
applied_message_count = AppliedMessage.where(:applied_type => ["Organization", "AppliedContest", "StudentWorksScoresAppeal", "AppliedProject", "ApplyAddSchools"], :user_id => User.current.id, :status => 0).count
applied_course_message_count = CourseMessage.where(:user_id => User.current.id, :course_message_type => "JoinCourseRequest", :status => 0).count
applied_pull_request_message_count = ForgeMessage.where(:user_id => User.current.id, :forge_message_type => "PullRequest", :status => [1,3]).count
@applied_message_alls_count = applied_message_count + applied_course_message_count + applied_pull_request_message_count
else
# 看别人的主页显示动态
#更新用户申请成为课程老师或教辅消息的状态
@ -2267,35 +2235,15 @@ class UsersController < ApplicationController
end
# 待审批的申请
# 待审批的消息一般不多,可以特殊处理
def unapproval_applied_list
@message_alls = []
# messages_all = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc")
messages_all = MessageAll.where(:user_id => @user.id, :message_type => ["OrgMessage", "AppliedMessage", "CourseMessage", "ForgeMessage"]).includes(:message).order("created_at desc")
messages_all.each do |message_all|
mess = message_all.message
if !mess.nil?
if (message_all.message_type == "OrgMessage")
if mess.message_type == "ApplySubdomain" && OrgMessage.where(:organization_id => mess.organization_id, :message_type => "AgreeApplySubdomain").count == 0
@message_alls << mess
end
elsif (message_all.message_type == "AppliedMessage" )
if (mess.applied_type == "AppliedContest" && mess.status == 0) || (mess.applied_type == "StudentWorksScoresAppeal" && mess.status == 0) || (mess.applied_type == "AppliedProject" && mess.status == 1 && AppliedMessage.where("applied_id = #{mess.applied_id} and status != 1").count == 0) || ( mess.applied_type == "ApplyAddSchools" && ApplyAddSchools.where(:school_id => mess.applied_id, :status => 0).count != 0 )
@message_alls << mess
end
elsif message_all.message_type == "CourseMessage"
if mess.course_message_type == "JoinCourseRequest" && mess.status == 0
@message_alls << mess
end
elsif message_all.message_type == "ForgeMessage"
if mess.forge_message_type == "PullRequest" && PullRequest.where(:pull_request_id => mess.forge_message_id, :status => [1, 3]).count > 0 && PullRequest.where(:pull_request_id => mess.forge_message_id).first.user_id != User.current.id
user_id = PullRequest.where(:pull_request_id => mess.forge_message_id, :status => [1, 3]).first.id
if ForgeMessage.where("status in (1,3) and user_id != #{user_id} and pull_request_id = #{mess.forge_message_id}")
@message_alls << mess
end
end
end
end
end
user_id = User.current.id
sql = "SELECT * FROM `message_alls` ma left join `forge_messages` fm on ma.message_id=fm.id
left join `course_messages` cm on ma.message_id=cm.id left join `applied_messages` apm on ma.message_id=apm.id
where (ma.user_id =#{user_id} and ma.message_type = 'ForgeMessage' and fm.forge_message_type='PullRequest' and fm.status=0 and fm.user_id=#{user_id} ) or
(ma.user_id=#{user_id} and ma.message_type='AppliedMessage' and apm.applied_type in ('Organization', 'AppliedContest', 'StudentWorksScoresAppeal', 'AppliedProject', 'ApplyAddSchools') and apm.user_id =#{user_id} and apm.status =0 ) or
(ma.user_id=#{user_id} and ma.message_type='CourseMessage' and cm.course_message_type='JoinCourseRequest' and cm.status=0 and cm.user_id=#{user_id} );"
@message_alls = MessageAll.find_by_sql(sql)
@message_count = @message_alls.count
@message_alls = paginateHelper @message_alls, 20
respond_to do |format|
@ -2380,7 +2328,7 @@ class UsersController < ApplicationController
shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id)
@page = params[:page] ? params[:page].to_i + 1 : 0
user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")"
project_types = "('Message','Issue','Project')"
project_types = "('Message','Issue','Project', 'Attachment')"
principal_types = "JournalsForMessage"
container_type = ''
act_type = ''
@ -2395,6 +2343,9 @@ class UsersController < ApplicationController
when "current_user"
container_type = 'Principal'
act_type = 'Principal'
when "project_resource"
container_type = 'Project'
act_type = "Attachment"
when "all"
container_type = 'all'
act_type = 'all'
@ -4098,6 +4049,7 @@ class UsersController < ApplicationController
end
def user_courselist
@user_courselist = "课程"
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
@my_syllabuses = @user.syllabuses
@ -4281,6 +4233,7 @@ class UsersController < ApplicationController
end
def user_projectlist
@user_projectlist = "项目"
@order, @c_sort, @type, @list_type = 1, 2, 1, 1
#limit = 5

View File

@ -46,6 +46,10 @@ module ApplicationHelper
@objs = paginateHelper @attachments,25
end
# 判断当前用户能否对消息进行操作
def allow_to_show applied_message
(User.current.id == applied_message.user_id && applied_message.status == 0) ? true : false
end
# 获取竞赛的管理人员
def contest_managers contest
@ -1344,10 +1348,10 @@ module ApplicationHelper
elsif @forum || params[:controller] == "forums"
title << "问吧"
elsif @user
if !@project_community.blank?
title << @project_community
elsif !@course_community.blank?
title << @course_community
if !@project_community.blank? || !@user_projectlist.blank?
title << "项目"
elsif !@course_community.blank? || !@user_courselist.blank?
title << "课程"
elsif !@contest_community.blank?
title << @contest_community
elsif !@manage_issues.blank?

View File

@ -416,11 +416,13 @@ module IssuesHelper
if detail.property == 'attr' && detail.prop_key == 'description'
s = l(:text_journal_changed_no_detail, :label => label)
unless no_html
diff_link = link_to l(:label_diff),
{:controller => 'journals', :action => 'diff', :id => detail.journal_id,
:detail_id => detail.id, :only_path => options[:only_path]},
:title => l(:label_view_diff)
s << " (#{ diff_link })"
if detail.try(:prop_key) == "description"
diff_link = link_to l(:label_diff),
{:controller => 'journals', :action => 'diff', :id => detail.journal_id,
:detail_id => detail.id, :only_path => options[:only_path]},
:title => l(:label_view_diff)
s << " (#{ diff_link })"
end
end
s.html_safe
elsif detail.value.present?

View File

@ -134,10 +134,6 @@ module UsersHelper
end
end
# 判断当前用户能否对消息进行操作
def allow_to_show applied_message
(User.current.id == applied_message.user_id && applied_message.status == 1) ? true : false
end
# 项目申请消息通过状态判断用户
# status(1申请的消息2已操作过该消息包括同意或者拒绝消息状态更新3拒绝消息4:被拒人收到消息5拒绝者收到消息6同意后申请人收到消息7同意后批准人收到消息)

View File

@ -11,7 +11,7 @@ class AppliedProject < ActiveRecord::Base
# 仅仅给项目管理人员发送消息
def send_appliled_message
self.project.managers.each do |member|
self.applied_messages << AppliedMessage.new(:user_id => member.user_id, :status => true, :viewed => false, :applied_user_id => self.user_id, :role => self.role, :project_id => self.project_id)
self.applied_messages << AppliedMessage.new(:user_id => member.user_id, :status => false, :viewed => false, :applied_user_id => self.user_id, :role => self.role, :project_id => self.project_id)
#----------------微信通知----------------------
count = ShieldWechatMessage.where("container_type='User' and container_id=#{member.user_id} and shield_type='Project' and shield_id=#{self.project_id}").count

View File

@ -1,6 +1,6 @@
class BlogMessage < ActiveRecord::Base
# attr_accessible :title, :body
attr_accessible :content, :blog_commont_id, :blog_message_type, :viewed, :user_id, :blog_id, :user_operator_id
attr_accessible :content, :blog_message_id, :blog_message_type, :viewed, :user_id, :blog_id, :user_operator_id
belongs_to :blog_comment ,:polymorphic => true
belongs_to :user
@ -8,7 +8,7 @@ class BlogMessage < ActiveRecord::Base
validates :user_id, presence: true
validates :blog_id, presence: true
validates :blog_commont_id, presence: true
validates :blog_message_id, presence: true
validates :blog_message_type, presence: true
after_create :add_user_message

View File

@ -100,7 +100,8 @@ class Course < ActiveRecord::Base
'is_delete',
'syllabus_id',
'end_time',
'end_term'
'end_term',
'os_allow'
acts_as_customizable

View File

@ -203,7 +203,7 @@ class Memo < ActiveRecord::Base
end
def destroyable_by? user
(user && self.author == user) || user.admin? || self.forum.creator == user
(user && self.author == user) || user.admin? || self.forum.creator == user || Memo.find(self.root_id).author == user
#self.author == user || user.admin?
end

View File

@ -2,5 +2,14 @@ class MessageAll < ActiveRecord::Base
attr_accessible :message_id, :message_type, :user_id
belongs_to :user
# 虚拟关联---项目消息表/课程消息表/用户留言消息表/贴吧消息表
belongs_to :forge_message, foreign_key: 'message_id', conditions: "message_alls.message_type = 'ForgeMessage'"
belongs_to :course_message, foreign_key: 'message_id', conditions: "message_alls.message_type = 'CourseMessage'"
belongs_to :applied_message, foreign_key: 'message_id', conditions: "message_alls.message_type = 'AppliedMessage'"
belongs_to :at_message, foreign_key: 'message_id', conditions: "message_alls.message_type = 'AtMessage'"
belongs_to :memo_message, foreign_key: 'message_id', conditions: "message_alls.message_type = 'MemoMessage'"
belongs_to :org_message, foreign_key: 'message_id', conditions: "message_alls.message_type = 'OrgMessage'"
belongs_to :system_message, foreign_key: 'message_id', conditions: "message_alls.message_type = 'SystemMessage'"
belongs_to :user_feedback_message, foreign_key: 'message_id', conditions: "message_alls.message_type = 'UserFeedbackMessage'"
belongs_to :message ,:polymorphic => true
end

View File

@ -1,7 +1,7 @@
class OrgMessage < ActiveRecord::Base
belongs_to :user
belongs_to :organization
has_many :message_alls, :as => :message, :dependent => :destroy
has_many :message_alls, :class_name => 'MessageAll', :as => :message, :dependent => :destroy
validates :message_type, :presence => true
validates :message_id, :presence => true
validates :organization_id, :presence => true

View File

@ -10,6 +10,7 @@ class Organization < ActiveRecord::Base
has_many :users, :through => :org_members
has_many :files
has_many :org_messages, :class_name => 'OrgMessage', :dependent => :destroy
has_many :applied_messages, :class_name => 'AppliedMessage', :dependent => :destroy
acts_as_attachable
validates_uniqueness_of :name
after_create :save_as_org_activity, :add_default_subfields

View File

@ -5,18 +5,18 @@
<div class="email_verify" style="width: 580px;">
<p class="fb f18" style="color:green;"><i class="icon-ok mr5 f18"></i>注册成功!
<span style=" color:#3b94d6; font-size:12px; font-weight:normal;">请在24小时内点击邮件中的链接来激活您的账号。</span></p>
<p class="f14 mt30 mb5">请登录邮箱(<span class="c_red"><%= @mail_type %></span>)收取账号激活邮件。<br/>点击邮件中的激活链接,方可使用该账号
<p class="f14 mt30 mb5">请登录邮箱(<span class="c_red"><%= @user.mail %></span>)收取账号激活邮件。<br/>点击邮件中的激活链接,方可使用该账号
</p>
<p>
<a href="http://mail.<%= email %>" class="btn btn-blue" target="_blank"><%= l(:label_check_email)%></a>
&nbsp; &nbsp; <%= link_to "<input class='btn btn-blue' type='button' id='btn' value='重新获取验证码' onclick='settime(this)' />".html_safe, { :controller => 'account', :action => 'resendmail', :user => @user}, :remote => true, :method => 'get' %>
&nbsp; &nbsp; <%= link_to "<input class='btn btn-blue' type='button' id='btn' value='重新发送激活邮件' onclick='settime(this)' />".html_safe, { :controller => 'account', :action => 'resendmail', :user => @user}, :remote => true, :method => 'get' %>
</p>
<ul class="email_prompt_txt mt30" style="width: 580px;">
<p class="email_prompt_p">如果您一直收不到激活邮件,请按照以下步骤操作:</p>
<li>1.请确认是否填写了正确的邮箱地址 </li>
<li>2.请注意查看邮箱中的“订阅邮件”、“垃圾邮件”可能Trustie的邮件被误杀了</li>
<li>3.点击这里重新发送激活邮件</li>
<li>3.点击重新发送激活邮件按钮</li>
<li>4.如果您无法收到激活邮件,请直接给我们留言:</li>
<div class="mt10 clearfix">
<% get_memo %>

View File

@ -38,6 +38,9 @@
<th style="width: 60px;">
<%=l(:field_created_on)%>
</th>
<th style="width: 30px;">
开源检索
</th>
</tr>
</thead>
<tbody>
@ -57,6 +60,7 @@
<td class="center">
<%= format_date(syllabus.created_at) %>
</td>
<td></td>
</tr>
<% courses = syllabus.courses.not_deleted %>
<% courses.each do |course| %>
@ -75,6 +79,7 @@
<td class="center">
<%= format_date(course.created_at) %>
</td>
<td style="text-align: center;"><a href="<%= open_or_close_os_interface_course_path(course.id) %>" id="os_allow_<%= course.id %>" data-remote="true"><%= course.try(:os_allow) == 0 ? "允许" : "不允许" %></a></td>
</tr>
<% end %>
<% end %>

View File

@ -81,8 +81,8 @@
</ul>
</div>
<%end%>
<div class="postDetailTitle fl">
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @article.title%></a>
<div class=" fl " style="font-size:14px;font-weight: bold; color:#333; max-width:600px;margin-bottom: 15px;word-break:break-all; word-wrap:break-word;">
<p> <%= @article.title%></p>
</div>
<div class="cl"></div>

View File

@ -0,0 +1 @@
$("#os_allow_<%= @course.id %>").html("<%= @course.try(:os_allow) == 0 ? "允许" : "不允许" %>");

View File

@ -1,7 +1,7 @@
<div id="Footer" class="f12">
<div class="footerAboutContainer">
<ul class="footerAbout">
<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="<%#= 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>
<% memo = Memo.where(:id => 1168).first %>

View File

@ -86,7 +86,7 @@
</li>
<!--<li><a href="javascript:void(0);" class="menuGrey">账号设置</a> </li>-->
<li>
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post"%>
<%= link_to "退出",logout_url_without_domain,:class => "menuGrey",:method => "post", :id => "logout_trustie" %>
</li>
</ul>
</li>

View File

@ -23,7 +23,7 @@
<% end %>
</ul>
</div>
<div class="fl" id="navHomepageSearch">
<div class="fl" id="navHomepageSearch" style="margin-left:75px;">
<!--<form class="navHomepageSearchBox">-->
<% name = name%>
<a href ="javascript:void(0);" disabled="true"><%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>

View File

@ -16,8 +16,8 @@
<%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<span class="c_grey fl ml10">还能输入<span id="textCount" class="c_orange">50</span>个字符</span>
<a href="javascript:void(0);" class="linkBlue f12 fr mr10" style="height:21px;" id="" onclick="f_submit();">
<%= l(:label_submit)%>
<a href="javascript:void(0);" class="linkBlue f12 fr mr10" style="height:21px;" id="inquiry_question" onclick="f_submit();">
<%= l(:label_submit) %>
</a>
<div class="cl"></div>
<% end %>

View File

@ -209,8 +209,8 @@
<% end %>
<% elsif ma.class == BlogMessage %>
<% if ma.blog_message_type == "BlogComment" %>
<% user_id = User.find(BlogComment.find(ma.blog_commont_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_commont_id).root_id %>
<% user_id = User.find(BlogComment.find(ma.blog_message_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_message_id).root_id %>
<li><a href="<%= user_blog_blog_comment_path(:user_id => user_id, :blog_id => ma.blog_id, :id => blog_id) %>" target="_blank" title="<%= User.find(ma.user_operator_id).show_name %> 回复了博客:<%= message_content(ma.content) %>"><span class="shadowbox_news_user"><%= User.find(ma.user_operator_id).show_name %> </span>回复了博客:<%= message_content(ma.content) %></a></li>
<% end %>
<% elsif ma.class == MemoMessage %>
@ -242,7 +242,7 @@
<% end %>
</ul>
<!--<a onclick = "show_more();" id = "show_more_messages" style="display: none; cursor: pointer;" class = "shadowbox_news_all">展开更多</a>-->
<%= link_to '查看全部', user_message_path(User.current),:id =>'show_all_messages', :class => "shadowbox_news_all", :target =>"_Blank" %>
<%= link_to '查看全部', user_path(User.current), :id =>'show_all_messages', :class => "shadowbox_news_all", :target =>"_Blank" %>
</div>
<script type="text/javascript">

View File

@ -59,11 +59,11 @@
}
}
</script>
<div class="fl" id="navHomepageSearch">
<div class="fl" id="navHomepageSearch" >
<!--<form class="navHomepageSearchBox">-->
<% name = name%>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox', method: :get) do %>
<%= form_tag({controller: :welcome, action: :search },:class=>'navHomepageSearchBox',:style=>'width:380px;', 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="all"/>
<input type="text" style="display: none;"/>

View File

@ -147,7 +147,11 @@
<%# 课程英雄榜 %>
<%= render :partial => 'courses/course_heroes', :locals => {:course => @course} %>
<div class="sy_class_leftbox" >
<h3 class="fontGrey7">推荐</h3>
<h3 class="fontGrey7"><span>推荐</span>
<% if @course.try(:os_allow) == 1 %>
<a class="c_white db creatPostIcon2 bGreen fr mt3" href="http://ossean.trustie.net?user_id=<%= User.current.id %>" target="_blank">开源检索</a>
<% end %>
</h3>
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
</div>
<%# 更新访问数,刷新的时候更新访问次数 %>

View File

@ -64,7 +64,6 @@
})
</script>
</head>
<body onload="prettyPrint();">
<div class="navContainer">
<% is_current_user = User.current.logged? && User.current == @user %>
@ -291,6 +290,20 @@
$("#projectMenu").mouseleave(function(){
$("#topnav_project_menu").hide();
});
// 如果是强制修改资料页面,则除退出按钮外,其他按钮的连接都失效
<% if @force %>
// 禁用所有a标签
var t = document.getElementsByTagName("a");
len = t.length;
for(var i=0;i<len;i++){
t[i].href = 'javascript:void(0)';
}
// 退出按钮可用
var d = document.getElementById("logout_trustie");
d.href='<%= logout_url_without_domain %>';
// 提问按钮不可用
document.getElementById('inquiry_question').onclick = function (){return false;};
<% end %>
</script>
</body>
</html>

View File

@ -0,0 +1,23 @@
<div id="sy_popup_box" style="width:380px;">
<div class="sy_popup_top sy_popup_top_tishi">
<h3 class="fl">温馨提示</h3>
<a href="javascript:void(0);" class="sy_icons_close02 fr" onclick="hideModal()"></a>
<div class="cl"></div>
</div>
<div class="sy_popup_con02" >
<ul class="sy_popup_tishi ">
<li>
<% if @flag == 1 %>
<p>当前组织已申请过该域名,请耐心等待管理员的审批,审批完成后系统会以消息的形式通知您</p>
<% elsif @flag == 2 %>
<p>已经被其他管理员抢先一步处理了</p>
<% else %>
<p>您的申请已提交,系统会以消息的形式通知您结果</p>
<% end %>
</li>
<li>
<a href="javascript:void(0);" class="sy_btn_blue " onclick="hideModal()">知道了</a>
</li>
</ul>
</div>
</div>

View File

@ -0,0 +1,5 @@
<% if @flag == 2 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'organizations/applied_organization_domain_tip') %>";
pop_box_new(htmlvalue,380,250);
<% end %>
$("#applied_project_<%= @applied_message.id %>").html('<%= escape_javascript( render :partial => 'users/applied_organization_sundomain', :locals => {:ma => @applied_message}) %>');

View File

@ -1 +1 @@
$("#agree_apply_subdomain_<%= params[:act_id] %>").text("已同意申请");
<%= render "organizations/organization_message_ajax_tip" %>

View File

@ -0,0 +1,2 @@
var htmlvalue = "<%= escape_javascript(render :partial => 'organizations/applied_organization_domain_tip') %>";
pop_box_new(htmlvalue,380,250);

View File

@ -0,0 +1 @@
<%= render "organizations/organization_message_ajax_tip" %>

View File

@ -227,9 +227,6 @@
data:{
id:id,
domain:domain
},
success:function(){
$("#apply_hint").text("您的申请已提交,系统会以消息的形式通知您结果");
}
});
}

View File

@ -8,7 +8,7 @@
<div class="pullreques_pullbox">
<div class="pullreques_pull_top clear">
<p class="fl c_grey ml15"><%= day %></p>
<p class="fr c_green mr15"><%= commits.count %>个提交</p>
<p class="fr c_green mr15">当前页<%= commits.count %>个提交</p>
</div>
<ul class="pullreques_pull_list">
<% commits.each do |commit| %>

View File

@ -0,0 +1,16 @@
<div class="shortMessageWidth">
<li class="homepageNewsPortrait fl">
<%=link_to image_tag(url_to_avatar(ma.applied), :width => "30", :height => "30"), organization_path(ma.applied_id), :target => '_blank' %>
</li>
<li class="homepageNewsPubType fl">
<%=link_to ma.applied.name, organization_path(ma.applied_id), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class='homepageNewsType fl'>申请子域名:</span>
</li>
<li class="messageInformationContents">
<%= ma.name %>
</li>
</div>
<li class="messageOperateContents fl">
<span><%= render :partial => "users/user_message_organization_applied_action", :locals => {:ma => ma} %></span>
</li>
<li class="homepageNewsTime fr"><%= time_tag(ma.updated_at).html_safe %> </li>

View File

@ -12,13 +12,14 @@
</h3>
<div class="cl"></div>
<p class="sy_cgrey clear">
<span class="mr15 fl"><%= (cur_homework_end_time homework).html_safe %></span>
<span class="fl mr30"><%= (cur_homework_end_time homework).html_safe %></span>
<span class="fl">未交:</span>
<span class="sy_cgrey hw_w30 fl mr15"><%= homework.course.student.count - homework.student_works.has_committed.count %></span>
<span class="fl c_green">已评:</span>
<span class="sy_cgrey hw_w30 fl mr15"><%= homework.student_works.where("work_status != 0 and (teacher_score is not null or teaching_asistant_score is not null)").count %></span>
<span class="fl c_red">未评:</span>
<span class="sy_cgrey hw_w30 fl mr15"><%= homework.student_works.where("work_status != 0 and teacher_score is null and teaching_asistant_score is null").count %></span>
<span class="sy_cgrey hw_w30 fl mr30"><%= homework.course.student.count - homework.student_works.has_committed.count %></span>
<span class="fl">已评:</span>
<span class="sy_cgrey hw_w30 fl mr30"><%= homework.student_works.where("work_status != 0 and (teacher_score is not null or teaching_asistant_score is not null)").count %></span>
<% not_evaluate_count = homework.student_works.where("work_status != 0 and teacher_score is null and teaching_asistant_score is null").count %>
<span class="fl">未评:</span>
<span class="<%= not_evaluate_count > 0 ? "c_red" : "sy_cgrey" %> hw_w30 fl mr30"><%= not_evaluate_count %></span>
</p>
</div>
<% if homework.student_works.has_committed.count == 0 %>

View File

@ -23,7 +23,10 @@
<% end %>
<%# 博客消息 %>
<%= render :partial => 'users/user_message_blog', :locals => {:ma => ma} %>
<% if ma.class == BlogMessage %>
<%= render :partial => 'users/user_message_blog', :locals => {:ma => ma} %>
<% end %>
<!--公共贴吧-->
<% if ma.class == MemoMessage %>
<%= render :partial => 'users/user_message_forum', :locals => {:ma => ma} %>

View File

@ -1,10 +1,11 @@
<div class="container-big mt10">
<div class="pr">
<!-- 项目社区赛选的资源库动态为短版,具体项目赛选的资源库为宽版 -->
<div class="<%= @project_community.nil? ? 'container-big' : 'resources' %> mt10">
<div class="<%= @project_community.nil? ? 'pr' : 'homepagePostBrief' %>">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="content-big">
<div class="<%= @project_community.nil? ? 'content-big' : 'homepagePostDes' %>">
<div class="homepagePostTo break_word">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
@ -12,10 +13,10 @@
<%= 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_files_path(activity.course), :class => "newsBlue ml15" %>
<%= link_to activity.project.name.to_s+" | 项目资源", project_files_path(activity.project), :class => "newsBlue ml15" %>
</div>
<div class="homepagePostTitle break_word" >
<%= link_to activity.filename, project_files_path(activity.course), :class => "postGrey" %>
<%= link_to activity.filename, project_files_path(activity.project), :class => "postGrey" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostDeadline mr15">

View File

@ -12,9 +12,9 @@
</h3>
<div class="cl"></div>
<p class="sy_cgrey clear">
<span class="mr15 fl"><%= cur_homework_end_time homework %></span>
<span class="mr30 fl"><%= cur_homework_end_time homework %></span>
<% my_work = homework.student_works.where("user_id = ? && work_status != 0",User.current).first %>
<span class="fl">状态:</span><span class="<%= my_work ? '' : 'hw_cir_nomal hw_cir_lorange' %> fl mr15"><%= my_work ? '已提交' : '未提交' %></span>
<span class="fl">状态:</span><span class="<%= my_work ? '' : 'hw_cir_nomal hw_cir_lorange' %> fl mr30"><%= my_work ? '已提交' : '未提交' %></span>
<span class="fl">成绩:</span>
<% if my_work && !my_work.work_score.nil? %>
<span class="sy_corange hw_w40 fl mr15"><%= format("%.1f",my_work.work_score.to_f) %></span>

View File

@ -78,6 +78,8 @@
<%# end %>
<% when 'Message' %>
<%= render :partial => 'project_message', :locals => {:activity => act, :user_activity_id => user_activity.id, :is_course => 0, :is_board => 0} %>
<% when 'Attachment'%>
<%= render :partial => 'users/project_attachment', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
<% when 'Project' %>
<%# cache (act) do %>
<%= render :partial => 'project_create', :locals => {:activity => act, :user_activity_id => user_activity.id} %>

View File

@ -1,4 +1,4 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
<div class="resources" id="user_activity_<%= user_activity_id%>" style="<%= activity.private == 1? 'background-color:#cecece;':'' %>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>

View File

@ -3,19 +3,21 @@
<%#= javascript_include_tag "init_KindEditor","user" %>
<% end %>
<%if jours %>
<% jours.each do |jour|%>
<% if jours.count > 0 %>
<% jours.each do |jour| %>
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id && !User.current.admin?)) %>
<script type="text/javascript">
$(function(){
sd_create_editor_from_data(<%= jour.id%>, null, "100%", "<%=jour.class.to_s%>");
sd_create_editor_from_data(<%= jour.id %>, null, "100%", "<%= jour.class.to_s %>");
});
</script>
<%= render :partial => 'user_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id} %>
<%= render :partial => 'user_journalsformessage', :locals => {:activity => jour, :user_activity_id => jour.id} %>
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
<% end %>
<%end%>
<% end%>
<% end %>
<% else %>
<%= render :partial => "projects/no_data" %>
<% end %>
<% if (jours.count + page * 10) < count %>
<%= link_to "点击展开更多",feedback_path(@user.id, :type => type, :page => page),:id => "show_more_jours",:remote => "true",:class => "loadMore mt10 f_grey"%>
<%= link_to "点击展开更多", feedback_path(@user.id, :type => type, :page => page), :id => "show_more_jours", :remote => "true", :class => "loadMore mt10 f_grey" %>
<% end %>

View File

@ -25,6 +25,10 @@
<ul class="homepageNewsList fl" id="applied_project_<%= ma.id %>">
<%= render :partial => "users/applied_project_content", :locals =>{:ma => ma} %>
</ul>
<% elsif ma && ma.applied_type == "Organization" %>
<ul class="homepageNewsList fl" id="applied_project_<%= ma.id %>">
<%= render :partial => "users/applied_organization_sundomain", :locals =>{:ma => ma} %>
</ul>
<!-- 匿评成绩申诉 -->
<% elsif ma && ma.applied_type == "StudentWorksScoresAppeal" %>
<ul class="homepageNewsList fl">

View File

@ -1,3 +1,4 @@
<% ma.nil? ? local_assigns[:ma] : ma %>
<% if ma.class == BlogMessage %>
<% if ma.blog_message_type == "BlogComment" %>
<ul class="homepageNewsList fl">
@ -10,10 +11,10 @@
<span class="homepageNewsType fl">回复了博客:</span>
</li>
<li class="messageInformationContents">
<% user_id = User.find(BlogComment.find(ma.blog_commont_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_commont_id).root_id %>
<% user_id = User.find(BlogComment.find(ma.blog_message_id).blog.author_id) %>
<% blog_id = BlogComment.find(ma.blog_message_id).root_id %>
<%= link_to message_content(ma.content), user_blog_blog_comment_path(:user_id => user_id, :blog_id => ma.blog_id, :id => blog_id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
:class => "#{ma.viewed == false ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
</li>
</div>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>

View File

@ -0,0 +1,11 @@
<% ma = ma.nil? ? local_assigns[:ma] : ma %>
<% if allow_to_show(ma) %>
<%= link_to "同意", agree_apply_subdomain_organizations_path(:organization_id => ma.applied_id, :org_domain => ma.name, :user_id => ma.applied_user_id, :ma_id => ma.id),
:remote => true, :method => :post, :class => "link-blue", :style => "font-size: 14px;" %> |
<%= link_to "拒绝", refused_apply_subdomain_organizations_path(:organization_id => ma.applied_id, :org_domain => ma.name, :user_id => ma.applied_user_id, :ma_id => ma.id),
:remote => true, :method => :post, :class => "link-blue",:style => "font-size: 14px;" %>
<% elsif ma.status == 2 %>
<span style="font-size:14px;">已同意</span>
<% elsif ma.status == 4 %>
<span style="font-size:14px;">已拒绝</span>
<% end %>

View File

@ -13,6 +13,7 @@
:class => "homepagePostTypeMine postTypeGrey" %></li>
<li><%= link_to "问题动态", {:controller => "users", :action => "project_community", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%></li>
<li><%= link_to "论坛动态", {:controller => "users", :action => "project_community", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%></li>
<li><%= link_to "资源库动态", {:controller => "users", :action => "project_community", :type => "project_resource"}, :class => "homepagePostTypeNotice postTypeGrey" %></li>
<!-- <li><%#= link_to "个人留言", {:controller => "users", :action => "project_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>-->
<% end %>
</ul>

View File

@ -5,7 +5,7 @@
</script>
<div class="mt10 mb10">
<div class="banner-big f16 fontGrey3" style="margin: 0 auto; position: relative;">
我发布的的作业
<%= @user.id == User.current.id ? "我发布的的作业" : "TA发布的的作业" %>
<div class="hw_more_box" >
<ul>
<li class="hw_more_icons fr">

View File

@ -218,7 +218,9 @@
<!--缺陷列表开始-->
<div id="myissues_con" class="myissues_con mb10">
<div class="myissues_head mb5">
<h2 class="ml15">我发布的Issue</h2>
<h2 class="ml15">
<%= @user.id == User.current.id ? "我发布的Issue" : "TA发布的Issue" %>
</h2>
</div>
<div class="clear mb5">
<div class="issues_statistics fl">

View File

@ -15,7 +15,7 @@
<div id="messageContent">
<% unless is_current_user %>
<div class="resources"><%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
<div class="resources mb10"><%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
<div class="fl" style="width:658px;">
<%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%>
<%= render :partial => "jour_form", :locals => {:f => f, :object => @user} %>

View File

@ -5,7 +5,7 @@
</script>
<div class="mt10 mb10">
<div class="banner-big f16 fontGrey3" style="margin: 0 auto; position: relative;">
我收到的的作业
<%= @user.id == User.current.id ? "我收到的的作业" : "TA收到的的作业" %>
<div class="hw_more_box" >
<ul>
<li class="hw_more_icons fr">

View File

@ -218,7 +218,9 @@
<!--缺陷列表开始-->
<div id="myissues_con" class="myissues_con mb10">
<div class="myissues_head mb5">
<h2 class="ml15">我收到的Issue</h2>
<h2 class="ml15">
<%= @user.id == User.current.id ? "我收到的Issue" : "TA收到的Issue" %>
</h2>
</div>
<div class="clear mb5">
<div class="issues_statistics fl">

View File

@ -1,4 +1,4 @@
<table class="new_roadmap_table " cellpadding="0" cellspacing="0">
<table class="new_roadmap_table " cellpadding="0" cellspacing="0" style="width:968px;">
<thead>
<tr>
<th>指派给</th>

View File

@ -53,7 +53,7 @@
</div>
<div id="new_roadmap_content_1">
<div class="pd15box">
<table class="new_roadmap_table " cellpadding="0" cellspacing="0">
<table class="new_roadmap_table " cellpadding="0" cellspacing="0" style="width:968px;" >
<thead>
<tr>
<th>ID</th>

View File

@ -103,6 +103,7 @@ RedmineApp::Application.routes.draw do
post 'reset_excellent_teacher'
post 'reset_excellent_student'
post 'agree_apply_subdomain'
post 'refused_apply_subdomain'
post 'update_field_by_admin'
post 'reset_update_field_by_admin'
end
@ -1359,6 +1360,7 @@ RedmineApp::Application.routes.draw do
get 'delete_member'
get 'archive_course'
get 'set_invite_code_halt'
get 'open_or_close_os_interface'
end
collection do
match 'join_private_courses', :via => [:get, :post]

View File

@ -0,0 +1,5 @@
class AddOsAllowToCourse < ActiveRecord::Migration
def change
add_column :courses, :os_allow, :integer, :default => 0
end
end

View File

@ -0,0 +1,8 @@
class RenameBlogMessage < ActiveRecord::Migration
def up
rename_column :blog_messages, :blog_commont_id, :blog_message_id
end
def down
end
end

View File

@ -0,0 +1,9 @@
class OsAllowToCourse < ActiveRecord::Migration
def up
courses = Course.where(:tea_id => 193)
courses.update_all(:os_allow => true)
end
def down
end
end

View File

@ -244,7 +244,7 @@ a.submit_btn2:hover {background-color: #297fb8;}
/****翻页***/
.wlist{float:right;}
.wlist li{float:left;}
.wlist a{ float:left; border:1px solid #3b94d6; padding:0 5px; margin-left:3px; color:#3b94d6;}
.wlist a{ float:left; border:1px solid #64bdd9; padding:0 5px; margin-right:5px; color:#888;}
.wlist a:hover{border:1px solid #3b94d6; background-color:#3b94d6; color:#fff; text-decoration:none;}
.wlist_select a { background-color:#3b94d6; color:#fff;}
/*add by Tim*/
@ -387,10 +387,10 @@ a:hover.hw_btn_blue,a:active.hw_btn_blue{ background: #3b94d6; color:#fff;}
.hw_search_box a:hover.hw_btn_search{background:url(../images/hw/icons_hw.png) -40px -57px no-repeat;}
.hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;}
/* 编辑删除 */
.sy_icons_edit{ display: inline-block; padding:9px;background:url(../images/sy/sy_icons02.png) 0 1px no-repeat; }
.sy_icons_del{ padding:9px;background:url(../images/sy/sy_icons02.png) 0 -21px no-repeat;}
.sy_icons_edit:hover{ background:url(../images/sy/sy_icons02.png) -20px 1px no-repeat; }
.sy_icons_del:hover{ background:url(../images/sy/sy_icons02.png) -20px -21px no-repeat;}
.sy_icons_edit{ display: inline-block; padding:9px;background:url(../../images/sy/sy_icons02.png) 0 1px no-repeat;}
.sy_icons_del{ padding:9px;background:url(../../images/sy/sy_icons02.png) 0 -21px no-repeat;}
.sy_icons_edit:hover{ background:url(../../images/sy/sy_icons02.png) -20px 1px no-repeat; }
.sy_icons_del:hover{ background:url(../../images/sy/sy_icons02.png) -20px -21px no-repeat;}
/* 翻页 */
.pages a{ display:block; border:1px solid #d1d1d1; color:#888; float:left; width:30px;text-align:center; padding:3px 0; line-height:1.9; margin-right:5px;}
.pages a:hover{ background-color:#3b94d6; border:1px solid #3b94d6; color:#fff;}

View File

@ -153,13 +153,13 @@ a:hover.CloseBtn{background:url(/images/CloseBtn.png) 0px -24px no-repeat; }
.ping_star{ width:160px; color:#333; font-weight:bold; margin-bottom:5px;}
.ping_star span a{ float:right; width:20px; height:20px; background:url(../images/star.png) -2px 0 no-repeat; margin-right:3px;}
.ping_star span a:hover{background:url(../images/star.png) -24px 0 no-repeat;}
.ping_con textarea{ width:455px; height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
a.ping_sub{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;}
.ping_con textarea{ width:455px; height:76px; border:1px solid #3b94d6; margin-bottom:5px; color:#666; font-size:12px;}
a.ping_sub{ float:right; height:22px; width:60px; background:#3b94d6; color:#fff; text-align:center;}
a:hover.ping_sub{ background:#14a8b9;}
.recall{ border-top:1px solid #CCC; padding:5px 0;}
.recall_head{ float:left;}
.recall_head a{ display:block; width:30px; height:30px; border:1px solid #CCC; padding:1px;}
.recall_head a:hover{border:1px solid #15bccf;}
.recall_head a:hover{border:1px solid #3b94d6;}
.recall_con{ float:left;color:#777777; width:520px; margin-left:10px;word-break: break-all;word-wrap: break-word; }
.recall_con a{ color:#3b94d6; }
.ping_list{ margin-top:15px;}
@ -168,13 +168,13 @@ a:hover.ping_sub{ background:#14a8b9;}
.ping_tb_{ border-bottom:3px solid #e4e4e4; text-align:center;}
.ping_tb_ ul{height:24px;}
.ping_tb_ li{float:left;height: 24px;width: auto; padding:0 10px;cursor:pointer;}
.ping_normaltab { color:#15bccf ; border-bottom:3px solid #e4e4e4;}
.ping_hovertab { color:#656767; font-weight:bold; border-bottom:3px solid #15bccf; }
.ping_normaltab { color:#3b94d6 ; border-bottom:3px solid #e4e4e4;}
.ping_hovertab { color:#656767; font-weight:bold; border-bottom:3px solid #3b94d6; }
.ping_dis{display:block; }
.ping_undis{display:none;}
.ping_C{border-bottom:1px dashed #CCC; padding:10px 0 0px;}
.ping_dispic a{ display:block; height:46px; width:46px; border:1px solid #CCC; padding:1px; float:left;}
.ping_dispic a:hover{border:1px solid #15bccf;}
.ping_dispic a:hover{border:1px solid #3b94d6;}
.ping_discon{ float:left; width:610px; margin-left:10px; }
/*.ping_distop span{ float:left;}*/
.ping_distop p{ color:#5f5f5f;word-break: break-all;word-wrap: break-word;}
@ -193,7 +193,7 @@ span.author { font-size: 0.9em; color: #888; }
.ni_con p{ color:#808181; }
.ni_con a:hover{ text-decoration:none;}
.ni_btn{ width:190px; margin:15px auto; line-height:1.9;}
a.tijiao{ height:28px; display:block; width:80px; color:#fff; background:#15bccf; text-align:center; padding-top:4px; float:left; margin-right:15px;}
a.tijiao{ height:28px; display:block; width:80px; color:#fff; background:#3b94d6; text-align:center; padding-top:4px; float:left; margin-right:15px;}
a:hover.tijiao{ background:#0f99a9;}
.c_pink{ color:#e65d5e;}
.ni_con_work { width:300px; margin:25px 20px;}
@ -296,94 +296,22 @@ a.contributor_course{float: right; color: #888; font-size: 12px; font-weight: no
/*公共弹框*/
/* 按钮*/
/* 加入班级弹窗 */
#sy_popup_box{
width:460px;
background:#fff;
padding-bottom:30px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);
}
.sy_popup_top{
background:#3b94d6;
height:40px;
-webkit-border-radius: 5px 5px 0px 0px;
-moz-border-radius: 5px 5px 0px 0px;
-o-border-radius: 5px 5px 0px 0px;
border-radius: 5px 5px 0px 0px;
}
.sy_popup_top h3{
font-size:18px;
color:#fff;
font-weight:normal;
line-height:40px;
padding-left:10px;
}
a.sy_icons_close{
width:20px;
height:20px;
display:block;
background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat;
margin:8px 10px 0 0;
}
a:hover.sy_icons_close{
background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;
}
.sy_popup_con{
margin:30px auto 0;
font-size:14px;
width:330px;
}
.sy_popup_add label{
display:block;
float:left;
width:85px;
text-align:right;
line-height:40px;
}
.sy_popup_add li{
line-height:40px;
}
.sy_input_txt{
border:1px solid #dedede;
height:36px;
background:#fff;
padding:0 5px;
width:220px;
}
.sy_popup_con02{
margin:30px auto 0;
font-size:14px;
text-align:center;
width:360px;
}
.sy_popup_con02 ul li p{
margin-bottom:15px;
text-align:center;
font-size:14px;
color:#616161;
}
#sy_popup_box{ width:460px; background:#fff; padding-bottom:30px; border-radius:5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
.sy_popup_top{ background:#3b94d6; height:40px; -webkit-border-radius: 5px 5px 0px 0px; -moz-border-radius: 5px 5px 0px 0px; -o-border-radius: 5px 5px 0px 0px; border-radius: 5px 5px 0px 0px;}
.sy_popup_top h3{ font-size:18px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px;}
a.sy_icons_close{ width:20px; height:20px; display:block; background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; margin:8px 10px 0 0;}
a:hover.sy_icons_close{background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;}
.sy_popup_con{ margin:30px auto 0;font-size:14px; width:330px;}
.sy_popup_add label{ display:block; float:left; width:85px; text-align:right; line-height:40px;}
.sy_popup_add li{ line-height:40px;}
.sy_input_txt{ border:1px solid #dedede; height:36px; background:#fff; padding:0 5px; width:220px;}
.sy_popup_con02{ margin:30px auto 0; font-size:14px; text-align:center; width:360px;}
.sy_popup_con02 ul li p{ margin-bottom:15px; text-align:center; font-size:14px; color:#616161;}
.sy_popup_con02 a{ margin:0 auto;}
.sy_popup_top_tishi{ background:#ededed; }
.sy_popup_top_tishi h3{color:#616161; font-size:16px;}
a.sy_icons_close02{
width:20px;
height:20px;
display:block;
background: url(/images/sy/sy_icons_close02.png) 0 0px no-repeat;
margin:8px 10px 0 0;
border: none;
outline: none;
transition: all 0s linear;
}
a:hover.sy_icons_close02{
background: url(/images/sy/sy_icons_close02.png) -40px 0px no-repeat;
}
a.sy_icons_close02{ width:20px; height:20px; display:block; background: url(/images/sy/sy_icons_close02.png) 0 0px no-repeat; margin:8px 10px 0 0; border: none; outline: none; transition: all 0s linear;}
a:hover.sy_icons_close02{ background: url(/images/sy/sy_icons_close02.png) -40px 0px no-repeat;}
img.ui-datepicker-trigger { display: block; background: url(/images/public_icon.png) -31px 0 no-repeat; cursor: pointer; vertical-align: middle; margin-left: 5px; margin-top: 5px; margin-right: 5px; width: 16px;
height: 15px; float: left;}

View File

@ -264,6 +264,7 @@ a.sortArrowActiveD {background:url(../images/post_image_list.png) -0px -20px no-
a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:5px;}
.creatPost {width:80px; height:25px; border-radius:3px; color:#ffffff; text-align:center; float:right; line-height:25px; vertical-align:middle; margin-top:2px;}
.creatPostIcon {background:url(../images/post_image_list.png) -40px -54px no-repeat; width:70px; height:25px; padding-left:10px; border-radius:3px;}
.creatPostIcon2 {width:60px; height:24px; padding-left:5px; border-radius:3px;line-height: 24px;}
.postRow {width:970px; border-bottom:1px solid #efefef; padding:15px 0;}
.postPortrait {width:75px; height:75px; float:left; margin-right:15px;}
.postWrap {width:690px; float:left; margin-right:95px;}
@ -316,6 +317,13 @@ a.postRouteLink:hover {text-decoration:underline;}
.resourceSendO {width:65px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-48px; top:20px; padding:2px 0px; display:none;}
.ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;}
.ReplyToMessageInputContainer {width:582px; float:left;}
/****翻页***/
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
ul.wlist li{float: left;}
ul.wlist li a{ border:1px solid #d1d1d1; padding: 1px 4px 1px 4px; margin-right:5px;}
ul.wlist li a:hover{ background:#3b94d6; 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: #3b94d6;cursor: default;}
/*博客列表界面样式*/
.listbox{ width:730px; background-color:#fff; border:1px solid #ddd; padding:10px; }
/*.bloglistbox{ min-height:690px;}*/

View File

@ -273,7 +273,7 @@ a:hover.qx_btn{color:#3b94d6;}
.navHomepageMenu:hover {background-color:#2182ca;}
.navHomepageSearchBoxcontainer {margin-top:11px;}
.navHomepageSearchBox {width:340px; border:none; outline:none; height:32px; background-color:#ffffff;}
#navHomepageSearch{margin-top: 11px;background-color: white; margin-left:75px;}
#navHomepageSearch{margin-top: 11px;background-color: white; }
.navHomepageSearchInput {width:345px; height:32px; outline:none; border:none !important; float:left; padding-left:5px !important; margin:0;}
#navSearchAlert {display:none;}
.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;}
@ -421,7 +421,7 @@ li.menuArrow:hover {background:url(/images/item.png) -20px -70px no-repeat;}
a.topnav_login_box:hover {color:#a1ebff;}
.navRow1 {margin:0; padding:0;}
.navRow2 {margin:0; padding:0;}
.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: 2px;}
.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:7px;}
.topnav_login_list a{color:#3b94d6;}
.topnav_login_list a:hover{color:#2182ca;}
.topnav_login_list li{ }