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

Commit

Permalink
Merge pull request #145 from christianbundy/fix-upstream
Browse files Browse the repository at this point in the history
Add refresh option and bump version
  • Loading branch information
christianbundy committed May 10, 2014
2 parents 59cde7f + a3270e8 commit e0fed6b
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 19 deletions.
20 changes: 10 additions & 10 deletions client/layout/sidebar/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
<i class="fa fa-sort"></i>
<strong>NEWS </strong>
</li>
<a href="/hot" class="{{activeSort 'hot'}} list-group-item"><i class="fa fa-fire"></i> Hot</a>
<a href="/top/week" class="{{activeSort 'top'}} list-group-item"><i class="fa fa-star"></i> Top</a>
<a href="/hot" class="{{activeSort 'hot'}} sort list-group-item"><i class="fa fa-fire"></i> Hot</a>
<a href="/top/week" class="{{activeSort 'top'}} sort list-group-item"><i class="fa fa-star"></i> Top</a>
{{#if isSortTop}}
<div class="indent">
<a class="{{activeTime 'hour'}} list-group-item" href="/{{sortType}}/hour">Hour</a>
<a class="{{activeTime 'day'}} list-group-item" href="/{{sortType}}/day">Day</a>
<a class="{{activeTime 'week'}} list-group-item" href="/{{sortType}}/week">Week</a>
<a class="{{activeTime 'month'}} list-group-item" href="/{{sortType}}/month">Month</a>
<a class="{{activeTime 'year'}} list-group-item" href="/{{sortType}}/year">Year</a>
<a class="{{activeTime 'ever'}} list-group-item" href="/{{sortType}}/ever">Ever</a>
<a class="{{activeTime 'hour'}} time list-group-item" href="/{{sortType}}/hour">Hour</a>
<a class="{{activeTime 'day'}} time list-group-item" href="/{{sortType}}/day">Day</a>
<a class="{{activeTime 'week'}} time list-group-item" href="/{{sortType}}/week">Week</a>
<a class="{{activeTime 'month'}} time list-group-item" href="/{{sortType}}/month">Month</a>
<a class="{{activeTime 'year'}} time list-group-item" href="/{{sortType}}/year">Year</a>
<a class="{{activeTime 'ever'}} time list-group-item" href="/{{sortType}}/ever">Ever</a>
</div>
{{/if}}
<a href="/recent" class="{{activeSort 'recent'}} list-group-item"><i class="fa fa-clock-o"></i> Recent</a>
<a href="/random" class="{{activeSort 'random'}} list-group-item"><i class="fa fa-random"></i> Random</a>
<a href="/recent" class="{{activeSort 'recent'}} sort list-group-item"><i class="fa fa-clock-o"></i> Recent</a>
<a href="/random" class="{{activeSort 'random'}} sort list-group-item"><i class="fa fa-random"></i> Random</a>
</ul>
</sidebar>
</template>
11 changes: 11 additions & 0 deletions client/layout/sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,14 @@ Template.sidebar.helpers({
return '/';
}
});

Template.sidebar.events({
'click .sort.active' : function (event) {
// don't try changing pages
event.preventDefault();
require('routes', function (Routes) {
// run the onAfterAction for the sort type
Routes[Session.get('sortType')].onAfterAction();
});
}
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fraction.io",
"version": "0.21.2",
"version": "0.21.3",
"author": "Christian Bundy",
"description": "Your personalized community aggregator.",
"contributors": [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions shared/router/lib/hot.js → shared/router/routes/hot.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ define('routeHot', depend, function (Posts, setNews, Controllers) {
},
onAfterAction: function () {
setNews('hot');
Session.set('posts', Posts.find({}, {
Session.set('findSelector', {});
Session.set('findOptions', {
reactive: false,
sort: {
heat: -1
}
}).fetch());
});
Session.set('posts', Posts.find(
Session.get('findSelector'),
Session.get('findOptions')
).fetch());
}
};
});
10 changes: 8 additions & 2 deletions shared/router/lib/random.js → shared/router/routes/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ define('routeRandom', depend, function (Posts, setNews, shuffle, Controllers) {
},
onAfterAction: function () {
setNews('random');
Session.set('posts', shuffle(Posts.find({}, {

Session.set('findSelector', {});
Session.set('findOptions', {
reactive: false
}).fetch()));
});
Session.set('posts', shuffle(Posts.find(
Session.get('findSelector'),
Session.get('findOptions')
).fetch()));
}
};
});
10 changes: 8 additions & 2 deletions shared/router/lib/recent.js → shared/router/routes/recent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,19 @@ define('routeRecent', depend, function (Posts, setNews, Controllers) {
return Meteor.subscribe('recentPosts');
},
onAfterAction: function () {

setNews('recent');
Session.set('posts', Posts.find({}, {
Session.set('findSelector', {});
Session.set('findOptions', {
reactive: false,
sort: {
createdAt: -1
}
}).fetch());
});
Session.set('posts', Posts.find(
Session.get('findSelector'),
Session.get('findOptions')
).fetch());
}
};
});
File renamed without changes.
11 changes: 9 additions & 2 deletions shared/router/lib/top.js → shared/router/routes/top.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,19 @@ define('routeTop', depend, function (Posts, setNews, Controllers) {

setNews('top');
Session.set('sortTime', time);
Session.set('posts', Posts.find({}, {

Session.set('findSelector', {});
Session.set('findOptions', {
reactive: false,
sort: {
oldPoints: -1
}
}).fetch());
});
Session.set('posts', Posts.find(
Session.get('findSelector'),
Session.get('findOptions')
).fetch());


var accepted = [
'hour',
Expand Down
File renamed without changes.

0 comments on commit e0fed6b

Please sign in to comment.