diff --git a/my-todolist/.idea/workspace.xml b/my-todolist/.idea/workspace.xml index 52048cd..067cc7d 100644 --- a/my-todolist/.idea/workspace.xml +++ b/my-todolist/.idea/workspace.xml @@ -18,31 +18,41 @@ - + - - + + - + + + + + + + + + + + - - + + - - + + - - + + @@ -51,8 +61,8 @@ - - + + @@ -61,8 +71,18 @@ - - + + + + + + + + + + + + @@ -73,6 +93,7 @@ fs + multer @@ -80,11 +101,13 @@ @@ -119,7 +142,6 @@ - @@ -146,6 +168,20 @@ + + + + + + + + + + + + + + + + + - + @@ -267,11 +318,13 @@ + + - @@ -284,15 +337,16 @@ - + - - - + + + + - + - + @@ -300,7 +354,6 @@ - @@ -311,10 +364,28 @@ - + + + + + + + + + + + + + + + + + + @@ -347,14 +418,7 @@ - - - - - - - - + @@ -387,14 +451,7 @@ - - - - - - - - + @@ -427,14 +484,7 @@ - - - - - - - - + @@ -467,14 +517,7 @@ - - - - - - - - + @@ -506,14 +549,7 @@ - - - - - - - - + @@ -584,73 +620,104 @@ - + + + - - + + - + - + - + - + - + - - + + - + - + + + + + + - - + + - + - - + + - + - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + diff --git a/my-todolist/app.js b/my-todolist/app.js index 602febe..3aa28d0 100644 --- a/my-todolist/app.js +++ b/my-todolist/app.js @@ -1,19 +1,29 @@ var express = require('express'); +var multer=require('multer'); var session = require('cookie-session'); // Loads the piece of middleware for sessions var bodyParser = require('body-parser');// Loads the piece of middleware for managing the settings var mongoose=require('mongoose'); +var validator=require('validator'); +var fs= require('fs'); mongoose.connect('mongodb://localhost:27017/test'); var urlencodedParser = bodyParser.urlencoded({ extended: false }); //var fs = require('fs'); var app = express(); var Task=require('./model/task'); +var Step=require('./model/step'); +//console.log(Step); var router=express.Router(); +var ObjectId = require('mongodb').ObjectID; // var buf = new Buffer(1024); var id,id1=0; var arr=[],arr1=[],arr2=[],array1=[],array=[]; - var myo=new Object(); + var gfs; + //var myo=new Object(); /* If there is no to do list in the session, we create an empty one in the form of an array before continuing */ +app.use('/uploads',express.static(__dirname+"/upload")); +var upload=multer({dest:"./uploads/"}).array('name',1); + app.use(function(req, res, next){ arr=[]; arr1=[]; @@ -30,22 +40,21 @@ app.use(function(req, res, next){ } next(); -}) - -/* The to do list and the form are displayed */ -router.get('/todo', function(req, res) { -Task.find({},"-_id Todo",function(err,task){ - arr=task; - for (var i in arr) - { - //console.log(arr[i]); - var myo=new Object(); - myo=arr[i]; - arr1[i]=myo.Todo; - //console.log(myo.Todo); - } - //console.log(arr[1]); -}).limit(10); +}); +function addme(n,m,res) +{ + Task.find({},"-_id Todo",function(err,task){ + arr=task; + for (var i in arr) + { + //console.log(arr[i]); + var myo=new Object(); + myo=arr[i]; + arr1[i]=myo.Todo; + //console.log(myo.Todo); + } + //console.log(arr[1]); + }).skip(n).limit(m); Task.find({},"-_id Memberassigned",function(err,task){ arr=task; for (var i in arr) @@ -56,9 +65,9 @@ Task.find({},"-_id Todo",function(err,task){ array1[i]=myo.Memberassigned; //console.log(myo.Todo); } - // res.json(task); + // res.json(task); //array1=task - }).limit(10); + }).skip(n).limit(m); Task.find({},"_id",function(err,task){ arr=task; for (var i in arr) @@ -72,6 +81,7 @@ Task.find({},"-_id Todo",function(err,task){ // res.json(task); //array1=task }); + Task.find({},"-_id Priority",function(err,task){ arr=task; @@ -83,20 +93,103 @@ Task.find({},"-_id Todo",function(err,task){ arr2[i]=myo.Priority; //console.log(myo.Todo); } - }).sort({KEY:-1}).limit(10); + }).sort({KEY:1}).skip(n).limit(m); + + Step.find({},"-_id Steps",function(err,step){ + arr=step.Steps; + //console.log(arr); + }); res.render('todo.ejs',{todolist:arr1, priority: array1, member:arr2,index:array}); +} +/*router.get('/file/:id',function(req,res){ + var pic_id = req.param('id'); + var gfs = req.gfs; + + gfs.files.find({filename: pic_id}).toArray(function (err, files) { + + if (err) { + res.json(err); + } + if (files.length > 0) { + var mime = 'image/jpeg'; + res.set('Content-Type', mime); + var read_stream = gfs.createReadStream({filename: pic_id}); + read_stream.pipe(res); + } else { + res.json('File Not Found'); + } + }); +});*/ +// router.all('/upload',function(req,res){ +// var dirname=require('path').dirname(__dirname); +// var filename=req.files.file.name; +// var type=req.files.file.mimetype; +// var read_stream=fs.creeateReadStream(dirname+'/'+path); +// var conn=req.conn; +// var Grid=require('gridfs-stream'); +// Grid.mongo=mongoose.mongo; +// gfs=Grid(conn.db); +// var writestream=gfs.createWriteStream({ +// filename:filename +// }); +// read_stream.pipe(writestream); +// }); +/* The to do list and the form are displayed */ +router.get('/todo', function(req, res) { +addme(0,10,res); }); - router.get('/todo1', function(req, res) { +router.get('/todo/2', function(req, res) { + addme(10,10,res); +}); +router.get('/todo/3', function(req, res) { + addme(20,10,res); +}); +router.get('/todo1', function(req, res) { res.render('todo1.ejs'); }); /* Adding an item to the to do list */ router.post('/todo/add/', urlencodedParser, function(req, res) { + + //console.log(step); if (req.body.newtodo != '') { + // for(var i in req.body.) var task = new Task(); + var step= new Step(); + + //console.log(req.body.hid); + for (var i in req.body.hid) + { + var a=req.body.Step; + //console.log(req.body.Step); + step.Steps=a; + //step.Todo=task.Todo; + } task.Todo = req.body.newtodo; + console.log(req.body.newtodo); + task.File=req.body.name; task.Memberassigned = req.body.taskassigned; task.Priority = req.body.s1; + step.Todo=task.Todo; + step.save(function (err) { + if (!err) { + Step.find({}) + .populate('Todo') + .exec(function(error, task) { + console.log(JSON.stringify(task, null, "\t")) + }) + } + if (err) { + console.log(err); + } + console.log(step); + }); + upload(req,res,function(err){ + if(err){return res.end("error uploading file")} + res.end("file is uploaded"); + + }) task.save(function (err) { + if (err) { console.log(err); } @@ -104,41 +197,54 @@ router.post('/todo/add/', urlencodedParser, function(req, res) { }) } res.redirect('/api/todo'); -}) +}); + router.post('/todo/update/', urlencodedParser, function(req, res) { - Task.findById(id,function(err,task) - { + if(validator.isNumeric(req.body.updatedpriority)) { + Task.findById(id,function(err,task) { console.log(id); - if(err) - { + if (err) { res.send(err); } - task.Todo=req.body.updatedtodo; - task.Memberassigned=req.body.updatedmember; - task.Priority=req.body.updatedpriority; + task.Todo = req.body.updatedtodo; + task.Memberassigned = req.body.updatedmember; + task.Priority = req.body.updatedpriority; - task.save(function(err) - { - if(err) { + task.save(function (err) { + if (err) { throw err; } console.log(task); //res.json({message:'Bear updated!'}); }); - }) + } + ); res.redirect('/api/todo'); - }); + } + else + { + res.send("sorry no data updated"); + //alert("No data updated"); + res.redirect('/api/todo1') + }}); /* Deletes an item from the to do list */ router.get('/todo/delete/:id', function(req, res) { -console.log(req.params.id); - Task.remove(req.params.id); + console.log(req.params.id); + id=req.params.id; + Task.findByIdAndRemove(req.params.id,function(err,tasks){console.log(tasks);}); + +//Task.remove(); + //console.log(a); + res.redirect('/api/todo'); }); router.get('/todo/update/:id', function(req, res) { - id=req.params.id; - id1=1; + + id = req.params.id; + id1 = 1; + res.redirect('/api/todo1'); }); /* Redirects to the to do list if the page requested is not found */ @@ -154,5 +260,5 @@ else res.redirect('/api/todo1'); } }); -app.listen(8008); +app.listen(8010); \ No newline at end of file diff --git a/my-todolist/core/db.js b/my-todolist/core/db.js new file mode 100644 index 0000000..e69de29 diff --git a/my-todolist/login.ejs b/my-todolist/login.ejs new file mode 100644 index 0000000..de1da70 --- /dev/null +++ b/my-todolist/login.ejs @@ -0,0 +1,10 @@ +
+

