Skip to content

Commit

Permalink
Merge pull request #7 from martindale/profiles
Browse files Browse the repository at this point in the history
Improved Profiles
  • Loading branch information
martindale committed Jan 12, 2016
2 parents 761237a + e54e049 commit 81967c9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/melody.js
Expand Up @@ -54,7 +54,11 @@ var Person = melody.define('Person', {
email: { type: String , max: 200 },
username: { type: String , slug: true , max: 200 },
password: { type: String , masked: true , max: 200 },
created: { type: Date , default: Date.now }
created: { type: Date , default: Date.now },
avatar: {
url: { type: String, default: '/img/square-image.png' }
},
bio: { type: String }
},
requires: {
'Post': {
Expand Down
Binary file added public/img/square-image.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions views/partials/person.jade
@@ -1,5 +1,8 @@
a.ui.card(href="/people/#{person.slug}")
.image
img(src="#{person.avatar.url}")
.content
.header #{person.username}
.meta joined
abbr.tooltipped(title="#{person.created}") #{moment(person.created).fromNow()}
.description #{person.bio}
10 changes: 7 additions & 3 deletions views/people.jade
@@ -1,9 +1,13 @@
extends layouts/default

block content
for person in people
include partials/person


h1.header #{people.length} People

.ui.five.cards
for person in people
include partials/person

.ui.segment
form.ui.form(action="/people", method="post")
.field
Expand Down
2 changes: 2 additions & 0 deletions views/person.jade
Expand Up @@ -5,8 +5,10 @@ block content
.ui.grid
.row
.four.wide.column
img.ui.image.fluid.bordered(src="#{person.avatar.url}")

h2 #{person.username}
p #{person.bio}

.ui.statistic
.value #{posts.length}
Expand Down

0 comments on commit 81967c9

Please sign in to comment.