Skip to content
Permalink
Browse files

Add announcements

  • Loading branch information
vantezzen committed Oct 16, 2019
1 parent 09d4735 commit 0c0b7cc82298e2d9fccae9336dd7aac55c7d87d2
Showing with 47 additions and 1 deletion.
  1. +3 −0 .gitignore
  2. +10 −1 app/Controllers/Http/StaticController.js
  3. +34 −0 resources/announcements/version.json
@@ -17,3 +17,6 @@ recipes/
.DS_Store
public/terms.html
public/privacy.html

resources/announcements/*.json
!resources/announcements/version.json
@@ -2,6 +2,9 @@
/**
* Controller for routes with static responses
*/
const Helpers = use('Helpers');
const fs = require('fs-extra');
const path = require('path');

class StaticController {
// Enable all features
@@ -214,9 +217,15 @@ class StaticController {
}

// Show announcements
announcement({
async announcement({
response,
params,
}) {
const announcement = path.join(Helpers.resourcesPath(), 'announcements', `${params.version}.json`);

if (await fs.pathExists(announcement)) {
return response.download(announcement);
}
return response.send('No announcement found.');
}
}
@@ -0,0 +1,34 @@
{
"main": {
"headline": "Example Accouncement",
"subHeadline": "Configure your announcement here",
"image": {
"light": "https://api.getferdi.com/assets/feature/light.png",
"dark": "https://api.getferdi.com/assets/feature/dark.png"
},
"text": "Long description here",
"cta": {
"label": "Click here to do something",
"href": "/settings/app",
"analytics": {
"category": "announcements-main",
"action": "event",
"label": "This does not get used"
}
}
},
"spotlight": {
"title": "Spotlight:",
"subject": "Show another feature",
"text": "Show another feature in the spotlight",
"cta": {
"label": "Click here to do something",
"href": "/settings/team",
"analytics": {
"category": "announcements-spotlight",
"action": "event",
"label": "This does not get used"
}
}
}
}

0 comments on commit 0c0b7cc

Please sign in to comment.
You can’t perform that action at this time.