be responsive

b e responsive

b e res pon sive
This commit is contained in:
Christine Dodrill 2015-03-13 03:23:05 -07:00
parent 22ff2665d1
commit 5ab74a5fde
6 changed files with 40 additions and 8 deletions

View File

@ -11,6 +11,7 @@ class extends lapis.Application
@include "controllers.blog" @include "controllers.blog"
[contact: "/contact"]: => [contact: "/contact"]: =>
@page = "contact"
@title = "Contact" @title = "Contact"
render: true render: true

View File

@ -15,6 +15,9 @@ class Blog extends lapis.Application
data = \read "*a" data = \read "*a"
data data
@title = "Blog"
@page = "blog"
render: true render: true
["blog.post": "/blog/:name"]: => ["blog.post": "/blog/:name"]: =>
@ -39,4 +42,6 @@ class Blog extends lapis.Application
@title = \read "*l" @title = \read "*l"
\close! \close!
@page = "blog"
render: true render: true

View File

@ -10,12 +10,15 @@ class Email extends lapis.Application
[email: "/contact/email"]: respond_to { [email: "/contact/email"]: respond_to {
GET: => GET: =>
@title = "Contact Me" @title = "Contact Me"
@page = "contact"
@csrf_token = csrf.generate_token @ @csrf_token = csrf.generate_token @
return render: true return render: true
POST: => POST: =>
csrf.assert_token @ csrf.assert_token @
@page = "contact"
assert_valid @params, { assert_valid @params, {
{ "name", exists: true, min_length: 3 } { "name", exists: true, min_length: 3 }
{ "message", exists: true, min_length: 15 } { "message", exists: true, min_length: 15 }
@ -40,5 +43,7 @@ class Email extends lapis.Application
@err = res @err = res
return render: "error", status: 500 return render: "error", status: 500
@title = "Success"
return render: "success" return render: "success"
} }

View File

@ -11,11 +11,13 @@ gh = require('github').new({access_token: os.getenv "GITHUB_TOKEN", httpclient_d
class Projects extends lapis.Application class Projects extends lapis.Application
[projects: "/projects"]: => [projects: "/projects"]: =>
@title = "Projects" @title = "Projects"
@page = "projects"
render: true render: true
[readme: "/projects/:name"]: => [readme: "/projects/:name"]: =>
@title = "Readme for #{@params.name}" @title = "Readme for #{@params.name}"
@name = @params.name @name = @params.name
@page = "projects"
@doc = oleg.cache "readmes", @params.name, -> @doc = oleg.cache "readmes", @params.name, ->
reply, err = gh\authed_request "/repos/Xe/#{@params.name}/contents/README.md" reply, err = gh\authed_request "/repos/Xe/#{@params.name}/contents/README.md"

View File

@ -5,6 +5,7 @@ oleg = require "lib/oleg"
class Projects extends lapis.Application class Projects extends lapis.Application
[resume: "/resume"]: => [resume: "/resume"]: =>
@title = "Resume" @title = "Resume"
@page = "resume"
@doc = oleg.cache "caches", "resume", -> @doc = oleg.cache "caches", "resume", ->
local data local data

View File

@ -44,16 +44,34 @@ class Layout extends Widget
div id: "navbar", class: "collapse navbar-collapse", -> div id: "navbar", class: "collapse navbar-collapse", ->
ul class: "nav navbar-nav", -> ul class: "nav navbar-nav", ->
li -> if @page == "blog"
a href: "/blog", "Blog" li class: "active", ->
li -> a href: "/blog", "Blog"
a href: "/projects", "Projects" else
li -> li ->
a href: "/resume", "Resume" a href: "/blog", "Blog"
if @page == "projects"
li class: "active", ->
a href: "/projects", "Projects"
else
li ->
a href: "/projects", "Projects"
if @page == "resume"
li class: "active", ->
a href: "/resume", "Resume"
else
li ->
a href: "/resume", "Resume"
ul class: "nav navbar-nav navbar-right", -> ul class: "nav navbar-nav navbar-right", ->
li -> if @page == "contact"
a href: "/contact", "Contact" li class: "active", ->
a href: "/contact", "Contact"
else
li ->
a href: "/contact", "Contact"
footer: => footer: =>
footer -> footer ->