From cf570d2b1958bc93ed9ace1a63bc62c4ca9e59af Mon Sep 17 00:00:00 2001 From: mrjvs Date: Sun, 22 Aug 2021 16:45:10 +0200 Subject: [PATCH] added github links to progress --- boards/boards.json | 29 +++++++++++++++++++++++++ public/assets/css/main.css | 23 ++++++++++++++++++++ src/routers/home.js | 4 +++- src/routers/progress.js | 4 +++- src/trello.js | 2 ++ views/home.handlebars | 2 +- views/partials/progress-list.handlebars | 11 ++++++++-- views/progress.handlebars | 2 +- 8 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 boards/boards.json diff --git a/boards/boards.json b/boards/boards.json new file mode 100644 index 0000000..99f50f0 --- /dev/null +++ b/boards/boards.json @@ -0,0 +1,29 @@ +{ + "boards": { + "juxt": { + "github_links": [ + { "display": "Juxt repo", "url": "https://github.com/PretendoNetwork/juxt-web" } + ] + }, + "account": { + "github_links": [ + { "display": "Account server repo", "url": "https://github.com/PretendoNetwork/account" } + ] + }, + "smm": { + "github_links": [ + { "display": "SMM server repo", "url": "https://github.com/PretendoNetwork/account" } + ] + }, + "web": { + "github_links": [ + { "display": "Website repo", "url": "https://github.com/PretendoNetwork/website" } + ] + }, + "eshop": { + "github_links": [ + { "display": "EShop repo", "url": "https://github.com/PretendoNetwork/Grove" } + ] + } + } +} diff --git a/public/assets/css/main.css b/public/assets/css/main.css index c659843..0013cca 100644 --- a/public/assets/css/main.css +++ b/public/assets/css/main.css @@ -414,6 +414,29 @@ section.team { .progress-title { margin-bottom: 20px; } +.progress-title a.github { + margin-top: 10px; + color: #6D73A2; + display: flex; + align-items: center; + opacity: .75; + text-decoration: none; +} +.progress-title a.github:focus, .progress-title a.github:hover, .progress-title a.github:visited { + color: #6D73A2; + text-decoration: none; +} +.progress-title a.github:hover { + opacity: 1; +} +.progress-title a.github svg { + height: 1.3rem; + margin-right: .4rem; +} +.feature-list-wrapper.purple .progress-title a.github, .feature-list-wrapper.purple .progress-title a.github:focus, .feature-list-wrapper.purple .progress-title a.github:hover, .feature-list-wrapper.purple .progress-title a.github:visited { + color: #c69cf9; +} + .feature-list-wrapper canvas { width: 100px; height: 100px; diff --git a/src/routers/home.js b/src/routers/home.js index 84dba26..a2ef859 100644 --- a/src/routers/home.js +++ b/src/routers/home.js @@ -1,5 +1,6 @@ const { Router } = require('express'); const util = require('../util'); +const { boards } = require('../../boards/boards.json'); const router = new Router(); const { getTrelloCache } = require('../trello'); @@ -11,7 +12,8 @@ router.get('/', async (request, response) => { response.render('home', { layout: 'main', locale: tmpLocale, - featuredFeatureList: cache.sections[0] + featuredFeatureList: cache.sections[0], + boards, }); }); diff --git a/src/routers/progress.js b/src/routers/progress.js index 6d590f4..70f8547 100644 --- a/src/routers/progress.js +++ b/src/routers/progress.js @@ -1,5 +1,6 @@ const { Router } = require('express'); const util = require('../util'); +const { boards } = require('../../boards/boards.json'); const router = new Router(); const { getTrelloCache } = require('../trello'); @@ -11,7 +12,8 @@ router.get('/', async (request, response) => { response.render('progress', { layout: 'main', locale: tmpLocale, - progressLists: cache + progressLists: cache, + boards, }); }); diff --git a/src/trello.js b/src/trello.js index f8de99c..4860f2d 100644 --- a/src/trello.js +++ b/src/trello.js @@ -31,6 +31,7 @@ async function updateTrelloCache() { for (const board of boards) { const meta = { title: '', + id: '', percentage_complete: 0, progress: { not_started: [], @@ -40,6 +41,7 @@ async function updateTrelloCache() { }; meta.title = board.name; + meta.id = board.id; const lists = await trello.getListsOnBoard(board.id); const cards = await trello.getCardsOnBoard(board.id); diff --git a/views/home.handlebars b/views/home.handlebars index 5995e2c..4decf74 100644 --- a/views/home.handlebars +++ b/views/home.handlebars @@ -78,7 +78,7 @@

{{ locale.progress.title }}

- {{> progress-list data=featuredFeatureList }} + {{> progress-list data=featuredFeatureList purple=true boards=boards }}
diff --git a/views/partials/progress-list.handlebars b/views/partials/progress-list.handlebars index 005b94f..de03bcc 100644 --- a/views/partials/progress-list.handlebars +++ b/views/partials/progress-list.handlebars @@ -1,4 +1,4 @@ -
+
@@ -8,9 +8,16 @@
-

{{ data.title }}

+ {{#if data.id}}{{#if lookup boards data.id}}{{#with (lookup boards id) as | board |}} + {{#each board.github_links}} + + + {{this.display}} + + {{/each}} + {{/with}}{{/if}}{{/if}}
{{#each data.progress.completed}} diff --git a/views/progress.handlebars b/views/progress.handlebars index 7e7fff9..6a88206 100644 --- a/views/progress.handlebars +++ b/views/progress.handlebars @@ -13,7 +13,7 @@
{{#each progressLists.sections}}
- {{> progress-list data=this }} + {{> progress-list data=this boards=boards }}
{{/each}}