This repository has been archived on 2024-09-20. You can view files and clone it, but cannot push or open issues or pull requests.
musicapp/views/tracks.moon

44 lines
1.2 KiB
Plaintext
Raw Normal View History

2019-04-18 05:08:09 +00:00
import Widget from require "lapis.html"
import Tracks from require "models"
class extends Widget
@menu: =>
div ->
if @page != 1
a href: @url_for("tracks", order: @order, asc_desc: @asc_desc, page: 1), "<<"
raw "&nbsp;"
a href: @url_for("tracks", order: @order, asc_desc: @asc_desc, page: @page - 1), "<"
raw "&nbsp;"
if @page != @last_page
a href: @url_for("tracks", order: @order, asc_desc: @asc_desc, page: @page + 1), ">"
raw "&nbsp;"
a href: @url_for("tracks", order: @order, asc_desc: @asc_desc, page: @last_page), ">>"
content: =>
@menu!
div ->
element "table", ->
tr ->
th "Title"
th "Artist"
th "Genre"
th "Mood"
th "Album"
th "Link"
th "Status"
th "Quality"
for track in *@tracks
tr ->
td track.title
td track.artist
td track.genre
td track.mood
td track.album
td ->
if track.link and #track.link > 0
a href: track.link, track.link
td Tracks.statuses[track.status]
td Tracks.qualities[track.quality]
@menu!