diff --git a/Gemfile b/Gemfile index 58ccbc011..34636a914 100644 --- a/Gemfile +++ b/Gemfile @@ -50,10 +50,10 @@ gem 'elasticsearch-model' gem 'elasticsearch-rails' #rails 3.2.22.2 bug - gem "test-unit", "~>3.0" + # gem "test-unit", "~>3.0" ### profile - gem 'oneapm_rpm' + # gem 'oneapm_rpm' group :development do gem 'grape-swagger' @@ -63,22 +63,18 @@ group :development do if RUBY_PLATFORM =~ /w32/ gem 'win32console' end + + if RUBY_PLATFORM =~ /darwin/ + gem 'puma' +end end group :development, :test do - unless RUBY_PLATFORM =~ /w32/ - gem 'pry-rails' if RUBY_VERSION >= '2.0.0' gem 'pry-byebug' + gem "test-unit", "~>3.0" end - gem 'pry-stack_explorer' - if RUBY_PLATFORM =~ /darwin/ - gem 'puma' - end - end - gem 'rspec-rails', '~> 3.0' - gem 'factory_girl_rails' end # Gems used only for assets and not required diff --git a/app/api/mobile/entities/attachment.rb b/app/api/mobile/entities/attachment.rb index 0eda2d1c0..55e4aa555 100644 --- a/app/api/mobile/entities/attachment.rb +++ b/app/api/mobile/entities/attachment.rb @@ -17,17 +17,18 @@ module Mobile end else case field + when :download_url + "attachments/download/#{f.try(:id)}" when :file_dir "attachments/download/" << f.send(:id).to_s << '/' when :attafile_size (number_to_human_size(f.filesize)).gsub("ytes", "").to_s when :coursename - f.course.nil? ? "" : f.course.name + f.try(:course).try(:name) || '' when :syllabus_title - f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title + f.try(:course).try(:syllabus).try(:title) || '' when :course_id - f.course.nil? ? 0 : f.course.id - + f.try(:course).try(:id) || 0 end end end @@ -50,6 +51,8 @@ module Mobile current_user_is_teacher = is_course_teacher(current_user,instance.course) current_user_is_teacher end + + attachment_expose :download_url end end end \ No newline at end of file diff --git a/app/api/mobile/entities/issue.rb b/app/api/mobile/entities/issue.rb index 7f09906b5..2cb6cd87a 100644 --- a/app/api/mobile/entities/issue.rb +++ b/app/api/mobile/entities/issue.rb @@ -180,6 +180,8 @@ module Mobile end end end + + expose :attachments, using: Mobile::Entities::Attachment end end end \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 14d5961cd..88e34d25f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -55,7 +55,7 @@ class ApplicationController < ActionController::Base include Redmine::Search::Controller include Redmine::MenuManager::MenuController helper Redmine::MenuManager::MenuHelper - + def user_agent logger.info "HTTP_USER_AGENT #{request.env["HTTP_USER_AGENT"]}" end @@ -117,6 +117,9 @@ class ApplicationController < ActionController::Base elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth? # RSS key authentication does not start a session user = User.find_by_rss_key(params[:key]) + elsif session[:wechat_openid] + uw = UserWechat.find_by_openid(session[:wechat_openid]) + user = uw.user if uw end end if user.nil? && Setting.rest_api_enabled? && accept_api_auth? @@ -509,8 +512,7 @@ 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/attachments_controller.rb b/app/controllers/attachments_controller.rb index e7a5d3164..848d85c34 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -72,8 +72,10 @@ class AttachmentsController < ApplicationController def direct_download @attachment.increment_download + file_type = detect_content_type(@attachment) + send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename), - :type => detect_content_type(@attachment), + :type => file_type, :disposition => 'attachment' #inline can open in browser end @@ -130,11 +132,7 @@ class AttachmentsController < ApplicationController def download # modify by nwb # 下载添加权限设置 - if (params[:type] && params[:type] == "wechat" ) - candown = true - else - candown = attachment_candown @attachment - end + candown = attachment_candown @attachment if candown || User.current.admin? || User.current.id == @attachment.author_id if stale?(:etag => @attachment.digest) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 5e0ef4638..fe707ac5b 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -32,6 +32,13 @@ class CoursesController < ApplicationController before_filter :require_login, :only => [:join, :unjoin] #before_filter :allow_join, :only => [:join] + # 邀请码停用/启用 + def set_invite_code_halt + if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? + @course.update_attribute('invite_code_halt', @course.invite_code_halt == 0 ? 1 : 0) + end + end + #查找组织 def search_public_orgs_not_in_course condition = '%%' diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 3234d15c0..b7e4b9efd 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -82,6 +82,27 @@ class HomeworkCommonController < ApplicationController @homework.publish_time = params[:homework_common][:publish_time] end homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new + param_end_time = Time.parse(params[:homework_common][:end_time]).strftime("%Y-%m-%d") + homework_end_time = Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") + if homework_end_time != param_end_time + if homework_end_time > param_end_time + @homework.student_works.where("work_status = 1").each do |st| + if param_end_time < Time.parse(st.commit_time.to_s).strftime("%Y-%m-%d") + st.late_penalty = @homework.late_penalty + st.work_status = 2 + st.save + end + end + else + @homework.student_works.where("work_status = 2").each do |st| + if param_end_time >= Time.parse(st.commit_time.to_s).strftime("%Y-%m-%d") + st.late_penalty = 0 + st.work_status = 1 + st.save + end + end + end + end @homework.end_time = params[:homework_common][:end_time] || Time.now @homework.course_id = params[:course_id] if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index c6cb018a5..2f0b1d45e 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -22,9 +22,9 @@ class IssuesController < ApplicationController before_filter :authorize1, :only => [:show] before_filter :find_issue, :only => [:show, :edit, :update,:add_journal, :add_journal_in_org] before_filter :find_issues, :only => [:bulk_edit, :bulk_update, :destroy] - before_filter :find_project, :only => [:new, :create, :update_form] + before_filter :find_project, :only => [:new, :create, :update_form, :issue_commits, :commit_for_issue, :issue_commit_delete] #before_filter :authorize, :except => [:index, :show] - before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply] + before_filter :authorize, :except => [:index,:add_journal, :add_journal_in_org,:delete_journal,:reply,:add_reply, :issue_commits, :commit_for_issue, :issue_commit_delete] before_filter :find_optional_project, :only => [:index] before_filter :check_for_default_issue_status, :only => [:new, :create] @@ -57,6 +57,57 @@ class IssuesController < ApplicationController helper :project_score include ApplicationHelper + # issue和代码提交id关联模块 --> over + # 获取某个项目的commit_ids + def issue_commits + begin + return render_404 if @project.gpid.nil? + @issue_commit_ids = (params[:issue_commit_ids].is_a?(Array) ? params[:issue_commit_ids] : params[:issue_commit_ids].split(",")) unless params[:issue_commit_ids].nil? + search = params[:search].to_s.strip + @type = params[:type] + limit = 15 + g = Gitlab.client + g_project = g.project(@project.gpid) + rev = params[:branch].nil? ? g_project.default_branch : params[:branch] + @project_branches = g.branches(@project.gpid) + @branch_names = @project_branches.map{|b| b.name} + @default_branch = g_project.default_branch + # 搜索的分页需要单独处理,因为搜索不容易获取总数 + if search.present? + @commits = g.commits(@project.gpid, ref_name:rev, :search => search) + @commits_count = @commits.count + @commits_pages = Paginator.new @commits_count, limit, params['page'] || 1 + @offset ||= @commits_pages.offset + @commits = paginateHelper @commits,limit + else + @commits = g.commits(@project.gpid, page:(params[:page].to_i - 1).to_s, ref_name:rev, :search => search) + @commits_count = g.user_static(@project.gpid, :rev => rev).count + @commits_pages = Redmine::Pagination::Paginator.new @commits_count, limit, params[:page] + end + rescue Exception => e + puts e + end + end + + # 选择对应的Commit + def commit_for_issue + history_commit_ids = params[:issue_for_commit_ids].split(",") unless params[:issue_for_commit_ids].nil? + @issue_commit_ids = (history_commit_ids.blank? ? params[:checkbox1] : params[:checkbox1] | history_commit_ids).uniq + end + + def issue_commit_delete + commit_id = params[:commit_id].split(",") + issue_commit_ids = params[:issue_commit_ids] + # issue_id存在则为issue详情或者编辑的时候,否则为新建Issue + # 编辑和详情的时候需要在数据库中删除记录,新建的时候在内存中删除 + if params[:issue_id] + commit_issue = CommitIssues.where(:commit_id => commit_id, :issue_id => params[:issue_id], :project_id => @project.id).first + commit_issue.delete if commit_issue + end + @issue_commit_ids = issue_commit_ids - commit_id + end + # over + def index # 顶部导航 @project_menu_type = 2 @@ -163,14 +214,14 @@ class IssuesController < ApplicationController def show # 顶部导航 @project_menu_type = 2 - # 打开编辑内容 @is_edit = true unless params[:edit].nil? - # 当前用户查看指派给他的缺陷消息,则设置消息为已读 query = ForgeMessage.where("forge_message_type =? and user_id =? and forge_message_id =?", "Issue", User.current, @issue).first query.update_attribute(:viewed, true) unless query.nil? - + # issue 关联的commit + commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) + @issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id} # issue 新建的at消息 User.current.at_messages.unviewed('Issue', @issue.id).each {|x| x.viewed!} # 回复的at消息 @@ -238,6 +289,8 @@ class IssuesController < ApplicationController @issue.fixed_version_id = nil if @issue.fixed_version_id == 0 @issue.assigned_to_id = nil if @issue.assigned_to_id == 0 if @issue.save + # 关联commmit + update_issue_commit params[:commit_ids] #params[:issue][:assigned_to_id] = nil if params[:issue][:assigned_to_id].to_i == 0 senduser = User.find(params[:issue][:assigned_to_id]) issue_id = @issue.id @@ -276,6 +329,9 @@ class IssuesController < ApplicationController def edit # 修改实例变量的值 return unless update_issue_from_params + # issue 关联的commit + commit_issues = CommitIssues.where(:issue_id => @issue.id, :project_id => @issue.project_id) + @issue_commit_ids = commit_issues.map{|commit_issue| commit_issue.commit_id} respond_to do |format| format.html {render :layout => 'base_projects' }#added by young @@ -309,9 +365,9 @@ class IssuesController < ApplicationController end end end - - if @saved + # 更新commit关联情况 + update_issue_commit params[:commit_ids] #修改界面增加跟踪者 watcherlist = @issue.watcher_users select_users = [] @@ -356,6 +412,26 @@ class IssuesController < ApplicationController end end + # 保存issue的时候相关的commit操作 + # commit_ids => "9b9845ff,poor56el" + def update_issue_commit commit_ids + # 关联commmit + commit_ids = params[:commit_ids] + unless commit_ids.blank? + commit_ids = commit_ids.split(",").uniq + if params[:action] == "update" + exist_commit_ids = CommitIssues.where(:issue_id => @issue, :project_id => @issue.project_id) + unless exist_commit_ids.blank? + exist_commit_ids = exist_commit_ids.map{|commit| commit.commit_id} + commit_ids = commit_ids - exist_commit_ids + end + end + commit_ids.each do |commit_id| + CommitIssues.create(:commit_id => commit_id, :project_id => @issue.project_id, :issue_id => @issue.id) + end + end + end + def update_user_issue_detail(issue, params) case params[:type] when "status" @@ -794,7 +870,6 @@ class IssuesController < ApplicationController # 更新issue状态时,journal表产生记录,返回@current_journal @issue.init_journal(User.current) - issue_attributes = params[:issue] if issue_attributes && params[:conflict_resolution] case params[:conflict_resolution] @@ -809,18 +884,18 @@ class IssuesController < ApplicationController end end - senduser = User.find(params[:issue][:assigned_to_id]) - - if senduser.id != User.current.id && @issue.assigned_to_id != params[:issue][:assigned_to_id].to_i - issue_id = @issue.id - issue_title = params[:issue][:subject] - priority_id = params[:issue][:priority_id] - ps = ProjectsService.new - ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id + if params[:action] == "update" + senduser = User.find(params[:issue][:assigned_to_id]) + if senduser.id != User.current.id && @issue.assigned_to_id != params[:issue][:assigned_to_id].to_i + issue_id = @issue.id + issue_title = params[:issue][:subject] + priority_id = params[:issue][:priority_id] + ps = ProjectsService.new + ps.send_wechat_project_issue_notice senduser,@issue.project,issue_id,issue_title,priority_id + end end @issue.safe_attributes = issue_attributes - @priorities = IssuePriority.active @allowed_statuses = @issue.new_statuses_allowed_to(User.current) true diff --git a/app/controllers/pull_requests_controller.rb b/app/controllers/pull_requests_controller.rb index 6f245a92b..b6fdd1fee 100644 --- a/app/controllers/pull_requests_controller.rb +++ b/app/controllers/pull_requests_controller.rb @@ -38,12 +38,12 @@ class PullRequestsController < ApplicationController @requests_merged_count = merge_requests.select{|request| request.state == "merged"}.count @requests_closed_count = merge_requests.select{|request| request.state == "closed"}.count - @limit = 10 + @limit = 20 @is_remote = true @count = type_count(type, @requests_opened_count, @requests_merged_count, @requests_closed_count) @pages = Paginator.new @count, @limit, params['page'] || 1 @offset ||= @pages.offset - @requests = paginateHelper @requests, 10 + @requests = paginateHelper @requests, 20 respond_to do |format| format.html format.js diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 596775045..f579090e6 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -7,7 +7,7 @@ class StudentWorkController < ApplicationController require "base64" before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex, :set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project, - :search_course_students,:work_canrepeat,:add_group_member] + :search_course_students,:work_canrepeat,:add_group_member,:change_project] before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment] before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work] before_filter :author_of_work, :only => [:edit, :update, :destroy] @@ -587,6 +587,14 @@ class StudentWorkController < ApplicationController if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") student_work.late_penalty = @homework.late_penalty student_work.work_status = 2 + # 缺评扣分 + if @homework.homework_detail_manual.no_anon_penalty == 0 && @homework.homework_detail_manual.comment_status == 3 && @homework.anonymous_comment == 0 + work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")" + all_dis_eva = StudentWorksEvaluationDistribution.where("student_work_id IN #{work_ids}") + has_sw_count = all_dis_eva.select("distinct user_id").count + anon_count = all_dis_eva.count / has_sw_count + student_work.absence_penalty = @homework.homework_detail_manual.absence_penalty * anon_count + end else student_work.late_penalty = 0 student_work.work_status = 1 @@ -1052,7 +1060,7 @@ class StudentWorkController < ApplicationController end def forbidden_anonymous_comment - @homework.update_column('anonymous_comment', 1) + @homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0) homework_detail_manual = @homework.homework_detail_manual homework_detail_programing = @homework.homework_detail_programing if homework_detail_programing @@ -1084,6 +1092,7 @@ class StudentWorkController < ApplicationController respond_to do |format| format.js end + @homework = @work.homework_common end def new_student_work_project @@ -1130,6 +1139,26 @@ class StudentWorkController < ApplicationController end end + # 作品更换关联项目 + def change_project + work = @homework.student_works.has_committed.where("user_id = #{User.current.id}").first + project = Project.find params[:projectName].to_i + if work && project + relate_user_ids = work.student_work_projects.map{|pro| pro.user_id} + member_ids = project.members.map{|mem| mem.user_id} + if (relate_user_ids & member_ids) == relate_user_ids + work.student_work_projects.update_all(:project_id => params[:projectName].to_i) + student_works = @homework.student_works.where("user_id in #{'(' + relate_user_ids.join(',') + ')'}") + student_works.update_all(:project_id => params[:projectName].to_i) + else + @remain_user_ids = relate_user_ids - (relate_user_ids & member_ids) + end + end + respond_to do |format| + format.js + end + end + #查找课程的学生 def search_course_students name = "" diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index da7cfd849..ed3148e6f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -35,14 +35,14 @@ class UsersController < ApplicationController # before_filter :can_show_course, :only => [:user_courses,:user_homeworks] - before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, + before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses, :unsolved_issues_list, :user_homeworks,:student_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments, :watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index, :activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index, :activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource, :user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction, :user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list, - :sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues] + :sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community] before_filter :auth_user_extension, only: :show #before_filter :rest_user_score, only: :show #before_filter :select_entry, only: :user_projects @@ -433,7 +433,8 @@ class UsersController < ApplicationController render_404 return end - @message_alls = paginateHelper @message_alls,25 + + @message_alls = paginateHelper @message_alls, 25 respond_to do |format| format.html{render :layout=>'new_base_user'} end @@ -1186,10 +1187,18 @@ class UsersController < ApplicationController student_work = StudentWork.where(homework_common_id: homework.id, user_id: User.current.id).first if student_work - #提交作品时,计算是否迟交 + # 提交作品时,计算是否迟交 if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") student_work.late_penalty = homework.late_penalty student_work.work_status = 2 + # 缺评扣分 + if homework.homework_detail_manual.no_anon_penalty == 0 && homework.homework_detail_manual.comment_status == 3 && homework.anonymous_comment == 0 + work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")" + all_dis_eva = StudentWorksEvaluationDistribution.where("student_work_id IN #{work_ids}") + has_sw_count = all_dis_eva.select("distinct user_id").count + anon_count = all_dis_eva.count / has_sw_count + student_work.absence_penalty = homework.homework_detail_manual.absence_penalty * anon_count + end else student_work.late_penalty = 0 student_work.work_status = 1 @@ -1806,22 +1815,197 @@ class UsersController < ApplicationController end def show - #更新用户申请成为课程老师或教辅消息的状态 + if is_current_user + # 自己的主页显示消息 + # 系统消息为管理员发送,我的消息中包含有系统消息 + @message_alls = [] + messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc") + messages.each do |message_all| + mess = message_all.message + unless (message_all.message_type == 'CourseMessage' && mess && mess.course && mess.course.is_delete == 1) + @message_alls << mess + end + end + @message_count = @message_alls.count + @message_alls = paginateHelper @message_alls, 20 + # 用户待解决的issue +=begin + @unsolved_issues = Issue.where(:assigned_to_id => @user.id, :status_id => [1, 2, 4, 6]).includes(:author, :project).order("updated_on desc") + @unsolved_issues_count = @unsolved_issues.count + @unsolved_issue_pages = Paginator.new @unsolved_issues_count, 20, params['page'] || 1 + @unsolved_issues = paginateHelper @unsolved_issues, 20 +=end + @unsolved_issues_count = Issue.where(:assigned_to_id => @user.id, :status_id => [1, 2, 4, 6]).includes(:author, :project).order("updated_on desc").count + # 用户待完成的作业 + my_course_ids = StudentsForCourse.where(:student_id => @user.id).blank? ? "(-1)" : "(" + StudentsForCourse.where(:student_id => @user.id).map{|sc| sc.course_id}.join(",") + ")" + homeworks = HomeworkCommon.where("course_id in #{my_course_ids} and publish_time <= '#{Date.today}'") + homework_ids = homeworks.blank? ? "(-1)" : "(" + homeworks.map{|homework| homework.id}.join(",") + ")" + student_works = StudentWork.where("user_id = #{@user.id} and homework_common_id in #{homework_ids} and work_status != 0") + @unfinished_homework_count = homeworks.count - student_works.count + # 用户待完成的测验 + exercises = Exercise.where("course_id in #{my_course_ids} and exercise_status = 2") + exercise_ids = exercises.blank? ? "(-1)" : "(" + exercises.map{|ex| ex.id}.join(",") + ")" + exercise_users = ExerciseUser.where("user_id = #{@user.id} and exercise_id in #{exercise_ids}") + @unfinished_test_count = exercises.count - exercise_users.count + # 用户待完成的问卷 + polls = Poll.where("polls_type = 'Course' and polls_group_id in #{my_course_ids} and polls_status = 2") + poll_ids = polls.blank? ? "(-1)" : "(" + polls.map{|poll| poll.id}.join(",") + ")" + poll_users = PollUser.where("user_id = #{@user.id} and poll_id in #{poll_ids}") + @unfinished_poll_count = polls.count - poll_users.count + # 用户待匿评的作品 + student_work_evaluations = @user.student_works_evaluation_distributions + student_work_ids = student_work_evaluations.blank? ? "(-1)" : "(" + student_work_evaluations.map{|st| st.student_work_id}.join(",") + ")" + student_work_scores = @user.student_works_scores.where("student_work_id in #{student_work_ids} and reviewer_role = 3") + @anonymous_evaluation_count = student_work_evaluations.count - student_work_scores.count + # 待评阅的作业 暂不做 + @unreview_homework = 1 + # 待审批的作业 + @unapproval_homework = 1 + else + # 看别人的主页显示动态 + #更新用户申请成为课程老师或教辅消息的状态 + if params[:course_id] != nil + join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", + params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false) + join_course_messages.update_all(:viewed => true) + end + shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) + shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) + @page = params[:page] ? params[:page].to_i + 1 : 0 + user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" + user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" + course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')" + project_types = "('Message','Issue','Project')" + principal_types = "JournalsForMessage" + container_type = '' + act_type = '' + # 他的动态 + sql = "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}))" + if params[:type].present? + case params[:type] + when "course_homework" + container_type = 'Course' + act_type = 'HomeworkCommon' + when "course_news" + container_type = 'Course' + act_type = 'News' + when "course_message" + container_type = 'Course' + act_type = 'Message' + when "course_poll" + container_type = 'Course' + act_type = 'Poll' + when "course_journals" + container_type = 'Course' + act_type = 'JournalsForMessage' + when "project_issue" + container_type = 'Project' + act_type = 'Issue' + when "project_message" + container_type = 'Project' + act_type = 'Message' + when "user_journals" + container_type = 'Principal' + act_type = 'JournalsForMessage' + when "current_user" + container_type = 'Principal' + act_type = 'Principal' + when "all" + container_type = 'all' + act_type = 'all' + end + end + if container_type != '' && container_type != 'all' + if container_type == 'Course' + sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'" + elsif container_type == 'Project' + sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'" + elsif container_type == 'Principal' && act_type == 'JournalsForMessage' + sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}" + elsif container_type == 'Principal' && act_type == 'Principal' + sql = "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}))" + end + if User.current != @user + sql += " and user_id = #{@user.id}" + end + else + if User.current != @user + blog_ids = "("+@user.blog.id.to_s+")" + 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(','))+")" + end + sql = "(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}) " + + "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})" + if container_type != 'all' && User.current != @user + sql = "user_id = #{@user.id} and(" + sql + ")" + end + end + @user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count + @user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10) + @type = params[:type] + end + respond_to do |format| + format.js + format.html {render :layout => 'new_base_user'} + end + end + + # 待解决的Issue + def unsolved_issues_list + @unsolved_issues = Issue.where(:assigned_to_id => @user.id, :status_id => [1, 2, 4, 6]).includes(:author, :project).order("updated_on desc") + @unsolved_issues_count = @unsolved_issues.count + @limit = 20 + @is_remote = true + @unsolved_issues_pages = Paginator.new @unsolved_issues_count, @limit, params['page'] || 1 + @offset ||= @unsolved_issues_pages.offset + @unsolved_issues = paginateHelper @unsolved_issues, @limit + respond_to do |format| + format.js + end + end + + # 待完成的作业 + def unfinished_homework_list + + end + + # 待完成的测验 + def unfinished_test_list + + end + + # 待完成的问卷 + def unfinished_poll_list + + end + + # 待匿评的作业 + def anonymous_evaluation_list + + end + + # 待审批的申请 + def unapproval_homework_list + + end + + # 课程社区 + def course_community if params[:course_id] != nil join_course_messages = CourseMessage.where("course_id =? and course_message_type =? and user_id =? and course_message_id =? and viewed =?", params[:course_id], 'JoinCourseRequest', User.current.id, @user.id, false) join_course_messages.update_all(:viewed => true) end - shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) @page = params[:page] ? params[:page].to_i + 1 : 0 - user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')" - project_types = "('Message','Issue','Project')" principal_types = "JournalsForMessage" container_type = '' act_type = '' + if params[:type].present? case params[:type] when "course_homework" @@ -1839,6 +2023,63 @@ class UsersController < ApplicationController when "course_journals" container_type = 'Course' act_type = 'JournalsForMessage' + when "user_journals" + container_type = 'Principal' + act_type = 'JournalsForMessage' + when "current_user" + container_type = 'Principal' + act_type = 'Principal' + when "all" + container_type = 'all' + act_type = 'all' + end + end + if container_type != '' && container_type != 'all' + if container_type == 'Course' + sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'" + elsif container_type == 'Principal' && act_type == 'JournalsForMessage' + sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}" + elsif container_type == 'Principal' && act_type == 'Principal' + sql = "user_id = #{@user.id} and (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})" + end + if User.current != @user + sql += " and user_id = #{@user.id}" + end + else + if User.current != @user + blog_ids = "("+@user.blog.id.to_s+")" + 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(','))+")" + end + sql = "(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}) " + + "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})" + if container_type != 'all' && User.current != @user + sql = "user_id = #{@user.id} and(" + sql + ")" + end + end + @user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count + @user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10) + @type = params[:type] + respond_to do |format| + format.js + format.html {render :layout => 'base_course_community'} + end + end + + # 项目社区 + def project_community + # 看别人的主页显示动态 + #更新用户申请成为课程老师或教辅消息的状态 + shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) + @page = params[:page] ? params[:page].to_i + 1 : 0 + user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" + project_types = "('Message','Issue','Project')" + principal_types = "JournalsForMessage" + container_type = '' + act_type = '' + if params[:type].present? + case params[:type] when "project_issue" container_type = 'Project' act_type = 'Issue' @@ -1857,14 +2098,12 @@ class UsersController < ApplicationController end end if container_type != '' && container_type != 'all' - if container_type == 'Course' - sql = "container_type = '#{container_type}' and container_id in #{user_course_ids} and act_type = '#{act_type}'" - elsif container_type == 'Project' + if container_type == 'Project' sql = "container_type = '#{container_type}' and container_id in #{user_project_ids} and act_type = '#{act_type}'" elsif container_type == 'Principal' && act_type == 'JournalsForMessage' sql = "container_type = '#{container_type}' and act_type= '#{act_type}' and container_id = #{@user.id}" elsif container_type == 'Principal' && act_type == 'Principal' - sql = "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}))" + sql = "user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}))" end if User.current != @user sql += " and user_id = #{@user.id}" @@ -1876,19 +2115,18 @@ class UsersController < ApplicationController 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(','))+")" end sql = "(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}) " + "or (container_type = 'Blog' and act_type= 'BlogComment' and container_id in #{blog_ids})" if container_type != 'all' && User.current != @user sql = "user_id = #{@user.id} and(" + sql + ")" end end - + @user_activities_count = UserActivity.where("#{sql}").order('updated_at desc').count @user_activities = UserActivity.where("#{sql}").order('updated_at desc').limit(10).offset(@page * 10) @type = params[:type] respond_to do |format| format.js - format.html {render :layout => 'new_base_user'} + format.html {render :layout => 'base_project_community'} end end @@ -3539,7 +3777,7 @@ class UsersController < ApplicationController # @syllabus = paginateHelper @syllabus,@limit respond_to do |format| - format.html {render :layout => 'new_base_user'} + format.html {render :layout => 'base_course_community'} end end @@ -3683,7 +3921,7 @@ class UsersController < ApplicationController @my_joined_projects_count = @my_joined_projects.count respond_to do |format| - format.html {render :layout => 'new_base_user'} + format.html {render :layout => 'base_project_community'} end end diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 654f83855..25ce1f83e 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -1,4 +1,6 @@ #coding=utf-8 + +require 'base64' class WechatsController < ActionController::Base wechat_responder @@ -105,6 +107,7 @@ class WechatsController < ActionController::Base end on :event, with: 'unsubscribe' do |request| + unBind(request) request.reply.success # user can not receive this message end @@ -272,12 +275,18 @@ class WechatsController < ActionController::Base end end + def unBind(request) + uw = user_binded?(request[:FromUserName]) + uw.try(:subscribe!) + end + def sendBind(request) tmpurl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login&connect_redirect=1#wechat_redirect" logger.info "tmpurl!!!!!!!!!!!!!!" logger.info tmpurl news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台! -在这里您可以随时了解您的课程和项目动态,随时点赞和回复。 +在这里您可以随时了解您的课程和项目动态,随时点赞和回复。交作业、代码提交等更多功能,请前往 www.trustie.net + 我们将会与微信不断结合,为您提供更有价值的服务。 您还未绑定确实的用户,请先绑定,谢谢!" } } @@ -485,9 +494,33 @@ class WechatsController < ActionController::Base end + # 用于权限跳转 + def auth + state = params[:state] + url = "#{ROOT_URL}/wechat/auth_callback" + authorize_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{url}&response_type=code&scope=snsapi_base&state=#{state}&connect_redirect=1#wechat_redirect" + redirect_to authorize_url + end + + def auth_callback + path = Base64.urlsafe_decode64(params[:state]) + open_id = get_openid_from_code(params[:code]) + unless open_id + render 'wechats/open_wechat', layout: nil and return + end + + redirect_to "/wechat/user_activities##{path}" + end + + private def get_openid_from_code(code) - return 'oCnvgvz8R7QheXE-R9Kkr39j8Ndg' if code =='only-for-test' + if code =='only-for-test' + openid = 'o3ss_wHOOnHkz1khBJxH8RF4SfPY' + session[:wechat_openid] = openid + return openid + end + openid = session[:wechat_openid] unless openid if code diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 02bdde103..73b5e9b5f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -37,11 +37,21 @@ module ApplicationHelper # super # end + # 获取多种类型的user用户名 + def user_message_username user + user.try(:show_name) + end + # 超出1w后用k+形式显示 def switch_integer_into_k number number > 10000 ? (number.to_f / 1000).round.to_s + "k" : number end + # 判断某个课程是否包含仅对自己可见的作业 + def course_has_score_open_common_homework course + course.homework_commons.select{|hc| hc.score_open == 0}.count > 0 ? true : false + end + # 隐藏项目以外的信息 # return: true 显示,false 不显示 def hidden_unproject_infos @@ -72,12 +82,36 @@ module ApplicationHelper user.nil? ? User.find(2) : user end + # 通过邮件查找用户,能查到返回用户,否则返回邮件地址 + def user_by_mail mail + user = User.find_by_mail(mail) + user.nil? ? mail : user.try(:show_name) + end + + def link_to_user_mail(mail, css_class) + user = User.find_by_mail(mail) + user = user.nil? ? mail : user + if user.is_a?(User) + name = user.show_name + link_to name, {:controller=> 'users', :action => 'show', id: user.id}, :class => css_class, :target => "_blank" + else + "#{h(user.to_s)}".html_safe + end + end + # 通过系统外部用户名查找用户,如果用户不存在则用邮箱替换 def get_user_by_login_and login user = User.find_by_login(login) (user.nil? || login == "root") ? User.find(2) : user end + # 登录名来自外部系统 + # 通过登录名查找用户,如果用户存在则显示用户姓名,否则显示登录名 + def get_user_by_login login + user = User.find_by_login(login) + user.nil? ? login : user.show_name + end + # 重置user_path,目的是将id转换成用户名 def user_path(resource, parameters = {}) if Fixnum === resource @@ -2786,6 +2820,37 @@ module ApplicationHelper end technical_title end + # 用户项目总数 + def user_project_count + @my_projects = @user.projects.select("projects.*,(SELECT MAX(updated_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS updatetime").order("updatetime DESC") + @my_project_total = @my_projects.count + end + + # 用户的课程总数 + def user_course_count + @my_course_count = @user.syllabuses.count + + sy_courses = @user.courses.visible.not_deleted + syllabus_ids = sy_courses.empty? ? '(-1)' : "(" + sy_courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")" + syllabus_members = SyllabusMember.where("user_id = #{@user.id}") + syllabus_member_ids = syllabus_members.empty? ? "(-1)" : "(" + syllabus_members.map{|syl_mem| syl_mem.syllabus_id}.join(',') + ")" + @join_syllabuses = Syllabus.where("(id in #{syllabus_ids} or id in #{syllabus_member_ids}) and user_id != #{@user.id}") + @my_joined_course_count = @join_syllabuses.count + + @user_course_total = @my_joined_course_count + @my_course_count + end + + # 用户发布的issue数 + def issues_author_is_self_count + @issues = Issue.where( :author_id => @user.id ) + @issues_author_is_self_count = @issues.count + end + + # 用户收到的issue数 + def issues_assigned_is_self_count + @issues = Issue.where( :assigned_to_id => @user.id ) + @issues_assigned_is_self_count = @issues.count + end def get_user_roll user technical_title = "" @@ -3705,7 +3770,9 @@ def get_hw_status homework_common end if Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") str += '作品提交中' - elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") + elsif Time.parse(homework_common.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && homework_common.anonymous_comment == 1 && User.current.allowed_to?(:as_teacher, homework_common.course) + str += '教师评阅中' + else str += '作品补交中' end elsif homework_common.homework_detail_manual.comment_status == 2 diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index e6603070d..e8cbcadf7 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -27,6 +27,21 @@ module RepositoriesHelper REPO_IP_ADDRESS = Setting.host_repository REPO_GITLAB_ADDRESS = "git.trustie.net" + # 获取某次提交的关联Issue + # REDO:一次关联查询 + # type为true则为详情页面,全部显示 + def get_commit_issues commit_id, project_id, type + commit_issues = CommitIssues.where(:commit_id => commit_id, :project_id => project_id) + unless commit_issues.blank? + if commit_issues.count > 2 && type != 1 + result = commit_issues.map{|commit_issue| commit_issue.issue_id}.first(2) << "more" + else + result = commit_issues.map{|commit_issue| commit_issue.issue_id} + end + end + return result unless result.blank? + end + # 因为gitlab的提交总数不是实时同步的,说以取总数用两种方法 def choise_commit_count git_count, pro_count git_count > pro_count ? git_count : pro_count diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 98024954d..879a7bb3c 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -94,13 +94,13 @@ module UsersHelper def pull_request_message_status ma case ma.status when 1 - "创建了PullRequest:" + "创建了PullRequest:" when 2 - "接受了PullRequest:" + "接受了PullRequest:" when 3 - "重新打开了PullRequest:" + "重新打开了PullRequest:" when 4 - "关闭了PullRequest:" + "关闭了PullRequest:" end end @@ -135,11 +135,11 @@ module UsersHelper def applied_project_tip applied_message case applied_message.status when 4 - "拒绝申请加入项目:" + "拒绝申请加入:" when 5,3,2,1,7 - "申请加入项目:" + "申请加入:" when 6 - "同意申请加入项目" + "同意申请加入:" end end @@ -159,6 +159,10 @@ module UsersHelper end end + def is_current_user + is_current_user = (User.current == @user) + end + def applied_project_tip_header applied_message case applied_message.status when 4 diff --git a/app/models/attachment.rb b/app/models/attachment.rb index c83a7bf2a..ff87f533c 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -397,7 +397,7 @@ class Attachment < ActiveRecord::Base end def course - container + Course === container ? container : nil end def visible?(user=User.current) diff --git a/app/models/commit_issues.rb b/app/models/commit_issues.rb new file mode 100644 index 000000000..fc56465f9 --- /dev/null +++ b/app/models/commit_issues.rb @@ -0,0 +1,5 @@ +class CommitIssues < ActiveRecord::Base + attr_accessible :commit_id, :issue_id, :project_id + # 之所以没建立关联表,主要是应为commit_id是直接通过api获取的,不存在trustie端 + has_many :issues +end diff --git a/app/models/issue.rb b/app/models/issue.rb index 46a42cb34..6fdd978f3 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -56,6 +56,8 @@ class Issue < ActiveRecord::Base has_one :praise_tread_cache, as: :object, dependent: :destroy # ForgeMessage虚拟关联(多态) has_many :forge_messages, :class_name => 'ForgeMessage',:as =>:forge_message ,:dependent => :destroy + # 该关联不能关联删除,因为commit记录没有存在Trustie数据库中 + has_many :commit_issueses has_many :at_messages, class_name: 'AtMessage', as: :at_message ,:dependent => :destroy @@ -133,6 +135,10 @@ class Issue < ActiveRecord::Base after_save :after_create_from_copy after_destroy :update_parent_attributes + def user + self.author + end + #动态的更新 def update_activity update_user_activity(self.class, self.id) diff --git a/app/models/message.rb b/app/models/message.rb index 1d76c8ef6..309291183 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -106,6 +106,10 @@ class Message < ActiveRecord::Base end } + def description + self.content + end + def topic? parent_id.nil? end diff --git a/app/models/user_wechat.rb b/app/models/user_wechat.rb index c63411ab3..71221a3d1 100644 --- a/app/models/user_wechat.rb +++ b/app/models/user_wechat.rb @@ -24,4 +24,9 @@ class UserWechat < ActiveRecord::Base BlogComment.where(author_id: old_user).update_all(author_id: u.id) UserActivity.where(user_id: old_user).update_all(user_id: u.id) end + + + def unsubscribe! + self.delete + end end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 43bdf9e09..c1c5f4f9f 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -584,6 +584,8 @@ class CoursesService @state = 2 elsif course[:is_delete] == 1 @state = 11 + elsif course[:invite_code_halt] == 1 + @state = 14 else if current_user.member_of_course?(course) #如果已经是成员 @state = 3 diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb index 0814b5f50..970fded22 100644 --- a/app/views/comments/create.js.erb +++ b/app/views/comments/create.js.erb @@ -1,8 +1,8 @@ <% if @course %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); + $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); <% elsif @project %> $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'projects/project_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); <% else %> - $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'organizations/org_subfield_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); + $("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'organizations/course_news_post_reply', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>"); <% end %> sd_create_editor_from_data('<%= @user_activity_id%>',"","100%", "UserActivity"); diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index a7f99f2b0..8ad3323f6 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -62,17 +62,17 @@ <% when 'HomeworkCommon' %> <%= render :partial => 'users/course_homework', :locals => {:activity => act, :user_activity_id => activity.id, :hw_status => 2} %> <% when 'News' %> - <%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_news', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %> <% when 'Message' %> <%= render :partial => 'users/course_message', :locals => {:activity => act, :user_activity_id => activity.id,:is_course=>1,:is_board=>0} %> <% when 'Poll' %> - <%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_poll', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %> <% when 'JournalsForMessage' %> - <%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %> <% when 'Attachment' %> <%= render :partial => 'users/course_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %> <% when 'Course' %> - <%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id} %> + <%= render :partial => 'users/course_create', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %> <% end %> <% end %> <% end %> diff --git a/app/views/courses/_course_activity_users.html.erb b/app/views/courses/_course_activity_users.html.erb index cffd383e6..692be98e9 100644 --- a/app/views/courses/_course_activity_users.html.erb +++ b/app/views/courses/_course_activity_users.html.erb @@ -4,9 +4,9 @@ <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_applide_action.html.erb b/app/views/users/_user_message_applide_action.html.erb index a8b5598fa..425c3f74d 100644 --- a/app/views/users/_user_message_applide_action.html.erb +++ b/app/views/users/_user_message_applide_action.html.erb @@ -1,13 +1,15 @@ <% ma = ma.nil? ? @applied_message : ma %> <% if allow_to_show(ma) %> - <%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :post, :class => "link-blue"%> | - <%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), :remote => true, :method => :get, :class => "link-blue" %> + <%= link_to "同意", allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), + :remote => true, :method => :post, :class => "link-blue", :style => "font-size: 14px;" %> | + <%= link_to "拒绝", refused_allow_to_join_project_project_memberships_path(:project_id => ma.project_id, :applied_message_id => ma.id), + :remote => true, :method => :get, :class => "link-blue",:style => "font-size: 14px;" %> <% elsif ma.status == 4 %> - 被拒绝 + 被拒绝 <% elsif ma.status == 5 %> - 您已拒绝 + 您已拒绝 <% elsif ma.status == 6 %> - 已通过 + 已通过 <% elsif ma.status == 7 %> - 您已同意 + 您已同意 <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_applide_users.html.erb b/app/views/users/_user_message_applide_users.html.erb index 18539c628..8e909aaa0 100644 --- a/app/views/users/_user_message_applide_users.html.erb +++ b/app/views/users/_user_message_applide_users.html.erb @@ -1,2 +1,4 @@ <%=link_to applied_project_users(ma), user_path(applied_project_users(ma)), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %> -<%= applied_project_tip(ma) %> \ No newline at end of file + + 申请以“<%= applied_project_message_type(ma.role) %>”身份加入: + \ No newline at end of file diff --git a/app/views/users/_user_message_applied.html.erb b/app/views/users/_user_message_applied.html.erb index 89084d30b..6c86b940c 100644 --- a/app/views/users/_user_message_applied.html.erb +++ b/app/views/users/_user_message_applied.html.erb @@ -2,25 +2,26 @@ <% if ma.applied_type == "ApplyAddSchools" %> - + <% elsif ma && ma.applied_type == "AppliedProject" %> <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 && ma.course_message %> <% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%> -

