add pagination navigator
This commit is contained in:
parent
1dd6538ae7
commit
9df604a203
@ -58,9 +58,10 @@ local function Stationhandler(self)
|
||||
return { json = self.airtimes }
|
||||
end
|
||||
|
||||
-- for i, item in ipairs(self.airtimes) do
|
||||
-- print(to_json(item))
|
||||
-- end
|
||||
|
||||
self.station_id = station_id
|
||||
self.offset = tonumber(offset)
|
||||
self.limit = tonumber(limit)
|
||||
|
||||
return { render = "station" }
|
||||
|
||||
|
||||
@ -13,6 +13,12 @@
|
||||
margin: auto;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.scroll {
|
||||
font-size: 20px;
|
||||
margin: auto;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@ -1,5 +1,15 @@
|
||||
<% render("views.navigation") %>
|
||||
|
||||
<div class="scroll">
|
||||
<% if offset > 0 then %>
|
||||
<a href="<%= url_for("station", { station = station_id }, { offset = offset-1 }) %>"><span style="color:#ffffff !important;">previous</span></a>
|
||||
<% end %>
|
||||
-
|
||||
<% if table.getn(airtimes) >= limit then %>
|
||||
<a href="<%= url_for("station", { station = station_id }, { offset = offset+1 }) %>"><span style="color:#ffffff !important;">next</span></a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="airtimes" style="background-color: black; width: 900px; margin:0 auto;">
|
||||
<% for i, item in ipairs(airtimes) do %>
|
||||
<div style="clear:both;height:5px;"></div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user