Skip to content

Commit

Permalink
Improving what happens with an empty database, fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
JedWatson committed Feb 1, 2014
1 parent 92dbb31 commit e232e96
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 72 deletions.
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -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!
6 changes: 3 additions & 3 deletions templates/views/site/blog.jade
Expand Up @@ -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
Expand All @@ -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
Expand Down
129 changes: 69 additions & 60 deletions templates/views/site/index.jade
Expand Up @@ -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
Expand All @@ -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;



Expand Down
4 changes: 2 additions & 2 deletions templates/views/site/links.jade
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions templates/views/site/meetups.jade
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/views/site/members.jade
Expand Up @@ -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')
Expand Down
3 changes: 1 addition & 2 deletions templates/views/site/mentors.jade
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion templates/views/site/organisations.jade
Expand Up @@ -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.