mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
prepare payment gateway settings
This commit is contained in:
10
notes.md
10
notes.md
@@ -1,8 +1,10 @@
|
||||
# Account view:
|
||||
|
||||
- Load all orders of customer from db when selecting tickets and save to memory to check if ticket count has been exceeded or not.
|
||||
|
||||
- load all available start page templates with dir crawler
|
||||
|
||||
|
||||
- fix ticket counting
|
||||
- Seat numbering!!
|
||||
|
||||
|
||||
- Update files to import when deploying for included json files instead of secret.json files
|
||||
@@ -11,10 +13,6 @@
|
||||
- Other optimization for seat plan editor
|
||||
|
||||
|
||||
|
||||
- Seat numbering!!
|
||||
|
||||
|
||||
- FUTURE: Implement Permission system
|
||||
- FUTURE: Add Admin profile (page to change account settings per person like changing pwd)
|
||||
- FUTURE add multi-language support
|
||||
|
||||
@@ -86,9 +86,10 @@ let file = path.join( __dirname + '/webapp/main/dist/index.html' );
|
||||
|
||||
console.log( '[ Server ] loading backend components' );
|
||||
if ( settings.init ) {
|
||||
require( './backend/helperRoutes.js' )( app, settings ); // Helper routes
|
||||
require( './admin/adminRoutes.js' )( app, settings ); // admin routes
|
||||
require( './admin/adminAPIRoutes.js' )( app, settings ); // admin api routes
|
||||
require( './backend/userAPIRoutes.js' )( app, settings ); // admin api routes
|
||||
require( './backend/userAPIRoutes.js' )( app, settings ); // user api routes
|
||||
require( './backend/userRoutes.js' )( app, settings ); // user routes
|
||||
require( './backend/payments/paymentRoutes.js' )( app, settings ); // payment routes
|
||||
require( './backend/plugins/pluginLoader.js' )( app, settings ); // plugin loader
|
||||
|
||||
20
src/server/backend/helperRoutes.js
Normal file
20
src/server/backend/helperRoutes.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const path = require( 'path' );
|
||||
|
||||
module.exports = ( app, settings ) => {
|
||||
app.get( '/eventAssets/:image', ( req, res ) => {
|
||||
res.sendFile( path.join( __dirname + '/../assets/events/' + req.params.image ) );
|
||||
} );
|
||||
|
||||
app.get( '/otherAssets/:image', ( req, res ) => {
|
||||
res.sendFile( path.join( __dirname + '/../assets/' + req.params.image ) );
|
||||
} );
|
||||
|
||||
app.get( '/supportFiles/:file', ( req, res ) => {
|
||||
res.sendFile( path.join( __dirname + '/../ui/home/templates/' + settings.startPage + '/supportFiles/' + req.params.file ) );
|
||||
} );
|
||||
|
||||
// TODO: Decide if removed or not
|
||||
app.get( '/startPage/helperFunction', ( req, res ) => {
|
||||
res.sendFile( path.join( __dirname + '/../ui/home/helper.js' ) );
|
||||
} );
|
||||
};
|
||||
@@ -33,6 +33,7 @@ class PluginManager {
|
||||
getPluginDetails ( plugin ) {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
fs.readFile( path.join( __dirname + '/others/' + plugin + '/plugin.json' ), ( err, file ) => {
|
||||
if ( err ) reject( err );
|
||||
resolve( file );
|
||||
} );
|
||||
} );
|
||||
@@ -41,7 +42,9 @@ class PluginManager {
|
||||
loadPaymentGatewaySettings () {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/configOptions.json' ), ( err, options ) => {
|
||||
if ( err ) reject( err );
|
||||
fs.readFile( path.join( __dirname + '/payments/' + this.paymentGateway + '/config.payments.json' ), ( err, config ) => {
|
||||
if ( err ) reject( err );
|
||||
let f = options;
|
||||
for ( let s in f ) {
|
||||
f[ s ][ 'value' ] = config[ s ];
|
||||
@@ -52,6 +55,10 @@ class PluginManager {
|
||||
} );
|
||||
}
|
||||
|
||||
savePaymentGatewaySettings () {
|
||||
|
||||
}
|
||||
|
||||
saveSettings ( plugin, settings ) {
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ const posth = require( './api/postHandler.js' );
|
||||
const geth = require( './api/getHandler.js' );
|
||||
const postHandler = new posth();
|
||||
const getHandler = new geth();
|
||||
const path = require( 'path' );
|
||||
const bodyParser = require( 'body-parser' );
|
||||
|
||||
module.exports = ( app, settings ) => {
|
||||
@@ -39,12 +38,4 @@ module.exports = ( app, settings ) => {
|
||||
res.status( error.code ).send( error.message );
|
||||
} );
|
||||
} );
|
||||
|
||||
app.get( '/eventAssets/:image', ( req, res ) => {
|
||||
res.sendFile( path.join( __dirname + '/../assets/events/' + req.params.image ) );
|
||||
} );
|
||||
|
||||
app.get( '/otherAssets/:image', ( req, res ) => {
|
||||
res.sendFile( path.join( __dirname + '/../assets/' + req.params.image ) );
|
||||
} );
|
||||
};
|
||||
@@ -11,5 +11,6 @@
|
||||
"maxTickets":10,
|
||||
"currency":"CHF",
|
||||
"gcInterval":300,
|
||||
"ticketTimeout":900
|
||||
"ticketTimeout":900,
|
||||
"startPage": "default"
|
||||
}
|
||||
@@ -3,9 +3,13 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="/supportFiles/style.css">
|
||||
<title>libreevent</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Test</h1>
|
||||
<nav></nav>
|
||||
<img src="/otherAssets/logo.png" alt="libreevent logo" class="logo">
|
||||
<h1>Welcome to libreevent!</h1>
|
||||
<p>No start page has been configured yet! Please configure one either by using the configurator in the settings or by uploading your own HTML page to the correct folder as detailed <a href="https://libreevent.janishutz.com/docs/admin-panel/pages">here</a></p>
|
||||
</body>
|
||||
</html>
|
||||
0
src/server/ui/home/helper.js
Normal file
0
src/server/ui/home/helper.js
Normal file
@@ -3,9 +3,11 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<title>{{ pageName }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
12
src/server/ui/home/templates/default/supportFiles/style.css
Normal file
12
src/server/ui/home/templates/default/supportFiles/style.css
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* libreevent - style.css
|
||||
*
|
||||
* Created by Janis Hutz 08/29/2023, Licensed under the GPL V3 License
|
||||
* https://janishutz.com, development@janishutz.com
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
.logo {
|
||||
height: 50vh;
|
||||
}
|
||||
Reference in New Issue
Block a user