Skip to content

Commit

Permalink
Merge branch 'master' into mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Dec 30, 2019
2 parents 044c950 + f694d8b commit dc840ad
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 14 deletions.
37 changes: 31 additions & 6 deletions http/js/iznik/views/pages/user/newsfeed.js
Original file line number Diff line number Diff line change
Expand Up @@ -1448,14 +1448,39 @@ define([
}
}

var replies = self.model.get('replies')
self.replies = new Iznik.Collections.Replies(replies)
var origreplies = self.model.get('replies')
var replies = []
var users = [];

self.contributors = []
_.each(replies, function (reply) {
if (reply.user) {
self.contributors[reply.user.id] = reply.user.displayname

function unnest(origreplies) {
_.each(origreplies, function(reply) {
replies.push(reply)

if (reply.user) {
self.contributors[reply.user.id] = reply.user.displayname
users[reply.user.id] = reply.user
}

if (reply.replies && reply.replies.length) {
// In the new version of FD we have nested replies. Make sure we at least display these (flattened) in
// this version.
unnest(reply.replies)
}
})
}

unnest(origreplies)
console.log("Replies", replies)

for (var i = 0; i < replies.length; i++) {
if (!replies[i].user && replies[i].userid) {
replies[i].user = users[replies[i].userid]
}
})
}

self.replies = new Iznik.Collections.Replies(replies)

var replyel = self.$('.js-replies')

Expand Down
18 changes: 10 additions & 8 deletions http/js/iznik/views/pages/user/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,16 @@ define([
self.listenToOnce(Iznik.Session, 'isLoggedIn', function (loggedIn) {
// We have some groups near their chosen location.
var mygroups = Iznik.Session.get('groups');
mygroups.each(function(group) {
if (group.get('type') == 'Freegle' &&
group.get('privategroup')) {
// We are a member of a private group. That should appear at the top.
groups.append('<option value="' + group.get('id') + '" />');
groups.find('option:last').text(group.get('namedisplay'));
}
});
if (mygroups) {
mygroups.each(function(group) {
if (group.get('type') == 'Freegle' &&
group.get('privategroup')) {
// We are a member of a private group. That should appear at the top.
groups.append('<option value="' + group.get('id') + '" />');
groups.find('option:last').text(group.get('namedisplay'));
}
});
}

var homegroup = null;
var homegrouptime = null;
Expand Down
2 changes: 2 additions & 0 deletions http/template/modtools/user/logentry.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
Outcome for #{{msgid}}: {{text}}
<% } else if (subtype == 'Autoapproved') { %>
Auto-approved #{{msgid}} - either Yahoo problems or not moderated
<% } else if (subtype == 'WorryWords') { %>
Message #{{msgid}} {{text}}
<% } else { %>
<div class="text-muted">Unknown log type {{type}} subtype {{subtype}}</div>
<% } %>
Expand Down

0 comments on commit dc840ad

Please sign in to comment.