Browse files

Improving what happens with an empty database, fixes #14

  • Loading branch information...
1 parent 92dbb31 commit e232e96d2143475bcded89548766012b04ede829 @JedWatson committed Feb 1, 2014
View
4 README.md
@@ -64,10 +64,8 @@ When it's all up and running, you should see the message `SydJS is ready on port
#### or, how you don't have any content yet
-The first time you run the site, the homepage **will** error because it expects there to be at least one meetup, and your database won't have any. Don't freak out, just go to [/keystone](http://localhost:3000/keystone), sign in as the admin user, and create one.
+The first time you run the site, the homepage will warn you that it expects there to be at least one meetup, and your database won't have any. Don't freak out, just go to [/keystone](http://localhost:3000/keystone), sign in as the admin user, and create one.
You'll probably want to add some other content too (blog post, members, etc) to get all the pages looking right.
-We'll hopefully create a development copy of the database (or improve the init scripts) soon to make this smoother.
-
... happy hacking!
View
6 templates/views/site/blog.jade
@@ -16,7 +16,7 @@ block intro
block content
.container
.row
- div(class= data.categories.length ? 'col-sm-8' : 'col-sm-8 col-sm-offset-2')
+ div(class= data.categories.length || !data.posts.length ? 'col-sm-8' : 'col-sm-8 col-sm-offset-2')
if filters.category && !data.category
h3 Invalid Category.
else
@@ -26,9 +26,9 @@ block content
+post(post)
else
if data.category
- h3 No posts in the category #{data.category.name}.
+ h3.text-muted No posts in the category #{data.category.name}.
else
- h3 There are no posts yet.
+ h3.text-muted There are no posts yet.
if data.categories.length
.col-sm-3.col-sm-offset-1
View
129 templates/views/site/index.jade
@@ -9,61 +9,69 @@ block content
- lastMeetup = false;
else
- nextMeetup = lastMeetup;
-
+
+ - nextMeetup = false;
section.section.home-meetup
- .home-meetup-wrapper
+ if !nextMeetup
.container
- h5= (lastMeetup) ? 'Our last meetup:' : 'Our next meetup:'
- div(data-ks-editable=editable(user, { list: 'Meetup', id: nextMeetup.id }))
- h1= nextMeetup.name
- .row
- .col-sm-8
- if nextMeetup.description
- p!= nextMeetup.description
- if nextMeetup.talks.length
- .meetup-talks
- span.meetup-talks__icon.entypo.entypo-large.entypo-comment
- h4.meetup-talks__heading Talks on the night
- ul.list-unstyled
- each talk in nextMeetup.talks
- li.talk
- strong.talk__name #{talk.name}
- if talk.who.length
- .talk__speaker
- | by
- each user, i in talk.who
- if i
- | ,
- = user.name.full + ' '
- if user.twitter
- a(href='http://twitter.com/' + user.twitter.replace('@', ''), target='_blank' data-size="large")= user.twitter + ' '
- .col-sm-4
- dl.dl-horizontal.home-meetup__details-list
- dt
- .sr-only Date
- span.entypo.entypo-fixed-width.entypo-calendar
- dd=nextMeetup._.date.format('dddd, DD MMM YYYY')
- dt
- .sr-only Time
- span.entypo.entypo-fixed-width.entypo-clock
- dd=nextMeetup.time
- dt
- .sr-only Place
- span.entypo.entypo-fixed-width.entypo-location
- dd=nextMeetup.place
- if !lastMeetup
- .register-btn
- a(href='/attend', disabled=!nextMeetup.rsvpsAvailable).btn.btn-lg.btn-block.btn-register= nextMeetup.rsvpsAvailable ? 'Register' : 'Sold out!'
- hr.line-dashed
- p: a(href='/meetups').text-muted All our meetups →
-
- +advertisement()
- .home-meetup-map
- #meetup-map.map
- a(href='https://maps.google.com.au/?daddr=' + nextMeetup.place, target='_blank').directions-button
- span.entypo.entypo-popup
- | Get Directions
-
+ h1 Welcome<br>
+ h3 It looks like you've initialised a new database.
+ p.lead Head over to <a href='/keystone'>Keystone</a> and create an upcoming meetup, some members and blog posts to see the site work properly.
+ p.lead A default account has been created for you to sign in with: <strong>admin@keystonejs.com</strong> and the password <strong>admin</strong>.
+ else
+ .home-meetup-wrapper
+ .container
+ h5= (lastMeetup) ? 'Our last meetup:' : 'Our next meetup:'
+ div(data-ks-editable=editable(user, { list: 'Meetup', id: nextMeetup.id }))
+ h1= nextMeetup.name
+ .row
+ .col-sm-8
+ if nextMeetup.description
+ p!= nextMeetup.description
+ if nextMeetup.talks.length
+ .meetup-talks
+ span.meetup-talks__icon.entypo.entypo-large.entypo-comment
+ h4.meetup-talks__heading Talks on the night
+ ul.list-unstyled
+ each talk in nextMeetup.talks
+ li.talk
+ strong.talk__name #{talk.name}
+ if talk.who.length
+ .talk__speaker
+ | by
+ each user, i in talk.who
+ if i
+ | ,
+ = user.name.full + ' '
+ if user.twitter
+ a(href='http://twitter.com/' + user.twitter.replace('@', ''), target='_blank' data-size="large")= user.twitter + ' '
+ .col-sm-4
+ dl.dl-horizontal.home-meetup__details-list
+ dt
+ .sr-only Date
+ span.entypo.entypo-fixed-width.entypo-calendar
+ dd=nextMeetup._.date.format('dddd, DD MMM YYYY')
+ dt
+ .sr-only Time
+ span.entypo.entypo-fixed-width.entypo-clock
+ dd=nextMeetup.time
+ dt
+ .sr-only Place
+ span.entypo.entypo-fixed-width.entypo-location
+ dd=nextMeetup.place
+ if !lastMeetup
+ .register-btn
+ a(href='/attend', disabled=!nextMeetup.rsvpsAvailable).btn.btn-lg.btn-block.btn-register= nextMeetup.rsvpsAvailable ? 'Register' : 'Sold out!'
+ hr.line-dashed
+ p: a(href='/meetups').text-muted All our meetups &rarr;
+
+ +advertisement()
+ .home-meetup-map
+ #meetup-map.map
+ a(href='https://maps.google.com.au/?daddr=' + nextMeetup.place, target='_blank').directions-button
+ span.entypo.entypo-popup
+ | Get Directions
+
//- About
section.section.home-about: .container
@@ -80,13 +88,14 @@ block content
//- Blog
- section.section.home-blog: .container
- .blog(itemscope itemtype="http://schema.org/Blog")
- for post in posts
- +post(post)
- hr.line-dashed
- p(data-ks-editable=editable(user, { list: 'Post' }))
- a(href='/blog', itemprop='url').text-muted See all SydJS blog posts &rarr;
+ if posts.length
+ section.section.home-blog: .container
+ .blog(itemscope itemtype="http://schema.org/Blog")
+ for post in posts
+ +post(post)
+ hr.line-dashed
+ p(data-ks-editable=editable(user, { list: 'Post' }))
+ a(href='/blog', itemprop='url').text-muted See all SydJS blog posts &rarr;
View
4 templates/views/site/links.jade
@@ -29,9 +29,9 @@ block content
+link(link)
else
if data.tag
- h3 No links in the tag #{data.tag.name}.
+ h3.text-muted No links in the tag #{data.tag.name}.
else
- h3 There are no links yet.
+ h3.text-muted There are no links yet.
.col-sm-3
h5.text-muted Sort by
View
4 templates/views/site/meetups.jade
@@ -22,8 +22,12 @@ block content
a(href='/me').btn.btn-primary Attend
hr.line-thick
+
each meetup, i in meetups.past
+meetup(meetup, 'past')
+
+ if !meetups.upcoming.length && !meetups.past.length
+ h3.text-muted There are no meetups yet.
block js
// twitter
View
2 templates/views/site/members.jade
@@ -63,7 +63,7 @@ block content
=moment(post.publishedDate).fromNow()
p: a(href='/blog/post/' + post.slug)=post.title
else
- h3.text-muted Oops, nobody's here!
+ h3.text-muted There are no members yet.
block js
script(src='/js/lib/bootstrap/transition.js')
View
3 templates/views/site/mentors.jade
@@ -39,5 +39,4 @@ block content
if member.email
= member.email.replace('@', ' at ').replace(/\./i, ' dot ')
else
- .text-center
- h3.text-muted Oops, nobody's here!
+ h3.text-muted There are no mentors yet.
View
2 templates/views/site/organisations.jade
@@ -21,4 +21,4 @@ block content
hr
+organisations(org)
else
- h3.text-muted Oops, nobody's here!
+ h3.text-muted There are no organisations yet.

0 comments on commit e232e96

Please sign in to comment.