diff --git a/app/helpers/courses_helper.rb b/app/helpers/courses_helper.rb index 88b55b2b..80beea16 100644 --- a/app/helpers/courses_helper.rb +++ b/app/helpers/courses_helper.rb @@ -256,8 +256,8 @@ module CoursesHelper people end # 截至到2014-03-17 这个是最终的判断课程是否过期的方法 - def course_endTime_timeout? project - end_time_str = Course.find_by_extra(project.try(:extra)).try(:endup_time) + def course_endTime_timeout? course + end_time_str = course.try(:endup_time) begin cTime = Time.parse(end_time_str.to_s) rescue TypeError,ArgumentError diff --git a/app/models/journal.rb b/app/models/journal.rb index 8027f18a..2e9363dd 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -29,7 +29,7 @@ class Journal < ActiveRecord::Base # end attr_accessor :indice - acts_as_event :title =>Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.inProjectIndex}#{status}: #{o.issue.subject}" }, + acts_as_event :title =>Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.project_index}#{status}: #{o.issue.subject}" }, :description =>:notes, :author => :user, :group => :issue, diff --git a/app/views/layouts/_base_header.html.erb b/app/views/layouts/_base_header.html.erb index d340ea9e..983c83d2 100644 --- a/app/views/layouts/_base_header.html.erb +++ b/app/views/layouts/_base_header.html.erb @@ -41,10 +41,25 @@ <%=link_to_user(User.current)%>
  • @@ -77,11 +92,40 @@ }); } + function addProjectSlipMenu () { + var loggedas = $('#project_loggedas_li') + var project_sub_menu = $('.project_sub_menu') + var course_sub_menu = $('.course_sub_menu') + loggedas.mouseenter(function(event) { + course_sub_menu.hide(); + project_sub_menu.show(); + }); + project_sub_menu.mouseleave(function(event) { + project_sub_menu.hide(); + }); + } + function addCourseSlipMenu () { + var loggedas = $('#course_loggedas_li') + var project_sub_menu = $('.project_sub_menu') + var course_sub_menu = $('.course_sub_menu') + loggedas.mouseenter(function(event) { + project_sub_menu.hide(); + course_sub_menu.show(); + }); + course_sub_menu.mouseleave(function(event) { + course_sub_menu.hide(); + }); + } + $(document).ready(function () { addSlipMenu(); + addProjectSlipMenu (); + addCourseSlipMenu(); }); jQuery(document).ready(function($) { $('.sub_menu').find("a").attr('target', '_blank'); + $('.project_sub_menu').find("a").attr('target', '_blank'); + $('.course_sub_menu').find("a").attr('target', '_blank'); }); diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index fc0fc2ec..f1726426 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -2158,8 +2158,66 @@ ul.messages-for-user-reply li { #loggedas .sub_menu a{ margin: 0px; } + .sub_menu li{ - width: 90%; + width: 90%; +} + +#project_loggedas_li .project_sub_menu { + box-shadow: 2px 2px 6px #b0b0b0 ; + display: none; + background: #13AEBF 0 0 no-repeat; + left: 115px; + padding-bottom: 5px; + position: absolute; + top: 40px; + font-size: 1.1em; + margin: 0px auto; + padding: 0px 0px; + text-align: left; + z-index: 1; +} +#project_loggedas_li .project_sub_menu a{ + margin: 0px; +} + +#project_loggedas_li li { + border-bottom: 1px solid #129DAD; + color: white; + list-style: none ; + padding: 6px 0px; + margin-left: 5%; + font-size: 0.8em; + width: 90%; + line-height: 15px; +} +#course_loggedas_li .course_sub_menu { + box-shadow: 2px 2px 6px #b0b0b0 ; + display: none; + background: #13AEBF 0 0 no-repeat; + left: 115px; + padding-bottom: 5px; + position: absolute; + top: 0px; + font-size: 1.1em; + margin: 0px auto; + padding: 0px 0px; + text-align: left; + z-index: 1; +} +#course_loggedas_li .course_sub_menu a{ + margin: 0px; +} + +#course_loggedas_li li { + border-bottom: 1px solid #129DAD; + color: white; + list-style: none ; + padding: 6px 0px; + margin-left: 5%; + font-size: 0.8em; + width: 90%; + line-height: 15px; } /*gcm*/