forked from CMU-313/cmu-313-f24-nodebb-f24-NodeBB
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routes and Controllers for the new Additional Information Page #34
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
c8dbc9c
working on route and controller for the Additional Info button
d7a5e4f
trying new ideas for routes
ea50aeb
updated plugin.json
20fc750
Updated plugin.json and the index controller file
c3b74cd
Updated controlelr file
658359a
more status on routes and controllers
2a6d179
Currently stuck here
0b4c78e
Fixed lint errors
2b7f502
added to read.yml
265ecc6
added route and yaml
1b90ea6
updated yaml
aa2b61f
Updated controller file
846b44e
updated route file
61cb29c
site down, working on controller
b639c96
wrote controller test
2362537
added another test
8937bd9
lint error fixes
6f284b4
fixed lint errors and updated controller file because it couldn't fin…
cbcf448
IT WORKS, had incorrect file location for the controllers file in the…
e021d17
fixed lint error
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"id": "nodebb-plugin-additional-info", | ||
"name": "NodeBB Additional Info", | ||
"description": "Adds an additional info page", | ||
"hooks": [ | ||
{ | ||
"hook": "static:app.load", | ||
"method": "init" | ||
} | ||
], | ||
"library": "./src/controllers/index.js", | ||
"routes": { | ||
"/additional-info": { | ||
"method": "get", | ||
"handler": "./src/controllers/additional-info" | ||
} | ||
}, | ||
"admin": { | ||
"modules": { | ||
"settings": "./src/admin/settings" | ||
} | ||
}, | ||
"dependencies": {}, | ||
"keywords": [] | ||
} | ||
|
||
|
||
|
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,18 @@ | ||
paths: | ||
/api/additional-info: | ||
get: | ||
summary: Get Additional Information | ||
description: Returns additional information for the user. | ||
operationId: getAdditionalInfo | ||
responses: | ||
'200': | ||
description: A JSON object containing additional information. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
info: | ||
type: string | ||
example: "This is the additional information." | ||
|
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,15 @@ | ||
'use strict'; | ||
|
||
// generated by chatGPT | ||
const additionalInfoController = module.exports; | ||
|
||
additionalInfoController.get = async function (req, res) { | ||
// You can customize the data being sent to the template | ||
const data = { | ||
title: 'Additional Information', | ||
}; | ||
|
||
// Render the additional-info template without the 'templates/' prefix | ||
res.render('additional-info', data); | ||
}; | ||
|
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
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: we can probably remove this empty line but everything else lgtm!