notes
This commit is contained in:
parent
99b81c6da1
commit
8af3343aa2
3
app.moon
3
app.moon
@ -7,6 +7,7 @@ import Tracks from require "models"
|
||||
class extends lapis.Application
|
||||
"/console": console.make!
|
||||
|
||||
-- TODO figure out why [%u] character class does not work
|
||||
[tracks: "/tracks(/:order[%a])(/:asc_desc)(/:page[%d])"]: =>
|
||||
@order = tostring(@params.order)\lower!
|
||||
-- validate order field
|
||||
@ -19,8 +20,6 @@ class extends lapis.Application
|
||||
tracks = Tracks\paginated "* ORDER BY #{@order} #{@asc_desc}", per_page: 32
|
||||
-- @last_page = tracks\num_pages! -- TODO figure out why this errors
|
||||
@last_page = 150
|
||||
-- if true
|
||||
-- return "success this far"
|
||||
-- validate page
|
||||
if @page < 1
|
||||
return redirect_to: @url_for "tracks", order: @order, asc_desc: @asc_desc, page: 1
|
||||
|
Reference in New Issue
Block a user