diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b1aae9b26..d14bccc4e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -507,7 +507,8 @@ class ApplicationController < ActionController::Base # render_404 # end - def self.model_object(model) + def self. + model_object(model) self.model_object = model end diff --git a/app/controllers/blog_comments_controller.rb b/app/controllers/blog_comments_controller.rb index dcab1b360..dcd549d76 100644 --- a/app/controllers/blog_comments_controller.rb +++ b/app/controllers/blog_comments_controller.rb @@ -144,7 +144,7 @@ class BlogCommentsController < ApplicationController if params[:parent_id] @blogComment.content = params[:blog_comment][:content] parent = BlogComment.find params[:parent_id] - @blogComment.reply_id = params[:reply_id] + @blogComment.reply_id = params[:id] parent.children << @blogComment else @quote = params[:quote][:quote] || "" diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index ceb63d7b0..099e9404a 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -161,6 +161,7 @@ class BoardsController < ApplicationController if @project render :action => 'show', :layout => 'base_projects' elsif @course + @left_nav_type = 2 @params=params render :action => 'show', :layout => 'base_courses' end @@ -185,6 +186,7 @@ class BoardsController < ApplicationController @board = @project.boards.build @board.safe_attributes = params[:board] if @project.project_type == 1 + @left_nav_type = 2 render :layout => 'base_courses' end end @@ -206,6 +208,7 @@ class BoardsController < ApplicationController def edit if @project.project_type == 1 + @left_nav_type = 2 render :layout => 'base_courses' end end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 5966b310f..9226b904c 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -19,8 +19,8 @@ class CommentsController < ApplicationController default_search_scope :news include ApplicationHelper model_object News - before_filter :find_model_object - before_filter :find_project_from_association + before_filter :find_model_object, :except => [:reply, :quote] + before_filter :find_project_from_association, :except => [:reply, :quote] before_filter :authorize def create @@ -73,7 +73,46 @@ class CommentsController < ApplicationController def destroy @news.comments.find(params[:comment_id]).destroy - redirect_to news_url(@news) + if params[:user_activity_id] + @user_activity_id = params[:user_activity_id] + respond_to do |format| + format.js + return + end + else + redirect_to news_url(@news) + end + end + + def quote + @comment = Comment.find(params[:id]) + respond_to do | format| + format.js + end + end + + def reply + comment = Comment.find(params[:id]) + @news = News.find comment.commented_id + new_comment = @news.comments.build(:author_id => User.current.id, :reply_id => params[:id], :comments => params[:content], :parent_id => comment.id) + @user_activity_id = params[:user_activity_id] + if new_comment.save + update_course_activity(@news.class,@news.id) + update_user_activity(@news.class,@news.id) + update_org_activity(@news.class,@news.id) + if @user_activity_id + respond_to do |format| + format.js + return + end + else + respond_to do |format| + format.html { + redirect_to news_path(@news) + } + end + end + end end private @@ -87,5 +126,4 @@ class CommentsController < ApplicationController @news end - end diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 28366b109..a38cc8d34 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -301,7 +301,6 @@ class CoursesController < ApplicationController def member ## 有角色参数的才是课程,没有的就是项目 if (User.current.admin? || @course.is_public == 1 || (@course.is_public == 0 && User.current.member_of_course?(@course))) - @render_file = 'new_member_list' @score_sort_by = "desc" @sort_type = params[:sort_type] ? params[:sort_type] : "score" @@ -414,6 +413,9 @@ class CoursesController < ApplicationController end def settings + #添加成员消息状态 + join_course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and status = ? and viewed =?", User.current.id, 'JoinCourse', @course.id, 1, 0) + join_course_messages.update_all(:viewed => true) if User.current.allowed_to?(:as_teacher,@course) @select_tab = params[:tab] @issue_custom_fields = IssueCustomField.sorted.all @@ -889,25 +891,28 @@ class CoursesController < ApplicationController if params[:type].present? case params[:type] when "homework" - @course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc') when "news" - @course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc') when "message" - @course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'Message'").order('updated_at desc') when "poll" - @course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'Poll'").order('updated_at desc') when "attachment" - @course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'Attachment'").order('updated_at desc') when "journalsForMessage" - @course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.where("course_act_type = 'JournalsForMessage'").order('updated_at desc') else - @course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.order('updated_at desc') end else - @course_activities = course_activities.order('updated_at desc').limit(10).offset(@page * 10) + @course_activities = course_activities.order('updated_at desc') end + @course_activities_count = @course_activities.count + @course_activities = @course_activities.limit(10).offset(@page * 10) @type = params[:type] + @left_nav_type = 1 respond_to do |format| format.js format.html{render :layout => 'base_courses'} @@ -939,6 +944,7 @@ class CoursesController < ApplicationController end @jour = paginateHelper @jours,10 @state = false + @left_nav_type = 6 respond_to do |format| format.html{render :layout => 'base_courses'} format.api @@ -1122,6 +1128,14 @@ class CoursesController < ApplicationController end end + #统计 + def statistics_course + @left_nav_type = 9 + respond_to do |format| + format.html {render :layout => 'base_courses'} + end + end + private def update_quotes attachment if attachment.copy_from diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index c3964c567..e3caaf9fb 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -29,6 +29,7 @@ class ExerciseController < ApplicationController exercises = @course.exercises.where("exercise_status <> 1").order("created_at asc") end @exercises = paginateHelper exercises,20 #分页 + @left_nav_type = 8 respond_to do |format| format.html end @@ -72,6 +73,7 @@ class ExerciseController < ApplicationController end # @percent = get_percent(@exercise,User.current) @exercise_questions = @exercise.exercise_questions + @left_nav_type = 8 respond_to do |format| format.html {render :layout => 'base_courses'} end @@ -118,6 +120,7 @@ class ExerciseController < ApplicationController end def edit + @left_nav_type = 8 respond_to do |format| format.html{render :layout => 'base_courses'} end @@ -159,6 +162,7 @@ class ExerciseController < ApplicationController @exercise = Exercise.find(params[:id]) exercise_questions = @exercise.exercise_questions @exercise_questions = paginateHelper exercise_questions, 5 + @left_nav_type = 8 respond_to do |format| format.html{render :layout => 'base_courses'} end @@ -379,6 +383,7 @@ class ExerciseController < ApplicationController else @exercise_users_list = [] end + @left_nav_type = 8 respond_to do |format| format.html format.xls { @@ -566,6 +571,7 @@ class ExerciseController < ApplicationController eu = get_exercise_user(@exercise.id, @user.id) eu.update_attributes(:score => score) @exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first + @left_nav_type = 8 respond_to do |format| format.html {render :layout => 'base_courses'} end diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index f06725d01..ed2b2ebfa 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -366,6 +366,7 @@ class FilesController < ApplicationController @tag_list = attachment_tag_list @all_attachments + @left_nav_type = 5 render :layout => 'base_courses' elsif params[:org_subfield_id] if params[:sort] @@ -445,6 +446,7 @@ class FilesController < ApplicationController @versions = @project.versions.sort @course_tag = @project.project_type if @project.project_type == 1 + @left_nav_type = 5 render :layout => 'base_courses' end end @@ -812,6 +814,7 @@ class FilesController < ApplicationController @attachtype = params[:type].to_i @contenttype = params[:contentType].to_s # render layout: 'base_courses' + @left_nav_type = 5 respond_to do |format| format.js format.html { diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 6724f42bb..2020915f8 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -39,6 +39,7 @@ class HomeworkCommonController < ApplicationController end end + @left_nav_type = 3 respond_to do |format| format.js format.html @@ -60,6 +61,7 @@ class HomeworkCommonController < ApplicationController @is_in_course = params[:is_in_course].to_i @course_activity = params[:course_activity].to_i if @is_in_course == 1 || @course_activity == 1 + @left_nav_type = 3 respond_to do |format| format.html{render :layout => 'base_courses'} end diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 049842e37..921d7d12b 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -432,15 +432,14 @@ class IssuesController < ApplicationController def add_journal if User.current.logged? - @jour = Journal.new - @jour.user_id = User.current.id - @jour.notes = params[:notes] - @jour.journalized = @issue - @jour.save_attachments(params[:attachments]) - @jour.save + jour = Journal.new + jour.user_id = User.current.id + jour.notes = params[:notes] + jour.journalized = @issue + jour.save_attachments(params[:attachments]) + jour.save update_user_activity(@issue.class,@issue.id) update_forge_activity(@issue.class,@issue.id) - @allowed_statuses = @issue.new_statuses_allowed_to(User.current) @user_activity_id = params[:user_activity_id] if params[:issue_id] @@ -474,7 +473,6 @@ class IssuesController < ApplicationController def reply @issue = Issue.find(params[:id]) @jour = Journal.find(params[:journal_id]) - @tempContent = "
#{ll(Setting.default_language, :text_user_wrote, @jour.user.realname.blank? ? @jour.user.login: @jour.user.realname)}
#{@jour.notes.html_safe}
".html_safe respond_to do |format| format.js end @@ -483,17 +481,17 @@ class IssuesController < ApplicationController #给issue添加journ。回复内容包含 对某个被回复的journ的内容 def add_reply if User.current.logged? - jour = Journal.new - jour.user_id = User.current.id - jour.notes = params[:quote]+params[:notes] + jour = Journal.find(params[:journal_id]) @issue = Issue.find params[:id] - jour.journalized = @issue - jour.save - update_user_activity(@issue.class,@issue.id) - update_forge_activity(@issue.class,@issue.id) + new_jour = @issue.journals.build(:user_id => User.current.id, :reply_id => params[:journal_id], :notes => params[:content], :parent_id => jour.id) + @user_activity_id = params[:user_activity_id] + if new_jour.save + update_user_activity(@issue.class,@issue.id) + update_forge_activity(@issue.class,@issue.id) - respond_to do |format| - format.html{redirect_to issue_url(@issue)} + respond_to do |format| + format.js + end end end end @@ -502,8 +500,9 @@ class IssuesController < ApplicationController def delete_journal @issue = Issue.find(params[:id]) Journal.destroy(params[:journal_id]) - respond_to do |format| - format.html{redirect_to issue_url(@issue)} + @user_activity_id = params[:user_activity_id] + respond_to do |format| + format.js end end diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb index f5ad89832..3e41e2c91 100644 --- a/app/controllers/messages_controller.rb +++ b/app/controllers/messages_controller.rb @@ -56,6 +56,7 @@ class MessagesController < ApplicationController all @replies = paginateHelper messages_replies,10 @reply = Message.new(:subject => "RE: #{@message.subject}") + @left_nav_type = 2 render :action => "show", :layout => "base_courses"#by young elsif @project @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page @@ -124,6 +125,7 @@ class MessagesController < ApplicationController end else + @left_nav_type = 2 respond_to do |format| format.html { layout_file = @project ? 'base_projects' : 'base_courses' @@ -140,15 +142,15 @@ class MessagesController < ApplicationController def reply if params[:parent_id] parent = Message.find params[:parent_id] + @topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i) @reply = Message.new @reply.author = User.current @reply.board = parent.board @reply.content = params[:content] - @reply.subject = "RE: #{parent.subject}" - @reply.reply_id = params[:reply_id] + @reply.subject = "RE: #{@topic.subject}" + @reply.reply_id = params[:id] # @reply.reply_id = params[:id] parent.children << @reply - @topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i) @user_activity_id = params[:user_activity_id] if params[:user_activity_id] @is_course = params[:is_course] if params[:is_course] @is_board = params[:is_board] if params[:is_board] @@ -241,6 +243,7 @@ class MessagesController < ApplicationController if @project layout_file = 'base_projects' elsif @course + @left_nav_type = 2 layout_file = 'base_courses' elsif @org_subfield @organization = @org_subfield.organization diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index 76b229dbf..190c3852b 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -56,7 +56,7 @@ class NewsController < ApplicationController :order => "#{News.table_name}.created_on DESC", :offset => @page * 10, :limit => 10) - + @left_nav_type = 4 respond_to do |format| format.html { @news = News.new # for adding news inline @@ -136,6 +136,7 @@ class NewsController < ApplicationController @newss = paginateHelper @newss,@limit #@newss = paginateHelper scope_order,10 + @left_nav_type = 4 respond_to do |format| format.html { @news = News.new @@ -176,6 +177,7 @@ class NewsController < ApplicationController if @news.course_id @course = Course.find(@news.course_id) if @course + @left_nav_type = 4 render :layout => 'base_courses' end elsif @news.org_subfield_id @@ -279,6 +281,7 @@ class NewsController < ApplicationController @organization = @org_subfield.organization end if @course + @left_nav_type = 4 render :layout => "base_courses" elsif @org_subfield render :layout => 'base_org' diff --git a/app/controllers/org_document_comments_controller.rb b/app/controllers/org_document_comments_controller.rb index 924be596e..a8a294d4d 100644 --- a/app/controllers/org_document_comments_controller.rb +++ b/app/controllers/org_document_comments_controller.rb @@ -1,6 +1,6 @@ class OrgDocumentCommentsController < ApplicationController before_filter :find_organization, :only => [:new, :create, :show, :index] - before_filter :authorize_allowed, :only => [:create, :add_reply] + before_filter :authorize_allowed, :only => [:create, :add_reply, :add_reply_in_doc] helper :attachments,:organizations layout 'base_org' diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb index e4cf31f55..ad04e68fa 100644 --- a/app/controllers/poll_controller.rb +++ b/app/controllers/poll_controller.rb @@ -15,6 +15,7 @@ class PollController < ApplicationController polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2") end @polls = paginateHelper polls,20 #分页 + @left_nav_type = 7 respond_to do |format| format.html{render :layout => 'base_courses'} end @@ -25,7 +26,7 @@ class PollController < ApplicationController def show @poll = Poll.find params[:id] - if @poll.polls_status != 2 && (!User.current.allowed_to?(:as_teacher,@course) || User.current.admin?) + if @poll.polls_status != 2 && !(User.current.allowed_to?(:as_teacher,@course) || User.current.admin?) render_403 return end @@ -44,6 +45,7 @@ class PollController < ApplicationController @percent = get_percent(@poll,User.current) poll_questions = @poll.poll_questions @poll_questions = paginateHelper poll_questions,5 #分页 + @left_nav_type = 7 respond_to do |format| format.html {render :layout => 'base_courses'} end @@ -78,6 +80,7 @@ class PollController < ApplicationController def edit respond_to do |format| + @left_nav_type = 7 format.html{render :layout => 'base_courses'} end end @@ -112,6 +115,7 @@ class PollController < ApplicationController @poll = Poll.find(params[:id]) poll_questions = @poll.poll_questions @poll_questions = paginateHelper poll_questions, 5 + @left_nav_type = 7 respond_to do |format| format.html{render :layout => 'base_courses'} end @@ -393,6 +397,7 @@ class PollController < ApplicationController #显示某个学生某份问卷的填写结果 def poll_result @poll_questions = paginateHelper @poll.poll_questions,5 + @left_nav_type = 7 respond_to do |format| format.html{render :layout => 'base_courses'} end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index cb86f1165..d8c174bc3 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -300,15 +300,13 @@ class ProjectsController < ApplicationController return end - logger.debug "111111111"*100 - # over @author = params[:user_id].blank? ? nil : User.active.find(params[:user_id]) @page = params[:page] ? params[:page].to_i + 1 : 0 # 根据私密性,取出符合条件的所有数据 if User.current.member_of?(@project) || User.current.admin? case params[:type] when nil - @events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'Project', 'Attachment')", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10) + @events_pages = ForgeActivity.where("project_id = ? and forge_act_type in ('Issue', 'Message','News', 'Project', 'Attachment','Commit')", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10) when 'issue' @events_pages = ForgeActivity.where("project_id = ? and forge_act_type = 'Issue'", @project).includes(:forge_act).order("updated_at desc").limit(10).offset(@page * 10) when 'news' @@ -321,8 +319,8 @@ class ProjectsController < ApplicationController else @events_pages = ForgeActivity.includes(:project).where("forge_activities.project_id = ? and projects.is_public = ? and forge_act_type != ? ",@project,1, "Document").order("created_at desc").page(params['page'|| 1]).per(10); end - logger.debug "2"*100 - # g = Gitlab.client + + # 版本库统计图 unless @project.gpid.nil? || @project.project_score.changeset_num == 0 # rep_statics_commit = @project.rep_statics.order("commits_num desc") rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") @@ -335,20 +333,14 @@ class ProjectsController < ApplicationController @a_commits_del = rep_statics_code.map {|s| s.del.to_i } @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } g = Gitlab.client - logger.debug "3"*100 begin gid = @project.gpid - logger.debug "31"*100 - g_branch = g.project(gid) - logger.debug "4"*100 - g_branch = g_branch.default_branch.to_s - logger.debug "5"*100 + g_project = g.project(gid) + g_branch = g_project.default_branch.to_s rescue =>e - logger.error("get gitlab project failed: " + e) + logger.error("get default branch failed: " + e) end - logger.debug "6"*100 @rev = g_branch.nil? ? "master" : g_branch - logger.debug "7"*100 end # 根据对应的请求,返回对应的数据 respond_to do |format| diff --git a/app/controllers/quality_analysis_controller.rb b/app/controllers/quality_analysis_controller.rb index 6b50c1788..80c5a2468 100644 --- a/app/controllers/quality_analysis_controller.rb +++ b/app/controllers/quality_analysis_controller.rb @@ -165,7 +165,7 @@ class QualityAnalysisController < ApplicationController logger.info("result: delete job ###################==>#{d_job}") qa.delete respond_to do |format| - format.html{redirect_to project_quality_analysis_path(:project_id => @project.id)} + format.html{redirect_to :controller => 'repositories', :action => 'show', :id => @project, :repository_id => gitlab_repository(@project).identifier} end rescue Exception => e puts e @@ -199,9 +199,6 @@ class QualityAnalysisController < ApplicationController # update成功则返回 ‘200’ jenkins_job = @client.job.update("#{job_name}", @doc.to_xml) - get_current_build_status = @client.job.get_current_build_status("Hjqreturn-1280") - logger.error("Failed to update job: ==> #{jenkins_job}") unless jenkins_job == '200' - # 数据更新到Trustie数据 if jenkins_job == '200' logger.info("quality_ananlysis will be updated: ==> #{jenkins_job}") diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 6b41e39fc..65b4a15d6 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -48,7 +48,7 @@ class RepositoriesController < ApplicationController include RepositoriesHelper helper :project_score #@root_path = RepositoriesHelper::ROOT_PATH - require 'net/ssh' + # require 'net/ssh' rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed def new diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 45b54cf0a..1b93bdeba 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -381,14 +381,24 @@ class StudentWorkController < ApplicationController @is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 @show_all = false - course_group = CourseGroup.find_by_id(@group) if @group - if course_group - group_students = course_group.users - if group_students.empty? - student_in_group = '(0)' + if @group + if @group == "0" + none_group_students = @course.members.select{ |member| member.course_group_id == 0 } + if none_group_students.empty? + student_in_group = '(0)' + else + student_in_group = '(' + none_group_students.map{ |member| member.user_id }.join(',') + ')' + end else - student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' + course_group = CourseGroup.find_by_id(@group) + group_students = course_group.users + if group_students.empty? + student_in_group = '(0)' + else + student_in_group = '(' + group_students.map{ |user| user.id }.join(',') + ')' + end end + #开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表 if (@homework.is_open == 1 && @course.is_public == 1) || (@homework.is_open == 1 && @course.is_public == 0 && User.current.member_of_course?(@course)) || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.has_committed.where(:user_id => User.current.id).empty?) if @order == 'lastname' @@ -526,6 +536,7 @@ class StudentWorkController < ApplicationController @is_focus = params[:is_focus] ? params[:is_focus].to_i : 0 # 消息传过来的ID @message_student_work_id = params[:student_work_id] + @left_nav_type = 3 respond_to do |format| format.js format.html @@ -918,6 +929,7 @@ class StudentWorkController < ApplicationController ORDER BY absence #{order}") end @order = order == "desc" ? "asc" : "desc" + @left_nav_type = 3 respond_to do |format| format.html end diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb index 291e6ca30..9c69f5259 100644 --- a/app/controllers/syllabuses_controller.rb +++ b/app/controllers/syllabuses_controller.rb @@ -13,7 +13,6 @@ class SyllabusesController < ApplicationController end def show - #@courses = @syllabus.courses respond_to do |format| format.js format.html{render :layout => 'base_syllabus'} @@ -109,11 +108,7 @@ class SyllabusesController < ApplicationController sort_name = "updated_on" sort_type = @c_sort == 1 ? "asc" : "desc" - if User.current == @syllabus.user || User.current.admin? - @courses = @syllabus.courses.where("is_delete = 0").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}") - else - @courses = User.current.courses.visible.where("is_delete =? and syllabus_id =?", 0, @syllabus.id).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}") - end + @courses = @syllabus.courses.where("is_delete = ?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS #{sort_name}").order("#{sort_name} #{sort_type}") #根据 作业+资源数排序 if @order.to_i == 2 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 5a88e90d3..5e968e854 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -94,6 +94,12 @@ class UsersController < ApplicationController @comment = Message.find params[:comment].to_i when 'BlogComment' @comment = BlogComment.find params[:comment].to_i + when 'OrgDocumentComment' + @comment = OrgDocumentComment.find params[:comment].to_i + when 'Comment' + @comment = Comment.find params[:comment].to_i + when 'Journal' + @comment = Journal.find params[:comment].to_i end end @@ -133,6 +139,16 @@ class UsersController < ApplicationController @user_activity_id = params[:user_activity_id] @activity_id = params[:activity_id] @type = 'OrgDocumentComment' + when 'News' + @reply = Comment.find params[:reply_id] + @user_activity_id = params[:user_activity_id] + @activity_id = params[:activity_id] + @type = 'News' + when 'Issue' + @reply = Journal.find params[:reply_id] + @user_activity_id = params[:user_activity_id] + @activity_id = params[:activity_id] + @type = 'Issue' end respond_to do |format| format.js @@ -709,9 +725,9 @@ class UsersController < ApplicationController @user = User.current @select_course = params[:select_course] ? 1 : 0 #@user_homeworks = HomeworkCommon.where(:user_id => @user.id).order("created_at desc") - visible_course = Course.where("is_public = 1 && is_delete = 0") - visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" - @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc") + courses = @user.courses.where("is_delete = 1") + course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")" + @homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and course_id not in #{course_ids}").order("#{@order} #{@b_sort}") @type = params[:type] @limit = 15 @is_remote = true @@ -933,6 +949,7 @@ class UsersController < ApplicationController @student_work = StudentWork.new end @course = @homework.course + @left_nav_type = 3 respond_to do |format| format.js format.html {render :layout => 'base_courses'} @@ -1549,7 +1566,11 @@ class UsersController < ApplicationController when "current_user" @user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10) else - blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" + if @user == User.current + blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" + else + blog_ids = "("+@user.blog.id.to_s+")" + end @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types})" + "or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}) "+ "or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id}) " + @@ -1559,8 +1580,12 @@ class UsersController < ApplicationController # @user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})or (container_type = 'Principal' and act_type= '#{principal_types}' and container_id = #{@user.id})").order('updated_at desc').limit(10).offset(@page * 10) # blog_ids = "("+@user.blog.id.to_s+","+((User.watched_by(@user.id).count == 0 )? '0' :User.watched_by(@user.id).map{|u| u.blog.id}.join(','))+")" # 减少数据库交互 - watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(',')) - user_ids = "(" + @user.id.to_s + watched_user_ids + ")" + if @user == User.current + watched_user_ids = User.watched_by(@user.id).count == 0 ? " " : ("," + User.watched_by(@user.id).map{|u| u.id.to_s }.join(',')) + user_ids = "(" + @user.id.to_s + watched_user_ids + ")" + else + user_ids = "(" + @user.id.to_s + ")" + end watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}") blog_ids = watched_user_blog_ids.empty? ? "(-1)" : "(" + watched_user_blog_ids.map { |blog| blog.id}.join(",") + ")" @@ -3312,19 +3337,22 @@ class UsersController < ApplicationController when 'News' obj = News.where('id = ?', params[:id].to_i).first @journals = obj.comments.reorder("created_on desc") + @type = 'News' + @user_activity_id = params[:div_id].to_i if params[:div_id] when 'Syllabus' obj = Syllabus.where('id = ?', params[:id].to_i).first - @journals = obj.comments.reorder("created_on desc") + @journals = obj.journals_for_messages.reorder("created_on desc") when 'JournalsForMessage' obj = JournalsForMessage.where('id = ?', params[:id].to_i).first journals = [] @journals = get_all_children(journals, obj) @type = 'JournalsForMessage' @user_activity_id = params[:div_id].to_i if params[:div_id] - @allow_delete = params[:allow_delete] when 'Issue' obj = Issue.where('id = ?', params[:id].to_i).first @journals = obj.journals.reorder("created_on desc") + @type = 'Issue' + @user_activity_id = params[:div_id].to_i if params[:div_id] when 'BlogComment' obj = BlogComment.where('id = ?', params[:id].to_i).first @user_activity_id = params[:div_id].to_i if params[:div_id] @@ -3334,6 +3362,7 @@ class UsersController < ApplicationController @journals = get_all_children(comments, obj) when 'HomeworkCommon' obj = HomeworkCommon.where('id = ?', params[:id].to_i).first + @type = 'HomeworkCommon' @journals = obj.journals_for_messages.reorder("created_on desc") @is_in_course = params[:is_in_course].to_i if params[:is_in_course] @course_activity = params[:course_activity].to_i if params[:course_activity] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 603084cd1..7aae73e94 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -38,6 +38,24 @@ module ApplicationHelper # super # end + # 通过系统外部邮箱查找用户,如果用户不存在则用邮箱替换 + def get_user_by_mail mail + user = User.find_by_mail(mail) + user.nil? ? User.find(2) : user + end + + # 历史数据(老版本库数据)处理完则可以修改该放放 + def get_rep_identifier_by_project project + identifier = Repository.where(:project_id => project.id, :type => "Repository::Gitlab").first.try(:identifier) + result = identifier.nil? ? Repository.where(:project_id => project.id).first.try(:identifier) : identifier + result + end + + # 获取用户单位 + # 优先获取高校信息,如果改信息不存在则获取occupation + def get_occupation_from_user user + School.where("id=?",user.user_extensions.school_id).first.try(:name).nil? ? user.user_extensions.try(:occupation) : School.where("id=?",user.user_extensions.school_id).first.try(:name) + end def update_visiti_count container container.update_column(:visits, container.visits + 1) diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index d1f4bfe97..96e0d7683 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -35,7 +35,7 @@ module CoursesHelper and (c.is_excellent =1 or c.excellent_option =1) and c.is_public = 1 and c.id != #{current_course.id} order by cs.updated_at desc;" default_ids = Course.find_by_sql(sql).flatten.map { |c| c.id } excellent_ids << default_ids.flatten - arr_result = excellent_ids.flatten.uniq.first(5) + arr_result = excellent_ids.flatten.uniq.first(3) excellent_courses = Course.find(arr_result) return excellent_courses end @@ -78,18 +78,18 @@ module CoursesHelper #生成课程老师成员链接 def course_teacher_link teacher_num if User.current.member_of_course?(@course) || User.current.admin? - link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'info_foot_num c_blue', :id => 'teacher_number' + link_to "#{teacher_num}", course_member_path(@course, :role => 1), :class => 'sy_cblue', :id => 'teacher_number' else - content_tag 'span',teacher_num, :class => 'info_foot_num c_blue' + content_tag 'span',teacher_num, :class => 'sy_cblue' end end #生成课程学生列表连接 def course_student_link student_num if (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course)) || User.current.admin? - link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'info_foot_num c_blue', :id => "student_number" + link_to "#{student_num}", course_member_path(@course, :role => 2), :class => 'sy_cblue', :id => "student_number" else - content_tag 'span',student_num, :class => 'info_foot_num c_blue' + content_tag 'span',student_num, :class => 'sy_cblue' end end @@ -591,6 +591,26 @@ module CoursesHelper Course.tagged_with(tag_name).order('updated_at desc') end + # 获取动态列表名称 + def get_acts_list_type type + case type + when "homework" + ">" + l(:label_homework_acts) + when "news" + ">" + l(:label_news_acts) + when "attachment" + ">" + l(:label_attachment_acts) + when "message" + ">" + l(:label_message_acts) + when "journalsForMessage" + ">" + l(:label_journalsForMessage_acts) + when "poll" + ">" + l(:label_poll_acts) + else + ">" + l(:label_all_cats) + end + end + #分班下拉框 def course_group_option course type = [] @@ -772,12 +792,12 @@ module CoursesHelper url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id) method = joined ? 'delete' : 'post' if joined - link = link_to(text, url, :remote => true, :method => method, :class => "Blue-btn", :style => "margin_left: 0px;", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) + link = link_to(text, url, :remote => true, :method => method, :class => "sy_btn_grey fl", :id => "#{course.id}", :confirm => l(:text_are_you_sure_out)) else - link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "Blue-btn", :style => "margin_left: 0px;") + link = link_to(text, url, :remote => true, :method => method, :id => "#{course.id}", :class => "sy_btn_grey fl") end else - link = "#{l(:label_course_join_student)}" + link = "#{l(:label_course_join_student)}" end link.html_safe end @@ -872,7 +892,7 @@ module CoursesHelper desc.html_safe end - # 学生按作业总分排序,取前8个 + # 学生按作业总分排序,取前3个 def hero_homework_score(course, score_sort_by) sql_select = "SELECT members.*,( SELECT SUM(work_score) @@ -884,14 +904,14 @@ module CoursesHelper FROM members JOIN students_for_courses ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id - WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 9" + WHERE members.course_id = #{course.id} ORDER BY score #{score_sort_by} limit 3" homework_scores = Member.find_by_sql(sql_select) end def contributor_course_scor(course_id) ccs = CourseContributorScore.find_by_sql("SELECT * FROM `course_contributor_scores` where course_id = #{course_id} order by (message_num*2 + message_reply_num + news_reply_num + news_num + - resource_num*5 + journal_num + homework_journal_num ) desc limit 9;") + resource_num*5 + journal_num + homework_journal_num ) desc limit 3;") end end diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index 42a3a6538..4f0a2ca6d 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -101,6 +101,10 @@ module StudentWorkHelper if course.course_groups && !course.course_groups.empty? base = [] base << l(:label_chose_group) + base << -1 + result << base + base = [] + base << l(:label_no_group) base << 0 result << base course.course_groups.each do |group| diff --git a/app/models/changeset.rb b/app/models/changeset.rb index f72342257..149f4b163 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -22,9 +22,7 @@ class Changeset < ActiveRecord::Base #after_save :be_user_score # user_score has_many :filechanges, :class_name => 'Change', :dependent => :delete_all - # fq - has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy - # end + has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy #Added by nie has_one :project_status, :dependent => :destroy @@ -59,7 +57,6 @@ class Changeset < ActiveRecord::Base validates :committed_on, presence: true validates :commit_date, presence: true validates :scmid, uniqueness: {scope: :repository_id, allow_nil: true} - scope :visible, lambda {|*args| includes(:repository => :project).where(Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args)) } @@ -68,7 +65,7 @@ class Changeset < ActiveRecord::Base # after_update :be_user_score after_destroy :down_user_score # before_create :before_create_cs - after_create :act_as_forge_activity + # after_create :act_as_forge_activity def revision=(r) @@ -118,7 +115,7 @@ class Changeset < ActiveRecord::Base # 项目中提交动态,类型Changeset # type:0 为老版本即Trsutie数据 1为gitlab中获取的动态 def act_as_forge_activity - self.acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true) + self.forge_acts << ForgeActivity.new(:user_id => self.user_id, :project_id => self.project_id, :type => true) end def scan_for_issues diff --git a/app/models/comment.rb b/app/models/comment.rb index 80b52a8f4..633c9a825 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -33,10 +33,11 @@ class Comment < ActiveRecord::Base :title=>Proc.new {|o| "RE: #{o.commented.title}" }, :url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.commented.id} } + acts_as_tree :counter_cache => :comments_count, :order => "#{Comment.table_name}.created_on ASC" belongs_to :commented, :polymorphic => true, :counter_cache => true,:touch => true belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' validates_presence_of :commented, :author, :comments - safe_attributes 'comments' + safe_attributes 'comments','parent_id','reply_id','comments_count' after_create :send_mail, :act_as_system_message, :act_as_student_score after_destroy :down_course_score diff --git a/app/models/commit.rb b/app/models/commit.rb new file mode 100644 index 000000000..a6633206a --- /dev/null +++ b/app/models/commit.rb @@ -0,0 +1,13 @@ +class Commit < ActiveRecord::Base + attr_accessible :comments, :committed_on, :committer, :project_id, :repository_id, :version + validates :repository_id, presence: true + validates :version, presence: true, uniqueness: {scope: :repository_id} + validates :committed_on, presence: true + has_many :forge_acts, :class_name => 'ForgeActivity',:as =>:forge_act ,:dependent => :destroy + after_create :act_as_forge_activity + + # 项目中提交动态 + def act_as_forge_activity + self.forge_acts << ForgeActivity.new(:user_id => 2, :project_id => self.project_id) + end +end diff --git a/app/models/forge_activity.rb b/app/models/forge_activity.rb index 47ebf4d0f..5fe953f66 100644 --- a/app/models/forge_activity.rb +++ b/app/models/forge_activity.rb @@ -25,8 +25,11 @@ class ForgeActivity < ActiveRecord::Base # 在个人动态里面增加当前动态 # 版本库提交动态不显示在用户动态中 + # Commit为版本库提交类型,因为是从gitlab获取,不能实时更新 def add_user_activity - if self.forge_act_type != "Changeset" + if self.forge_act_type == "Commit" + self.update_column(:updated_at, self.forge_act.committed_on) + else user_activity = UserActivity.where("act_type = '#{self.forge_act_type.to_s}' and act_id = '#{self.forge_act_id}'").first if user_activity user_activity.save @@ -50,7 +53,9 @@ class ForgeActivity < ActiveRecord::Base # 项目提交动态不显示在组织动态中 def add_org_activity - if self.forge_act_type != "Changeset" + if self.forge_act_type == "Commit" + self.update_column(:updated_at, self.forge_act.committed_on) + else org_activity = OrgActivity.where("org_act_type = '#{self.forge_act_type.to_s}' and org_act_id = #{self.forge_act_id}").first if org_activity org_activity.updated_at = self.updated_at diff --git a/app/models/journal.rb b/app/models/journal.rb index 0f88fcb7f..d2cc9e539 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -37,6 +37,7 @@ class Journal < ActiveRecord::Base has_many :at_messages, as: :at_message, dependent: :destroy acts_as_attachable attr_accessor :indice + acts_as_tree :counter_cache => :comments_count, :order => "#{Journal.table_name}.created_on ASC" acts_as_event :title =>Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.project_index}#{status}: #{o.issue.subject}" }, :description =>:notes, diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index ab4b65f5c..d864b6462 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -162,7 +162,7 @@ class CoursesService raise '403' end end - @comments = @news.comments + @comments = @news.comments.reorder("created_on desc") @comments.reverse! if current_user.wants_comments_in_reverse_order? {:news => @news,:comments => @comments} diff --git a/app/views/admin/users.html.erb b/app/views/admin/users.html.erb index 2a757fdee..9215782bb 100644 --- a/app/views/admin/users.html.erb +++ b/app/views/admin/users.html.erb @@ -56,8 +56,7 @@ <%= checked_image user.admin? %> <%= format_time(user.created_on) %> <%= format_time(user.last_login_on) unless user.last_login_on.nil? %> - <% occupation = user.user_extensions.identity == 0 ? School.where("id=?",user.user_extensions.school_id).first.try(:name) : user.user_extensions.occupation %> - <%= truncate( occupation, :length => 12 ) %> + <%= truncate(get_occupation_from_user(user), :length => 12 ) %> <%= change_status_link(user) %> <%= delete_link user_path(user, :back_url => admin_users_path(params)) unless User.current == user %> diff --git a/app/views/blog_comments/_edit.html.erb b/app/views/blog_comments/_edit.html.erb index 048402635..b9d10527d 100644 --- a/app/views/blog_comments/_edit.html.erb +++ b/app/views/blog_comments/_edit.html.erb @@ -39,6 +39,8 @@ %>

