app/assist/render.js
//render reports list (admin)
render reports list (admin)
render reports list ( admin )
function reports(req, res, next) {
    var url_parts = url.parse(req.url, true);
    var active = 1;
    if(url_parts.query.active == 'not') {
        active = 0;
    }
    db.reports.findAll({
        where: {
            active: active
        },
        order: [['id', 'DESC']],
        include: [{model: db.admins}]
    }).then(function(reports) {
        var variables = {
            reports: reports,
            active: active,
            count: reports.length
        };
        res.render('admin/reports', variables);
    }, function(err) {
        console.log(err);
        errors.e500(req, res, next);
    });
}
function reports ( req , res , next ) { var url_parts = url . parse ( req . url , true ) ; var active = 1 ; if ( url_parts . query . active == 'not' ) { active = 0 ; } db . reports . findAll ( { where : { active : active } , order : [ [ 'id' , 'DESC' ] ] , include : [ { model : db . admins } ] } ) . then ( function ( reports ) { var variables = { reports : reports , active : active , count : reports . length } ; res . render ( 'admin/reports' , variables ) ; } , function ( err ) { console . log ( err ) ; errors . e500 ( req , res , next ) ; } ) ; }
render reports list (admin)
render reports list ( admin )