Skip to content

Commit

Permalink
Interface revisions (presenter & audience)
Browse files Browse the repository at this point in the history
Trying to clean up for Apple Store App submision
  • Loading branch information
zeroasterisk committed May 8, 2013
1 parent 1e2b908 commit 39388aa
Show file tree
Hide file tree
Showing 21 changed files with 335 additions and 100 deletions.
3 changes: 1 addition & 2 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ accounts-base
accounts-google
accounts-facebook
accounts-twitter
accounts-meetup
bootstrap
router
chartjs
tour
d3
accounts-ui-bootstrap-dropdown
moment
validation
x-editable-bootstrap
bootstrap-growl
amplify
accounts-ui
3 changes: 3 additions & 0 deletions client/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ Meteor.subscribe('decksPublic', function() {

Session.set('SlidesLoaded', false);
Deps.autorun(function () {

Meteor.subscribe('deckSelected', Session.get('deckId'), function() {
Session.set('SlidesLoaded', true);
});

Meteor.subscribe('decksForUser', Meteor.userId(), function() {
});

Meteor.subscribe('pollsForSlide', Session.get('slideId'), function() {
Session.set('PollsLoaded', true);
});
Expand Down
5 changes: 5 additions & 0 deletions client/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
header .brand img {
/* margin: 0 0 5px 0; */
position: absolute;
left: 0;
}
44 changes: 30 additions & 14 deletions client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,37 @@
<header>
<div class="navbar navbar-static-top">
<div class="navbar-inner">
{{#if deck}}
<a class="brand" href="/deck/{{deck._id}}">{{deck.title}}</a>
{{else}}
<a class="brand" href="/decks">Presenteract</a>
{{/if}}

<ul class="nav">
{{#if currentUser}}
<li><a href="/decksMine"><i class="icon-user"></i> My Presentations</a></li>
<li><a href="/deckNew"><i class="icon-plus"></i> New Presentation</a></li>
<div class="container navbar-responsive-container">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
{{#if deck}}
<a class="brand" href="/deck/{{deck._id}}">
<img src="/icon.png" alt="Logo" width="20">
{{deck.title}}
</a>
{{else}}
<a class="brand" href="/decks">
<img src="/icon.png" alt="Logo" width="20">
Presenteract
</a>
{{/if}}
</ul>

<div class="navbar-text pull-right">
{{loginButtons align="right" }}
<div class="navbar-text pull-right">
{{loginButtons align="right" }}
</div>
<div class="nav-collapse collapse">
<ul class="nav">
{{#if currentUser}}
<li><a href="/decksMine"><i class="icon-user"></i> My Presentations</a></li>
<li><a href="/deckNew"><i class="icon-plus"></i> New Presentation</a></li>
{{else}}
<li><a href="#">Login to create/edit/run Presenations</a></li>
{{/if}}
</ul>
</div>
</div>
</div>
</div>
Expand Down
42 changes: 11 additions & 31 deletions client/lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,34 +31,6 @@
return 'deckEdit';
};

deckOpen = function(deckId) {
if (! (_.isString(deckId) && deckId.length)) {
return 'decks';
}
var deck = Decks.findOne({ _id: deckId});
if (! (_.isObject(deck) && deck.owner == Meteor.userId())) {
Notify.alert('Access denied, you are not the owner');
return 'decks';
}
Meteor.call('deckOpen', deckId);
Meteor.Router.to('/deck/' + deckId);
return 'deck';
};

deckClose = function(deckId) {
if (! (_.isString(deckId) && deckId.length)) {
return 'decks';
}
var deck = Decks.findOne({ _id: deckId});
if (! (_.isObject(deck) && deck.owner == Meteor.userId())) {
Notify.alert('Access denied, you are not the owner');
return 'decks';
}
Meteor.call('deckClose', deckId);
Meteor.Router.to('/decksMine');
return 'decksMine';
};

deckEditSlide = function(deckId, slideId) {
if (! (_.isString(deckId) && deckId.length)) {
return 'decks';
Expand All @@ -73,14 +45,13 @@

Meteor.Router.add({
'/': 'home',
'/about': 'about',
'/decks': 'decks',
'/decksMine': 'decksMine',
'/deck/:deckId': deckView,
'/deck/:deckId/:slideId': deckView,
'/deckNew': 'deckNew',
'/deckEdit/:deckId': deckEdit,
'/deckOpen/:deckId': deckOpen,
'/deckClose/:deckId': deckClose,
'/deckEditSlide/:deckId/:slideId': deckEditSlide,
});

Expand All @@ -95,17 +66,26 @@
return 'user_signin';
},

// require the auctions collections subscription to have been loaded
// require the collections
requireDecks: function(page) {
if (Session.get('DecksLoaded')) {
return page;
}
return 'loading';
},

// require the collections
requireSlides: function(page) {
if (Session.get('SlidesLoaded')) {
return page;
}
return 'loading';
}

});

Meteor.Router.filter('requireDecks', {only: ['decks', 'deck', 'deckEdit']});
Meteor.Router.filter('requireSlides', {only: ['deck', 'deckEdit']});

Meteor.startup(function() {
Meteor.autorun(function() {
Expand Down
2 changes: 1 addition & 1 deletion client/views/_deckNodePublic.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h4>
</span>
{{/if}}
</h4>
<p class="muted">{{short}}</p>
<p class="muted">{{safe 'short'}}</p>
</div>
</div>
</template>
41 changes: 41 additions & 0 deletions client/views/_editDeckBar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template name="_editDeckBar">
<div class="media">
<div class="pull-left thumbnail" style="margin-right: 10px;">
<div class="btn-group">
<a href="/deckEdit/{{_id}}" class="btn btn-mini"><i class="icon-edit"></i> Edit</a>
{{#if isOpen}}
<a href="/deck/{{_id}}" class="btn btn-mini btn-primary"><i class="icon-play icon-white"></i> View/Start</a>
{{else}}
<a href="/deck/{{_id}}" class="btn btn-mini btn-info"><i class="icon-search icon-white"></i> Preview</a>
{{/if}}
</div>
&nbsp;
<br>
{{#if slidesCount}}
<span class="label label-info"><i class="icon-ok icon-white"></i> has {{slidesCount}} slides</span>
{{else}}
<span class="label label-warning"><i class="icon-remove icon-white"></i> no slides</span>
{{/if}}
<br>
{{#if isOpen}}
<a href="#" data-id="{{_id}}" class="deckClose label label-success" data-toggle="tooltip" title="Deck is open, ready to connect to... click to change"><i class="icon-ok icon-white"></i> Open</a>
{{else}}
<a href="#" data-id="{{_id}}" class="deckOpen label label-warning"><i class="icon-remove icon-white"></i> Closed</a>
{{/if}}
<br>
{{#if isFindable}}
<a href="#" data-id="{{_id}}" class="deckHide" data-toggle="tooltip" title="Deck is Findable/visible, click to change"><i class="icon-eye-open"></i> Visible</a>
{{else}}
<a href="#" data-id="{{_id}}" class="deckFindable" data-toggle="tooltip" title="Deck is hidden, click to change"><i class="icon-lock"></i> Invisible</a>
{{/if}}
</div>
<div class="media-body">
<h4 style="margin:0;">
<span class="eip" data-type="text" data-mode="inline" data-name="title" data-pk="{{_id}}">{{title}}</span>
</h4>
<div class="muted eip" data-type="textarea" data-mode="inline" data-name="short" data-pk="{{_id}}">{{safe 'short'}}</div>
<br>
<span class="label">created: {{createdNice}}</span>
</div>
</div>
</template>
94 changes: 94 additions & 0 deletions client/views/_editDeckBar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Template._editDeckBar.events({
// open a deck, done on server, as a call example
// this relies on Meteor.methods() defined in server/methods.js
'click .deckOpen': function(event) {
var deckId = _(event).eventGetA().data('id');
var deck = Decks.findOne({ _id: deckId});
if (! (_.isObject(deck) && deck.owner == Meteor.userId())) {
Notify.alert('Access denied, you are not the owner');
return false;
}
Meteor.call('deckOpen', deckId);
return false;
},
// close a deck, done on server, as a call example
'click .deckClose': function(event) {
var deckId = _(event).eventGetA().data('id');
var deck = Decks.findOne({ _id: deckId});
if (! (_.isObject(deck) && deck.owner == Meteor.userId())) {
Notify.alert('Access denied, you are not the owner');
return false;
}
Meteor.call('deckClose', deckId);
return false;
},
// make findable, done on client->server, as an example
// this relies on Decks.allow defined in the models/decks.js
'click .deckFindable': function(event) {
var deckId = _(event).eventGetA().data('id');
var deck = Decks.findOne({ _id: deckId});
if (! (_.isObject(deck) && deck.owner == Meteor.userId())) {
Notify.alert('Access denied, you are not the owner');
return false;
}
Decks.update( { _id: deckId }, { $set: { isFindable: true } } );
return false;
},
// make not-findable, done on client->server, as an example
// this relies on Decks.allow defined in the models/decks.js
'click .deckHide': function(event) {
var deckId = _(event).eventGetA().data('id');
var deck = Decks.findOne({ _id: deckId});
console.log('deckHide', event, deckId, deck, Meteor.userId());
if (! (_.isObject(deck) && deck.owner == Meteor.userId())) {
Notify.alert('Access denied, you are not the owner');
return false;
}
Decks.update( { _id: deckId }, { $set: { isFindable: false } } );
return false;
},

});

Template._editDeckBar.helpers({
decks: function() {
return Decks.find({ owner: Meteor.userId() });
},
createdNice: function() {
return moment(this.created).fromNow();
},
slidesCount: function() {
Session.set('slideIdAlt', this._id);
return Slides.find({ deckId: this._id }).count();
}
});

Template._editDeckBar.rendered = function() {
// setup which changes as slides re-render/change
if (_.isObject(Template.decksMine.autorunner)) {
Template._editDeckBar.autorunner.stop();
}
Template._editDeckBar.autorunner = Deps.autorun(function() {
var mydecks = Decks.find({ owner: Meteor.userId() }).count();
if (mydecks == 0) {
return false;
}
// setup in-place
$('.eip').each(function(i, el) {
$(el).editable({
value: $(el).html(),
url: function(params) {
var d = new $.Deferred;
var deck = {};
deck[params.name] = params.value;
console.log('editable', params, deck, _.isObject(deck));
var updated = Decks.update({ _id: params.pk }, { $set: deck });
console.log('editable-done', updated);
return d.resolve();
}
});
});
});
};


2 changes: 1 addition & 1 deletion client/views/_viewPoll.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Template.viewPoll.doChart = function(pollId) {
animationSteps: 60,
};
var ctx = $("#viewPollChart").get(0).getContext("2d");
Template.viewPoll.chart = new Chart(ctx).Pie(data, options);
Template.viewPoll.chart = new Chart(ctx).Doughnut(data, options);
console.log('doChart', pollId, pollOptions, data, ctx, options, Template.viewPoll.chart);
return true;
}
Expand Down
16 changes: 16 additions & 0 deletions client/views/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template name="about">
<h1>About Presenteract</h1>
<p class="lead">Presenteract is a project to facilitate interactive presentations, where the audience can see and interact with slides from their phone/device/laptop.</p>
<h2>Audience</h2>
<p>Connect to the currently "open" deck, for this presentaiton. Often there is a QR code or a URL provided to make this simpler.</p>
<p>Wait for the Presenter to change slides for you.</p>
<p>Polls should be very simple, just choose an option and submit.</p>
<h2>Presenters</h2>
<p>To present, you must login, via Facebook or via Google. Once logged in, you'll have an option for "My Presentations" and the ability to add new ones.</p>
<p>New Deck/Presenations will be created without any slides. You must add at least one slide to be able to use it.</p>
<p>Only "Open" Presenations are available to audience members. You can edit Presenations while open, and audience members should get your changes automatically synced.</p>
<p>Only the "owner" / "creator" of a Presenation can control/run it.</p>
<h2>Help / Contact</h2>
<p><a href="https://github.com/zeroasterisk/Presenteract/issues">Bug Reports and Feature Requests</a> are available. If there is a significant need, we will improve this to a knowledge base.</p>
<p>Developers, the code is available on <a href="https://github.com/zeroasterisk/Presenteract">GitHub</a></p>
</template>
6 changes: 4 additions & 2 deletions client/views/deckEdit.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
<li><a href="/decksMine"><i class="icon-user"></i> My Decks</a> <span class="divider">/</span></li>
<li class="active"><i class="icon-book"></i> Deck</li>
</ul>
<h1>{{deck.title}}</h1>
<p>Editing Deck {{getSession 'deckId'}}</p>
<h3>Editing Deck {{getSession 'deckId'}}</h3>
{{#with deck}}
{{> _editDeckBar}}
{{/with}}

<h4>Slides ({{slidesCount}})</h4>
<ul class="thumbnails">
Expand Down
16 changes: 11 additions & 5 deletions client/views/deckView.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@
{{> slideView}}
</div>


{{/with}}

{{#if isOwner}}
<div class="deck-presenter-area">
<div class="deck-presenter-area well">
{{#if prevSlideId}}
<a href="#setSlide" class="setSlide" data-id="{{prevSlideId}}"><i class="icon-arrow-left"></i></a>
{{/if}}
<strong>on slide {{currentSlideInt}} out of {{slidesCount}}</strong>
{{#if nextSlideId}}
<a href="#setSlide" class="setSlide" data-id="{{nextSlideId}}"><i class="icon-arrow-right"></i></a>
{{/if}}
<ul class="thumbnails">
{{#each slides}}
<li class="thumbnail span2" style="height: 60px; overflow: hidden;">
<li class="thumbnail span2" style="height: 60px; overflow: hidden; background-color: white;">
<strong><a href="#setSlide" class="setSlide" data-id="{{_id}}">{{title}}</a></strong><br>
<span class="muted">{{safe 'short'}}</span>
</li>
Expand All @@ -27,6 +31,8 @@
</div>
{{/if}}

{{/with}}

</template>


Loading

0 comments on commit 39388aa

Please sign in to comment.