Skip to content

Commit

Permalink
navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
TangentFoxy committed Feb 14, 2017
1 parent fd67954 commit 0801de0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions keys.moon
Expand Up @@ -15,7 +15,6 @@ class extends lapis.Application
return redirect_to: @url_for "user_login"

@html ->
a href: @url_for("gamekeys_list"), "list keys"
form {
class: "pure-form"
action: @url_for "gamekeys_add"
Expand All @@ -31,6 +30,10 @@ class extends lapis.Application
else
option value: Keys.types[t], t
input type: "submit", value: "Submit", class: "pure-button"
br!
a href: @url_for("gamekeys_list"), class: "pure-button", "key list"
if @session.id and (Users\find id: @session.id).admin
a href: @url_for("gamekeys_list_edit"), class: "pure-button", "edit keys"

POST: =>
unless @session.id
Expand All @@ -46,6 +49,7 @@ class extends lapis.Application
}

if key
@session.info = "Key added!"
return redirect_to: @url_for "gamekeys_list"
else
@session.info = "Key submission failed: #{errMsg}"
Expand All @@ -55,7 +59,6 @@ class extends lapis.Application
[list: "/list"]: =>
keys = Keys\select "* WHERE NOT status = #{Keys.statuses.claimed} ORDER BY game ASC"
@html ->
a href: @url_for("gamekeys_add"), "add a key"
element "table", class: "pure-table pure-table-striped", ->
tr ->
th "Game"
Expand All @@ -64,6 +67,10 @@ class extends lapis.Application
tr ->
td key.game
td Keys.types[key.type]
br!
a href: @url_for("gamekeys_add"), class: "pure-button", "add key"
if @session.id and (Users\find id: @session.id).admin
a href: @url_for("gamekeys_list_edit"), class: "pure-button", "edit keys"

[list_edit: "/list/edit"]: respond_to {
before: =>
Expand Down
2 changes: 2 additions & 0 deletions views/gamekeys_list_edit.moon
Expand Up @@ -44,3 +44,5 @@ class extends Widget
input type: "text", name: "recipient", value: key.recipient
td ->
input type: "checkbox", name: "delete"
a href: @url_for("gamekeys_add"), class: "pure-button", "add key"
a href: @url_for("gamekeys_list"), class: "pure-button", "key list"

0 comments on commit 0801de0

Please sign in to comment.