diff --git a/app/assets/javascripts/syllabuses.js.coffee b/app/assets/javascripts/syllabuses.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/syllabuses.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/syllabuses.css.scss b/app/assets/stylesheets/syllabuses.css.scss new file mode 100644 index 000000000..2576e25f0 --- /dev/null +++ b/app/assets/stylesheets/syllabuses.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the syllabuses controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index d3f681a06..4014a91bd 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -67,12 +67,15 @@ class AdminController < ApplicationController def excellent_all_courses name = params[:name] @order = "" - if params[:order] == 'asc' - courses = Course.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) asc, c.id desc") + @sort = "" + if params[:sort] && (params[:order] == 'act') + courses = Course.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) #{params[:sort]}, c.id desc") @order = params[:order] - elsif params[:order] == 'desc' - courses = Course.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) DESC, c.id desc") + @sort = params[:sort] + elsif params[:sort] && (params[:order] == 'time') + courses = Course.find_by_sql("SELECT * FROM courses WHERE name like '%#{name}%' ORDER BY time #{params[:sort]},id desc") @order = params[:order] + @sort = params[:sort] else courses = Course.like(name).order('created_at desc') end @@ -99,6 +102,22 @@ class AdminController < ApplicationController end end + #取消精品 + def cancel_excellent_course + @course = Course.find params[:id] + unless @course.nil? + if @course.is_excellent == 1 || @course.excellent_option == 1 + @course.update_column('is_excellent', 0) + @course.update_column('excellent_option', 0) + end + end + respond_to do |format| + format.html{ + redirect_to excellent_courses_url + } + end + end + #管理员界面课程资源列表 def course_resource_list diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index b1e5456c5..e4f637b6d 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -49,6 +49,11 @@ class ExerciseController < ApplicationController return end @exercise = Exercise.find params[:id] + @exercise.course_messages.each do |message| + if User.current.id == message.user_id && message.viewed == 0 + message.update_attributes(:viewed => true) if message.viewed == 0 + end + end @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? exercise_end = @exercise.end_time > Time.now if @exercise.time == -1 diff --git a/app/controllers/org_subfields_controller.rb b/app/controllers/org_subfields_controller.rb index 2b41983cc..3edda8285 100644 --- a/app/controllers/org_subfields_controller.rb +++ b/app/controllers/org_subfields_controller.rb @@ -14,10 +14,9 @@ class OrgSubfieldsController < ApplicationController SubfieldSubdomainDir.create(:org_subfield_id => @subfield.id, :name => params[:sub_dir].downcase) end end - #默认类型为帖子 - @subfield.update_attributes(:field_type => params[:field_type]||"Post") + @subfield.update_attributes(:field_type => params[:field_type]) # admin配置的类型 - update_status_by_type(@subfield, params[:field_type]||"Post") + update_status_by_type(@subfield, params[:field_type]) else @res = false end diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 10431f01a..d478b4d63 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1096,7 +1096,8 @@ class StudentWorkController < ApplicationController all_student_ids = "(" + pro.members.map{|member| member.user_id}.join(",") + ")" end all_students = User.where("id in #{all_student_ids}") - @commit_student_ids = @homework.student_work_projects.map{|student| student.user_id} + student_work_id = @homework.student_work_projects.where("user_id=?",User.current.id).empty? ? -1 : @homework.student_work_projects.where("user_id=?",User.current.id).first.student_work_id + @commit_student_ids = @homework.student_work_projects.where("student_work_id != #{student_work_id}").map{|student| student.user_id} @users = searchstudent_by_name all_students,name respond_to do |format| format.js @@ -1115,6 +1116,20 @@ class StudentWorkController < ApplicationController end end + def get_user_infor + req = Hash.new(false) + user = User.where("id = #{params[:user_id].to_i}").first + if user + req[:id] = user.id + req[:name] = user.show_name + req[:student_id] = user.user_extensions.student_id + req[:valid] = true + else + req[:valid] = false + end + render :json => req + end + private def searchstudent_by_name users, name mems = [] diff --git a/app/controllers/syllabuses_controller.rb b/app/controllers/syllabuses_controller.rb new file mode 100644 index 000000000..69982b99a --- /dev/null +++ b/app/controllers/syllabuses_controller.rb @@ -0,0 +1,23 @@ +class SyllabusesController < ApplicationController + + before_filter :is_logged, :only => [:index, :show] + before_filter :find_syllabus, :only => [:show] + def index + user = User.current + @syllabuses = user.syllabuses + end + + def show + @courses = @syllabus.courses + + end + + private + def find_syllabus + @syllabus = Syllabus.find params[:id] + end + + def is_logged + redirect_to signin_path unless User.current.logged? + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cad57b49f..ca63f496c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -130,8 +130,11 @@ class UsersController < ApplicationController onclick_time = User.current.onclick_time.onclick_time messages.each do |message_all| # 未读的消息存放在数组 - if (message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0) || (message_all.message_type == "SystemMessage"&& !message_all.message.nil? && message_all.message.created_at > onclick_time) - @message_alls << message_all.message + mess = message_all.message + if (message_all.message_type != "SystemMessage"&& !mess.nil? && (mess.viewed == 0 || !mess.viewed)) || (message_all.message_type == "SystemMessage"&& !mess.nil? && mess.created_at > onclick_time) + unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1) + @message_alls << mess + end break if @message_alls.length == 5 end end @@ -154,33 +157,41 @@ class UsersController < ApplicationController update_message_viewed(@user) end # @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count + courses = @user.courses.where("is_delete = 1") + course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")" case params[:type] when nil # 系统消息为管理员发送,我的消息中包含有系统消息 @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| - @message_alls << message_all.message + mess = message_all.message + unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1) + @message_alls << mess + end end when 'unviewed' @message_alls = [] - messages = MessageAll.where("user_id =?", @user.id).includes(:message).order("created_at desc") + messages = MessageAll.where("message_alls.user_id =?", @user.id).includes(:message).order("created_at desc") messages.each do |message_all| # 在点击或者刷新消息列表后未读的消息存放在数组 - if message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0 - @message_alls << message_all.message + mess = message_all.message + if message_all.message_type != "SystemMessage"&& !mess.nil? && (mess.viewed == 0 || !mess.viewed) + unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1) + @message_alls << mess + end end end #课程相关消息 when 'homework' - @message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork','Exercise') and user_id =?", @user.id).order("created_at desc") + @message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork','Exercise') and user_id =? and course_id NOT IN #{course_ids}", @user.id).order("created_at desc") when 'course_message' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user.id).order("created_at desc") + @message_alls = CourseMessage.where("course_message_type =? and user_id =? and course_id NOT IN #{course_ids}", "Message", @user.id).order("created_at desc") when 'course_news' # 课程通知包含发布的通知和回复的通知 - @message_alls = CourseMessage.where("course_message_type in ('News', 'Comment') and user_id =?", @user.id).order("created_at desc") + @message_alls = CourseMessage.where("course_message_type in ('News', 'Comment') and user_id =? and course_id NOT IN #{course_ids}", @user.id).order("created_at desc") when 'poll' - @message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user.id).order("created_at desc") + @message_alls = CourseMessage.where("course_message_type =? and user_id =? and course_id NOT IN #{course_ids}", "Poll", @user.id).order("created_at desc") #项目相关消息 when 'issue' @message_alls = ForgeMessage.where("forge_message_type in ('Issue', 'Journal') and user_id =?" , @user.id).order("created_at desc") diff --git a/app/helpers/syllabuses_helper.rb b/app/helpers/syllabuses_helper.rb new file mode 100644 index 000000000..dac84937b --- /dev/null +++ b/app/helpers/syllabuses_helper.rb @@ -0,0 +1,2 @@ +module SyllabusesHelper +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 44b919121..4a6dbc6b6 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -147,7 +147,9 @@ module UsersHelper # 统计未读消息数 def unviewed_message(user) - course_count = CourseMessage.where("user_id =? and viewed =?", user, 0).count + courses = user.courses.where("is_delete = 1") + course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")" + course_count = CourseMessage.where("user_id =? and viewed =? and course_id not in #{course_ids}", user, 0).count forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count org_count = OrgMessage.where("user_id =? and viewed =?", user, 0).count user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0).count diff --git a/app/models/course.rb b/app/models/course.rb index 69dbec5d0..e3a845b11 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -24,6 +24,7 @@ class Course < ActiveRecord::Base #belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher,该方法通过tea_id来调用User表 belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表 + belongs_to :syllabus # has_many :bid has_many :members, :include => [:principal, :roles], :conditions => "#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE}" has_many :memberships, :class_name => 'Member' diff --git a/app/models/syllabus.rb b/app/models/syllabus.rb new file mode 100644 index 000000000..7d6319955 --- /dev/null +++ b/app/models/syllabus.rb @@ -0,0 +1,5 @@ +class Syllabus < ActiveRecord::Base + belongs_to :user + has_many :courses + attr_accessible :description, :title +end diff --git a/app/models/user.rb b/app/models/user.rb index 44ef54c95..258fe2ea5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -90,6 +90,7 @@ class User < Principal has_many :homework_users has_many :homework_attaches, :through => :homework_users has_many :homework_evaluations + has_many :syllabuses, :dependent => :destroy #问卷相关关关系 has_many :poll_users, :dependent => :destroy has_many :poll_votes, :dependent => :destroy diff --git a/app/views/account/login.html.erb b/app/views/account/login.html.erb index f2b43c9a3..23acabd1f 100644 --- a/app/views/account/login.html.erb +++ b/app/views/account/login.html.erb @@ -2,32 +2,6 @@ <%= stylesheet_link_tag 'leftside'%> -
-
-
- -
  欢迎加入Trustie创新实践社区!在这里,您的创新意识和创新潜力将得到充分发挥!目前已有超过200所高校和科研机构在平台中开展在线协同开发、协同学习和协同研究。

  Trustie社区的理想是:让创新过程变的更美好!
