-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from karudedios/features/todo-edit
Features/todo edit
- Loading branch information
Showing
20 changed files
with
104 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
'use strict'; | ||
const Todo = require('./todo'); | ||
|
||
module.exports = class TodoDto { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'use strict'; | ||
|
||
const mongoose = require('mongoose'); | ||
const Schema = mongoose.Schema; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
'use strict'; | ||
const md5 = require('md5'); | ||
const User = require('./user'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
'use strict'; | ||
const crypto = require('crypto'); | ||
const mongoose = require('mongoose'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
'use strict'; | ||
const Q = require('q'); | ||
const Joi = require('joi'); | ||
const FindUser = require('./findUser'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
angular.module('todoApp') | ||
.value('Colors', | ||
[ | ||
{ | ||
name: 'Blue', | ||
colorCode: '#0000FF' | ||
}, | ||
{ | ||
name: 'Red', | ||
colorCode: '#FF0000' | ||
}, | ||
{ | ||
name: 'Yellow', | ||
colorCode: '#FFFF00' | ||
}, | ||
{ | ||
name: 'Blue Grey', | ||
colorCode: '#607D8B' | ||
}, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
34 changes: 34 additions & 0 deletions
34
public/sections/todo/directives/editcolor/todo.editcolor.modal.directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
angular.module('todoApp') | ||
.directive('myTodoEditColorModal', myTodoEditColorModal); | ||
|
||
function myTodoEditColorModal() { | ||
return { | ||
scope : { | ||
editColorModalId : '@', | ||
myTodo : '=', | ||
onSuccess : '&' | ||
}, | ||
templateUrl : 'sections/todo/directives/editcolor/todo.editcolor.modal.html', | ||
controller : ['$scope', 'Todo', 'Colors', myTodoEditColorModaController] | ||
} | ||
} | ||
|
||
function myTodoEditColorModaController($scope, Todo, Colors){ | ||
$scope.colors = Colors; | ||
$scope.editColor = editColor; | ||
|
||
function editColor(color){ | ||
Todo.update({_id : $scope.myTodo._id, color : color.colorCode}, function(doc){ | ||
if($scope.onSuccess){ | ||
$scope.onSuccess(doc); | ||
} | ||
Materialize.toast('The Color was Updated for Task: ' + doc.name, 4000) | ||
closeModal(); | ||
}); | ||
|
||
} | ||
|
||
function closeModal(){ | ||
$('#' + $scope.editColorModalId).closeModal(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
public/sections/todo/directives/editcolor/todo.editcolor.modal.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div id="{{editColorModalId}}" class="modal modal-editcolor"> | ||
<div class="modal-content"> | ||
<ul class="collection with-header "> | ||
<li class="collection-header center-align"><h5><strong>Select a Color</strong></h5></li> | ||
<li class="collection-item" ng-repeat="color in colors | filter : findTodo"> | ||
<a href="javascript:void(0);" style="background-color : {{color.colorCode}}; " class="material-icons tiny btn-floating"></a> | ||
<strong> {{color.name}}</strong> | ||
<a href="javascript:void(0);" ng-click="editColor(color);" | ||
class="secondary-content padding-edit-button"> | ||
<i class="material-icons">send</i> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,8 @@ | |
|
||
.padding-edit-button{ | ||
padding-top: 5px; | ||
} | ||
|
||
.modal-editcolor{ | ||
width : 300px; | ||
} |