%
if(typeof ed == 'undefined') ed = {}
var thisrepost = (typeof repost != 'undefined' && repost)
var cover = share.images[0]
var my = (user.address.value && share.address == user.address.value.toString('hex'))
var subscribed = '';
if(!my && user.address.value){
var me = psdk.userInfo.getmy()
if (me && me.relation(share.address, 'subscribes')){
subscribed = 'subscribed'
}
}
///all
var cview = 'article'
var value = Number(share.score)
var checkvisibility = app.platform.sdk.node.shares.checkvisibility(share)
var lockedaccount = app.platform.sdk.user.reputationBlockedNotMe(share.address)
var userInfo = psdk.userInfo.get(share.address) || {}
var name = app.platform.api.clearname(userInfo.name || share.address, true)
var translates = app.platform.sdk.translate.share.needtranslate(share.txid)
var lang = app.platform.sdk.translate.share.lang(share.txid)
var translated = app.platform.sdk.translate.share.get(share.txid) || {}
var cc = share.renders.captionclear(translated.c);
%>
<% var maketags = function() { %>
<% if(share.tags && share.tags.length > 0) {
var bycategories = app.platform.sdk.categories.fromTags(share.tags, share.lanuage)
%>
<% } %>
<%} %>
<% var displaypkoin = function(){ %>
<% if((typeof preview == 'undefined' || !preview) && all) {%>
<% } %>
<% if(!lockedaccount) {%>
<% if(app.boost && !app.pkoindisable && (typeof preview == 'undefined' || !preview)) {%>
<% } %>
<% } %>
<% } %>
<% var displaysys = function(){ %>
<% if((typeof repost == 'undefined' || !repost || fromempty)) {%>
<%if(typeof authorsettings != 'undefined' && authorsettings.pin == share.txid){%>
<%=e((authorsettings.temp || authorsettings.relay) ? 'pinning' :'pinned').toLowerCase()%>, <%}%><% if(share.downloadedDate) {%> <%- app.reltime(share.downloadedDate) %> <% } else { %>
<% if(share.time) {%><%- app.reltime(share.time) %> <% } else { %><%=e('e13019')%> <% } %><% if(typeof boosted != 'undefined' && boosted) {%> <%-e('boosted')%> <% } %> <% if(typeof fromrecommendations != 'undefined' && fromrecommendations) {%> <%=e('recommended')%> <% } %><% if(share.edit == 'true') {%>, <%=e('e13130').toLowerCase()%> <% } %><% } %><% if(share.visibility()) {%>, <%=e('sharevisibility_' + share.visibility()).toLowerCase()%> <% } %>
<% } else { %>
<% if(share.time) {%><%- app.reltime(share.time) %> <% } else { %><%=e('e13019')%> <% } %><% if(share.edit == 'true') {%>, <%=e('e13130').toLowerCase()%> <% } %><% if(share.visibility()) {%>, <%=e('sharevisibility_' + share.visibility()).toLowerCase()%> <% } %>
<% } %>
<% } %>
<% var threedots = function(){ %>
<% if((typeof repost == 'undefined' || !repost) && (typeof preview == 'undefined' || !preview) && !share.temp) { %>
<% if(!checkvisibility && (typeof openapi == 'undefined' || !openapi)) {%>
<% } else { %>
<% } %>
<% } %>
<% } %>
<% var metadisplay = function(){ %>
<%-(name) %>
<% if((!state || !my) && (typeof repost == 'undefined' || !repost) && (typeof app.platform.sdk.user.myaccauntdeleted == 'undefined' || !app.platform.sdk.user.myaccauntdeleted())) { %>
· <%=e('sub')%> <%=e('subi')%>
<% if(state && !my && user.address.value && me) {
var r = me.relation(share.address, 'subscribes') %>
·
<% } %>
<% } %>
<% } %>
<% var makecaptionclear = function(){%>
<% if(cc) { %>
<%=app.actions.emoji(nl2br(trimrn(filterXSS(clearScripts(cc)))))%>
<% }
} %>
<% var makestarstoppanel = function(){
var value = Number(share.score)
if (Number(share.scnt) && _.isNumber(Number(share.scnt))) {
value = value / Number(share.scnt)
}
else {
value = 0
}
if(!share.temp){
%>
<%-Number(value).toFixed(1)%>
<% _.each(translates, function(t){ %>
<%-flb(t)%>
<% }) %>
<% if(!all) {%>
<% displaypkoin() %>
<% } %>
<% } %>
<% } %>
<% var makestarspanel = function(){ %>
<% } %>
<% var makesharepanel = function(){
%>
<% threedots() %>
<% if(typeof preview == 'undefined' || !preview) {%>
<% } %>
<% } %>
<% var makeavatar = function(){
var src = userInfo.image;
var letter = name ? name[0] : '';
%>
<% } %>
<% var maketemp = function(){ %>
<%=e('postWaitConf')%>
<% } %>
<% var notvisible = function(){ %>
<% if(!lockedaccount) {%>
<% makecaptionclear() %>
<% if(checkvisibility == 'sub'){ %>
<%=e('sharevisibilitylabel_sub_' + cview)%>
<% } %>
<% if(checkvisibility == 'reg'){ %>
<%=e('sharevisibilitylabel_reg_' + cview)%>
<% } %>
<% if(!state) {%>
<%=e('signupmenu')%>
<% } %>
<% } else { %>
<%=e('lockedaccounta')%>
<% } %>
<% } %>
<% var makearticle = function(){
var edjs = new edjsHTML(null, app)
var txt = null
try{
var message = edjs.apply(translated.m || share.message, trydecode)
txt = edjs.parse(message)
} catch(e){
console.error(e)
}
%>
<% if(txt) {%>
<%=txt%>
<% } else { %>
<%-e('error')%>
<% } %>
<% } %>
<% makeavatar() %>
<% if(!all) { %>
<% metadisplay() %>
<% displaysys() %>
<% } %>
<% makesharepanel() %>
<% if(all) { %>
<% maketags() %>
<% makecaptionclear() %>
<% displaysys() %>
<% metadisplay() %>
<% } else { %>
<% makecaptionclear() %>
<% if(!share.temp && !share.relay){
var edjs = new edjsHTML(null, app)
var message = edjs.apply(translated.m || share.message, trydecode)
var words = edjs.words(message)
var textPreview = '';
if (message && message.blocks){
for (const b of message.blocks.slice()){
if (b.type === 'paragraph' && b.data && b.data.text){
try{
textPreview = filterXSS(clearScripts(findAndReplaceLink(b.data.text)))
} catch(err){
}
break;
}
}
}
%>
<%} else{ %>
<%} %>
<% if(!share.temp && !share.relay){ %>
<% maketags() %>
<% } %>
<% } %>
<% makestarstoppanel() %>
<% if(!all) {%>
<%=e('postRemoved')%>
<% } %>
<%=e('e13131')%>
<%=e('unblock')%>
<%=e('showhiddenPost')%>
<% if(all) {%>
<%=e('postRemoved')%>
<% if(!checkvisibility && !lockedaccount) {%>
<% makearticle() %>
<% makestarspanel() %>
<% maketags() %>
<% displaysys() %>
<% displaypkoin() %>
<% } else { %>
<% notvisible() %>
<% } %>
<% } %>