1
0
mirror of https://github.com/fenwick67/mastofeed synced 2024-12-23 07:38:10 +01:00

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

View File

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

View File

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