+ + <% end %> \ No newline at end of file diff --git a/app/views/student_work/_no_teacher_score_notice.html.erb b/app/views/student_work/_no_teacher_score_notice.html.erb index 5a8c768cc..0926e3c74 100644 --- a/app/views/student_work/_no_teacher_score_notice.html.erb +++ b/app/views/student_work/_no_teacher_score_notice.html.erb @@ -1,7 +1,8 @@
+ \ No newline at end of file diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index eaf6b9304..cc078bf9c 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -4,14 +4,21 @@ (<%= @student_work_count%>人已交) - <% my_work = @homework.student_works.where("user_id = #{User.current.id}").first %> + <%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %> + <% my_work = cur_user_works_for_homework @homework %> <% if !@is_teacher && my_work.nil? && User.current.member_of_course?(@course) %> 您尚未提交作品 - <%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %> + <% unless @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %> + <%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %> + <% end %> <% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%> - 您已提交且不可再修改,因为截止日期已过 + 已提交且不可再修改,因为截止日期已过 <% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%> - 您已提交,您还可以修改 + <% if @homework.homework_type == 3 %> + 组长已提交,组长还可修改 + <% else %> + 您已提交,您还可以修改 + <% end %> <% end %> <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3 || @homework.is_open == 1%> diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 8e1a2a546..ed0b369e8 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -103,21 +103,11 @@ } function popupRegex(){ - if($("#group_member_ids").length > 0) { - if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) { - $('#ajax-modal').html("

作品信息完整性校验中,请稍等...

"); - showModal('ajax-modal', '500px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); - $('#ajax-modal').parent().addClass("anonymos"); - } - } else { - $('#ajax-modal').html("

作品信息完整性校验中,请稍等...

"); - showModal('ajax-modal', '500px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); - $('#ajax-modal').parent().addClass("anonymos"); - } + $('#ajax-modal').html("

作品信息完整性校验中,请稍等...

"); + showModal('ajax-modal', '500px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); + $('#ajax-modal').parent().addClass("anonymos"); } function nh_check_field(params){ @@ -140,6 +130,12 @@ params.contentmsg.html(''); } } + if(!result) { + return result; + } + } + if($("#group_member_ids").length > 0) { + result=regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html()))); } return result; } diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb index 453f717c9..dfddea306 100644 --- a/app/views/student_work/new.html.erb +++ b/app/views/student_work/new.html.erb @@ -62,21 +62,11 @@ } // 作品校验 function popupRegex(){ - if($("#group_member_ids").length > 0) { - if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) { - $('#ajax-modal').html("

作品信息完整性校验中,请稍等...

"); - showModal('ajax-modal', '500px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); - $('#ajax-modal').parent().addClass("anonymos"); - } - } else { - $('#ajax-modal').html("

作品信息完整性校验中,请稍等...

"); - showModal('ajax-modal', '500px'); - $('#ajax-modal').siblings().remove(); - $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); - $('#ajax-modal').parent().addClass("anonymos"); - } + $('#ajax-modal').html("

作品信息完整性校验中,请稍等...

"); + showModal('ajax-modal', '500px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9"); + $('#ajax-modal').parent().addClass("anonymos"); } function nh_check_field(params){ @@ -99,6 +89,12 @@ params.contentmsg.html(''); } } + if(!result) { + return result; + } + } + if($("#group_member_ids").length > 0) { + result=regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html()))); } return result; } diff --git a/app/views/student_work/retry_work.js.erb b/app/views/student_work/retry_work.js.erb index c6f354875..c15b81e09 100644 --- a/app/views/student_work/retry_work.js.erb +++ b/app/views/student_work/retry_work.js.erb @@ -1,2 +1,3 @@ hideModal('#popbox02'); -$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false,:has_group=>false})%>"); \ No newline at end of file +$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false,:has_group=>false})%>"); +$("#group_member_ids").val("<%=User.current.id %>"); \ No newline at end of file diff --git a/app/views/student_work/search_course_students.js.erb b/app/views/student_work/search_course_students.js.erb index c7aa982b9..2ac4eeaab 100644 --- a/app/views/student_work/search_course_students.js.erb +++ b/app/views/student_work/search_course_students.js.erb @@ -7,7 +7,8 @@ $("#all_students_list").empty(); link += ""; $("#all_students_list").append(link); - var str = ""; + var str = $("#group_member_ids").val(); + /*var str = ""; var lists = $("#choose_students_list li"); if(lists.length > 0) { for(var i=0; i if (str.indexOf(<%=user.id.to_s %>) < 0) { $("#student_<%=user.id %>").one("click",function choose_student() { diff --git a/app/views/users/_course_journalsformessage.html.erb b/app/views/users/_course_journalsformessage.html.erb index 658e14c53..9ed7e6e76 100644 --- a/app/views/users/_course_journalsformessage.html.erb +++ b/app/views/users/_course_journalsformessage.html.erb @@ -14,13 +14,23 @@ <% course=Course.find(activity.jour_id) %> <%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
-
- <% if activity.parent %> - <%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> - <% else %> - <%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> - <% end %> -
+ + <% if activity.parent %> + <% content = activity.parent.notes %> + <% else %> + <% content = activity.notes %> + <% end %> + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> +
+ + +
留言时间:<%= format_time(activity.created_on) %>
diff --git a/app/views/users/_user_at_message.html.erb b/app/views/users/_user_at_message.html.erb index 8f0c6acaf..81139ab8e 100644 --- a/app/views/users/_user_at_message.html.erb +++ b/app/views/users/_user_at_message.html.erb @@ -1,4 +1,4 @@ -<% if AtMessage === ma && ma.at_valid? %> +<% if ma.class == AtMessage && ma.at_valid? %>
  • <%=link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"),user_path(ma.author) %>
  • diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index 681f158e7..952a3396e 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -3,11 +3,14 @@
    每组最小人数: 人 +
    每组最大人数: 人 +
    +

    - <% if is_activity.to_i == 1 %> -
    - <% if activity.parent %> - <%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> - <% else %> - <%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> - <% end %> -
    - <% else %> + <%# if is_activity.to_i == 1 %> + + <%# else %> <% if activity.parent %> <% content = activity.parent.notes %> <% else %> <% content = activity.notes %> <% end %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> - <% end %> +
    + + +
    + <%# end %>
    留言时间:<%= format_time(activity.created_on) %>
    diff --git a/app/views/users/_user_jours_list.html.erb b/app/views/users/_user_jours_list.html.erb index afd498d06..6211aac7d 100644 --- a/app/views/users/_user_jours_list.html.erb +++ b/app/views/users/_user_jours_list.html.erb @@ -5,7 +5,7 @@ <%if jours %> <% jours.each do |jour|%> - <% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id)) %> + <% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id && !User.current.admin?)) %> diff --git a/app/views/users/user_messages.html.erb b/app/views/users/user_messages.html.erb index 391709b52..1ff8adc57 100644 --- a/app/views/users/user_messages.html.erb +++ b/app/views/users/user_messages.html.erb @@ -4,8 +4,9 @@ <% if (!@message_alls.nil? && @message_alls.count >0) %> <% if params[:type].nil? || params[:type] == "unviewed" %>
    - 有 <%= unviewed_message(@user) %> 条未读 - <% unless (unviewed_message(@user) == 0 || User.current != @user) %> + <% count = unviewed_message(@user) %> + 有 <%= count %> 条未读 + <% unless (count == 0 || User.current != @user) %> <%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %> <% end %>
    diff --git a/config/locales/account/zh.yml b/config/locales/account/zh.yml index c6a23b964..532806356 100644 --- a/config/locales/account/zh.yml +++ b/config/locales/account/zh.yml @@ -37,7 +37,7 @@ zh: label_password_lost: "忘记密码?" button_login: 登录 # account_controller中判断用户名或密码输入有误的提示信息 - notice_account_invalid_creditentials: "无效的用户名或密码,注意登录名区分大小写,谢谢!" + notice_account_invalid_creditentials: "无效的用户名或密码,注意登录名区分大小写。" # account_controller中判断未激活的提示信息 notice_account_invalid_creditentials_new: "您还未到邮箱激活。如果您丢失帐户,电子邮件验证帮助我们的支持团队验证帐户的所有权,并允许您接收所有您要求的通知。" diff --git a/config/routes.rb b/config/routes.rb index 10c3cb870..ec8fa2337 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -330,6 +330,7 @@ RedmineApp::Application.routes.draw do post 'last_codecomparetime' post 'set_score_rule' get 'work_canrepeat' + get 'get_user_infor' end end @@ -1020,6 +1021,7 @@ RedmineApp::Application.routes.draw do get 'admin/excellent_courses', as: :excellent_courses get 'admin/excellent_all_courses', as: :excellent_all_courses match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course' + match 'admin/cancel_excellent_course/:id', :to => 'admin#cancel_excellent_course' get 'admin/course_resource_list' get 'admin/project_resource_list' match 'admin/users', :via => :get diff --git a/db/migrate/20160613064914_create_syllabuses.rb b/db/migrate/20160613064914_create_syllabuses.rb new file mode 100644 index 000000000..a9a926d7e --- /dev/null +++ b/db/migrate/20160613064914_create_syllabuses.rb @@ -0,0 +1,12 @@ +class CreateSyllabuses < ActiveRecord::Migration + def change + create_table :syllabuses do |t| + t.string :title + t.text :description + t.references :user + + t.timestamps + end + add_index :syllabuses, :user_id + end +end diff --git a/db/migrate/20160613065840_add_syllabus_to_course.rb b/db/migrate/20160613065840_add_syllabus_to_course.rb new file mode 100644 index 000000000..b40d187d0 --- /dev/null +++ b/db/migrate/20160613065840_add_syllabus_to_course.rb @@ -0,0 +1,6 @@ +class AddSyllabusToCourse < ActiveRecord::Migration + def change + add_column :courses, :syllabus_id, :integer + add_index :courses, :syllabus_id + end +end diff --git a/public/images/login/bg_login.jpg b/public/images/login/bg_login.jpg new file mode 100644 index 000000000..274dcb6f6 Binary files /dev/null and b/public/images/login/bg_login.jpg differ diff --git a/public/images/login/bg_register.jpg b/public/images/login/bg_register.jpg new file mode 100644 index 000000000..c1a027a86 Binary files /dev/null and b/public/images/login/bg_register.jpg differ diff --git a/public/images/login/icons_login.png b/public/images/login/icons_login.png new file mode 100644 index 000000000..9d1ba136d Binary files /dev/null and b/public/images/login/icons_login.png differ diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 9f6b6aabd..6fbf9f8c4 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -550,7 +550,7 @@ function check_late_penalty(id) } else { - obj.val("0"); + obj.val(""); } } diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js index e9ef7ad6c..1578d72df 100644 --- a/public/javascripts/homework.js +++ b/public/javascripts/homework.js @@ -194,9 +194,11 @@ $(function(){ $("#GroupPopupBox").dialog("open"); $(".ui-dialog-titlebar").hide(); $("a.popClose").on('click', function(){ + reset_group_attr(); $("#GroupPopupBox" ).dialog("close"); }); $("#cancel_group").on('click', function(){ + reset_group_attr(); $("#GroupPopupBox" ).dialog("close"); }); $('#min_num').focus(); @@ -351,29 +353,67 @@ $(function(){ $("#GroupPopupBox").dialog("open"); $(".ui-dialog-titlebar").hide(); $("a.popClose").on('click', function () { + reset_group_attr(); $("#GroupPopupBox").dialog("close"); }); $("#cancel_group").on('click', function () { + reset_group_attr(); $("#GroupPopupBox").dialog("close"); }); $('#min_num').focus(); } }); + var reset_group_attr = function() { + $("#min_num_notice").hide(); + $("#min_max_num_notice").hide(); + $("#max_num_notice").hide(); + if($("input[name=min_num]").length > 0 && $("input[name=max_num]").length > 0) { + $("#min_num").val($("input[name=min_num]").val()); + $("#max_num").val($("input[name=max_num]").val()); + } else { + $("#min_num").val(2); + $("#max_num").val(10); + } + }; var saveGroupAttr = function() { var valid = true; var base_on_project = 0; var min = $.trim($("#min_num").val()); var max = $.trim($("#max_num").val()); - if(min.length <= 0) { + var regex = /^\d+$/; + if(!regex.test(min) || parseInt(min) <= 0) { + $("#min_num_notice").html("请输入正整数"); + $("#max_num_notice").html(""); + $("#min_max_num_notice").html(""); + $("#min_num_notice").show(); $("#min_num").focus(); - valid = false; return false; + } else { + $("#min_num_notice").html(""); + $("#min_num_notice").hide(); + } + if(!regex.test(max) || parseInt(max) <= 0) { + $("#max_num_notice").html("请输入正整数"); + $("#min_num_notice").html(""); + $("#min_max_num_notice").html(""); + $("#max_num_notice").show(); + $("#max_num").focus(); + return false; + } else { + $("#max_num_notice").html(""); + $("#max_num_notice").hide(); } - if(max.length <= 0) { + if(parseInt(min) > parseInt(max)) { + $("#min_max_num_notice").html("最小人数不得大于最大人数"); + $("#min_num_notice").html(""); + $("#max_num_notice").html(""); + $("#min_max_num_notice").show(); $("#max_num").focus(); - valid = false; return false; + } else { + $("#min_max_num_notice").html(""); + $("#min_max_num_notice").hide(); } if ($("#base_on_project").is(":checked")) { base_on_project = 1; diff --git a/public/javascripts/new_user.js b/public/javascripts/new_user.js index b6301afad..8db3fbc20 100644 --- a/public/javascripts/new_user.js +++ b/public/javascripts/new_user.js @@ -259,6 +259,24 @@ function regex_evaluation_end(){ } } +//处理迟交、缺评扣分 +function check_late_penalty(id) +{ + var obj = $("#" + id); + var regex = /^\d+$/; + if(regex.test(obj.val())) + { + if(obj.val() > 50) + { + obj.val("50"); + } + } + else + { + obj.val(""); + } +} + //验证匿评数量 function regex_evaluation_num(){ var evaluation_num = $.trim($("#evaluation_num").val()); @@ -627,4 +645,52 @@ var autoTextarea2 = function (elem,elem2, extra, maxHeight) { addEvent(elem2, 'input', change); addEvent(elem2, 'focus', change); change(); -}; \ No newline at end of file +}; + +function user_name_keypress(e){ + if (e.keyCode == '13') { + $('#main_login_form').submit(); + } +} + +function changeRegisterBtn(checkbox){ + if(checkbox.checked == true){ + $("#loginUpButton").removeClass('new_login_submit_disable'); + $("#loginUpButton").addClass('new_login_submit'); + }else{ + $("#loginUpButton").removeClass('new_login_submit') + $("#loginUpButton").addClass('new_login_submit_disable'); + } +} + +function clearInfo(id, content) { + var text = $('#' + id); + if (text.val() == content) { + $('#' + id).val(''); + } +} + +function showInfo(id, content) { + var text = $('#' + id); + if (text.val() == '') { + $('#' + id).val(content); + } +} + +function login(){ + $('#main_login_form').submit(); //表单提交没有任何反应的原因:js冲突 +} + +function register(){ + if($("#loginUpButton").hasClass('new_login_submit_disable')){ + return; + } + if($login_correct && $mail_correct && $passwd_correct && $passwd_comfirm_correct && $("#read_and_confirm").attr("checked") == 'checked'){ + $("#main_reg_form").submit(); + }else{ + $('#user_login').blur(); + $('#user_mail').blur(); + $('#user_password').blur(); + $('#user_password_confirmation').blur(); + } +} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 38d58a126..dcd275d92 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -747,8 +747,8 @@ a:hover .gz_btn{color:#ff5722;} .homepageCoursesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-65px; font-size:12px; color:#4b4b4b; line-height:2; z-index:9999; display:none;} /*注册登陆页面*/ -#loginInBox {display:block; margin-top:143px;} -#signUpBox {display:none; margin-top:79px;} +#loginInBox {display:block;} +#signUpBox {display:none;} #loginSignButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;} #loginInButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;} #loginSignButton:hover {background-color:#297fb8;} @@ -1628,7 +1628,170 @@ ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;} span.shadowbox_news_user{ color:#3b94d6;} a.shadowbox_news_all{ display:block; width:305px; height:40px; line-height:40px; color:#3b94d6; text-align:center;border-top:1px solid #eee;} -/*未登录回复提示*/ -.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;} +/* 新版登录注册 */ +.mr45{ margin-right:45px;} +.mt100{ margin-top:100px;} +.mt50{ margin-top:50px;} +.new_login{ + width:100%; + height:524px; + background-color:#3b94d6; +} +.new_login_con{ + width:1000px; + height:524px; + margin:0 auto; + background:url(../images/login/bg_login.jpg) 0 0 no-repeat; +} +.new_login_box{ + background:#FFF; + width:265px; + padding:20px 15px; + -webkit-border-radius:5px; + -moz-border-radius:5px; + -o-border-radius:5px; + border-radius:5px; + background-color: rgba(255,255,255,0.3); +} +.new_login_h2{ + font-size:18px; + color:#fff; + border-bottom:1px solid #fff; + font-weight:normal; + padding-bottom:5px; + margin-bottom:30px; +} +.new_login_h2 a{ + font-size:12px; + color:#fff; + background:url(../images/login/icons_login.png) 0 -69px no-repeat; + padding-left:10px; +} +input.new_register_input{ + -webkit-box-shadow: 0 0 0px 1000px white inset; + margin-left:5px; + width:250px; + height:45px; + border:none; + outline: none; +} +input.new_loggin_input{ + -webkit-box-shadow: 0 0 0px 1000px white inset; + outline: none; + width:205px; + height:45px; + border:none; + margin-left:50px; +} +.new_loggin_users{ + width:265px; + height:45px; + -webkit-border-radius:5px; + -moz-border-radius:5px; + -o-border-radius:5px; + border-radius:5px; + border:none; + background:#fff url(../images/login/icons_login.png) 8px 9px no-repeat; + +} +.new_login_lock{ + background:#fff url(../images/login/icons_login.png) 8px -28px no-repeat; + width:265px; + height:45px; + -webkit-border-radius:5px; + -moz-border-radius:5px; + -o-border-radius:5px; + border-radius:5px; + border:none; +} +.new_register_li{ + background:#fff; + width:265px; + height:45px; + -webkit-border-radius:5px; + -moz-border-radius:5px; + -o-border-radius:5px; + border-radius:5px; + border:none; +} +.new_login_form ul li{ + margin-bottom:20px; +} +.new_login_error{ + color:#c00202; +} +.new_login_submit_disable{ + width:265px; + height:40px; + line-height: 40px; + background:#ccc; + color:#fff; + font-size:14px; + -webkit-border-radius:5px; + -moz-border-radius:5px; + -o-border-radius:5px; + border-radius:5px; + border:none; + text-align:center; + cursor:pointer; + vertical-align: middle; +} +.new_login_submit{ + width:265px; + height:40px; + line-height: 40px; + background:#f27d0d; + color:#fff; + font-size:14px; + -webkit-border-radius:5px; + -moz-border-radius:5px; + -o-border-radius:5px; + border-radius:5px; + border:none; + text-align:center; + cursor:pointer; + vertical-align: middle; +} +.new_login_check{ + width:15px; + height:15px; + border:1px solid #fff; + border-style:none; + margin-right:5px; + vertical-align: -2px; +} +.new_login_form label{ color:#fff;} +.new_login_form a{ color:#fff; text-decoration:underline;} +.new_register{ + width:100%; + height:579px; + background-color:#3b94d6; +} +.new_register_con{ + width:1000px; + height:580px; + margin:0 auto; + background:url(../images/login/bg_register.jpg) 0 0 no-repeat; +} +.new_login_txt{ + width:282px; + height:140px; + padding:30px 12px 0; + color:#fff; + margin:235px 0 0 165px; +} +.new_login_txt h3{ + font-size:18px; + text-align:center; + margin-bottom:20px; +} +.new_login_txt p{ + line-height:2.0; +} +.new_register_left{ + margin-top:250px; +} +/*未登录回复提示*/ +.visitor-box {width:620px; height:33px; line-height:33px; text-align:center; vertical-align: middle; border:1px solid #ccc; background-color: #fff;} diff --git a/public/stylesheets/org2.css b/public/stylesheets/org2.css index 9e19fb5cb..23e53fd7b 100644 --- a/public/stylesheets/org2.css +++ b/public/stylesheets/org2.css @@ -197,7 +197,7 @@ a.sn-reply-username { color:#24366e; margin-right:15px; } .topnav_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 1px;} .topnav_login_list a{color:#269ac9;} .topnav_login_list li{ } -.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block; line-height:0;} +.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:50px; position:relative; display:inline-block; line-height:0;} .homepageLeft {width:240px; float:left; margin-right:10px; margin-bottom:10px;} .none {display: none;} .user-img,.user-img img{ margin-right:10px; -moz-border-radius: 50px; -webkit-border-radius: 50px;border-radius: 50px; display:block; width:40px; height:40px;} diff --git a/public/stylesheets/org_custom.css b/public/stylesheets/org_custom.css index 0bdc8a670..95df98738 100644 --- a/public/stylesheets/org_custom.css +++ b/public/stylesheets/org_custom.css @@ -1,64 +1,64 @@ /* 门户首页 */ #por_header{ width:100%; } -.por_header_top{ width:100%; height:70px; background:#3b94d6; } -.por_header_con{ width:1000px; margin:0 auto; height:70px; } -.por_logo{ margin-top:5px;} +.por_header_top{ width:100%; height:55px; background:#3b94d6; } +.por_header_con{ width:1000px; margin:0 auto; height:55px; } +.por_logo img{ margin-top:2px; height:51px;} .por_login li{ float:left;} -.por_login li a{ display:block; padding:0 15px; height:70px; line-height:70px;font-size:16px; color:#fff; } +.por_login li a{ display:block; padding:0 15px; height:55px; line-height:55px;font-size:16px; color:#fff; } .por_login li a:hover{ background-color:#1173bc;} -.por_search{ margin-top:15px; margin-right:20px;} +.por_search{ margin-top:10px; margin-right:20px;} .pro_input_search{ background-color:#daeefc; height:36px; width:355px; border:none; padding:0 5px; color:#3b94d6;} -a.por_search_btn{ display:block;background:#daeefc url(../images/org_custom/icons_por.png) 0 8px no-repeat; width:25px; height:36px;} -a:hover.por_search_btn{background:#daeefc url(../images/org_custom/icons_por.png) -35px 8px no-repeat; } -.por_nav{ width:1000px; height:70px; overflow:hidden; margin: 0 auto; position:relative; } -a.por_edit_index{ position:absolute; font-size:14px; right:5px; top:20px;} -.por_nav ul{ border-bottom:7px solid #ccc; height:63px;} +a.por_search_btn{ display:block;background:#daeefc url(../images/icons_por.png) 0 8px no-repeat; width:25px; height:36px;} +a:hover.por_search_btn{background:#daeefc url(../images/icons_por.png) -35px 8px no-repeat; } +.por_nav{ width:100%; height:50px; background-color:#eeefef; } +.por_nav ul{ width:1000px;height:50px; overflow:hidden; margin: 0 auto; position:relative;} +a.por_edit_index{ position:absolute; font-size:14px; right:5px; top:15px;} .por_nav ul li{ float:left; } -.por_nav ul li a{ display: block; height:63px; padding:0 20px; line-height:63px; font-size:18px; color:#333; } -.por_nav ul li a:hover{ border-bottom:7px solid #3b94d6; } -.por_index_act{border-bottom:7px solid #3b94d6; } +.por_nav ul li a{ display: block; height:63px; padding:0 20px; line-height:50px; font-size:16px; color:#333; } +.por_nav ul li a:hover{ color:#3b94d6; } +.por_nav ul li a.por_index_act{color:#3b94d6; } #por_container{ width:1000px; margin:10px auto;} .por_left{ width:685px; margin-right:15px; float:left; } .por_right{ width:300px; float:left;} .por_icons_hot{ background:url(../images/org_custom/icons_por.png) 0 -78px no-repeat; height:22px; width:55px; padding-left:3px; color:#fff; font-size:12px; line-height:22px; font-weight:normal;} -.por_h2_index{ font-size:20px; font-weight:normal; color:#3b94d6; width:100%; border-bottom:1px solid #e8e5e5; height:40px; line-height:40px;} +.por_h2_index{ font-size:18px; font-weight:normal; color:#3b94d6; width:100%; border-bottom:1px solid #e8e5e5; height:40px; line-height:40px;} a.por_more_index{ font-size:12px; color:#999; } .por_hotbar_left li{ width:365px; padding:12px 5px 12px 0; border-bottom:1px dashed #e8e5e5;} a.por_hot_title{ font-size:16px; display:block; font-weight:bold; width:365px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .por_hot_txt{ color:#666; line-height:20px;max-height:60px;overflow:hidden;text-overflow:ellipsis;} .por_time{ color:#999;} a.por_hot_name{color:#3b94d6;} -.por_hotbar_right{ border:1px solid #e8e5e5; padding:5px; margin-top:15px; width:300px;} +.por_hotbar_right{ padding:5px 0 5px 10px; margin-top:15px; width:300px; } .por_hotbar_right img{ width:300px; height:246px;} .por_hot_title_r{ font-size:16px; display:block; font-weight:bold; width:300px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .por_hot_txt_r{color:#666; line-height:20px;max-height:80px;overflow:hidden;text-overflow:ellipsis;} .por_course{ } -.por_course_bar{ width:328px; margin:0 7px; padding:20px 0; border-bottom:1px solid #e8e5e5;} +.por_course_bar{ width:328px; margin:0 7px; padding:20px 0 0px;} a.por_course_title{font-size:14px; margin-bottom:10px; display:block; font-weight:bold; width:328px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .por_course_bar img{ width:140px; height:100px; } .por_course_txt { width:180px; margin-left:5px;color:#666; line-height:20px;max-height:80px;overflow:hidden;text-overflow:ellipsis;} .por_course_time{color:#3b94d6; margin-left:5px;} -.por_post{ border-bottom:1px solid #e8e5e5; padding-bottom:5px;} +.por_post{ padding-bottom:5px;} .por_post_left{ width:394px; margin-top:15px;} .por_post_leftbar img{ width:377px; height:163px;} .por_post_leftbar { border-bottom:1px dashed #e8e5e5; padding-bottom:5px; margin-bottom:10px;} a.por_post_title{font-size:18px; display:block; width:377px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .por_post_txt{color:#666; line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; } -.post_icons_grey{ width:5px; height:5px; margin:10px 5px 0 0; background-color:#b3b3b3; display:block; line-height:20px;} -.por_post_list li{ height:20px; height:30px;} +.post_icons_grey{ width:4px; height:4px; margin:10px 5px 0 0; background-color:#b3b3b3; display:block; line-height:20px;} +.por_post_list li{ height:35px;} .por_post_list li a{ font-size:14px; } a.por_hidden_w390{ display:block; width:390px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} a.por_hidden_w270{ display:block; width:280px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .por_post_right{ width:280px; border-left:1px solid #e8e5e5; margin-top:15px; padding-left:10px;} .por_news_list li{ padding:15px 0; border-bottom:1px dashed #e8e5e5;} -.por_users_img{ width:40px; height:40px; border:1px solid #e8e5e5;} +.por_users_img{ width:40px; height:40px; -webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;} .por_news_txt{ width:245px; margin-left:10px;} .por_news_p{ line-height:20px;max-height:40px;min-width:240px;overflow:hidden;text-overflow:ellipsis; } a.por_zan{ background:url(../images/org_custom/icons_por.png) 0 -41px no-repeat; height:15px; width:20px; display:block; padding-left:15px; line-height:20px; color:#999;} a.por_zan:hover{background:url(../images/org_custom/icons_por.png) -34px -42px no-repeat; color:#3b94d6; } .por_hidden_w205{ font-size:14px; display:block; width:205px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} -.por_projects{border-bottom:1px solid #e8e5e5; padding-bottom:10px; margin-top:10px;} +.por_projects{ padding-bottom:10px; margin-top:10px;} .por_projects ul li{ padding:5px 0;} .por_projects ul{ margin-top:5px;} .por_project_p{ line-height:20px;max-height:40px;overflow:hidden;text-overflow:ellipsis; margin-top:5px; margin-left:10px; color:#666; } @@ -67,8 +67,8 @@ a.por_zan:hover{background:url(../images/org_custom/icons_por.png) -34px -42px n .por_teachers{ margin-top:20px; } #por_teachers_nav {border-bottom:1px solid #d0d0d0; height:31px;} #por_teachers_nav li {float:left; padding:0px 5px; text-align:center; } -#por_teachers_nav li a{font-size:20px;} -.por_teachers_hover {border:1px solid #d0d0d0; border-bottom:1px solid #fff; } +#por_teachers_nav li a{font-size:18px;} +.por_teachers_hover { } .por_teachers_hover a{color:#3b94d6;} .por_teachers_nomal {border-bottom:none; } .por_teachers_nomal a{color:#999;} @@ -76,7 +76,7 @@ a.por_zan:hover{background:url(../images/org_custom/icons_por.png) -34px -42px n .dis {display:block;} a.por_more_teacher{ font-size:12px; } .por_teachers_li{ margin-top:10px;} -.por_teachers_li li{ padding:10px 0;border-bottom:1px solid #e8e5e5;} +.por_teachers_li li{ padding:10px 0;} .por_teachers_img{ width:60px; height:60px; -webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;} a.por_teachers_name{ display:block; width:75px; font-size:18px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .por_teachers_p{ font-size:14px; color:#999; width:150px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} @@ -88,22 +88,4 @@ a.por_teachers_name{ display:block; width:75px; font-size:18px;overflow:hidden; .por_footer_con ul li{ float:left; text-align:center;} .por_footer_con ul li a{ font-size:14px;} .por_footer_con ul li a span{ color:#999; margin:0 15px ;} -.por_footer_con p{ text-align:center; margin-top:20px; color:#777;} - - - - - - - - - - - - - - - - - - +.por_footer_con p{ text-align:center; margin-top:20px; color:#777;} \ No newline at end of file diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 333c410ca..ff71bf5c4 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -533,7 +533,7 @@ a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no- .homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} .newsActive {width:16px; height:16px; border-radius:50%; background-color:#ff0000; position:absolute; left:17px; top:5px; text-align:center;font-size:12px; color:#ffffff !important;padding-bottom: 3px;padding-left: 2px;padding-right: 1px;font-weight: bold;} .navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} -.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block;} +.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:50px; position:relative; display:inline-block;} .homepageProfileMenuIcon:hover {background:url(../images/nav_icon.png) 30px -122px no-repeat;} .navHomepageProfile ul li ul {display:none;} .navHomepageProfile ul li:hover ul {display:block;} diff --git a/spec/controllers/syllabuses_controller_spec.rb b/spec/controllers/syllabuses_controller_spec.rb new file mode 100644 index 000000000..72c43dff1 --- /dev/null +++ b/spec/controllers/syllabuses_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe SyllabusesController, :type => :controller do + +end diff --git a/spec/factories/syllabuses.rb b/spec/factories/syllabuses.rb new file mode 100644 index 000000000..436972e39 --- /dev/null +++ b/spec/factories/syllabuses.rb @@ -0,0 +1,9 @@ +# Read about factories at https://github.com/thoughtbot/factory_girl + +FactoryGirl.define do + factory :syllabus do + title "MyString" + description "MyText" + user nil + end +end diff --git a/spec/models/syllabus_spec.rb b/spec/models/syllabus_spec.rb new file mode 100644 index 000000000..6072c09ce --- /dev/null +++ b/spec/models/syllabus_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe Syllabus, :type => :model do + pending "add some examples to (or delete) #{__FILE__}" +end