Lots of small bug fixes, changing image sizes

This commit is contained in:
Will Marshall
2014-07-29 11:33:09 +10:00
parent 39a79869c0
commit c4f7c1af60
11 changed files with 31 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ Darkswarm.directive "producerModal", ($modal)->
transclude: true
link: (scope, elem, attrs, ctrl)->
elem.on "click", (ev)=>
ev.preventDefault()
ev.stopPropagation()
console.log scope.enterprise
scope.modalInstance = $modal.open(controller: ctrl, templateUrl: 'producer_modal.html', scope: scope)

View File

@@ -5,6 +5,6 @@ Darkswarm.filter "groups", (Matcher)->
groups.filter (group)=>
Matcher.match([
group.name, group.long_description
group.name, group.description
], text) || group.enterprises.some (e)->
Matcher.match [e.name], text

View File

@@ -1,5 +1,5 @@
Darkswarm.filter "stripUrl", ->
stripper = /(https?:\/\/)?(www\.)?(.*)/
stripper = /(https?:\/\/)?(.*)/
(url) ->
url.match(stripper).pop()

View File

@@ -2,4 +2,5 @@ Darkswarm.factory "Matcher", ->
new class Matcher
match: (properties, text)->
properties.some (prop)->
prop ||= ""
prop.toLowerCase().indexOf(text.toLowerCase()) != -1

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
%p.right
{{ [enterprise.address.city, enterprise.address.state] | printArray}}
%h3{"ng-if" => "enterprise.is_distributor"}
%a{"bo-href" => "enterprise.path", "ofn-empties-cart" => "enterprise"}
%a{"bo-href" => "enterprise.path", "ofn-empties-cart" => "enterprise", bindonce: true}
%i.ofn-i_040-hub
{{ enterprise.name }}
%h3{"ng-if" => "!enterprise.is_distributor"}

View File

@@ -221,7 +221,7 @@ class Enterprise < ActiveRecord::Base
private
def strip_url(url)
url.andand.sub /(https?:\/\/)?(www\.)?/, ''
url.andand.sub /(https?:\/\/)?/, ''
end
def set_unused_address_fields

View File

@@ -0,0 +1,8 @@
Spree::Image.class_eval do
has_attached_file :attachment,
:styles => { :mini => '48x48>', :small => '114x114#', :product => '240x240>', :large => '600x600>' },
:default_style => :product,
:url => '/spree/products/:id/:style/:basename.:extension',
:path => ':rails_root/public/spree/products/:id/:style/:basename.:extension',
:convert_options => { :all => '-strip -auto-orient -quality 75' }
end

View File

@@ -20,7 +20,7 @@
"ng-debounce" => "150",
"ofn-disable-enter" => true}
.group{"ng-repeat" => "group in Groups.groups | groups:query | orderBy:order",
.group{"ng-repeat" => "group in groups = (Groups.groups | groups:query | orderBy:order)",
name: "group{{group.id}}",
id: "group{{group.id}}"}
.row.pad-top{bindonce: true}
@@ -44,8 +44,13 @@
%producer-modal{"ng-if" => "!enterprise.is_distributor", "show-hub-actions" => 'true'}
{{ enterprise.name }}
.row.group_footer
.small-12.columns
%hr
.group{"ng-show" => "groups.length == 0"}
.row.pad-top
No groups found
= render partial: "shared/footer"

View File

@@ -1,9 +1,9 @@
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}"}
.row.active_table_row{"ng-click" => "toggle()", "ng-class" => "{'closed' : !open()}", bindonce: true}
.columns.small-12.medium-6.large-5.skinny-head
%a.hub{"bo-href" => "hub.path", "ng-class" => "{primary: hub.active, secondary: !hub.active}", "ofn-empties-cart" => "hub"}
%i.ofn-i_040-hub
%span
%strong {{ hub.name }}
%strong {{ hub.name | truncate:40}}
.columns.small-4.medium-2.large-2
{{ hub.address.city }}
.columns.small-2.medium-1.large-1

View File

@@ -111,6 +111,13 @@ describe ShopController do
response.body.should be_empty
end
it "scopes variants for a product to the order cycle and distributor" do
controller.stub(:current_order_cycle).and_return order_cycle
controller.stub(:current_distributor).and_return d
Spree::Product.any_instance.should_receive(:variants_for).with(order_cycle, d)
xhr :get, :products
end
context "RABL tests" do
render_views
before do