Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dianne And Jennifer #50

Open
wants to merge 70 commits into
base: b/dkl+jmo/master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
52454a0
added gems better-errors and pry, ran bundle install
dlaguerta Oct 4, 2016
9c1f1f0
added migrations for tables
dlaguerta Oct 4, 2016
249bf2c
made sure our models had the right relationships
dlaguerta Oct 4, 2016
864babc
Created seed data for markets/products/sales/vendors
jmojennifer Oct 4, 2016
929ab8b
Created seed data for markets/products/sales/vendors
jmojennifer Oct 4, 2016
b05d585
added the view for viewing all markets, WIP
dlaguerta Oct 5, 2016
51a7fc4
added gem for erd and added erd pdf
dlaguerta Oct 5, 2016
87e136e
Created home controller
jmojennifer Oct 5, 2016
c1eeb13
Working All Markets List and Show for individual markets
jmojennifer Oct 5, 2016
6b571ee
added the ability to edit and save an existing market
dlaguerta Oct 5, 2016
e925013
Created routes/controllers for Vendor and Products; Viewing Products …
jmojennifer Oct 5, 2016
dffe112
Resolved merge conflict
jmojennifer Oct 5, 2016
1643c4c
Create a Product is working
jmojennifer Oct 5, 2016
bcb1336
Merge branch 'b/jmo/Vendor' into b/dkl+jmo/master
jmojennifer Oct 6, 2016
4f3f8eb
Edit a Product is working
jmojennifer Oct 6, 2016
407a667
Merge branch 'b/jmo/Vendor' into b/dkl+jmo/master
jmojennifer Oct 6, 2016
7fcadf6
Delete a Product is working
jmojennifer Oct 6, 2016
bd9e99d
Merge branch 'b/jmo/Vendor' into b/dkl+jmo/master
jmojennifer Oct 6, 2016
1209aa6
nested vendor routes, linked vendors on the market page
dlaguerta Oct 6, 2016
571c5e8
Create a Sale/view list of Sales working--added sales controller; fix…
jmojennifer Oct 6, 2016
7824275
Merge branch 'b/jmo/Vendor' into b/dkl+jmo/master
jmojennifer Oct 6, 2016
d0455c8
trying to merge market_vendor branch
dlaguerta Oct 6, 2016
4dfe49c
added new market page, changing it to a partial
dlaguerta Oct 6, 2016
70ff3e1
changed new form to use a partial
dlaguerta Oct 6, 2016
521329a
fixed form partial for editing a market
dlaguerta Oct 6, 2016
f4f5f96
added a few CSS styling, currently reconfiguring the form to edit a v…
dlaguerta Oct 6, 2016
f54b5a1
Added ERB to Vendor/Product/Sale-related views; updated controllers/r…
jmojennifer Oct 6, 2016
05c7f59
fixed dis thing about redirecting
dlaguerta Oct 6, 2016
28bf9cb
Refactored to remove Show view or Product; put Create Sale link on Pr…
jmojennifer Oct 6, 2016
afcddbc
Removed Product Show method/index link/html file
jmojennifer Oct 7, 2016
60bc88f
Added error handling to Sales index; changed Sales new form field names
jmojennifer Oct 7, 2016
7ce45e3
Added Total Sales to Product Lists; incl comments re refactoring view…
jmojennifer Oct 7, 2016
f01f0a6
Merge branch 'b/jmo/Vendor' into b/dkl+jmo/master
jmojennifer Oct 7, 2016
8e6470c
added the ability to add a vendor with related market
dlaguerta Oct 7, 2016
7a85211
added function to delete a vendor as a market
dlaguerta Oct 7, 2016
038898d
began to add lots of styling
dlaguerta Oct 7, 2016
431916d
Updated comments on Vendors/Products/Sales index pages
jmojennifer Oct 7, 2016
e3d3ca6
Merge branch 'b/jmo/Vendor' into b/dkl+jmo/master
jmojennifer Oct 7, 2016
017c85a
made minor changes to CSS and edit forms, need to figure out why no a…
dlaguerta Oct 7, 2016
6652673
changed font color
dlaguerta Oct 7, 2016
52a1b93
fixed conflict
dlaguerta Oct 7, 2016
8aad048
added navbar and concentrated styling to homepage
dlaguerta Oct 7, 2016
2b28c42
Added List of Sales and Total Sales for current month; misc fixes to …
jmojennifer Oct 7, 2016
3b02981
Fixed merge conflict
jmojennifer Oct 7, 2016
0a05bf8
adding tables
dlaguerta Oct 7, 2016
f80354f
Merge branch 'b/dkl/css' into b/dkl+jmo/master
dlaguerta Oct 7, 2016
b2541fd
added head tag to change titles across pages
dlaguerta Oct 7, 2016
b0fe8ab
adding heading changes
dlaguerta Oct 7, 2016
38eefd7
added more heading changes
dlaguerta Oct 7, 2016
9269880
added table to vendor index page
dlaguerta Oct 7, 2016
c7a1436
added table for list of vendors under market
dlaguerta Oct 7, 2016
678da43
Adding headers to various pages
jmojennifer Oct 7, 2016
0ece65b
Resoved merge conflict
jmojennifer Oct 7, 2016
3dafde9
added table to list of products
dlaguerta Oct 7, 2016
dfebf6a
added table style to sales
dlaguerta Oct 7, 2016
5d2f00a
added more heading styles
dlaguerta Oct 7, 2016
1a37c9d
fixed margins on tables
dlaguerta Oct 7, 2016
bf4503c
fixed a missing table tag
dlaguerta Oct 7, 2016
c0fa684
fixed conflicts
dlaguerta Oct 7, 2016
b569c24
fixed some leftover comments
dlaguerta Oct 7, 2016
54ccc82
Formatting/content updates
jmojennifer Oct 7, 2016
a85f23d
Resolved merge conflict
jmojennifer Oct 7, 2016
86a414a
Fixed link formatting
jmojennifer Oct 7, 2016
ea54a5d
Updated Gemfile for Heroku
jmojennifer Oct 7, 2016
a867add
Added config changes for images on Heroku
jmojennifer Oct 7, 2016
eb89308
Added config changes for images on Heroku pt 2
jmojennifer Oct 7, 2016
219e10a
Added config changes for images on Heroku pt 3
jmojennifer Oct 7, 2016
9b2802f
Added config changes for images on Heroku pt 4
jmojennifer Oct 7, 2016
0078e82
Added config changes for images on Heroku pt 5
jmojennifer Oct 7, 2016
aa7f958
Added config changes for images on Heroku pt 6
jmojennifer Oct 7, 2016
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
25 changes: 18 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
source 'https://rubygems.org'
source 'http://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.7'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# See http://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
# Turbolinks makes following links in your web application faster. Read more: http://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# Build JSON APIs with ease. Read more: http://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'graphviz'


# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

Expand All @@ -38,10 +39,20 @@ group :development, :test do
end

group :development do
gem 'rails-erd'
gem "pry-rails"
gem "better_errors"
gem "binding_of_caller"
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
gem 'sqlite3'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
# Spring speeds up development by keeping your application running in the background. Read more: http://github.com/rails/spring
gem 'spring'
end


group :production do
gem 'pg'
gem 'rails_12factor'
end
36 changes: 35 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GEM
remote: https://rubygems.org/
remote: http://rubygems.org/
specs:
actionmailer (4.2.7)
actionpack (= 4.2.7)
Expand Down Expand Up @@ -37,10 +37,16 @@ GEM
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.3)
better_errors (2.1.1)
coderay (>= 1.0.0)
erubis (>= 2.6.6)
rack (>= 0.9.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
byebug (9.0.6)
choice (0.2.0)
coderay (1.1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
Expand All @@ -54,6 +60,7 @@ GEM
execjs (2.7.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
graphviz (0.3.0)
i18n (0.7.0)
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
Expand All @@ -67,6 +74,7 @@ GEM
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
Expand All @@ -76,7 +84,14 @@ GEM
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
pg (0.19.0)
pkg-config (1.1.7)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
pry-rails (0.3.4)
pry (>= 0.9.10)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
Expand All @@ -97,8 +112,18 @@ GEM
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-erd (1.5.0)
activerecord (>= 3.2)
activesupport (>= 3.2)
choice (~> 0.2.0)
ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_12factor (0.0.3)
rails_serve_static_assets
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (4.2.7)
actionpack (= 4.2.7)
activesupport (= 4.2.7)
Expand All @@ -107,6 +132,7 @@ GEM
rake (11.3.0)
rdoc (4.2.2)
json (~> 1.4)
ruby-graphviz (1.2.2)
sass (3.4.22)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
Expand All @@ -117,6 +143,7 @@ GEM
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
slop (3.6.0)
spring (2.0.0)
activesupport (>= 4.2)
sprockets (3.7.0)
Expand Down Expand Up @@ -147,11 +174,18 @@ PLATFORMS
ruby

DEPENDENCIES
better_errors
binding_of_caller
byebug
coffee-rails (~> 4.1.0)
graphviz
jbuilder (~> 2.0)
jquery-rails
pg
pry-rails
rails (= 4.2.7)
rails-erd
rails_12factor
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
spring
Expand Down
Binary file added app/assets/images/farmar_bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/floral_skulls.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/veggies.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/javascripts/home.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/
3 changes: 3 additions & 0 deletions app/assets/javascripts/markets.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/
3 changes: 3 additions & 0 deletions app/assets/javascripts/products.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/
3 changes: 3 additions & 0 deletions app/assets/javascripts/sales.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/
3 changes: 3 additions & 0 deletions app/assets/javascripts/vendors.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/
124 changes: 124 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,127 @@

table {
display: block;
margin-left: 20%;
}

.product-index-table {
margin-left: 30%;
}

.vendor-index-table {
margin-left: 35%;
}

.sales-index-table {
margin-left: 33%;
}

h1 {
text-align: center;
font-family: cursive;
color: white;
}

h2 {
text-align: center;
}

body {
/*background-color: #82b324;*/
}

.container {
margin-right: auto;
margin-left: auto;
padding-left: 15px;
padding-right: 15px;
}
div {
background-color: #F1F2F2 ;
opacity: 0.9;
/*padding: 30px;*/
margin: 60px;
}

.market-view {
/*background-image: url("veggies.jpg");*/
background-image: url("farmar_bg.jpg");

background-size: 100%;
background-repeat: repeat;
}

.home_bg {
background-image: url("farmar_bg.jpg");
background-size: 100%;
background-repeat: no-repeat;
}

.navbar {
list-style: none;
text-align: center;
/*background-color: white;*/
}

.navbar li{
list-style: none;
display: inline;
padding: 40px;
/*font-family: cursive;*/
color: white;
}

.navbar a:link, a:visited {
background-color: #f44336;
color: white;
padding: 14px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
}

div.home-button {
background-color: #f44336;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: block;
float:right;
border-radius: 3%;
}

.home-button a:link {
color: white;
text-decoration: none;
}

a:visited, a:link {
color: black;
text-decoration: underline;
}

table {
text-align: center;
}
td {
padding: 20px;
text-align: center;
border: black solid 1px;
}

td a {
padding: 10px;
}

/*div {
background-image: url("farmar_bg.jpg");
background-size: 99%;
background-repeat: no-repeat;
opacity: 0.5;
}*/


/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
Expand Down
3 changes: 3 additions & 0 deletions app/assets/stylesheets/home.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the home controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/markets.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the markets controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/products.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the products controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/sales.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the sales controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/vendors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the vendors controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
5 changes: 5 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class HomeController < ApplicationController

def index; end

end
53 changes: 53 additions & 0 deletions app/controllers/markets_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
class MarketsController < ApplicationController

def index
@markets = Market.all
end

def all
#put a list of all the markets here
@markets = Market.all
@market = Market.find_by(params[:name])
@vendors = Vendor.where([:market_id] == @market.id)
end

def show
@market = Market.find(params[:id])
@vendors_list = @market.vendors
end

def new
@market = Market.new
end

def create
@market = Market.new(market_params)

if @market.save
redirect_to markets_path
else
render :new
end
end

def edit
@market = Market.find(params[:id])
end

def update
@market = Market.find(params[:id])
if @market.update(market_params) #if it saves successfully
redirect_to markets_path
else #if it doesn't save
render :edit
end
end



private

def market_params
params.require(:market).permit(:name, :address, :city, :state, :county, :zip)
end
end
Loading