Initial commit

This commit is contained in:
kngako committed 2021-12-18 02:34:52 +02:00
1 parent 3d2768a68b
commit 3a51a595a5
20 files changed
+25261

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
/**
* This router handles things related to the web browser experience...
*/
const fetch = require("node-fetch");
module.exports = function (options) {
var express = options.express;
var db = options.db;
var router = express.Router();
router.route('/')
.get(function(request, response, next) {
response.display("home", {
user: request.user,
pageTitle: "Home - Mantra"
})
});
return router;
};
+268
View File
@@ -0,0 +1,268 @@
const config = require('config');
const express = require('express');
const pug = require("pug");
const session = require("express-session");
const SequelizeSessionStore = require('connect-session-sequelize')(session.Store);
const bodyParser = require("body-parser");
const path = require("path");
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const fs = require('fs');
module.exports = function () {
var server = {};
server.run = (db) => {
console.log("Starting Server")
return new Promise((resolve, reject) => {
const app = express();
app.set("view engine", "pug");
app.set("views", path.resolve("server/views"));
// compile pug views below so that they are rendered quicker
var pugPages = {};
var modelDir = path.join(__dirname, './views');
fs.readdirSync(modelDir)
.filter(file => {
return file.endsWith(".pug");
})
.forEach(file => {
const name = file.split(".pug")[0];
pugPages[name] = pug.compileFile(path.join(modelDir, file))
});
// Set up middleware to make use of the compiled pugjs views
app.use((request, response, next) => {
// This is cheating...
response.display = (view, options) => {
options.domain = config.get("server.domain");
options.urlEndpoint = request.originalUrl;
// Set a default pageTitle...
options.pageTitle = options.pageTitle ? options.pageTitle : "Mantra";
options.errorMessage = (error) => {
// TODO: Make error human readable...
return error.message;
}
if(config.get("server.compiled-render")) {
if(pugPages[view]) {
response.send(pugPages[view](options))
} else {
response.send(pugPages["404"](options))
}
} else {
response.render(view, options);
}
}
next();
})
app.use('/static', express.static("server/static"));
// Session related stuff...
function extendDefaultFields(defaults, session) {
return {
data: defaults.data,
expires: session.cookie && session.cookie.expires ? session.cookie.expires : defaults.expires, // 157680000
userId: session.passport.user
};
}
var sessionStore = new SequelizeSessionStore({
db: db.sequelize,
table: 'session',
extendDefaultFields: extendDefaultFields
// TODO: Define expiry and clean up...
});
app.use(session({
store: sessionStore,
secret: config.get("server.secret"),
resave: false,
saveUninitialized: false,
cookie: config.get("server.cookie")
}));
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
passport.use(new LocalStrategy(
function(username, password, done) {
username = username != null ? username.trim().toLowerCase() : "";
password = password != null ? password : "";
return db.User.findOne({
include: [
{
association: db.User.Passwords
},
{
association: db.User.UserEmails,
required: true,
where: {
emailAddress: {
[db.Sequelize.Op.like]: username
}
}
},
{
association: db.User.UserRoles,
// required: true,
include: [
{
association: db.UserRole.Role,
required: true,
where: {
type: {
[db.Sequelize.Op.or]: roles
}
}
}
]
}
]
}).then(
user => {
// Validate Password
if(user) {
if (!user.passwords[0].validPassword(password)) {
return done(null, false, {
username: username,
message: 'Invalid username or password.'
});
} else {
return done(null, user);
}
} else {
console.error("User Doesn't Exist: ", username);
return done(null, false, {
username: username,
message: 'Invalid username or password.'
});
}
},
err => {
console.error("Authentication Failed: " + err);
return done(null, false, { message: 'Incorrect username or password.' });
}
).catch(error => {
console.log("Passport Error: ", error);
return done(error);
})
}
));
passport.serializeUser(function(user, done) {
done(null, user.id);
});
passport.deserializeUser(function(id, done) {
// TODO: Add memberships and things like that...
return db.User.findByPk(id, {
include: [
{
association: db.User.UserRoles,
// required: true,
include: [
{
association: db.UserRole.Role,
required: true,
where: {
type: {
[db.Sequelize.Op.or]: roles
}
}
}
]
}
]
})
.then(user => {
return done(null, user);
}).catch(error => {
return done(error);
})
});
app.use(passport.initialize());
app.use(passport.session());
sessionStore.sync();
// TODO: Create a load router module...
var router = require('./router/index.js')({
app: app,
express: express,
db: db,
passport: passport
});
app.use('/', router);
// 404 pages...
app.use((request, response, next) => {
if(!response.headersSent) {
response.status(404);
if (request.accepts('html')) {
response.display("404", {
user: request.user,
pageTitle: "Page Not Found - Mantra"
})
return;
}
if (request.accepts('application/json')) {
response.json({
message: "URL not accessible"
});
return;
}
response.type('txt').send('Resource Not found');
}
});
// 500 pages...
app.use((error, request, response, next) => {
console.error(`${response.getHeader("id")} - `, error);
if(error && !response.headersSent) {
response.status(500);
// TODO: Check if production and then show stack...
if (request.accepts('html')) {
response.display("error", {
user: request.user,
pageTitle: "Internal Error - Mantra",
error: error
})
return;
}
if (request.xhr) {
response.json({
message: "Internal Error, Please check your tires.",
error: error
});
return;
}
response.type('txt').send('Internal server error');
}
});
const port = process.env.PORT || config.get("server.port");
app.listen(port);
resolve(port);
});
}
return server;
};
+9067
View File
File diff suppressed because it is too large. Load diff
+13
View File
@@ -0,0 +1,13 @@
/*!
* Materialize v1.0.0 (http://materializecss.com)
* Copyright 2014-2017 Materialize
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
*/
.materialize-red{background-color:#e51c23 !important}.materialize-red-text{color:#e51c23 !important}.materialize-red.lighten-5{background-color:#fdeaeb !important}.materialize-red-text.text-lighten-5{color:#fdeaeb !important}.materialize-red.lighten-4{background-color:#f8c1c3 !important}.materialize-red-text.text-lighten-4{color:#f8c1c3 !important}.materialize-red.lighten-3{background-color:#f3989b !important}.materialize-red-text.text-lighten-3{color:#f3989b !important}.materialize-red.lighten-2{background-color:#ee6e73 !important}.materialize-red-text.text-lighten-2{color:#ee6e73 !important}.materialize-red.lighten-1{background-color:#ea454b !important}.materialize-red-text.text-lighten-1{color:#ea454b !important}.materialize-red.darken-1{background-color:#d0181e !important}.materialize-red-text.text-darken-1{color:#d0181e !important}.materialize-red.darken-2{background-color:#b9151b !important}.materialize-red-text.text-darken-2{color:#b9151b !important}.materialize-red.darken-3{background-color:#a21318 !important}.materialize-red-text.text-darken-3{color:#a21318 !important}.materialize-red.darken-4{background-color:#8b1014 !important}.materialize-red-text.text-darken-4{color:#8b1014 !important}.red{background-color:#F44336 !important}.red-text{color:#F44336 !important}.red.lighten-5{background-color:#FFEBEE !important}.red-text.text-lighten-5{color:#FFEBEE !important}.red.lighten-4{background-color:#FFCDD2 !important}.red-text.text-lighten-4{color:#FFCDD2 !important}.red.lighten-3{background-color:#EF9A9A !important}.red-text.text-lighten-3{color:#EF9A9A !important}.red.lighten-2{background-color:#E57373 !important}.red-text.text-lighten-2{color:#E57373 !important}.red.lighten-1{background-color:#EF5350 !important}.red-text.text-lighten-1{color:#EF5350 !important}.red.darken-1{background-color:#E53935 !important}.red-text.text-darken-1{color:#E53935 !important}.red.darken-2{background-color:#D32F2F !important}.red-text.text-darken-2{color:#D32F2F !important}.red.darken-3{background-color:#C62828 !important}.red-text.text-darken-3{color:#C62828 !important}.red.darken-4{background-color:#B71C1C !important}.red-text.text-darken-4{color:#B71C1C !important}.red.accent-1{background-color:#FF8A80 !important}.red-text.text-accent-1{color:#FF8A80 !important}.red.accent-2{background-color:#FF5252 !important}.red-text.text-accent-2{color:#FF5252 !important}.red.accent-3{background-color:#FF1744 !important}.red-text.text-accent-3{color:#FF1744 !important}.red.accent-4{background-color:#D50000 !important}.red-text.text-accent-4{color:#D50000 !important}.pink{background-color:#e91e63 !important}.pink-text{color:#e91e63 !important}.pink.lighten-5{background-color:#fce4ec !important}.pink-text.text-lighten-5{color:#fce4ec !important}.pink.lighten-4{background-color:#f8bbd0 !important}.pink-text.text-lighten-4{color:#f8bbd0 !important}.pink.lighten-3{background-color:#f48fb1 !important}.pink-text.text-lighten-3{color:#f48fb1 !important}.pink.lighten-2{background-color:#f06292 !important}.pink-text.text-lighten-2{color:#f06292 !important}.pink.lighten-1{background-color:#ec407a !important}.pink-text.text-lighten-1{color:#ec407a !important}.pink.darken-1{background-color:#d81b60 !important}.pink-text.text-darken-1{color:#d81b60 !important}.pink.darken-2{background-color:#c2185b !important}.pink-text.text-darken-2{color:#c2185b !important}.pink.darken-3{background-color:#ad1457 !important}.pink-text.text-darken-3{color:#ad1457 !important}.pink.darken-4{background-color:#880e4f !important}.pink-text.text-darken-4{color:#880e4f !important}.pink.accent-1{background-color:#ff80ab !important}.pink-text.text-accent-1{color:#ff80ab !important}.pink.accent-2{background-color:#ff4081 !important}.pink-text.text-accent-2{color:#ff4081 !important}.pink.accent-3{background-color:#f50057 !important}.pink-text.text-accent-3{color:#f50057 !important}.pink.accent-4{background-color:#c51162 !important}.pink-text.text-accent-4{color:#c51162 !important}.purple{background-color:#9c27b0 !important}.purple-text{color:#9c27b0 !important}.purple.lighten-5{background-color:#f3e5f5 !important}.purple-text.text-lighten-5{color:#f3e5f5 !important}.purple.lighten-4{background-color:#e1bee7 !important}.purple-text.text-lighten-4{color:#e1bee7 !important}.purple.lighten-3{background-color:#ce93d8 !important}.purple-text.text-lighten-3{color:#ce93d8 !important}.purple.lighten-2{background-color:#ba68c8 !important}.purple-text.text-lighten-2{color:#ba68c8 !important}.purple.lighten-1{background-color:#ab47bc !important}.purple-text.text-lighten-1{color:#ab47bc !important}.purple.darken-1{background-color:#8e24aa !important}.purple-text.text-darken-1{color:#8e24aa !important}.purple.darken-2{background-color:#7b1fa2 !important}.purple-text.text-darken-2{color:#7b1fa2 !important}.purple.darken-3{background-color:#6a1b9a !important}.purple-text.text-darken-3{color:#6a1b9a !important}.purple.darken-4{background-color:#4a148c !important}.purple-text.text-darkeLine truncated
* Waves v0.6.0
* http://fian.my.id/Waves
*
* Copyright 2014 Alfiana E. Sibuea and other contributors
* Released under the MIT license
* https://github.com/fians/Waves/blob/master/LICENSE
*/.waves-effect{position:relative;cursor:pointer;display:inline-block;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;vertical-align:middle;z-index:1;-webkit-transition:.3s ease-out;transition:.3s ease-out}.waves-effect .waves-ripple{position:absolute;border-radius:50%;width:20px;height:20px;margin-top:-10px;margin-left:-10px;opacity:0;background:rgba(0,0,0,0.2);-webkit-transition:all 0.7s ease-out;transition:all 0.7s ease-out;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;-webkit-transform:scale(0);transform:scale(0);pointer-events:none}.waves-effect.waves-light .waves-ripple{background-color:rgba(255,255,255,0.45)}.waves-effect.waves-red .waves-ripple{background-color:rgba(244,67,54,0.7)}.waves-effect.waves-yellow .waves-ripple{background-color:rgba(255,235,59,0.7)}.waves-effect.waves-orange .waves-ripple{background-color:rgba(255,152,0,0.7)}.waves-effect.waves-purple .waves-ripple{background-color:rgba(156,39,176,0.7)}.waves-effect.waves-green .waves-ripple{background-color:rgba(76,175,80,0.7)}.waves-effect.waves-teal .waves-ripple{background-color:rgba(0,150,136,0.7)}.waves-effect input[type="button"],.waves-effect input[type="reset"],.waves-effect input[type="submit"]{border:0;font-style:normal;font-size:inherit;text-transform:inherit;background:none}.waves-effect img{position:relative;z-index:-1}.waves-notransition{-webkit-transition:none !important;transition:none !important}.waves-circle{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-mask-image:-webkit-radial-gradient(circle, white 100%, black 100%)}.waves-input-wrapper{border-radius:0.2em;vertical-align:bottom}.waves-input-wrapper .waves-button-input{position:relative;top:0;left:0;z-index:1}.waves-circle{text-align:center;width:2.5em;height:2.5em;line-height:2.5em;border-radius:50%;-webkit-mask-image:none}.waves-block{display:block}.waves-effect .waves-ripple{z-index:-1}.modal{display:none;position:fixed;left:0;right:0;background-color:#fafafa;padding:0;max-height:70%;width:55%;margin:auto;overflow-y:auto;border-radius:2px;will-change:top, opacity}.modal:focus{outline:none}@media only screen and (max-width: 992px){.modal{width:80%}}.modal h1,.modal h2,.modal h3,.modal h4{margin-top:0}.modal .modal-content{padding:24px}.modal .modal-close{cursor:pointer}.modal .modal-footer{border-radius:0 0 2px 2px;background-color:#fafafa;padding:4px 6px;height:56px;width:100%;text-align:right}.modal .modal-footer .btn,.modal .modal-footer .btn-large,.modal .modal-footer .btn-small,.modal .modal-footer .btn-flat{margin:6px 0}.modal-overlay{position:fixed;z-index:999;top:-25%;left:0;bottom:0;right:0;height:125%;width:100%;background:#000;display:none;will-change:opacity}.modal.modal-fixed-footer{padding:0;height:70%}.modal.modal-fixed-footer .modal-content{position:absolute;height:calc(100% - 56px);max-height:100%;width:100%;overflow-y:auto}.modal.modal-fixed-footer .modal-footer{border-top:1px solid rgba(0,0,0,0.1);position:absolute;bottom:0}.modal.bottom-sheet{top:auto;bottom:-100%;margin:0;width:100%;max-height:45%;border-radius:0;will-change:bottom, opacity}.collapsible{border-top:1px solid #ddd;border-right:1px solid #ddd;border-left:1px solid #ddd;margin:.5rem 0 1rem 0}.collapsible-header{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;cursor:pointer;-webkit-tap-highlight-color:transparent;line-height:1.5;padding:1rem;background-color:#fff;border-bottom:1px solid #ddd}.collapsible-header:focus{outline:0}.collapsible-header i{width:2rem;font-size:1.6rem;display:inline-block;text-align:center;margin-right:1rem}.keyboard-focused .collapsible-header:focus{background-color:#eee}.collapsible-body{display:none;border-bottom:1px solid #ddd;-webkit-box-sizing:border-box;box-sizing:border-box;padding:2rem}.sidenav .collapsible,.sidenav.fixed .collapsible{border:none;-webkit-box-shadow:none;box-shadow:none}.sidenav .collapsible li,.sidenav.fixed .collapsible li{padding:0}.sidenav .collapsible-header,.sidenav.fixed .collapsible-header{background-color:transparent;border:none;line-height:inherit;height:inherit;padding:0 16px}.sidenav .collapsible-header:hover,.sidenav.fixed .collapsible-header:hover{background-color:rgba(0,0,0,0.05)}.sidenav .collapsible-header i,.sidenav.fixed .collapsible-header i{line-height:inherit}.sidenav .collapsible-body,.sidenav.fixed .collapsible-body{border:0;background-color:#fff}.sidenav .collapsible-body li a,.sidenav.fixed .collapsible-body li a{padding:0 23.5px 0 31px}.collapsible.popout{border:none;-webkit-box-shadow:none;box-shadow:none}.collapsible.popout>li{-webkit-box-shadow:0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);box-shadow:0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12);margin:0 24px;-webkit-transition:margin 0.35s cubLine truncated
Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

+12374
View File
File diff suppressed because it is too large. Load diff
+6
View File
@@ -0,0 +1,6 @@
/*!
* Materialize v1.0.0 (http://materializecss.com)
* Copyright 2014-2017 Materialize
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
*/
var _get=function t(e,i,n){null===e&&(e=Function.prototype);var s=Object.getOwnPropertyDescriptor(e,i);if(void 0===s){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,i,n)}if("value"in s)return s.value;var a=s.get;return void 0!==a?a.call(n):void 0},_createClass=function(){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}}();function _possibleConstructorReturn(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}window.cash=function(){var i,o=document,a=window,t=Array.prototype,r=t.slice,n=t.filter,s=t.push,e=function(){},h=function(t){return typeof t==typeof e&&t.call},d=function(t){return"string"==typeof t},l=/^#[\w-]*$/,u=/^\.[\w-]*$/,c=/<.+>/,p=/^\w+$/;function v(t,e){e=e||o;var i=u.test(t)?e.getElementsByClassName(t.slice(1)):p.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t);return i}function f(t){if(!i){var e=(i=o.implementation.createHTMLDocument(null)).createElement("base");e.href=o.location.href,i.head.appendChild(e)}return i.body.innerHTML=t,i.body.childNodes}function m(t){"loading"!==o.readyState?t():o.addEventListener("DOMContentLoaded",t)}function g(t,e){if(!t)return this;if(t.cash&&t!==a)return t;var i,n=t,s=0;if(d(t))n=l.test(t)?o.getElementById(t.slice(1)):c.test(t)?f(t):v(t,e);else if(h(t))return m(t),this;if(!n)return this;if(n.nodeType||n===a)this[0]=n,this.length=1;else for(i=this.length=n.length;s<i;s++)this[s]=n[s];return this}function _(t,e){return new g(t,e)}var y=_.fn=_.prototype=g.prototype={cash:!0,length:0,push:s,splice:t.splice,map:t.map,init:g};function k(t,e){for(var i=t.length,n=0;n<i&&!1!==e.call(t[n],t[n],n,t);n++);}function b(t,e){var i=t&&(t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector);return!!i&&i.call(t,e)}function w(e){return d(e)?b:e.cash?function(t){return e.is(t)}:function(t,e){return t===e}}function C(t){return _(r.call(t).filter(function(t,e,i){return i.indexOf(t)===e}))}Object.defineProperty(y,"constructor",{value:_}),_.parseHTML=f,_.noop=e,_.isFunction=h,_.isString=d,_.extend=y.extend=function(t){t=t||{};var e=r.call(arguments),i=e.length,n=1;for(1===e.length&&(t=this,n=0);n<i;n++)if(e[n])for(var s in e[n])e[n].hasOwnProperty(s)&&(t[s]=e[n][s]);return t},_.extend({merge:function(t,e){for(var i=+e.length,n=t.length,s=0;s<i;n++,s++)t[n]=e[s];return t.length=n,t},each:k,matches:b,unique:C,isArray:Array.isArray,isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}});var E=_.uid="_cash"+Date.now();function M(t){return t[E]=t[E]||{}}function O(t,e,i){return M(t)[e]=i}function x(t,e){var i=M(t);return void 0===i[e]&&(i[e]=t.dataset?t.dataset[e]:_(t).attr("data-"+e)),i[e]}y.extend({data:function(e,i){if(d(e))return void 0===i?x(this[0],e):this.each(function(t){return O(t,e,i)});for(var t in e)this.data(t,e[t]);return this},removeData:function(s){return this.each(function(t){return i=s,void((n=M(e=t))?delete n[i]:e.dataset?delete e.dataset[i]:_(e).removeAttr("data-"+name));var e,i,n})}});var L=/\S+/g;function T(t){return d(t)&&t.match(L)}function $(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function B(t,e,i){t.classList?t.classList.add(e):i.indexOf(" "+e+" ")&&(t.className+=" "+e)}function D(t,e){t.classList?t.classList.remove(e):t.className=t.className.replace(e,"")}y.extend({addClass:function(t){var n=T(t);return n?this.each(function(e){var i=" "+e.className+" ";k(n,function(t){B(e,t,i)})}):this},attr:function(e,i){if(e){if(d(e))return void 0===i?this[0]?this[0].getAttribute?this[0].getAttribute(e):this[0][e]:void 0:this.each(function(t){t.setAttribute?t.setAttribute(e,i):t[e]=i});for(var t in e)this.attr(t,e[t]);return this}},hasClass:function(t){var e=!1,i=T(t);return i&&i.length&&this.each(function(t){return!(e=$(t,i[0]))}),e},prop:function(e,i){if(d(e))return void 0===i?this[0][e]:this.each(function(t){t[e]=i});for(var t in e)this.prop(t,e[t]);return this},removeAttr:function(e){return this.each(function(t){t.removeAttribute?t.removeAttribute(e):delete t[e]})},removeClass:function(t){if(!arguments.length)return this.attr("class","");var i=T(t);return i?this.each(function(e){k(i,function(t){D(e,t)})}):this},removeProp:function(e){return this.each(function(t){delete t[e]})},toggleClass:function(t,e){if(void 0!==e)return this[e?"addClassLine truncated
+6
View File
@@ -0,0 +1,6 @@
extend templates/layout.pug
block content
.container
.center
h1 404: Page Not Found
+20
View File
@@ -0,0 +1,20 @@
body {
display: flex;
width: 100%;
min-height: 100vh;
flex-direction: column;
}
main {
flex: 1 0 auto;
}
header, main, footer {
padding-left: 300px;
}
@media only screen and (max-width : 992px) {
header, main, footer {
padding-left: 0;
}
}
+47
View File
@@ -0,0 +1,47 @@
/* Color scheme from https://material.io/resources/color/#!/?view.left=0&view.right=0&primary.color=212121&secondary.color=263238 */
.primary-color {
background-color: #212121 !important;
}
.primary-color-light {
background-color: #484848 !important;
}
.primary-color-dark {
background-color: #000000 !important;
}
.secondary-color {
background-color: #263238 !important;
}
.secondary-color-light {
background-color: #4f5b62 !important;
}
.secondary-color-dark {
background-color: #000a12 !important;
}
.money-chip {
display: inline-block;
/* height: 33px;
font-size: 1;
font-weight: 500; */
line-height: 32px;
padding: 12px;
border-radius: 16px;
}
.auto-image {
width: auto !important;
}
/* This gives use dots in our markdown lists... */
.flow-text ul li {
list-style-type: disc !important;
}
.bitcoin-address {
word-wrap: break-word;
}
+6
View File
@@ -0,0 +1,6 @@
extend templates/layout.pug
block content
.container
.center
h1 Internal Server Error
+6
View File
@@ -0,0 +1,6 @@
extend templates/layout.pug
block content
.container
.center
h1 Home
+18
View File
@@ -0,0 +1,18 @@
ul.pagination
- var disableLeft = page<=0 ? "disabled" : "";
- var hrefLeft = page<=0 ? "#" : "?page="+(Number(page)-1);
li(class=disableLeft)
//- TODO: Compute the left value...
a(href=hrefLeft)
i.material-icons chevron_left
- var n = 0;
while n < totalPages
- var derivedClass = n == page ? "active" : ""
li(class=derivedClass)
a(href="?page="+n)= (++n)
- var disableRight = page>=(Number(totalPages)-1) ? "disabled" : "";
li(class=disableRight)
//- TODO: Compute the right value..
- var hrefRight = page>=(Number(totalPages)-1) ? "#" : "?page="+(Number(page)+1);
a(href=hrefRight)
i.material-icons chevron_right
+4
View File
@@ -0,0 +1,4 @@
document.addEventListener('DOMContentLoaded', function() {
//
M.Sidenav.init(document.querySelectorAll('.sidenav'));
});
+122
View File
@@ -0,0 +1,122 @@
doctype html
html(lang="en" dir="ltr")
head
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
<link async href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
link(rel="icon", href="/static/img/mantra-icon.png", type="image/png")
block seo
title Mantra
//- Using Material Design Lite for the CSS stuff
//- https://getmdl.io
//- <script src="https://code.getmdl.io/1.3.0/material.min.js"></script>
//- <link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
link(rel="stylesheet", href="/static/css/materialize.min.css")
style(media="screen")
include ../css/site-layout.css
style(media="screen")
include ../css/site.css
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
block additionalStyle
body
ul.sidenav.sidenav-fixed#slide-out
li
.user-view.primary-color-light
.background
a#name
p.flow-text.white-text.name Mantra
a#bio
span.white-text Mantra Mantra Mantra
a#email
span.white-text.email mantra@exonumia.africa
if user
li
.divider
li
a(href="/account")
i.material-icons.black-text person
span account
li
a(href="/account/tokens")
i.material-icons.black-text vpn_key
span tokens
li
form.center(action="/account/logout" method="POST")
<button class="btn-flat" type="submit">logout</button>
//- li.red-text
a DELETE ACCOUNT
else
li
a(href="/account/authenticate") login/register
//- li
a(href="/login/hd-auth") login with hd-auth
header(role="banner")
block navigation
nav.primary-color
.nav-wrapper
a.brand-logo.center.hide-on-small-only(href="/") Mantra
ul.left
li
a.sidenav-trigger(href="#", data-target="slide-out")
i.material-icons menu
main(role="main")
.row
.col.s12
//- I just need the space at the top of the page to be good on mobile...
block content
.container
p.flow-text Center content
.row
.col.s12
//- I just need some space at the bottom...
block footer
footer.primary-color.page-footer(role="footer")
.container
.row
.col.s12.m6
p.flow-text Follow
ul
li
a.white-text(href="https://www.twitter.com/exonumia280") Twitter
li
a.white-text(href="https://www.facebook.com/exonumia.africa") Facebook
li
a.white-text(href="https://www.instagram.com/exonumia.africa") Instagram
li
a.white-text(href="https://www.linkedin.com/company/exonumia-africa") LinkedIn
.col.s12.m6
//- p.flow-text Links
//- ul
li
a.white-text(href="/faq") FAQ
li
a.white-text(href="/privacy") Privacy Policy
li
a.white-text(href="/compliance") Compliance
li
a.white-text(href="/terms") Terms
li
a.white-text(href="/contact") Contact
.footer-copyright.primary-color-dark
.container
span &copy; 2021
a(href="https://sigidli.com/")
strong Sigidli
script(src="/static/js/materialize.min.js")
script
include ../js/site.js
block additionalScripts
//- All other scripts will be added here as they are needed in the views