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

Styles #18

Merged
merged 3 commits into from
Oct 6, 2016
Merged
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
Binary file modified app/assets/images/cabbage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 23 additions & 2 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ nav {
opacity: .8;
position: fixed;
width: 100vw;
z-index: 1;
}

nav p {
Expand Down Expand Up @@ -93,10 +94,12 @@ div.search {
}

div.no-selector {
z-index: 0;
margin: 45vh 25vw;
}

div.search-high {
z-index: 0;
position: relative;
margin: 0vw auto 5vw;
background-color: #fafafa;
Expand Down Expand Up @@ -176,6 +179,14 @@ div.search input.search-button {
width: 7vw;
}

div.search input.vendor{
background-color: #61964f;
}

div.search input.market {
background-color: #423d61;
}

::-webkit-input-placeholder {
color: #585858;
font-weight: 300;
Expand Down Expand Up @@ -236,7 +247,7 @@ article.entity-display img.vendor {
}

article.entity-display img.market {
background-color: #71416a;
background-color: #423d61;
}

article.entity-display ul {
Expand All @@ -250,13 +261,23 @@ article.entity-display ul.address-block {
width: 40vw;
}

article.entity-display p {
padding: 3vw 0 0 0;
font: normal 400 1vw/1 'Lato', sans-serif;
letter-spacing: .15em;
}

h4 {
font: normal 300 1vw/1 'Lato', sans-serif;
letter-spacing: .15em;
padding: .5vw 0 3vw 0;
padding: .5vw 0 0 0;
text-transform: uppercase;
}

h4 a:hover {
color: #dadada;
}

article.entity-display ul.address-block li:first-of-type {
margin: 3vw 0 0 0;
}
Expand Down
16 changes: 12 additions & 4 deletions app/controllers/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,25 @@ def market
end

def market_login
@id = params[:market][:id].to_i
redirect_to controller: 'markets', action: 'show', id: @id
if params[:market][:id].to_i == 0
redirect_to '/market'
else
@id = params[:market][:id].to_i
redirect_to controller: 'markets', action: 'show', id: @id
end
end

def vendor
@id = 10
end

def vendor_login
@id = params[:vendor][:id].to_i
redirect_to controller: 'vendors', action: 'show', id: @id
if params[:vendor][:id].to_i == 0
redirect_to '/vendor'
else
@id = params[:vendor][:id].to_i
redirect_to controller: 'vendors', action: 'show', id: @id
end
end

end
2 changes: 1 addition & 1 deletion app/views/pages/market.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="search no-selector">
<%= form_for :market, url: {controller: 'pages', action: 'market_login'}, method: :get do |f| %>
<%= f.text_field :id, placeholder: "Enter your market number"%>
<%= f.submit "login", class:"search-button" %>
<%= f.submit "login", class:"search-button market" %>
<% end %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/vendor.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="search no-selector">
<%= form_for :vendor, url: {controller: 'pages', action: 'vendor_login'}, method: :get do |f| %>
<%= f.text_field :id, placeholder: "Enter your vendor number"%>
<%= f.submit "login", class:"search-button" %>
<%= f.submit "login", class:"search-button vendor" %>
<% end %>
</div>

Expand Down
29 changes: 20 additions & 9 deletions app/views/products/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
<h1>Products#index</h1>
<article>
<ul>
<% @products.each do |product| %>
<h4><%= product.id %></h4>
<li><%= link_to product.name, {controller: 'products', action: 'show', id: product.id} %></li>
<li><%= product.vendor_id %></li>
<section class="body">

<div class="search search-high">
<%= search_form_for @search_product do |f| %>
<%= f.search_field :name_cont, placeholder: "Search Products"%>
<%= f.submit "search", class:"search-button" %>
<% end %>
</ul>
</article
</div>

<article>
<ul>
<% @products.each do |product| %>
<h3><%= link_to product.name, {controller: 'products', action: 'show', id: product.id} %></h3>
<h4>sold by <%= link_to product.vendor.name, {controller: 'vendors', action: 'show', id: product.vendor.id} %></h4>
<h4>at <%= link_to product.vendor.market.name, {controller: 'markets', action: 'show', id: product.vendor.market.id}%></h4>
<div class="list-break"></div>
<% end %>
</ul>

</article>
</section>