Skip to content

Commit b4c76ab

Browse files
committed
init
0 parents  commit b4c76ab

File tree

214 files changed

+30982
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+30982
-0
lines changed

.bowerrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"directory": "vendor/assets/bower_components",
3+
"interactive": false
4+
}

.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore the default SQLite database.
11+
/db/*.sqlite3
12+
/db/*.sqlite3-journal
13+
14+
# Ignore all logfiles and tempfiles.
15+
/log/*.log
16+
/tmp
17+
18+
/node_modules

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.1.1@startup_sociaty

Gemfile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
source 'https://rubygems.org'
2+
3+
4+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5+
gem 'rails', '4.1.4'
6+
# Use sqlite3 as the database for Active Record
7+
gem 'sqlite3'
8+
# Use SCSS for stylesheets
9+
gem 'sass-rails', '~> 4.0.3'
10+
# Use Uglifier as compressor for JavaScript assets
11+
gem 'uglifier', '>= 1.3.0'
12+
# Use CoffeeScript for .js.coffee assets and views
13+
gem 'coffee-rails', '~> 4.0.0'
14+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
15+
# gem 'therubyracer', platforms: :ruby
16+
17+
# Use jquery as the JavaScript library
18+
gem 'jquery-rails'
19+
20+
gem 'bootstrap-sass'
21+
gem 'autoprefixer-rails'
22+
gem 'angular_rails_csrf'
23+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
24+
# gem 'turbolinks'
25+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
26+
gem 'jbuilder', '~> 2.0'
27+
# bundle exec rake doc:rails generates the API under doc/api.
28+
gem 'sdoc', '~> 0.4.0', group: :doc
29+
30+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
31+
gem 'spring', group: :development
32+
33+
# Use ActiveModel has_secure_password
34+
# gem 'bcrypt', '~> 3.1.7'
35+
36+
# Use unicorn as the app server
37+
# gem 'unicorn'
38+
39+
# Use Capistrano for deployment
40+
# gem 'capistrano-rails', group: :development
41+
42+
# Use debugger
43+
# gem 'debugger', group: [:development, :test]
44+

Gemfile.lock

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actionmailer (4.1.4)
5+
actionpack (= 4.1.4)
6+
actionview (= 4.1.4)
7+
mail (~> 2.5.4)
8+
actionpack (4.1.4)
9+
actionview (= 4.1.4)
10+
activesupport (= 4.1.4)
11+
rack (~> 1.5.2)
12+
rack-test (~> 0.6.2)
13+
actionview (4.1.4)
14+
activesupport (= 4.1.4)
15+
builder (~> 3.1)
16+
erubis (~> 2.7.0)
17+
activemodel (4.1.4)
18+
activesupport (= 4.1.4)
19+
builder (~> 3.1)
20+
activerecord (4.1.4)
21+
activemodel (= 4.1.4)
22+
activesupport (= 4.1.4)
23+
arel (~> 5.0.0)
24+
activesupport (4.1.4)
25+
i18n (~> 0.6, >= 0.6.9)
26+
json (~> 1.7, >= 1.7.7)
27+
minitest (~> 5.1)
28+
thread_safe (~> 0.1)
29+
tzinfo (~> 1.1)
30+
angular_rails_csrf (1.0.1)
31+
rails (>= 3, < 5)
32+
arel (5.0.1.20140414130214)
33+
autoprefixer-rails (2.1.0.20140628)
34+
execjs
35+
bootstrap-sass (3.2.0.0)
36+
sass (~> 3.2)
37+
builder (3.2.2)
38+
coffee-rails (4.0.1)
39+
coffee-script (>= 2.2.0)
40+
railties (>= 4.0.0, < 5.0)
41+
coffee-script (2.3.0)
42+
coffee-script-source
43+
execjs
44+
coffee-script-source (1.7.1)
45+
erubis (2.7.0)
46+
execjs (2.2.1)
47+
hike (1.2.3)
48+
i18n (0.6.11)
49+
jbuilder (2.1.2)
50+
activesupport (>= 3.0.0, < 5)
51+
multi_json (~> 1.2)
52+
jquery-rails (3.1.1)
53+
railties (>= 3.0, < 5.0)
54+
thor (>= 0.14, < 2.0)
55+
json (1.8.1)
56+
mail (2.5.4)
57+
mime-types (~> 1.16)
58+
treetop (~> 1.4.8)
59+
mime-types (1.25.1)
60+
minitest (5.4.0)
61+
multi_json (1.10.1)
62+
polyglot (0.3.5)
63+
rack (1.5.2)
64+
rack-test (0.6.2)
65+
rack (>= 1.0)
66+
rails (4.1.4)
67+
actionmailer (= 4.1.4)
68+
actionpack (= 4.1.4)
69+
actionview (= 4.1.4)
70+
activemodel (= 4.1.4)
71+
activerecord (= 4.1.4)
72+
activesupport (= 4.1.4)
73+
bundler (>= 1.3.0, < 2.0)
74+
railties (= 4.1.4)
75+
sprockets-rails (~> 2.0)
76+
railties (4.1.4)
77+
actionpack (= 4.1.4)
78+
activesupport (= 4.1.4)
79+
rake (>= 0.8.7)
80+
thor (>= 0.18.1, < 2.0)
81+
rake (10.3.2)
82+
rdoc (4.1.1)
83+
json (~> 1.4)
84+
sass (3.2.19)
85+
sass-rails (4.0.3)
86+
railties (>= 4.0.0, < 5.0)
87+
sass (~> 3.2.0)
88+
sprockets (~> 2.8, <= 2.11.0)
89+
sprockets-rails (~> 2.0)
90+
sdoc (0.4.0)
91+
json (~> 1.8)
92+
rdoc (~> 4.0, < 5.0)
93+
spring (1.1.3)
94+
sprockets (2.11.0)
95+
hike (~> 1.2)
96+
multi_json (~> 1.0)
97+
rack (~> 1.0)
98+
tilt (~> 1.1, != 1.3.0)
99+
sprockets-rails (2.1.3)
100+
actionpack (>= 3.0)
101+
activesupport (>= 3.0)
102+
sprockets (~> 2.8)
103+
sqlite3 (1.3.9)
104+
thor (0.19.1)
105+
thread_safe (0.3.4)
106+
tilt (1.4.1)
107+
treetop (1.4.15)
108+
polyglot
109+
polyglot (>= 0.3.1)
110+
tzinfo (1.2.1)
111+
thread_safe (~> 0.1)
112+
uglifier (2.5.1)
113+
execjs (>= 0.3.0)
114+
json (>= 1.8.0)
115+
116+
PLATFORMS
117+
ruby
118+
119+
DEPENDENCIES
120+
angular_rails_csrf
121+
autoprefixer-rails
122+
bootstrap-sass
123+
coffee-rails (~> 4.0.0)
124+
jbuilder (~> 2.0)
125+
jquery-rails
126+
rails (= 4.1.4)
127+
sass-rails (~> 4.0.3)
128+
sdoc (~> 0.4.0)
129+
spring
130+
sqlite3
131+
uglifier (>= 1.3.0)

README.md

+16

Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require File.expand_path('../config/application', __FILE__)
5+
6+
Rails.application.load_tasks

app/assets/images/.keep

Whitespace-only changes.
22.5 KB
22.7 KB
4.58 KB
27.7 KB
27.9 KB
22.4 KB
6.71 KB
11.6 KB
12.5 KB
9.22 KB
9.19 KB
40 KB
10.3 KB
7.64 KB
22.6 KB
16.1 KB
23.2 KB
19.1 KB
25.6 KB
22.8 KB
23.1 KB
18.6 KB
16 KB
6.08 KB
20.6 KB
26.8 KB
13.7 KB
6.9 KB
25.8 KB
7.79 KB
7.52 KB
35.9 KB
20.8 KB
26.6 KB
11.2 KB
6.67 KB
26.7 KB
39.2 KB
14.7 KB
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
var phonecatAnimations = angular.module('phonecatAnimations', ['ngAnimate']);
2+
3+
phonecatAnimations.animation('.phone', function() {
4+
5+
var animateUp = function(element, className, done) {
6+
if(className != 'active') {
7+
return;
8+
}
9+
element.css({
10+
position: 'absolute',
11+
top: 500,
12+
left: 0,
13+
display: 'block'
14+
});
15+
16+
jQuery(element).animate({
17+
top: 0
18+
}, done);
19+
20+
return function(cancel) {
21+
if(cancel) {
22+
element.stop();
23+
}
24+
};
25+
}
26+
27+
var animateDown = function(element, className, done) {
28+
if(className != 'active') {
29+
return;
30+
}
31+
element.css({
32+
position: 'absolute',
33+
left: 0,
34+
top: 0
35+
});
36+
37+
jQuery(element).animate({
38+
top: -500
39+
}, done);
40+
41+
return function(cancel) {
42+
if(cancel) {
43+
element.stop();
44+
}
45+
};
46+
}
47+
48+
return {
49+
addClass: animateUp,
50+
removeClass: animateDown
51+
};
52+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
'use strict';
2+
3+
/* App Module */
4+
5+
var phonecatApp = angular.module('phonecatApp', [
6+
'ngRoute',
7+
'phonecatAnimations',
8+
9+
'phonecatControllers',
10+
'phonecatFilters',
11+
'phonecatServices'
12+
]);
13+
14+
phonecatApp.config(['$routeProvider',
15+
function($routeProvider) {
16+
$routeProvider.
17+
when('/phones', {
18+
templateUrl: 'phone_list.html',
19+
controller: 'PhoneListCtrl'
20+
}).
21+
when('/phones/:phoneId', {
22+
templateUrl: 'phone_detail.html',
23+
controller: 'PhoneDetailCtrl'
24+
}).
25+
otherwise({
26+
redirectTo: '/phones'
27+
});
28+
}]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
/* Controllers */
4+
5+
var phonecatControllers = angular.module('phonecatControllers', []);
6+
7+
phonecatControllers.controller('PhoneListCtrl', ['$scope', 'Phone',
8+
function($scope, Phone) {
9+
$scope.phones = Phone.query();
10+
$scope.orderProp = 'age';
11+
}]);
12+
13+
phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', 'Phone',
14+
function($scope, $routeParams, Phone) {
15+
$scope.phone = Phone.get({phoneId: $routeParams.phoneId}, function(phone) {
16+
$scope.mainImageUrl = phone.images[0];
17+
});
18+
19+
$scope.setImage = function(imageUrl) {
20+
$scope.mainImageUrl = imageUrl;
21+
}
22+
}]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
/* Directives */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/* Filters */
4+
5+
angular.module('phonecatFilters', []).filter('checkmark', function() {
6+
return function(input) {
7+
return input ? '\u2713' : '\u2718';
8+
};
9+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//= require_tree .
2+
//= require_self
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
'use strict';
2+
3+
/* Services */
4+
5+
var phonecatServices = angular.module('phonecatServices', ['ngResource']);
6+
7+
phonecatServices.factory('Phone', ['$resource',
8+
function($resource){
9+
return $resource('api/v1/phones/:phoneId.json', {}, {
10+
query: {method:'GET', params:{phoneId:'phones'}, isArray:true}
11+
});
12+
}]);

app/assets/javascripts/application.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file.
9+
//
10+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require jquery
14+
//= require jquery_ujs
15+
//= require index

app/assets/javascripts/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//= require bootstrap-sprockets
2+
//= require bower_components/angular/angular
3+
//= require bower_components/angular-animate/angular-animate
4+
//= require bower_components/angular-resource/angular-resource
5+
//= require bower_components/angular-route/angular-route

0 commit comments

Comments
 (0)