Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an error page #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions client/error.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template name="_houston_error">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: ideally we should have a shared parent layout template that handles navbar, etc.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

<div class="houston">
{{#if loggingIn}}
{{> spinner}}
{{else}}
{{> _houston_navbar}}
<div class="container content">
<img id="houston-error-img" src="http://i.imgur.com/hYgkzvA.gif">
<p>
This collection doesn't seem to exist. Try going to the
<a href="{{pathFor 'houston_home'}}">home page</a>.
</p>
<p>
If you haven't restarted Meteor since creating this collection, try restarting it.
</p>
</div>
{{/if}}
</div>
</template>
5 changes: 5 additions & 0 deletions client/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ Router.map ->
data: ->
[collection, @subscription] = setup_collection(@params.name)
{collection}
action: ->
if Houston._collections.collections.findOne({name})
this.render()
else
this.render Houston._houstonize('error')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd also want one of these for a document, I imagine. Also, perhaps a catch-all error?

I think IronRouter does something nice for us on 404s, wondering if we can take advantage of that without stepping on an existing user's toes.

waitOn: -> @subscription
template: 'collection_view'

Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Package.on_use(function(api) {
api.add_files([
'client/admin_login.html', 'client/db_view.html',
'client/collection_view.html', 'client/document_view.html',
'client/admin_navbar.html', 'client/main.html'],
'client/admin_navbar.html', 'client/main.html', 'client/error.html'],
'client');

api.add_files([
Expand Down
4 changes: 4 additions & 0 deletions public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@
.houston #houston-report-bug {
float: left;
}

.houston #houston-error-img {
padding-bottom: 10px;
}