+

+

@@ -56,4 +58,11 @@
- \ No newline at end of file + + \ No newline at end of file diff --git a/app/views/blog_comments/_new.html.erb b/app/views/blog_comments/_new.html.erb index e336c7d01..de7be84c1 100644 --- a/app/views/blog_comments/_new.html.erb +++ b/app/views/blog_comments/_new.html.erb @@ -36,6 +36,8 @@ :maxlength => 5000 }%>

+

+

@@ -62,4 +64,4 @@
-->
- \ No newline at end of file + diff --git a/app/views/blog_comments/show.html.erb b/app/views/blog_comments/show.html.erb index bde98d456..f5c7c9094 100644 --- a/app/views/blog_comments/show.html.erb +++ b/app/views/blog_comments/show.html.erb @@ -135,13 +135,8 @@ <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
-
- <%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %> - <%= time_from_now(comment.created_on) %> -
- <% if !comment.parent.nil? && !comment.parent.parent.nil? %> - <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> - <% end %> + <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> + <% if !comment.content_detail.blank? %>
<%= comment.content_detail.html_safe %> diff --git a/app/views/blogs/_homepage.html.erb b/app/views/blogs/_homepage.html.erb index d5a5c0d64..a16547836 100644 --- a/app/views/blogs/_homepage.html.erb +++ b/app/views/blogs/_homepage.html.erb @@ -51,13 +51,13 @@ <% all_comments = []%> <% count=get_all_children(all_comments, activity).count %>
- <%= render :partial => 'users/blog_comment_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %> + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %> <% all_comments = []%> <% comments = get_all_children(all_comments, activity)[0..2] %> <% if count > 0 %>
- <%= render :partial => 'users/blog_comments_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1}%> + <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1}%>
<% end %> diff --git a/app/views/blogs/index.html.erb b/app/views/blogs/index.html.erb index 50db24063..f473ab534 100644 --- a/app/views/blogs/index.html.erb +++ b/app/views/blogs/index.html.erb @@ -184,3 +184,10 @@ function nh_init_board(params){ + diff --git a/app/views/boards/_course_new.html.erb b/app/views/boards/_course_new.html.erb index df61d2b9c..32cec24d5 100644 --- a/app/views/boards/_course_new.html.erb +++ b/app/views/boards/_course_new.html.erb @@ -130,11 +130,13 @@

<% end %> \ No newline at end of file diff --git a/app/views/courses/_course_heroes.html.erb b/app/views/courses/_course_heroes.html.erb index ea05eea53..4699c12d2 100644 --- a/app/views/courses/_course_heroes.html.erb +++ b/app/views/courses/_course_heroes.html.erb @@ -1,9 +1,9 @@ <% hero_homework_scores = hero_homework_score(course, "desc") %> <% unless hero_homework_scores.map(&:score).detect{|s| s.to_i != 0}.nil? %>
\ No newline at end of file diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 57969faa5..cd85b8067 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -1,4 +1,5 @@ <%= stylesheet_link_tag 'polls', :media => 'all' %> +

@@ -221,3 +222,4 @@

+
\ No newline at end of file diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb index da89bf26e..fb9e9d26b 100644 --- a/app/views/poll/statistics_result.html.erb +++ b/app/views/poll/statistics_result.html.erb @@ -1,4 +1,5 @@ <%= stylesheet_link_tag 'polls', :media => 'all' %> +

@@ -32,4 +33,5 @@

+
\ No newline at end of file diff --git a/app/views/projects/_project_activities.html.erb b/app/views/projects/_project_activities.html.erb index 6322a532a..2e119ed7c 100644 --- a/app/views/projects/_project_activities.html.erb +++ b/app/views/projects/_project_activities.html.erb @@ -72,23 +72,8 @@ <% when "Attachment" %> <%= render :partial => 'users/project_attachment', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id } %> - - - - - - - - - <%#= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %> - - - - - - - - + <% when "Commit" %> + <%= render :partial => 'projects/project_commit', :locals => {:activity => activity.forge_act, :user_activity_id => activity.id, :identifier => get_rep_identifier_by_project(@project) } %> <% end %> <% end %> <% end %> diff --git a/app/views/projects/_project_commit.html.erb b/app/views/projects/_project_commit.html.erb new file mode 100644 index 000000000..eea981a9d --- /dev/null +++ b/app/views/projects/_project_commit.html.erb @@ -0,0 +1,28 @@ +<% project = Project.find(activity.project_id) %> +<% user = get_user_by_mail(activity.committer) %> +
+
+
+ <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %> + <%= render :partial => 'users/show_detail_info', :locals => {:user => user} %> +
+
+
+ <% if user.try(:realname) == ' ' %> + <%= link_to user, user_path(user), :class => "newsBlue mr15" %> + <% else %> + <%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %> + <% end %> + TO + <%= link_to project.to_s+" | 项目代码提交", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %> +
+
+ <%= link_to activity.comments, {:controller => 'repositories', :action => 'commit_diff', :id => project.id, :repository_id => identifier, :changeset => activity.version}, :class => "postGrey" %> +
+
+ 提交时间:<%= format_time(activity.committed_on) %> +
+
+
+
+
diff --git a/app/views/projects/_project_news.html.erb b/app/views/projects/_project_news.html.erb index e751e16ae..161221526 100644 --- a/app/views/projects/_project_news.html.erb +++ b/app/views/projects/_project_news.html.erb @@ -61,7 +61,7 @@ <% comments = activity.comments.reorder("created_on desc").limit(3) %> <% if count > 0 %>
- <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%> + <%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'News', :activity_id => activity.id} %>
<% end %> diff --git a/app/views/quality_analysis/_show.html.erb b/app/views/quality_analysis/_show.html.erb index b364f5f89..7901c6be0 100644 --- a/app/views/quality_analysis/_show.html.erb +++ b/app/views/quality_analysis/_show.html.erb @@ -34,7 +34,7 @@

