-
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.
modified: Gemfile.lock -- bumped rails dependency version modified: app/assets/javascripts/angular/controllers/listen.js modified: app/assets/javascripts/app.js -- added in $rootScope and moved the debug function onto it (now available to all) modified: app/assets/javascripts/application.js -- moved angular inititization to end modified: app/assets/javascripts/angular/directives/directives.js -- properly set up this file to initialise with clobbering other modules and at the right time (we have a baw.directives module now) new file: app/assets/javascripts/angular/controllers/projects_manager.js renamed: app/assets/templates/project.html -> app/assets/templates/project_details.html renamed: app/assets/templates/projects.html -> app/assets/templates/projects_index.html new file: app/assets/templates/projects_manager.html -- created for crea task new file: app/assets/templates/record_information.html -- first attempt at a control (widget / directive)
- Loading branch information
Showing
9 changed files
with
169 additions
and
100 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
7 changes: 7 additions & 0 deletions
7
app/assets/javascripts/angular/controllers/projects_manager.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,7 @@ | ||
"use strict"; | ||
function ProjectsManagerCtrl($scope, $resource) { | ||
$scope.projectsResource = $resource('/projects', {}, { get: { method:'GET', params:{}, isArray: true }}); | ||
$scope.projects = $scope.projectsResource.get(); | ||
} | ||
|
||
ProjectsCtrl.$inject = ['$scope', '$resource']; |
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,27 +1,48 @@ | ||
|
||
// HACK: this is a very bad way to do this! | ||
bawApp.directive('nsDsFade', function() { | ||
return function(scope, element, attrs) { | ||
element.css('display', 'none'); | ||
scope.$watch(attrs.ngDsFade, function(value) { | ||
if (value) { | ||
element.fadeIn(200); | ||
} | ||
else { | ||
element.fadeOut(100); | ||
} | ||
}); | ||
} | ||
|
||
}); | ||
// .directive('uiToggle', [function() { | ||
// return function(scope, elm, attrs) { | ||
// scope.$watch(attrs.uiToggle, function(newVal, oldVal){ | ||
// if (newVal) { | ||
// elm.removeClass('ui-hide').addClass('ui-show'); | ||
// } else { | ||
// elm.removeClass('ui-show').addClass('ui-hide'); | ||
// } | ||
(function() { | ||
var bads = angular.module('bawApp.directives', []); | ||
|
||
bads.directive('addRedBox', function() { | ||
return function(scope, element, attrs){ | ||
element.append("<div style='background-color: red; height: 100px; width: 100px'></div>"); | ||
} | ||
}); | ||
|
||
bads.directive('recordInformation', function(){ | ||
return { | ||
restrict: 'AE', | ||
/*scope: false,*/ | ||
/* priority: ??? */ | ||
/* controller: ??? */ | ||
/* require: ??? */ | ||
/*template: "<div></div>",*/ | ||
templateUrl: "/assets/record_information.html" | ||
/*replace: false*/ | ||
/*compile: function(tElement, tAttrs, transclude) { | ||
},*/ | ||
/*link: function(scope, iElement, iAttrs, controller) { | ||
} */ | ||
|
||
} | ||
}); | ||
|
||
})(); | ||
|
||
//bawApp.directive('nsDsFade', function() { | ||
// return function(scope, element, attrs) { | ||
// element.css('display', 'none'); | ||
// scope.$watch(attrs.ngDsFade, function(value) { | ||
// if (value) { | ||
// element.fadeIn(200); | ||
// } | ||
// else { | ||
// element.fadeOut(100); | ||
// } | ||
// }); | ||
// } | ||
//}]); | ||
// | ||
//}); | ||
// | ||
|
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
39 changes: 20 additions & 19 deletions
39
app/assets/templates/projects.html → app/assets/templates/projects_index.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 |
---|---|---|
@@ -1,20 +1,21 @@ | ||
<div id="content" data-ng-controller="ProjectsCtrl"> | ||
<h1>Project List</h1> | ||
|
||
<p>These are the available projects.</p> | ||
|
||
<a href="/">Home</a> | ||
|
||
<ul id="project-list"> | ||
<li data-ng-repeat="project in projects"> | ||
<div> | ||
<h3><a data-ng-href="/projects/{{project.id}}" title="urn: {{project.urn}}">{{project.name}}</a></h3> | ||
<p data-ng-bind="project.description" ></p> | ||
<small>{{project.updated_at}}</small> | ||
<p ng-bind="project.sites.length" ></p> | ||
</div> | ||
<img class="thumb-image" ng-src="{{project.photos[0].uri}}" > | ||
</li> | ||
|
||
</ul> | ||
<div id="content" data-ng-controller="ProjectsCtrl"> | ||
<h1>Project List</h1> | ||
|
||
<p>These are the available projects.</p> | ||
|
||
<a href="/projects/manage">Manage projects</a> | ||
|
||
<ul id="project-list"> | ||
<li data-ng-repeat="project in projects"> | ||
<div> | ||
<h3><a data-ng-href="/projects/{{project.id}}" title="urn: {{project.urn}}">{{project.name}}</a></h3> | ||
<p data-ng-bind="project.description" ></p> | ||
<small>{{project.updated_at}}</small> | ||
<p ng-bind="project.sites.length" ></p> | ||
<p add-red-box style=""></p> | ||
</div> | ||
<img class="thumb-image" ng-src="{{project.photos[0].uri}}" > | ||
</li> | ||
|
||
</ul> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<div id="content" data-ng-controller="ProjectsManagerCtrl"> | ||
<h1>Project List</h1> | ||
|
||
<p>These are the available projects.</p> | ||
|
||
<a href="/">Home</a> | ||
|
||
<ul id="project-list"> | ||
<li data-ng-repeat="project in projects"> | ||
<div> | ||
<h3><a data-ng-href="/projects/{{project.id}}" title="urn: {{project.urn}}">{{project.name}}</a></h3> | ||
<p data-ng-bind="project.description" ></p> | ||
<small>{{project.updated_at}}</small> | ||
<a href="">details</a>  | ||
<a href="">edit</a>  | ||
<a href="">delete</a>  | ||
</div> | ||
<img class="thumb-image" ng-src="{{project.photos[0].uri}}" > | ||
</li> | ||
|
||
</ul> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div> | ||
modified<span>{{{project.updated_at}}</span> created<span></span> archived<span></span> | ||
</div> |