Skip to content
This repository has been archived by the owner on Nov 29, 2017. It is now read-only.

Commit

Permalink
adds hidden option to creation form
Browse files Browse the repository at this point in the history
  • Loading branch information
toddtreece committed May 6, 2014
1 parent b4d3447 commit 018e911
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,17 @@ exports.create = function(req, res, next) {
});
}


this.metadata.create({
title: req.param('title'),
description: req.param('description'),
fields: fields,
tags: tags
tags: tags,
hidden: (req.param('hidden') === '1' ? true : false)
}, function(err, stream) {

console.log(stream);

if(err) {
err = new Error('creating stream failed');
next(err);
Expand Down
18 changes: 18 additions & 0 deletions views/streams/make.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@
<textarea name="description" class="form-control" rows="6" placeholder="Weather sensor at 3332 Uniontown Rd..." required></textarea>
</div>

<div class="form-group">

<label>Show in Public Stream List?</label>

<div>

<label class="radio-inline">
<input type="radio" name="hidden" value="0" checked> Visible
</label>

<label class="radio-inline">
<input type="radio" name="hidden" value="1"> Hidden
</label>

</div>

</div>

<div class="form-group">
<label>Fields</label>
<input type="text" name="fields" class="form-control" placeholder="wind, humidity, temp, rain" required>
Expand Down

0 comments on commit 018e911

Please sign in to comment.