link to prev/next info page in bottom
This commit is contained in:
@@ -930,4 +930,35 @@ nav.pagination {
|
||||
font-size: 20px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.info-suggestions {
|
||||
border-top: 1px solid #fff;
|
||||
box-shadow: 0 -1px 0 0 #ddd;
|
||||
font-size: 0;
|
||||
margin-top: 50px;
|
||||
padding-top: 30px;
|
||||
|
||||
a {
|
||||
color: #444;
|
||||
display: inline-block;
|
||||
padding: 4px 1em;
|
||||
width: 50%;
|
||||
font-size: 18px;
|
||||
vertical-align: middle;
|
||||
|
||||
&:first-child {
|
||||
text-align: right;
|
||||
border-right: 1px solid black;
|
||||
}
|
||||
&:last-child {
|
||||
text-align: left; // just in case it's changed in a parent node
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ class InfoController < ApplicationController
|
||||
end
|
||||
|
||||
def show
|
||||
@prev = Info.where(["id < ?", @info.id]).last || Info.last
|
||||
@next = Info.where(["id > ?", @info.id]).first || Info.first
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
<% title @info.title %>
|
||||
|
||||
<%= link_to "Info", info_index_path %> → <%= @info.title %>
|
||||
<% if mod? %>
|
||||
<%= link_to "Edit Info", edit_info_path(@info), class: "btn blue right" %>
|
||||
<% end %>
|
||||
<div class="clear"></div>
|
||||
<h1 class="info-title"><%= @info.title %></h1>
|
||||
<div class="post"><%= render_trusted_md(@info.content).html_safe %></div>
|
||||
<h1 class="info-title"><%= title @info.title %></h1>
|
||||
|
||||
<div class="post">
|
||||
<%= render_trusted_md(@info.content).html_safe %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="info-suggestions center">
|
||||
<%= link_to "« #{@prev}", @prev %>
|
||||
<%= link_to "#{@next} »", @next %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user