ajout de la page divers + lien de retour

This commit is contained in:
Antoine WEBER 2015-10-07 18:03:22 +02:00
parent e782a359c4
commit e603610448
8 changed files with 21 additions and 12 deletions

1
app.js
View File

@ -52,6 +52,7 @@ app.use('/channel', require('./routes/channel'));
app.use('/movie', require('./routes/movie')); app.use('/movie', require('./routes/movie'));
app.use('/show_list', require('./routes/show_list')); app.use('/show_list', require('./routes/show_list'));
app.use('/show', require('./routes/show')); app.use('/show', require('./routes/show'));
app.use('/divers', require('./routes/divers'));
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function(req, res, next) {

View File

@ -18,7 +18,7 @@ function humanFileSize(bytes, si) {
} }
/* GET home page. */ /* 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 config = res.locals.config;
var db = config.init_db(); var db = config.init_db();
@ -41,7 +41,7 @@ router.get('/:id', function(req, res, next) {
row.file.push(ligne); row.file.push(ligne);
},function(){ },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 });
}); });
}); });

View File

@ -16,7 +16,7 @@ function addZero(v) {
}; };
/* GET home page. */ /* 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 config = res.locals.config;
var db = config.init_db(); var db = config.init_db();
var data = []; var data = [];
@ -58,7 +58,8 @@ router.get('/:id', function(req, res, next) {
} }
res.render('show',{ res.render('show',{
title: titre, title: titre,
videos: data videos: data,
channel_id: req.params.incoming_chan
}); });
}); });

View File

@ -20,7 +20,7 @@ router.get('/:id', function(req, res, next) {
//aprés toute les opération de la base //aprés toute les opération de la base
function(){ function(){
console.log(shows); 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 });
}); });
}); });

View File

@ -13,7 +13,7 @@ block content
each video, i in videos each video, i in videos
tr tr
td td
a(href="/movie/#{video.id}")= video.title a(href="/movie/#{video.id}/#{channel.id}")= video.title
td= video.duree td= video.duree
td= video.year td= video.year
script. script.

View File

@ -3,26 +3,30 @@ extends layout
block content block content
h1= movie.title h1= movie.title
a(href="/channel/#{channel_id}") Retour à la liste
br
br
label Note label Note
p= movie.rating p= movie.rating
label Télécharger label Télécharger
br br
each file, i in movie.file 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
br
label Résumé label Résumé
p= movie.summary p= movie.summary
br br
br
label Genre label Genre
each tag, i in movie.tags_genre each tag, i in movie.tags_genre
if(tag!='') if(tag!='')
span= tag span= tag
|   |  
br br
br
label Acteurs label Acteurs
each tag, i in movie.tags_star each tag, i in movie.tags_star
if(tag!='') if(tag!='')

View File

@ -3,6 +3,9 @@ extends layout
block content block content
h1= title 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%") table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%")
thead thead
tr tr
@ -13,7 +16,7 @@ block content
each video, i in videos each video, i in videos
tr tr
td td
a(href="/movie/#{video.id}")= video.titre a(href="/movie/#{video.id}/#{channel_id}")= video.titre
td= video.season_episode td= video.season_episode
td= video.duree td= video.duree
script. script.

View File

@ -12,7 +12,7 @@ block content
each show, i in shows each show, i in shows
tr tr
td td
a(href="/show/#{show.id}")= show.title a(href="/show/#{show.id}/#{channel}")= show.title
td= show.year td= show.year
script. script.
$(document).ready(function() { $(document).ready(function() {