add first draft of about page

This commit is contained in:
Christine Dodrill 2015-01-31 21:37:51 -08:00
parent a1bb72b7a0
commit f8f0efc2d5
6 changed files with 40 additions and 0 deletions

View File

@ -3,6 +3,8 @@ lapis = require "lapis"
class extends lapis.Application
layout: require "layout.bootstrap"
@include "controllers.about"
[index: "/"]: =>
render: true

14
controllers/about.moon Normal file
View File

@ -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

View File

@ -0,0 +1,4 @@
img.textwrap-right {
float: right;
margin: 10px;
}

BIN
static/img/error.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

10
views/about.moon Normal file
View File

@ -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."

10
views/error.moon Normal file
View File

@ -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