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

Jessica & Lauren's FarMarRails Site #43

Open
wants to merge 93 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
588527c
created new rails app
jchung722 Oct 4, 2016
c2c4029
re-added seed CSVs
laurenfb Oct 4, 2016
8f2a3f6
created all controllers
jchung722 Oct 4, 2016
d86797e
added models
jchung722 Oct 4, 2016
3ea0161
added homes controller
jchung722 Oct 4, 2016
ace4111
seed database
laurenfb Oct 4, 2016
5497a8c
Update and rename README.rdoc to README.md
jchung722 Oct 4, 2016
951cc86
added photo of data structure
laurenfb Oct 4, 2016
f6e323e
rename photo
laurenfb Oct 4, 2016
677a1e3
Update README.md
jchung722 Oct 4, 2016
5a25fb4
added home page & index links for Market & Vendor. woo hoo
laurenfb Oct 4, 2016
78615c8
Merge branch 'master' of https://github.com/jchung722/FarMarRails
laurenfb Oct 4, 2016
692010f
index method for viewing all Markets
laurenfb Oct 4, 2016
d04fdff
show method in markets controller
laurenfb Oct 4, 2016
59a9575
added link to each market in the html index page
laurenfb Oct 4, 2016
8355781
show view for individual markets
laurenfb Oct 4, 2016
e64a070
add new route aliases & fix typo in vendors/index route
laurenfb Oct 4, 2016
d4de686
Merge pull request #1 from jchung722/view-all-markets
jchung722 Oct 4, 2016
2d6ef4c
added new and update option to market
jchung722 Oct 5, 2016
d26363d
Merge pull request #2 from jchung722/forms
laurenfb Oct 5, 2016
9f6d309
links to edit and add market
jchung722 Oct 5, 2016
06022fe
added overall user views
jchung722 Oct 5, 2016
7a84e0b
added index view for vendors with links to show
laurenfb Oct 5, 2016
a08a4fd
added ability for vendors to add new product
laurenfb Oct 5, 2016
1cdfec5
ability for vendors to edit and update products
laurenfb Oct 5, 2016
7f48dc3
add vendor option
jchung722 Oct 5, 2016
3f2f774
added rendered button to update products from the vendors/index page
laurenfb Oct 5, 2016
521cb13
abilty to delete products as a vendor
laurenfb Oct 5, 2016
7f8df10
added delete button to rendered product buttons
laurenfb Oct 5, 2016
7255e8a
added redirect after destroy, thanks jessica
laurenfb Oct 5, 2016
ed6db72
show product when link is clicked
laurenfb Oct 5, 2016
aca9c78
add buttons for edit and delete to show product page
laurenfb Oct 5, 2016
94020df
comments
laurenfb Oct 5, 2016
ab00430
delete and edit vendor options added
jchung722 Oct 5, 2016
6d3bd3c
Merge pull request #3 from jchung722/market_editing_vendor_list
laurenfb Oct 5, 2016
0199d4d
added sale button file
laurenfb Oct 5, 2016
ee06b31
resolved merge conflict in vendors controller
laurenfb Oct 5, 2016
67d028a
typo fix & routes for new & create in sale
laurenfb Oct 5, 2016
ba460ff
form and button for adding a new sale from a product
laurenfb Oct 5, 2016
975d2b3
vendor can see list of sales
jchung722 Oct 5, 2016
1c64c19
added ability to create a new sale from a product
laurenfb Oct 5, 2016
edc98ab
Merge pull request #5 from jchung722/add-sales
laurenfb Oct 5, 2016
632adda
total sale
jchung722 Oct 6, 2016
667bfff
changing h1s to h2s in market
laurenfb Oct 6, 2016
5cc5064
change h1s to h2s in product views
laurenfb Oct 6, 2016
b7fe186
changing h1s to h2s in sale views
laurenfb Oct 6, 2016
a460165
changing h1s to h2s in vendor views
laurenfb Oct 6, 2016
aa0fdfc
changing h1s to h2s in homes views
laurenfb Oct 6, 2016
9720ac7
added monthly sale list and total
jchung722 Oct 6, 2016
496ce2a
Merge pull request #6 from jchung722/monthly_sale
laurenfb Oct 6, 2016
24cd619
CSS styling, a teeny bit
laurenfb Oct 6, 2016
3e54812
Merge pull request #7 from jchung722/styling-and-layout
jchung722 Oct 6, 2016
65e7c05
move sales logic to controller
laurenfb Oct 6, 2016
43b22aa
aligned vendors with buttons
jchung722 Oct 6, 2016
711e1c9
add method to convert sale input to storing in cents
laurenfb Oct 6, 2016
ecae763
more css and added redirects
jchung722 Oct 6, 2016
69c02fd
added ability to see products of each market on the guest page
laurenfb Oct 6, 2016
89d17e6
added functional top nav links in application.html.erb layout
laurenfb Oct 6, 2016
9d803e4
created market shut down option
jchung722 Oct 6, 2016
275c410
more application.html.erb styling and layout
laurenfb Oct 6, 2016
6e60f1d
made add vendor button
jchung722 Oct 6, 2016
fc3fa36
Merge pull request #8 from jchung722/styling-and-layout
jchung722 Oct 6, 2016
6d8938f
Merge pull request #9 from jchung722/market_spruce
laurenfb Oct 6, 2016
2d62766
added image
jchung722 Oct 6, 2016
366e0e1
added background image
jchung722 Oct 6, 2016
b456c2d
style & layout for front page
laurenfb Oct 7, 2016
cd3ca0d
market lists on index and home render with a new partial
laurenfb Oct 7, 2016
e4318c2
Merge pull request #10 from jchung722/front-page-buttons
jchung722 Oct 7, 2016
1a921df
Merge pull request #11 from jchung722/new-partials
jchung722 Oct 7, 2016
2c2680d
rolled back broken partials
laurenfb Oct 7, 2016
41cf060
Merge pull request #12 from jchung722/new-partials
laurenfb Oct 7, 2016
13f2dcf
updated Gemfile for production yay
laurenfb Oct 7, 2016
e136aa8
changed order of seed files
laurenfb Oct 7, 2016
c608542
commented out sales
laurenfb Oct 7, 2016
e44e1a8
serve static assets + uncomment sales
laurenfb Oct 7, 2016
9882c9e
dumb end
laurenfb Oct 7, 2016
7dea818
please work, database
laurenfb Oct 7, 2016
029c74a
comment out Markets comment
laurenfb Oct 7, 2016
e033fe5
styling the top header on all pages except home
laurenfb Oct 7, 2016
8e783ab
spaced li lines
jchung722 Oct 7, 2016
eda3e6c
Merge pull request #13 from jchung722/final-touches-on-vendor
jchung722 Oct 7, 2016
e3758ae
Merge pull request #14 from jchung722/more-market-styles
laurenfb Oct 7, 2016
4d3ea66
styled vendors/show view
laurenfb Oct 7, 2016
bf2ed8f
fixed add market button
jchung722 Oct 7, 2016
289d5dc
styling new product page and form
laurenfb Oct 7, 2016
454d695
added footer
jchung722 Oct 7, 2016
8e3579f
style create product page
laurenfb Oct 7, 2016
56aaede
style sales index page
laurenfb Oct 7, 2016
96b8c9b
final touches everywhere
laurenfb Oct 7, 2016
247af7c
link formatting
jchung722 Oct 7, 2016
d6c8c0e
Merge pull request #15 from jchung722/final-touches-on-vendor
jchung722 Oct 7, 2016
00cb88d
Merge pull request #16 from jchung722/market-styles-continued
laurenfb Oct 7, 2016
b8b0fb8
a few more links
laurenfb 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
Binary file added .DS_Store
Binary file not shown.
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
.DS_Store
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal

