Skip to content
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

text button earlier changes #40

Open
wants to merge 2 commits into
base: f24
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Controllers.osd = require('./osd');
Controllers['404'] = require('./404');
Controllers.errors = require('./errors');
Controllers.composer = require('./composer');
Controllers.resourcesButton = require('./resources-button');

Controllers.write = require('./write');

Expand Down
12 changes: 12 additions & 0 deletions src/controllers/resources-button.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use strict';

const controllers = {};

Check failure on line 3 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 0 tabs but found 1 space

controllers.getResourcesButtonPage = async (req, res) => {

Check failure on line 5 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 0 tabs but found 1 space
// Render the resources-button template

Check failure on line 6 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Mixed spaces and tabs
res.render('resources-button', {

Check failure on line 7 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Mixed spaces and tabs
title: 'Resources Page', // You can customize the title or add more data as needed

Check failure on line 8 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Mixed spaces and tabs
});

Check failure on line 9 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Mixed spaces and tabs
};

Check failure on line 10 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 0 tabs but found 1 space

module.exports = controllers;

Check failure on line 12 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 0 tabs but found 1 space

Check failure on line 12 in src/controllers/resources-button.js

View workflow job for this annotation

GitHub Actions / test

Newline required at end of file but not found
4 changes: 3 additions & 1 deletion src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const winston = require('winston');
const path = require('path');
const express = require('express');

const resourcesButtonController = require('../controllers/resources-button');
const meta = require('../meta');
const controllers = require('../controllers');
const controllerHelpers = require('../controllers/helpers');
Expand Down Expand Up @@ -80,6 +80,8 @@
setupPageRoute(app, '/recent', [], controllers.recent.get);
setupPageRoute(app, '/top', [], controllers.top.get);
setupPageRoute(app, '/unread', [middleware.ensureLoggedIn], controllers.unread.get);
setupPageRoute(app, '/resources-button', [], resourcesButtonController.getResourcesButtonPage);

Check failure on line 83 in src/routes/index.js

View workflow job for this annotation

GitHub Actions / test

Block must not be padded by blank lines

};

_mounts.category = (app, name, middleware, controllers) => {
Expand Down
22 changes: 22 additions & 0 deletions src/views/resources-button.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{title}}</title>
</head>
<body>
<div class="container">
<h1>Resources</h1>
<p>Welcome to the resources page! Here you can find various links and materials.</p>

<h2>Useful Links</h2>
<ul>
<li><a href="https://example.com" target="_blank">Example Link 1</a></li>
<li><a href="https://example.com" target="_blank">Example Link 2</a></li>
<li><a href="https://example.com" target="_blank">Example Link 3</a></li>
</ul>
<!-- Add more sections as needed -->
</div>
</body>
</html>