From e603610448612cc78e07e6b21f45b19ea9097057 Mon Sep 17 00:00:00 2001 From: Antoine WEBER Date: Wed, 7 Oct 2015 18:03:22 +0200 Subject: [PATCH] ajout de la page divers + lien de retour --- app.js | 1 + routes/movie.js | 4 ++-- routes/show.js | 5 +++-- routes/show_list.js | 2 +- views/channel.jade | 2 +- views/movie.jade | 12 ++++++++---- views/show.jade | 5 ++++- views/show_list.jade | 2 +- 8 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app.js b/app.js index 28cfb98..9a71faf 100644 --- a/app.js +++ b/app.js @@ -52,6 +52,7 @@ app.use('/channel', require('./routes/channel')); app.use('/movie', require('./routes/movie')); app.use('/show_list', require('./routes/show_list')); app.use('/show', require('./routes/show')); +app.use('/divers', require('./routes/divers')); // catch 404 and forward to error handler app.use(function(req, res, next) { diff --git a/routes/movie.js b/routes/movie.js index 368a512..c5b6e4a 100644 --- a/routes/movie.js +++ b/routes/movie.js @@ -18,7 +18,7 @@ function humanFileSize(bytes, si) { } /* GET home page. */ -router.get('/:id', function(req, res, next) { +router.get('/:id/:incoming_chan', function(req, res, next) { var config = res.locals.config; var db = config.init_db(); @@ -41,7 +41,7 @@ router.get('/:id', function(req, res, next) { row.file.push(ligne); },function(){ - res.render('movie', { title: 'Détail vidéo',movie: row }); + res.render('movie', { title: 'Détail vidéo',movie: row,channel_id: req.params.incoming_chan }); }); }); diff --git a/routes/show.js b/routes/show.js index c1c2520..c171ef0 100644 --- a/routes/show.js +++ b/routes/show.js @@ -16,7 +16,7 @@ function addZero(v) { }; /* GET home page. */ -router.get('/:id', function(req, res, next) { +router.get('/:id/:incoming_chan', function(req, res, next) { var config = res.locals.config; var db = config.init_db(); var data = []; @@ -58,7 +58,8 @@ router.get('/:id', function(req, res, next) { } res.render('show',{ title: titre, - videos: data + videos: data, + channel_id: req.params.incoming_chan }); }); diff --git a/routes/show_list.js b/routes/show_list.js index 67e18e6..a1aa1a2 100644 --- a/routes/show_list.js +++ b/routes/show_list.js @@ -20,7 +20,7 @@ router.get('/:id', function(req, res, next) { //aprés toute les opération de la base function(){ console.log(shows); - res.render('show_list', { title: 'Liste des séries',shows: shows }); + res.render('show_list', { title: 'Liste des séries',shows: shows, channel: req.params.id }); }); }); diff --git a/views/channel.jade b/views/channel.jade index 0ddfbb6..6f07a9a 100644 --- a/views/channel.jade +++ b/views/channel.jade @@ -13,7 +13,7 @@ block content each video, i in videos tr td - a(href="/movie/#{video.id}")= video.title + a(href="/movie/#{video.id}/#{channel.id}")= video.title td= video.duree td= video.year script. diff --git a/views/movie.jade b/views/movie.jade index 7dc1c00..156c3f2 100644 --- a/views/movie.jade +++ b/views/movie.jade @@ -3,26 +3,30 @@ extends layout block content h1= movie.title + a(href="/channel/#{channel_id}") Retour à la liste + br + br + label Note p= movie.rating label Télécharger br each file, i in movie.file - a(href="/file/#{file.id}/#{file.filename}") #{file.size} #{file.filename} + a(href="/file/#{file.id}/#{file.filename}") #{file.size} #{file.filename} br - + br label Résumé p= movie.summary br - + br label Genre each tag, i in movie.tags_genre if(tag!='') span= tag |   br - + br label Acteurs each tag, i in movie.tags_star if(tag!='') diff --git a/views/show.jade b/views/show.jade index 47b1e7e..6dc0c9d 100644 --- a/views/show.jade +++ b/views/show.jade @@ -3,6 +3,9 @@ extends layout block content h1= title + a(href="/channel/#{channel_id}") Retour à la liste des séries + br + table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%") thead tr @@ -13,7 +16,7 @@ block content each video, i in videos tr td - a(href="/movie/#{video.id}")= video.titre + a(href="/movie/#{video.id}/#{channel_id}")= video.titre td= video.season_episode td= video.duree script. diff --git a/views/show_list.jade b/views/show_list.jade index 9d67806..73e1c48 100644 --- a/views/show_list.jade +++ b/views/show_list.jade @@ -12,7 +12,7 @@ block content each show, i in shows tr td - a(href="/show/#{show.id}")= show.title + a(href="/show/#{show.id}/#{channel}")= show.title td= show.year script. $(document).ready(function() {