Skip to content

Commit

Permalink
fix bug & update templates
Browse files Browse the repository at this point in the history
  • Loading branch information
fundon committed Jul 28, 2012
1 parent 90d9681 commit 7ec0860
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
1 change: 1 addition & 0 deletions bin/npmv-cli.js
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -16,5 +16,6 @@
"express": "3.0.0rc1",
"jade": "*"
},
"bin": "./bin/npmv-cli.js",
"engines": { "node": ">= 0.8.0" }
}
11 changes: 8 additions & 3 deletions routes/index.js
Expand Up @@ -2,7 +2,8 @@
/*
* GET home page.
*/
var npmV = require('../lib/npmV.js');
var npmV = require('../lib/npmV.js')
, fs = require('fs');

exports.index = function(req, res){

Expand All @@ -25,15 +26,19 @@ exports.package = function (req, res) {
var fullpackage = package + '@' + version;

npmV.package(fullpackage, function (data) {
var packagejson = require(npmV.rootPath + '/' + package + '/package.json');

res.render('package', {
title: 'npmV is a visual interface for NPM.',
name: npmV.rootPath + '/' + fullpackage,
path: '',
name: fullpackage,
packages: packagejson.dependencies || [],
path: npmV.rootPath + '/' + package + '/node_modules',
//packages: data.dependencies,
//path: data.path,
//realPath: data.path,
depth: 1
});

});

};
3 changes: 2 additions & 1 deletion views/index.jade
@@ -1,8 +1,9 @@
extends layout

block content
p Welcome to Vnpm.
h1 Welcome to Vnpm.
h2= path
if packages.length
ul.packages
- for (var pkg in packages)
li
Expand Down
11 changes: 9 additions & 2 deletions views/package.jade
@@ -1,5 +1,12 @@
extends layout

block content
p Welcome to npmV.
h2 #{path} #{name}
h1 Welcome to npmV.
h2= name
p= path
if packages.length
ul.packages
- for (var pkg in packages)
li
//- a(href='/!##{pkg}@#{packages[pkg]}') #{pkg}@#{packages[pkg]}
a(href='/#{pkg}@#{packages[pkg]}', target="_blank") #{pkg}@#{packages[pkg]}

0 comments on commit 7ec0860

Please sign in to comment.