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