Changeset 1058

Show
Ignore:
Timestamp:
11/03/07 18:47:00 (6 years ago)
Author:
cho45
Message:

lang/ruby/ekfloras/template.html:

paging の UI をマシに

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/ruby/ekfloras/template.html

    r1057 r1058  
    191191                                <% if stash.page %> 
    192192                                <div class="paging"> 
     193                                        <% if stash.page != 1 %> 
     194                                        <a href="?page=1" title="first">&lt;&lt;</a> 
     195                                        <% end %> 
     196                                        <% if stash.page > 1 %> 
     197                                        <a href="?page=<%= stash.page - 1 %>" title="prev">&lt;</a> 
     198                                        <% end %> 
     199                                        .. 
    193200                                        <% stash.page_slices.each_with_index do |s,index| %> 
    194                                         <% if stash.page == index + 1 %> 
    195                                         <%= index+1 %> 
    196                                         <% else %> 
    197                                         <a href="?page=<%= index+1 %>"><%= index+1 %></a> 
    198                                         <% end %> 
     201                                                <% index += 1 %> 
     202                                                <% next unless stash.page - 3 <= index && index <= stash.page + 3 %> 
     203                                                <% if stash.page == index %> 
     204                                                        <%= index %> 
     205                                                <% else %> 
     206                                                        <a href="?page=<%= index %>"><%= index %></a> 
     207                                                <% end %> 
     208                                        <% end %> 
     209                                        .. 
     210                                        <% if stash.page < stash.page_slices.length %> 
     211                                        <a href="?page=<%= stash.page + 1 %>" title="next">&gt;</a> 
     212                                        <% end %> 
     213                                        <% if stash.page != stash.page_slices.length %> 
     214                                        <a href="?page=<%= stash.page_slices.length %>" title="last">&gt;&gt;</a> 
    199215                                        <% end %> 
    200216                                </div>