-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: added detail screen Co-authored-by: MauritsioRK <maurits_rk@hotmail.com> Co-authored-by: Martijn Vegter <martijn@martijnvegter.com>
- Loading branch information
1 parent
f618ccc
commit e0bc9e3
Showing
11 changed files
with
204 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,3 +109,6 @@ tmp/ | |
temp/ | ||
|
||
# End of https://www.gitignore.io/api/node | ||
|
||
# Ignore .vscode folder | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* This file is part of the ALICE Electronic Logbook v2, also known as Jiskefet. | ||
* Copyright (C) 2020 Stichting Hogeschool van Amsterdam | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
import { h } from '/js/src/index.js'; | ||
|
||
/** | ||
* A singular post which is part of a log | ||
* @param {Object} post all data related to the post | ||
* @param {Number} index the identification index of the post | ||
* @return {vnode} Returns the navbar | ||
*/ | ||
const entry = (post, index) => | ||
h('.flex-column.p2.shadow-level1.mv2', { | ||
id: `post${index}`, | ||
}, [ | ||
h('.f7.gray-darker', { style: 'align-self: flex-end;' }, `#${index}`), | ||
h('.w-100.bg-gray-light.mv1.ph1', post.content), | ||
h('.w-75.mv1.ph1', `Written by: ${post.sender}`), | ||
]); | ||
|
||
export default entry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* This file is part of the ALICE Electronic Logbook v2, also known as Jiskefet. | ||
* Copyright (C) 2020 Stichting Hogeschool van Amsterdam | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published | ||
* by the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
import { h } from '/js/src/index.js'; | ||
import PostBox from '../../../components/Post/index.js'; | ||
|
||
/** | ||
* A collection of details relating to a log | ||
* @param {object} model Pass the model to access the defined functions | ||
* @return {vnode} Return the view of the table with the filtering options | ||
*/ | ||
const overviewScreen = (model) => { | ||
const data = model.overview.getData(); | ||
const id = parseInt(model.router.params.id); | ||
let posts; | ||
|
||
data.forEach((entry) => { | ||
if (entry.entryID === id) { | ||
posts = entry.content; | ||
} | ||
}); | ||
|
||
return h('.w-100.flex-column', [posts.map((post, index) => h('.w-100', PostBox(post, index + 1)))]); | ||
}; | ||
|
||
export default (model) => [overviewScreen(model)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.