Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

pagination finished but still need modify some css)

  • Loading branch information...
commit 30ac5f5ae8f95e03fb06d3d05b80b24c9b9d03d3 1 parent c5099f7
@liudangyi liudangyi authored
View
BIN  app/assets/images/fallback/big_default.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0  app/assets/images/fallback/thumb_default .jpg → app/assets/images/fallback/thumb_default.jpg
File renamed without changes
View
BIN  app/assets/images/icon/todo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
8 app/assets/stylesheets/application.css.less
@@ -199,4 +199,12 @@ i.img-todo {
height: 28px;
background-image: url(/assets/icon/todo.png);
background-repeat: no-repeat;
+}
+
+div.pagination {
+ margin: 0px 30px;
+ a {
+ line-height: 16px;
+ padding: 6px 10px;
+ }
}
View
2  app/views/events/index.html.slim
@@ -30,7 +30,7 @@ h1
= link_to '[编辑]', edit_event_path(event)
= link_to '[删除]', event, :confirm => '你确定要删除吗?', :method => :delete
.clearboth
- == 1 ? '<i class="img-finish"></i>' : '<i class="i.img-todo"></i>'
+ == false ? '<i class="img-finish"></i>' : '<i class="img-todo"></i>'
hr
= paginate @events
View
4 app/views/kaminari/_first_page.html.slim
@@ -5,6 +5,6 @@
total_pages : total number of pages
per_page : number of items to fetch per page
remote : data-remote
-span.first
- == link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
+li.first
+ == link_to_unless current_page.first?, '<<', url, :remote => remote
'
View
2  app/views/kaminari/_gap.html.slim
@@ -4,6 +4,6 @@
total_pages : total number of pages
per_page : number of items to fetch per page
remote : data-remote
-span.page.gap
+li.page.gap
== raw(t 'views.pagination.truncate')
'
View
4 app/views/kaminari/_last_page.html.slim
@@ -5,6 +5,6 @@
total_pages : total number of pages
per_page : number of items to fetch per page
remote : data-remote
-span.last
- == link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
+li.last
+ == link_to_unless current_page.last?, '>>', url, {:remote => remote}
'
View
4 app/views/kaminari/_next_page.html.slim
@@ -5,6 +5,6 @@
total_pages : total number of pages
per_page : number of items to fetch per page
remote : data-remote
-span.next
- == link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
+li.next
+ == link_to_unless current_page.last?, '>', url, :rel => 'next', :remote => remote
'
View
4 app/views/kaminari/_page.html.slim
@@ -6,6 +6,6 @@
total_pages : total number of pages
per_page : number of items to fetch per page
remote : data-remote
-span class="page#{' current' if page.current?}"
- == link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
+li class="page#{' active' if page.current?}"
+ == link_to page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
'
View
21 app/views/kaminari/_paginator.html.slim
@@ -7,13 +7,14 @@
paginator : the paginator that renders the pagination tags inside
== paginator.render do
- nav.pagination
- == first_page_tag unless current_page.first?
- == prev_page_tag unless current_page.first?
- - each_page do |page|
- - if page.left_outer? || page.right_outer? || page.inside_window?
- == page_tag page
- - elsif !page.was_truncated?
- == gap_tag
- == next_page_tag unless current_page.last?
- == last_page_tag unless current_page.last?
+ div.pagination.pagination-right
+ ul
+ == first_page_tag unless current_page.first?
+ == prev_page_tag unless current_page.first?
+ - each_page do |page|
+ - if page.left_outer? || page.right_outer? || page.inside_window?
+ == page_tag page
+ - elsif !page.was_truncated?
+ == gap_tag
+ == next_page_tag unless current_page.last?
+ == last_page_tag unless current_page.last?
View
4 app/views/kaminari/_prev_page.html.slim
@@ -5,6 +5,6 @@
total_pages : total number of pages
per_page : number of items to fetch per page
remote : data-remote
-span.prev
- == link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
+li.prev
+ == link_to_unless current_page.first?, '<', url, :rel => 'prev', :remote => remote
'
View
2  app/views/mates/index.html.slim
@@ -45,7 +45,7 @@ ul.thumbnails style="margin-left: px;"
- @mates.each_with_index do |mate, index|
li.span3
= link_to mate, class: 'thumbnail' do
- = image_tag(mate.photo.small, height: 180, width: 180)
+ = image_tag(mate.photo.small, width: 180)
.caption
h4 = mate.name
p = mate.tagline
View
4 app/views/mates/show.html.slim
@@ -9,7 +9,7 @@
.row
.span4
- = image_tag(@mate.photo.big, height: 400, width: 400)
+ = image_tag(@mate.photo.big, width: 400)
.span5
dl.dl-horizontal
@@ -21,7 +21,7 @@
dd: p = @mate.description
dt 联系方式:
dd: p = @mate.contact
- br
+ br.clearboth
dd
= link_to '[编辑]', edit_mate_path(@mate)
| &nbsp;|&nbsp;
View
3  app/views/posts/index.html.slim
@@ -63,7 +63,8 @@ table.table
td
= link_to post, :method => :delete, remote: true, class: "delete-alert" do
i.icon-remove
- = paginate @posts
+
+= paginate @posts
= content_for :script do
View
116 db/seeds.rb
@@ -48,4 +48,120 @@
post1 = Post.create(title: '这个项目简单吗?', content: '简单吗?不简单吗?不简单?简单?', author: user1.id)
post1.clone.save
post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
+post1.clone.save
post1.clone.save
Please sign in to comment.
Something went wrong with that request. Please try again.