Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@
/tmp
.DS_Store
.env

*.swp
/vendor

Gemfile.lock
11 changes: 7 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.4'
gem 'rails'

# When you HTTParty, you must party hard!
gem 'httparty'

# Use postgresql as the database for Active Record
gem 'pg'
Expand Down Expand Up @@ -42,12 +45,12 @@ end

# Use debugger
# gem 'debugger', group: [:development, :test]

gem 'bootstrap-sass', '~> 3.2.0'
gem "font-awesome-rails"
gem 'bootstrap-sass', '~> 3.2.0'


# for heroku deployment
gem 'rails_12factor', group: :production
gem 'unicorn'

ruby '2.1.1'
ruby '2.1.1'
7 changes: 6 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ GEM
font-awesome-rails (4.1.0.0)
railties (>= 3.2, < 5.0)
hike (1.2.3)
httparty (0.13.1)
json (~> 1.8)
multi_xml (>= 0.5.2)
i18n (0.6.11)
jbuilder (1.5.3)
activesupport (>= 3.0.0)
Expand All @@ -57,6 +60,7 @@ GEM
mime-types (1.25.1)
minitest (4.7.5)
multi_json (1.10.1)
multi_xml (0.5.5)
pg (0.17.1)
polyglot (0.3.5)
rack (1.5.2)
Expand Down Expand Up @@ -127,10 +131,11 @@ DEPENDENCIES
bootstrap-sass (~> 3.2.0)
coffee-rails (~> 4.0.0)
font-awesome-rails
httparty
jbuilder (~> 1.2)
jquery-rails
pg
rails (= 4.0.4)
rails
rails_12factor
sass-rails (~> 4.0.2)
sdoc
Expand Down
79 changes: 41 additions & 38 deletions app/assets/javascripts/categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ app.controller('dragNdrop', ['$scope', '$http', function($scope, $http) {
window.onload = function() {
$scope.page_start = 0
$scope.page_end = 5
console.log("items!!" +$scope.all_items.length);

$scope.active_cats = function() {
return $scope.cats.slice($scope.page_start, $scope.page_end);
}

$scope.cat_length = $scope.cats.length
// $scope.cat_length = $scope.cats.length
$scope.end_button = true;
$scope.start_button = false;

Expand All @@ -35,51 +36,53 @@ app.controller('dragNdrop', ['$scope', '$http', function($scope, $http) {
console.log("end: " + $scope.page_end);
}

// filter items
$scope.filter_view = "All";
$scope.item_count = $scope.all_items.length;
// default view is All
$scope.filter = function(filter) {
$scope.filter_view = filter;

// sets item count for filter
switch(filter) {
case "All":
$scope.item_count = $scope.all_items.length;
break;
case "Refridgerator":
$scope.item_count = $scope.refridgerator_items.length;
break;
case "Freezer":
$scope.item_count = $scope.freezer_items.length;
break;
case "Pantry":
$scope.item_count = $scope.pantry_items.length;
break;
case "Shopping List":
$scope.item_count = $scope.shopping_list_items.length;
break;
}
}

$scope.editModal = function(category, item) {
$scope.item = item;
console.log("item: "+ $scope.item);
$scope.category = category;

// turn the first link on for heroku
// $('.modal').modal({remote: "http://okfridge.herokuapp.com/categories/" + $scope.category +"/items/" + $scope.item + "/edit"});
// turn the first link on for local development
console.log("test modal");
$('.modal').modal({remote: "http://localhost:3000/categories/" + $scope.category +"/items/" + $scope.item + "/edit"});
}

$scope.deleteItem = function(category, item, item_id ) {
$scope.item_id = item_id;
$scope.category = category;
console.log(item);
if (item.id) {
console.log("inside the if");
// saved member
$http.delete("http://localhost:3000/categories/" + $scope.category +"/items/" + $scope.item_id);
// success(function(data, status, headers, config) {
// // this callback will be called asynchronously
// // when the response is available
// }).
// error(function(data, status, headers, config) {
// // called asynchronously if an error occurs
// // or server returns response with an error status.
// });
}
// $http.delete("http://localhost:3000/categories/" + $scope.category +"/items/" + $scope.item_id);
// }
else {
// unsaved member, remove it from members.
$scope.itemData.splice( $.inArray(item, $scope.itemData), 1 );
}
};

$scope.setCategory = function(category){
$scope.categorySelected = category;
}
console.log("this is the container: " + $scope.group);
$http.get("http://localhost:3000/groups/" + $scope.group + "/api/items").success(function (data) {
// turn the first link on for heroku
// $http.get("http://okfridge.herokuapp.com/groups/" + $scope.group + "/api/items").success(function (data) {
// turn the first link on for local development
$http.get("http:/localhost:3000.com/groups/" + $scope.group + "/api/items").success(function (data) {

//Convert data to array.
$scope.itemData = angular.fromJson(angular.fromJson(data));
console.log($scope.itemData);
Expand Down Expand Up @@ -132,12 +135,13 @@ app.controller('dragNdrop', ['$scope', '$http', function($scope, $http) {

this.className = "";


// sets the path to add new item to container
// turn the first link on for heroku
// $scope.dropZoneLink = "http://okfridge.herokuapp.com/categories/"+$scope.categorySelected+"/items/new_item";
// turn the second link on for local development
$scope.dropZoneLink = "http://localhost:3000/categories/"+$scope.categorySelected+"/items/new_item";
console.log("dropped " + data);

console.log($scope.dropZoneLink);
//window.location.href = e.dataTransfer.getData('text');
// window.location.href = $scope.dropZoneLink;
$('.modal').modal({remote: $scope.dropZoneLink});
});

Expand Down Expand Up @@ -185,13 +189,12 @@ app.controller('dragNdrop', ['$scope', '$http', function($scope, $http) {
if (e.stopPropagation) e.stopPropagation();

this.className = "";

// $scope.dropZoneLink = "<%#= new_category_item_path($scope.category) %>";
// sets the path to add new item to shopping list
// turn the first link on for heroku
// $scope.dropZoneLink = "http://okfridge.herokuapp.com/categories/"+$scope.categorySelected+"/items/new_sl";
// turn the first link on for local development
$scope.dropZoneLink = "http://localhost:3000/categories/"+$scope.categorySelected+"/items/new_sl";
console.log("dropped " + data);
console.log($scope.dropZoneLink);
//window.location.href = e.dataTransfer.getData('text');
// window.location.href = $scope.dropZoneLink;

$('.modal').modal({remote: $scope.dropZoneLink});
});
};
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/recipes.js.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
5 changes: 4 additions & 1 deletion app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
*= require font-awesome
*= require_tree .
*/
@import 'bootstrap-sprockets';

/*@import 'bootstrap-sprockets';*/
@import 'bootstrap';


Expand Down Expand Up @@ -56,3 +57,5 @@ a {
color: white;
}



61 changes: 61 additions & 0 deletions app/assets/stylesheets/application.css.BACKUP.91290.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require font-awesome
*= require_tree .
*/

/*@import 'bootstrap-sprockets';*/
@import 'bootstrap';


body {
background: #4AABCC;
color: #3D1429;

}

a {
color: #3D1429;
}

.navbar-default {
background: rgba(20,20,20,.2);
border: none;
color: white;
-webkit-box-shadow: 0px 7px 20px 1px rgba(9,68,120,1);
-moz-box-shadow: 0px 7px 20px 1px rgba(9,68,120,1);
box-shadow: 0px 7px 20px 1px rgba(9,68,120,1);
}

.navbar-nav {
color:white;
}

.navbar-inverse .navbar-nav > a,
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
background-color: transparent;
color: white;
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover {
background-color: transparent;
}

.navbar-inverse .navbar-nav > li > a {
color: white;
}



61 changes: 61 additions & 0 deletions app/assets/stylesheets/application.css.BACKUP.91366.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require font-awesome
*= require_tree .
*/

/*@import 'bootstrap-sprockets';*/
@import 'bootstrap';


body {
background: #4AABCC;
color: #3D1429;

}

a {
color: #3D1429;
}

.navbar-default {
background: rgba(20,20,20,.2);
border: none;
color: white;
-webkit-box-shadow: 0px 7px 20px 1px rgba(9,68,120,1);
-moz-box-shadow: 0px 7px 20px 1px rgba(9,68,120,1);
box-shadow: 0px 7px 20px 1px rgba(9,68,120,1);
}

.navbar-nav {
color:white;
}

.navbar-inverse .navbar-nav > a,
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
background-color: transparent;
color: white;
}

.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover {
background-color: transparent;
}

.navbar-inverse .navbar-nav > li > a {
color: white;
}



Loading