+ +
+ +
+ +

+ +
\ No newline at end of file diff --git a/my-todolist/model/step.js b/my-todolist/model/step.js new file mode 100644 index 0000000..11fa579 --- /dev/null +++ b/my-todolist/model/step.js @@ -0,0 +1,10 @@ +var mongoose=require('mongoose'); +var Schema=mongoose.Schema; +var StepSchema= new Schema({ + Steps:String, + Todo:{ + type:mongoose.Schema.Types.ObjectId, + ref: 'Task' +} +}); +module.exports=mongoose.model('Step',StepSchema); \ No newline at end of file diff --git a/my-todolist/model/task.js b/my-todolist/model/task.js index eaa29f8..2891be2 100644 --- a/my-todolist/model/task.js +++ b/my-todolist/model/task.js @@ -3,7 +3,10 @@ var Schema=mongoose.Schema; var TaskSchema= new Schema({ Todo:String, Memberassigned:String, - Priority:Number + Priority:Number, + File:String }); +//var mongoose=require('mongoose'); +//var Schema=mongoose.Schema; module.exports=mongoose.model('Task',TaskSchema); \ No newline at end of file diff --git a/my-todolist/npm-debug.log b/my-todolist/npm-debug.log deleted file mode 100644 index f052a53..0000000 --- a/my-todolist/npm-debug.log +++ /dev/null @@ -1,113 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'install', 'mongoose' ] -2 info using npm@3.10.9 -3 info using node@v6.9.2 -4 silly loadCurrentTree Starting -5 silly install loadCurrentTree -6 silly install readLocalPackageData -7 silly fetchPackageMetaData mongoose@4.7,7 -8 silly fetchNamedPackageData mongoose -9 silly mapToRegistry name mongoose -10 silly mapToRegistry using default registry -11 silly mapToRegistry registry https://registry.npmjs.org/ -12 silly mapToRegistry data Result { -12 silly mapToRegistry raw: 'mongoose', -12 silly mapToRegistry scope: null, -12 silly mapToRegistry escapedName: 'mongoose', -12 silly mapToRegistry name: 'mongoose', -12 silly mapToRegistry rawSpec: '', -12 silly mapToRegistry spec: 'latest', -12 silly mapToRegistry type: 'tag' } -13 silly mapToRegistry uri https://registry.npmjs.org/mongoose -14 verbose request uri https://registry.npmjs.org/mongoose -15 verbose request no auth needed -16 info attempt registry request try #1 at 4:19:22 PM -17 verbose request id a669a724673e3f16 -18 verbose etag W/"587c3566-8641d" -19 verbose lastModified Mon, 16 Jan 2017 02:52:22 GMT -20 http request GET https://registry.npmjs.org/mongoose -21 http 200 https://registry.npmjs.org/mongoose -22 verbose headers { server: 'nginx/1.10.1', -22 verbose headers 'content-type': 'application/json', -22 verbose headers 'last-modified': 'Thu, 19 Jan 2017 09:43:05 GMT', -22 verbose headers etag: 'W/"58808a29-86430"', -22 verbose headers 'content-encoding': 'gzip', -22 verbose headers 'cache-control': 'max-age=300', -22 verbose headers 'content-length': '41827', -22 verbose headers 'accept-ranges': 'bytes', -22 verbose headers date: 'Thu, 19 Jan 2017 10:49:23 GMT', -22 verbose headers via: '1.1 varnish', -22 verbose headers age: '155', -22 verbose headers connection: 'keep-alive', -22 verbose headers 'x-served-by': 'cache-ams4444-AMS', -22 verbose headers 'x-cache': 'HIT', -22 verbose headers 'x-cache-hits': '2', -22 verbose headers 'x-timer': 'S1484822963.078661,VS0,VE0', -22 verbose headers vary: 'Accept-Encoding' } -23 silly get cb [ 200, -23 silly get { server: 'nginx/1.10.1', -23 silly get 'content-type': 'application/json', -23 silly get 'last-modified': 'Thu, 19 Jan 2017 09:43:05 GMT', -23 silly get etag: 'W/"58808a29-86430"', -23 silly get 'content-encoding': 'gzip', -23 silly get 'cache-control': 'max-age=300', -23 silly get 'content-length': '41827', -23 silly get 'accept-ranges': 'bytes', -23 silly get date: 'Thu, 19 Jan 2017 10:49:23 GMT', -23 silly get via: '1.1 varnish', -23 silly get age: '155', -23 silly get connection: 'keep-alive', -23 silly get 'x-served-by': 'cache-ams4444-AMS', -23 silly get 'x-cache': 'HIT', -23 silly get 'x-cache-hits': '2', -23 silly get 'x-timer': 'S1484822963.078661,VS0,VE0', -23 silly get vary: 'Accept-Encoding' } ] -24 verbose get saving mongoose to /home/lcom64/.npm/registry.npmjs.org/mongoose/.cache.json -25 verbose correctMkdir /home/lcom64/.npm correctMkdir not in flight; initializing -26 silly fetchPackageMetaData Error: No compatible version found: mongoose@4.7,7 -26 silly fetchPackageMetaData Valid install targets: -26 silly fetchPackageMetaData 4.7.7, 4.7.6, 4.7.5, 4.7.5-pre, 4.7.4, 4.7.3, 4.7.2, 4.7.1, 4.7.0, 4.6.8, 4.6.7, 4.6.6, 4.6.5, 4.6.4, 4.6.3, 4.6.2, 4.6.1, 4.6.0, 4.5.10, 4.5.9, 4.5.8, 4.5.7, 4.5.6, 4.5.5, 4.5.4, 4.5.3, 4.5.2, 4.5.1, 4.5.0, 4.4.20, 4.4.19, 4.4.18, 4.4.17, 4.4.16, 4.4.15, 4.4.14, 4.4.13, 4.4.12, 4.4.11, 4.4.10, 4.4.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.1.2, 1.1.1, 1.1.0, 1.0.16, 1.0.15, 1.0.14, 1.0.13, 1.0.12, 1.0.11, 1.0.10, 1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1 -26 silly fetchPackageMetaData -26 silly fetchPackageMetaData at pickVersionFromRegistryDocument (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:178:16) -26 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50 -26 silly fetchPackageMetaData at /usr/lib/node_modules/npm/lib/utils/pulse-till-done.js:20:8 -26 silly fetchPackageMetaData at saved (/usr/lib/node_modules/npm/lib/cache/caching-client.js:174:7) -26 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:241:18 -26 silly fetchPackageMetaData at FSReqWrap.oncomplete (fs.js:123:15) -26 silly fetchPackageMetaData error for mongoose@4.7,7 { Error: No compatible version found: mongoose@4.7,7 -26 silly fetchPackageMetaData Valid install targets: -26 silly fetchPackageMetaData 4.7.7, 4.7.6, 4.7.5, 4.7.5-pre, 4.7.4, 4.7.3, 4.7.2, 4.7.1, 4.7.0, 4.6.8, 4.6.7, 4.6.6, 4.6.5, 4.6.4, 4.6.3, 4.6.2, 4.6.1, 4.6.0, 4.5.10, 4.5.9, 4.5.8, 4.5.7, 4.5.6, 4.5.5, 4.5.4, 4.5.3, 4.5.2, 4.5.1, 4.5.0, 4.4.20, 4.4.19, 4.4.18, 4.4.17, 4.4.16, 4.4.15, 4.4.14, 4.4.13, 4.4.12, 4.4.11, 4.4.10, 4.4.9, 4.4.8, 4.4.7, 4.4.6, 4.4.5, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.7, 4.3.6, 4.3.5, 4.3.4, 4.3.3, 4.3.2, 4.3.1, 4.3.0, 4.2.10, 4.2.9, 4.2.8, 4.2.7, 4.2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0.0.3, 0.0.2, 0.0.1 -26 silly fetchPackageMetaData -26 silly fetchPackageMetaData at pickVersionFromRegistryDocument (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:178:16) -26 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50 -26 silly fetchPackageMetaData at /usr/lib/node_modules/npm/lib/utils/pulse-till-done.js:20:8 -26 silly fetchPackageMetaData at saved (/usr/lib/node_modules/npm/lib/cache/caching-client.js:174:7) -26 silly fetchPackageMetaData at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:241:18 -26 silly fetchPackageMetaData at FSReqWrap.oncomplete (fs.js:123:15) code: 'ETARGET' } -27 silly rollbackFailedOptional Starting -28 silly rollbackFailedOptional Finishing -29 silly runTopLevelLifecycles Finishing -30 silly install printInstalled -31 verbose stack Error: No compatible version found: mongoose@4.7,7 -31 verbose stack Valid install targets: -31 verbose stack 4.7.7, 4.7.6, 4.7.5, 4.7.5-pre, 4.7.4, 4.7.3, 4.7.2, 4.7.1, 4.7.0, 4.6.8, 4.6.7, 4.6.6, 4.6.5, 4.6.4, 4.6.3, 4.6.2, 4.6.1, 4.6.0, 4.5.10, 4.5.9, 4.5.8, 4.5.7, 4.5.6, 4.5.5, 4.5.4, 4.5.3, 4.5.2, 4.5.1, 4.5.0, 4.4.20, 4.4.19, 4.4.18, 4.4.17, 4.4.16, 4.4.15, 4.4.14, 4.4.13, 4.4.12, 4.4.11, 4.4.10, 4.4.9, 4.4.8, 4.4.7, 4.4.6, 4.4.5, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.7, 4.3.6, 4.3.5, 4.3.4, 4.3.3, 4.3.2, 4.3.1, 4.3.0, 4.2.10, 4.2.9, 4.2.8, 4.2.7, 4.2.6, 4.2.5, 4.2.4, 4.2.3, 4.2.2, 4.2.1, 4.2.0, 4.1.12, 4.1.11, 4.1.10, 4.1.9, 4.1.8, 4.1.7, 4.1.6, 4.1.5, 4.1.3, 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7.1, 2.7.0, 2.6.8, 2.6.7, 2.6.6, 2.6.5, 2.6.4, 2.6.3, 2.6.2, 2.6.1, 2.6.0, 2.5.14, 2.5.13, 2.5.12, 2.5.11, 2.5.10, 2.5.9, 2.5.8, 2.5.7, 2.5.6, 2.5.5, 2.5.4, 2.5.3, 2.5.2, 2.5.1, 2.5.0, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.3.13, 2.3.12, 2.3.11, 2.3.10, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.1.4, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.8.4, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.4, 1.7.3, 1.7.2, 1.6.0, 1.5.0, 1.4.0, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.0, 1.1.25, 1.1.24, 1.1.23, 1.1.22, 1.1.21, 1.1.20, 1.1.19, 1.1.18, 1.1.17, 1.1.16, 1.1.15, 1.1.14, 1.1.13, 1.1.12, 1.1.11, 1.1.10, 1.1.9, 1.1.8, 1.1.7, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.16, 1.0.15, 1.0.14, 1.0.13, 1.0.12, 1.0.11, 1.0.10, 1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1 -31 verbose stack -31 verbose stack at pickVersionFromRegistryDocument (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:178:16) -31 verbose stack at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50 -31 verbose stack at /usr/lib/node_modules/npm/lib/utils/pulse-till-done.js:20:8 -31 verbose stack at saved (/usr/lib/node_modules/npm/lib/cache/caching-client.js:174:7) -31 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:241:18 -31 verbose stack at FSReqWrap.oncomplete (fs.js:123:15) -32 verbose cwd /home/lcom64/Documents/my-todolist -33 error Linux 4.4.0-57-generic -34 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "mongoose" -35 error node v6.9.2 -36 error npm v3.10.9 -37 error code ETARGET -38 error notarget No compatible version found: mongoose@4.7,7 -38 error notarget Valid install targets: -38 error notarget 4.7.7, 4.7.6, 4.7.5, 4.7.5-pre, 4.7.4, 4.7.3, 4.7.2, 4.7.1, 4.7.0, 4.6.8, 4.6.7, 4.6.6, 4.6.5, 4.6.4, 4.6.3, 4.6.2, 4.6.1, 4.6.0, 4.5.10, 4.5.9, 4.5.8, 4.5.7, 4.5.6, 4.5.5, 4.5.4, 4.5.3, 4.5.2, 4.5.1, 4.5.0, 4.4.20, 4.4.19, 4.4.18, 4.4.17, 4.4.16, 4.4.15, 4.4.14, 4.4.13, 4.4.12, 4.4.11, 4.4.10, 4.4.9, 4.4.8, 4.4.7, 4.4.6, 4.4.5, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.7, 4.3.6, 4.3.5, 4.3.4, 4.3.3, 4.3.2, 4.3.1, 4.3.0, 4.2.10, 4.2.9, 4.2.8, 4.2.7, 4.2.6, 4.2.5, 4.2.4, 4.2.3, 4.2.2, 4.2.1, 4.2.0, 4.1.12, 4.1.11, 4.1.10, 4.1.9, 4.1.8, 4.1.7, 4.1.6, 4.1.5, 4.1.3, 4.1.2, 4.1.1, 4.1.0, 4.0.8, 4.0.7, 4.0.6, 4.0.5, 4.0.4, 4.0.3, 4.0.2, 4.0.1, 4.0.0, 4.0.0-rc4, 4.0.0-rc3, 4.0.0-rc2, 4.0.0-rc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.5.7, 2.5.6, 2.5.5, 2.5.4, 2.5.3, 2.5.2, 2.5.1, 2.5.0, 2.4.10, 2.4.9, 2.4.8, 2.4.7, 2.4.6, 2.4.5, 2.4.4, 2.4.3, 2.4.2, 2.4.1, 2.4.0, 2.3.13, 2.3.12, 2.3.11, 2.3.10, 2.3.9, 2.3.8, 2.3.7, 2.3.6, 2.3.5, 2.3.4, 2.3.3, 2.3.2, 2.3.1, 2.3.0, 2.2.4, 2.2.3, 2.2.2, 2.2.1, 2.2.0, 2.1.4, 2.1.3, 2.1.2, 2.1.1, 2.1.0, 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.8.4, 1.8.3, 1.8.2, 1.8.1, 1.8.0, 1.7.4, 1.7.3, 1.7.2, 1.6.0, 1.5.0, 1.4.0, 1.3.7, 1.3.6, 1.3.5, 1.3.4, 1.3.3, 1.3.2, 1.3.1, 1.3.0, 1.2.0, 1.1.25, 1.1.24, 1.1.23, 1.1.22, 1.1.21, 1.1.20, 1.1.19, 1.1.18, 1.1.17, 1.1.16, 1.1.15, 1.1.14, 1.1.13, 1.1.12, 1.1.11, 1.1.10, 1.1.9, 1.1.8, 1.1.7, 1.1.6, 1.1.5, 1.1.4, 1.1.3, 1.1.2, 1.1.1, 1.1.0, 1.0.16, 1.0.15, 1.0.14, 1.0.13, 1.0.12, 1.0.11, 1.0.10, 1.0.8, 1.0.7, 1.0.6, 1.0.5, 1.0.4, 1.0.3, 1.0.2, 1.0.1, 1.0.0, 0.0.6, 0.0.5, 0.0.4, 0.0.3, 0.0.2, 0.0.1 -39 error notarget This is most likely not a problem with npm itself. -39 error notarget In most cases you or one of your dependencies are requesting -39 error notarget a package version that doesn't exist. -40 verbose exit [ 1, true ] diff --git a/my-todolist/package.json b/my-todolist/package.json index 794edc0..86d5a30 100644 --- a/my-todolist/package.json +++ b/my-todolist/package.json @@ -1,13 +1,17 @@ { - "name": "my-todolist", - "version": "0.1.0", - "dependencies": { - "express": "~4.11.0", - "ejs": "~2.1.4", - "mongoose":"4.7,7", - "cookie-session": "~1.1.0", - "body-parser": "~1.10.1" - }, - "author": "Mateo21 ", - "description": "A very basic to do list manager" -} \ No newline at end of file + "name": "my-todolist", + "version": "0.1.0", + "dependencies": { + "body-parser": "~1.10.1", + "cookie-session": "~1.1.0", + "ejs": "~2.1.4", + "express": "~4.11.0", + "mongoose": "4.7,7", + "multer": "^1.2.1", + "validator": "6.2.1", + "path":"0.12.7", + "fs":"0.0.1" + }, + "author": "Mateo21 ", + "description": "A very basic to do list manager" +} diff --git a/my-todolist/settings.js b/my-todolist/settings.js new file mode 100644 index 0000000..e69de29 diff --git a/my-todolist/uploads/27972f066b700a1fd1683483f56c1fc5 b/my-todolist/uploads/27972f066b700a1fd1683483f56c1fc5 new file mode 100644 index 0000000..9cbad1f Binary files /dev/null and b/my-todolist/uploads/27972f066b700a1fd1683483f56c1fc5 differ diff --git a/my-todolist/uploads/33cbf6c3f892f7725ea81c0598c9df5c b/my-todolist/uploads/33cbf6c3f892f7725ea81c0598c9df5c new file mode 100644 index 0000000..9cbad1f Binary files /dev/null and b/my-todolist/uploads/33cbf6c3f892f7725ea81c0598c9df5c differ diff --git a/my-todolist/uploads/451cdc0ede49ced713c96a9c53db217f b/my-todolist/uploads/451cdc0ede49ced713c96a9c53db217f new file mode 100644 index 0000000..33e1e61 Binary files /dev/null and b/my-todolist/uploads/451cdc0ede49ced713c96a9c53db217f differ diff --git a/my-todolist/uploads/b9e1efefb791e1352feaeba034497c49 b/my-todolist/uploads/b9e1efefb791e1352feaeba034497c49 new file mode 100644 index 0000000..9cbad1f Binary files /dev/null and b/my-todolist/uploads/b9e1efefb791e1352feaeba034497c49 differ diff --git a/my-todolist/uploads/eae94ed0e2e5bbebd4a6b4644be0a62e b/my-todolist/uploads/eae94ed0e2e5bbebd4a6b4644be0a62e new file mode 100644 index 0000000..33e1e61 Binary files /dev/null and b/my-todolist/uploads/eae94ed0e2e5bbebd4a6b4644be0a62e differ diff --git a/my-todolist/views/todo.ejs b/my-todolist/views/todo.ejs index 529d03e..c9e3827 100644 --- a/my-todolist/views/todo.ejs +++ b/my-todolist/views/todo.ejs @@ -16,17 +16,49 @@ <% priority.forEach(function(p,index2){%> <% member.forEach(function(m,index3){%> <% index.forEach(function(l,index4){%> + + <% if((index1==index2) && (index2==index3)&&(index3==index4)){%>
  • delete update <%= todo %> <%=p %> <%=m %>
  • <%}})})})});%> + 1 + 2 + 3 -
    -

    - + + +

    +
    + +
    +

    + +

    + + Priority: -

    \ No newline at end of file