Skip to content

Commit

Permalink
lets try this
Browse files Browse the repository at this point in the history
  • Loading branch information
TangentFoxy committed Jan 10, 2018
1 parent f43b06f commit 2b40a0f
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions views/ksp/crafts_index.moon
Expand Up @@ -27,42 +27,42 @@ class KSPCraftsIndex extends Widget
input style: "width: 50%; border: none;", type: "text", id: "tag", placeholder: "list by tag"
input style: "border: none;", type: "submit", onclick: "location.href = '#{@url_for "ksp_crafts_index"}' + document.getElementById('tag').value;", value: ""

if #@crafts < 1
p "There are no crafts matching that criteria."
return
if #@crafts < 1
p "There are no crafts matching that criteria."

widget Pagination
else
widget Pagination

element "table", class: "table is-bordered is-striped is-narrow is-fullwidth", ->
thead ->
tr ->
th "Craft"
th "Creator"
th "Status"
th "Notes"
tfoot ->
tr ->
th "Craft"
th "Creator"
th "Status"
th "Notes"
tbody ->
the_date = os.date "*t", os.time!
for craft in *@crafts
element "table", class: "table is-bordered is-striped is-narrow is-fullwidth", ->
thead ->
tr ->
td -> a href: @url_for("ksp_crafts_view", id: craft.id), craft.name
name = craft.creator
if the_date.month == 4 and the_date.day == 1
name = "John"
elseif craft.user_id != 0
if user = Users\find id: craft.user_id
name = user.name
td name
status = Crafts.statuses\to_name craft.status
td class: status, status
if Crafts.statuses.reviewed == craft.status
td -> a href: "https://youtube.com/watch?v=#{craft.episode}", target: "_blank", "Watch on YouTube"
else
td craft.notes
th "Craft"
th "Creator"
th "Status"
th "Notes"
tfoot ->
tr ->
th "Craft"
th "Creator"
th "Status"
th "Notes"
tbody ->
the_date = os.date "*t", os.time!
for craft in *@crafts
tr ->
td -> a href: @url_for("ksp_crafts_view", id: craft.id), craft.name
name = craft.creator
if the_date.month == 4 and the_date.day == 1
name = "John"
elseif craft.user_id != 0
if user = Users\find id: craft.user_id
name = user.name
td name
status = Crafts.statuses\to_name craft.status
td class: status, status
if Crafts.statuses.reviewed == craft.status
td -> a href: "https://youtube.com/watch?v=#{craft.episode}", target: "_blank", "Watch on YouTube"
else
td craft.notes

widget Pagination
widget Pagination

0 comments on commit 2b40a0f

Please sign in to comment.