add first draft of about page
This commit is contained in:
parent
a1bb72b7a0
commit
f8f0efc2d5
2
app.moon
2
app.moon
|
@ -3,6 +3,8 @@ lapis = require "lapis"
|
|||
class extends lapis.Application
|
||||
layout: require "layout.bootstrap"
|
||||
|
||||
@include "controllers.about"
|
||||
|
||||
[index: "/"]: =>
|
||||
render: true
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
gh = require('github').new({access_token = os.getenv "GITHUB_TOKEN", httpclient_driver = 'httpclient.ngx_driver'})
|
||||
|
||||
lapis = require "lapis"
|
||||
|
||||
class About extends lapis.Application
|
||||
[about: "/about"]: =>
|
||||
@user, err = gh\get_authenticated_user()
|
||||
|
||||
if err
|
||||
@err = err
|
||||
|
||||
return status: 500, render: "error"
|
||||
|
||||
return render: true
|
|
@ -0,0 +1,4 @@
|
|||
img.textwrap-right {
|
||||
float: right;
|
||||
margin: 10px;
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 78 KiB |
|
@ -0,0 +1,10 @@
|
|||
import Widget from require "lapis.html"
|
||||
|
||||
class About extends Widget
|
||||
content: =>
|
||||
link rel: "stylesheet", href: "/static/css/about/main.css"
|
||||
|
||||
img class: "textwrap-right", src: @user.avatar_url
|
||||
|
||||
p ->
|
||||
text "I am a GitHub power user. As of right now, I have #{@user.public_repos} open source projects tracked on GitHub. I have #{@user.followers} followers and am following #{@user.following} users."
|
|
@ -0,0 +1,10 @@
|
|||
import Widget from require "lapis.html"
|
||||
|
||||
class Error extends Widget
|
||||
content: =>
|
||||
center ->
|
||||
h1 "Oops!"
|
||||
|
||||
img src: "/static/img/error.png"
|
||||
|
||||
p @err
|
Loading…
Reference in New Issue