fix default reply and boost options

This commit is contained in:
fenwick67 2018-03-24 18:33:22 -05:00
parent 0072386666
commit 71edc0a4e5
3 changed files with 40 additions and 28 deletions

View file

@ -46,6 +46,8 @@ app.get('/api/feed',function(req,res){
opts.header = true;
}
}
opts.boosts = true;
if (req.query.boosts){
if (req.query.boosts.toLowerCase() == 'no' || req.query.boosts.toLowerCase() == 'false'){
opts.boosts = false;
@ -53,6 +55,8 @@ app.get('/api/feed',function(req,res){
opts.boosts = true;
}
}
opts.replies = true;
if (req.query.replies){
if (req.query.replies.toLowerCase() == 'no' || req.query.replies.toLowerCase() == 'false'){
opts.replies = false;

View file

@ -173,6 +173,14 @@ function buildUp(jsonObj,opts){
item.isReply = true;
}
if(item.categories){
item.hasCw = item.categories.indexOf('nsfw') > -1;
if(item.hasCw){
item.cw = item.summary;
}
}
return true;
});

View file

@ -48,34 +48,34 @@
<% if (item.isBoost) { %>
<div class="item-title"> <%- item.title %> </div>
<% } %>
<div class="author">
<a target="_top" class="avatar" href="<%- item.author.uri %>">
<img class="avatar" src="<%- item.author.avatar %>"/>
</a>
<div class="author-info">
<a target="_top" class="author-displayname" href="<%- item.author.uri %>"> <%= item.author.displayName %> </a>
<div class="author-fullname"> <%= item.author.fullName %> </div>
</div>
</div>
<div class="item-content">
<%- item.content %>
</div>
<% if (item.enclosures.length > 0){ %>
<div class="enclosures">
<% for (var i = 0; i < item.enclosures.length; i ++){ var e = item.enclosures[i] %>
<a target="_top" class="enclosure" href="<%= e.url %>" >
<% if (e.type.indexOf('image') > -1){ %>
<img src="<%= e.url %>"/>
<% }else if (e.type.indexOf('video') > -1){ %>
<video autoplay loop muted src="<%= e.url %>"/>
<% } else { %>
<%= e.url %>
<% } %>
</a>
<% } %>
</div>
<% } %>
<div class="date"><%= item.stringDate %></div>
<div class="author">
<a target="_top" class="avatar" href="<%- item.author.uri %>">
<img class="avatar" src="<%- item.author.avatar %>"/>
</a>
<div class="author-info">
<a target="_top" class="author-displayname" href="<%- item.author.uri %>"> <%= item.author.displayName %> </a>
<div class="author-fullname"> <%= item.author.fullName %> </div>
</div>
</div>
<div class="item-content">
<%- item.content %>
</div>
<% if (item.enclosures.length > 0){ %>
<div class="enclosures">
<% for (var i = 0; i < item.enclosures.length; i ++){ var e = item.enclosures[i] %>
<a target="_top" class="enclosure" href="<%= e.url %>" >
<% if (e.type.indexOf('image') > -1){ %>
<img src="<%= e.url %>"/>
<% }else if (e.type.indexOf('video') > -1){ %>
<video autoplay loop muted src="<%= e.url %>"/>
<% } else { %>
<%= e.url %>
<% } %>
</a>
<% } %>
</div>
<% } %>
<div class="date"><%= item.stringDate %></div>
</div>
<% }); %>
</div>