simplex/views/index/logged_in.moon
2018-04-23 05:22:27 -07:00

29 lines
738 B
Plaintext

import Widget from require "lapis.html"
class LoggedIn extends Widget
content: =>
script -> raw "var API_KEY = '#{@keys[1].key}';"
script src: "/static/index.js"
p "API Keys:"
ul ->
if @keys
for key in *@keys
li key.key
li ->
a onclick: "new_api_key()"
p "Tasks:"
ul ->
if @tasks
for task in *@tasks
li ->
input type: "checkbox", id: "task-#{task.id}", onchange: "check(#{task.id});", checked: task.done
text " #{task.content}"
li ->
form {
onsubmit: "return new_task();"
}, ->
input type: "text", id: "new-task", placeholder: "new task"
input type: "submit", value: "+"