real initial commit
This commit is contained in:
parent
26ffa901f8
commit
c1b132e8af
@ -1,29 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
const Controllers = module.exports;
|
||||
|
||||
const accountHelpers = require.main.require('./src/controllers/accounts/helpers');
|
||||
const helpers = require.main.require('./src/controllers/helpers');
|
||||
|
||||
const Controllers = module.exports;
|
||||
|
||||
Controllers.renderAdminPage = (req, res) => {
|
||||
res.render('admin/plugins/theme-quickstart', {
|
||||
title: 'Quick Start Theme',
|
||||
res.render('admin/plugins/persona', {
|
||||
title: 'Persona Theme',
|
||||
});
|
||||
};
|
||||
|
||||
Controllers.renderThemeSettings = async (req, res, next) => {
|
||||
const userData = await accountHelpers.getUserDataByUserSlug(req.params.userslug, req.uid, req.query);
|
||||
if (!userData) {
|
||||
return next();
|
||||
}
|
||||
const lib = require('./theme');
|
||||
userData.theme = await lib.loadThemeConfig(userData.uid);
|
||||
|
||||
userData.title = '[[themes/harmony:settings.title]]';
|
||||
userData.breadcrumbs = helpers.buildBreadcrumbs([
|
||||
{ text: userData.username, url: `/user/${userData.userslug}` },
|
||||
{ text: '[[themes/harmony:settings.title]]' },
|
||||
]);
|
||||
|
||||
res.render('account/theme', userData);
|
||||
};
|
||||
};
|
24
templates/admin/plugins/persona.tpl
Normal file
24
templates/admin/plugins/persona.tpl
Normal file
@ -0,0 +1,24 @@
|
||||
<div class="acp-page-container">
|
||||
<!-- IMPORT admin/partials/settings/header.tpl -->
|
||||
|
||||
<div class="row m-0">
|
||||
<div id="spy-container" class="col-12 col-md-8 px-0 mb-4" tabindex="0">
|
||||
<form role="form" class="persona-settings">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="hideSubCategories" name="hideSubCategories">
|
||||
<label class="form-check-label">Hide subcategories on categories view</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="hideCategoryLastPost" name="hideCategoryLastPost">
|
||||
<label class="form-check-label">Hide last post on categories view</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="enableQuickReply" name="enableQuickReply">
|
||||
<label class="form-check-label">Enable quick reply</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- IMPORT admin/partials/settings/toc.tpl -->
|
||||
</div>
|
||||
</div>
|
130
templates/header.tpl
Normal file
130
templates/header.tpl
Normal file
@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{function.localeToHTML, userLang, defaultLang}" {{{if languageDirection}}}data-dir="{languageDirection}" style="direction: {languageDirection};"{{{end}}}>
|
||||
<head>
|
||||
<title>{browserTitle}</title>
|
||||
{{{each metaTags}}}{function.buildMetaTag}{{{end}}}
|
||||
<link rel="stylesheet" type="text/css" href="{relative_path}/assets/client{{{if bootswatchSkin}}}-{bootswatchSkin}{{{end}}}{{{ if (languageDirection=="rtl") }}}-rtl{{{ end }}}.css?{config.cache-buster}" />
|
||||
{{{each linkTags}}}{function.buildLinkTag}{{{end}}}
|
||||
|
||||
<script>
|
||||
var config = JSON.parse('{{configJSON}}');
|
||||
var app = {
|
||||
user: JSON.parse('{{userJSON}}')
|
||||
};
|
||||
|
||||
document.documentElement.style.setProperty('--panel-offset', `${localStorage.getItem('panelOffset') || 0}px`);
|
||||
</script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.1.min.js"></script>
|
||||
<script>
|
||||
var config = JSON.parse('{{configJSON}}');
|
||||
var app = {
|
||||
user: JSON.parse('{{userJSON}}')
|
||||
};
|
||||
fetch('/frames/totals').then((res) => {
|
||||
return res.json()
|
||||
}).then((obj) => {
|
||||
document.getElementById("sss").innerText = obj.stories;
|
||||
document.getElementById("aaa").innerText = obj.authors;
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$(".navbar-burger").click(function() {
|
||||
$(".navbar-burger").toggleClass("is-active");
|
||||
$(".navbar-menu").toggleClass("is-active");
|
||||
})
|
||||
|
||||
$('.has-dropdown > .navbar-link').click(function() {
|
||||
$('.navbar-dropdown').toggle()
|
||||
})
|
||||
})
|
||||
$(document).mouseup(function(e) {
|
||||
var container = $(".navbar-menu, .navbar-burger, .navbar-burger > span");
|
||||
if (!container.is(e.target) && container.has(e.target).length === 0) {
|
||||
$(".navbar-burger").removeClass("is-active");
|
||||
$(".navbar-menu").removeClass("is-active");
|
||||
}
|
||||
});
|
||||
|
||||
document.documentElement.style.setProperty('--panel-offset', `${localStorage.getItem('panelOffset') || 0}px`);
|
||||
</script>
|
||||
{{{if useCustomHTML}}}
|
||||
{{customHTML}}
|
||||
{{{end}}}
|
||||
{{{if useCustomCSS}}}
|
||||
<style>{{customCSS}}</style>
|
||||
{{{end}}}
|
||||
</head>
|
||||
|
||||
<body class="{bodyClass} skin-{{{if bootswatchSkin}}}{bootswatchSkin}{{{else}}}noskin{{{end}}}">
|
||||
<nav id="menu" class="slideout-menu hidden">
|
||||
<!-- IMPORT partials/slideout-menu.tpl -->
|
||||
</nav>
|
||||
<nav id="chats-menu" class="slideout-menu hidden">
|
||||
<!-- IMPORT partials/chats-menu.tpl -->
|
||||
</nav>
|
||||
|
||||
<main id="panel" class="slideout-panel">
|
||||
<div id="navstufz">
|
||||
<nav class="navbar container is-fluid pb-4">
|
||||
<div class="sitetitle navbar-brand">Rockfic</div>
|
||||
<div id="sitesubtitle" class="is-flex">
|
||||
<div class="subtitle is-5 m-0"> — Band fiction that rocks</div>
|
||||
<div class="content is-small">With <div id="sss" style="display: inline-block">0</div> stories by <div id="aaa" style="display: inline-block"></div> authors</div>
|
||||
</div>
|
||||
<div class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="/">Home</a>
|
||||
<a class="navbar-item" href="/bands">Bands</a>
|
||||
<a class="navbar-item" href="/authors">Authors</a>
|
||||
<a class="navbar-item" href="/forum">Message Board</a>
|
||||
<!-- IF config.loggedIn -->
|
||||
{{{ if config.loggedIn }}}
|
||||
<div class="navbar-item has-dropdown is-hoverable">
|
||||
<a class="navbar-link">Your Stuff</a>
|
||||
<div class="navbar-dropdown">
|
||||
<a class="navbar-item" href="/my-stuff">Account</a>
|
||||
<a class="navbar-item" href="/messages">
|
||||
Private Messages
|
||||
</a>
|
||||
<a class="navbar-item" href="/my-stuff/reviews">Manage Reviews</a>
|
||||
<a class="navbar-item" href="/my-stuff/profile">Edit Profile</a>
|
||||
<a class="navbar-item" href="/user/{user.remoteId}">View Profile</a>
|
||||
<a class="navbar-item" href="/my-stuff/stories">Stories</a>
|
||||
<a class="navbar-item" href="/my-stuff/drafts">Drafts</a>
|
||||
<!--IF isAdmin -->
|
||||
{{{if isAdmin}}}
|
||||
<hr class="navbar-divider">
|
||||
<a class="navbar-item" href="/admin">Admin page</a>
|
||||
{{{end}}}
|
||||
<!-- ENDIF isAdmin-->
|
||||
</div>
|
||||
</div>
|
||||
<a class="navbar-item" href="/logout">Log Out</a>
|
||||
{{{else}}}
|
||||
<a class="navbar-item button is-light mr-3" href="/login">Log In</a>
|
||||
<a class="navbar-item button is-primary" href="/register">Register!</a>
|
||||
{{{end}}}
|
||||
</div>
|
||||
<div id="addlink" class="navbar-end" style="align-items: center !important">
|
||||
<a class="button is-primary" href="/new-story">Submit a New Story!</a>
|
||||
</div>
|
||||
</div>
|
||||
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
<span aria-hidden="true"></span>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
<nav class="navbar sticky-top navbar-expand-lg bg-light header border-bottom py-0" id="header-menu" component="navbar">
|
||||
<div class="container-lg justify-content-start flex-nowrap">
|
||||
<!-- IMPORT partials/menu.tpl -->
|
||||
</div>
|
||||
</nav>
|
||||
<script>
|
||||
const rect = document.getElementById('header-menu').getBoundingClientRect();
|
||||
const offset = Math.max(0, rect.bottom);
|
||||
document.documentElement.style.setProperty('--panel-offset', offset + `px`);
|
||||
</script>
|
||||
<div class="container-lg pt-3" id="content" style="margin: 0 auto;" >
|
||||
<!-- IMPORT partials/noscript/warning.tpl -->
|
||||
<!-- IMPORT partials/noscript/message.tpl -->
|
24
templates/partials/categories/lastpost.tpl
Normal file
24
templates/partials/categories/lastpost.tpl
Normal file
@ -0,0 +1,24 @@
|
||||
<div class="lastpost border-start border-4 lh-sm h-100" style="border-color: {./bgColor}!important;">
|
||||
{{{ each ./posts }}}
|
||||
{{{ if @first }}}
|
||||
<div component="category/posts" class="ps-2 text-xs d-flex flex-column h-100 gap-1">
|
||||
<div class="text-nowrap text-truncate">
|
||||
<a class="text-decoration-none avatar-tooltip" title="{./user.displayname}" href="{config.relative_path}/user/{./user.userslug}">{buildAvatar(posts.user, "18px", true)}</a>
|
||||
<a class="permalink text-muted timeago text-xs" href="{config.relative_path}/topic/{./topic.slug}{{{ if ./index }}}/{./index}{{{ end }}}" title="{./timestampISO}" aria-label="[[global:lastpost]]"></a>
|
||||
</div>
|
||||
<div class="post-content text-xs text-break line-clamp-sm-2 lh-sm position-relative flex-fill">
|
||||
<a class="stretched-link" tabindex="-1" href="{config.relative_path}/topic/{./topic.slug}{{{ if ./index }}}/{./index}{{{ end }}}" aria-label="[[global:lastpost]]"></a>
|
||||
{./content}
|
||||
</div>
|
||||
</div>
|
||||
{{{ end }}}
|
||||
{{{ end }}}
|
||||
|
||||
{{{ if !./posts.length }}}
|
||||
<div component="category/posts" class="ps-2">
|
||||
<div class="post-content overflow-hidden text-xs">
|
||||
[[category:no-new-posts]]
|
||||
</div>
|
||||
</div>
|
||||
{{{ end }}}
|
||||
</div>
|
127
templates/topic.tpl
Normal file
127
templates/topic.tpl
Normal file
@ -0,0 +1,127 @@
|
||||
<div data-widget-area="header">
|
||||
{{{each widgets.header}}}
|
||||
{{widgets.header.html}}
|
||||
{{{end}}}
|
||||
</div>
|
||||
<div class="row mb-5">
|
||||
<div class="topic {{{ if widgets.sidebar.length }}}col-lg-9 col-sm-12{{{ else }}}col-lg-12{{{ end }}}" itemid="{url}" itemscope itemtype="https://schema.org/DiscussionForumPosting">
|
||||
<meta itemprop="headline" content="{escape(titleRaw)}">
|
||||
<meta itemprop="text" content="{escape(titleRaw)}">
|
||||
<meta itemprop="url" content="{url}">
|
||||
<meta itemprop="datePublished" content="{timestampISO}">
|
||||
<meta itemprop="dateModified" content="{lastposttimeISO}">
|
||||
<div itemprop="author" itemscope itemtype="https://schema.org/Person">
|
||||
<meta itemprop="name" content="{author.username}">
|
||||
{{{ if author.remoteId }}}<meta itemprop="url" content="{config.relative_path}/user/{author.remoteId}">{{{ end }}}
|
||||
</div>
|
||||
|
||||
<div class="topic-header sticky-top mb-3 bg-body">
|
||||
<div class="d-flex flex-wrap gap-3 border-bottom p-2">
|
||||
<div class="d-flex flex-column gap-2 flex-grow-1">
|
||||
<h1 component="post/header" class="mb-0" itemprop="name">
|
||||
<div class="topic-title d-flex">
|
||||
<span class="fs-3" component="topic/title">{title}</span>
|
||||
</div>
|
||||
</h1>
|
||||
|
||||
<div class="topic-info d-flex gap-2 align-items-center flex-wrap">
|
||||
<span component="topic/labels" class="d-flex gap-2 {{{ if (!scheduled && (!pinned && (!locked && (!icons.length && (!oldCid || (oldCid == "-1")))))) }}}hidden{{{ end }}}">
|
||||
<span component="topic/scheduled" class="badge badge border border-gray-300 text-body {{{ if !scheduled }}}hidden{{{ end }}}">
|
||||
<i class="fa fa-clock-o"></i> [[topic:scheduled]]
|
||||
</span>
|
||||
<span component="topic/pinned" class="badge badge border border-gray-300 text-body {{{ if (scheduled || !pinned) }}}hidden{{{ end }}}">
|
||||
<i class="fa fa-thumb-tack"></i> {{{ if !pinExpiry }}}[[topic:pinned]]{{{ else }}}[[topic:pinned-with-expiry, {isoTimeToLocaleString(./pinExpiryISO, config.userLang)}]]{{{ end }}}
|
||||
</span>
|
||||
<span component="topic/locked" class="badge badge border border-gray-300 text-body {{{ if !locked }}}hidden{{{ end }}}">
|
||||
<i class="fa fa-lock"></i> [[topic:locked]]
|
||||
</span>
|
||||
<a component="topic/moved" href="{config.relative_path}/category/{oldCid}" class="badge badge border border-gray-300 text-body text-decoration-none {{{ if !oldCid }}}hidden{{{ end }}}">
|
||||
<i class="fa fa-arrow-circle-right"></i> {{{ if privileges.isAdminOrMod }}}[[topic:moved-from, {oldCategory.name}]]{{{ else }}}[[topic:moved]]{{{ end }}}
|
||||
</a>
|
||||
{{{each icons}}}<span class="lh-1">{@value}</span>{{{end}}}
|
||||
</span>
|
||||
{function.buildCategoryLabel, category, "a", "border"}
|
||||
<div data-tid="{./tid}" component="topic/tags" class="lh-1 tags tag-list d-flex flex-wrap hidden-xs hidden-empty gap-2"><!-- IMPORT partials/topic/tags.tpl --></div>
|
||||
<div class="d-flex hidden-xs gap-2"><!-- IMPORT partials/topic/stats.tpl --></div>
|
||||
{{{ if !feeds:disableRSS }}}
|
||||
{{{ if rssFeedUrl }}}<a class="hidden-xs" target="_blank" href="{rssFeedUrl}"><i class="fa fa-rss-square"></i></a>{{{ end }}}
|
||||
{{{ end }}}
|
||||
{{{ if browsingUsers }}}
|
||||
<div class="d-inline-block hidden-xs">
|
||||
<!-- IMPORT partials/topic/browsing-users.tpl -->
|
||||
</div>
|
||||
{{{ end }}}
|
||||
<div class="ms-auto">
|
||||
<!-- IMPORT partials/post_bar.tpl -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-wrap gap-2 align-items-center hidden-empty" component="topic/thumb/list"><!-- IMPORT partials/topic/thumbs.tpl --></div>
|
||||
</div>
|
||||
</div>
|
||||
{{{ if merger }}}
|
||||
<!-- IMPORT partials/topic/merged-message.tpl -->
|
||||
{{{ end }}}
|
||||
|
||||
{{{ if forker }}}
|
||||
<!-- IMPORT partials/topic/forked-message.tpl -->
|
||||
{{{ end }}}
|
||||
|
||||
|
||||
{{{ if !scheduled }}}
|
||||
<!-- IMPORT partials/topic/deleted-message.tpl -->
|
||||
{{{ end }}}
|
||||
|
||||
<ul component="topic" class="posts timeline" data-tid="{tid}" data-cid="{cid}">
|
||||
{{{each posts}}}
|
||||
<li component="post" class="{{{ if posts.deleted }}}deleted{{{ end }}} {{{ if posts.selfPost }}}self-post{{{ end }}} {{{ if posts.topicOwnerPost }}}topic-owner-post{{{ end }}}" <!-- IMPORT partials/data/topic.tpl -->>
|
||||
<a component="post/anchor" data-index="{./index}" id="{increment(./index, "1")}"></a>
|
||||
|
||||
<meta itemprop="datePublished" content="{posts.timestampISO}">
|
||||
<meta itemprop="dateModified" content="{posts.editedISO}">
|
||||
|
||||
<!-- IMPORT partials/topic/post.tpl -->
|
||||
</li>
|
||||
{{{ if (config.topicPostSort != "most_votes") }}}
|
||||
{{{ each ./events}}}
|
||||
<!-- IMPORT partials/topic/event.tpl -->
|
||||
{{{ end }}}
|
||||
{{{ end }}}
|
||||
{{{end}}}
|
||||
</ul>
|
||||
|
||||
{{{ if browsingUsers }}}
|
||||
<div class="visible-xs">
|
||||
<!-- IMPORT partials/topic/browsing-users.tpl -->
|
||||
<hr/>
|
||||
</div>
|
||||
{{{ end }}}
|
||||
|
||||
{{{ if config.enableQuickReply }}}
|
||||
<!-- IMPORT partials/topic/quickreply.tpl -->
|
||||
{{{ end }}}
|
||||
|
||||
{{{ if config.usePagination }}}
|
||||
<!-- IMPORT partials/paginator.tpl -->
|
||||
{{{ end }}}
|
||||
|
||||
<!-- IMPORT partials/topic/navigator.tpl -->
|
||||
</div>
|
||||
<div data-widget-area="sidebar" class="col-lg-3 col-sm-12 {{{ if !widgets.sidebar.length }}}hidden{{{ end }}}">
|
||||
{{{each widgets.sidebar}}}
|
||||
{{widgets.sidebar.html}}
|
||||
{{{end}}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div data-widget-area="footer">
|
||||
{{{each widgets.footer}}}
|
||||
{{widgets.footer.html}}
|
||||
{{{end}}}
|
||||
</div>
|
||||
|
||||
{{{ if !config.usePagination }}}
|
||||
<noscript>
|
||||
<!-- IMPORT partials/paginator.tpl -->
|
||||
</noscript>
|
||||
{{{ end }}}
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "nodebb-theme-quickstart",
|
||||
"name": "My Theme Name",
|
||||
"description": "Enter a description here",
|
||||
"id": "nodebb-theme-rockfic",
|
||||
"name": "Rockfic",
|
||||
"description": "Theme used on rockfic.com",
|
||||
"url": "https://github.com/nodebb/nodebb-theme-quickstart",
|
||||
"baseTheme": "nodebb-theme-harmony"
|
||||
"baseTheme": "nodebb-theme-persona"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user