代码重复度

<%= @ha["duplicated_lines_density"].to_i == 0 ? 0 : @ha["duplicated_lines_density"] %> borderRadius"> - <%= @ha["duplicated_lines_density"].nil? ? 0 : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %> + <%= @ha["duplicated_lines_density"].nil? ? "良好" : duplicated_lines_density_status(@ha["duplicated_lines_density"].to_i)[0] %>

@@ -43,7 +43,7 @@

注释率

<%= @ha["comment_lines_density"].to_i == 0 ? 0 : @ha["comment_lines_density"] %> borderRadius"> - <%= @ha["comment_lines_density"].nil? ? 0 : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %> + <%= @ha["comment_lines_density"].nil? ? "较低" : comment_lines_density_status(@ha["comment_lines_density"].to_i)[0] %>

diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index 484e8eb0e..039baa386 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -59,9 +59,14 @@
  • 内容: -
    - <%= work.description.html_safe if work.description%> -
    + <% com_contents = work.work_status %> + <% if com_contents != 0 && work.description %> +
    + <%= work.description.html_safe %> +
    + <% else %> + 该作品未在线下完成提交 + <% end %>
  • diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 6bdc3753e..3ec6232db 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -7,7 +7,7 @@ -
    -

    课程信息

    -
    -<% if @syllabus.des_status == 1 && @syllabus.courses.where("is_delete = 0").empty? %> -
    - <% if User.current == @syllabus.user %> -

    您建立的课程还未创建班级,请 - <%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "syllabusbox_a_blue", :target => '_blank'%> -

    - <% else %> -

    本课程下还未创建班级,敬请期待。 -

    - <% end %> -
    -<% end %> -
    - <% if @syllabus.des_status == 0%> - <% if User.current == @syllabus.user %> -

    您建立的课程尚未填写课程大纲,请完善您的<%=link_to '课程大纲', edit_syllabus_path(@syllabus), :class => 'syllabusbox_a_blue' %>!

    - <% else %> -

    <%=@syllabus.user.show_name %>老师尚未完成课程大纲的编写,敬请期待。

    - <% end %> + +
    + <% if @syllabus.des_status == 0 && User.current == @syllabus.user %> +
    +

    您建立的课程尚未填写课程大纲,请完善您的 <%=link_to '课程大纲', edit_syllabus_path(@syllabus), :class => 'sy_corange' %>,谢谢啦!

    + <% elsif @syllabus.des_status == 0 %> +
    +

    该课程尚未填写课程大纲,敬请期待!

    <% else %> -
    - <%=@syllabus.description.html_safe %> -
    - <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @syllabus} %> -
    -
    - <% if User.current.logged? && User.current == @syllabus.user%> -
    -
      -
    • -
        -
      • <%=link_to '编辑', edit_syllabus_path(@syllabus), :class => 'postOptionLink'%>
      • -
      • <%=link_to '删除', delete_des_syllabus_path(@syllabus), :class => 'postOptionLink', :confirm => l(:text_are_you_sure)%>
      • -
      -
    • -
    +
    +
    + <%=@syllabus.description.html_safe %> +
    + <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @syllabus} %>
    -
    - <% end %> -
    更新时间:<%=format_time @syllabus.updated_at %>
    -
    -<% end %> - +
    + <% if User.current.logged? && User.current == @syllabus.user%> +
    +
      +
    • +
        +
      • <%=link_to '编辑', edit_syllabus_path(@syllabus), :class => 'postOptionLink'%>
      • +
      • <%=link_to '删除', delete_des_syllabus_path(@syllabus), :class => 'postOptionLink', :confirm => l(:text_are_you_sure)%>
      • +
      +
    • +
    +
    +
    + <% end %> +
    更新时间:<%=format_time @syllabus.updated_at %>
    +
    +
    + <% end %> <% count=@syllabus.journals_for_messages.count %> -
    +
    <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => @syllabus, :user_activity_id => @syllabus.id} %> <% comments = @syllabus.journals_for_messages.reorder("created_on desc").limit(3) %> @@ -62,26 +56,28 @@ <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%>
    <% end %> -
    -
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
    -
    - <% if User.current.logged? %> -
    - <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_syllabus_message', :id => @syllabus.id},:method => "post") do |f|%> -
    - - -
    -

    - <% end%> -
    - <% else %> - <%= render :partial => "users/show_unlogged" %> - <% end %> +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
    +
    + <% if User.current.logged? %> +
    + <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_syllabus_message', :id => @syllabus.id},:method => "post") do |f|%> +
    + + +
    +

    + <% end%> +
    + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
    +
    -
    -
    -
    -
    +
    +
    + + diff --git a/app/views/syllabuses/syllabus_courselist.html.erb b/app/views/syllabuses/syllabus_courselist.html.erb index 0b0713738..ecb8ed7b8 100644 --- a/app/views/syllabuses/syllabus_courselist.html.erb +++ b/app/views/syllabuses/syllabus_courselist.html.erb @@ -1 +1,12 @@ -<%= render :partial => 'syllabus_course_list'%> \ No newline at end of file + + +
    + <%=render :partial => 'syllabuses/syllabus_course_list' %> +
    diff --git a/app/views/syllabuses/syllabus_courselist.js.erb b/app/views/syllabuses/syllabus_courselist.js.erb index 5433ea2c1..1fc73f8e6 100644 --- a/app/views/syllabuses/syllabus_courselist.js.erb +++ b/app/views/syllabuses/syllabus_courselist.js.erb @@ -1 +1 @@ -$("#course-list").replaceWith('<%= escape_javascript( render :partial => 'syllabus_course_list') %>'); \ No newline at end of file +$("#sy_tab_con_2").html('<%= escape_javascript( render :partial => 'syllabus_course_list') %>'); \ No newline at end of file diff --git a/app/views/users/_blog_comment_reply_banner.html.erb b/app/views/users/_blog_comment_reply_banner.html.erb deleted file mode 100644 index 496cd2c7c..000000000 --- a/app/views/users/_blog_comment_reply_banner.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -
    -
    - 回复 - ︿ - <%= count>0 ? "(#{count})" : "" %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - -
    -
    <%#= format_date(activity.updated_on) %>
    - <%if count>3 %> - - <% end %> -
    \ No newline at end of file diff --git a/app/views/users/_blog_comments_replies.html.erb b/app/views/users/_blog_comments_replies.html.erb deleted file mode 100644 index b4a134b7b..000000000 --- a/app/views/users/_blog_comments_replies.html.erb +++ /dev/null @@ -1,60 +0,0 @@ - \ No newline at end of file diff --git a/app/views/users/_comment_reply_detail.html.erb b/app/views/users/_comment_reply_detail.html.erb index b8ea13cf4..3c9f3d279 100644 --- a/app/views/users/_comment_reply_detail.html.erb +++ b/app/views/users/_comment_reply_detail.html.erb @@ -4,6 +4,17 @@
    <%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %> <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> -
    <%= comment.content_detail.html_safe %>
    +
    + <% if comment.class == Journal %> + <% if comment.details.any? %> + <% details_to_strings(comment.details).each do |string| %> +

    <%= string %>

    + <% end %> + <% end %> +

    <%= comment.content_detail.html_safe %>

    + <% else %> + <%= comment.content_detail.html_safe %> + <% end %> +
    \ No newline at end of file diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index f87b483da..ded407f8c 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -290,28 +290,12 @@ <% count=activity.journals_for_messages.count %>
    -
    -
    回复 - ︿ - <%= count>0 ? "(#{count})" : "" %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - -
    -
    - <%if count>3 %> - - <% end %> -
    + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :is_in_course => -1,:course_activity=>course_activity} %> <% comments = activity.journals_for_messages.reorder("created_on desc").limit(3) %> <% if count > 0 %>
    - <%=render :partial => 'users/homework_replies', :locals => {:comments => comments, :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %> + <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => -1,:course_activity=>course_activity, :is_teacher => is_teacher, :user_activity_id => user_activity_id} %>
    <% end %> diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index 64ba9f6df..3225a1a8b 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -40,16 +40,14 @@
    <% all_comments = []%> <% count=get_all_children(all_comments, activity).count %> - <% allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %> - <%# count = fetch_user_leaveWord_reply(activity).count %>
    - <%= render :partial => 'users/journal_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :allow_delete => allow_delete} %> + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> <% all_comments = []%> <% comments = get_all_children(all_comments, activity)[0..2] %> <% if count > 0 %>
    - <%= render :partial => 'users/journal_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :allow_delete => allow_delete, :activity_id =>activity.id}%> + <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>
    <% end %> diff --git a/app/views/users/_course_message.html.erb b/app/views/users/_course_message.html.erb index 48daa6e95..692ad4e59 100644 --- a/app/views/users/_course_message.html.erb +++ b/app/views/users/_course_message.html.erb @@ -81,7 +81,7 @@ <% all_comments = []%> <% count=get_all_children(all_comments, activity).count %>
    - <%= render :partial => 'users/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %> + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %> <% all_comments = []%> <% comments = get_all_children(all_comments, activity)[0..2] %> @@ -97,7 +97,7 @@
    <% if User.current.logged? %>
    - <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,is_course=>is_course},:method => "post", :remote => true) do |f|%> + <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => is_board,:is_course=>is_course},:method => "post", :remote => true) do |f|%>
    diff --git a/app/views/users/_course_news.html.erb b/app/views/users/_course_news.html.erb index 18f16b068..f46282ff8 100644 --- a/app/views/users/_course_news.html.erb +++ b/app/views/users/_course_news.html.erb @@ -62,6 +62,7 @@
    + <% count=activity.comments.count %>
    <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> @@ -69,31 +70,32 @@ <% comments = activity.comments.reorder("created_on desc").limit(3) %> <% if count > 0 %>
    - <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%> + <%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'News', :activity_id => activity.id} %> +
    + <% end %> + <% if activity.commentable? %> +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
    +
    + <% if User.current.logged? %> +
    + <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> + +
    + + +
    +

    + <% end%> +
    + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
    +
    +
    <% end %> - -
    -
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
    -
    - <% if User.current.logged? %> -
    - <%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%> - -
    - - -
    -

    - <% end%> -
    - <% else %> - <%= render :partial => "users/show_unlogged" %> - <% end %> -
    -
    -
    -
    -
  • -
    - <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %> -
    -
    -
    - <%= link_to comment.user.show_name, user_path(comment.user_id), :class => "newsBlue mr10 f14" %> - <%= time_from_now(comment.created_on) %> -
    - <% unless comment.m_parent_id.nil? %> - <% parents_rely = [] %> - <% parents_rely = get_reply_parents parents_rely, comment %> - <% length = parents_rely.length %> -
    - <% if length <= 3 %> - <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %> - <% else %> -
    -
    -
    - <%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %> -
    - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %> -
    -
    - - - <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %> -
    - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %> -
    - <% end %> -
    - <% end %> -
    - <%= comment.notes.html_safe %> -
    -
    -
    - - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - - - <%= link_to( - l(:button_reply), - {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => 'HomeworkCommon', :is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity}, - :remote => true, - :method => 'get', - :title => l(:button_reply)) %> - - - - <% if User.current.admin? ||is_teacher || comment.user == User.current%> - <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user,:is_in_course => is_in_course, :user_activity_id => user_activity_id, :course_activity => course_activity}, - :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> - <% end %> - -
    -
    -
    -

    -
    -
    -
  • - <% end %> - \ No newline at end of file diff --git a/app/views/users/_journal_replies.html.erb b/app/views/users/_journal_replies.html.erb deleted file mode 100644 index 7fc708ebb..000000000 --- a/app/views/users/_journal_replies.html.erb +++ /dev/null @@ -1,85 +0,0 @@ - \ No newline at end of file diff --git a/app/views/users/_journal_reply_banner.html.erb b/app/views/users/_journal_reply_banner.html.erb deleted file mode 100644 index c231f473d..000000000 --- a/app/views/users/_journal_reply_banner.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -
    -
    - 回复 - ︿ - <%= count>0 ? "(#{count})" : "" %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - -
    -
    <%#= format_date(activity.updated_on) %>
    - <%if count>3 %> -
    - - 展开更多 - -
    - <% end %> -
    \ No newline at end of file diff --git a/app/views/users/_message_contents.html.erb b/app/views/users/_message_contents.html.erb index eab125006..365914908 100644 --- a/app/views/users/_message_contents.html.erb +++ b/app/views/users/_message_contents.html.erb @@ -1,23 +1,29 @@ -<% parents_rely = [] %> -<% parents_rely = get_reply_parents_no_root parents_rely, comment %> -<% length = parents_rely.length %> -
    - <% if length <= 3 %> - <%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %> - <% else %> -
    -
    -
    - <%=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %> +
    + <%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %> + <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> +
    +<% if !comment.parent.nil? && !comment.parent.parent.nil? %> + <% parents_rely = [] %> + <% parents_rely = get_reply_parents_no_root parents_rely, comment %> + <% length = parents_rely.length %> +
    + <% if length <= 3 %> + <%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %> + <% else %> +
    +
    +
    + <%=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %> +
    + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %> +
    +
    + + + <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %> +
    + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
    - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %> -
    -
    - - - <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %> -
    - <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %> -
    - <% end %> -
    \ No newline at end of file + <% end %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/users/_message_replies.html.erb b/app/views/users/_message_replies.html.erb index c6f9d91b0..9ef2d146d 100644 --- a/app/views/users/_message_replies.html.erb +++ b/app/views/users/_message_replies.html.erb @@ -11,13 +11,8 @@ <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %>
    -
    - <%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %> - <%= time_from_now(comment.created_on) %> -
    - <% if !comment.parent.nil? && !comment.parent.parent.nil? %> - <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> - <% end %> + <%= render :partial => 'users/message_contents', :locals => {:comment => comment}%> + <% if !comment.content_detail.blank? %>
    <%= comment.content_detail.html_safe %> @@ -28,6 +23,7 @@ <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + <% if type == 'Message' %> <%= link_to( l(:button_reply), @@ -37,7 +33,7 @@ :title => l(:button_reply)) %> - <% if comment.course_destroyable_by?(User.current) %> + <% if comment.course_destroyable_by?(User.current) %> <%= link_to( l(:button_delete), delete_board_message_path(comment,:board_id =>comment.board.id, :user_activity_id => user_activity_id, :activity_id => activity_id, :is_course => is_course, :is_board => is_board), @@ -48,6 +44,61 @@ :title => l(:button_delete) ) %> <% end %> + <% elsif type == 'JournalsForMessage' %> + + <%= link_to( + l(:button_reply), + {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + <% if comment.creator_user == User.current || User.current.admin? %> + <%= link_to('删除', {:controller => 'words', :action => 'destroy', :object_id => comment, :user_id => comment.user, :user_activity_id => user_activity_id, :activity_id => activity_id}, + :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "fr mr20", :title => l(:button_delete)) %> + <% end %> + <% elsif type == 'OrgDocumentComment' %> + + <%= link_to( + l(:button_reply), + {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + <% if comment.creator_user == User.current %> + <%= link_to( + l(:button_delete), + {:controller => 'org_document_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id}, + :method => :delete, + :remote => true, + :class => 'fr mr20', + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:button_delete)) %> + <% end %> + <% elsif type == 'BlogComment' %> + + <%= link_to( + l(:button_reply), + {:controller => 'users' ,:action => 'reply_to', :reply_id => comment.id, :type => type, :user_activity_id => user_activity_id, :activity_id => activity_id, :homepage => homepage}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) if !comment.root.locked? %> + + + <% if comment.author == User.current %> + <%= link_to( + l(:button_delete), + {:controller => 'blog_comments',:action => 'destroy', :id => comment.id, :user_activity_id => user_activity_id, :homepage => homepage}, + :method => :delete, + :remote => true, + :class => 'fr mr20', + :data => {:confirm => l(:text_are_you_sure)}, + :title => l(:button_delete)) %> + <% end %> + <% end %>
    diff --git a/app/views/users/_message_reply_banner.html.erb b/app/views/users/_message_reply_banner.html.erb deleted file mode 100644 index 0c8cda379..000000000 --- a/app/views/users/_message_reply_banner.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -
    -
    - 回复 - ︿ - <%= count>0 ? "(#{count})" : "" %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> - -
    -
    <%#= format_date(activity.updated_on) %>
    - <%if count>3 %> - - <% end %> -
    \ No newline at end of file diff --git a/app/views/users/_news_contents.html.erb b/app/views/users/_news_contents.html.erb new file mode 100644 index 000000000..2ff2c0746 --- /dev/null +++ b/app/views/users/_news_contents.html.erb @@ -0,0 +1,29 @@ +
    + <%= link_to comment.creator_user.show_name, user_url_in_org(comment.creator_user.id), :class => "newsBlue mr10 f14" %> + <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> +
    +<% if !comment.parent.nil? %> + <% parents_rely = [] %> + <% parents_rely = get_reply_parents parents_rely, comment %> + <% length = parents_rely.length %> +
    + <% if length <= 3 %> + <%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %> + <% else %> +
    +
    +
    + <%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %> +
    + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %> +
    +
    + + + <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %> +
    + <%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %> +
    + <% end %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/users/_news_replies.html.erb b/app/views/users/_news_replies.html.erb new file mode 100644 index 000000000..a4732af8c --- /dev/null +++ b/app/views/users/_news_replies.html.erb @@ -0,0 +1,90 @@ + \ No newline at end of file diff --git a/app/views/users/_org_document_replies.html.erb b/app/views/users/_org_document_replies.html.erb deleted file mode 100644 index ce26cf70c..000000000 --- a/app/views/users/_org_document_replies.html.erb +++ /dev/null @@ -1,60 +0,0 @@ - \ No newline at end of file diff --git a/app/views/users/_project_issue_reply.html.erb b/app/views/users/_project_issue_reply.html.erb index 3dac8026a..fb2fc214e 100644 --- a/app/views/users/_project_issue_reply.html.erb +++ b/app/views/users/_project_issue_reply.html.erb @@ -5,7 +5,7 @@ <% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %> <% if count > 0 %>
    - <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%> + <%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Issue', :activity_id => activity.id} %>
    <% end %> diff --git a/app/views/users/_project_message.html.erb b/app/views/users/_project_message.html.erb index 00075dc8e..0a5c18a9b 100644 --- a/app/views/users/_project_message.html.erb +++ b/app/views/users/_project_message.html.erb @@ -82,7 +82,7 @@ <%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %> <%# count = fetch_user_leaveWord_reply(activity).count %>
    - <%= render :partial => 'users/message_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %> + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %> <% all_comments = []%> <% comments = get_all_children(all_comments, activity)[0..2] %> @@ -98,7 +98,7 @@
    <% if User.current.logged? %>
    - <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%> + <%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id,:is_course => is_course, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
    diff --git a/app/views/users/_project_news.html.erb b/app/views/users/_project_news.html.erb index cdceb490d..4c7ec2b04 100644 --- a/app/views/users/_project_news.html.erb +++ b/app/views/users/_project_news.html.erb @@ -62,11 +62,11 @@ <% count=activity.comments.count %>
    <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> - + <% comments = activity.comments.reorder("created_on desc").limit(3) %> <% if count > 0 %>
    - <%= render :partial => 'users/all_replies', :locals => {:comments => comments}%> + <%= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'News', :activity_id => activity.id} %>
    <% end %> diff --git a/app/views/users/_reply_banner.html.erb b/app/views/users/_reply_banner.html.erb index 25175542f..43aebb89c 100644 --- a/app/views/users/_reply_banner.html.erb +++ b/app/views/users/_reply_banner.html.erb @@ -10,9 +10,27 @@
    <%#= format_date(activity.updated_on) %>
    <%if count>3 %> + <% if activity.class.to_s == 'HomeworkCommon' && is_in_course == -1 %> + + 展开更多 + + <% elsif activity.class.to_s == 'HomeworkCommon' %> + + 展开更多 + + <% elsif activity.class.to_s == 'Message' %> + + 展开更多 + + <% elsif activity.class.to_s == 'BlogComment' %> + + 展开更多 + + <% else %> + + 展开更多 + + <% end %> +
    <% end %>
    \ No newline at end of file diff --git a/app/views/users/_reply_to.html.erb b/app/views/users/_reply_to.html.erb index cb8b2e0ff..aa519a5da 100644 --- a/app/views/users/_reply_to.html.erb +++ b/app/views/users/_reply_to.html.erb @@ -33,7 +33,6 @@ <%= hidden_field_tag 'is_course', params[:is_course], :value => @is_course %> <%= hidden_field_tag 'is_board', params[:is_board], :value => @is_board %> <%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %> - <%= hidden_field_tag 'reply_id', params[:reply_id], :value => reply.author.id %> <%= hidden_field_tag 'activity_id',params[:activity_id],:value =>@activity_id %> <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %>
    @@ -47,7 +46,6 @@ <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %> <%= hidden_field_tag 'parent_id', params[:parent_id], :value => reply.id %> - <%= hidden_field_tag 'reply_id', params[:reply_id], :value => reply.author_id %> <%= hidden_field_tag 'homepage', params[:homepage], :value => @homepage %>
    @@ -65,7 +63,26 @@

    <% end%> - <% end %> + <% elsif @type == 'News' %> + <%= form_for('new_form', :url => {:controller => 'comments',:action => 'reply', :id => reply.id}, :method => "post", :remote => true) do |f| %> + <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %> +
    + + +
    +

    + <% end%> + <% elsif @type == 'Issue' %> + <%= form_for('new_form',:url => add_reply_issue_path(reply.issue.id),:method => "post", :remote => true) do |f|%> + <%= hidden_field_tag 'journal_id',params[:journal_id],:value =>reply.id %> + <%= hidden_field_tag 'user_activity_id',params[:user_activity_id],:value =>@user_activity_id %> +
    + + +
    +

    + <% end %> + <% end %>
    diff --git a/app/views/users/_show_user_homeworks.html.erb b/app/views/users/_show_user_homeworks.html.erb index 46e075412..f54f49865 100644 --- a/app/views/users/_show_user_homeworks.html.erb +++ b/app/views/users/_show_user_homeworks.html.erb @@ -1,8 +1,8 @@
    选用题库中的题目
    - 公共题库 - 我的题库 + 我的题库 + 公共题库
    diff --git a/app/views/users/_user_blog.html.erb b/app/views/users/_user_blog.html.erb index a19bfc016..b6cd9ebc3 100644 --- a/app/views/users/_user_blog.html.erb +++ b/app/views/users/_user_blog.html.erb @@ -44,13 +44,13 @@ <% all_comments = []%> <% count=get_all_children(all_comments, activity).count %>
    - <%= render :partial => 'users/blog_comment_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 0} %> + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 0} %> <% all_comments = []%> <% comments = get_all_children(all_comments, activity)[0..2] %> <% if count > 0 %>
    - <%= render :partial => 'users/blog_comments_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 0}%> + <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 0}%>
    <% end %> diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index 952a3396e..6ce635a9b 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -16,7 +16,7 @@ 基于项目实施 -

    提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计。

    +

    提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计

    确定 diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index 6e325c2f0..990a193cc 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -302,28 +302,12 @@ <% count=homework_common.journals_for_messages.count %>
    -
    -
    回复 - ︿ - <%= count>0 ? "(#{count})" : "" %> - - <%=render :partial=> "praise_tread/praise", :locals => {:activity=>homework_common, :user_activity_id=>homework_common.id,:type=>"activity"}%> - -
    -
    - <%if count>3 %> - - <% end %> -
    + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => homework_common, :user_activity_id => -1, :is_in_course => is_in_course,:course_activity=>-1} %> <% comments = homework_common.journals_for_messages.reorder("created_on desc").limit(3) %> <% if count > 0 %>
    - <%=render :partial => 'users/homework_replies', :locals => {:comments => comments, :is_in_course => is_in_course, :course_activity=> -1, :is_teacher => is_teacher, :user_activity_id => -1} %> + <%=render :partial => 'users/news_replies', :locals => {:comments => comments, :type => 'HomeworkCommon', :is_in_course => is_in_course,:course_activity=>-1, :is_teacher => is_teacher, :user_activity_id => -1} %>
    <% end %> diff --git a/app/views/users/_user_journalsformessage.html.erb b/app/views/users/_user_journalsformessage.html.erb index 4fb79ee2d..7880cde99 100644 --- a/app/views/users/_user_journalsformessage.html.erb +++ b/app/views/users/_user_journalsformessage.html.erb @@ -64,15 +64,14 @@
    <% all_comments = []%> <% count=get_all_children(all_comments, activity).count %> - <% allow_delete = (activity.user == User.current || User.current.admin?) %>
    - <%= render :partial => 'users/journal_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :allow_delete => allow_delete} %> + <%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> <% all_comments = []%> <% comments = get_all_children(all_comments, activity)[0..2] %> <% if count > 0 %>
    - <%= render :partial => 'users/journal_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :allow_delete => allow_delete, :activity_id =>activity.id}%> + <%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>
    <% end %> diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index c27002d24..fa2be7ae1 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -653,7 +653,7 @@ ">您增加了新的班级成员:
  • - <%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")", user_path(ma.course_message_id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> + <%= link_to User.find(ma.course_message_id).login+"("+(User.find(ma.course_message_id).realname ? User.find(ma.course_message_id).realname : User.find(ma.course_message_id).login) +")", {:controller => 'courses', :action => 'settings', :id => ma.course_id, :tab=>'member'}, :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %> diff --git a/app/views/users/_user_syllabus_list.html.erb b/app/views/users/_user_syllabus_list.html.erb index aa77c727d..9fa93c76e 100644 --- a/app/views/users/_user_syllabus_list.html.erb +++ b/app/views/users/_user_syllabus_list.html.erb @@ -59,7 +59,7 @@ <% end %> <% if courses.count > 3 %>
  • - 共<%=courses.count %>个课程,点击全部展开 + 共<%=courses.count %>个班级,点击全部展开
  • <% end %> <% end %> diff --git a/app/views/users/all_journals.js.erb b/app/views/users/all_journals.js.erb index b7485def3..cc36ef3b3 100644 --- a/app/views/users/all_journals.js.erb +++ b/app/views/users/all_journals.js.erb @@ -1,13 +1,15 @@ <% if params[:type] == 'HomeworkCommon' %> -$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/homework_replies', :locals => {:comments => @journals, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>'); +$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :type => @type, :is_in_course =>@is_in_course,:course_activity=>@course_activity, :is_teacher => @is_teacher, :user_activity_id => @user_activity_id}) %>'); <% elsif params[:type] == 'JournalsForMessage' %> -$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/journal_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :allow_delete => @allow_delete, :activity_id =>params[:id].to_i}) %>'); +$('#reply_div_<%= @user_activity_id %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id =>params[:id].to_i}) %>'); <% elsif params[:type] == 'Message' %> $('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i,:is_course => @is_course, :is_board => @is_board}) %>'); <% elsif params[:type] == 'BlogComment' %> -$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/blog_comments_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i, :homepage => @homepage}) %>'); +$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals,:user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i, :homepage => @homepage}) %>'); <% elsif params[:type] == 'OrgDocumentComment' %> -$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/org_document_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>'); +$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/message_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>'); +<% elsif params[:type] == 'News' || params[:type] == 'Issue' %> +$('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/news_replies', :locals => {:comments => @journals, :user_activity_id => @user_activity_id, :type => @type, :activity_id => params[:id].to_i}) %>'); <% else %> $('#reply_div_<%= params[:div_id].to_i %>').html('<%=escape_javascript(render :partial => 'users/all_replies', :locals => {:comments => @journals}) %>'); <% end %> diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb index 238102879..84503f837 100644 --- a/app/views/users/new_user_commit_homework.html.erb +++ b/app/views/users/new_user_commit_homework.html.erb @@ -7,7 +7,7 @@ $(function(){ $("#RSide").removeAttr("id"); $("#Container").css("width","1000px"); - <%if @homework.anonymous_comment == 0 && @homework.homework_detail_manual.comment_status != 1%> + <%if !@is_test && @homework.anonymous_comment == 0 && @homework.homework_detail_manual.comment_status != 1%> $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_student_work_alert') %>'); showModal('ajax-modal', '360px'); $('#ajax-modal').siblings().remove(); diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index ce7b2dad0..9acffce3d 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -36,7 +36,7 @@
    • 更多
    • <%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%> -
    • <%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%> +
    • <%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
    • <%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
    diff --git a/app/views/users/show_all_replies.js.erb b/app/views/users/show_all_replies.js.erb index 2d4321bce..7b47b29d8 100644 --- a/app/views/users/show_all_replies.js.erb +++ b/app/views/users/show_all_replies.js.erb @@ -1,7 +1,7 @@ <% unless @comment.parent.nil? %> <% if params[:type] == 'JournalsForMessage' && (@comment.jour_type == 'Principal' || @comment.jour_type == 'Course') %> $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>"); - <% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' ) %> + <% elsif (@comment.class.to_s == 'Message' || @comment.class.to_s == 'BlogComment' || @comment.class.to_s == 'OrgDocumentComment') %> $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/journal_comment_reply', :locals => {:comment => @comment.parent})%>"); <% else %> $('#comment_reply_<%=@comment.id %>').html("<%= escape_javascript(render :partial => 'users/comment_reply', :locals => {:comment => @comment.parent})%>"); diff --git a/config/locales/courses/zh.yml b/config/locales/courses/zh.yml index 29d6b236c..9a07e0fa8 100644 --- a/config/locales/courses/zh.yml +++ b/config/locales/courses/zh.yml @@ -29,6 +29,16 @@ zh: label_upload_files: 上传资源 label_apply_join_course: 申请加入班级 label_apply_for_homework: 申请引用作业 + + #动态名称 + label_homework_acts: 作业动态 + label_news_acts: 通知动态 + label_attachment_acts: 资源库动态 + label_message_acts: 论坛动态 + label_journalsForMessage_acts: 留言动态 + label_poll_acts: 问卷动态 + label_all_cats: 全部动态 + # # 课程托管平台主页 # diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 9c19fcbbb..dbb3ff074 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2101,6 +2101,7 @@ zh: label_file_lost_list: 缺失文件列表 lable_unset: 未设置 label_chose_group: 请选择分班 + label_no_group: 暂无 label_hostedz_organization: 主办单位 label_hosted_by: 国防科学技术大学并行与分布处理国家重点实验室 diff --git a/config/routes.rb b/config/routes.rb index bcfb6de98..1124080b7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -207,6 +207,12 @@ RedmineApp::Application.routes.draw do resources :apply_project_masters delete 'apply_project_masters', :to => 'apply_project_masters#delete' + resources :comments do + member do + post 'reply' + get 'quote' + end + end # resources :organization, :except => [:show] do # # end @@ -1141,6 +1147,7 @@ RedmineApp::Application.routes.draw do get 'search_public_orgs_not_in_course' get "homework_search" get "show_comparecode" + get "statistics_course" end collection do match 'join_private_courses', :via => [:get, :post] diff --git a/db/migrate/20160718064146_add_type_to_changeset.rb b/db/migrate/20160718064146_add_type_to_changeset.rb deleted file mode 100644 index 4d51883a1..000000000 --- a/db/migrate/20160718064146_add_type_to_changeset.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AddTypeToChangeset < ActiveRecord::Migration - def change - add_column :changesets, :project_id, :integer - add_column :changesets, :type, :integer, :default => false - end -end diff --git a/db/migrate/20160719013955_add_column_to_comments.rb b/db/migrate/20160719013955_add_column_to_comments.rb new file mode 100644 index 000000000..6d0201c49 --- /dev/null +++ b/db/migrate/20160719013955_add_column_to_comments.rb @@ -0,0 +1,7 @@ +class AddColumnToComments < ActiveRecord::Migration + def change + add_column :comments, :parent_id, :integer + add_column :comments, :comments_count, :integer, :default => 0 + add_column :comments, :reply_id, :integer + end +end diff --git a/db/migrate/20160720094503_add_column_to_journal.rb b/db/migrate/20160720094503_add_column_to_journal.rb new file mode 100644 index 000000000..3882109c3 --- /dev/null +++ b/db/migrate/20160720094503_add_column_to_journal.rb @@ -0,0 +1,7 @@ +class AddColumnToJournal < ActiveRecord::Migration + def change + add_column :journals, :parent_id, :integer + add_column :journals, :comments_count, :integer, :default => 0 + add_column :journals, :reply_id, :integer + end +end diff --git a/db/migrate/20160721075236_create_commits.rb b/db/migrate/20160721075236_create_commits.rb new file mode 100644 index 000000000..555bf72f1 --- /dev/null +++ b/db/migrate/20160721075236_create_commits.rb @@ -0,0 +1,14 @@ +class CreateCommits < ActiveRecord::Migration + def change + create_table :commits do |t| + t.integer :repository_id + t.string :version + t.string :committer + t.text :comments + t.datetime :committed_on + t.integer :project_id + + t.timestamps + end + end +end diff --git a/db/migrate/20160722074421_delete_org_anonymous.rb b/db/migrate/20160722074421_delete_org_anonymous.rb new file mode 100644 index 000000000..fe796f3c5 --- /dev/null +++ b/db/migrate/20160722074421_delete_org_anonymous.rb @@ -0,0 +1,11 @@ +class DeleteOrgAnonymous < ActiveRecord::Migration + def up + anonymous_replys = OrgDocumentComment.where("organization_id = 23 AND creator_id = 2") + if anonymous_replys + anonymous_replys.destroy_all + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 0f1acef8f..8b7700a2b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160718064146) do +ActiveRecord::Schema.define(:version => 20160720094503) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -298,6 +298,10 @@ ActiveRecord::Schema.define(:version => 20160718064146) do t.string "revision", :null => false t.string "committer" t.datetime "committed_on", :null => false + t.integer "repository_id", :null => false + t.string "revision", :null => false + t.string "committer" + t.datetime "committed_on", :null => false t.text "comments" t.date "commit_date" t.string "scmid" @@ -389,6 +393,9 @@ ActiveRecord::Schema.define(:version => 20160718064146) do t.text "comments" t.datetime "created_on", :null => false t.datetime "updated_on", :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" end add_index "comments", ["author_id"], :name => "index_comments_on_author_id" @@ -1054,6 +1061,9 @@ ActiveRecord::Schema.define(:version => 20160718064146) do t.text "notes" t.datetime "created_on", :null => false t.boolean "private_notes", :default => false, :null => false + t.integer "parent_id" + t.integer "comments_count", :default => 0 + t.integer "reply_id" end add_index "journals", ["created_on"], :name => "index_journals_on_created_on" diff --git a/lib/redmine.rb b/lib/redmine.rb index cfd8b6824..ed40b4c04 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -198,7 +198,7 @@ Redmine::AccessControl.map do |map| map.project_module :news do |map| map.permission :manage_news, {:news => [:new, :create, :edit, :update, :destroy], :comments => [:destroy]}, :require => :member map.permission :view_news, {:news => [:index, :show]}, :public => true, :read => true - map.permission :comment_news, {:comments => :create} + map.permission :comment_news, {:comments => [:create, :reply]} end map.contest_module :contestnotifications do |map| diff --git a/lib/tasks/gitlab_act_project.rake b/lib/tasks/gitlab_act_project.rake index ee9ca1a9a..c4854db58 100644 --- a/lib/tasks/gitlab_act_project.rake +++ b/lib/tasks/gitlab_act_project.rake @@ -1,25 +1,32 @@ namespace :gitlab do desc "sync gitlab's commit acts to trustie" task :forge_acts => :environment do - begin - g = Gitlab.client - projects = Project.find_by_sql("select * from projects where gpid is not null") - projects.each do |project| + g = Gitlab.client + projects = Project.find_by_sql("select * from projects where gpid is not null and id not in (2,847,931,942)") + projects.each do |project| + begin g_project = g.project(project.gpid) # 获取默认分支 g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch # 总的提交次数 commit_count = g.user_static(project.gpid, :rev => g_default_branch).count pages = commit_count / 20 + 1 - pages.each do |page| - commits = g.commits(g_project.gpid, :ref_name => g_default_branch, :page => page) + puts "#{pages}" + puts "project id is #{project.id}" + # api获取每次只能获取20次提交,所以需要通过取得page值来获取每页的提交动态 + (0..pages).each do |page| + commits = g.commits(project.gpid, :ref_name => g_default_branch, :page => page) commits.each do |commit| - Changeset.create(:project_id => project.id, :repository_id => project.gpid, :revision => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at) + Commit.create(:project_id => project.id, :repository_id => project.gpid, :version => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at) end end + rescue Exception => e + # puts "Some wrong with project #{project.id}" + # Project.where(:id => project.id).first.update_column(:gpid, nil) + # Repository.where(:project_id => project.id).first.destroy + # try + puts e end - rescue Exception => e - puts e end end end diff --git a/lib/tasks/gitlab_forge_acts_update.rake b/lib/tasks/gitlab_forge_acts_update.rake new file mode 100644 index 000000000..4d8e9b2fb --- /dev/null +++ b/lib/tasks/gitlab_forge_acts_update.rake @@ -0,0 +1,32 @@ +namespace :gitlab do + desc "sync gitlab's commit acts to trustie" + task :forge_acts_update => :environment do + g = Gitlab.client + ids = [2,847,931,942] + projects = Project.find(ids) + projects.each do |project| + # c = Commit.where(:project_id => project.id) + # if c.blank? + begin + g_project = g.project(project.gpid) + # 获取默认分支 + g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch + # 总的提交次数 + commit_count = g.user_static(project.gpid, :rev => g_default_branch).count + pages = commit_count / 20 + 1 + puts "#{pages}" + puts "project id is #{project.id}" + # api获取每次只能获取20次提交,所以需要通过取得page值来获取每页的提交动态 + (0..pages).each do |page| + commits = g.commits(project.gpid, :ref_name => g_default_branch, :page => page) + commits.each do |commit| + Commit.create(:project_id => project.id, :repository_id => project.gpid, :version => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at) + end + end + rescue Exception => e + puts e + end + # end + end + end +end diff --git a/lib/tasks/gitlab_trustie_acts.rake b/lib/tasks/gitlab_trustie_acts.rake new file mode 100644 index 000000000..8c3568397 --- /dev/null +++ b/lib/tasks/gitlab_trustie_acts.rake @@ -0,0 +1,41 @@ +namespace :gitlab do + desc "sync gitlab's commit acts to trustie" + task :acts_to_trustie => :environment do + begin + projects = Project.where(:status => 1) + projects.each do |project| + c = Commit.find_by_sql("SELECT * FROM `commits` where project_id = #{project.id} order by committed_on limit 1;") + g_project = g.project(project.gpid) + end + rescue Exception => e + puts e + end + g = Gitlab.client + ids = [2,847,931,942] + projects = Project.find(ids) + projects.each do |project| + c = Commit.where(:project_id => project.id) + if c.blank? + begin + g_project = g.project(project.gpid) + # 获取默认分支 + g_default_branch = g_project.default_branch.nil? ? "master" : g_project.default_branch + # 总的提交次数 + commit_count = g.user_static(project.gpid, :rev => g_default_branch).count + pages = commit_count / 20 + 1 + puts "#{pages}" + puts "project id is #{project.id}" + # api获取每次只能获取20次提交,所以需要通过取得page值来获取每页的提交动态 + (0..pages).each do |page| + commits = g.commits(project.gpid, :ref_name => g_default_branch, :page => page) + commits.each do |commit| + Commit.create(:project_id => project.id, :repository_id => project.gpid, :version => commit.id, :committer => commit.author_email, :comments => Redmine::CodesetUtil.to_utf8(commit.title, 'UTF-8'), :committed_on => commit.created_at) + end + end + rescue Exception => e + puts e + end + end + end + end +end diff --git a/lib/tasks/gitlab_unused.rake b/lib/tasks/gitlab_unused.rake new file mode 100644 index 000000000..4b81acbff --- /dev/null +++ b/lib/tasks/gitlab_unused.rake @@ -0,0 +1,18 @@ +namespace :gitlab do + desc "sync gitlab's commit acts to trustie" + task :unused => :environment do + begin + Project.where("id in (161,236,266)").update_all(:gpid => nil) + repositories = Repository.find_by_sql("select * from repositories where project_id in (select project_id from repositories group by project_id having count(project_id) > 1);") + repositories.each do |rep| + puts "#{rep.id}" + if rep.type == "Repository::Git" + rep.destroy + end + end + # Repository.where("project_id in (161,236,266)").destroy_all + rescue Exception => e + puts e + end + end +end diff --git a/lib/tasks/wechat.rake b/lib/tasks/wechat.rake index bbba9994c..dd02f9209 100644 --- a/lib/tasks/wechat.rake +++ b/lib/tasks/wechat.rake @@ -1,5 +1,6 @@ #coding=utf-8 # +require 'uglifier' def compress(srcs, outfile) wechat_path = File.join(Rails.root, "public", "javascripts", "wechat") diff --git a/public/images/arrow.png b/public/images/arrow.png new file mode 100644 index 000000000..2081ddf8d Binary files /dev/null and b/public/images/arrow.png differ diff --git a/public/images/sy/bg_sy.jpg b/public/images/sy/bg_sy.jpg new file mode 100644 index 000000000..2a36dd530 Binary files /dev/null and b/public/images/sy/bg_sy.jpg differ diff --git a/public/images/sy/icons_smile.png b/public/images/sy/icons_smile.png new file mode 100644 index 000000000..b760d82fc Binary files /dev/null and b/public/images/sy/icons_smile.png differ diff --git a/public/images/sy/icons_sy.png b/public/images/sy/icons_sy.png new file mode 100644 index 000000000..09cdd32cb Binary files /dev/null and b/public/images/sy/icons_sy.png differ diff --git a/public/images/sy/icons_tan.png b/public/images/sy/icons_tan.png new file mode 100644 index 000000000..eaac3551b Binary files /dev/null and b/public/images/sy/icons_tan.png differ diff --git a/public/images/sy/liststyle.png b/public/images/sy/liststyle.png new file mode 100644 index 000000000..0d73a985f Binary files /dev/null and b/public/images/sy/liststyle.png differ diff --git a/public/images/sy/logo_class.jpg b/public/images/sy/logo_class.jpg new file mode 100644 index 000000000..f9b475bcf Binary files /dev/null and b/public/images/sy/logo_class.jpg differ diff --git a/public/images/sy/male.jpg b/public/images/sy/male.jpg new file mode 100644 index 000000000..46d58f26e Binary files /dev/null and b/public/images/sy/male.jpg differ diff --git a/public/images/sy/massage.jpg b/public/images/sy/massage.jpg new file mode 100644 index 000000000..6ec412180 Binary files /dev/null and b/public/images/sy/massage.jpg differ diff --git a/public/images/sy/sy_icons_close.png b/public/images/sy/sy_icons_close.png new file mode 100644 index 000000000..e500a2a27 Binary files /dev/null and b/public/images/sy/sy_icons_close.png differ diff --git a/public/javascripts/application.js b/public/javascripts/application.js index fb7c6cda2..b7468366a 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1261,6 +1261,7 @@ function elocalStorage(editor,mdu){ h = h < 10 ? '0' + h : h; m = m < 10 ? '0' + m : m; s = s < 10 ? '0' + s : s; + editor.sync(); if(!editor.isEmpty()){ add_data("content",mdu,editor.html()); $('#e_tip').html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 "); @@ -1340,40 +1341,6 @@ function expand_all_reply(container, btnid, id, type, div_id) { } } -function expand_journal_reply(container, btnid, id, type, div_id, allow_delete) { - var target = $(container); - var btn = $(btnid); - if (btn.data('init') == '0') { - btn.data('init', 1); - $.get( - '/users/all_journals', - { - type: type, - id: id, - div_id: div_id, - allow_delete: allow_delete - }, - function(data) { - - } - ); - btn.html('收起回复'); - //target.show(); - } else if(btn.data('init') == '1') { - btn.data('init', 3); - btn.html('展开更多'); - target.hide(); - target.eq(0).show(); - target.eq(1).show(); - target.eq(2).show(); - } - else { - btn.data('init', 1); - btn.html('收起回复'); - target.show(); - } -} - function expand_message_reply(container, btnid, id, type, div_id, is_course, is_board) { var target = $(container); var btn = $(btnid); diff --git a/public/javascripts/syllabus.js b/public/javascripts/syllabus.js index 4dd387595..24b997496 100644 --- a/public/javascripts/syllabus.js +++ b/public/javascripts/syllabus.js @@ -31,10 +31,11 @@ function submit_syllabus() { } //编辑英文名称 -function show_edit_eng_name() { +function show_edit_eng_name(str) { EngEdit = true; $("#syllabus_eng_name_show").hide(); $("#syllabus_eng_name_edit").show(); + $("#syllabus_eng_name_edit").val(str); $("#syllabus_eng_name_edit").focus(); } @@ -57,7 +58,7 @@ function show_edit_title(str) { IsEdit = true; $("#syllabus_title_show").hide(); $("#syllabus_title_edit").show(); - $("#syllabus_title_edit").text(str); + $("#syllabus_title_edit").val(str); $("#syllabus_title_edit").focus(); } @@ -82,13 +83,13 @@ function toggle_all_syllabus_attr(){ var none = $("#all_syllabus_attr li.none_attr"); if(btn.data('init')=='0'){ btn.data('init',1); - btn.removeClass('homepageLeftMenuMoreIcon'); - btn.addClass('homepageLeftMenuHideIcon'); + btn.removeClass('homepageLeftMenuMoreIcon2'); + btn.addClass('homepageLeftMenuHideIcon2'); target.show(); }else{ btn.data('init',0); - btn.addClass('homepageLeftMenuMoreIcon'); - btn.removeClass('homepageLeftMenuHideIcon'); + btn.addClass('homepageLeftMenuMoreIcon2'); + btn.removeClass('homepageLeftMenuHideIcon2'); none.hide(); } } diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 1ec98b1cf..b72a8ef56 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -43,7 +43,7 @@ table{ background:#fff;} .no_line{ border-bottom:none;} .line{border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;} .no_border{ border:none;} -.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 135px -193px no-repeat; cursor:pointer;} +.min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(/images/public_icon.png) 135px -193px no-repeat; cursor:pointer;} a.btn_message_free{ background:#ff5722; display:block; text-align:center; color:#fff; padding:3px 0; width:80px; margin-bottom:10px;} .db {display:block;} @@ -530,7 +530,7 @@ a:hover.bgreen_n_btn{background:#08a384;} .blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;white-space:nowrap;} .orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} .sticky_btn_cir{ background:#269ac9; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} -.locked_btn_cir{background: url(../images/locked.png) 0 0 no-repeat; cursor: default;} +.locked_btn_cir{background: url(/images/locked.png) 0 0 no-repeat; cursor: default;} .bgreen_btn_cir{ background:#1abc9c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;white-space:nowrap;} .grey_border{border:1px solid #dddddd !important;} .red-cir-btn{ background:#e74c3c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;} diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css index 4ee419d7b..ccf161725 100644 --- a/public/stylesheets/css/courses.css +++ b/public/stylesheets/css/courses.css @@ -35,8 +35,8 @@ a:hover.DropBtn{background: url(../images/homepage_icon.png) -125px -370px no-re .ProResultTable{ color:#888888;} .SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; } .SearchIcon:hover{background:url(../images/homepage_icon2.png) 676px -419px no-repeat; } -a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } -a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +a.link_file{ background:url(/images/pic_file.png) 0 2px no-repeat; padding-left:20px; } +a:hover.link_file{ background:url(/images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} a.remove-upload {background: url(/images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;margin-left: 5px;} a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} @@ -132,8 +132,8 @@ a:hover.tijiao{ background:#297fb8;} .grey_c{ color:#808181;} .link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} -.ul_grey li {color:#909090; list-style-position:inside; padding-left:1px;list-style-image:url('../images/news_dot2.png')} -.ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('../images/news_dot.png')} +.ul_grey li {color:#909090; list-style-position:inside; padding-left:1px;list-style-image:url('/images/news_dot2.png')} +.ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('/images/news_dot.png')} span.author { font-size: 0.9em; color: #888; } .ReplyToMessageInputContainer {width: 582px;float: left;} .ReplyToMessageContainer {border-bottom:1px solid #e3e3e3; width:632px; margin:0px auto; margin-top:15px; min-height:60px;} @@ -152,8 +152,8 @@ a.select_btn_select{ background:#64bddb; color:#fff;} .courses_list_pic{ border:1px solid #ede7e9; width:64px; height:64px; padding:1px;} .courses_list_pic:hover{border:1px solid #64bdd9;} .courses_list_title{ max-width:500px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} -.pic_eye_blue{display:block; background:url(../images/pic_uersall.png) -372px 3px no-repeat; width:16px; height:15px; } -.pic_eye_grey{display:block; background:url(../images/pic_uersall.png) -372px -10px no-repeat; width:16px; height:15px; } +.pic_eye_blue{display:block; background:url(/images/pic_uersall.png) -372px 3px no-repeat; width:16px; height:15px; } +.pic_eye_grey{display:block; background:url(/images/pic_uersall.png) -372px -10px no-repeat; width:16px; height:15px; } .courses_list{ padding-bottom:10px;} .courses_list_table{ color:#6e6e6e;} @@ -349,7 +349,7 @@ a:hover.icon_remove{background:url(../images/icons.png) -20px -338px no-repeat;} a.hwork_center{ display:block; width:60px; text-align:center; margin-right:5px;} .show_hwork{ border:2px solid #64bdd9; width:646px; padding:10px; color:#666666; padding-bottom:0px; } .show_hwork ul li{ margin-bottom:5px;} -.show_hwork_arrow{ position:relative; top:1px; left:165px;background:url(../images/course/arrow_up.jpg) 0 0 no-repeat; width:20px; height:11px;} +.show_hwork_arrow{ position:relative; top:1px; left:165px;background:url(/images/course/arrow_up.jpg) 0 0 no-repeat; width:20px; height:11px;} .tit_fb{ font-weight:bold; width:66px; text-align:right; display:block; float:left;} .show_hwork_p{ width:630px; float:left;} .hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:615px; height:35px;} @@ -363,7 +363,7 @@ a:hover.ping_pic{border:1px solid #64bdd9;} .ping_back_tit{ float:left; width:578px; margin-left:10px; } a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; text-align:center; display:block;} a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} -.min_search{ width:200px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 185px -193px no-repeat; cursor:pointer;} +.min_search{ width:200px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(/images/public_icon.png) 185px -193px no-repeat; cursor:pointer;} .li_min_search{ float:right; margin-right:-10px;} .info_ni{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;} .hwork_num{ width:90px; text-align:center; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} @@ -428,7 +428,7 @@ a:hover.rside_work_tit{ color:#0781b4;} .bgrey_icon{ color:#9b9b9b; border:1px solid #b6b6b6; background:#f0f0f0; font-size:12px; padding:0px 3px; } .dgrey_icon{ color:#717171; border:1px solid #717171; font-size:12px; padding:0px 3px;} .yellow_icon{ color:#ff5c60; border:1px solid #ff5c60; background:#ffffd5; font-size:12px; padding:0px 3px;} -.arrow_r{background:url(../images/course/icons.png) 0 -450px no-repeat; width:22px; height:13px; } +.arrow_r{background:url(/images/course/icons.png) 0 -450px no-repeat; width:22px; height:13px; } .c_dgreen{ color:#0e9e4f;} .list_more{ text-align:center; margin:10px 0;} .rside_massage_txt{ width:650px; margin-left:10px; } @@ -436,14 +436,14 @@ a.massage_tit{ max-width:530px;overflow:hidden; white-space: nowrap; text-overfl a.rside_name{ display:block; max-width:80px;} .rside_talk_txt{ width:650px; margin-left:10px; color:#333;} .rside_talk_tit{ color:#0781b4; width:490px; display:block; } -.rside_talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/course/arrow.png) 0 0 no-repeat; height:7px; width:13px;} +.rside_talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(/images/course/arrow.png) 0 0 no-repeat; height:7px; width:13px;} .rside_talkWrapBox{ width:650px; margin-left:60px; } .rside_Msg_txt{ float:left; width:580px; margin-left:10px;} .rside_talkWrapMsg{ background:#f2f2f2; padding:10px;} .rside_talkWrapMsg ul li{} .rside_inputFeint{ border:1px solid #d9d9d9; background:#fff; width:623px; height:40px; margin:10px; margin-bottom:5px;color:#666;} -a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; } -a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; } +a.icon_face{background:url(/images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; } +a:hover.icon_face{background:url(/images/public_icon.png) -79px -671px no-repeat; } a.pro_mes_w{ height:20px; display:block; color:#999999;} .info_list{ border-top:1px solid #F2F2F2; padding:5px 0;} .info_list_r li{ height:20px;} @@ -487,8 +487,8 @@ a:hover.btn_cancel{ color:#666;} .questionTitle{ width:644px; height:30px; border:1px solid #cbcbcb; padding-left:5px; background:#fff;} .examTime {width:90px; border:1px solid #cbcbcb; outline:none; height:28px; text-align:center; padding-left:0px; } .testStatus{width:698px; border:1px solid #cbcbcb; padding:10px; margin-bottom:10px; background:#ffffff; position:relative; color:#767676;} -.testEdit{ background:url(images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; bottom:10px; right:10px; position:absolute;} -a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;} +.testEdit{ background:url(../images/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right; bottom:10px; right:10px; position:absolute;} +a:hover.testEdit{ background:url(../images/icons.png) -21px -272px no-repeat;} .testDesEdit {width:670px; overflow:hidden;} .testEditTitle{ padding:10px 0px ; float:left; width:564px; } .questionEditContainer {border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px; margin-top:10px;} @@ -497,8 +497,8 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;} /*20151123课程排行榜Tim*/ .courseMenuSetting {background:url(/images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top:3px; float:right; margin-right:5px;} .courseMenuSetting:hover {background:url(/images/homepage_icon2.png) -190px -407px no-repeat;} -.rankList {width:220px; padding:10px; background-color:#ffffff; margin-top:10px;} -.rankList li {width:73px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;} +.rankList {width:208px; background: #fff; border: 1px solid #e5e5e5; border-bottom: none; padding:10px 15px;} +.rankList li {width:68px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;} .rankList li p {width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;} .rankPortrait {border-radius:50%; width:35px; height:35px;} .numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; color:#585858; white-space: nowrap;} diff --git a/public/stylesheets/css/org.css b/public/stylesheets/css/org.css index e4ce6a168..028254e04 100644 --- a/public/stylesheets/css/org.css +++ b/public/stylesheets/css/org.css @@ -105,7 +105,7 @@ div.flash {margin-top :0px !important} /*名师榜20160505*/ .function-row {border-bottom:1px dashed #b2b2b2; padding-bottom:16px;} .teacher-list-search {width:310px; height:23px; border:1px solid #ccc; border-right:none; outline:none;} -.teacher-search-icon {background:url(../images/search.png) 0 3px no-repeat; width:25px; height:25px; border:1px solid #ccc; border-left:none; cursor:pointer;} +.teacher-search-icon {background:url(/images/search.png) 0 3px no-repeat; width:25px; height:25px; border:1px solid #ccc; border-left:none; cursor:pointer;} .teacher-search-type {width:84px; height:23px; border:1px solid #ccc; outline:none;} .teacher-list-row {border-bottom:1px dashed #b2b2b2; padding:18px 0;} .teacher-avatar {float:left;} diff --git a/public/stylesheets/css/popup.css b/public/stylesheets/css/popup.css index 4b3d513cf..ea2034a5e 100644 --- a/public/stylesheets/css/popup.css +++ b/public/stylesheets/css/popup.css @@ -9,7 +9,7 @@ color: #333; } .ui-progressbar-value{margin:-1px;height:100%} -.ui-widget-header{border:1px solid #628db6;background:#759fcf url(jquery/images/ui-bg_gloss-wave_35_759fcf_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold} +.ui-widget-header{border:1px solid #628db6;background:#759fcf url(../jquery/images/ui-bg_gloss-wave_35_759fcf_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold} .ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px} /*发送资源弹窗*/ @@ -44,7 +44,7 @@ input.sendSourceText:hover {background-color:#297fb8;} .popbox{/* width:300px; *//* height:100px; */position:fixed !important;/* z-index:100; */left:50%;top:50%;margin:-100px 0 0 -150px; /* background:#fff; */ -moz-border-radius:5px; /* -webkit-border-radius:5px; */ /* border-radius:5px; */ /* box-shadow:0px 0px 8px #194a81; */ /* overflow:auto; */} /*上传资源弹窗*/ -.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} +.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:fixed; top:50%; left:50%; margin-left:-200px; z-index:1000;} .uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:15px; width:140px; display:inline-block;} .uploadDialogText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block; font-weight: bold;} .uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative;} @@ -164,7 +164,7 @@ a:hover.CloseBtn{background:url(/images/CloseBtn.png) 0px -24px no-repeat; } /****评分弹框****/ /*#popbox{width:488px;height:550px;position:absolute;z-index:100;left:50%;top:40%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; padding:5px; overflow:auto; }*/ -.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;} +.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(/images/close.png) no-repeat;cursor:pointer;} .alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; } .ping_con{ margin:5px; border-bottom:1px dashed #CCC; padding-bottom:5px;} .ping_con ul{ height:30px;} @@ -173,8 +173,8 @@ a:hover.CloseBtn{background:url(/images/CloseBtn.png) 0px -24px no-repeat; } .ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;} .ping_con p span a{ color:#777777;} .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_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;} a:hover.ping_sub{ background:#14a8b9;} @@ -207,7 +207,7 @@ span.author { font-size: 0.9em; color: #888; } /* 匿名评分弹框 */ /*.popbox02{width:480px;height:200px;position:absolute;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}*/ -.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;} +.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(/images/close.png) no-repeat;cursor:pointer;} /* 开启匿评弹框 */ .anonymos{width:480px;height:180px;position:fixed !important;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;} @@ -316,7 +316,7 @@ a.contributor_course{float: right; color: #888; font-size: 12px; font-weight: no /*转发样式*/ .shareDP {width:415px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:relative; z-index:1000;} -.shareArrow {background:url(../images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;} +.shareArrow {background:url(/images/arrowList.png) -90px -108px no-repeat; display:inline-block; width:5px; height:10px; margin-right:3px;} .sectionWrap {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:205px; min-height:150px; padding-top:5px; border:1px solid #dddddd;} .columnWrap {float:left; max-height:155px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:178px; min-height:155px; border:1px solid #dddddd;} .columnWrap li {padding-left:10px; color:#585858; line-height:20px;} diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 2edab35b5..350141150 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -159,7 +159,7 @@ div.thumbnails div {background:#fff;display:inline-block;margin-right:2px;} .repos_files ul li{ float:left; padding-left:10px; height:26px;} .repos_files ul:hover{ background:#ffffdd;} .repos_t_c li{ text-align:center;} -.pic_stats{display:block; background:url(../images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;} +.pic_stats{display:block; background:url(/images/public_icon.png) 0px -548px no-repeat; width:20px; height:15px;} .tree-age{width:10%; text-align:right;} .tree-author{width:10%; text-align:left;} .tree-comments{width:40%; text-align:left;} @@ -260,7 +260,7 @@ p.percent { .label02{ width:110px; text-align:right; font-size:14px; display:block; float:left;} .label03{ width:70px; text-align:right; display:block; float:left; white-space: nowrap;} .collapsible{ border-left:none;border-right:none;border-bottom:none; border-top:1px solid #e4e4e4; padding-top:10px; } -.icon-reload { background-image: url(../images/reload.png); } +.icon-reload { background-image: url(/images/reload.png); } .icon { background-position: 0% 50%; background-repeat: no-repeat; @@ -375,28 +375,28 @@ tr.entry td.age { text-align: right; } tr.entry.file td.filename a { margin-center: 16px; } tr.entry.file td.filename_no_report a { margin-left: 16px; } -tr span.expander {background-image: url(../images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;} -tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png);} -.icon-folder { background-image: url(../images/folder.png); } -.open .icon-folder { background-image: url(../images/folder_open.png); } -.icon-file { background-image: url(../images/files/default.png); } -.icon-file.text-plain { background-image: url(../images/files/text.png); } -.icon-file.text-x-c { background-image: url(../images/files/c.png); } -.icon-file.text-x-csharp { background-image: url(../images/files/csharp.png); } -.icon-file.text-x-java { background-image: url(../images/files/java.png); } -.icon-file.text-x-javascript { background-image: url(../images/files/js.png); } -.icon-file.text-x-php { background-image: url(../images/files/php.png); } -.icon-file.text-x-ruby { background-image: url(../images/files/ruby.png); } -.icon-file.text-xml { background-image: url(../images/files/xml.png); } -.icon-file.text-css { background-image: url(../images/files/css.png); } -.icon-file.text-html { background-image: url(../images/files/html.png); } -.icon-file.image-gif { background-image: url(../images/files/image.png); } -.icon-file.image-jpeg { background-image: url(../images/files/image.png); } -.icon-file.image-png { background-image: url(../images/files/image.png); } -.icon-file.image-tiff { background-image: url(../images/files/image.png); } -.icon-file.application-pdf { background-image: url(../images/files/pdf.png); } -.icon-file.application-zip { background-image: url(../images/files/zip.png); } -.icon-file.application-x-gzip { background-image: url(../images/files/zip.png); } +tr span.expander {background-image: url(/images/bullet_toggle_plus.png); padding-left: 8px; margin-left: 0; cursor: pointer;} +tr.open span.expander {background-image: url(/images/bullet_toggle_minus.png);} +.icon-folder { background-image: url(/images/folder.png); } +.open .icon-folder { background-image: url(/images/folder_open.png); } +.icon-file { background-image: url(/images/files/default.png); } +.icon-file.text-plain { background-image: url(/images/files/text.png); } +.icon-file.text-x-c { background-image: url(/images/files/c.png); } +.icon-file.text-x-csharp { background-image: url(/images/files/csharp.png); } +.icon-file.text-x-java { background-image: url(/images/files/java.png); } +.icon-file.text-x-javascript { background-image: url(/images/files/js.png); } +.icon-file.text-x-php { background-image: url(/images/files/php.png); } +.icon-file.text-x-ruby { background-image: url(/images/files/ruby.png); } +.icon-file.text-xml { background-image: url(/images/files/xml.png); } +.icon-file.text-css { background-image: url(/images/files/css.png); } +.icon-file.text-html { background-image: url(/images/files/html.png); } +.icon-file.image-gif { background-image: url(/images/files/image.png); } +.icon-file.image-jpeg { background-image: url(/images/files/image.png); } +.icon-file.image-png { background-image: url(/images/files/image.png); } +.icon-file.image-tiff { background-image: url(/images/files/image.png); } +.icon-file.application-pdf { background-image: url(/images/files/pdf.png); } +.icon-file.application-zip { background-image: url(/images/files/zip.png); } +.icon-file.application-x-gzip { background-image: url(/images/files/zip.png); } /*版本库diff*/ .showing-changes-info {width:650px; padding:10px; padding-top: 0px; background-color:#ffffff; line-height:2;} @@ -428,11 +428,11 @@ tr.open span.expander {background-image: url(../images/bullet_toggle_minus.png); /*gcm upload file count and deleteall*/ #upload_file_count #count {color:red; font-size:1.5em;} -span.add_attachment .remove_all {background:none;background: url(../images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block;right:10%;text-decoration:none;} -span.add_attachment a {padding-left:16px; background: url(../images/bullet_add.png) no-repeat 0 50%; } +span.add_attachment .remove_all {background:none;background: url(/images/delete.png) no-repeat 1px 50%; width:1px; display:inline-block;right:10%;text-decoration:none;} +span.add_attachment a {padding-left:16px; background: url(/images/bullet_add.png) no-repeat 0 50%; } /*导出*/ -a.atom { background: url(../images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; } +a.atom { background: url(/images/feed.png) no-repeat 1px 50%; padding: 2px 0px 3px 16px; } p.other-formats { text-align: right; font-size:0.9em; color: #666; } .other-formats span + span:before { content: "| "; } @@ -488,11 +488,11 @@ a:hover.upload_btn_grey{background:#8a8a8a;} .analysis-block {padding:15px; border:1px solid #d9d9d9;} .flex {display:flex;} .analysis-genral {flex:1; display:block; text-align:center;} -.analysis-block-icon {background:url(../images/code-analysis-icon.png) -2px -8px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} -.analysis-serious-icon {background:url(../images/code-analysis-icon.png) -2px -34px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} -.analysis-main-icon {background:url(../images/code-analysis-icon.png) -2px -59px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} -.analysis-secondary-icon {background:url(../images/code-analysis-icon.png) -2px -85px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} -.analysis-info-icon {background:url(../images/code-analysis-icon.png) -2px -111px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-block-icon {background:url(/images/code-analysis-icon.png) -2px -8px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-serious-icon {background:url(/images/code-analysis-icon.png) -2px -34px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-main-icon {background:url(/images/code-analysis-icon.png) -2px -59px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-secondary-icon {background:url(/images/code-analysis-icon.png) -2px -85px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} +.analysis-info-icon {background:url(/images/code-analysis-icon.png) -2px -111px no-repeat; width:14px; height:14px; display:inline-block; vertical-align:middle;} .quality-percentage {width:320px; height:14px; display:inline-block;} .quality-percentage-rate {width:50%; height:14px; background-color:#0a6c99; display:inline-block;} .image-cir {border-radius:50%;} diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index c3a85418d..82e27aa1f 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -7,7 +7,7 @@ /*主内容左右分栏*/ #LSide{ width:240px;} #RSide{ width:670px; background:#fff; padding:10px; margin-left: 10px; margin-bottom:10px;} - +.courseRSide{ width:730px; background:#fff; padding:10px; margin-left: 10px; margin-bottom:10px;} /*资源库*/ .resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right} .resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;} @@ -131,7 +131,7 @@ html{ overflow-x:hidden;} .close_btn span { display:none;} .side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;} .msgserver { margin:10px 0 0px 5px;} -.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -110px; padding-left:22px; display:block; height:24px; } +.msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -110px; padding-left:22px; display:block; height:24px; } .opnionText{box-shadow:none; width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;} a.opnionButton{ display:block; background:#269ac9; width:130px; height:26px; margin-top:5px; text-align:center; padding-top:0px; color:#fff;} a.opnionButton:hover{background: #297fb8; } @@ -796,7 +796,7 @@ a.talkmain_name{ color:#ff5722;} a:hover.talkmain_name{ color:#d33503;} .talkmain_tit{ color:#0781b4; width:450px; display:block; } .talklist_main{ } -.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/arrow.png) 0 0 no-repeat; height:7px; width:13px;} +.talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(/images/arrow.png) 0 0 no-repeat; height:7px; width:13px;} .talkConIpt{ background:#f2f2f2; } .talkWrapBox{ width:610px; margin-left:60px; } .inputFeint{ border:1px solid #d9d9d9; background:#fff; width:583px; height:50px; margin:10px; margin-bottom:5px;color:#666;} diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index b2cba2483..be8bbc65b 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -31,8 +31,8 @@ a:hover.search_btn{ background: #0fa9bb;} #userInfo {float:right; display:inline-block; width:130px; padding-top:5px;} .userInfoRow2 {margin-top:-5px;} .myPractice {display:inline-block;} -a.parent {background: url(../images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;} -a.parent:hover {background: url(../images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;} +a.parent {background: url(/images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;} +a.parent:hover {background: url(/images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;} a.linkToOrange:hover {color:#fe7d68;} #userInfo ul li {positon: relative;} #userInfo ul li ul {display:none;} @@ -62,10 +62,10 @@ div#menu a:hover, div#menu a:hover span { color: #a1ebff; } div#menu li.current a {} div#menu {display: block; cursor: pointer; background-repeat: no-repeat;background-position: 95% 0;padding-right: 15px; _padding-right: 20px;} div#menu ul a.user_name { width:170px; text-align:right; margin:0; } -.pic_triangle{background: url(../images/item.png) -90px -48px no-repeat; float:right; display:block; width:10px; height:10px; margin-top:12px; margin-left:7px;} -.pic_triangle:hover{background: url(../images/item.png) -90px -78px no-repeat; } -div#menu ul ul a.parent {background: url(../images/item.png) -20px 6px no-repeat;width:60px;} -div#menu ul ul a.parent:hover {background: url(../images/item.png) -20px -11px no-repeat;} +.pic_triangle{background: url(/images/item.png) -90px -48px no-repeat; float:right; display:block; width:10px; height:10px; margin-top:12px; margin-left:7px;} +.pic_triangle:hover{background: url(/images/item.png) -90px -78px no-repeat; } +div#menu ul ul a.parent {background: url(/images/item.png) -20px 6px no-repeat;width:60px;} +div#menu ul ul a.parent:hover {background: url(/images/item.png) -20px -11px no-repeat;} /* menu::level1 */ div#menu a { padding: 5px 12px 0 10px;line-height: 30px; color: #fff;} /*div#menu li { background: url(images/main-delimiter.png) 98% 4px no-repeat; }*/ @@ -153,10 +153,10 @@ a.more{ float:right; font-size:12px; font-weight:normal; color:#a9a9a9; margin-t a:hover.more{ color:#64bdd9;} .project_box_ul{ padding:0 10px;} .project_box_list{ padding:10px 0; border-bottom:1px dashed #e2e1e1; padding-left:30px; color:#6f6c6c;} -.img_problem{ background:url(../images/img_project.png) 0 -20px no-repeat;} -.img_talk{ background:url(../images/img_project.png) 0 -62px no-repeat;} -.img_ziyuan{ background:url(../images/img_project.png) 0 -115px no-repeat;} -.img_edition{ background:url(../images/img_project.png) 0 -167px no-repeat;} +.img_problem{ background:url(/images/img_project.png) 0 -20px no-repeat;} +.img_talk{ background:url(/images/img_project.png) 0 -62px no-repeat;} +.img_ziyuan{ background:url(/images/img_project.png) 0 -115px no-repeat;} +.img_edition{ background:url(/images/img_project.png) 0 -167px no-repeat;} a.project_name{ color:#058c42;} a:hover.project_name{ color:#016f33;} a.project_txt{ color:#0781b4; width:445px; display:block; float:left; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} @@ -254,7 +254,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;} .table_maxWidth table {max-width: 642px;} .homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} .homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;} -.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px;} +.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(/images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px;} .homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} .postAttSize {color:#888888; font-size:12px; margin-left: 5px;} .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;} @@ -267,9 +267,9 @@ a.replyGrey {color:#888888; display:inline-block;} a.replyGrey:hover {color:#4b4b4b;} /*个人主页右部分*/ -a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;} +a.gz_btn{display:block; background:url(/images/pic_uersall.png) -318px -25px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;} a:hover.gz_btn{ color:#ff5722;} -a.qx_btn{display:block; background:url(../images/pic_uersall.png) -318px -47px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;} +a.qx_btn{display:block; background:url(/images/pic_uersall.png) -318px -47px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;} a:hover.qx_btn{color:#64bdd9;} .courseMenu {width:30px; display:block; float:right;height: 50px;} @@ -330,6 +330,8 @@ a.projectsLineGrey:hover {color:#ffffff;} .homepageLeftMenuMore:hover {background-color:#269ac9;} .homepageLeftMenuMoreIcon {background:url(/images/homepage_icon.png) -74px -240px no-repeat; display:block; height:18px;} .homepageLeftMenuHideIcon {background:url(/images/homepage_icon.png) 100px -624px no-repeat;display:block; height:18px;} +.homepageLeftMenuMoreIcon2 {background:url(/images/homepage_icon.png) -90px -240px no-repeat; display:block; height:18px;} +.homepageLeftMenuHideIcon2 {background:url(/images/homepage_icon.png) 85px -624px no-repeat;display:block; height:18px;} .homepageMenuSetting {display:inline-block; background:url(/images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top: 16px; margin-right: 15px;} .homepageMenuSetting:hover {background:url(/images/homepage_icon2.png) -190px -407px no-repeat;} a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} @@ -338,7 +340,7 @@ a.homepageMenuControl {float:left; width:180px;} .project_Label_New {width:218px; padding-left:10px; background:#fff; margin-top:15px; margin-bottom:10px;} .homepageLabelText {color:#484848; font-size:16px; margin-left:10px; margin-bottom:12px; display:block;} .homepageRightBanner {width:718px; margin:0px auto; float:right; background-color: #ffffff; padding:10px 15px; border:1px solid #dddddd;} -.homepageRightBannerImg{width:1000px; margin:0px auto; height: 60px; margin-top: 10px; background:url(../images/TeachersDay.jpg)} +.homepageRightBannerImg{width:1000px; margin:0px auto; height: 60px; margin-top: 10px; background:url(/images/TeachersDay.jpg)} a.homepageWhite {color:#ffffff;} a.homepageWhite:hover {color:#a1ebff} a.newsGrey {color:#4b4b4b;} @@ -358,12 +360,12 @@ a.menuGrey:hover {color:#fe7d68;} #navSearchAlert {display:none;} /*151228侧导航样式更新*/ -.menuSetting {background:url(../images/hwork_icon.png) -5px -303px no-repeat; display:inline-block; width:20px; height:20px;} -.praviteC {background:url(../images/hwork_icon.png) -79px -255px no-repeat;} +.menuSetting {background:url(/images/hwork_icon.png) -5px -303px no-repeat; display:inline-block; width:20px; height:20px;} +.praviteC {background:url(/images/hwork_icon.png) -79px -255px no-repeat;} .praviteCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;} -.publicC {background:url(../images/hwork_icon.png) -79px -125px no-repeat;} +.publicC {background:url(/images/hwork_icon.png) -79px -125px no-repeat;} .publicCP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; left:25px;} -.shild {background:url(../images/hwork_icon.png) -6px -354px no-repeat;} +.shild {background:url(/images/hwork_icon.png) -6px -354px no-repeat;} .shildP {display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;} ul.shild:hover li ul {display:block;} .subNavArrow {background:url(/images/hwork_icon.png) -82px -399px no-repeat; display:inline-block; width:20px; height:20px; position:absolute; top:10px; right:0px;} @@ -374,7 +376,7 @@ ul.subNavArrow:hover li ul {display:block;} /*左侧导航*/ .subNavBox{width:240px; background:#fff;margin:10px 10px 0 0;} .subNav{border-bottom:solid 1px #e5e3da;cursor:pointer;font-weight:bold;font-size:14px;color:#3ca5c6; height:26px;padding-left:10px;background-color:#fff; padding-top:2px;} -.subNav_jiantou{background:url(../images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;} +.subNav_jiantou{background:url(/images/jiantou1.jpg) no-repeat;background-position:95% 50%; background-color:#fff;} .subNav_jiantou:hover{color:#0781b4; } .currentDd{color:#0781b4;} .currentDt{background-color:#fff;} @@ -402,8 +404,8 @@ a.greyBtn2 {float:right; text-align:center; font-size:12px; color:#ffffff; backg .users_r_h2{background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;} /*留言*/ -a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; } -a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; } +a.icon_face{background:url(/images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; } +a:hover.icon_face{background:url(/images/public_icon.png) -79px -671px no-repeat; } .inputUsers_message{ border:1px solid #d2d2d2; width:718px; height:48px; color:#666; padding:5px; margin-bottom:5px;} .inputUsers_message02{ border:1px solid #d2d2d2; width:618px; height:26px; color:#666; padding:5px; margin-bottom:5px; } .message_list_box{ background:#f5f5f5; margin-top: 10px;} @@ -435,14 +437,14 @@ a.box_close{background:url(../images/img_floatbox.png) -22px 0 no-repeat;} .uppic_btn:hover {background-color: #329cbd;} /*myctrip*/ -.userImage{position:absolute; right:140px; top:5px; width:30px;height:30px; background: url(../images/item.png) 2px 4px no-repeat; line-height:1.4;} +.userImage{position:absolute; right:140px; top:5px; width:30px;height:30px; background: url(/images/item.png) 2px 4px no-repeat; line-height:1.4;} a.topnav_login_a{color:#fff; display:inline-block;} a.topnav_login_a:hover {color:#a1ebff;} -a.topnav_login_mes{color:#fff; width:10px;height:20px; padding-left:15px; background: url(../images/item.png) -84px -145px no-repeat; display:inline-block; vertical-align:top;} +a.topnav_login_mes{color:#fff; width:10px;height:20px; padding-left:15px; background: url(/images/item.png) -84px -145px no-repeat; display:inline-block; vertical-align:top;} a.topnav_login_mes:hover {color:#a1ebff;} a.topnav_login_box{ color:#fff; font-size:14px; font-weight:bold; width:90px; display:inline-block;} -.menuArrow {background:url(../images/item.png) -20px -40px no-repeat;} -li.menuArrow:hover {background:url(../images/item.png) -20px -70px no-repeat;} +.menuArrow {background:url(/images/item.png) -20px -40px no-repeat;} +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;} diff --git a/public/stylesheets/sy_public.css b/public/stylesheets/sy_public.css new file mode 100644 index 000000000..7c79bf6e6 --- /dev/null +++ b/public/stylesheets/sy_public.css @@ -0,0 +1,211 @@ +/* 字体颜色 */ +.sy_cblack{ color: #333;} +.sy_cgrey{ color: #888;} +.sy_corange{ color: #ee4a1f;} +.sy_f14{ font-size: 14px;} +.sy_f16{ font-size: 16px;} +a.sy_cgrey{ color: #888;} +a:hover.sy_cgrey{ color:#ee4a1f;} +a.sy_corange{ color: #ee4a1f; } +a:hover.sy_corange{ text-decoration:underline;} +a.sy_cblue{ color: #3b94d6;} +a.sy_cblack{ color: #333;} +a.sy_cgrey{ color: #888;} +a.sy_cmore{ font-size:12px; color:#888; font-weight:normal;} +a:hover.sy_cmore{color: #ee4a1f;} +/* 按钮*/ +a.btn_orange_big{ + border: 1px solid #ee4a1f; + color: #ee4a1f; + text-align: center; + font-size: 14px; + padding:0 10px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.btn_orange_big{ + background: #ee4a1f; + color: #fff; +} +a.btn_green_big{ + border: 1px solid #60b25e; + color: #60b25e; + text-align: center; + font-size: 14px; + padding:0 10px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.btn_green_big{ + background: #60b25e; + color: #fff; +} +a.sy_btn_green{ + color: #fff; + background: #60b25e; + text-align: center; + font-size: 12px; + padding:0 15px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.sy_btn_green{ background: #51a74f;} +a.sy_btn_grey{ + color: #333; + background: #e1e1e1; + text-align: center; + font-size: 12px; + padding:0 15px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.sy_btn_grey{ background: #c3c3c3;} +a.sy_btn_blue{ + color: #fff; + background: #3b94d6; + text-align: center; + font-size: 12px; + padding:0 15px; + height: 30px; + line-height: 30px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.sy_btn_blue{ background: #2788d0;} +/* 排序 */ +.sy_category{ + height: 50px; + line-height: 50px; + padding-left: 15px; + border-bottom:1px solid #ddd; +} +.sy_category span{ float: left;} +a.sortupbtn{ + background: url(../images/sy/liststyle.png) 0 3px no-repeat; + width:12px; + height:17px; + display:block; + margin-right:10px; + cursor:pointer; +} +a.sortdownbtn{ + background: url(../images/sy/liststyle.png) 0 -12px no-repeat; + width:12px; + height:17px; + display:block; + cursor:pointer; +} +/* 翻页 */ +.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; +} +a.pages-big{ + width:50px; +} +.pages .active{ + background-color:#3b94d6; + border:1px solid #3b94d6; + color:#fff; +} +.pages{ + width:330px; + + margin:20px auto 10px; +} +/* 输入框 */ +.sy_right_box input,.sy_right_box select{ + border:1px solid #ccc; + padding:5px; + background:#fff; +} +.sy_top_con input,.sy_top_con select{ + border:1px solid #ccc; + padding:5px; + background:#fff; +} +/* 加入班级弹窗 */ +#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; +} +.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; +} diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index 91c69f47a..3b856ad67 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -56,6 +56,9 @@ input.syllabus_input_min{ background: #fff; border: 1px solid #dddddd; } +.sy_tab_con{ + width:740px; padding:20px 20px 0 20px; position:relative; +} .syllabuscon_title{ color:#000; text-align:center; } @@ -146,3 +149,465 @@ a:hover.course-title{ color:#269ac9;} .homepageSyllabusName {font-size:16px; color:#484848; float:left; max-width:120px;} .syllabusTitleTextarea {resize:none; width:120px; margin-left: 10px; height:80px; max-width:120px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 0px;} +/* */ +/* 课程大纲头部 */ +.sy_top{ + background:#f5f5f5; + width: 100%; + height: 138px; +} +.sy_top_con{ + background: url(../images/sy/bg_sy.jpg) no-repeat; + width: 1280px; + margin: 0 auto; + height: 108px; + text-align:center; + padding-top: 30px; +} +.sy_top_con h2{ + font-size: 30px; + color: #cc3433; + font-weight:normal; +} +.sy_top_con p{ + font-size: 18px; + color: #333; +} +/* 课程大纲tab */ +.sy_content{ + width: 1000px; + margin: 0 auto; + margin-top:12px; +} +.sy_con_l{ + width: 785px; + border: 1px solid #e7e7e7; + background: #fff; +} +#sy_tab_nav { + border-bottom:1px solid #e7e7e7; + height:50px; + background: #f8f8f8; +} +#sy_tab_nav li { + float:left; + padding:0px 50px; + text-align:center; + height: 47px; + line-height: 47px; +} +#sy_tab_nav li a{ + font-size:16px; + color: #333; +} +.sy_tab_hover { + border-top:3px solid #ee4a1f; + border-bottom:1px solid #fff; + background: #fff; +} +.sy_tab_nomal { + border-bottom:none; +} +.undis { + display:none; +} +.dis { + display:block; +} +/* 课程大纲 */ +.icons_tishi{ + width: 110px; + height: 110px; + margin: 135px auto 20px; +} +.sy_tab_con_p{ + font-size: 16px; + text-align: center; + margin-bottom:100px; + color:#888; +} +.sy_classlist{ + padding: 15px 15px; + border-bottom: 1px dashed #e6e6e6; +} +.sy_classlist_title{ + font-size: 16px; + font-weight: normal; + margin-bottom: 5px; + max-width:600px; + overflow:hidden; + white-space: nowrap; + text-overflow:ellipsis; +} +.sy_con_r{ + width:205px; +} +.sy_right_box{ + border:1px solid #e7e7e7; + border-bottom:none; + background:#fff; + width:205px; + padding-bottom:15px; +} +.sy_right_title{ + border-left:5px solid #ee4a1f; + height:30px; + line-height:30px; + font-size:16px; + padding-left:10px; + margin-top:5px; +} +.sy_info label{ + width:70px; + text-align:right; + display:block; + float:left; + margin-right:5px; +} +.sy_info input,.sy_info select{ + width:105px; + border:1px solid #e7e7e7; + margin-bottom:5px; +} +.sy_info select{ + width:115px; +} +.sy_info li{ + height:30px; + line-height:30px; +} +input.sy_info_input_min{ + width:30px; +} +.sy_teachers_list{ + margin:10px; +} +.sy_teachers_list li{ + padding:10px 0; +} +.sy_teachers_img{ + width:60px; + height:60px; + border:3px solid #e6e6e6; + -webkit-border-radius:50px; + -moz-border-radius:50px; + -o-border-radius:50px; + border-radius:50px; +} +a.sy_teachers_name{ + color: #000; + display:block; + width:95px; + font-size:16px; + margin:5px 0 10px; +} +a:hover.sy_teachers_name{ + color: #ee4a1f; +} +.sy_teachers_span{ + font-size:12px; + color:#fff; + width:150px; + padding:2px 5px; + background:#ffb400; + -webkit-border-radius:50px; + -moz-border-radius:50px; + -o-border-radius:50px; + border-radius:50px; +} +/* 班级主页 */ +.sy_class_infobox{ + padding:15px; + background:#fff; + margin:12px auto 0; + width:968px; + border:1px solid #e5e5e5; + position: relative; +} +.homepagePostSetting { + position:absolute; + width:20px; + height:20px; + right:10px; + top:10px; +} +.homepagePostSetting ul li:hover ul { + display:block; +} +.homepagePostSettingIcon { + background:url(../images/sy/icons_sy.png) 1px -408px no-repeat; + width:20px; + height:20px; +} +.homepagePostSettiongText { + width:75px; + text-align: center; + line-height:2; + font-size:12px; + color:#616060; + background-color:#ffffff; + border:1px solid #eaeaea; + border-radius:3px; + position:absolute; + left:-60px; + top:20px; + padding:5px 0px; + display:none; + box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); +} +.homepagePostSettingIcon:hover { + background:url(../images/sy/icons_sy.png) -28px -408px no-repeat; +} +a.postOptionLink { + color:#616060; + display:block; + width:55px; + padding:0px 10px; +} +a.postOptionLink:hover { + color:#fff; + background-color:#3b94d6; +} + +.sy_class_logo{ + width:110px; + height:110px; +} +.sy_class_id{ + width:110px; + height:80px; + background:#f1f1f1; + text-align:center; + padding-top:30px; +} +.sy_class_id p{ + font-size:16px; + color:#333; +} +.sy_class_title{ + font-size: 18px; + font-weight: normal; + margin-bottom: 5px; + max-width:440px; + overflow:hidden; + white-space: nowrap; + text-overflow:ellipsis; +} +.icon_si{ + display:block; + width:30px; + height:22px; + background:url(../images/sy/icons_sy.png) 0 -452px no-repeat; + color:#fff; + font-size:12px; + padding-left:10px; + line-height: 22px; +} +.sy_class_titbox{margin-bottom:5px; padding-top:10px; } +a.sy_btn_orange{ + display:block; + border:1px solid #ee4a1f; + background:#fff url(../images/sy/icons_sy.png) 8px -548px no-repeat; + color:#ee4a1f; + text-align:center; + height:26px; + line-height:26px; + width:60px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; + padding-left:20px; +} +a:hover.sy_btn_orange{ + border:1px solid #fff; + background:#ee4a1f url(../images/sy/icons_sy.png) 8px -516px no-repeat; + color:#fff; +} +/* 班级主页左侧导航 */ +.sy_class_leftnav{ width:240px;} +.accordion li > a { + display: block; + padding: 0 10px 0 40px; + height:49px; + line-height:49px; + color: #333; + font-size:16px; + background: #f8f8f8; + border:1px solid #e5e5e5; + border-bottom:none; +} +.accordion > li:hover > a{ + color: #ee4a1f; + background: #fff; +} +.accordion > li:target > a, +.accordion > li > a.active { + color: #ee4a1f; + background: #fff; + border:1px solid #e5e5e5; + border-left:3px solid #ee4a1f; + border-bottom:none; +} +.accordion li{ position:relative;} + +.accordion li > a span { + margin-top:15px; + font-size:12px; + padding: 0 10px; + background: #dbdbdb; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; + margin-left:10px; + color: #333; +} +.accordion > li:hover > a span, +.accordion > li:target > a span, +.accordion > li > a.active span { + margin-left:10px; + color: #333; + background: #dbdbdb; +} +/* Images */ +.accordion > li > a:before { + position: absolute; + top: 0; + left: 0; + content: ''; + width: 24px; + height: 50px; + margin: 4px 8px; + background-repeat: no-repeat; + background-image: url(../images/sy/icons_sy.png); + background-position: 5px 13px; +} +.accordion li.sy_icons_index > a:before { background-position: 5px 13px; } +.accordion li.sy_icons_index:hover > a:before, +.accordion li.sy_icons_index:target > a:before, +.accordion li.sy_icons_index > a.active:before { background-position: -23px 13px; } + +.accordion li.sy_icons_boards > a:before { background-position: 5px -23px; } +.accordion li.sy_icons_boards:hover > a:before, +.accordion li.sy_icons_boards:target > a:before, +.accordion li.sy_icons_boards > a.active:before { background-position: -23px -23px; } + +.accordion li.sy_icons_more > a:before { background-position: 5px -60px; } +.accordion li.sy_icons_more:hover > a:before, +.accordion li.sy_icons_more:target > a:before, +.accordion li.sy_icons_more > a.active:before { background-position: -23px -60px; } + +.accordion li.sy_icons_hwork > a:before { background-position: 5px -100px; } +.accordion li.sy_icons_hwork:hover > a:before, +.accordion li.sy_icons_hwork:target > a:before, +.accordion li.sy_icons_hwork > a.active:before { background-position: -23px -100px; } + +.accordion li.sy_icons_news > a:before { background-position: 5px -134px; } +.accordion li.sy_icons_news:hover > a:before, +.accordion li.sy_icons_news:target > a:before, +.accordion li.sy_icons_news > a.active:before { background-position: -23px -134px; } + +.accordion li.sy_icons_files > a:before { background-position: 5px -172px; } +.accordion li.sy_icons_files:hover > a:before, +.accordion li.sy_icons_files:target > a:before, +.accordion li.sy_icons_files > a.active:before { background-position: -23px -172px; } + +.accordion li.sy_icons_feedback > a:before { background-position: 5px -214px; } +.accordion li.sy_icons_feedback:hover > a:before, +.accordion li.sy_icons_feedback:target > a:before, +.accordion li.sy_icons_feedback > a.active:before { background-position: -23px -214px;} + +.accordion li.sy_icons_poll > a:before { background-position: 5px -251px; } +.accordion li.sy_icons_poll:hover > a:before, +.accordion li.sy_icons_poll:target > a:before, +.accordion li.sy_icons_poll > a.active:before { background-position: -23px -251px; } + +.accordion li.sy_icons_exercise > a:before { background-position: 5px -290px; } +.accordion li.sy_icons_exercise:hover > a:before, +.accordion li.sy_icons_exercise:target > a:before, +.accordion li.ssy_icons_exercise > a.active:before { background-position: -23px -290px; } + +.accordion li.sy_icons_st > a:before { background-position: 5px -330px; } +.accordion li.sy_icons_st:hover > a:before, +.accordion li.sy_icons_st:target > a:before, +.accordion li.sy_icons_st > a.active:before { background-position: -23px -330px; } +/* Sub Menu */ +.sub-menu li a { + color: #797979; + background: #f8f8f8; + height:39px; + line-height:39px; + font-size:14px; +} +.sub-menu li:last-child a { border-bottom:1px solid #e5e5e5; } +.accordion li > .sub-menu { + display: none; +} +.accordion li:target > .sub-menu { + display: block; +} +.accordion > li > a.sy_class_add:before{background-image:none;} +.accordion > li > a.sy_class_add { + padding:0; + border:none; + display:block; + position: absolute; + top:15px; + right:10px; + width:20px; + height:20px; + background: url(../images/sy/icons_sy.png) 0px -487px no-repeat; +} +.sub-menu > li > a.sy_class_add { + padding:0; + border:none; + display:block; + position: absolute; + top:15px; + right:10px; + width:20px; + height:20px; + background: url(../images/sy/icons_sy.png) 0px -487px no-repeat; +} +.accordion li .sy_class_add:hover { + background: url(../images/sy/icons_sy.png) -32px -487px no-repeat; + padding:0; + border:none; +} + +.sy_class_leftbox{ width:208px; background: #fff; border: 1px solid #e5e5e5; border-bottom: none; padding:10px 15px;} +.sy_class_users{ width:50px; margin:0 15px 10px 4px; } +.sy_class_users span{ display:block; height:20px;width:50px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} +.sy_class_users img{ + width:40px; + height:40px; + margin:5px 0; + border: 3px solid #fff; + -webkit-border-radius:50px; + -moz-border-radius:50px; + -o-border-radius:50px; + border-radius:50px; +} +.sy_class_users img:hover{border: 3px solid #e6e6e6;} +.sy_class_leftbox h3{ + height:30px; + line-height:30px; + font-size:14px; + font-weight:normal; +} +.sy_sq_orange{ display: block;width: 15px; height: 15px; background:#f79981; color: #fff; text-align:center; line-height: 15px;} +a.sy_class_ltitle{display: block; font-size: 14px; width: 185px; color:#888; } +a:hover.sy_class_ltitle{ color:#333;} +.sy_cir_grey{ + font-size:12px; + padding: 0 10px; + background: #dbdbdb; + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; + color: #888; +} +.sy_class_lclass li{ padding:10px 0; border-bottom: 1px dashed #ebebeb;} +.sy_class_lclass li:last-child { border-bottom:none;} +.sy_class_r{ width: 748px; background: #fff; border: 1px solid #e5e5e5;} + diff --git a/spec/factories/commits.rb b/spec/factories/commits.rb new file mode 100644 index 000000000..c520e8b64 --- /dev/null +++ b/spec/factories/commits.rb @@ -0,0 +1,11 @@ +FactoryGirl.define do + factory :commit do + repository_id 1 +version "MyString" +committer "MyString" +comments "MyText" +committed_on "2016-07-21" +project_id 1 + end + +end diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb new file mode 100644 index 000000000..546996270 --- /dev/null +++ b/spec/models/commit_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Commit, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end