Skip to content

Commit

Permalink
modified: Gemfile
Browse files Browse the repository at this point in the history
modified:   Gemfile.lock
	-- removed angular-rails dependency (more trouble than its worth)

new file:   app/assets/javascripts/angular/controllers/home.js
deleted:    app/assets/javascripts/angular/controllers/homes.coffee
new file:   app/assets/javascripts/angular/controllers/project.js
new file:   app/assets/javascripts/angular/controllers/site.js
deleted:    app/assets/javascripts/angular/filters/.gitkeep
deleted:    app/assets/javascripts/angular/services/.gitkeep
deleted:    app/assets/javascripts/angular/widgets/.gitkeep
new file:   app/assets/javascripts/app.js
modified:   app/assets/javascripts/application.js
new file:   app/assets/javascripts/controllers.js.erb
new file:   app/assets/javascripts/filters.js
renamed:    app/assets/javascripts/angular/controllers/.gitkeep -> app/assets/javascripts/fitlers.js
deleted:    app/assets/javascripts/home.js.coffee
new file:   app/assets/javascripts/home_controller.js
new file:   app/assets/javascripts/services.js
new file:   app/assets/javascripts/widgets.js
modified:   app/assets/stylesheets/application.css
new file:   app/assets/templates/home.html
new file:   app/assets/templates/project.html
new file:   app/assets/templates/site.html
deleted:    app/assets/javascripts/fitlers.js
deleted:    app/assets/javascripts/home_controller.js
	-- setting up angular client side models, some of this crap will likely be deleted later

modified:   app/views/layouts/application.html.erb
	-- special mention, the rails <%= render.view %> or whatever it was has been deleted, it is no longer needed

modified:   db/schema.rb
modified:   db/seeds.rb
	-- added some more seed data
  • Loading branch information
atruskie committed Nov 5, 2012
1 parent ec6af59 commit fed5b45
Show file tree
Hide file tree
Showing 21 changed files with 381 additions and 49 deletions.
18 changes: 18 additions & 0 deletions app/assets/javascripts/angular/controllers/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict'

//angular.module('home', []).config(function ($routeProvider, $httpProvider) {
//
// $routeProvider.
// when('/', {templateUrl: '/assets/home.html', controller: HomeCtrl}).
// otherwise({redirectTo: '/'});
//
// //$httpProvider.defaults.headers.
// // common['X-CSRF-Token'] = $['meta[name=csrf-token]'].attr('content');
//});

function HomeCtrl($scope) {

$scope.welcomeMessage = "Welcome to <bar>";


}
1 change: 0 additions & 1 deletion app/assets/javascripts/angular/controllers/homes.coffee

This file was deleted.

15 changes: 15 additions & 0 deletions app/assets/javascripts/angular/controllers/project.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict'


function ProjectCtrl($scope, $http) {

$http.get('projects.json').success(function(data) {
$scope.projectList = data;
});



$scope.ProjectName = "boobs r us";


}
9 changes: 9 additions & 0 deletions app/assets/javascripts/angular/controllers/site.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict'


function SiteCtrl($scope) {

$scope.name = "farts r us";


}
Empty file.
Empty file.
Empty file.
13 changes: 13 additions & 0 deletions app/assets/javascripts/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

/* App Module */

angular.module('baw', []).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/home', {templateUrl: 'assets/home.html', controller: HomeCtrl}).
when('/projects', {templateUrl: 'assets/project.html', controller: ProjectCtrl}).
when('/site', {templateUrl: 'assets/site.html', controller: SiteCtrl}).
//when('/phones/:phoneId', {templateUrl: 'partials/phone-detail.html', controller: PhoneDetailCtrl}).
otherwise({redirectTo: '/home'});
}]);
5 changes: 2 additions & 3 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
//= require jquery
//= require jquery_ujs
//= require_tree .
//= require angular.min
//= require angle-up
//= require_tree ./angular


