Skip to content

Commit

Permalink
main feed works again
Browse files Browse the repository at this point in the history
  • Loading branch information
santisiri committed Jun 20, 2018
1 parent 0ffecb1 commit b289ef1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h5>{{_ 'votes'}}</h5>
<h5>{{_ 'recent-activity'}}</h5>
</div>
<div id="non-editable-feed" class="ledger">
{{> tally homeVotes hidePost=true}}
{{> tally homeVotes}}
</div>
{{> footnote}}
</div>
Expand Down
1 change: 1 addition & 0 deletions imports/ui/templates/components/decision/ledger/ledger.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { $ } from 'meteor/jquery';
import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { Tracker } from 'meteor/tracker';
import { Session } from 'meteor/session';

import { setupSplit } from '/imports/ui/modules/split';
Expand Down
4 changes: 2 additions & 2 deletions imports/ui/templates/layout/url/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
{{/if}}

<div id="non-editable-feed">
{{> feed this}}
{{> feed mainFeed}}
</div>
</div>
</div>

<div class="split split-right">
{{> ledger options=this.options kind='DELEGATION' singlePost=true hidePost=false peerFeed=false postFeed=false homeFeed=true}}
{{> ledger mainLedger}}
</div>

{{> compose}}
Expand Down
19 changes: 19 additions & 0 deletions imports/ui/templates/layout/url/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ Template.homeFeed.helpers({
}
return undefined;
},
mainFeed() {
const tally = this;
Session.set('longFeedView', this.options.view);
console.log(tally.options.view);
return tally;
},
mainLedger() {
// options=this.options kind='DELEGATION' singlePost=true hidePost=false peerFeed=false postFeed=false homeFeed=true
const tally = this;
return {
options: tally.options,
kind: 'DELEGATION',
singlePost: true,
hidePost: false,
peerFeed: false,
postFeed: false,
homeFeed: true,
};
},
});

Template.postFeed.onCreated(function () {
Expand Down
13 changes: 0 additions & 13 deletions imports/ui/templates/widgets/feed/feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,6 @@ Template.feed.onRendered(function () {
if (count.ready()) {
instance.count.set(Counts.get('feedItems'));
}
/*
if (Meteor.user()) {
const draft = instance.subscribe('contractDrafts', { view: 'contractByKeyword', keyword: `draft-${Meteor.userId()}` });
if (draft.ready()) {
const draftContract = Contracts.findOne({ keyword: `draft-${Meteor.userId()}` });
if (draftContract) {
Session.set('draftContract', draftContract);
} else {
Session.set('draftContract', createContract());
}
}
}
*/
});
});

Expand Down
3 changes: 3 additions & 0 deletions imports/ui/templates/widgets/feed/paginator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Meteor } from 'meteor/meteor';
import { $ } from 'meteor/jquery';
import { Template } from 'meteor/templating';
import { Session } from 'meteor/session';
import { ReactiveVar } from 'meteor/reactive-var';

import { gui } from '/lib/const';
Expand Down Expand Up @@ -63,6 +64,8 @@ Template.paginator.helpers({
let nextSkip = (this.options.skip + gui.ITEMS_PER_PAGE);
if (nextSkip > this.count) { nextSkip = this.count; }
this.options.skip = nextSkip;
this.options.view = Session.get('longFeedView');
console.log(`nextOptions: ${JSON.stringify(this.options)}`);
return this.options;
},
});
Expand Down

0 comments on commit b289ef1

Please sign in to comment.