-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
62 additions
and
44 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
55 changes: 34 additions & 21 deletions
55
client/components/adminProjectList/adminProjectList.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 |
---|---|---|
@@ -1,32 +1,45 @@ | ||
'use strict'; | ||
|
||
angular.module('bitCrowdFundsApp') | ||
.directive('adminProjectList', function () { | ||
.directive('adminProjectList', function ($timeout) { | ||
return { | ||
//templateUrl: 'components/adminProjectList/adminProjectList.html', | ||
templateUrl: 'components/adminProjectList/adminProjectList.html', | ||
restrict: 'EA', | ||
//replace: true, | ||
//transclude: true, | ||
//scope: true | ||
scope: { | ||
projects: '=' | ||
}, | ||
//replace: true, | ||
//transclude: true, | ||
/*controller: function($scope) | ||
//template: '<div>this is my template</div>', | ||
/*scope: { | ||
project: '=' | ||
},*/ | ||
link: function (scope,el, attrs) | ||
{ | ||
$scope.$watch('projects', function(v) { | ||
$scope.projects = v; | ||
/*scope.$watch('project', function (newMyData) { | ||
//Build the table and insert it into DOM | ||
}); | ||
}*/ | ||
link: function(scope, element, attrs) | ||
{ | ||
element.text('<div>shit</div>'); | ||
scope.$on("Data_Ready", function () | ||
console.log("before: " + el.html()); | ||
$timeout(function() | ||
{ | ||
element.text('<div>shit</div>'); | ||
}); | ||
} | ||
console.log("After: " + el.html()); | ||
$timeout(function() | ||
{ | ||
console.log("After2: " + el.html()); | ||
}, 0); | ||
}, 0); | ||
$timeout(function () | ||
{ | ||
console.log('HERE'); | ||
});*/ | ||
}, | ||
/*template: | ||
[ | ||
//'<li class="list-group-item" ng-repeat=\'project in projects\'>', | ||
'<strong>', | ||
'<span class="label label-success" ng-show="project.amountRaised >= project.amountToRaise"> Finished</span>', | ||
'<span> clas="label label-warning" ng-show="project.amountRaised !== 0 && project.amountRaised < project.amountToRaise"> Ongoing</span>', | ||
'<span> class="label label-default" ng-show="project.amountRaised === 0"> Not started</span>', | ||
' ', | ||
'<span> {{project.name}} ({{project.amountRaised | toBTC}} / {{project.amountToRaise | toBTC}}</span>' | ||
].join('')*/ | ||
//template: 'test' | ||
}; | ||
}); |
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,22 +1,21 @@ | ||
li.list-group-item(ng-repeat='project in projects') | ||
strong | ||
span.label.label-success(ng-show="project.amountRaised >= project.amountToRaise") Finished | ||
span.label.label-warning(ng-show="project.amountRaised !== 0 && project.amountRaised < project.amountToRaise") Ongoing | ||
span.label.label-default(ng-show="project.amountRaised === 0") Not started | ||
| | ||
span {{project.name}} ({{project.amountRaised | toBTC}} / {{project.amountToRaise | toBTC}}) | ||
br | ||
small.text-muted | ||
span Project created | ||
| | ||
b(am-time-ago="project.dateCreat") | ||
| | ||
span and finishing | ||
| | ||
b(am-time-ago="project.dateEndCampaign") | ||
.pull-right | ||
a(ng-href='/projects/{{project.slug}}/edit') | ||
span.glyphicon.glyphicon-pencil | ||
| | ||
a.trash(ng-click='deleteProject(project)') | ||
span.glyphicon.glyphicon-trash | ||
strong | ||
span.label.label-success(ng-show="project.amountRaised >= project.amountToRaise") Finished | ||
span.label.label-warning(ng-show="project.amountRaised !== 0 && project.amountRaised < project.amountToRaise") Ongoing | ||
span.label.label-default(ng-show="project.amountRaised === 0") Not started | ||
| | ||
span {{project.name}} ({{project.amountRaised | toBTC}} / {{project.amountToRaise | toBTC}}) | ||
br | ||
small.text-muted | ||
span Project created | ||
| | ||
b(am-time-ago="project.dateCreat") | ||
| | ||
span and finishing | ||
| | ||
b(am-time-ago="project.dateEndCampaign") | ||
.pull-right | ||
a(ng-href='/projects/{{project.slug}}/edit') | ||
span.glyphicon.glyphicon-pencil | ||
| | ||
a.trash(ng-click='deleteProject(project)') | ||
span.glyphicon.glyphicon-trash |