65 changes: 65 additions & 0 deletions app/assets/javascripts/controllers.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
///* App Controllers */
//
//function PhotoGalleryCtrl($route, $http) {
// $http.defaults.headers.post['Content-Type'] = 'application/json'
// $http.defaults.headers.put['Content-Type'] = 'application/json'
//
// // assumes the presence of jQuery
// var token = $("meta[name='csrf-token']").attr("content");
// $http.defaults.headers.post['X-CSRF-Token'] = token;
// $http.defaults.headers.put['X-CSRF-Token'] = token;
// $http.defaults.headers['delete']['X-CSRF-Token'] = token;
//
//
// $route.when('/photographers',
// {template: '<%= asset_path("photographers.html") %>', controller: PhotographersCtrl});
//
// $route.when('/photographers/:photographer_id/galleries',
// {template: '<%= asset_path("galleries.html") %>', controller: GalleriesCtrl});
//
// $route.when('/photographers/:photographer_id/galleries/:gallery_id/photos',
// {template: '<%= asset_path("photos.html") %>', controller: PhotosCtrl});
//
// $route.otherwise({redirectTo: '/photographers'});
//}
//PhotoGalleryCtrl.$inject = ['$route', '$http'];
//
//function PhotographersCtrl(Photographers) {
// this.photographers = Photographers.index();
//}
//PhotographersCtrl.$inject = ['Photographers'];
//
//function GalleriesCtrl(Galleries, Photographers, $routeParams) {
// this.photographer = Photographers.get({ photographer_id: $routeParams.photographer_id });
// this.galleries = Galleries.index({ photographer_id: $routeParams.photographer_id });
//}
//GalleriesCtrl.$inject = ['Galleries', 'Photographers', '$routeParams'];
//
//function PhotosCtrl(Photos, Galleries, Photographers, SelectedPhotos, $routeParams) {
// var self = this;
//
// self.photographer = Photographers.get({ photographer_id: $routeParams.photographer_id });
// self.gallery = Galleries.get({ photographer_id: $routeParams.photographer_id, gallery_id: $routeParams.gallery_id });
// self.photos = Photos.index({ photographer_id: $routeParams.photographer_id, gallery_id: $routeParams.gallery_id });
// self.selected_photos = SelectedPhotos.index();
//
//
// self.selectPhoto = function(photo) {
// var selected_photo = new SelectedPhotos({ selected_photo: { photo_id: photo.id } });
// selected_photo.$create(function() {
// self.selected_photos.push(selected_photo);
// });
// }
//
// self.deleteSelectedPhoto = function(selected_photo) {
// angular.Array.remove(self.selected_photos, selected_photo);
// selected_photo.$destroy({ selected_photo_id: selected_photo.id });
// }
//
// self.saveSelectedPhoto = function(selected_photo) {
// selected_photo.$update({ selected_photo_id: selected_photo.id });
// $('input').blur();
// }
//
//}
//PhotosCtrl.$inject = ['Photos', 'Galleries', 'Photographers', 'SelectedPhotos', '$routeParams'];
1 change: 1 addition & 0 deletions app/assets/javascripts/filters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* http://docs.angularjs.org/#!angular.filter */
File renamed without changes.
3 changes: 0 additions & 3 deletions app/assets/javascripts/home.js.coffee

This file was deleted.

7 changes: 7 additions & 0 deletions app/assets/javascripts/home_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

function HomeCtrl($scope) {

$scope.welcomeMessage = "Welcome to <bar>";


}
24 changes: 24 additions & 0 deletions app/assets/javascripts/services.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* http://docs.angularjs.org/#!angular.service */

//angular.service('Photographers', function($resource) {
// return $resource('photographers/:photographer_id', {},
// { 'index': { method: 'GET', isArray: true }});
//});
//
//angular.service('Galleries', function($resource) {
// return $resource('photographers/:photographer_id/galleries/:gallery_id', {},
// { 'index': { method: 'GET', isArray: true }});
//});
//
//angular.service('Photos', function($resource) {
// return $resource('photographers/:photographer_id/galleries/:gallery_id/photos', {},
// { 'index': { method: 'GET', isArray: true }});
//});
//
//angular.service('SelectedPhotos', function($resource) {
// return $resource('selected_photos/:selected_photo_id', {},
// { 'create': { method: 'POST' },
// 'index': { method: 'GET', isArray: true },
// 'update': { method: 'PUT' },
// 'destroy': { method: 'DELETE' }});
//});
16 changes: 16 additions & 0 deletions app/assets/javascripts/widgets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* http://docs.angularjs.org/#!angular.widget */

