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

B/bk/master #55

Open
wants to merge 45 commits into
base: b/bk/master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
fe5850e
Added markets and vendors resources/routes
esther-ng Oct 4, 2016
fdc2e67
Generated models with relationships.
Bella8 Oct 4, 2016
8f0eedc
Added erd, WIP exploring BK MVC
esther-ng Oct 5, 2016
3814e30
Added controllers and index view for main page
Bella8 Oct 5, 2016
39ddaa1
Completed seeds file
esther-ng Oct 5, 2016
a7c30c9
added new and create in the controller and new view
Bella8 Oct 5, 2016
b2d57a8
Completed user_show view
esther-ng Oct 5, 2016
0975683
added creatate for market
Bella8 Oct 5, 2016
67eb26a
fixed changes for merge
Bella8 Oct 5, 2016
273f559
Added the edit and delete button in the market, still working on edit
Bella8 Oct 6, 2016
4ed6b28
Completed vendor homepage with product and sale info. WIP: get new pr…
esther-ng Oct 6, 2016
d2801d0
Got new link and view working but need to finish create/build action
esther-ng Oct 6, 2016
9b64a5f
Added vendor controller
Bella8 Oct 6, 2016
f6111a7
Fixed merge conflict and added market edit vendor vendor
Bella8 Oct 6, 2016
8eb1a4d
Create product works, no sales doesn't break show, WIP: edit/delete p…
esther-ng Oct 6, 2016
a40b11a
Made sure that only market can edit a market and deleted commets
Bella8 Oct 6, 2016
b280f6b
Fixed conflict in vendors_controller
esther-ng Oct 6, 2016
e798546
functioning edit product link
esther-ng Oct 6, 2016
ed8e7ac
functioning delete product link
esther-ng Oct 6, 2016
550d6b0
Moved sales filter and totals from vendor controller to vendor model,…
esther-ng Oct 7, 2016
c58563f
Fixed vendor controller referene to sales total method.
esther-ng Oct 7, 2016
8828e34
fixed the create, edit, and delete function for the vendors and clean…
Bella8 Oct 7, 2016
8526008
fixed vendor merge conflict
Bella8 Oct 7, 2016
df648e7
fixed more merge conflict
Bella8 Oct 7, 2016
6f2dd8b
Used form to require purchase time input
esther-ng Oct 7, 2016
4c48e57
Made sale amount required too.
esther-ng Oct 7, 2016
ea6c5d4
Removed unnecessary routes
esther-ng Oct 7, 2016
2ba3b91
Adjusted Gemfile for Heroku
esther-ng Oct 7, 2016
e978c95
Added basic css for mainpage
esther-ng Oct 7, 2016
c07861e
finished home page
esther-ng Oct 7, 2016
a188597
Added application header
esther-ng Oct 7, 2016
0f7cfdf
worked in market and vendor css
Bella8 Oct 7, 2016
094d093
Added list styling and linked application header
esther-ng Oct 7, 2016
c327a47
Merge branch 'b/bk/market_css' into b/bk/master
Bella8 Oct 7, 2016
329856b
Added styling to some forms
esther-ng Oct 7, 2016
34251ec
Changed market CSS to look like Vendor CSS
Bella8 Oct 7, 2016
3797549
fixed merge conflict
Bella8 Oct 7, 2016
f2cdec4
Changed production.rb file
Bella8 Oct 7, 2016
921eac0
changed production.rb again
Bella8 Oct 7, 2016
3e57db9
changed production.rb number 3
Bella8 Oct 7, 2016
a1e7e4b
changed the gem file
Bella8 Oct 8, 2016
9a0734f
Compiled assets
Bella8 Oct 8, 2016
49423e6
changed image
Bella8 Oct 8, 2016
8bbd4fd
added css to market-vendor
Bella8 Oct 8, 2016
a71bc66
fixed some css that was not showing up on heroku
Bella8 Oct 8, 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.
14 changes: 13 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source 'https://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
Expand All @@ -23,6 +23,7 @@ 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 @@ -35,13 +36,24 @@ gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'sqlite3'
end

group :development do
gem 'better_errors'
gem 'binding_of_caller'
gem 'pry-rails'
# 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'

gem 'rails-erd'
end


group :production do
gem 'pg'
gem 'rails_12factor'
end
34 changes: 34 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
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/.DS_Store
Binary file not shown.
Binary file added app/assets/images/tomatoes.jpeg
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/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/
96 changes: 81 additions & 15 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,81 @@
/*
* 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 any plugin's vendor/assets/stylesheets directory 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 bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*/
body {
margin: 0;
}

header {
background-image: url(/assets/tomatoes.jpeg);
height: 15vh;
width: 100vw;
background-size: cover;
margin: 0;
background-position: center center;
text-align: center;
color: white;
font-family: "Special Elite", cursive;
font-size: 2em;
}

header h1 {
margin: 0;
position: relative;
top: 4vh;
}

header h1 a {
text-decoration: none;
color: white;
}

#main {
background-image: url(/assets/tomatoes.jpeg);
height: 100vh;
width: 100vw;
background-size: cover;
margin: 0;
position: absolute;
top: 0;
overflow: hidden;
}

#main h1 {
text-align: center;
font-size: 3em;
position: relative;
top: 35vh;
font-family: "Special Elite", cursive;
color: white;
}

#menu {
text-align: center;
margin: 40vh auto;
font-size: 1.5em;
}

#menu a {
text-decoration: none;
color: white;
font-family: "Molengo";
}

h2.section-heading {
margin-top: 6vh;
}

.centered-list {
list-style: none;
font-family: "Molengo";
text-align: center;
padding-left: 0;
}

.add-vendor-edit-market li {
font-family: "Molengo";
margin-left: 470px;
list-style-type: none;
}
.market-address {
font-family: "Molengo";
text-align: center;
list-style-type: none;
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/markets.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

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/
46 changes: 46 additions & 0 deletions app/assets/stylesheets/vendors.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// 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/



.page-title {
text-align: center;
font-family: "Special Elite", cursive;
font-size: 2em;
margin: 12vh 0 6vh;
}

h1.page-title {
margin-bottom: 3vh;
}

.vendor-market, .section-heading {
font-family: "Special Elite", cursive;
font-size: 1.5em;
text-align: center;
}

.add-product {
list-style: none;
font-family: "Molengo";
text-align: center;
padding-left: 0;
}

p.vendor-details, p.market-address {
font-family: "Molengo";
text-align: center;
}

table, tr, td {
border: 1px solid black;
width: 80vw;
text-align: center;
}

.sales_tables {
margin: 5vh auto;
width: 80vw;
font-family: "Molengo", sans-serif;
}
67 changes: 67 additions & 0 deletions app/controllers/markets_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
class MarketsController < ApplicationController

def mainpage
end

def index
@markets = Market.all
@link = "market"
end

def new
@market = Market.new
end

def create
@new_market_create = Market.new(market_params)
if @new_market_create.save
redirect_to market_path
else
render :new
end
end

def user_all
@markets = Market.all
@link = "user"
render "index"
end

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

def user_show
id = params[:id]
@market = Market.find(id)
@vendors = @market.vendors
@link = "user"
render "show"
end

def destroy
Market.find(params[:id]).destroy
redirect_to markets_path
end

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

def update
@market = Market.find(params[:id])
if @market.update(market_params)
redirect_to market_path(@market.id)
else
render :edit
end
end

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