修改国际化文件,zh-cn

  views:
    pagination:
      first: "首页"
      last: "尾页"
      previous: "上一页"
      next: "下一页"
      truncate: "…"
    helpers:
      page_entries_info:
        one_page:
          display_entries:
            zero: "没有任何 %{entry_name}"
            one: "显示 <b>1</b> 个 %{entry_name}"
            other: "显示 <b>全部 %{count}</b> 个 %{entry_name}"
        more_pages:
          display_entries: "显示 <b>%{total}</b> 个 %{entry_name} 中的第 <b>%{first}&nbsp;-&nbsp;%{last}</b> 个"

haml添加分页插件

.col-md-12.site-theme-paginate-wrapper
      = paginate @site_themes, window: 2, left: 1, right: 1 

生成的页码html

<div class="col-md-12 site-theme-paginate-wrapper">
            <nav class="pagination">
              <span class="first">
            <a href="/site_themes">首页</a>
          </span>

              <span class="prev">
            <a rel="prev" href="/site_themes?page=2">上一页</a>
          </span>

                  <span class="page">
            <a href="/site_themes">1</a>
          </span>

                  <span class="page">
            <a rel="prev" href="/site_themes?page=2">2</a>
          </span>

                  <span class="page current">  //当前页,里面没有a
            3
          </span>

                  <span class="page">
            <a rel="next" href="/site_themes?page=4">4</a>
          </span>

                  <span class="page">
            <a href="/site_themes?page=5">5</a>
          </span>

                  <span class="page gap">…</span>

                  <span class="page">
            <a href="/site_themes?page=18">18</a>
          </span>

              <span class="next">
            <a rel="next" href="/site_themes?page=4">下一页</a>
          </span>

              <span class="last">
            <a href="/site_themes?page=18">尾页</a>
          </span>

            </nav>
        </div>

设置分页样式

.site-theme-paginate-wrapper .pagination span a, .site-theme-paginate-wrapper .pagination span.current{
  height: 66px;
  line-height: 66px;
  padding: 0 26px;
  text-align: center;
  font-size: 18px;
  color: #414141;
  border: 1px solid #d9d9d9;
  display: inline-block;
  margin-right: 14px;
  background: #fff;
}
.site-theme-paginate-wrapper .pagination span a:hover, .site-theme-paginate-wrapper .pagination span.current {
  height: 68px;
  line-height: 68px;
  background: #dc0000;
  color: #fff;
}

kaminari分页插件样式的更多相关文章

  1. 高仿bootstrap样式的分页插件

    链接:https://pan.baidu.com/s/1jKgn2hK 密码:whwl 不知道是自己的第几个分页插件了,以前写一个丢一个,桌面,U盘,移动硬盘.想用的时候找不到,这次传网上来.大家帮忙 ...

  2. MVC如何使用开源分页插件shenniu.pager.js

    最近比较忙,前期忙公司手机端接口项目,各种开发+调试+发布现在几乎上线无问题了:虽然公司项目忙不过在期间抽空做了两件个人觉得有意义的事情,一者使用aspnetcore开发了个人线上项目(要说线上其实只 ...

  3. 分页插件--根据Bootstrap Paginator改写的js插件

    刚刚出来实习,之前实习的公司有一个分页插件,和后端的数据字典约定好了的,基本上是看不到内部是怎么实现的,新公司是做WPF的,好像对于ASP.NET的东西不多,导师扔了一个小系统给我和另一个同事,指了两 ...

  4. [原创]jquery+css3打造一款ajax分页插件

    最近公司的项目将好多分页改成了ajax的前台分页以前写的分页插件就不好用了,遂重写一个 支持IE6+,但没有动画效果如果没有硬需求,个人认为没必要多写js让动画在这些浏览器中实现css3的动画本来就是 ...

  5. bootstrap分页插件--Bootstrap Paginator的使用&AJAX版备份(可单独使用)

    html部分: <ul class="pagination"></ul> <!--bootstrap3版本用ul包裹--> <div cl ...

  6. Bootstrap Paginator 分页插件参数介绍及使用

    Bootstrap Paginator是一款基于Bootstrap的js分页插件,功能很丰富,个人觉得这款插件已经无可挑剔了.它提供了一系列的参数用来支持用户的定制,提供了公共的方法可随时获得插件状态 ...

  7. Bootstrap分页插件:bootstrap-paginator

    今天和大家分享一个Bootstrap的分页插件:bootstrap-paginator. 插件地址: https://github.com/lyonlai/bootstrap-paginator 先看 ...

  8. Jquery.Page.js 分页插件的使用

    1.简单直接贴代码 需要引用以下样式和脚本 <link href="~/Scripts/Page/pager.css" rel="stylesheet" ...

  9. [转] jQuery Infinite Ajax Scroll(ias) 分页插件介绍

    原文链接:http://justflyhigh.com/index.php/articlec/index/index.php?s=content&m=aticle&id=91 Infi ...

随机推荐

  1. [BZOJ1572] [Usaco2009 Open]工作安排Job(贪心 + 堆)

    传送门 把任务按照d排序 一次加入到堆中,如果当前放不进堆中,并且比堆中最小的大, 就从堆中弹出一个数,再把当前的数放进去 #include <queue> #include <cs ...

  2. JMS API学习总结(一)

    三.JMS API简析 顶级接口 P2P Pub/sub 备注 ConnectionFactory QueueConnectionFactory TopicConnectionFactory 基于工厂 ...

  3. VirtualBox 下主机与虚拟机以及虚拟机之间互通信配置

    引用链接:1)http://www.it165.net/os/html/201401/7063.html 2)http://www.cnblogs.com/sineatos/p/4489620.htm ...

  4. JQuery Mobile 的引用代码,以及在手机浏览器上字体太小的解决办法

    JQuery Mobile 的引用代码: <link rel="stylesheet" href="http://code.jquery.com/mobile/1. ...

  5. mongodb的安装及环境配置

    一 下载 官网:https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.6.3-signed.msi 官网可能打不开, ...

  6. 济南学习 Day 5 T3 am

    [题目描述] 众所不知,rly现在不会玩国际象棋.但是,作为一个OIer,rly当然做过八皇后问题.在这里再啰嗦几句,皇后可以攻击到同行同列同对角线,在 n*n的棋盘中,摆放n个皇后使它们互相不能攻击 ...

  7. CSS 选择器语法参考手册

    转自:http://www.w3school.com.cn/cssref/css_selectors.asp CSS3 选择器 在 CSS 中,选择器是一种模式,用于选择需要添加样式的元素. &quo ...

  8. PAT (Advanced Level) 1086. Tree Traversals Again (25)

    入栈顺序为先序遍历,出栈顺序为中序遍历. #include<cstdio> #include<cstring> #include<cmath> #include&l ...

  9. argument to nsmutablearray method addobject cannot be nil 警告

    You cannot add nil to an NSMutableArray, and you will raise an exception if you try to. There's NSNu ...

  10. 50 个 Bootstrap 插件

    Bootstrap是快速开发Web应用程序的前端工具包.它是一个CSS和HTML的集合,它使用了最新的浏览器技术,给你的Web开发提供了时尚的版式,表单,buttons,表格,网格系统等等. 本文向你 ...