-
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.
Worked on List, edit, show UI for Projects, Sits, Photos, Bookmarks, …
…Tags, AudioEvents. Details and edit are on the same page now. modified: Gemfile modified: Gemfile.lock new file: app/assets/javascripts/angular/controllers/audio_events.js new file: app/assets/javascripts/angular/controllers/bookmarks.js deleted: app/assets/javascripts/angular/controllers/photo.js modified: app/assets/javascripts/angular/controllers/photos.js modified: app/assets/javascripts/angular/controllers/projects.js modified: app/assets/javascripts/angular/controllers/sites.js modified: app/assets/javascripts/angular/controllers/tags.js modified: app/assets/javascripts/angular/services/services.js modified: app/assets/javascripts/app.js modified: app/assets/stylesheets/_layout.css.scss renamed: app/assets/javascripts/angular/controllers/recording.js -> app/assets/templates/bookmark_details.html renamed: app/assets/templates/search_show.html -> app/assets/templates/bookmarks_list.html modified: app/assets/templates/home.html renamed: app/assets/templates/photo.html -> app/assets/templates/photo_details.html deleted: app/assets/templates/photos.html new file: app/assets/templates/photos_list.html new file: app/assets/templates/project_details.html deleted: app/assets/templates/project_edit.html deleted: app/assets/templates/project_show.html modified: app/assets/templates/projects_list.html renamed: app/assets/templates/tags.html -> app/assets/templates/search_details.html new file: app/assets/templates/site_details.html deleted: app/assets/templates/site_edit.html deleted: app/assets/templates/site_show.html new file: app/assets/templates/tag_details.html new file: app/assets/templates/tags_list.html modified: app/models/project.rb
- Loading branch information
Mark Cottman-Fields
committed
Jan 7, 2013
1 parent
cb2a691
commit bdab4af
Showing
27 changed files
with
458 additions
and
237 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
app/assets/javascripts/angular/controllers/audio_events.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,29 @@ | ||
"use strict"; | ||
|
||
function AudioEventsCtrl($scope, $resource, Project) { | ||
$scope.audioEventsResource = $resource('/audioEvents', {}); | ||
$scope.audioEvents = $scope.audioEventsResource.query(); | ||
|
||
$scope.links = function(key) { | ||
return AudioEventsCtrl.linkList(this.audioEvent.id)[key]; | ||
}; | ||
|
||
$scope.delete = function(id) { | ||
alert("deleting audio event {0}!".format(id)); | ||
}; | ||
} | ||
|
||
AudioEventsCtrl.linkList = function (id) { | ||
return { | ||
edit: '/audioEvents/' + id + '/edit', | ||
details: '/audioEvents/' + id | ||
}; | ||
}; | ||
|
||
AudioEventsCtrl.$inject = ['$scope', '$resource', 'AudioEvent']; | ||
|
||
function AudioEventCtrl($scope, $resource, $routeParams, AudioEvent) { | ||
|
||
} | ||
|
||
AudioEventCtrl.$inject = ['$scope', '$resource', '$routeParams', 'AudioEvent']; |
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,28 @@ | ||
"use strict"; | ||
|
||
function BookmarksCtrl($scope, $resource, Bookmark) { | ||
$scope.bookmarksResource = $resource('/bookmarks', {}); | ||
$scope.bookmarks = $scope.bookmarksResource.query(); | ||
|
||
$scope.links = function(key) { | ||
return BookmarksCtrl.linkList(this.bookmark.id)[key]; | ||
}; | ||
|
||
$scope.delete = function(id) { | ||
alert("deleting bookmark {0}!".format(id)); | ||
}; | ||
} | ||
|
||
BookmarksCtrl.linkList = function (id) { | ||
return { | ||
edit: '/bookmarks/' + id + '/edit', | ||
details: '/bookmarks/' + id | ||
}; | ||
}; | ||
|
||
BookmarksCtrl.$inject = ['$scope', '$resource', 'Bookmark']; | ||
|
||
function BookmarkCtrl($scope, $resource, $routeParams, Bookmark) { | ||
} | ||
|
||
BookmarkCtrl.$inject = ['$scope', '$resource', '$routeParams', 'Bookmark']; |
This file was deleted.
Oops, something went wrong.
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,7 +1,74 @@ | ||
"use strict"; | ||
function PhotosCtrl($scope, $resource) { | ||
$scope.photosResource = $resource('/photos', {}, { get: { method:'GET', params:{}, isArray: true }}); | ||
$scope.photos = $scope.photosResource.get(); | ||
|
||
function PhotosCtrl($scope, $resource, Photo) { | ||
$scope.photosResource = $resource('/photos', {}); | ||
$scope.photos = $scope.photosResource.query(); | ||
|
||
$scope.links = function(key) { | ||
return PhotosCtrl.linkList(this.photo.id)[key]; | ||
}; | ||
} | ||
|
||
PhotosCtrl.$inject = ['$scope', '$resource']; | ||
PhotosCtrl.linkList = function (id) { | ||
return { | ||
edit: '/photos/' + id + '/edit', | ||
details: '/photos/' + id | ||
}; | ||
}; | ||
|
||
PhotosCtrl.$inject = ['$scope', '$resource', 'Photo']; | ||
|
||
function PhotoCtrl($scope, $resource, $routeParams, Photo) { | ||
|
||
var photoResource = Photo; | ||
var routeArgs = {photoId: $routeParams.photoId}; | ||
|
||
$scope.editing = $routeParams.editing === "edit"; | ||
|
||
$scope.photo = photoResource.get(routeArgs, function () { | ||
$scope.links = PhotosCtrl.linkList($scope.photo.id); | ||
|
||
$scope.original = angular.copy($scope.project); | ||
|
||
}); | ||
|
||
$scope.links = {}; | ||
|
||
$scope.delete = function() { | ||
var doit = confirm("Are you sure you want to delete this photo (id {0})?".format(this.project.id)); | ||
if (doit) { | ||
photoResource.remove(); | ||
} | ||
}; | ||
|
||
$scope.reset = function() { | ||
if($scope.editing){ | ||
$scope.project = angular.copy($scope.original); | ||
} | ||
}; | ||
|
||
$scope.update = function updateProject() { | ||
if($scope.editing){ | ||
// do not send back the full object for update | ||
var p = { "photo": {} }; | ||
// p.project.name = $scope.project.name; | ||
// p.project.urn = $scope.project.urn; | ||
// p.project.description = $scope.project.description; | ||
// p.project.notes = $scope.project.notes; | ||
// | ||
// p.project.siteIds = $scope.siteIds; | ||
|
||
photoResource.update(routeArgs, p, function() { | ||
$scope.original = angular.copy($scope.site); | ||
var msg = "Photo details updated successfully."; | ||
console.log(msg); alert(msg); | ||
}, function() { | ||
var msg = "There was a problem updating the photo details. Please check for errors and try again."; | ||
console.log(msg); alert(msg); | ||
}); | ||
} | ||
}; | ||
} | ||
|
||
PhotoCtrl.$inject = ['$scope', '$resource', '$routeParams', 'Photo']; | ||
|
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use strict"; | ||
|
||
function TagsCtrl($scope, $resource, Tag) { | ||
$scope.tagsResource = $resource('/tags', {}); | ||
$scope.tags = $scope.tagsResource.query(); | ||
|
||
$scope.links = function(key) { | ||
return TagsCtrl.linkList(this.tag.id)[key]; | ||
}; | ||
|
||
$scope.delete = function(id) { | ||
alert("deleting tag {0}!".format(id)); | ||
}; | ||
} | ||
|
||
TagsCtrl.linkList = function (id) { | ||
return { | ||
edit: '/tags/' + id + '/edit', | ||
details: '/tags/' + id | ||
}; | ||
}; | ||
|
||
TagsCtrl.$inject = ['$scope', '$resource', 'Tag']; | ||
|
||
function TagCtrl($scope, $resource, $routeParams, Tag) { | ||
|
||
} | ||
|
||
TagCtrl.$inject = ['$scope', '$resource', '$routeParams', 'Tag']; |
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
Oops, something went wrong.