1、调整分页控件显示样式

2、修改课程动态分页算法
3、更新样式文件
This commit is contained in:
sw 2015-03-19 14:30:06 +08:00
parent b9ed34f86e
commit 258d9bf33a
4 changed files with 19 additions and 21 deletions

View File

@ -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

View File

@ -44,11 +44,7 @@
<div class="cl"></div>
</div><!--课程动态 end-->
<!--<ul class="wlist" >-->
<!--<li><a href="#">下一页</a></li>-->
<!--<li><a href="#">...</a></li>-->
<!--<li><a href="#">2</a></li>-->
<!--<li class="wlist_select" ><a href="#">1</a></li>-->
<!--<li><a href="#">上一页</a></li>-->
<!--</ul>-->
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<div class="cl"></div>

View File

@ -236,7 +236,7 @@ module Redmine
else
text = "\xc2\xab " + l(:label_previous)
end
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous', :remote => remote) << '</li>' + ' '
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous c_blue', :remote => remote) << '</li>' + ' '
end
unless paginator.previous_page
if paginator.next_page
@ -245,7 +245,7 @@ module Redmine
else
text = "\xc2\xab " + l(:label_previous)
end
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous', :remote => remote) << '</li>' + ' '
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous c_blue', :remote => remote) << '</li>' + ' '
end
end
@ -265,7 +265,7 @@ module Redmine
html << '<li>' << content_tag('span', page.to_s, :class => 'current-page') << '</li>'
end
else
html << '<li>' << yield(page.to_s, {page_param => page}, :class => 'page', :remote => remote) << '</li>'
html << '<li>' << yield(page.to_s, {page_param => page}, :class => 'page c_blue', :remote => remote) << '</li>'
end
html << ' '
previous = page
@ -277,7 +277,7 @@ module Redmine
else
text = l(:label_next) + " \xc2\xbb"
end
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'next', :remote => remote) << '</li>' + ' '
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'next c_blue', :remote => remote) << '</li>' + ' '
end
unless paginator.next_page
@ -287,7 +287,7 @@ module Redmine
else
text = l(:label_next) + " \xc2\xbb"
end
html << "<li>" << yield(text, {page_param => paginator.next_page}, :class => 'next', :remote => remote) << "</li>" + ' '
html << "<li>" << yield(text, {page_param => paginator.next_page}, :class => 'next c_blue', :remote => remote) << "</li>" + ' '
end
end

View File

@ -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;}