Skip to content

Commit 420be6e

Browse files
Added courses template
Co-authored-by: Francisco Ortiz <fortizabril@gmail.com>
1 parent ba63a67 commit 420be6e

5 files changed

Lines changed: 44 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"scripts": {
1414
"dev": "NODE_ENV=dev ts-node-dev --ignore-watch node_modules --inspect=0.0.0.0:9267 ./src/apps/mooc_backend/server.ts",
15-
"dev:backoffice:frontend": "NODE_ENV=dev ts-node-dev --ignore-watch node_modules --inspect=0.0.0.0:9267 ./src/apps/backoffice/frontend/server.ts",
15+
"dev:backoffice:frontend": "NODE_ENV=dev ts-node-dev --ignore-watch node_modules ./src/apps/backoffice/frontend/server.ts",
1616
"test": "npm run test:unit && npm run test:features",
1717
"test:unit": "NODE_ENV=test jest",
1818
"test:features": "NODE_ENV=test cucumber-js -p default",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Request, Response } from 'express';
2+
import { CoursesCounterFinder } from '../../../../Contexts/Mooc/CoursesCounter/application/Find/CoursesCounterFinder';
3+
4+
export class CoursesGetController {
5+
constructor(private coursesCounterFinder: CoursesCounterFinder) {}
6+
7+
async run(req: Request, res: Response) {
8+
// const courses = await this.coursesCounterFinder.run();
9+
10+
res.render('pages/courses', {
11+
title: 'Welcome',
12+
description: 'CodelyTV - Backoffice',
13+
courses_counter: 0,
14+
new_course_id: 'xxxx'
15+
});
16+
}
17+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Express } from 'express';
2+
import container from '../config/dependency-injection';
3+
import { CoursesGetController } from '../controllers/CoursesGetController';
4+
5+
export const register = (app: Express) => {
6+
const controller: CoursesGetController = container.get('Apps.Backoffice.Frontend.controllers.CoursesGetController');
7+
app.get('/courses', controller.run.bind(controller));
8+
};
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{% extends '../master.html' %}
2+
3+
{% block page_title %}Cursos{% endblock %}
4+
5+
{% block main %}
6+
<div class="max-w-sm rounded overflow-hidden shadow-lg float-left">
7+
<img class="w-full" src="https://codely.tv/pro/img/bg/cursos-codelytv-pro.png" alt="Sunset in the mountains">
8+
<div class="px-6 py-4">
9+
<div class="font-bold text-xl mb-2">Cursos</div>
10+
<p class="text-gray-700 text-base">
11+
Actualmente CodelyTV Pro cuenta con <b>{{ courses_counter }}</b> cursos.
12+
</p>
13+
</div>
14+
</div>
15+
<div class="clearfix mb-10"></div>
16+
<hr class="mb-10">
17+
{% endblock %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)