forked from AdaGold/betsy
-
Notifications
You must be signed in to change notification settings - Fork 16
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
ports - Elle, Cloudy, Sav, Margaret #67
Open
qqdipps
wants to merge
396
commits into
Ada-C11:master
Choose a base branch
from
dev-elle-up:submaster
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 36 commits
Commits
Show all changes
396 commits
Select commit
Hold shift + click to select a range
a25ddfe
added cart_errors custom method to order, available_for_purchase? cus…
qqdipps 7c48a27
testing upto date for purchase action
qqdipps 7f56b93
Merge branch 'merchants-new-products' of https://github.com/Mello-Cel…
dev-elle-up f109bc6
fixed merge conflict
dev-elle-up e65b6ec
Merge pull request #24 from Mello-Cello/purchase
dev-elle-up 2eff8f5
fixed status to paid from complete
qqdipps 0aaec06
debugged creating new product, updated tests, made form accept dollar…
msfinnan c7d8bc2
Merge branch 'submaster' into merchants-new-products
qqdipps e6f0057
Update application_controller.rb
qqdipps a9c5e37
Merge pull request #23 from Mello-Cello/merchants-new-products
qqdipps 8c5cddd
resolved merge conflicts
CloudyLopez 8fd0dff
resolved issue in csv file.
CloudyLopez d4b4cda
merge conflict
CloudyLopez c21bd5e
resolved last merge prob
CloudyLopez 6205484
Merge pull request #25 from Mello-Cello/model_testing
qqdipps e5b8676
added edit and update actions and edit view
msfinnan fbb3f97
added tests for edit
msfinnan e92de0a
added functionality so merchants can only edit their own products
msfinnan 32a803b
added photo to product show page
msfinnan bb456ae
updated functionality so users must be logged in to see edit page
msfinnan cdb782d
finished model testing products
qqdipps 711f662
tested changes to schema for order validations on status
qqdipps afb46cb
added custom method tests, updated validations on stock, added tests …
qqdipps 2cef670
added custom methods testing for item model
qqdipps 2deac5d
added missed edge case logic and tests to custom methods in items and…
qqdipps 7fba0d1
Wrote tests for logging in and out. Also fixed 'invisibly' to 'intang…
dev-elle-up f584591
Update application_controller.rb
dev-elle-up 1d24af4
Started writing test for custom merchant model method. Need to finish.
dev-elle-up dc8c538
tested custom order methods and added additional logic for edge cases
qqdipps 7e22a70
added stock to missing params, ALL TEST GREEn =)
qqdipps 4be84ef
Merge pull request #26 from Mello-Cello/oauth_loginout_tests
qqdipps b49db51
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
qqdipps af43180
more styling
CloudyLopez 7b4f6f7
tb heroku, added find_car_order -> hard code to view_cart
qqdipps 1611145
testing issue
qqdipps 8bac9d4
tb
qqdipps 64d8028
undo change in view_cart"
qqdipps 0c0568d
fiddled with money displays but left as is in controllers for now, fi…
msfinnan 35a7130
added link to edit product on product page ONLY shows if to merchant …
msfinnan 8987f76
tb heroku
qqdipps 9c978cb
managed merge conflict in products_controller_test.rb
msfinnan 7b55b16
tb
qqdipps c2f82f8
tb
qqdipps 0a6de9a
test of flash message works fine
qqdipps 3c32db0
test of flash message works fine
qqdipps a77b5ff
Merge pull request #28 from Mello-Cello/merchants-update-products
qqdipps c585399
Merge branch 'master' of https://git.heroku.com/intangibly-mesc into …
qqdipps e238baa
tb
qqdipps 6773ae4
tb
qqdipps 5de34dd
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
dev-elle-up fbbd1c1
Wrote model test for build_from_github method in merchant model. Also…
dev-elle-up 3321c62
Merge pull request #29 from Mello-Cello/model_custom_method_test
CloudyLopez 0821935
Merge pull request #30 from Mello-Cello/purchase
dev-elle-up 31935ff
added custom model method to make items hash
msfinnan 84d1f1f
Merge branch 'merchant-dashboard' of https://github.com/Mello-Cello/b…
qqdipps a57aff2
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
qqdipps 980fd23
Resolved merge conflicts.
dev-elle-up 445384e
added show current method to merchant controller
msfinnan a386805
added current merchant route
msfinnan 77146e1
added links to dash
msfinnan 3d31227
Merge branch 'setup-merchant-dash-page' into merchant-dashboard
msfinnan 0b7caaa
Merge branch 'merchant-dashboard' of https://github.com/Mello-Cello/b…
qqdipps 13a3dd0
refactored method
qqdipps 8d8df6a
added current controller test
msfinnan 6b20266
updated find_merchant to find_logged_in_merchant
msfinnan bc1b34b
created custom method for filtering and revenue and count
qqdipps 19f1fd0
Merge branch 'merchant-dashboard' of https://github.com/Mello-Cello/b…
qqdipps cf73f3f
Removed glow. Changed background colors. Changed fonts, html, padding…
dev-elle-up 451e7ed
Styled the home page. Made font colors readable on products index pag…
dev-elle-up 0df10b2
fixed a bug in status revenue model method, created basic display to …
msfinnan 8b3e4a6
orders show page
qqdipps a4944ea
basic show page for merchant dash
msfinnan 5744a76
Merge branch 'merchant-dashboard' of https://github.com/Mello-Cello/b…
msfinnan 92c742f
added column and placeholder for ship button
msfinnan c577883
added better restrictions so that merchants can view order pages if t…
qqdipps d4ab9aa
updated tests for redirect to confirmaation page
qqdipps ab3ecac
played around with money display issues and reverted back to having m…
msfinnan 86629d3
routes
qqdipps 5357091
added boot strap to alerts, feel free to change.
qqdipps 0cf9891
fixed indentation for layout
qqdipps 2fadfe3
Merge branch 'bootstrap_alerts' into merchant-dashboard
qqdipps f97ce2e
fixed bootstrap alerts
qqdipps fac7e21
Merge branch 'merchant-dashboard' of https://github.com/Mello-Cello/b…
qqdipps ec9b94c
added bootstrap form to create and update product. would like help wi…
msfinnan f8f79d9
styling without error, fingers crossed.
CloudyLopez e4feb88
fixed tests
msfinnan cfec443
current page refactor
qqdipps c482a59
set up view, controller, routes, limited authorization to view to jus…
qqdipps 6450443
updated hosted images
CloudyLopez 689d9bf
scaffodling testing
qqdipps 9f4494a
Merge pull request #31 from Mello-Cello/add-bootstrap-to-forms
dev-elle-up a11e1b0
Merge pull request #32 from Mello-Cello/products-controller-tests
dev-elle-up a2d1e94
updated and fixed products_data#stock and found error using seeds file.
CloudyLopez dc53c1a
fixed bug when order id is invalid
msfinnan 4b3e83b
Merge branch 'submaster' into confirmation
qqdipps ca467f5
Merge pull request #33 from Mello-Cello/confirmation
qqdipps a30c4b1
Merge branch 'submaster' of https://git.heroku.com/intangibly-mesc in…
qqdipps 6c555a8
Merge branch 'master' of https://git.heroku.com/intangibly-mesc into …
qqdipps 75e82af
attempt number 3 for hosting images.
CloudyLopez 03274e5
new and create method for category, new form, and tests
msfinnan 97ed024
added link to new category to merc dash
msfinnan 44a6722
testing for orders#confirmation complete. all tests green. made small…
qqdipps 5a3eb8a
user acceptance testing looks good as well
qqdipps 5b1b62e
removed change from tb photo display
qqdipps ec0059c
Fixed merge conflict.
dev-elle-up e885ab9
photos hosted and being supported
CloudyLopez 71cc58d
Merge branch 'styling' of https://github.com/Mello-Cello/betsy into s…
dev-elle-up 51e0d0e
Merge pull request #34 from Mello-Cello/new-category
qqdipps aa00fd8
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
qqdipps 36a5d66
Merge pull request #35 from Mello-Cello/test-confirmation-controller
msfinnan 97a7be0
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
qqdipps 3da1bac
Small changes to make colors readable, centered text on empty cart.
dev-elle-up a5778b3
Changed merchant logged in name button to go to merchant dashboard.
dev-elle-up 68fc7e7
Merge pull request #36 from Mello-Cello/styling2
qqdipps 3aa6d32
inprocess of testing
qqdipps cfd9d32
fixed errors
qqdipps a1ef4db
Merge pull request #38 from Mello-Cello/fix-alerts
msfinnan 9af7445
tested show action
qqdipps a20ea9c
small refactor, all tests greeen to go
qqdipps 1a2506c
Pushing for Cloudy to look at adding links to photos
dev-elle-up 0c55d7c
added route and method to toggle a product retired, added temp link t…
msfinnan 9de24f8
changed product index so it only lists active products
msfinnan c517caa
product show page will flash error and redirect for a retired product
msfinnan 477b3e1
updated view logic so only owner of a product can see the retire prod…
msfinnan d4b1286
added buttons to links for editing and retiring products
msfinnan 902d692
added table with all products to merchant show with buttons to retire…
msfinnan 24c1693
finished testing custom models for order
qqdipps 4a4b6a8
Initial implementations of flexbox.
dev-elle-up 89bd8c3
Merge pull request #40 from Mello-Cello/custom-models-orders
dev-elle-up fe966dc
Merge pull request #39 from Mello-Cello/controller-order-show-tests
dev-elle-up c514ee2
Merge branch 'submaster' into styling2
dev-elle-up e4616a8
working our what shows where
msfinnan fbc0b1d
Merge pull request #41 from Mello-Cello/styling2
msfinnan fe5f87e
Merge branch 'submaster' into retire-product
msfinnan 7972f36
sorted products table on merchant dash by active or retired
msfinnan 7b2a13a
added funtionality to reactivate a product and changed language of fl…
msfinnan b88de07
tests for logged in user
msfinnan d22cacf
finished tests for toggle_inactive
msfinnan ef24fe9
removed add product from products page since its in the merchant dash…
msfinnan 88606cc
resolved merge conflicts
msfinnan 046579f
fixed type in show, made sure all prices are showing like money shoul…
msfinnan 7d6ace8
added link to update a product from the merchant dashboard, fixed typ…
msfinnan 5b94a1c
made sure money displayed with 2 places after the decimal on order co…
msfinnan 7e8b298
added link to category page from categories on product page
msfinnan 7b3f990
added test for merchant cannot update prodcut that is not theirs
msfinnan 56fe81d
Merge pull request #44 from Mello-Cello/add-links-to-dashboard
CloudyLopez cf7c4cf
created button on dashboard that sends info, creating update controll…
qqdipps ec275e5
fixed patch verb for purchase (sidetracked)
qqdipps 33ca49f
finished shipping button with tests for merchant dashboard
qqdipps 78fc6d3
added tests for flash msgs
qqdipps cc9eb76
added boot strap to in pg show product form for add to cart and reviews
qqdipps a9a4afb
refactored partial form item_form to be adated for update action in cart
qqdipps 6fa5aab
refactored routes
qqdipps 1716652
set up test scaffolding and logic for controller
qqdipps a7a9ce9
finished testing for items update
qqdipps ea294a1
merge conflict resolved
qqdipps 36cc907
Merge pull request #45 from Mello-Cello/ship-func
msfinnan c05dbe5
Merge pull request #46 from Mello-Cello/show_prodct_pg_forms
dev-elle-up 1493820
changed shipping location
qqdipps 296e4cf
updated form to add a little view logic
msfinnan aa26486
Fixed merchant path on nav bar.
dev-elle-up 49709fb
Merge branch 'change_cart_items' of https://github.com/Mello-Cello/be…
dev-elle-up 6a6515c
Merge pull request #47 from Mello-Cello/change_cart_items
dev-elle-up e3e1647
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
dev-elle-up 1274838
Merge branch 'submaster' into styling2
dev-elle-up 02bf9b3
Merge branch 'submaster' into styling2
qqdipps a8f4b44
Merge pull request #48 from Mello-Cello/styling2
qqdipps be5dd05
Merge pull request #49 from Mello-Cello/money-stuff
qqdipps d8185d2
Merge pull request #50 from Mello-Cello/ship-func
msfinnan 3e4c826
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
dev-elle-up 6651746
Merge branch 'submaster' into styling2
dev-elle-up 7de8e53
fixed the new view for product (added math variable back in), removed…
msfinnan e188384
refactored product controller
msfinnan a9c2603
removed raise
msfinnan 4ee2996
Merge pull request #51 from Mello-Cello/cleanup
qqdipps 0ce1894
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
dev-elle-up 6b7c789
Merge branch 'submaster' into styling2
dev-elle-up df29a6c
Clean up controllers
msfinnan d09a5d6
moved link to create new product from products page
msfinnan 25de1e9
time udpate in config
qqdipps 2b19d72
Merge branch 'submaster' of https://github.com/Mello-Cello/betsy into…
qqdipps 67c8659
Merge pull request #52 from Mello-Cello/cleanup
qqdipps e641960
fixed some buttons on dashboard
msfinnan 55b4911
Merge pull request #53 from Mello-Cello/time-update
msfinnan bb272ee
Merge pull request #54 from Mello-Cello/cleanup
qqdipps 1cb4e1c
added bootstrap to dashboard
qqdipps 263a5ad
fixed layout of table
qqdipps 5f3f4b0
added moeny formatting to current
msfinnan 0fb6d50
fixed merge conflict
msfinnan 212ed32
fixed this column
qqdipps fa6c638
Worked on unifying styling.
dev-elle-up f2f0d7e
Merge pull request #55 from Mello-Cello/styling2
msfinnan 8df38da
merge conflict resolved
msfinnan d909827
Merge pull request #56 from Mello-Cello/dash-style
dev-elle-up baab88d
Made more styling updates to product details. Also a few other stylin…
dev-elle-up 5384020
added cart icon
qqdipps 64b747d
Finalized the product show page. Moved some page-specific styling int…
dev-elle-up 9709c9a
styled merchant dash
msfinnan 316a134
added favicon
qqdipps 3207d19
Merge pull request #57 from Mello-Cello/styling2
qqdipps 31c6fcb
Merge pull request #58 from Mello-Cello/style-dashboard
qqdipps b53e087
Merge pull request #59 from Mello-Cello/nav-style
qqdipps c081a84
adjusted margins so hover on logo does not push out other items on nav
qqdipps f9d1a92
updating buttons, alert
qqdipps 5e53193
updated button colors
qqdipps cdc85f6
cart page is styled
qqdipps f63ace2
fiddling, overrode form bootstrap atcive colors
qqdipps 33dcdc1
missed change
qqdipps cd284d9
fixed lost margin
qqdipps 8a06815
fixed bug for add items with 0 quantity to cart
qqdipps e185319
fixed money precison on order form total page
qqdipps db18050
updated class name
qqdipps fc20e01
Merge pull request #60 from Mello-Cello/cart-style
qqdipps 9257338
animation home pg, short
qqdipps 4cee9ac
Merge pull request #61 from Mello-Cello/animation-home
qqdipps f0b2ddc
On products index page, added price and added card look. Adjusted spa…
dev-elle-up 73d4f1f
Removed helvetica font. Styled the merchant and categories pages.
dev-elle-up b6c5004
Minor code cleanups. Also image suggestion currently commented out.
dev-elle-up 0f74f39
Merge branch 'submaster' into styling2
qqdipps 3b30121
Merge pull request #62 from Mello-Cello/styling2
qqdipps e55d397
Fixed merge conflict. Styled the Category Products page.
dev-elle-up 33d99f5
fixed item count display
qqdipps b8f9cc7
fixed margin
qqdipps ee4185d
Styled the Merchant Products page. Centered the back-to buttons at th…
dev-elle-up d597c3b
Fixed merge conflicts.
dev-elle-up 2fe6e08
added pink hover to categories and products
msfinnan 1c2b53c
Merge pull request #63 from Mello-Cello/btn-dash-margin-fix
qqdipps a18c6ec
Merge pull request #64 from Mello-Cello/cart-items-fix
qqdipps 6f89d31
Merge pull request #66 from Mello-Cello/styling2
dev-elle-up fb404aa
Merge pull request #65 from Mello-Cello/pink-hover
msfinnan 2149be9
fixed margins on toggle bar
qqdipps 7099342
Merge pull request #67 from Mello-Cello/btn-dash-margin-fix
qqdipps 2ce610d
upcase prod name on merchant and categories show, view cart, prod ind…
msfinnan 8e82766
added upcase to merch dash
msfinnan 4398394
fixed bug
qqdipps 6f90001
Merge pull request #68 from Mello-Cello/fixed-bug-retired-product-views
qqdipps 602014e
Made H4s on category and merchant pages thicker with a stroke, incl r…
dev-elle-up f590430
Merge branch 'submaster' into upcase-products
msfinnan 4168e3e
Merge pull request #70 from Mello-Cello/upcase-products
msfinnan 1c8ae9a
added style for footer
qqdipps f1f3cf5
Merge pull request #71 from Mello-Cello/footer-style
qqdipps 336c9d7
Adjusted text on products index.
dev-elle-up d44be3a
fixed min height on main
qqdipps 375b5e7
Merge pull request #72 from Mello-Cello/footer-style
qqdipps f54fa5a
Added margin to new product form categories check boxes.
dev-elle-up c49a4ca
descriptions done
CloudyLopez 206db26
reseed data
qqdipps f24077d
Merge branch 'submaster' into styling2
qqdipps 4b30d51
Merge pull request #73 from Mello-Cello/styling2
qqdipps 4d0d419
Merge pull request #74 from Mello-Cello/reviews-descriptions
dev-elle-up File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
// Place all the styles related to the Merchants controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ | ||
|
||
.merchant-dashboard td a:hover { | ||
color: rgb(255, 157, 255); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
// Place all the styles related to the Orders controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ | ||
|
||
.item.card { | ||
width: 300px; | ||
|
||
} | ||
|
||
.flex { | ||
display: flex; | ||
flex-flow: row wrap; | ||
justify-content: space-around; | ||
} | ||
|
||
.checkout { | ||
margin-top: 2em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,6 @@ h4 { | |
font-weight: bolder; | ||
} | ||
|
||
.categories input { | ||
margin-left: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<section id="mainpadding" id="background-image-magical"> | ||
|
||
<h1>Intangibly</h1> | ||
<p id="tagline">find your magic</p> | ||
|
||
<p id="tagline" class= "magic roll-in-blurred-left "><%= image_tag "intangible.png", class: "img" %>find your magic</p> | ||
<% if session[:merchant_id] %> | ||
<% merchant = Merchant.find_by(id: session[:merchant_id]) %> | ||
<p class="centered-arial"><%= "You are currently logged in as #{merchant.username}" %></p> | ||
<%# wrap in class for footer %> | ||
<% end %> | ||
</section> | ||
</section> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,13 @@ | |
|
||
<div> | ||
<%= f.label :Quantity%> | ||
<% if @product.stock > 0%> | ||
<%= f.number_field :quantity, required: true, in: [email protected] %> | ||
<% else %> | ||
<%= f.number_field :quantity, required: true, in: 0..1 %> | ||
<%end%> | ||
</div> | ||
<div> | ||
<%= f.submit action, class: "btn btn-sm btn-primary" %> | ||
<%= f.submit action, class: "btn btn-info sm-margin" %> | ||
</div> | ||
<%end%> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
find_by
here should be done in the controller.