请您尽早完成匿评,如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。

-

例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分

+

请您尽早完成匿评,如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。

+

例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分

<% end%> -
  • <%= time_tag(ma.created_at).html_safe %>
  • +
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 && ma.course_message %> <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 4 && ma.course_message %> -
  • <%= time_tag(ma.created_at).html_safe %>
  • +
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> <% if ma.course_message_type == "HomeworkCommon" && ma.status == 5 %> - <% end %> <% if ma.course_message_type == "StudentWork" && ma.status == 1 && ma.course_message %> <% end %> <% if ma.course_message_type == "StudentWork" && ma.status == 2 && ma.course_message %> <% end %> <% if ma.course_message_type == "Course" && ma.course_message %> <% end %> @@ -624,23 +670,25 @@ <% end %> <% if ma.course_message_type == "CourseRequestDealResult" %> <% end %> <% if ma.course_message_type == "JoinCourse" and ma.status == 0 %> <% end %> <% if ma.course_message_type == "JoinCourse" and ma.status == 1 %> <% end %> - + <% if ma.course_message_type == "RemoveFromCourse" %> <% end %> <% if ma.course_message_type == "Exercise" && ma.status == 2 && ma.course_message %> -
  • <%= time_tag(ma.created_at).html_safe %>
  • +
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> <% if ma.course_message_type == "Exercise" && ma.status == 3 && ma.course_message %> -
  • 截止时间快到啦
  • -
  • <%= time_tag(ma.created_at).html_safe %>
  • +
  • 截止时间快到啦
  • +
  • <%= time_tag(ma.created_at).html_safe %>
  • <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_forge.html.erb b/app/views/users/_user_message_forge.html.erb index 10a14ffa9..937083b59 100644 --- a/app/views/users/_user_message_forge.html.erb +++ b/app/views/users/_user_message_forge.html.erb @@ -2,221 +2,239 @@ <% if ma.forge_message_type == "AppliedProject" %> <% end %> <% if ma.forge_message_type == "JoinProject" %> - <% unless ma.project.nil? %> - - <% end %> + <% unless ma.project.nil? %> + + <% end %> <% end %> <% if ma.forge_message_type == "RemoveFromProject" %> - <% unless ma.project.nil? %> - - <% end %> + <% unless ma.project.nil? %> + + <% end %> <% end %> <% if ma.forge_message_type == "ProjectInvite" %> <% inviter = User.find(ma.forge_message_id) %> <% end %> <% if ma.forge_message_type == "Issue" %> <% if ma.status == 1%> <% else %> <% end %> <% end %> <% if ma.forge_message_type == "Journal" && ma.forge_message %> <% end %> <% if ma.forge_message_type == "Message" %> <% end %> <% if ma.forge_message_type == "Comment" %> <% end %> <% if ma.forge_message_type == "PullRequest" %> <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_forum.html.erb b/app/views/users/_user_message_forum.html.erb index 37ad1a744..9bcfb1712 100644 --- a/app/views/users/_user_message_forum.html.erb +++ b/app/views/users/_user_message_forum.html.erb @@ -1,29 +1,29 @@ <% if ma.class == MemoMessage %> <% if ma.memo_type == "Memo" && !ma.memo.nil? && !ma.memo.author.nil? %> <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_org.html.erb b/app/views/users/_user_message_org.html.erb index 13c62318f..45ba65ec0 100644 --- a/app/views/users/_user_message_org.html.erb +++ b/app/views/users/_user_message_org.html.erb @@ -1,40 +1,44 @@ <% if ma.class == OrgMessage %> <% if ma.message_type == 'ApplySubdomain'%> <% end %> <% if ma.message_type == 'AgreeApplySubdomain'%> <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_system.html.erb b/app/views/users/_user_message_system.html.erb index 6bc8f28f3..3c0f72879 100644 --- a/app/views/users/_user_message_system.html.erb +++ b/app/views/users/_user_message_system.html.erb @@ -1,21 +1,22 @@ <% if ma.class == SystemMessage %> <%# @user_system_messages.each do |usm| %> - + <%# end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_user_message_userfeedaback.html.erb b/app/views/users/_user_message_userfeedaback.html.erb index 00fa78eeb..7b3251397 100644 --- a/app/views/users/_user_message_userfeedaback.html.erb +++ b/app/views/users/_user_message_userfeedaback.html.erb @@ -1,21 +1,25 @@ <% if ma.class == UserFeedbackMessage %> <% if ma.journals_for_message_type == "JournalsForMessage" %> <% end %> <% end %> \ No newline at end of file diff --git a/app/views/users/_user_programing_attr.html.erb b/app/views/users/_user_programing_attr.html.erb index d819ab59f..cc9ed5cdc 100644 --- a/app/views/users/_user_programing_attr.html.erb +++ b/app/views/users/_user_programing_attr.html.erb @@ -48,8 +48,8 @@ } if (inputs.length == outputs.length) { for (var i=0; i var text = document.getElementById("textarea_input_test"); var text2 = document.getElementById("textarea_output_test"); - autoTextarea2(text,text2); - autoTextarea2(text2,text); + autoTextarea2(text,text2, 0, 140); + autoTextarea2(text2,text, 0, 140); + <% else %> + var inputs = document.getElementsByName("program[input][]"); + var outputs = document.getElementsByName("program[output][]"); + if (inputs.length == outputs.length) { + for (var i=0; i \ No newline at end of file diff --git a/app/views/users/course_community.html.erb b/app/views/users/course_community.html.erb new file mode 100644 index 000000000..e31d6499f --- /dev/null +++ b/app/views/users/course_community.html.erb @@ -0,0 +1,39 @@ + + +
    +
    消息动态
    +
      +
    • +
        +
      • +
          + <% if hidden_unproject_infos %> +
        • <%= link_to "全部动态", {:controller => "users", :action => "course_community", :type => "all"}, :class => "homepagePostTypeAll postTypeGrey" %>
        • +
        • <%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "course_community", :type => "current_user"}, :class => "homepagePostTypeMine postTypeGrey" %>
        • +
        • <%= link_to "作业动态", {:controller => "users", :action => "course_community", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey" %>
        • +
        • <%= link_to "通知动态", {:controller => "users", :action => "course_community", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey" %>
        • +
        • <%= link_to "论坛动态", {:controller => "users", :action => "course_community", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey" %>
        • +
        • <%= link_to "问卷动态", {:controller => "users", :action => "course_community", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey" %>
        • +
        • <%= link_to "班级留言", {:controller => "users", :action => "course_community", :type => "course_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %>
        • +
        • <%= link_to "个人留言", {:controller => "users", :action => "course_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %>
        • + <% end %> +
        +
      • +
      +
    • +
    +
    + + +<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %> + <%# homepage = BlogComment.find(@user.blog.homepage_id) %> + <%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %> +<%# end %> + <% if @user_activities_count > 0 %> + <%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities, :page => 0, :type => @type, + :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => params[:action] } %> + <% else %> +
    + <%= render :partial => 'users/no_data' %> +
    + <% end %> diff --git a/app/views/users/course_community.js.erb b/app/views/users/course_community.js.erb new file mode 100644 index 000000000..ed8b26937 --- /dev/null +++ b/app/views/users/course_community.js.erb @@ -0,0 +1,6 @@ +$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities', + :locals => {:user_activities => @user_activities, + :page => @page, + :type => @type, + :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), + :action => "course_community"} )%>"); \ No newline at end of file diff --git a/app/views/users/project_community.html.erb b/app/views/users/project_community.html.erb new file mode 100644 index 000000000..1d5a49569 --- /dev/null +++ b/app/views/users/project_community.html.erb @@ -0,0 +1,37 @@ + + +
    +
    消息动态
    +
      +
    • +
        +
      • +
          + <% if hidden_unproject_infos %> +
        • <%= link_to "全部动态", {:controller => "users", :action => "project_community", :type => "all"}, :class => "homepagePostTypeAll postTypeGrey" %>
        • +
        • <%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "project_community", :type => "current_user"}, + :class => "homepagePostTypeMine postTypeGrey" %>
        • +
        • <%= link_to "问题动态", {:controller => "users", :action => "project_community", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%>
        • +
        • <%= link_to "论坛动态", {:controller => "users", :action => "project_community", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%>
        • +
        • <%= link_to "个人留言", {:controller => "users", :action => "project_community", :type => "user_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %>
        • + <% end %> +
        +
      • +
      +
    • +
    +
    + + +<%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %> +<%# homepage = BlogComment.find(@user.blog.homepage_id) %> +<%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %> +<%# end %> +<% if @user_activities_count > 0 %> + <%= render :partial => 'users/user_activities', :locals => { :user_activities => @user_activities, :page => 0, :type => @type, + :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), :action => params[:action] } %> +<% else %> +
    + <%= render :partial => 'users/no_data' %> +
    +<% end %> diff --git a/app/views/users/project_community.js.erb b/app/views/users/project_community.js.erb new file mode 100644 index 000000000..e3fda3f6e --- /dev/null +++ b/app/views/users/project_community.js.erb @@ -0,0 +1,6 @@ +$("#show_more_activities").replaceWith("<%= escape_javascript( render :partial => 'users/user_activities', + :locals => {:user_activities => @user_activities, + :page => @page, + :type => @type, + :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id), + :action => "project_community"} )%>"); \ No newline at end of file diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 66aafcf46..26ce0249c 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,51 +1,227 @@ - -
    -
    最新动态
    -
      -
    • -
        -
      • -
          - <% if hidden_unproject_infos %> -
        • 班级动态
        • -
        • <%= link_to "作业动态", {:controller => "users", :action => "show", :type => "course_homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%> -
        • -
        • <%= link_to "通知动态", {:controller => "users", :action => "show", :type => "course_news"}, :class => "homepagePostTypeNotice postTypeGrey"%> - -
        • <%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "course_message"}, :class => "homepagePostTypeForum postTypeGrey"%> -
        • <%= link_to "问卷动态", {:controller => "users", :action => "show", :type => "course_poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%> -
        • <%= link_to "班级留言", {:controller => "users", :action => "show", :type => "course_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%> - - - <% end %> -
        -
      • -
      • -
          -
        • 项目动态
        • -
        • <%= link_to "问题动态", {:controller => "users", :action => "show", :type => "project_issue"}, :class => "homepagePostTypeQuestion postTypeGrey"%> -
        • <%= link_to "论坛动态", {:controller => "users", :action => "show", :type => "project_message"}, :class => "homepagePostTypeForum postTypeGrey"%> - -
        -
      • -
      • -
          -
        • 更多
        • -
        • <%= link_to "个人留言", {:controller => "users", :action => "show", :type => "user_journals"}, :class =>"homepagePostTypeMessage postTypeGrey"%> -
        • <%= link_to @user == User.current ? "我的动态" : "他的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%> -
        • <%= link_to "全部动态", {:controller => "users", :action => "show", :type => "all"}, :class =>"homepagePostTypeAll postTypeGrey"%> -
        -
      • -
      -
    • -
    -
    + + +<% if is_current_user %> +
    +
    + <% if @unsolved_issues_count > 0 %> + + <% end %> + <% if @unfinished_homework_count > 0 %> + + <% end %> + <% if @unfinished_test_count > 0 %> + + <% end %> + <% if @unfinished_poll_count > 0 %> + + <% end %> + <% if @anonymous_evaluation_count > 0 %> + + <% end %> + + + + + + + + + + + <% if @unapproval_homework > 0 %> + + <% end %> +
    +
    +
    +
    +
    + 消息动态 +
    + + 共 <%= @message_count %> 个消息 + +
    +
    + <%= render :partial => 'users/new_user_message', :locals => { :message_alls => @message_alls } %> +
    +
    + + + - +<% else %> +
    +
    Ta的动态
    + +
    + + <%# if @user.blog.homepage_id and BlogComment.where("id=?", @user.blog.homepage_id).count > 0 %> <%# homepage = BlogComment.find(@user.blog.homepage_id) %> <%#= render :partial => 'blogs/homepage', :locals => {:activity => homepage, :user_activity_id => homepage.id} %> <%# end %> -<%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities,:page => 0,:type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %> + <% if @user_activities_count > 0 %> + <%= render :partial => 'users/user_activities', :locals => {:user_activities => @user_activities, :page => 0, :type => @type, :user_id => (@user.type == "AnonymousUser" ? User.current.id : @user.id)} %> + <% else %> +
    + <%= render :partial => 'users/no_data' %> +
    + <% end %> +<% end %> diff --git a/app/views/users/unsolved_issues_list.js.erb b/app/views/users/unsolved_issues_list.js.erb new file mode 100644 index 000000000..d36f7fa93 --- /dev/null +++ b/app/views/users/unsolved_issues_list.js.erb @@ -0,0 +1 @@ +$("#user_homepage_message_list").replaceWith("<%= escape_javascript( render :partial => 'users/unsolved_issues_list') %>"); \ No newline at end of file diff --git a/app/views/users/user_issues.html.erb b/app/views/users/user_issues.html.erb index 7284f3769..16c0714f8 100644 --- a/app/views/users/user_issues.html.erb +++ b/app/views/users/user_issues.html.erb @@ -4,7 +4,7 @@ - \ No newline at end of file diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html index 278b545a5..e5b61cc52 100644 --- a/public/assets/wechat/issue_detail.html +++ b/public/assets/wechat/issue_detail.html @@ -27,6 +27,18 @@
    {{issue.project_name}} - 项目问题{{issue.created_on}}
    + + + + +
    +
    + +
    +
    + 状   态:{{issue.issue_status}} 优先级:{{issue.issue_priority}}
    指派给:{{issue.issue_assigned_to}} @@ -114,7 +126,7 @@
    - +
    @@ -124,4 +136,15 @@
    - \ No newline at end of file + + + +
    +
    +
    + +
    +
      +
    • {{person.name}}

      ({{person.login}})

    • +
    +
    diff --git a/public/images/user/apply_tab.png b/public/images/user/apply_tab.png new file mode 100644 index 000000000..e5daa7e5f Binary files /dev/null and b/public/images/user/apply_tab.png differ diff --git a/public/images/user/female.jpg b/public/images/user/female.jpg index 219865572..499d2e5ac 100644 Binary files a/public/images/user/female.jpg and b/public/images/user/female.jpg differ diff --git a/public/images/user/home-user-left.png b/public/images/user/home-user-left.png new file mode 100644 index 000000000..f4968c0d7 Binary files /dev/null and b/public/images/user/home-user-left.png differ diff --git a/public/images/user/home-user-mes.png b/public/images/user/home-user-mes.png new file mode 100644 index 000000000..e52dd5b0a Binary files /dev/null and b/public/images/user/home-user-mes.png differ diff --git a/public/images/user/homepage_tab.png b/public/images/user/homepage_tab.png new file mode 100644 index 000000000..e3625d9aa Binary files /dev/null and b/public/images/user/homepage_tab.png differ diff --git a/public/images/user/male.jpg b/public/images/user/male.jpg index 46d58f26e..bd2597dd2 100644 Binary files a/public/images/user/male.jpg and b/public/images/user/male.jpg differ diff --git a/public/images/user/nonews.png b/public/images/user/nonews.png new file mode 100644 index 000000000..58abaed37 Binary files /dev/null and b/public/images/user/nonews.png differ diff --git a/public/images/user/user_navmore_icons.png b/public/images/user/user_navmore_icons.png index 6ecd00566..5dcd2608b 100644 Binary files a/public/images/user/user_navmore_icons.png and b/public/images/user/user_navmore_icons.png differ diff --git a/public/images/wechat/w-icons-file.png b/public/images/wechat/w-icons-file.png new file mode 100644 index 000000000..c5b8be58b Binary files /dev/null and b/public/images/wechat/w-icons-file.png differ diff --git a/public/javascripts/application.js b/public/javascripts/application.js index c3bd332a9..6e796a36d 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -1488,6 +1488,8 @@ function pop_up_box(value,tWidth,tTop,tLeft){ } // 公共弹框样式 +// 建议左右栏的:Width:460,Height:190 +// 建议宽屏对应值:Width:760,Height:500 function pop_box_new(value, Width, Height){ w = ($(window).width() - Width)/2; h = ($(window).height() - Height)/2; @@ -1715,7 +1717,7 @@ function expand_course_list(id, target, btnid, count) { //点击删除时的确认弹框 function delete_confirm_box(url, str){ var htmlvalue = '

    提示

    '+ - '

    ' + str + '

    确定'+ + '

    ' + str + '

    确定'+ '取消
    '; pop_box_new(htmlvalue, 300, 140); } diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 779b8805c..d9b1226c6 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -1446,7 +1446,7 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { } : function (name) { return getComputedStyle(elem, null)[name]; }, - minHeight = parseFloat(getFirstStyle('height')) + minHeight = parseFloat(getFirstStyle('height')); elem.style.resize = 'none'; elem2.style.resize = 'none'; @@ -1474,8 +1474,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; @@ -1491,8 +1489,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem2.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index b868b25d0..26d1e5bd8 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -477,7 +477,7 @@ $(function(){ //注意\n\ //1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ //2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ - //3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\ + //3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\ import java.io.*;\n\ import java.util.*;\n\ \n\ @@ -501,7 +501,7 @@ class Main\n\ //注意\n\ //1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ //2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ - //3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\ + //3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\ #include \n\ int main()\n\ {\n\ @@ -521,7 +521,7 @@ int main()\n\ //注意\n\ //1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ //2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ - //3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),每行末尾的所有空格用□表示\n\ + //3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\ #include \n\ using namespace std;\n\ \n\ @@ -543,7 +543,7 @@ int main()\n\ #注意\n\ #1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\ #2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\ - #3:该程序每次运行输出的结果最多显示100个字符(多余的不显示),空格用□表示\n\ + #3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),空格用□表示\n\ import sys \n\ \n\ #获取参数方式,使用raw_input\n\ diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index 916481818..600662ab1 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -632,7 +632,7 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { } : function (name) { return getComputedStyle(elem, null)[name]; }, - minHeight = parseFloat(getFirstStyle('height')) + minHeight = parseFloat(getFirstStyle('height')); elem.style.resize = 'none'; elem2.style.resize = 'none'; @@ -660,8 +660,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; @@ -677,8 +675,6 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { style2.overflowY = 'auto'; } else { height = elem2.scrollHeight - padding; - style.overflowY = 'hidden'; - style2.overflowY = 'hidden'; }; style.height = height + extra + 'px'; style2.height = height + extra + 'px'; diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 00d6bf3bc..385d0fd8f 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -10,6 +10,7 @@ app.constant('config', { app.run(['$rootScope', 'auth', '$location', '$routeParams', function($rootScope, auth, $location, $routeParams){ if(g_redirect_path && g_redirect_path.length>1){ + console.log(g_redirect_path); $location.path(g_redirect_path); g_redirect_path = null; } diff --git a/public/javascripts/wechat/controllers/issue.js b/public/javascripts/wechat/controllers/issue.js index b580da465..917de2990 100644 --- a/public/javascripts/wechat/controllers/issue.js +++ b/public/javascripts/wechat/controllers/issue.js @@ -1,4 +1,58 @@ -app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'common', function($scope, $http, $routeParams, auth, common){ +app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'common', + function($scope, $http, $routeParams, auth, common){ + + var vm = $scope; + vm.previewImgUrls = []; + vm.showAtDialog = false; + + var parseAtPersons = function (comment) { + var selectedPersons = []; + var ss = comment.match(/@(.+?)\s+/g); + + for(var i in ss){ + var personName = ss[i].substr(1, ss[i].length-2); + console.log(personName); + + for(var j in vm.at_persons){ + var person = vm.at_persons[j]; + if(person.name == personName){ + selectedPersons.push(person); + } + } + } + + for(var i in selectedPersons){ + var person = selectedPersons[i]; + comment = comment.replace('@'+person.name+' ', + '@'+person.name+'('+person.login+')'+' ' + ); + } + return comment; + }; + + vm.onPostChange = function (newValue, oldValue) { + if(newValue.length > oldValue.length && newValue.match(/@$/)=='@'){ + console.log('@ fire'); + vm.showAtDialog = true; + if(!vm.at_persons){ + $http.get('/at/'+$routeParams.id+'.json?type=Issue').then(function (response) { + vm.at_persons = response.data; + }); + } + } + console.log(vm.issue.comment); + }; + + vm.selectAtPerson = function (index) { + var person = vm.at_persons[index]; + vm.showAtDialog = false; + vm.issue.comment += person.name + ' '; + }; + + vm.cancelAt = function(){ + vm.showAtDialog = false; + } common.init({ id: $routeParams.id, @@ -18,11 +72,28 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c replytype = data.type; page = data.page; + + var parseImgAttachment = function(attachments){ + var urls = []; + if(!attachments){ + return urls; + } + + for(var i = attachments.length-1; i>=0; i--){ + if(attachments[i].filename.match('.jpg$')=='.jpg' || attachments[i].filename.match('.png$')=='.png'){ + urls.push(attachments[i].download_url); + attachments.splice(i, 1); + } + } + return urls; + }; + if (replytype == 0){ if (page == 0){ $scope.issue = data.data; $scope.page = 0; $scope.is_public = data.is_public; + $scope.previewImgUrls = parseImgAttachment($scope.issue.attachments); } else{ $scope.issue.all_children = $scope.issue.all_children.concat(data.data.all_children); @@ -42,6 +113,17 @@ app.controller('IssueController', ['$scope', '$http', '$routeParams', 'auth', 'c } }, replyCallback: function(){ + }, + beforeReplay: function(data){ + return parseAtPersons(data); } }); + + $scope.previewImg = function(index){ + console.log(index); + wx.previewImage({ + current: $scope.previewImgUrls[index], // 当前显示图片的http链接 + urls: $scope.previewImgUrls // 需要预览的图片http链接列表 + }); + } }]); \ No newline at end of file diff --git a/public/javascripts/wechat/others/factory.js b/public/javascripts/wechat/others/factory.js index 190dd36b4..daf8a45f8 100644 --- a/public/javascripts/wechat/others/factory.js +++ b/public/javascripts/wechat/others/factory.js @@ -94,24 +94,17 @@ app.factory('rms', function(){ }); app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$location', function($http, auth, $routeParams,rms,config,wx,$location){ - var addCommonReply = function(id, type, data,args,reply_type, cb){ - //先判断有没有绑定 -// $http.post( -// '/wechat/is_bind', -// {} ///不用传code了,都由服务器来处理 -// ).then(function(response){ -// console.log(response.data); -// if(response.data.status != 0){ -// $location.path("/login_tip"); -// } -// }); - + var addCommonReply = function(id, type, data,args,reply_type, beforeReply, cb){ if(!data.comment || data.comment.length<=0){ return; } var temp = data.comment.replace(/\n/g,'
    '); + if(typeof beforeReply==='function'){ + temp = beforeReply(temp); + } + var userInfo = { type: type, content: temp, @@ -121,6 +114,8 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc //回复按钮禁用 data.disabled = true; + console.log(userInfo); + $http({ method: 'POST', url: apiUrl+ "new_comment/"+id, @@ -308,7 +303,8 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config','wx','$loc loadData(args.id,0,0); args.scope.addReply = function(data,reply_type){ console.log(data.comment); - addCommonReply(data.act_id, args.replyType, data,args,reply_type, function(subscribe){ + + addCommonReply(data.act_id, args.replyType, data,args, reply_type, args.beforeReplay, function(subscribe){ // args.scope.formData = {comment: ''}; if(subscribe == 0){ $location.path("/login_tip"); diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 931aeb39e..9c44ea40d 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -142,6 +142,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .ml110{ margin-left:110px;} .ml125 { margin-left:125px;} .ml130 { margin-left:130px;} +.ml140 { margin-left:140px;} .ml150 { margin-left:150px;} .ml160 {margin-left:160px;} .ml250 {margin-left:250px;} @@ -174,6 +175,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .mr100 {margin-right:100px !important;} .mr118 {margin-right:118px !important;} .mr130 {margin-right:130px;} +.mr135 {margin-right:135px;} .mr150 {margin-right:150px;} .mw15{margin:0 15px;} .mr90 {margin-right:90px;} @@ -315,6 +317,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .H60 {height:60px !important;} .H150{ height:150px;} .p10 {padding-left:10px; padding-right:10px;} +.mw150 {max-width: 150px !important;} .mw220 {max-width: 220px !important;} .mw280 {max-width:280px !important;} .mw360 {max-width: 360px !important;} @@ -323,6 +326,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .mh18 {max-height: 18px;} .max_h54 {max-height:54px; } .maxHeight100 {max-height:100px; overflow-x:hidden; overflow-y:auto;} +.maxHeight200 {max-height:200px; overflow-x:hidden; overflow-y:auto;} .W50{ width:50px;} .W120{ width:110px;} @@ -673,6 +677,21 @@ a.sy_btn_grey_mini{ border-radius:3px; } a:hover.sy_btn_grey_mini{ background: #c3c3c3;} +a.btn_grey_mid{ + display:inline-block; + color: #565656; + background: #eaeaea; + text-align: center; + font-size: 12px; + padding:0 10px; + height: 26px; + line-height: 26px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + -o-border-radius:3px; + border-radius:3px; +} +a:hover.btn_grey_mid{ background: #c8c8c8;} a.sy_btn_green{ display:inline-block; color: #fff; @@ -805,22 +824,6 @@ a.sy_btn_pink{ } a:hover.sy_btn_pink{ background: #e64c4c;} -/* 我的缺陷列表*/ -.myissues_con{ width:968px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; margin: 0 auto; } -.myissues_head{ width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; } -.myissues_head h2{ font-size: 14px;} -select.issues_filter_active { font-weight: bold; color: #333;} -.issues_form_filter select.issues_filter_select_min02{width:60px; } -.issues_form_filter select.issues_filter_select_max{width:90px; } -.issues_list_txt li.issues_list_max{ width:90px } -.btn_newpro_grey{display: inline-block;color: #7b7b7b; border:1px solid #dbdbdb;background:#fff;text-align: center;font-size: 12px; padding:0 15px; height:24px; line-height: 24px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px;} -a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;} - -.my_issues_form_filter{ position: absolute; top:0; right: 0;} -.my_issues_form_filter select{ width:70px; height:30px; border:none; font-size:14px; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; text-align:center} -.my_issues_form_filter select.issues_filter_select_min{width:50px; } -.my_issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none;} - .ke-block pre{ font-size:9pt; font-family:Courier New,Arial; diff --git a/public/stylesheets/css/courses.css b/public/stylesheets/css/courses.css index 97ba3801f..8c0bbb8f4 100644 --- a/public/stylesheets/css/courses.css +++ b/public/stylesheets/css/courses.css @@ -604,3 +604,5 @@ a:hover.ex_icon_edit{ background:url(/images/course/icons.png) -21px -276px no- .archive_course_notice {width:220px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-265px; top:-15px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);} .archive_course_notice em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;} .archive_course_notice span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;} + +.teacher_member_img{width:50px; height:50px; border: 1px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;} \ No newline at end of file diff --git a/public/stylesheets/css/moduel.css b/public/stylesheets/css/moduel.css index 2161753b1..16a08deb3 100644 --- a/public/stylesheets/css/moduel.css +++ b/public/stylesheets/css/moduel.css @@ -20,6 +20,8 @@ input.radio-width90{ width: 90px; } .muban_icons_blue{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #3b94d6;border: 1px solid #3b94d6;} /*模板buttons 20161013byLB*/ .btn{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 30px;line-height: 30px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } +.btn-commit-issue{display: inline-block;border:none; padding:0 5px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 20px;line-height: 20px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; margin-top: 6px;} +.btn-commit{display: inline-block;border:none; padding:0 10px;color: #333;background: #e1e1e1; text-align:center;font-size: 12px; height: 20px;-webkit-border-radius: 3px;-moz-border-radius: 3px; -o-border-radius: 3px; border-radius: 3px; } .btn:hover{background: #c3c3c3; color: #333;} .btn-grey{background: #d9d9d9; color: #656565;} .btn-grey:hover{background: #717171; color: #fff;} diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index 79722a53c..54b34896c 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -788,6 +788,7 @@ a:hover.issues_list_title{color:#3b94d6;} .hw_search_box{ position:relative; } .hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;padding-right: 25px;} .hw_search_box a.hw_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;} +.hw_search_box input.hw_btn_search{display:block; width:20px; height:20px; background:url(/images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px; cursor:pointer;} .hw_search_box a:hover.hw_btn_search{background:url(/images/hw/icons_hw.png) -40px -57px no-repeat;} .hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;} /* 编辑删除 与课程相同 */ @@ -1001,8 +1002,8 @@ a.pullreques_reply_name{ font-weight: bold; color: #333;} .pullreques_reply_txt{ width: 900px;color: #666;} .pullreques_pull_top { width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; border-top:1px solid #e1e1e1;border-bottom:1px solid #e1e1e1;} a.pullreques_pull_name{display: block; margin-left: 5px;max-width:80px; color:#3b94d6 !important; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} -.pullreques_pull_list li{ height: 30px; line-height: 30px; } -.pullreques_pull_txt{display: block; margin-left: 10px;max-width:740px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} +.pullreques_pull_list li{ height: 35px; line-height: 35px; } +.pullreques_pull_txt{display: block; margin-left: 10px;max-width:640px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;} .pullreques_change_list li{height: 40px; line-height: 40px;border-bottom:1px solid #e1e1e1; } .pullreques_change_list li:last-child{ border-bottom: none;} .pullreques_icons_add{background: url(/images/new_project/icons_issue.png) 0 -374px no-repeat; display: inline-block; width: 19px; height: 16px;} @@ -1056,4 +1057,20 @@ table.text-file{} .old{ background:#ffecec; } .old:hover{ background:#fffaf1; } .new{ background: #eaffea;} -.new:hover{ background:#fffaf1; } \ No newline at end of file +.new:hover{ background:#fffaf1; } +.commit_id_value{color: white !important;} +/* 我的缺陷列表*/ +.myissues_con{ width:968px; padding:15px; border:1px solid #ddd; background-color:#fff; color:#444; margin: 0 auto; } +.myissues_head{ width: 100%; height: 40px; line-height: 40px; background: #f4f4f4; } +.myissues_head h2{ font-size: 14px;} +select.issues_filter_active { font-weight: bold; color: #333;} +.issues_form_filter select.issues_filter_select_min02{width:60px; } +.issues_form_filter select.issues_filter_select_max{width:90px; } +.issues_list_txt li.issues_list_max{ width:90px } +.btn_newpro_grey{display: inline-block;color: #7b7b7b; border:1px solid #dbdbdb;background:#fff;text-align: center;font-size: 12px; padding:0 15px; height:24px; line-height: 24px; -webkit-border-radius:3px; -moz-border-radius:3px; -o-border-radius:3px; border-radius:3px;} +a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;} + +.my_issues_form_filter{ position: absolute; top:0; right: 0;} +.my_issues_form_filter select{ width:70px; height:30px; border:none; font-size:14px; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; text-align:center} +.my_issues_form_filter select.issues_filter_select_min{width:50px; } +.my_issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none;} \ No newline at end of file diff --git a/public/stylesheets/css/public.css b/public/stylesheets/css/public.css index 7215604c2..8127753c5 100644 --- a/public/stylesheets/css/public.css +++ b/public/stylesheets/css/public.css @@ -738,6 +738,7 @@ a.xls{ margin-left:5px; color:#136b3b;} .st_box ul li{ float:left;} .st_box_top a{ font-weight:bold; color:#7a7a7a; float:left; margin-bottom:5px;} .st_box_top a:hover{ color:#1c9ec7;} +.teacher_st_boxlist{ border-bottom:1px dashed #CCC; height:60px; margin-bottom:10px; } .st_boxlist{ border-bottom:1px dashed #CCC; height:43px; margin-bottom:10px; } .st_boxlist a{ float:left;} .st_boxlist ul{ float:left; width:200px; margin-left:10px;} @@ -1401,7 +1402,7 @@ a:hover.comment_ding_link{ color:#269ac9;} .orig_textarea{width:90%; margin-bottom:10px;} .orig_sub{ float:right; background-color:#269ac9; color:#fff; height:25px; line-height:25px; text-align:center; width:80px; border:none;} .orig_sub:hover{ background:#297fb8;} -.orig_cont_hide{ text-align:center; width:632px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:5px 0;} +.orig_cont_hide{ text-align:center; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:5px 0;} .orig_cont_hide_issue{ text-align:center; width:882px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:5px 0;} .orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;} @@ -1548,3 +1549,5 @@ a.syllabusbox_a_blue{ .pages_new_404{ margin:160px 209px 0px 209px; height: 580px;} .pages_new_404_txt{ font-size: 16px; color: #888; text-align: center;} .feedbackText{box-shadow:none; width:550px; height:80px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;} + +._notice_box{border:solid 1px #f6d0b1; background:#fff9e9; padding:4px; color:#ee4a20;} \ No newline at end of file diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index b86068a33..878931598 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -94,20 +94,20 @@ div#menu ul ul ul li a{ width:185px; overflow:hidden; white-space: nowrap; text- .newsReadSetting {width:700px; background-color:#f6f6f6; border-bottom:1px solid #eeeeee; margin:10px auto; height:39px; line-height:39px; vertical-align:middle; font-size:14px; color:#7a7a7a; padding-left:10px;} .homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea;} .homepageNewsPortrait {width:40px; display:block; margin-top:7px;} -.homepageNewsPublisher { max-width:100px; font-size:12px; color:#269ac9; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; } +.homepageNewsPublisher { max-width:100px; font-size:12px; color:#269ac9; display:block; /*padding-left:5px;*/ overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; } .homepageNewsType {padding-left: 5px; font-size:12px; color:#888888; display:block;} .homepageNewsTypeHomework {width:160px; padding-left: 5px; font-size:12px; color:#888888; display:block; overflow:hidden; height:49px;word-break:break-all; word-wrap:break-word; text-overflow:ellipsis;} -.homepageNewsPubType {width:230px; font-size:12px; color:#888888; display: block;} +.homepageNewsPubType {auto-width:230px; font-size:12px; color:#888888; display: block;} .homepageNewsPubTypeHomework {width:270px; font-size:12px; color:#888888; display: block; white-space:nowrap;} -.homepageNewsContent {width:355px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } -.homepageSystenMessageContent {width:281px; max-width:291px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden;text-overflow:ellipsis;max-height: 49px; } +.homepageNewsContent {width:355px; max-width:365px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.homepageSystenMessageContent {width:500px; max-width:550px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden;text-overflow:ellipsis;max-height: 49px;white-space: nowrap; } +.homepageSystenMessageContent a:link{color:#1b1818;} +.homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:14px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.homepageHomeworkContent {width:235px; max-width:365px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.homepageHomeworkContentWarn2 {width:110px; max-width:365px; margin-right:10px; font-size:14px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.homepageHomeworkContent2 {width:285px; max-width:365px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } -.homepageHomeworkContentWarn {width:110px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } -.homepageHomeworkContent {width:235px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } -.homepageHomeworkContentWarn2 {width:60px; max-width:365px; margin-right:10px; font-size:12px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } -.homepageHomeworkContent2 {width:285px; max-width:365px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } - -.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} +.homepageNewsTime {width:70px; font-size:12px; color:#888888; display:block; text-align:right;} .loadMore {font-size:14px;width:748px; text-align:center; display:block; border:1px solid #dddddd; background-color:#ffffff; float:right;padding:5px 0; letter-spacing: 1px;} .homepageNewsTypeNotRead {padding-left: 5px; font-size:12px; color:#4b4b4b; font-weight:bold; display:block;} @@ -119,7 +119,7 @@ div#menu ul ul ul li a{ width:185px; overflow:hidden; white-space: nowrap; text- .ajax-waiting input.upload_filename {background:url(/images/hourglass.png) no-repeat 0px 50%;} .ajax-loading input.upload_filename {background:url(/images/loading.gif) no-repeat 0px 50%;} div.ui-progressbar { width: 100px; height:14px; margin: 2px 0 -5px 8px; display: inline-block; } -.upload_filename{ background: url(/images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 270px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} +.upload_filename{ background: url(/images/pic_file.png) 0 -22px no-repeat;color: #7f7f7f;width: 270px;border: none !important; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .message_title{border: 1px solid #9C9C9C;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff; max-width:400px;word-wrap:break-word; word-break:break-all;} .message_title_red{border: 1px solid #484848;padding: 0.6em;margin-left: 1.4em;margin-right: 0.4em;border-radius: 4px;font-family: "Microsoft YaHei";background-size: 100% 100%;margin-bottom: 5px;background-color: #fff;background-image: -moz-linear-gradient(top, #fff, #E0E0E0);} @@ -342,6 +342,7 @@ a.homepageMenuControl {float:left; width:180px;} .homepageLeftLabelContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top: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;} +.homepagetopBanner {width:750px; height: 100px; margin:0px auto; float:right; background-color: #90C5EC; border:1px solid #dddddd;} .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} @@ -355,7 +356,7 @@ a.replyGrey1 {color:#888888;} a.replyGrey1:hover {color:#4b4b4b;} a.newsBlue {color:#269ac9;} a.newsBlue:hover {color:#297fb8;} -a.newsBlack {color:#4b4b4b; font-size:13px; font-weight:bold} +a.newsBlack {color:#4b4b4b; font-size:14px; font-weight:bold} a.menuGrey {color:#808080;} a.menuGrey:hover {color:#fe7d68;} .navSearchTypeBox {width:368px; height:35px; position:absolute; border:1px solid #e1e1e1; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px;} @@ -498,6 +499,20 @@ a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;} .user_atten li a{ color:#333;} .user_atten li a:hover{ color:#3b94d6;} +.flex-container_homepage {display:flex;} +.homepage_tab_div{width:100%; border-right:1px solid #7CBBE5; text-align:center; font-size:14px; height: 70px; margin:15px 0px; color: #ffffff;} +/*.flex-container_homepage div{ width:68px; float:left; border-right:1px solid #62ACE2; text-align:center; font-size:14px; height: 70px; margin:10px 0px; color: #ffffff;}*/ +/*.flex-container_homepage div:last-child { border:none; }*/ +.flex-cell_homepage {flex:1; text-align: center} +.homepage_review_tab{ display:block; background:url(/images/user/homepage_tab.png) -15px -185px no-repeat; width:32px; height:32px; } +.homepage_issue_tab { display:block; background:url(/images/user/homepage_tab.png) -15px -12px no-repeat; width:32px; height:32px; } +.homepage_work_tab { display:block; background:url(/images/user/homepage_tab.png) -15px -56px no-repeat; width:32px; height:32px; } +.homepage_test_tab { display:block; background:url(/images/user/homepage_tab.png) -15px -99px no-repeat; width:32px; height:32px; } +.homepage_poll_tab { display:block; background:url(/images/user/homepage_tab.png) -15px -142px no-repeat; width:32px; height:32px; } +.homepage_anonymity_tab { display:block; background:url(/images/user/homepage_tab.png) -15px -228px no-repeat; width:32px; height:32px; } +.homepage_apply_tab { display:block; background:url(/images/user/apply_tab.png) -10px -12px no-repeat; width:32px; height:32px; } + + /* 个人主页左侧导航 */ .user_leftnav{ width:240px;} .users_accordion li > a { @@ -657,4 +672,16 @@ a.user_navmorebox .user_icons_closeclass{ .user_navmore_txt li a.user_navmore_li {font-size:12px;color:#888; display:block; width:75px;height:24px;line-height:24px; } .user_navmore_txt li a.user_navmore_add{ width:10px;color:#888; padding:0 5px; } .user_navmore_txt li:hover,.user_navmore_txt li a:hover{background-color:#f0f0f0;} -a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; text-align:center; color:#3b94d6; width:100%; display:inline-block;} \ No newline at end of file +a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; text-align:center; color:#3b94d6; width:100%; display:inline-block;} + +/*用户消息列表*/ +.messageWideContents{ width:455px; max-width:500px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.messageShortContents{ width:300px; max-width:350px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.messageMediumContents{ width:420px; max-width:450px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.messageOperateContents {width:100px; max-width:125px; margin-left:10px; font-size:14px; color:red; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.messageApplyContents{ width:200px; max-width:250px; margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height: 49px; } +.longMessageWidth { max-width: 610px; float:left; } +.shortMessageWidth { max-width: 540px; float:left; } +.messageInformationContents{ margin-right:10px; font-size:14px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;max-height:49px; float:left; } +.homepageBackground{ background-color:#90C5EC; flex:1; text-align: center } +.homepageClickBackground{ background-color:#3b94d6; flex:1; text-align: center } \ No newline at end of file diff --git a/public/stylesheets/css/user.css b/public/stylesheets/css/user.css new file mode 100644 index 000000000..cb47371e1 --- /dev/null +++ b/public/stylesheets/css/user.css @@ -0,0 +1,176 @@ +/*新版头部css byLB20161125*/ +.header-new{ height: 50px; width:100%; background:#3b94d6;} +.header-new-nav{ width: 1000px; margin:0 auto; height: 50px; line-height: 50px; background:#3b94d6;} +.header-new-nav-logo{ display: block; width: 51px; height: 45px; background:url(/images/nav_logo.png) 0 3px no-repeat;} +.header-new-nav-left li{ float: left; height: 50px; line-height: 50px;} +.header-new-nav-left li a{ display: block; padding:0 15px; color: #fff; font-size: 14px; font-weight: normal;} +.header-new-nav-left li a:hover{ background: #fff; color: #3b94d6;} +.header-new-nav-left li a.active{ background: #297ebd; color: #fff;} +.header-new-search{ margin-top: 10px; position: relative;} +.header-new-search-input{ width: 280px; height: 30px; background: #fff; padding:0 5px; border:none;} +.icons-header-search{display: block; width: 20px; height: 20px; background:url(/images/hw/icons_hw.png) 0 -56px no-repeat; position: absolute; right: 5px; top:4px;} +.header-new-nav-right li { float: left; padding:0 10px; } +.icons-header-news{ display: block; width: 20px; height: 20px;background:url(/images/icons-newhomepage.png) 0px 0px no-repeat; } +.icons-header-class{ display: block; width: 20px; height: 20px;background:url(/images/icons-newhomepage.png) 0px -37px no-repeat; } +.icons-header-project{ display: block; width: 20px; height: 20px;background:url(/images/icons-newhomepage.png) 0px -72px no-repeat; } +.header-users{width:40px; height:40px;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;} +.content-new {width:1000px; margin:0 auto; background-color:#eaebed;} +.home-user-left-box{width:240px;} +.home-user-right-box{width:750px;} +/*新版主页左侧css byLB20161125*/ +.home-user-leftnav{ background:#fff; width: 238px; border:1px solid #ddd; margin-bottom: 10px;} +.home-user-leftnav h3{ height: 40px; line-height: 40px; border-bottom:1px solid #ddd; color: #333; padding-left: 10px; font-weight: normal; } +.h3-more{ font-size: 12px; color: #888;} +.home-user-leftnav-li{ height: 45px; line-height: 40px; padding-left: 25px; color: #666;background:url(/images/user/home-user-left.png) 5px 5px no-repeat; font-size: 14px; position: relative; } +.home-user-leftnav-li:hover{ background:#f4f4f4 url(/images/user/home-user-left.png) 5px -35px no-repeat;} +.home-user-leftnav-li a:hover{color: #3b94d6;} +.icons-class{background:url(/images/user/home-user-left.png) 5px 5px no-repeat; } +.icons-class:hover{background:url(/images/user/home-user-left.png) 5px -35px no-repeat; } +.icons-project{background:url(/images/user/home-user-left.png) 5px -70px no-repeat; } +.icons-project:hover{background:url(/images/user/home-user-left.png) 5px -105px no-repeat; } +.icons-homework{background:url(/images/user/home-user-left.png) 5px -140px no-repeat; } +.icons-homework:hover{background:url(/images/user/home-user-left.png) 5px -177px no-repeat; } +.icons-doc{background:url(/images/user/home-user-left.png) 5px -215px no-repeat; } +.icons-doc:hover{background:url(/images/user/home-user-left.png) 5px -257px no-repeat; } +.icons-download{background:url(/images/user/home-user-left.png) 5px -292px no-repeat; } +.icons-download:hover{background:url(/images/user/home-user-left.png) 5px -326px no-repeat; } +.icons-issue{background:url(/images/user/home-user-left.png) 5px -360px no-repeat; } +.icons-issue:hover{background:url(/images/user/home-user-left.png) 5px -393px no-repeat; } +.home-user-grey-tag{ display: block; background-color: #eaeaea;padding: 0px 8px; height:20px; line-height:20px;-webkit-border-radius: 15px; -moz-border-radius: 15px; -o-border-radius: 15px; border-radius: 15px; font-size: 12px;} +.user_navmore_txt02 { display:inline-block; font-size:12px; color:#616060; background-color:#f8f8f8; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:17px; top:-3px; padding:5px 0px; display:none; box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5); z-index:1000; width:75px;} +.user_navmore_txt02 li a.user_navmore_li {font-size:12px;color:#888; display:block; width:50px;height:24px;line-height:24px; } +.user_navmore_txt02 li a{ display:inline-block; padding:0 10px; border:none; height:24px;line-height:24px;color:#888;width:50px; } +.user_navmore_txt02 li:hover,.user_navmore_txt02 li a:hover{background-color:#f0f0f0;} +/*新版主页个性签名css byLB20161125*/ +.home-user-intro{ width:728px; border:1px solid #ddd; padding:10px; background: #fff;} +.home-user-intro p{ color: #666; font-size: 14px;} +/*新版主页动态css byLB20161125*/ +.home-user-newsbox{width:748px; border:1px solid #ddd; background: #fff;} +.home-user-newsbox h3{ height: 40px; line-height: 40px; border-bottom:1px solid #ddd; color: #333; padding-left: 10px; font-weight: normal; } +a.btn-grey-small{padding: 0px 10px;font-size: 12px; line-height: 20px;background:#dedede; border-radius: 3px;color: #333;} +a.btn-blue-small{padding: 0px 10px;font-size: 12px; line-height: 20px;background:#3b94d6; border-radius: 3px;color: #fff;} +a:hover.btn-grey-small{background:#d0d0d0; } +a:hover.btn-blue-small{background:#297ebd;} +.home-user-news-list{ padding:10px 10px ;border-bottom:1px dashed #ddd;} +.home-user-news-img img{ width: 40px;height: 40px;margin: 5px 0; border-radius: 50px;} +a.home-user-news-name{ display: inline-block; max-width:200px;overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; color: #3b94d6;} +.home-user-news-grey{ color: #888;} +.home-user-news-list-inner{ width: 675px;} +.home-user-news-txt{max-width:600px;overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; } +.home-user-news-del{ height: 20px; display: inline-block; width: 20px; background:url(/images/user/home-user-left.png) 0px -514px no-repeat; } +.home-user-nonews{ width: 200px; margin:100px auto; text-align:center; color:#666; min-height: 350px; } +/*新版发现更多css byLB20161125*/ +.content-new-inner{ width: 998px;border:1px solid #ddd; background: #fff; position: relative;} +.content-new-inner h3{height: 40px; line-height: 40px; border-bottom:1px solid #ddd; color: #333; padding-left: 10px; font-weight: normal; font-size: 14px; background: #f6f6f6;} +.content-faxian-list{border-bottom:1px dashed #ddd; padding:10px 0px; width: 100%;} +a.faxian-list-title{ font-size: 14px; color:#333;max-width:720px;overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} +a:hover.faxian-list-title{ color: #3b94d6;} +.syllabus_class_private {color: #ff4a1b; border: 1px solid #ff4a1b;} +.syllabus_class_property {font-size: 12px; padding: 0 5px; border-radius: 3px;line-height: 14px;} +.syllabus_class_open {color: #7dd26c;border: 1px solid #7dd26c;} +a.pro_new_topbtn{ padding: 3px 7px; font-size: 12px; line-height: 20px; color: #333;vertical-align: middle;background-color: #fff; border: 1px solid #ddd; border-left: 0; border-top-right-radius: 3px; border-bottom-right-radius: 3px; color: #333;} +a.pro_new_topbtn_left { padding: 3px 10px; font-size: 12px;line-height: 20px; background-image: linear-gradient(#fcfcfc, #eee); border: 1px solid #d5d5d5;border-radius: 3px;border-top-right-radius: 0;border-bottom-right-radius: 0; color: #333; } +a:hover.pro_new_topbtn_left{background-image: linear-gradient(#ededed, #dddddd);} +.pro_new_topnav ul{border-bottom: 3px solid #fff; height: 30px; line-height: 30px;} +.pro_new_topnav ul li{ float: left; height: 30px; line-height: 30px;text-align: center; padding:0 15px; } +.pro_new_topnav_active{border-bottom: 3px solid #3b94d6; } +.hw_more_box {position:absolute; width:24px; height:15px; right:15px; top:15px;} +.hw_more_box ul li:hover ul {display:block; } +.hw_more_icons {background:url(/images/hw/icons_hw.png) 0px -30px no-repeat; width:24px; height:15px; } +.hw_more_icons:hover {background:url(/images/hw/icons_hw.png) -40px -30px no-repeat;} +.hw_more_txt {width:75px; font-size:12px; color:#616060; background-color:#fff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-40px; top:15px; padding:5px 0px; display:none; box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5); z-index:1000;} +.hw_more_txt li a.hw_more_li {font-size:12px;color:#888; display:block; width:75px;height:24px;line-height:24px;text-align:center; } +.hw_more_txt li a.hw_more_li:hover {background-color:#f0f0f0;} + + + + +/* 个人主页左侧信息 */ +.user_leftinfo{ width:238px;border:1px solid #e5e5e5; background:#fff url(/images/user/user_bg_info.jpg) 0 0 no-repeat; position:relative; } +a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;} +.user_leftinfo_img img{ width:74px; height:74px;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px; border:3px solid #dcdcdc; } +.user_leftinfo_female{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) 5px -378px no-repeat; position:absolute; top:80px; left:160px;} +.user_leftinfo_male{ display:block; width:20px; height:20px;background:url(/images/user/icons_user_leftnav.png) -25px -378px no-repeat; position:absolute; top:80px; left:160px;} +.user_leftinfo_namebox{ text-align:center; height:16px; line-height:16px; } +.user_leftinfo_name{ display: inline-block; max-width:160px; font-size:14px; font-weight:bold; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; } +.user_cirbtn_yellow{ color:#fff; background:#ffb400; padding:0 5px;-webkit-border-radius:10px;-moz-border-radius:10px;-o-border-radius:10px;border-radius:10px; line-height:16px; } +.user_info_inner{ width:210px; margin:0 15px 15px;} +.user_atten li{ width:68px; float:left; border-right:1px solid #e5e5e5; text-align:center; font-size:14px;} +.user_atten li a{ color:#333;} +.user_atten li a:hover{ color:#3b94d6;} +.user_atten li:last-child{ border:none;} +.user_info_intro{ margin:10px auto; width:210px; color:#888; text-align: center;} +a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; text-align:center; color:#3b94d6; width:100%; display:inline-block;} +/* 个人主页左侧导航 */ +.user_leftnav{ width:240px;} +.users_accordion li > a {display: block;padding: 0 10px 0 32px;height:49px;line-height:49px;color: #333;font-size:16px;background: #f8f8f8;border:1px solid #e5e5e5;border-bottom:none;} +.users_accordion > li:hover > a{color: #3b94d6;background: #fff;} +.users_accordion > li:target > a, +.users_accordion > li > a.active {color: #3b94d6;background: #fff;border:1px solid #e5e5e5;border-left:3px solid #3b94d6;border-bottom:none;} +.users_accordion li{ position:relative;} +.users_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;} +.users_accordion > li:hover > a span, +.users_accordion > li:target > a span, +.users_accordion > li > a.active span {margin-left:10px;color: #333;background: #dbdbdb;} +/* Images */ +.users_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/user/icons_user_leftnav.png);background-position: 5px 15px;} +.users_accordion li.user_icons_course > a:before { background-position: 5px 15px; } +.users_accordion li.user_icons_course:hover > a:before, +.users_accordion li.user_icons_course:target > a:before, +.users_accordion li.user_icons_course > a.active:before { background-position: -25px 15px; } +.users_accordion li.user_icons_new > a:before { background-position: 5px -48px; } +.users_accordion li.user_icons_new:hover > a:before, +.users_accordion li.user_icons_new:target > a:before, +.users_accordion li.user_icons_new > a.active:before { background-position: -25px -48px; } +.users_accordion li.user_icons_addclass > a:before { background-position: 5px -87px; } +.users_accordion li.user_icons_addclass:hover > a:before, +.users_accordion li.user_icons_addclass:target > a:before, +.users_accordion li.user_icons_addclass > a.active:before { background-position: -25px -87px; } +.users_accordion li.user_icons_myhw > a:before { background-position: 5px -124px; } +.users_accordion li.user_icons_myhw:hover > a:before, +.users_accordion li.user_icons_myhw:target > a:before, +.users_accordion li.user_icons_myhw > a.active:before { background-position: -25px -124px; } +.users_accordion li.user_icons_project > a:before { background-position: 5px -167px; } +.users_accordion li.user_icons_project:hover > a:before, +.users_accordion li.user_icons_project:target > a:before, +.users_accordion li.user_icons_project > a.active:before { background-position: -25px -167px; } +.users_accordion li.user_icons_addproject > a:before { background-position: 5px -205px; } +.users_accordion li.user_icons_addproject:hover > a:before, +.users_accordion li.user_icons_addproject:target > a:before, +.users_accordion li.user_icons_addproject > a.active:before { background-position: -25px -205px; } +.users_accordion li.user_icons_myissues > a:before { background-position: 5px -246px; } +.users_accordion li.user_icons_myissues:hover > a:before, +.users_accordion li.user_icons_myissues:target > a:before, +.users_accordion li.user_icons_myissues > a.active:before { background-position: -25px -246px; } +.users_accordion li.user_icons_mes > a:before { background-position: 5px -289px; } +.users_accordion li.user_icons_mes:hover > a:before, +.users_accordion li.user_icons_mes:target > a:before, +.users_accordion li.user_icons_mes > a.active:before { background-position: -25px -289px; } +/* Sub Menu */ +.user_sub_menu li a {color: #797979;background: #f8f8f8;height:39px;line-height:39px;font-size:14px;} +.user_sub_menu li a:hover,.user_sub_menu li a:target { color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;} +.user_sub_menu li a:hover,.user_sub_menu li a:target{} +.user_sub_menu li:last-child a { } +.users_accordion li > .user_sub_menu {display: none;} +.users_accordion li:target > .user_sub_menu {display: block;} +.user_sub_menu > li > span.user_icons_class {padding:0;border:none;display:block;position: absolute;top:18px;left:10px;width:20px;height:20px;background:url(/images/user/icons_user_leftnav.png) 0px -34px no-repeat;} +a.user_navmorebox{ display:block; width:238px; height:20px; position:relative; background:#f8f8f8;border:1px solid #e5e5e5; border-bottom:none;} +a:hover.user_navmorebox{ background:#fff;} +a.user_navmorebox .user_icons_moreclass{display:block;position: absolute;top:5px;left:100px;width:25px;height:10px;background:url(/images/user/icons_user_leftnav.png) 5px -347px no-repeat;} +a.user_navmorebox .user_icons_closeclass{display:block;position: absolute;top:5px;left:100px;width:25px;height:10px;background:url(/images/user/icons_user_leftnav.png) -25px -347px no-repeat;} +/* 个人主页左侧导航更多功能 */ +.user_navmore_box {position:absolute; width:15px; height:15px; right:13px; top:17px; cursor:pointer;} +.user_navmore_box ul li:hover ul {display:block; } +.user_navmore_icons {background:url(/images/user/icons_user_leftnav.png) -15px -34px no-repeat; width:19px; height:15px; } +.user_navmore_icons:hover {background:url(/images/user/icons_user_leftnav.png) -30px -34px no-repeat;} +.user_navmore_txt { display:inline-block; font-size:12px; color:#616060; background-color:#f8f8f8; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:17px; top:-3px; padding:5px 0px; display:none; box-shadow: 0px 0px 8px rgba(146, 153, 169, 0.5); z-index:1000; width:115px;} +.user_navmore_txt li a{ display:inline-block; padding:0 10px; border:none; height:24px;line-height:24px;color:#888;width:75px; } +.user_navmore_txt li a.user_navmore_li {font-size:12px;color:#888; display:block; width:75px;height:24px;line-height:24px; } +.user_navmore_txt li a.user_navmore_add{ width:10px;color:#888; padding:0 5px; } +.user_navmore_txt li:hover,.user_navmore_txt li a:hover{background-color:#f0f0f0;} + +/* 新版个人主页 */ +#messageTabList li { float:left; padding:10px 15px; text-align:center; } +.homepageTabTitle { max-width:330px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;} +.homepageTabProjectName{ max-width:160px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; } +.homepageTabAuthor { max-width:80px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis; } \ No newline at end of file diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index c38bd19b3..05ff9f396 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1895,6 +1895,5 @@ a.winbox_btn_close{ .winbox_p{ font-size: 14px; text-align: center; +} - -} \ No newline at end of file diff --git a/public/stylesheets/syllabus.css b/public/stylesheets/syllabus.css index 499e4a336..c38e1bd79 100644 --- a/public/stylesheets/syllabus.css +++ b/public/stylesheets/syllabus.css @@ -289,11 +289,10 @@ a.sy_class_option:hover { } .sy_class_id{ width:94px; - height:70px; + height:94px; border:1px solid #f1f1f1; background:#fff; text-align:center; - padding-top:24px; } .sy_class_id p{ font-size:16px; diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css index aa4cff972..d8c272b93 100644 --- a/public/stylesheets/weui/weixin.css +++ b/public/stylesheets/weui/weixin.css @@ -1,6 +1,8 @@ @charset "utf-8"; /* CSS Document */ +html, body{ margin:0; height:100%; } + /*基本样式*/ body,table,input,textarea,select,button { font-family: "微软雅黑","宋体","Helvetica Neue", Helvetica, Arial, sans-serif;} body, ul, h1,h2,h3,h4,h5,p,pre,input {padding:0px; margin:0px;} @@ -263,4 +265,25 @@ a.underline {text-decoration:underline;} /*资料修改*/ .blank-row {width:100%; height:38px; line-height:38px; vertical-align:middle;} .upload-input-container {width:30px; height:30px; border:1px solid #ddd; position:relative;} -.upload-input {width:30px; height:30px; position:absolute; z-index:1; opacity:0;} \ No newline at end of file +.upload-input {width:30px; height:30px; position:absolute; z-index:1; opacity:0;} +.select-container {position:relative; padding-left:62px;} +.select-text {position:absolute; left:15px;} +.select-model {width:100%; border:none; color:#999; margin-top:8px;} + + +/*附件显示 20161202byLB*/ +.clear:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden} +.clear{clear:both;zoom:1} +.weixin-files{ width:100%; word-break:break-all; word-wrap: break-word;} +.weixin-files ol{-webkit-padding-start: 0px;} +.weixin-files-img{ border:1px solid #eee; padding:2px; width:50px; margin-bottom:5px;} +/*所有人 20161202byLB*/ +.weixin-users-all{ width:100%; background:#fff;} +.weixin-users-all li{ height:40px; line-height:40px; font-size:14px; color:#888; padding:0 15px; border-bottom:1px solid #ccc;} +.weixin-users-all li:hover{ background:#f4f4f4;} + +/*弹出@选择对话框 guange*/ +.wechat-at {position: absolute; z-index: 999; top: 0; left:0; width: 100%; height: 100%; background-color: #ffffff;} + +/*@页面的取消按钮*/ +.cancel-btn-new {position: absolute; font-size: 13px; height: 24px; line-height: 24px; vertical-align: middle; padding: 0 7px; color: #888; background-color: #fff; outline: none; border: none; top: 11px; right: 10px;} diff --git a/spec/factories/commit_issues.rb b/spec/factories/commit_issues.rb new file mode 100644 index 000000000..e408d2b41 --- /dev/null +++ b/spec/factories/commit_issues.rb @@ -0,0 +1,8 @@ +FactoryGirl.define do + factory :commit_issue, :class => 'CommitIssues' do + commit_id "MyString" +issue_id 1 +project_id 1 + end + +end diff --git a/spec/models/commit_issues_spec.rb b/spec/models/commit_issues_spec.rb new file mode 100644 index 000000000..26b54b3b8 --- /dev/null +++ b/spec/models/commit_issues_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe CommitIssues, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end