//angular.directive('my:cycle', function(expr,el){
// return function(container){
// this.$watch(function() {
// if ($(container).children().length) {
// $(container).cycle({ fx: 'fade',
// speed: 500,
// timeout: 3000,
// pause: 1,
// next: '#next',
// prev: '#prev' });
// }
// });
// }
//});
134 changes: 134 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,137 @@
*= require_tree .
*/

html {
background: #555;
font-size: 100%;
height: 100%;
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
font-size: 80%;/*62.5%;*/
min-height: 100%;
position: relative;
font-family: Verdana, Helvetica, Arial, sans-serif;
}
img {
border-style: none;
}
h1 {
color: #fff;
margin: 15px 50px 0;
}
#outer_picture_frame {
padding-right: 220px;
padding-top: 100px;
}

#picture_frame, #selected_frame {
background-color: #fff;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
-moz-box-shadow: 3px 3px 7px #333;
-webkit-box-shadow: 3px 3px 7px #333;
box-shadow: 3px 3px 7px #333;
overflow: hidden;
padding: 20px;
}
#picture_frame {
height: 482px;
margin: auto;
position: relative;
width: 642px;
}
#selected_frame {
height: 800px;
right: 5px;
top: 5px;
position: absolute;
width: 202px;
}
#photos {
border: 1px solid #333;
height: 480px;
overflow: hidden;
width: 640px;
}
#photos .photo {
cursor: pointer;
height: 480px;
position: relative;
width: 640px;
}
#photos .photo .title {
bottom: 5px;
color: #fff;
display: block;
font-size: 22px;
font-weight: bold;
position: absolute;
right: 5px;
}
#prev, #next {
color: #999;
cursor: pointer;
font-family: arial, helvetica, verdana, sans-serif;
font-size: 64px;
position: absolute;
top: 230px;
}
#prev {
left: 1px;
}
#next {
right: -1px;
}
.selected_photo {
position: relative;
}
.selected_photo .delete {
background-color: #faa;
-webkit-border-radius: 9px;
-moz-border-radius: 9px;
border-radius: 9px;
border: 3px solid #555;
color: #555;
cursor: pointer;
font-size: 16px;
font-weight: bold;
height: 13px;
line-height: 10px;
position: absolute;
right: -4px;
top: -4px;
width: 13px;
}
#selected_photos input {
width: 193px;
}

ul {
list-style-type: none;
margin: 150px auto;
padding: 0;
width: 800px;
}

li {
background-color: #fff;
border: 1px solid #333;
float: left;
font-size: 24px;
font-weight: strong;
height: 100px;
line-height: 1.4em;
margin: 20px;
padding: 40px 20px 20px;
text-align: center;
width: 120px;
}
li a {
color: #555;
text-decoration: none;
}
6 changes: 6 additions & 0 deletions app/assets/templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h1>This is a test</h1>

<p>{{welcomeMessage}}</p>

<a href="#/projects/" >fun times</a>
<a href="#/site/" >funny times</a>
20 changes: 20 additions & 0 deletions app/assets/templates/project.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<h1>This is a project listing</h1>

<p>{{ProjectName}}</p>

<ul>
<li ng-repeat="project in projectList">
<div>
<h3>{{project.name}}</h3>
<p ng-bind="project.description" ></p>
<a ng-href="{{project.urn}}">{{project.urn}}</a>

<pre>{{project.notes}}</pre>

<small>{{updated_at}}</small>

</div>
</li>

</ul>
<a href="#/" >less fun times</a>
5 changes: 5 additions & 0 deletions app/assets/templates/site.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h1>This is a site listing</h1>

<p>{{name}}</p>

<a href="#/" >less fun times</a>
Loading

0 comments on commit fed5b45

Please sign in to comment.