mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
add startPage settings files
This commit is contained in:
@@ -24,8 +24,8 @@ class StartPageManager {
|
||||
loadStartPagePreferences( startPageName ) {
|
||||
let conf, options;
|
||||
try {
|
||||
conf = JSON.parse( fs.readFileSync( path.join( __dirname + '/../ui/home/templates/' + startPageName + '/startPage.json' ) ) );
|
||||
options = JSON.parse( fs.readFileSync( path.join( __dirname + '/../ui/home/templates/' + startPageName + '/startPage.config.json' ) ) );
|
||||
options = JSON.parse( fs.readFileSync( path.join( __dirname + '/../ui/home/templates/' + startPageName + '/startPage.json' ) ) );
|
||||
conf = JSON.parse( fs.readFileSync( path.join( __dirname + '/../ui/home/templates/' + startPageName + '/startPage.config.json' ) ) );
|
||||
return { 'conf': conf, 'options': options };
|
||||
} catch ( err ) {
|
||||
return {};
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"subtitle": "this is a test",
|
||||
"description": "this is a test description",
|
||||
"banner": "homeBanner.jpg"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"subtitle": {
|
||||
"id": "subtitle",
|
||||
"type": "text",
|
||||
"display": "Subtitle",
|
||||
"can-be-empty": false
|
||||
},
|
||||
"description": {
|
||||
"id": "description",
|
||||
"type": "textarea",
|
||||
"display": "Description",
|
||||
"textarea-settings": {
|
||||
"resize-y": true,
|
||||
"resize-x": false,
|
||||
"max-length": 0,
|
||||
"min-length": 100
|
||||
},
|
||||
"can-be-empty": false
|
||||
},
|
||||
"banner": {
|
||||
"id": "banner",
|
||||
"type": "image",
|
||||
"display": "Banner",
|
||||
"image-settings": {
|
||||
"upload-name": "homeBanner",
|
||||
"accept-filetype": "image/jpeg",
|
||||
"height": 200,
|
||||
"width": 350
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@
|
||||
<p>{{ event.description }}</p>
|
||||
<b>{{ event.date }}</b>
|
||||
</div>
|
||||
<img :src="event.logo" alt="event logo" class="ticket-logo">
|
||||
<!-- <img :src="event.logo" alt="event logo" class="ticket-logo"> -->
|
||||
</router-link>
|
||||
<router-link to="/admin/events/analytics" class="ticket" @click="setActiveTicket( event.eventID );" v-else="new Date( event.date ).getTime() > currentDate">
|
||||
<div class="ticket-name">
|
||||
@@ -29,7 +29,7 @@
|
||||
<p>{{ event.description }}</p>
|
||||
<b>{{ event.date }}</b>
|
||||
</div>
|
||||
<img :src="event.logo" alt="event logo" class="ticket-logo">
|
||||
<!-- <img :src="event.logo" alt="event logo" class="ticket-logo"> -->
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -107,7 +107,7 @@
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
events: { 'test':{ 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-08-15', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href }, 'test2':{ 'name': 'TestEvent2', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-06-13', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test2', 'currency': 'CHF', 'logo': new URL( '/src/assets/logo.png', import.meta.url ).href } },
|
||||
events: { 'test':{ 'name': 'TestEvent', 'description': 'This is a description for the TestEvent to test multiline support and proper positioning of the Fields', 'freeSeats': 2, 'maxSeats': 2, 'date':'2023-08-15', 'startingPrice':15, 'location': 'TestLocation', 'eventID': 'test', 'currency': 'CHF', 'logo': new URL( '/assets/logo.png', import.meta.url ).href } },
|
||||
currentDate: new Date().getTime(),
|
||||
eventList: { 'upcoming': { 'name': 'Upcoming', 'content': {} }, 'past': { 'name': 'Past', 'content': {} }, 'drafts': { 'name': 'Drafts', 'content': {} } },
|
||||
currentlyOpenMenu: '',
|
||||
|
||||
@@ -16,7 +16,9 @@
|
||||
</select>
|
||||
<!-- Start page settings -> Defined by startPage.json file -->
|
||||
<div class="start-page-settings">
|
||||
|
||||
<div class="setting" v-for="setting in startPageSettings">
|
||||
{{ setting }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -35,8 +37,10 @@
|
||||
fetch( '/admin/getAPI/getStartPageSettings?name=' + this.selectedTemplate ).then( res => {
|
||||
if ( res.status === 200 ) {
|
||||
res.json().then( json => {
|
||||
this.startPageSettings = json;
|
||||
console.log( json );
|
||||
this.startPageSettings = json[ 'options' ];
|
||||
for ( let option in this.startPageSettings ) {
|
||||
this.startPageSettings[ option ][ 'value' ] = json[ 'conf' ][ option ];
|
||||
}
|
||||
} );
|
||||
}
|
||||
} );
|
||||
@@ -59,7 +63,7 @@
|
||||
fetch( '/admin/getAPI/getSettings' ).then( res => {
|
||||
if ( res.status === 200 ) {
|
||||
res.json().then( json => {
|
||||
this.selectedTemplate = String( json[ 'startPage' ] );
|
||||
this.selectedTemplate = json[ 'startPage' ];
|
||||
} );
|
||||
}
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user