# Ignore all logfiles and tempfiles.
/log/*
!/log/.keep
/tmp
52 changes: 52 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
source 'https://rubygems.org'

# awesomely print stuff
gem 'awesome_print'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.7'
# 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
# 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
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://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

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

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# added these directly from Textbook Curriculum
# use postgres on production
gem 'pg', group: :production
# use rails 12 on production, this is required by Heroku
gem 'rails_12factor', group: :production

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end

group :development do
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
172 changes: 172 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.7)
actionpack (= 4.2.7)
actionview (= 4.2.7)
activejob (= 4.2.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.7)
actionview (= 4.2.7)
activesupport (= 4.2.7)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.7)
activesupport (= 4.2.7)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.7)
activesupport (= 4.2.7)
globalid (>= 0.3.0)
activemodel (4.2.7)
activesupport (= 4.2.7)
builder (~> 3.1)
activerecord (4.2.7)
activemodel (= 4.2.7)
activesupport (= 4.2.7)
arel (~> 6.0)
activesupport (4.2.7)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.3)
awesome_print (1.7.0)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
builder (3.2.2)
byebug (9.0.6)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.7.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.7.0)
jbuilder (2.6.0)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.2.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.3)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.1)
multi_json (1.12.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
pg (0.19.0)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.7)
actionmailer (= 4.2.7)
actionpack (= 4.2.7)
actionview (= 4.2.7)
activejob (= 4.2.7)
activemodel (= 4.2.7)
activerecord (= 4.2.7)
activesupport (= 4.2.7)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.7)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
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)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (11.3.0)
rdoc (4.2.2)
json (~> 1.4)
sass (3.4.22)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
spring (2.0.0)
activesupport (>= 4.2)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.0)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.11)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
turbolinks (5.0.1)
turbolinks-source (~> 5)
turbolinks-source (5.0.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.2)
execjs (>= 0.3.0, < 3)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)

PLATFORMS
ruby

DEPENDENCIES
awesome_print
byebug
coffee-rails (~> 4.1.0)
jbuilder (~> 2.0)
jquery-rails
pg
rails (= 4.2.7)
rails_12factor
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
spring
sqlite3
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)

BUNDLED WITH
1.13.1
59 changes: 3 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,5 @@
# FarMar Rails
Build a database backend application to view, create, and manage farmers markets as well as their vendors, products, and sales.
In this implementation we'll be seeding with static data, and also building a tool to allow markets and/or vendors to sign up and add their own data.
#FarMar Baseline

As you are using ActiveRecord to access the database compare the methods that are given to those you had to create in the CSV implementation of FarMar.
- Trello link: https://trello.com/b/J04JlCdb

This project is meant to be exploratory. Take time to try to dive into each piece of Rails (routes, controllers, models, views). This project is built so that you and your partner can create the waves yourself based on the dependencies of the requirements given.

## Best Practices
- Use git relentlessly
- Pair program on difficult problems and to share learning experiences

## Baseline
Before you start writing _any_ code:

- Review the requirements with your partner
- Create a Trello board
- Organize your tasks/stories
- Discuss who will do which tasks and when you will target completion
- What things should be done together as pairs vs individually?
- Organize your tasks/stories into iterations (a.k.a waves)
- Create a data diagram based on the original data [specification](https://github.com/Ada-C6/FarMar)

Once the above is complete, this project:

- requires a shared repo with your partner as a collaborator
- requires you to create a Rails application
- conform to Rails conventions on naming and inflection
- by using `rails new .` you will create a new rails app _inside_ of the fork folder instead of creating a _new_ folder for your rails app

**Your team shall submit a pull request with a link to your Trello board once you are done with the baseline which shall be reviewed before moving onto implementing the requirements**

## Requirements
However far you and your partner get, the application should have, at a minimum, the following features:
- Seeded data in your database from the original CSV files
- Multiple Active Record models
- RESTful routing
- Deployed application to Heroku
- A "look and feel" that will make you and your partner happy!

## User Stories

### Overall
- As a user, when I visit "/", I can choose whether I want to act as a Market or a Vendor
- As a user, I can view all Markets
- As a user, I can view a specific Market, viewing it's attributes as well as a list of it's vendors

### Market
- As a market, I can create or edit a Market
- As a market, I can create, edit, or delete any Vendor

### Vendor
- As a vendor, I can create, edit, or delete my Products
- As a vendor, I can create a Sale for one of my Products
- As a vendor, I can see a list of my Sales
- As a vendor, I can see a total of all of my Sales
- As a vendor, I can see a list of my Sales for the current month
- As a vendor, I can see a total of my Sales for the current month
- see data-structure.jpg for data structure
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)

Rails.application.load_tasks
Empty file added app/assets/images/.keep
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
3 changes: 3 additions & 0 deletions app/assets/javascripts/homes.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/
39 changes: 39 additions & 0 deletions app/assets/stylesheets/_reset.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

/* reset styles */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var, b, u, i, center,
dl, dt, dd, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%;
vertical-align: baseline; background: transparent;
}
body { line-height: 1; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; }
:focus { outline: 0; }
ins { text-decoration: none; }
del { text-decoration: line-through; }
table { border-collapse: collapse; border-spacing: 0; }

body {
font-size: 100%;
text-align: left;
color: #000000;
}

/* container - place inside each section or around the entire page depending on your layout */
.container {
width: 960px;
margin: 0 auto;
text-align: left;
position: relative;
}

/* for clearing any floats <br class=&quot;clearfloat&quot; /> */
.clearfloat {
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
}
Loading