Updated CSS for admin panel. Rewrote formatting for posts. Added ability to load more posts in communities. Added ability to post from community page. Started implementing error checking across all ajax functions.

This commit is contained in:
jay.poff@outlook.com
2021-03-21 02:04:31 -05:00
parent 511ba42b46
commit cd2065d74a
27 changed files with 1020 additions and 567 deletions

5
package-lock.json generated
View File

@@ -665,6 +665,11 @@
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"hashmap": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/hashmap/-/hashmap-2.4.0.tgz",
"integrity": "sha512-Ngj48lhnxJdnBAEVbubKBJuN1elfVLZJs94ZixRi98X3GCU4v6pgj9qRkHt6H8WaVJ69Wv0r1GhtS7hvF9zCgg=="
},
"hoek": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",

View File

@@ -7,6 +7,7 @@
"cookie-parser": "^1.4.5",
"express": "^4.17.1",
"fs-extra": "^9.0.1",
"hashmap": "^2.4.0",
"memory-cache": "^0.2.0",
"moment": "^2.29.1",
"mongoose": "^5.10.14",

View File

@@ -2,15 +2,34 @@ const crypto = require('crypto');
const NodeRSA = require('node-rsa');
const fs = require('fs-extra');
const database = require('./database');
const logger = require('./logger');
const config = require('./config.json');
const xmlParser = require('xml2json');
const request = require("request");
const moment = require('moment');
const { USER } = require('./models/user');
var HashMap = require('hashmap');
let TGA = require('tga');
let pako = require('pako');
let PNG = require('pngjs').PNG;
let communityMap = new HashMap();
database.connect().then(async e => {
let communities = await database.getCommunities();
if(communities !== null) {
for(let i = 0; i < communities.length; i++ ) {
for(let j = 0; j < communities[i].title_id.length; j++) {
communityMap.set(communities[i].title_id[j], communities[i].name);
}
}
}
logger.success('Created community index')
}).catch(error => {
logger.error(error);
});
let methods = {
create_user: function(pid, experience, notifications) {
return new Promise(function(resolve, reject) {
@@ -25,8 +44,6 @@ let methods = {
}, function (error, response, body) {
if (!error && response.statusCode === 200) {
let xml = xmlParser.toJson(body, {object: true});
//console.log(xml);
//console.log(xml.miis.mii.images.image[0].cached_url);
const newUsr = {
pid: pid,
created_at: moment().format('YYYY-MM-DD HH:mm:SS'),
@@ -40,7 +57,6 @@ let methods = {
official: false
};
const newUsrObj = new USER(newUsr);
//console.log(newUsrObj);
newUsrObj.save();
resolve(newUsr);
}
@@ -211,5 +227,8 @@ let methods = {
return hashed;
},
getCommunityHash: function() {
return communityMap;
}
};
exports.data = methods;

View File

@@ -120,6 +120,29 @@ async function getHotPostsByCommunity(community, numberOfPosts) {
title_id: community.title_id
}).sort({empathy_count: -1}).limit(numberOfPosts);
}
async function getNumberNewCommunityPostsByID(community, number) {
verifyConnected();
return POST.find({
title_id: community.title_id
}).sort({ created_at: -1}).limit(number);
}
async function getNumberPopularCommunityPostsByID(community, number) {
verifyConnected();
return POST.find({
title_id: community.title_id
}).sort({ empathy_count: -1}).limit(number);
}
async function getNumberVerifiedCommunityPostsByID(community, number) {
verifyConnected();
return POST.find({
title_id: community.title_id,
verified: true
}).sort({ created_at: -1}).limit(number);
}
async function getPostsByCommunity(community, numberOfPosts) {
verifyConnected();
return POST.find({
@@ -138,10 +161,12 @@ async function getPostsByCommunityKey(community, numberOfPosts, search_key) {
async function getNewPostsByCommunity(community, numberOfPosts) {
verifyConnected();
return POST.find({
title_id: community.title_ids
title_id: community.title_id
}).sort({ created_at: -1 }).limit(numberOfPosts);
}
async function getUserPostsAfterTimestamp(post, numberOfPosts) {
verifyConnected();
return POST.find({
@@ -150,6 +175,14 @@ async function getUserPostsAfterTimestamp(post, numberOfPosts) {
}).limit(numberOfPosts);
}
async function getCommunityPostsAfterTimestamp(post, numberOfPosts) {
verifyConnected();
return POST.find({
title_id: post.title_id,
created_at: { $lt: post.created_at }
}).limit(numberOfPosts);
}
async function getDiscoveryHosts() {
verifyConnected();
return ENDPOINT.findOne({
@@ -197,6 +230,9 @@ module.exports = {
getDiscoveryHosts,
getPostsByCommunity,
getHotPostsByCommunity,
getNumberNewCommunityPostsByID,
getNumberPopularCommunityPostsByID,
getNumberVerifiedCommunityPostsByID,
getNewPostsByCommunity,
getPostsByCommunityKey,
getPostsByUserID,
@@ -207,5 +243,6 @@ module.exports = {
getUserByPID,
getUserByUsername,
getUserPostsAfterTimestamp,
getCommunityPostsAfterTimestamp,
getServerConfig
};

View File

@@ -21,7 +21,7 @@ const PostSchema = new Schema({
country_id: Number,
created_at: Date,
feeling_id: Number,
id: Number,
id: String,
is_autopost: {
type: Number,
default: 0

View File

@@ -27,7 +27,8 @@ router.use(subdomain('web_api.olv', admin));
portal.use('/titles/show', routes.PORTAL_SHOW);
portal.use('/communities', routes.PORTAL_COMMUNITIES);
portal.use('/users', routes.PORTAL_USER);
portal.use('/post', routes.PORTAL_POST);
portal.use('/posts', routes.PORTAL_POST);
portal.use('/activity-feed', routes.PORTAL_FEED);
portal.use('/', routes.PORTAL_WEB);
ctr.use('/titles/show', routes.CTR_SHOW);

View File

@@ -4,6 +4,7 @@ const database = require('../../../../database');
const util = require('../../../../authentication');
const config = require('../../../../config.json');
const request = require("request");
var path = require('path');
const ejs = require('ejs');
var multer = require('multer');
var upload = multer({ dest: 'uploads/' });
@@ -53,6 +54,10 @@ router.get('/', upload.none(), function (req, res) {
});
router.get('/css/juxt.css', function (req, res) {
res.sendFile('css/juxt.css', {root: path.join(__dirname, '../../../../webfiles/admin/')});
});
router.get('/discovery', upload.none(), function (req, res) {
database.connect().then(async e => {
@@ -135,7 +140,7 @@ router.get('/communities', upload.none(), function (req, res) {
});
router.get('/posts', upload.none(), function (req, res) {
router.get('/audit', upload.none(), function (req, res) {
database.connect().then(async e => {
@@ -154,7 +159,7 @@ router.get('/posts', upload.none(), function (req, res) {
return;
}
let user = await database.getUserByPID(pid);
res.render('admin_posts.ejs', {
res.render('admin_audit.ejs', {
user: user,
});
@@ -217,6 +222,48 @@ router.get('/communities/new', upload.none(), function (req, res) {
});
router.get('/communities/:communityID/edit', upload.none(), function (req, res) {
database.connect().then(async e => {
//let paramPackData = util.data.decodeParamPack(req.headers["x-nintendo-parampack"]);
if(req.cookies.token === null)
{
res.redirect('/login');
return;
}
let pid = util.data.processServiceToken(req.cookies.token);
//console.log(req.headers["x-nintendo-servicetoken"]);
if(pid === null)
{
res.redirect('/login');
return;
}
let user = await database.getUserByPID(pid);
let community = await database.getCommunityByID(req.params.communityID.toString());
res.render('admin_edit_community.ejs', {
user: user,
community: community,
});
}).catch(error => {
console.log(error);
res.set("Content-Type", "application/xml");
res.statusCode = 400;
response = {
result: {
has_error: 1,
version: 1,
code: 400,
error_code: 15,
message: "SERVER_ERROR"
}
};
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
});
});
router.get('/communities/:communityID', upload.none(), function (req, res) {
database.connect().then(async e => {
@@ -235,10 +282,15 @@ router.get('/communities/:communityID', upload.none(), function (req, res) {
return;
}
let user = await database.getUserByPID(pid);
let community = await database.getCommunityByID(req.params.communityID);
res.render('admin_edit_community.ejs', {
user: user,
let community = await database.getCommunityByID(req.params.communityID.toString());
let newPosts = await database.getNewPostsByCommunity(community, 100);
let totalNumPosts = await database.getTotalPostsByCommunity(community);
res.render('admin_community.ejs', {
community: community,
newPosts: newPosts,
totalNumPosts: totalNumPosts,
user: user
});
}).catch(error => {
@@ -375,6 +427,7 @@ router.post('/login', upload.none(), function (req, res) {
if(config.authorized_PNIDs.indexOf(user.pid) === -1)
throw new Error('User is not authorized to access the application');
let password_hash = await util.data.nintendoPasswordHash(password, user.pid);
console.log(password_hash)
await request.post({
url: "http://" + config.account_server_domain + "/v1/api/oauth20/access_token/generate",
headers: {
@@ -394,6 +447,7 @@ router.post('/login', upload.none(), function (req, res) {
}
else
{
console.log(body)
res.statusCode = 400;
let response = {
error_code: 400,

View File

@@ -4,6 +4,7 @@ module.exports = {
PORTAL_COMMUNITIES: require('./portal/communities'),
PORTAL_USER: require('./portal/userpage'),
PORTAL_POST: require('./portal/posts'),
PORTAL_FEED: require('./portal/feed'),
CTR_SHOW: require('./ctr/show'),
CTR_WEB: require('./ctr/web'),
CTR_COMMUNITIES: require('./ctr/communities'),

View File

@@ -2,8 +2,8 @@ var express = require('express');
var xml = require('object-to-xml');
const database = require('../../../../database');
const util = require('../../../../authentication');
const ejs = require('ejs');
var multer = require('multer');
var moment = require('moment');
var upload = multer({ dest: 'uploads/' });
var router = express.Router();
@@ -54,11 +54,13 @@ router.get('/:communityID/new', function (req, res) {
let user = await database.getUserByPID(pid);
console.log(req.params.communityID)
let community = await database.getCommunityByID(req.params.communityID.toString());
let newPosts = await database.getNewPostsByCommunity(community, 100);
let newPosts = await database.getNumberNewCommunityPostsByID(community, 5);
let totalNumPosts = await database.getTotalPostsByCommunity(community);
if(isAJAX) {
res.render('portal_community_ajax.ejs', {
// EJS variable and server-side variable
moment: moment,
community: community,
newPosts: newPosts,
totalNumPosts: totalNumPosts,
@@ -68,6 +70,7 @@ router.get('/:communityID/new', function (req, res) {
else {
res.render('portal_community.ejs', {
// EJS variable and server-side variable
moment: moment,
community: community,
newPosts: newPosts,
totalNumPosts: totalNumPosts,
@@ -91,6 +94,64 @@ router.get('/:communityID/new', function (req, res) {
});
});
router.get('/:communityID/:type/loadPosts', function (req, res) {
res.header('X-Nintendo-WhiteList','1|http,youtube.com,,2|https,youtube.com,,2|http,.youtube.com,,2|https,.youtube.com,,2|http,.ytimg.com,,2|https,.ytimg.com,,2|http,.googlevideo.com,,2|https,.googlevideo.com,,2|https,youtube.com,/embed/,6|https,youtube.com,/e/,6|https,youtube.com,/v/,6|https,www.youtube.com,/embed/,6|https,www.youtube.com,/e/,6|https,www.youtube.com,/v/,6|https,youtube.googleapis.com,/e/,6|https,youtube.googleapis.com,/v/,6|http,maps.googleapis.com,/maps/api/streetview,2|https,maps.googleapis.com,/maps/api/streetview,2|http,cbk0.google.com,/cbk,2|https,cbk0.google.com,/cbk,2|http,cbk1.google.com,/cbk,2|https,cbk1.google.com,/cbk,2|http,cbk2.google.com,/cbk,2|https,cbk2.google.com,/cbk,2|http,cbk3.google.com,/cbk,2|https,cbk3.google.com,/cbk,2|https,.cloudfront.net,,2|https,www.google-analytics.com,/,2|https,stats.g.doubleclick.net,,2|https,www.google.com,/ads/,2|https,ssl.google-analytics.com,,2|http,fonts.googleapis.com,,2|fonts.googleapis.com,,2|https,www.googletagmanager.com,,2');
database.connect().then(async e => {
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
let post = await database.getPostByID(req.query.postID);
if(pid === null)
pid = 1000000000;
let user = await database.getUserByPID(pid);
let communityMap = await util.data.getCommunityHash();
let posts;
if(post !== null)
posts = await database.getCommunityPostsAfterTimestamp(post, 1);
else {
let community = await database.getCommunityByID(req.params.communityID)
switch (req.params.type) {
case 'popular':
posts = await database.getNumberPopularCommunityPostsByID(community, 10);
break;
case 'verified':
posts = await database.getNumberVerifiedCommunityPostsByID(community, 10);
break;
default:
posts = await database.getNewPostsByCommunity(community, 10);
break;
}
}
if(posts.length > 0)
{
res.render('portal_more_posts_ajax.ejs', {
communityMap: communityMap,
moment: moment,
database: database,
user: user,
newPosts: posts,
});
}
else
{
res.sendStatus(204);
}
}).catch(error => {
console.log(error);
res.set("Content-Type", "application/xml");
res.statusCode = 400;
response = {
result: {
has_error: 1,
version: 1,
code: 400,
error_code: 15,
message: "SERVER_ERROR"
}
};
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
});
});
router.post('/follow', upload.none(), function (req, res) {
database.connect().then(async e => {
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);

View File

@@ -0,0 +1,93 @@
var express = require('express');
var xml = require('object-to-xml');
const database = require('../../../../database');
const util = require('../../../../authentication');
var multer = require('multer');
var moment = require('moment');
var upload = multer({ dest: 'uploads/' });
var router = express.Router();
router.get('/', function (req, res) {
res.sendStatus(404);
});
router.get('/loadPosts', function (req, res) {
res.header('X-Nintendo-WhiteList','1|http,youtube.com,,2|https,youtube.com,,2|http,.youtube.com,,2|https,.youtube.com,,2|http,.ytimg.com,,2|https,.ytimg.com,,2|http,.googlevideo.com,,2|https,.googlevideo.com,,2|https,youtube.com,/embed/,6|https,youtube.com,/e/,6|https,youtube.com,/v/,6|https,www.youtube.com,/embed/,6|https,www.youtube.com,/e/,6|https,www.youtube.com,/v/,6|https,youtube.googleapis.com,/e/,6|https,youtube.googleapis.com,/v/,6|http,maps.googleapis.com,/maps/api/streetview,2|https,maps.googleapis.com,/maps/api/streetview,2|http,cbk0.google.com,/cbk,2|https,cbk0.google.com,/cbk,2|http,cbk1.google.com,/cbk,2|https,cbk1.google.com,/cbk,2|http,cbk2.google.com,/cbk,2|https,cbk2.google.com,/cbk,2|http,cbk3.google.com,/cbk,2|https,cbk3.google.com,/cbk,2|https,.cloudfront.net,,2|https,www.google-analytics.com,/,2|https,stats.g.doubleclick.net,,2|https,www.google.com,/ads/,2|https,ssl.google-analytics.com,,2|http,fonts.googleapis.com,,2|fonts.googleapis.com,,2|https,www.googletagmanager.com,,2');
database.connect().then(async e => {
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
let post = await database.getPostByID(req.query.postID);
if(pid === null)
pid = 1000000000;
let user = await database.getUserByPID(pid);
let newPosts = await database.getUserPostsAfterTimestamp(post, 5);
let communityMap = await util.data.getCommunityHash();
if(newPosts.length > 0)
{
res.render('portal_more_posts_ajax.ejs', {
communityMap: communityMap,
moment: moment,
user: user,
newPosts: newPosts,
});
}
else
{
res.sendStatus(204);
}
}).catch(error => {
console.log(error);
res.set("Content-Type", "application/xml");
res.statusCode = 400;
response = {
result: {
has_error: 1,
version: 1,
code: 400,
error_code: 15,
message: "SERVER_ERROR"
}
};
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
});
});
router.post('/follow', upload.none(), function (req, res) {
database.connect().then(async e => {
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
let userToFollow = await database.getUserByPID(req.body.userID);
if(pid === null)
pid = 1000000000;
let user = await database.getUserByPID(pid);
if(req.body.type === 'true' && user !== null && user.followed_users.indexOf(userToFollow.pid) === -1)
{
userToFollow.addToFollowers(user.pid);
user.addToUsers(userToFollow.pid);
res.sendStatus(200);
}
else if(req.body.type === 'false' && user !== null && user.followed_users.indexOf(userToFollow.pid) !== -1)
{
userToFollow.removeFromFollowers(user.pid);
user.removeFromUsers(userToFollow.pid);
res.sendStatus(200);
}
else
res.sendStatus(423);
}).catch(error => {
console.log(error);
res.set("Content-Type", "application/xml");
res.statusCode = 423;
response = {
result: {
has_error: 1,
version: 1,
code: 400,
error_code: 15,
message: "SERVER_ERROR"
}
};
res.send("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xml(response));
});
});
module.exports = router;

View File

@@ -3,11 +3,9 @@ var xml = require('object-to-xml');
const database = require('../../../../database');
const util = require('../../../../authentication');
const { POST } = require('../../../../models/post');
const ejs = require('ejs');
var multer = require('multer');
var upload = multer({ dest: 'uploads/' });
const snowflake = require('node-snowflake').Snowflake;
const moment = require('moment');
var router = express.Router();
router.post('/empathy', function (req, res) {
@@ -54,7 +52,6 @@ router.post('/new', upload.none(), async function (req, res, next) {
{
let paramPackData = util.data.decodeParamPack(req.headers["x-nintendo-parampack"]);
let pid = util.data.processServiceToken(req.headers["x-nintendo-servicetoken"]);
//console.log(pid);
if(pid === null)
{
throw new Error('The User token was not valid');
@@ -62,7 +59,8 @@ router.post('/new', upload.none(), async function (req, res, next) {
else
{
let usrObj = await database.getUserByPID(pid);
const creationDate = moment().format('YYYY-MM-DD HH:MM:SS');
//let community_id = req.body.olive_title_id.substring(0, req.body.olive_title_id.indexOf(','));
let community = await database.getCommunityByID(req.body.olive_community_id);
let appData = "";
if (req.body.app_data) {
appData = req.body.app_data.replace(/\0/g, "").trim();
@@ -80,19 +78,16 @@ router.post('/new', upload.none(), async function (req, res, next) {
screenshot = req.body.screenshot.replace(/\0/g, "").trim();
}
const document = {
title_id: paramPackData.title_id,
title_id: community.title_id[0],
screen_name: usrObj.user_id,
body: req.body.body,
app_data: appData,
painting: painting,
painting_uri: paintingURI,
screenshot: screenshot,
url: req.body.url,
search_key: req.body.search_key,
topic_tag: req.body.topic_tag,
community_id: req.body.community_id,
country_id: paramPackData.country_id,
created_at: creationDate,
created_at: new Date(),
feeling_id: req.body.feeling_id,
id: snowflake.nextId(),
is_autopost: req.body.is_autopost,
@@ -107,7 +102,7 @@ router.post('/new', upload.none(), async function (req, res, next) {
};
const newPost = new POST(document);
newPost.save();
res.sendStatus(200);
res.redirect('/communities/' + community.community_id + '/new');
}
}
catch (e)

View File

@@ -2,8 +2,8 @@ var express = require('express');
var xml = require('object-to-xml');
const database = require('../../../../database');
const util = require('../../../../authentication');
const ejs = require('ejs');
var multer = require('multer');
var moment = require('moment');
var upload = multer({ dest: 'uploads/' });
var router = express.Router();
@@ -19,9 +19,12 @@ router.get('/me', function (req, res) {
let user = await database.getUserByPID(pid);
let newPosts = await database.getNumberUserPostsByID(pid, 1);
let numPosts = await database.getTotalPostsByUserID(pid);
let communityMap = await util.data.getCommunityHash();
if(isAJAX) {
res.render('portal_me_page_ajax.ejs', {
// EJS variable and server-side variable
communityMap: communityMap,
moment: moment,
user: user,
newPosts: newPosts,
numPosts: numPosts
@@ -30,6 +33,8 @@ router.get('/me', function (req, res) {
else {
res.render('portal_me_page.ejs', {
// EJS variable and server-side variable
communityMap: communityMap,
moment: moment,
user: user,
newPosts: newPosts,
numPosts: numPosts
@@ -107,11 +112,16 @@ router.get('/show', function (req, res) {
let parentUser = await database.getUserByPID(pid);
let user = await database.getUserByPID(userID);
let newPosts = await database.getNumberUserPostsByID(user.pid, 1);
if(user === null)
res.sendStatus(404);
let newPosts = await database.getNumberUserPostsByID(user.pid, 10);
let numPosts = await database.getTotalPostsByUserID(user.pid);
let communityMap = await util.data.getCommunityHash();
if(isAJAX) {
res.render('portal_user_page_ajax.ejs', {
// EJS variable and server-side variable
communityMap: communityMap,
moment: moment,
user: user,
newPosts: newPosts,
numPosts: numPosts,
@@ -121,9 +131,12 @@ router.get('/show', function (req, res) {
else {
res.render('portal_user_page.ejs', {
// EJS variable and server-side variable
communityMap: communityMap,
moment: moment,
user: user,
newPosts: newPosts,
numPosts: numPosts
numPosts: numPosts,
parentUser: parentUser
});
}
}).catch(error => {
@@ -151,14 +164,15 @@ router.get('/loadPosts', function (req, res) {
if(pid === null)
pid = 1000000000;
let user = await database.getUserByPID(pid);
let newPosts = await database.getUserPostsAfterTimestamp(post, 1);
let numPosts = await database.getNumberUserPostsByID(pid);
let newPosts = await database.getUserPostsAfterTimestamp(post, 5);
let communityMap = await util.data.getCommunityHash();
if(newPosts.length > 0)
{
res.render('portal_user_page_posts_ajax.ejs', {
res.render('portal_more_posts_ajax.ejs', {
communityMap: communityMap,
moment: moment,
user: user,
newPosts: newPosts,
numPosts: numPosts
});
}
else

View File

@@ -3,73 +3,18 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Juxt Admin Panel</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
* {
box-sizing: border-box;
}
/* Create a column layout with Flexbox */
.row {
display: flex;
}
/* Left column (menu) */
.left {
flex: 35%;
padding: 15px 0;
}
.left h2 {
padding-left: 8px;
}
/* Right column (page content) */
.right {
flex: 65%;
padding: 15px;
}
/* Style the search box */
#mySearch {
width: 100%;
font-size: 18px;
padding: 11px;
border: 1px solid #ddd;
}
/* Style the navigation menu inside the left column */
#myMenu {
list-style-type: none;
padding: 0;
margin: 0;
}
#myMenu li a {
padding: 12px;
text-decoration: none;
color: black;
display: block
}
#myMenu li a:hover {
background-color: #eee;
}
</style>
<link rel="stylesheet" type="text/css" href="/css/juxt.css">
</head>
<body>
<h2 style="display: inline-block">Juxt Admin Panel - <%= user.user_id %></h2> <img style="width: 57px; display: inline-block; position: absolute; right: 8px;" src="<%= user.pfp_uri %>">
<h2 style="display: inline-block; margin-left: 20px">Juxt Admin Panel - <%= user.user_id %></h2> <img style="width: 57px; display: inline-block; position: absolute; right: 8px;" src="<%= user.pfp_uri %>">
<div class="row">
<div class="left" style="background-color:#bbb;max-width: 10%;">
<ul id="myMenu">
<li><a href="/">Home</a></li>
<li><a href="/communities">Communities</a></li>
<li><a href="/posts">Posts</a></li>
<li><a href="/audit">Audit Log</a></li>
<li><a href="/users">Users</a></li>
<li><a href="/discovery">Discovery</a></li>
</ul>
@@ -222,4 +167,4 @@
</script>
</body>
</html>
</html>

View File

@@ -80,47 +80,26 @@
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<%if(post.screenshot !== '' && post.painting === '' && post.url === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
</div>
<% } else if(post.painting !== '' && post.screenshot === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.screenshot === '' && post.painting === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<% } else if(post.body !== '' && post.screenshot === '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<div class="community-page-post-wrapper">
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
<h3><%= post.body %></h3>
</div>
<% } else if(post.screenshot !== '' && post.body !== '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.screenshot !== '' && post.painting !== '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.body !== '' && post.screenshot === '' && post.painting === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.url !== '' && post.painting !== '' && post.screenshot === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<%}%>
<%} else { %>
<% if(post.screenshot !== '') { %>
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<%}%>
<% if(post.painting !== '') { %>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
<%}%>
<% if(post.url) { %>
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<%}%>
<% if(post.body) { %>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
<%}%>
<%}%>
</div>
<br>
<br>
<% }); %>

View File

@@ -3,73 +3,18 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Juxt Admin Panel</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
* {
box-sizing: border-box;
}
/* Create a column layout with Flexbox */
.row {
display: flex;
}
/* Left column (menu) */
.left {
flex: 35%;
padding: 15px 0;
}
.left h2 {
padding-left: 8px;
}
/* Right column (page content) */
.right {
flex: 65%;
padding: 15px;
}
/* Style the search box */
#mySearch {
width: 100%;
font-size: 18px;
padding: 11px;
border: 1px solid #ddd;
}
/* Style the navigation menu inside the left column */
#myMenu {
list-style-type: none;
padding: 0;
margin: 0;
}
#myMenu li a {
padding: 12px;
text-decoration: none;
color: black;
display: block
}
#myMenu li a:hover {
background-color: #eee;
}
</style>
<link rel="stylesheet" type="text/css" href="/css/juxt.css">
</head>
<body>
<h2 style="display: inline-block">Juxt Admin Panel - <%= user.user_id %></h2> <img style="width: 57px; display: inline-block; position: absolute; right: 8px;" src="<%= user.pfp_uri %>">
<h2 style="display: inline-block; margin-left: 20px">Juxt Admin Panel - <%= user.user_id %></h2> <img style="width: 57px; display: inline-block; position: absolute; right: 8px;" src="<%= user.pfp_uri %>">
<div class="row">
<div class="left" style="background-color:#bbb;max-width: 10%;">
<ul id="myMenu">
<li><a href="/">Home</a></li>
<li><a href="/communities">Communities</a></li>
<li><a href="/posts">Posts</a></li>
<li><a href="/audit">Audit Log</a></li>
<li><a href="/users">Users</a></li>
<li><a href="/discovery">Discovery</a></li>
</ul>

View File

@@ -31,36 +31,95 @@
</menu>
<div id="main">
<div id="windowOverlay" class="overlay" style="margin-bottom: 0">
<div class="overlay-content">
<div class="overlay-content" style="position: fixed">
<div id="post-window" class="post-wrapper">
<!--Start of Main Post-->
<form action="/users/me" method="post" enctype="multipart/form-data">
<form class="post-emotion-radio" action="/posts/new" method="post" enctype="multipart/form-data">
<table>
<tr>
<td colspan="2">
<h1 class="communities-header" style="padding-left: 75px; padding-top: 10px">Post to <%= community.name %></h1>
<h1 class="communities-header" style="padding-left: 50px; padding-top: 10px">Post to <%= community.name %></h1>
</td>
</tr>
<tr>
<td>
<div class="post-type-button-text">T</div>
<img class="post-user-icon" src="<%= user.pfp_uri %>">
</td>
<td style="padding-left: 75px;" rowspan="2">
<textarea id="comment" name="comment" placeholder="Tap here to make a post." style="margin-bottom: 0; height: 200px" maxlength="300" rows="4" cols="50" onchange="if(wiiuFilter.checkWord(this.value) === -2) { this.value = ''; alert('Prost cannot contain explicit language');}"></textarea>
<td>
<div class="post-emotions-wrapper">
<label for="post-emotion-0">
<input type="radio" name="emotion" id="post-emotion-0" checked>
<span class="post-emotion-0"></span>
</label>
<label for="post-emotion-1">
<input type="radio" name="emotion" id="post-emotion-1">
<span class="post-emotion-1"></span>
</label>
<label for="post-emotion-2">
<input type="radio" name="emotion" id="post-emotion-2">
<span class="post-emotion-2"></span>
</label>
<label for="post-emotion-3">
<input type="radio" name="emotion" id="post-emotion-3">
<span class="post-emotion-3"></span>
</label>
<label for="post-emotion-4">
<input type="radio" name="emotion" id="post-emotion-4">
<span class="post-emotion-4"></span>
</label>
<label for="post-emotion-5">
<input type="radio" name="emotion" id="post-emotion-5">
<span class="post-emotion-5"></span>
</label>
</div>
<div class="post-emotions-arrow-left"></div>
</td>
<td>
<div class="post-screenshot-picker" onclick="loadScreenshots()">
<div class="post-screenshot-picker-icon"></div>
<div class="post-screenshot-picker-dropdown">
<div><img src="" class="post-screenshot-preview" id="post-top-screen-preview" onclick="document.getElementById('screenshot-value').value = wiiuMainApplication.getScreenShot(true); loadScreenshots()"></div>
<div><img src="" class="post-screenshot-preview" id="post-bottom-screen-preview" onclick="document.getElementById('screenshot-value').value = wiiuMainApplication.getScreenShot(false); loadScreenshots()"></div>
<div><button onclick="document.getElementById('screenshot-value').value = ''; loadScreenshots()">No Screenshot</button></div>
<input type="hidden" id="screenshot-value" name="screenshot-value" value="">
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="post-type-button-text selected" onclick="swapPostType(0)"></div>
</td>
<td rowspan="2" id="post-text-input">
<textarea class="post-textarea" id="comment" name="comment" placeholder="Tap here to make a post." rows="4" cols="50" onchange="if(wiiuFilter.checkWord(this.value) === -2) { this.value = ''; alert('Prost cannot contain explicit language');}"></textarea>
</td>
<td rowspan="2" id="post-painting-input" style="display: none;">
<div class="post-memo">
<img class="post-memo-preview" id="memo" width="640px" height="240px" src="" style="display: none;" onclick="newPainting(false)">
<input type="hidden" id="memo-value" name="memo-value" value="">
</div>
</td>
<br>
</tr>
<tr>
<td>
<div class="post-type-button-painting">P</div>
<div class="post-type-button-painting" onclick="swapPostType(1);newPainting(false)"></div>
</td>
</tr>
<tr>
<td colspan="2">
<label class="checkbox-container checkbox-post">Spoilers
<input type="checkbox" id="spoiler" name="spoiler" value="true" onclick="wiiuSound.playSoundByName('SE_WAVE_MENU', 1);">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td class="post-close-button-wrapper" colspan="2">
<div class="post-close-button" onclick="hideNewPostScreen()" ></div>
<div class="post-close-button" onclick="hideNewPostScreen();wiiuMemo.reset();" ></div>
</td>
<td>
<input type="submit" value="Submit" class="submit-button" style="margin-left: -124px;" onclick="wiiuSound.playSoundByName('SE_WAVE_MENU', 1);wiiuSound.playSoundByName('BGM_OLV_MAIN_LOOP_NOWAIT', 3);">
<input type="submit" value="Post" class="submit-button" style="margin-left: -124px;" onclick="wiiuSound.playSoundByName('SE_WAVE_MENU', 1);wiiuSound.playSoundByName('BGM_OLV_MAIN_LOOP_NOWAIT', 3);">
</td>
</tr>
</table>
@@ -79,11 +138,11 @@
<div class="community-page-info-container">
<%if(user.followed_communities.indexOf(community.id) !== -1){ %>
<div class="community-page-follow-button-wrapper selected">
<p class="community-page-follow-button-text" id="<%= community.id %>" onclick="followCommunity(this)" style="color: #FFFFFF">Following</p>
<p class="community-page-follow-button-text" id="<%= community.community_id %>" onclick="followCommunity(this)" style="color: #FFFFFF">Following</p>
</div>
<%} else {%>
<div class="community-page-follow-button-wrapper" <%if(user.pid === 1000000000) {%> style="display: none" <%}%>>
<p class="community-page-follow-button-text" id="<%= community.id %>" onclick="followCommunity(this)">Follow Community</p>
<p class="community-page-follow-button-text" id="<%= community.community_id %>" onclick="followCommunity(this)">Follow Community</p>
</div>
<%}%>
<img class="community-page-info-icon" src="<%= community.browser_icon %>">
@@ -131,67 +190,51 @@
</tr>
</tbody>
</table>
<% newPosts.forEach(function(post) { %>
<div class="post-user-info-wrapper">
<%if(post.verified) {%>
<img class="community-page-post-user-icon verified" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%=post.pid%>)">
<span class="community-page-verified-user-badge community-page-verified" style=""></span>
<%} else {%>
<img class="community-page-post-user-icon" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%=post.pid%>)">
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username" onclick="loadUserProfile(<%=post.pid%>)"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
<div id="community-posts-inner-body">
<% if(totalNumPosts === 0) {%>
<p>No Posts</p>
<%} else { %>
<button id="load-more-posts-button" onclick="loadCommunityPosts()">Load More Posts</button>
<% newPosts.forEach(function(post) { %>
<div class="post-user-info-wrapper" id="<%= post.id %>">
<%if(post.verified) {%>
<img class="community-page-post-user-icon verified" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%= post.pid %>)">
<span class="community-page-verified-user-badge community-page-verified" style=""></span>
<%} else {%>
<img class="community-page-post-user-icon" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%= post.pid %>)">
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username" onclick="loadUserProfile(<%= post.pid %>)"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= moment(post.created_at).fromNow() %> - <%= community.name %></h4>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>" >
<div class="community-page-post-yeah-button" <%if(user.pid !== 1000000000) {%> onclick="yeah(this.parentNode, <%= post.id %>)" <%}%>></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<div class="community-page-post-wrapper">
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
<h3><%= post.body %></h3>
<%} else { %>
<% if(post.screenshot !== '') { %>
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<%}%>
<% if(post.painting !== '') { %>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
<%}%>
<% if(post.url) { %>
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<%}%>
<% if(post.body) { %>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
<%}%>
<%}%>
</div>
<% }); %>
<%}%>
</div>
<%if(post.screenshot !== '' && post.painting === '' && post.url === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
</div>
<% } else if(post.painting !== '' && post.screenshot === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.screenshot === '' && post.painting === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<% } else if(post.body !== '' && post.screenshot === '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<h3><%= post.body %></h3>
</div>
<% } else if(post.screenshot !== '' && post.body !== '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.screenshot !== '' && post.painting !== '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.body !== '' && post.screenshot === '' && post.painting === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.url !== '' && post.painting !== '' && post.screenshot === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<%}%>
<br>
<br>
<% }); %>
</div>
</div>
<br>

View File

@@ -1,34 +1,98 @@
<div id="windowOverlay" class="overlay" style="margin-bottom: 0">
<div class="overlay-content">
<div class="overlay-content" style="position: fixed">
<div id="post-window" class="post-wrapper">
<!--Start of Main Post-->
<form action="/users/me" method="post" enctype="multipart/form-data">
<form class="post-emotion-radio" action="/posts/new" method="post" enctype="multipart/form-data">
<table>
<tr>
<td colspan="2">
<h1 class="communities-header" style="padding-left: 75px; padding-top: 10px">Post to <%= community.name %></h1>
<h1 class="communities-header" style="padding-left: 50px; padding-top: 10px">Post to <%= community.name %></h1>
</td>
</tr>
<tr>
<td>
<div class="post-type-button-text">T</div>
<img class="post-user-icon" src="<%= user.pfp_uri %>">
<input type="hidden" id="olive_title_id" name="olive_title_id" value="<%= community.title_id[0] %>">
<input type="hidden" id="olive_community_id" name="olive_community_id" value="<%= community.community_id %>">
<input type="hidden" id="_post_type" name="_post_type" value="body">
</td>
<td style="padding-left: 75px;" rowspan="2">
<textarea id="comment" name="comment" placeholder="Tap here to make a post." style="margin-bottom: 0; height: 200px" maxlength="300" rows="4" cols="50" onchange="if(wiiuFilter.checkWord(this.value) === -2) { this.value = ''; alert('Prost cannot contain explicit language');}"></textarea>
<td>
<div class="post-emotions-wrapper">
<label for="post-emotion-0">
<input type="radio" name="emotion" id="post-emotion-0" value="0" checked>
<span class="post-emotion-0"></span>
</label>
<label for="post-emotion-1">
<input type="radio" name="emotion" id="post-emotion-1" value="1">
<span class="post-emotion-1"></span>
</label>
<label for="post-emotion-2">
<input type="radio" name="emotion" id="post-emotion-2" value="2">
<span class="post-emotion-2"></span>
</label>
<label for="post-emotion-3">
<input type="radio" name="emotion" id="post-emotion-3" value="3">
<span class="post-emotion-3"></span>
</label>
<label for="post-emotion-4">
<input type="radio" name="emotion" id="post-emotion-4" value="4">
<span class="post-emotion-4"></span>
</label>
<label for="post-emotion-5">
<input type="radio" name="emotion" id="post-emotion-5" value="5">
<span class="post-emotion-5"></span>
</label>
</div>
<div class="post-emotions-arrow-left"></div>
</td>
<td>
<td>
<div class="post-screenshot-picker" onclick="loadScreenshots()">
<div class="post-screenshot-picker-icon"></div>
<div class="post-screenshot-picker-dropdown">
<div><img src="" class="post-screenshot-preview" id="post-top-screen-preview" onclick="document.getElementById('screenshot-value').value = wiiuMainApplication.getScreenShot(true);"></div>
<div><img src="" class="post-screenshot-preview" id="post-bottom-screen-preview" onclick="document.getElementById('screenshot-value').value = wiiuMainApplication.getScreenShot(false);"></div>
<div onclick="document.getElementById('screenshot-value').value = ''; loadScreenshots()">No Screenshot</div>
<input type="hidden" id="screenshot-value" name="screenshot" value="">
</div>
</div>
</td>
</td>
</tr>
<tr>
<td>
<div class="post-type-button-text selected" onclick="swapPostType(0)"></div>
</td>
<td rowspan="2" id="post-text-input">
<textarea class="post-textarea" id="comment" name="body" placeholder="Tap here to make a post." rows="4" cols="50" onchange="if(wiiuFilter.checkWord(this.value) === -2) { this.value = ''; alert('Prost cannot contain explicit language');}"></textarea>
</td>
<td rowspan="2" id="post-painting-input" style="display: none;">
<div class="post-memo">
<img class="post-memo-preview" id="memo" width="640px" height="240px" src="" style="display: none;" onclick="newPainting(false)">
<input type="hidden" id="memo-value" name="painting" value="">
</div>
</td>
<br>
</tr>
<tr>
<td>
<div class="post-type-button-painting">P</div>
<div class="post-type-button-painting" onclick="swapPostType(1);newPainting(false)"></div>
</td>
</tr>
<tr>
<td colspan="2">
<label class="checkbox-container checkbox-post">Spoilers
<input type="checkbox" id="spoiler" name="spoiler" value="true" onclick="wiiuSound.playSoundByName('SE_WAVE_MENU', 1);">
<span class="checkmark"></span>
</label>
</td>
</tr>
<tr>
<td class="post-close-button-wrapper" colspan="2">
<div class="post-close-button" onclick="hideNewPostScreen()" ></div>
<div class="post-close-button" onclick="hideNewPostScreen();wiiuMemo.reset();" ></div>
</td>
<td>
<input type="submit" value="Submit" class="submit-button" style="margin-left: -124px;" onclick="wiiuSound.playSoundByName('SE_WAVE_MENU', 1);wiiuSound.playSoundByName('BGM_OLV_MAIN_LOOP_NOWAIT', 3);">
<input type="submit" value="Post" class="submit-button" style="margin-left: -124px;" onclick="wiiuSound.playSoundByName('SE_WAVE_MENU', 1);wiiuSound.playSoundByName('BGM_OLV_MAIN_LOOP_NOWAIT', 3);">
</td>
</tr>
</table>
@@ -47,11 +111,11 @@
<div class="community-page-info-container">
<%if(user.followed_communities.indexOf(community.id) !== -1){ %>
<div class="community-page-follow-button-wrapper selected">
<p class="community-page-follow-button-text" id="<%= community.id %>" onclick="followCommunity(this)" style="color: #FFFFFF">Following</p>
<p class="community-page-follow-button-text" id="<%= community.community_id %>" onclick="followCommunity(this)" style="color: #FFFFFF">Following</p>
</div>
<%} else {%>
<div class="community-page-follow-button-wrapper" <%if(user.pid === 1000000000) {%> style="display: none" <%}%>>
<p class="community-page-follow-button-text" id="<%= community.id %>" onclick="followCommunity(this)">Follow Community</p>
<p class="community-page-follow-button-text" id="<%= community.community_id %>" onclick="followCommunity(this)">Follow Community</p>
</div>
<%}%>
<img class="community-page-info-icon" src="<%= community.browser_icon %>">
@@ -99,67 +163,51 @@
</tr>
</tbody>
</table>
<% newPosts.forEach(function(post) { %>
<div class="post-user-info-wrapper">
<%if(post.verified) {%>
<img class="community-page-post-user-icon verified" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%=post.pid%>)">
<span class="community-page-verified-user-badge community-page-verified" style=""></span>
<%} else {%>
<img class="community-page-post-user-icon" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%=post.pid%>)">
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username" onclick="loadUserProfile(<%=post.pid%>)"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
<div id="community-posts-inner-body">
<% if(totalNumPosts === 0) {%>
<p>No Posts</p>
<%} else { %>
<button id="load-more-posts-button" onclick="loadCommunityPosts()">Load More Posts</button>
<% newPosts.forEach(function(post) { %>
<div class="post-user-info-wrapper" id="<%= post.id %>">
<%if(post.verified) {%>
<img class="community-page-post-user-icon verified" src="<%= post.mii_face_url %>">
<span class="community-page-verified-user-badge community-page-verified" style=""></span>
<%} else {%>
<img class="community-page-post-user-icon" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%= post.pid %>)">
<span class="community-page-verified-user-badge community-page-verified" style="display: none;" onclick="loadUserProfile(<%= post.pid %>)"></span>
<%}%>
<h2 class="community-page-post-username" onclick="loadUserProfile(<%= post.pid %>)"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= moment(post.created_at).fromNow() %> - <%= community.name %></h4>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>" >
<div class="community-page-post-yeah-button" <%if(user.pid !== 1000000000) {%> onclick="yeah(this.parentNode, <%= post.id %>)" <%}%>></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<div class="community-page-post-wrapper">
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
<h3><%= post.body %></h3>
<%} else { %>
<% if(post.screenshot !== '') { %>
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<%}%>
<% if(post.painting !== '') { %>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
<%}%>
<% if(post.url) { %>
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<%}%>
<% if(post.body) { %>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
<%}%>
<%}%>
</div>
<% }); %>
<%}%>
</div>
<%if(post.screenshot !== '' && post.painting === '' && post.url === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
</div>
<% } else if(post.painting !== '' && post.screenshot === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.screenshot === '' && post.painting === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<% } else if(post.body !== '' && post.screenshot === '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<h3><%= post.body %></h3>
</div>
<% } else if(post.screenshot !== '' && post.body !== '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.screenshot !== '' && post.painting !== '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.body !== '' && post.screenshot === '' && post.painting === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.url !== '' && post.painting !== '' && post.screenshot === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<%}%>
<br>
<br>
<% }); %>
</div>
<br>
<img src="" onerror="wiiuBrowser.showLoadingIcon(!1)">

View File

@@ -23,7 +23,7 @@
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
<h4 class="community-page-post-time-stamp"><%= moment(post.created_at).fromNow() %></h4>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>

View File

@@ -198,54 +198,33 @@
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
<h4 class="community-page-post-time-stamp"><%= moment(post.created_at).fromNow()%> - <%= communityMap.get(post.title_id) %></h4>
<div class="community-page-post-yeah-button-wrapper">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<%if(post.screenshot !== '' && post.painting === '' && post.url === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
</div>
<% } else if(post.painting !== '' && post.screenshot === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.screenshot === '' && post.painting === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<% } else if(post.body !== '' && post.screenshot === '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<h3><%= post.body %></h3>
</div>
<% } else if(post.screenshot !== '' && post.body !== '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<div class="community-page-post-text-overlay">
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
<h3><%= post.body %></h3>
</div>
<%} else { %>
<% if(post.screenshot !== '') { %>
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<%}%>
<% if(post.painting !== '') { %>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
<%}%>
<% if(post.url) { %>
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<%}%>
<% if(post.body) { %>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
<%}%>
<%}%>
</div>
<% } else if(post.screenshot !== '' && post.painting !== '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.body !== '' && post.screenshot === '' && post.painting === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.url !== '' && post.painting !== '' && post.screenshot === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<%}%>
<% }); %>
<%}%>
</div>

View File

@@ -166,54 +166,33 @@
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
<h4 class="community-page-post-time-stamp"><%= moment(post.created_at).fromNow() %> - <%= communityMap.get(post.title_id) %></h4>
<div class="community-page-post-yeah-button-wrapper">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<%if(post.screenshot !== '' && post.painting === '' && post.url === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
</div>
<% } else if(post.painting !== '' && post.screenshot === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.screenshot === '' && post.painting === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<% } else if(post.body !== '' && post.screenshot === '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<h3><%= post.body %></h3>
</div>
<% } else if(post.screenshot !== '' && post.body !== '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<div class="community-page-post-text-overlay">
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
<h3><%= post.body %></h3>
</div>
<%} else { %>
<% if(post.screenshot !== '') { %>
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<%}%>
<% if(post.painting !== '') { %>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
<%}%>
<% if(post.url) { %>
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<%}%>
<% if(post.body) { %>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
<%}%>
<%}%>
</div>
<% } else if(post.screenshot !== '' && post.painting !== '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.body !== '' && post.screenshot === '' && post.painting === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.url !== '' && post.painting !== '' && post.screenshot === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<%}%>
<% }); %>
<%}%>
</div>

View File

@@ -0,0 +1,38 @@
<% newPosts.forEach(function(post) { %>
<div class="post-user-info-wrapper" id="<%= post.id %>">
<%if(post.verified) {%>
<img class="community-page-post-user-icon verified" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%= post.pid %>)">
<span class="community-page-verified-user-badge community-page-verified" style=""></span>
<%} else {%>
<img class="community-page-post-user-icon" src="<%= post.mii_face_url %>" onclick="loadUserProfile(<%= post.pid %>)">
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username" onclick="loadUserProfile(<%= post.pid %>)"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= moment(post.created_at).fromNow() %> - <%= communityMap.get(post.title_id) %></h4>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<div class="community-page-post-wrapper">
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
<h3><%= post.body %></h3>
<%} else { %>
<% if(post.screenshot !== '') { %>
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<%}%>
<% if(post.painting !== '') { %>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
<%}%>
<% if(post.url) { %>
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<%}%>
<% if(post.body) { %>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
<%}%>
<%}%>
</div>
<% }); %>

View File

@@ -44,7 +44,7 @@
<tr>
<% for(var i = 0; i < popularCommunities.length; i++) {%>
<td>
<div class="community-list-wrapper" onclick="loadCommunityPage('<%= popularCommunities[i].id %>')">
<div class="community-list-wrapper" onclick="loadCommunityPage('<%= popularCommunities[i].community_id %>')">
<img class="community-list-icon" src="<%= popularCommunities[i].browser_icon %>">
<h2 class="community-list-title"><%= popularCommunities[i].name %></h2>
<h4 class="community-list-followers"><%= popularCommunities[i].followers %> followers</h4>
@@ -66,7 +66,7 @@
<tr>
<% for(var j = 0; j < newCommunities.length; j++) {%>
<td>
<div class="community-list-wrapper" onclick="loadCommunityPage('<%= newCommunities[j].id %>')">
<div class="community-list-wrapper" onclick="loadCommunityPage('<%= newCommunities[j].community_id %>')">
<img class="community-list-icon" src="<%= newCommunities[j].browser_icon %>">
<h2 class="community-list-title"><%= newCommunities[j].name %></h2>
<h4 class="community-list-followers"><%= newCommunities[j].followers %> followers</h4>

View File

@@ -136,54 +136,33 @@
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
<h4 class="community-page-post-time-stamp"><%= post.created_at %> - <%= communityMap.get(post.title_id) %></h4>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<%if(post.screenshot !== '' && post.painting === '' && post.url === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
</div>
<% } else if(post.painting !== '' && post.screenshot === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.screenshot === '' && post.painting === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<% } else if(post.body !== '' && post.screenshot === '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<h3><%= post.body %></h3>
</div>
<% } else if(post.screenshot !== '' && post.body !== '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
<div class="community-page-post-wrapper">
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
<h3><%= post.body %></h3>
<%} else { %>
<% if(post.screenshot !== '') { %>
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<%}%>
<% if(post.painting !== '') { %>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
<%}%>
<% if(post.url) { %>
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<%}%>
<% if(post.body) { %>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
<%}%>
<%}%>
</div>
</div>
<% } else if(post.screenshot !== '' && post.painting !== '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.body !== '' && post.screenshot === '' && post.painting === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.url !== '' && post.painting !== '' && post.screenshot === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<%}%>
<% }); %>
<%}%>
</div>

View File

@@ -104,54 +104,33 @@
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
<h4 class="community-page-post-time-stamp"><%= post.created_at %> - <%= communityMap.get(post.title_id) %></h4>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<%if(post.screenshot !== '' && post.painting === '' && post.url === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
</div>
<% } else if(post.painting !== '' && post.screenshot === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.screenshot === '' && post.painting === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<% } else if(post.body !== '' && post.screenshot === '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<h3><%= post.body %></h3>
</div>
<% } else if(post.screenshot !== '' && post.body !== '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<div class="community-page-post-text-overlay">
<% if(post.body !== '' && post.painting === '' && post.screenshot === '' && !post.url) { %>
<h3><%= post.body %></h3>
</div>
<%} else { %>
<% if(post.screenshot !== '') { %>
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<%}%>
<% if(post.painting !== '') { %>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
<%}%>
<% if(post.url) { %>
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<%}%>
<% if(post.body) { %>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
<%}%>
<%}%>
</div>
<% } else if(post.screenshot !== '' && post.painting !== '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.body !== '' && post.screenshot === '' && post.painting === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.url !== '' && post.painting !== '' && post.screenshot === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<%}%>
<% }); %>
<%}%>
</div>

View File

@@ -1,59 +0,0 @@
<% newPosts.forEach(function(post) { %>
<div class="post-user-info-wrapper" id="<%= post.id %>">
<%if(post.verified) {%>
<img class="community-page-post-user-icon verified" src="<%= post.mii_face_url %>">
<span class="community-page-verified-user-badge community-page-verified" style=""></span>
<%} else {%>
<img class="community-page-post-user-icon" src="<%= post.mii_face_url %>">
<span class="community-page-verified-user-badge community-page-verified" style="display: none;"></span>
<%}%>
<h2 class="community-page-post-username"><%= post.screen_name %></h2>
<h4 class="community-page-post-time-stamp"><%= post.created_at %></h4>
<div class="community-page-post-yeah-button-wrapper <%if(user.likes.indexOf(post.id) !== -1){ %> selected <%}%>">
<div class="community-page-post-yeah-button" onclick="yeah(this.parentNode, <%= post.id %>)"></div>
</div>
<div id="yeah-<%= post.id %>" class="community-page-post-yeah-count"><%= post.empathy_count %> Yeahs</div>
</div>
<%if(post.screenshot !== '' && post.painting === '' && post.url === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
</div>
<% } else if(post.painting !== '' && post.screenshot === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.screenshot === '' && post.painting === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
<% } else if(post.body !== '' && post.screenshot === '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<h3><%= post.body %></h3>
</div>
<% } else if(post.screenshot !== '' && post.body !== '' && post.painting === '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.screenshot !== '' && post.painting !== '' && post.url === '') {%>
<div class="community-page-post-wrapper">
<img id="<%= post.id %>" class="community-page-post-screenshot" src="data:image/png;base64,<%= post.screenshot %>">
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<% } else if(post.url !== '' && post.body !== '' && post.screenshot === '' && post.painting === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<div class="community-page-post-text-overlay">
<h3><%= post.body %></h3>
</div>
</div>
<% } else if(post.url !== '' && post.painting !== '' && post.screenshot === '' && post.body === '') {%>
<div class="community-page-post-wrapper">
<iframe width="760" height="427.5" src="<%= post.url %>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<img id="<%= post.id%>" class="community-page-post-painting" src="<%= post.painting_uri %>">
</div>
<%}%>
<% }); %>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long