|
@@ -7,6 +7,7 @@ import Tracks from require "models"
|
7
|
7
|
class extends lapis.Application
|
8
|
8
|
"/console": console.make!
|
9
|
9
|
|
|
10
|
+ -- TODO figure out why [%u] character class does not work
|
10
|
11
|
[tracks: "/tracks(/:order[%a])(/:asc_desc)(/:page[%d])"]: =>
|
11
|
12
|
@order = tostring(@params.order)\lower!
|
12
|
13
|
-- validate order field
|
|
@@ -19,8 +20,6 @@ class extends lapis.Application
|
19
|
20
|
tracks = Tracks\paginated "* ORDER BY #{@order} #{@asc_desc}", per_page: 32
|
20
|
21
|
-- @last_page = tracks\num_pages! -- TODO figure out why this errors
|
21
|
22
|
@last_page = 150
|
22
|
|
- -- if true
|
23
|
|
- -- return "success this far"
|
24
|
23
|
-- validate page
|
25
|
24
|
if @page < 1
|
26
|
25
|
return redirect_to: @url_for "tracks", order: @order, asc_desc: @asc_desc, page: 1
|