From 258d9bf33ae9e352449e0a90564a51ae6dd58145 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 19 Mar 2015 14:30:06 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E8=B0=83=E6=95=B4=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F=202?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E7=AE=97=E6=B3=95=203=E3=80=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=A0=B7=E5=BC=8F=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 11 ++++++----- app/views/courses/show.html.erb | 10 +++------- lib/redmine/pagination.rb | 10 +++++----- public/stylesheets/courses.css | 9 +++++---- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 9b66c047f..809bf73ac 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -903,11 +903,12 @@ class CoursesController < ApplicationController end end - @offset, @limit = api_offset_and_limit({:limit => 10}) - @events_count = events.count - @events_pages = Paginator.new @events_count, @limit, params['page'] - @offset ||= @events_pages.offset - events = events.slice(@offset,@limit) + # @offset, @limit = api_offset_and_limit({:limit => 10}) + # @events_count = events.count + # @events_pages = Paginator.new @events_count, @limit, params['page'] + # @offset ||= @events_pages.offset + # events = events.slice(@offset,@limit) + events = paginateHelper events,10 @events_by_day = events.group_by {|event| User.current.time_to_date(event.event_datetime)} # documents diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 53754020f..57e4e06cc 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -44,11 +44,7 @@
- - - - - - - +
\ No newline at end of file diff --git a/lib/redmine/pagination.rb b/lib/redmine/pagination.rb index 189c15d36..3c891b520 100644 --- a/lib/redmine/pagination.rb +++ b/lib/redmine/pagination.rb @@ -236,7 +236,7 @@ module Redmine else text = "\xc2\xab " + l(:label_previous) end - html << '
  • ' << yield(text, {page_param => paginator.previous_page}, :class => 'previous', :remote => remote) << '
  • ' + ' ' + html << '
  • ' << yield(text, {page_param => paginator.previous_page}, :class => 'previous c_blue', :remote => remote) << '
  • ' + ' ' end unless paginator.previous_page if paginator.next_page @@ -245,7 +245,7 @@ module Redmine else text = "\xc2\xab " + l(:label_previous) end - html << '
  • ' << yield(text, {page_param => paginator.previous_page}, :class => 'previous', :remote => remote) << '
  • ' + ' ' + html << '
  • ' << yield(text, {page_param => paginator.previous_page}, :class => 'previous c_blue', :remote => remote) << '
  • ' + ' ' end end @@ -265,7 +265,7 @@ module Redmine html << '
  • ' << content_tag('span', page.to_s, :class => 'current-page') << '
  • ' end else - html << '
  • ' << yield(page.to_s, {page_param => page}, :class => 'page', :remote => remote) << '
  • ' + html << '
  • ' << yield(page.to_s, {page_param => page}, :class => 'page c_blue', :remote => remote) << '
  • ' end html << ' ' previous = page @@ -277,7 +277,7 @@ module Redmine else text = l(:label_next) + " \xc2\xbb" end - html << '
  • ' << yield(text, {page_param => paginator.next_page}, :class => 'next', :remote => remote) << '
  • ' + ' ' + html << '
  • ' << yield(text, {page_param => paginator.next_page}, :class => 'next c_blue', :remote => remote) << '
  • ' + ' ' end unless paginator.next_page @@ -287,7 +287,7 @@ module Redmine else text = l(:label_next) + " \xc2\xbb" end - html << "
  • " << yield(text, {page_param => paginator.next_page}, :class => 'next', :remote => remote) << "
  • " + ' ' + html << "
  • " << yield(text, {page_param => paginator.next_page}, :class => 'next c_blue', :remote => remote) << "
  • " + ' ' end end diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 80bd24e07..15172c6c2 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -62,10 +62,11 @@ a.problem_tit{ color:#0781b4; width:430px; display:block; overflow:hidden; white a:hover.problem_tit{ color:#09658c; } .problem_main{ border-bottom:1px dashed #d4d4d4; padding-bottom:10px; margin-bottom:10px;} /****翻页***/ -.wlist{} -.wlist a{ float:right; border:1px solid #64bdd9; padding:0 5px; margin-left:3px; color:#64bdd9;} -.wlist a:hover{border:1px solid #64bdd9; background-color:#64bdd9; color:#fff; text-decoration:none;} -.wlist_select a { background-color:#48aac9; color:#fff;} +ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; } +ul.wlist li{float: left;} +ul.wlist li a{ border:1px solid #15bccf; padding: 1px 4px 1px 4px; margin-left:3px;} +ul.wlist li a:hover{ background:#15bccf; color:#fff; text-decoration:none;} +.wlist_select { background-color:#64bdd9; color:#fff; padding: 1px 5px 0px 5px; margin-left:3px;margin-top: -2px; border:1px solid #64bdd9;} /****讨论区***/ .talk_top{ margin:10px 0; font-size:14px; color:#4c4c4c;} .talk_top span{ color:#ff7143;}