mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Added base for shop front (enterprise).
This commit is contained in:
@@ -8,16 +8,4 @@
|
||||
font-size: 0.8em;
|
||||
color: #b7b7b7;
|
||||
}
|
||||
|
||||
a {
|
||||
&:link {
|
||||
color: #000;
|
||||
}
|
||||
&:visited {
|
||||
color: #000;
|
||||
}
|
||||
&:hover {
|
||||
color: $primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1300,9 +1300,24 @@ $topbar-link-font-size: emCalc(16);
|
||||
|
||||
// $topbar-sticky-class: ".sticky";
|
||||
|
||||
|
||||
@import 'foundation';
|
||||
|
||||
textarea {
|
||||
min-height: emCalc(120) !important;
|
||||
}
|
||||
|
||||
@import 'foundation';
|
||||
a {
|
||||
&:link {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
&:visited {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: $primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,18 @@
|
||||
|
||||
@include button($padding, $bg, $radius, $full-width, $disabled, $is-input);
|
||||
}
|
||||
|
||||
a {
|
||||
&:link {
|
||||
color: #FFF;
|
||||
}
|
||||
&:visited {
|
||||
color: #FFF;
|
||||
}
|
||||
&:hover {
|
||||
color: $primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.backstretch img {
|
||||
@@ -45,18 +57,6 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
&:link {
|
||||
color: #FFF;
|
||||
}
|
||||
&:visited {
|
||||
color: #FFF;
|
||||
}
|
||||
&:hover {
|
||||
color: $primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
#home-page-nav
|
||||
{
|
||||
ul {
|
||||
|
||||
8
app/assets/stylesheets/search/products.css.scss
Normal file
8
app/assets/stylesheets/search/products.css.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
@import "foundation/variables";
|
||||
@import "foundation/components/global";
|
||||
|
||||
.products {
|
||||
margin: 0, emCalc(20);
|
||||
border: 1px solid black;
|
||||
padding: emCalc(10);
|
||||
}
|
||||
@@ -32,6 +32,19 @@ class EnterprisesController < BaseController
|
||||
@products = @searcher.retrieve_products
|
||||
end
|
||||
|
||||
# essentially the new 'show' action that renders non-spree view
|
||||
# will need to be renamed into show once the old one is removed
|
||||
def shop_front
|
||||
options = {:enterprise_id => params[:id]}
|
||||
options.merge(params.reject { |k,v| k == :id })
|
||||
|
||||
@enterprise = Enterprise.find params[:id]
|
||||
|
||||
@searcher = Spree::Config.searcher_class.new(options)
|
||||
@products = @searcher.retrieve_products
|
||||
render :layout => "landing_page"
|
||||
end
|
||||
|
||||
def search
|
||||
@suburb = Suburb.find(params[:suburb_id]) if params[:suburb_id].present?
|
||||
@enterpsises = Enterprise.find_near(@suburb)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
- @enterpsises.each do |enterprise|
|
||||
.row.search-result
|
||||
.large-12.columns
|
||||
= link_to enterprise.name, enterprise_path(enterprise)
|
||||
= link_to enterprise.name, shop_front_enterprise_path(enterprise.id)
|
||||
%span.secondary-info= "#{enterprise.city}, #{enterprise.state_name}"
|
||||
.large-8.columns
|
||||
= gmaps4rails(@enterprises_json)
|
||||
|
||||
15
app/views/enterprises/shop_front.html.haml
Normal file
15
app/views/enterprises/shop_front.html.haml
Normal file
@@ -0,0 +1,15 @@
|
||||
.row
|
||||
.large-12.columns
|
||||
%h2= @enterprise.name
|
||||
.row
|
||||
.large-12.columns= @enterprise.long_description.andand.html_safe
|
||||
|
||||
.row
|
||||
.large-12.columns
|
||||
.products
|
||||
- @products.each_slice(4).to_a.each do |products_row|
|
||||
.row
|
||||
- products_row.each do |product|
|
||||
.large-4.columns.centered
|
||||
.clearfix= link_to small_image(product), product
|
||||
= link_to product.name, product
|
||||
@@ -2,9 +2,15 @@ Openfoodweb::Application.routes.draw do
|
||||
root :to => 'spree/home#index'
|
||||
|
||||
resources :enterprises do
|
||||
get :suppliers, :on => :collection
|
||||
get :distributors, :on => :collection
|
||||
post :search, :on => :collection
|
||||
collection do
|
||||
get :suppliers
|
||||
get :distributors
|
||||
post :search
|
||||
end
|
||||
|
||||
member do
|
||||
get :shop_front
|
||||
end
|
||||
end
|
||||
|
||||
resources :suburbs
|
||||
|
||||
Reference in New Issue
Block a user