mirror of
https://github.com/neocities/neocities.git
synced 2025-08-06 09:34:57 +02:00
Events pagination and fixes for browse pagination
This commit is contained in:
parent
be32867860
commit
17119d369c
4 changed files with 45 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
<script type="text/javascript">
|
||||
function getPage(currentPage) {
|
||||
document.location.href = '?current_page='+currentPage+'&activity=<%= Rack::Utils.escape(params[:activity]) %>'
|
||||
}
|
||||
</script>
|
||||
<script src="/assets/scripts/news/template.js"></script>
|
||||
<script src="/assets/scripts/news/like.js"></script>
|
||||
<script src="/assets/scripts/news/comment.js"></script>
|
||||
|
@ -92,4 +97,27 @@
|
|||
|
||||
<% end %>
|
||||
|
||||
<div class="content">
|
||||
<% if @page_count > 1 %>
|
||||
<div class="txt-Center content eps">
|
||||
<% if @current_page != 1 %>
|
||||
<a href="#" onclick="getPage(<%= @current_page - 1 %>); return false"><i class="icon-arrow-left" style="text-decoration: none"></i></a>
|
||||
<% end %>
|
||||
|
||||
<% 1.upto(@page_count) do |num| %>
|
||||
<% if num == @current_page %>
|
||||
<%= num %>
|
||||
<% else %>
|
||||
<a href="#" onclick="getPage(<%= num %>); return false"><%= num %></a>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% if @current_page != @page_count %>
|
||||
<a href="#" onclick="getPage(<%= @current_page + 1 %>); return false"><i class="icon-arrow-right" style="text-decoration: none"></i></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%== erb :'_news_templates', layout: false %>
|
||||
|
|
|
@ -95,7 +95,11 @@
|
|||
<% end %>
|
||||
|
||||
<% 1.upto(@page_count) do |num| %>
|
||||
<a href="#" onclick="getPage(<%= num %>); return false" style="<%= num == @current_page ? 'text-decoration: none' : '' %>"><%= num %></a>
|
||||
<% if num == @current_page %>
|
||||
<%= num %>
|
||||
<% else %>
|
||||
<a href="#" onclick="getPage(<%= num %>); return false"><%= num %></a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if @current_page != @page_count %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue