Merge branch 'master' into 2-0-stable-Mar6

This commit is contained in:
luisramos0
2019-03-06 09:19:53 +00:00
79 changed files with 7134 additions and 3387 deletions

View File

@@ -8,8 +8,8 @@
//= require jquery
//= require jquery-migrate-min
//= require jquery_ujs
//= require jquery.ui.all
//= require shared/jquery-ui-timepicker-addon
//= require jquery-ui
//= require jquery-ui-timepicker-addon
//= require angular
//= require angular-resource
//= require angular-animate

View File

@@ -10,17 +10,19 @@ angular.module('admin.orderCycles', ['ngTagsInput', 'admin.indexUtils', 'admin.e
# using $parse instead of scope[attrs.datetimepicker] for cases
# where attrs.datetimepicker is 'foo.bar.lol'
$(element).datetimepicker
dateFormat: 'yy-mm-dd'
timeFormat: 'HH:mm:ss'
showOn: "button"
buttonImage: "<%= asset_path 'datepicker/cal.gif' %>"
buttonImageOnly: true
stepMinute: 15
onSelect: (dateText, inst) ->
scope.$apply(->
dateFormat: 'yy-mm-dd'
timeFormat: 'HH:mm'
showOn: 'button'
controlType: 'select'
oneLine: true
buttonImage: "<%= asset_path 'datepicker/cal.gif' %>"
buttonImageOnly: true
stepMinute: 15
onSelect: (dateText, inst) ->
scope.$apply(->
element.val(dateText)
parsed = $parse(attrs.datetimepicker)
parsed.assign(scope, dateText)
parsed = $parse(attrs.datetimepicker)
parsed.assign(scope, dateText)
)

View File

@@ -1,12 +1,15 @@
$(document).ready(function() {
$('.datetimepicker').datetimepicker({
dateFormat: 'yy-mm-dd',
timeFormat: 'HH:mm',
dayNames: Spree.translations.abbr_day_names,
dayNamesMin: Spree.translations.abbr_day_names,
monthNames: Spree.translations.month_names,
prevText: Spree.translations.previous,
nextText: Spree.translations.next,
showOn: "button",
showOn: 'button',
controlType: 'select',
oneLine: true,
buttonImage: "<%= asset_path 'datepicker/cal.gif' %>",
buttonImageOnly: true,
stepMinute: 15

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
.container
.row.modal-centered
%h2 {{'welcome_to_ofn' | t}}
%h5 {{'signup_or_login' | t}}:
%h2 {{'js.registration.welcome_to_ofn' | t}}
%h5 {{'js.registration.signup_or_login' | t}}:
%div{"ng-controller" => "AuthenticationCtrl"}
%tabset
%ng-include{src: "'signup.html'"}
@@ -9,9 +9,9 @@
%ng-include{src: "'forgot.html'"}
%div{ ng: { show: "active('/signup')"} }
%hr
{{'have_an_account' | t}}
{{'js.registration.have_an_account' | t}}
%a{ href: "", ng: { click: "select('/login')"}}
{{'action_login' | t}}
{{'js.registration.action_login' | t}}
%a.close-reveal-modal{"ng-click" => "$close()"}
%i.ofn-i_009-close

View File

@@ -7,9 +7,10 @@
*= require admin/spree_backend
*= require admin/spree_auth
*= require shared/jquery-ui-timepicker-addon
*= require jquery-ui-timepicker-addon
*= require shared/textAngular
*= require shared/ng-tags-input.min
*= require admin/custom
*= require_self
*/

View File

@@ -0,0 +1,2 @@
/* Custom fix */
.ui-timepicker-div.ui-timepicker-oneLine dl dd { width: 25%; }

View File

@@ -1,10 +0,0 @@
.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
.ui-timepicker-div dl { text-align: left; }
.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
.ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
.ui-timepicker-div td { font-size: 90%; }
.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
.ui-timepicker-rtl{ direction: rtl; }
.ui-timepicker-rtl dl { text-align: right; }
.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; }

View File

@@ -1,8 +1,7 @@
require 'open_food_network/products_cache_integrity_checker'
class Admin::CacheSettingsController < Spree::Admin::BaseController
def show
def edit
@results = Exchange.cachable.map do |exchange|
checker = OpenFoodNetwork::ProductsCacheIntegrityChecker.new(exchange.receiver, exchange.order_cycle)
@@ -10,4 +9,10 @@ class Admin::CacheSettingsController < Spree::Admin::BaseController
end
end
def update
Spree::Config.set(params[:preferences])
respond_to do |format|
format.html { redirect_to main_app.edit_admin_cache_settings_path }
end
end
end

View File

@@ -79,11 +79,9 @@ module Admin
end
def save_uploaded_file(upload)
filename = 'import' + Time.zone.now.strftime('%d-%m-%Y-%H-%M-%S')
extension = '.' + upload.original_filename.split('.').last
directory = 'tmp/product_import'
Dir.mkdir(directory) unless File.exist?(directory)
File.open(Rails.root.join(directory, filename + extension), 'wb') do |f|
extension = File.extname(upload.original_filename)
directory = Dir.mktmpdir 'product_import'
File.open(File.join(directory, "import#{extension}"), 'wb') do |f|
data = UploadSanitizer.new(upload.read).call
f.write(data)
f.path

View File

@@ -25,7 +25,7 @@ class SubscriptionConfirmJob
def proxy_orders
ProxyOrder.not_canceled.where('confirmed_at IS NULL AND placed_at IS NOT NULL')
.joins(:order_cycle).merge(recently_closed_order_cycles)
.joins(:order).merge(Spree::Order.complete)
.joins(:order).merge(Spree::Order.complete.not_state('canceled'))
end
def recently_closed_order_cycles

View File

@@ -1,3 +1,21 @@
# Validates the combination of on_demand and count_on_hand values.
#
# `on_demand` can have three values: true, false or nil
# `count_on_hand` can either be: nil or a number
#
# This means that a variant override can be in six different stock states
# but only three of them are valid.
#
# | on_demand | count_on_hand | stock_overridden? | use_producer_stock_settings? | valid? |
# |-----------|---------------|-------------------|------------------------------|--------|
# | 1 | nil | false | false | true |
# | 0 | x | true | false | true |
# | nil | nil | false | true | true |
# | 1 | x | ? | ? | false |
# | 0 | nil | ? | ? | false |
# | nil | x | ? | ? | false |
#
# This module has one method for each invalid case.
module StockSettingsOverrideValidation
extend ActiveSupport::Concern

View File

@@ -37,4 +37,7 @@ Spree::AppConfiguration.class_eval do
# Number localization
preference :enable_localized_number?, :boolean, default: false
# Enable cache
preference :enable_products_cache?, :boolean, default: true
end

View File

@@ -36,9 +36,15 @@ class VariantOverride < ActiveRecord::Base
end
def stock_overridden?
# If count_on_hand is present, it means on_demand is false
# See StockSettingsOverrideValidation for details
count_on_hand.present?
end
def use_producer_stock_settings?
on_demand.nil?
end
def move_stock!(quantity)
unless stock_overridden?
Bugsnag.notify RuntimeError.new "Attempting to move stock of a VariantOverride without a count_on_hand specified."

View File

@@ -1,6 +0,0 @@
# Disabled until this form takes order cycles into account
# Deface::Override.new(:virtual_path => "spree/checkout/edit",
# :insert_after => "[data-hook='checkout_summary_box']",
# :partial => "spree/checkout/other_available_distributors",
# :name => "add_change_distributor_form_to_checkout_address",
# :original => '60b9b1a39079f4efa85ff0425108edf671349d4f')

View File

@@ -1,5 +0,0 @@
Deface::Override.new(:virtual_path => "spree/products/show",
:insert_after => "[data-hook='product_show']",
:text => "<%= javascript_include_tag main_app.distributors_enterprises_path(:format => :js) %>",
:name => "add_distributor_details_js_to_product",
:original => 'b05ac497efeeebd4464f29891fd2c4a0f60c24d9')

View File

@@ -1,5 +0,0 @@
Deface::Override.new(:virtual_path => "spree/products/show",
:insert_before => "[data-hook='cart_form']",
:partial => "spree/products/distributor_details",
:name => "add_distributor_details_to_product",
:original => '789e3f5f6f36a8cd4115d7342752a37735659298')

View File

@@ -1,5 +0,0 @@
Deface::Override.new(:virtual_path => "spree/products/_cart_form",
:replace => "[data-hook='product_price'] .add-to-cart",
:partial => "spree/products/add_to_cart",
:name => "add_distributor_to_add_to_cart_form",
:original => '294014222132c795048fc6c7866971a332672c87')

View File

@@ -1,5 +0,0 @@
Deface::Override.new(:virtual_path => "spree/products/show",
:insert_bottom => "[data-hook='product_left_part_wrap']",
:partial => "spree/products/source",
:name => "add_source_to_product",
:original => 'bce3ba4847b3eac8ae061774a664ac4951d3d9db')

View File

@@ -1,5 +0,0 @@
Deface::Override.new(:virtual_path => "spree/checkout/_payment",
:replace => "code[erb-loud]:contains('submit_tag t(:save_and_continue)')",
:text => "<%= submit_tag I18n.t(:process_my_order), :class => 'continue button primary' %>",
:name => "replace_checkout_payment_button",
:original => 'ce2043a01931b3bc16b045302ebb0e0bb9150b67')

View File

@@ -1,5 +0,0 @@
Deface::Override.new(:virtual_path => "spree/checkout/_address",
:replace => "[data-hook='shipping_fieldset_wrapper']",
:partial => "spree/checkout/distributor",
:name => "replace_shipping_address_form_with_distributor_details",
:original => '53e219f90a2e1ba702a767261d0c2afe100ac751')

View File

@@ -1,4 +1,4 @@
/ insert_bottom "[data-hook='admin_configurations_sidebar_menu']"
%li
= link_to t('admin.cache_settings.show.title'), main_app.admin_cache_settings_path
= link_to t('admin.cache_settings.edit.title'), main_app.edit_admin_cache_settings_path

View File

@@ -1,4 +0,0 @@
/ insert_bottom "[data-hook='admin_product_sub_tabs']"
-# Commenting out for now, until product import is finished
-# = tab :product_import, label: "Import", url: main_app.admin_product_import_path, match_path: '/product_import'

View File

@@ -1,3 +0,0 @@
/ insert_bottom "[data-hook='admin_product_sub_tabs']"
= tab :variant_overrides, url: main_app.admin_inventory_path, match_path: '/inventory'

View File

@@ -1,5 +0,0 @@
/ replace_contents '#shipping_method p#minstrs'
= form.label :special_instructions, t(:delivery_instructions)
%br/
= form.text_area :special_instructions, :cols => 40, :rows => 7

View File

@@ -1,2 +0,0 @@
/ replace_contents '#shipping_method legend'
= t(:delivery_method)

View File

@@ -1,16 +0,0 @@
<!-- insert_after '[data-hook="checkout_summary_box"]'
sequence :before => 'add_change_distributor_form_to_checkout_address' -->
<% # Add a new 'Save and Continue/Process My Order' button under Order Summary on the checkout pages %>
<div id="add_new_save_checkout_button" class="columns omega four">
<%= submit_tag @order.state == "payment" ? t(:process_my_order) : t(:save_and_continue),
:class => "continue button primary large",
:form=> "checkout_form_#{@order.state}" %>
<script>
//Show additional button only if form attribute is supported
if ($("#add_new_save_checkout_button input[type=submit]")[0].form) {
$("#add_new_save_checkout_button").show();
}
</script>
</div>

View File

@@ -1,16 +0,0 @@
/ replace_contents '#product-variants'
%h6.product-section-title= t(:variants)
%ul
- has_checked = false
- @product.variants.active(current_currency).each_with_index do |v,index|
- next if v.option_values.empty? || (!v.in_stock && !Spree::Config[:show_zero_stock_products])
- next if current_order_cycle.present? && !current_order_cycle.has_variant?(v) # All copied from spree apart from this line
- checked = !has_checked && (v.in_stock || Spree::Config[:allow_backorders])
- has_checked = true if checked
%li
= radio_button_tag "products[#{@product.id}]", v.id, checked, :disabled => !v.in_stock && !Spree::Config[:allow_backorders], 'data-price' => v.price_in(current_currency).display_price
%label{:for => ['products', @product.id, v.id].join('_')}
%span.variant-description= variant_options v
- if variant_price v
%span.price.diff= variant_price v

View File

@@ -1 +0,0 @@
/ remove '#taxon-crumbs'

View File

@@ -1,6 +1,19 @@
- content_for :page_title do
= t(:cache_settings)
= form_tag main_app.admin_cache_settings_path, :method => :put do
.field
= hidden_field_tag 'preferences[enable_products_cache?]', '0'
= check_box_tag 'preferences[enable_products_cache?]', '1', Spree::Config[:enable_products_cache?]
= label_tag nil, t('.enable_products_cache')
.form-buttons
= button t(:update), 'icon-refresh'
%br
%br
%h4= t(:cache_state)
%br
%table.index
%thead
%tr

View File

@@ -2,7 +2,7 @@
#{t('admin.product_import.title')}
= render partial: 'ams_data'
= render partial: 'spree/admin/shared/product_sub_menu'
= render partial: 'admin/shared/product_sub_menu'
.import-wrapper{ng: {app: 'admin.productImport', controller: 'ImportFormCtrl'}}

View File

@@ -1,7 +1,7 @@
- content_for :page_title do
#{t('admin.product_import.title')}
= render partial: 'spree/admin/shared/product_sub_menu'
= render partial: 'admin/shared/product_sub_menu'
= render 'upload_sidebar'

View File

@@ -0,0 +1,8 @@
= content_for :sub_menu do
%ul#sub_nav.inline-menu
= tab :products, match_path: '/products'
= tab :option_types, match_path: '/option_types'
= tab :properties
= tab :prototypes
= tab :variant_overrides, url: main_app.admin_inventory_path, match_path: '/inventory'
= tab :import, url: main_app.admin_product_import_path, match_path: '/product_import'

View File

@@ -5,4 +5,4 @@
%h1.page-title= t("admin.variant_overrides.index.title")
%a.with-tip{ 'data-powertip' => "#{t("admin.variant_overrides.index.description")}" }=t('admin.whats_this')
= render :partial => 'spree/admin/shared/product_sub_menu'
= render partial: 'admin/shared/product_sub_menu'

View File

@@ -4,9 +4,9 @@
.row
.small-12.columns
%header
%h2 {{'enterprise_about_headline' | t}}
%h2= t(".headline")
%h5
{{'enterprise_about_message' | t}}
= t(".message")
%span{ ng: { class: "{brick: !enterprise.is_primary_producer, turquoise: enterprise.is_primary_producer}" } }
{{ enterprise.name }}
@@ -14,33 +14,33 @@
.row
.small-12.columns
.alert-box.info{ "ofn-inline-alert" => true, ng: { show: "visible" } }
%h6{ "ng-bind" => "'enterprise_success' | t:{enterprise: enterprise.name}" }
%span {{'enterprise_registration_exit_message' | t}}
%h6{ "ng-bind" => "'registration.steps.about.success' | t:{enterprise: enterprise.name}" }
%span= t(".registration_exit_message")
%a.close{ ng: { click: "close()" } } &times;
.small-12.large-8.columns
.row
.small-12.columns
.field
%label{ for: 'enterprise_description' } {{'enterprise_description' | t}}:
%input.chunky{ id: 'enterprise_description', placeholder: "{{'enterprise_description_placeholder' | t}}", ng: { model: 'enterprise.description' } }
%label{ for: 'enterprise_description' }= t(".enterprise_description")
%input.chunky{ id: 'enterprise_description', placeholder: "{{'registration.steps.about.enterprise_description_placeholder' | t}}", ng: { model: 'enterprise.description' } }
.row
.small-12.columns
.field
%label{ for: 'enterprise_long_desc' } {{'enterprise_long_desc' | t}}:
%textarea.chunky{ id: 'enterprise_long_desc', rows: 6, placeholder: "{{'enterprise_long_desc_placeholder' | t}}", ng: { model: 'enterprise.long_description' } }
%small{ "ng-bind" => "'enterprise_long_desc_length' | t:{num: enterprise.long_description.length}" }
%label{ for: 'enterprise_long_desc' }= t(".enterprise_long_desc")
%textarea.chunky{ id: 'enterprise_long_desc', rows: 6, placeholder: "{{'registration.steps.about.enterprise_long_desc_placeholder' | t}}", ng: { model: 'enterprise.long_description' } }
%small{ "ng-bind" => "'registration.steps.about.enterprise_long_desc_length' | t:{num: enterprise.long_description.length}" }
.small-12.large-4.columns
.row
.small-12.columns
.field
%label{ for: 'enterprise_abn' } {{'enterprise_abn' | t}}:
%input.chunky{ id: 'enterprise_abn', placeholder: "{{'enterprise_abn_placeholder' | t}}", ng: { model: 'enterprise.abn' } }
%label{ for: 'enterprise_abn' }= t(".enterprise_abn")+":"
%input.chunky{ id: 'enterprise_abn', placeholder: "{{'registration.steps.about.enterprise_abn_placeholder' | t}}", ng: { model: 'enterprise.abn' } }
.row
.small-12.columns
.field
%label{ for: 'enterprise_acn' } {{'enterprise_acn' | t}}:
%input.chunky{ id: 'enterprise_acn', placeholder: "{{'enterprise_acn_placeholder' | t}}", ng: { model: 'enterprise.acn' } }
%label{ for: 'enterprise_acn' }= t(".enterprise_acn")+":"
%input.chunky{ id: 'enterprise_acn', placeholder: "{{'registration.steps.about.enterprise_acn_placeholder' | t}}", ng: { model: 'enterprise.acn' } }
.row
.small-12.columns
.field
@@ -50,7 +50,7 @@
%input{ id: 'enterprise_charges_sales_tax_false', type: 'radio', name: 'charges_sales_tax', value: 'false', required: true, ng: { model: 'enterprise.charges_sales_tax' } }
%label{ for: 'enterprise_charges_sales_tax_false' } {{'say_no' | t}}
%span.error.small-12.columns{ ng: { show: "about.charges_sales_tax.$error.required && submitted" } }
{{'enterprise_tax_required' | t}}
= t(".enterprise_tax_required")
.row.buttons.pad-top
.small-12.columns

View File

@@ -4,26 +4,26 @@
.row
.small-12.columns
%header
%h2 {{'registration_greeting' | t}}
%h5{ "ng-bind" => "'who_is_managing_enterprise' | t:{enterprise: enterprise.name}" }
%h2= t('registration.steps.introduction.registration_greeting')
%h5{ "ng-bind" => "'registration.steps.contact.who_is_managing_enterprise' | t:{enterprise: enterprise.name}" }
%form{ name: 'contact', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('type',contact)" } }
.row.content
.small-12.medium-12.large-7.columns
.row
.small-12.columns.field
%label{ for: 'enterprise_contact' } {{'enterprise.registration.modal.steps.contact.contact_field' | t}}:
%input.chunky.small-12.columns{ id: 'enterprise_contact', name: 'contact_name', required: true, placeholder: "{{'enterprise.registration.modal.steps.contact.contact_field_placeholder' | t}}", ng: { model: 'enterprise.contact_name' } }
%label{ for: 'enterprise_contact' }= t(".contact_field")
%input.chunky.small-12.columns{ id: 'enterprise_contact', name: 'contact_name', required: true, placeholder: "{{'registration.steps.contact.contact_field_placeholder' | t}}", ng: { model: 'enterprise.contact_name' } }
%span.error.small-12.columns{ ng: { show: "contact.contact_name.$error.required && submitted" } }
{{'enterprise.registration.modal.steps.contact.contact_field_required' | t}}
= t(".contact_field_required")
.row
.small-12.columns.field
%label{ for: 'enterprise_email_address' } {{'admin.enterprises.form.contact.email_address' | t}}:
%label{ for: 'enterprise_email_address' }= t("admin.enterprises.form.contact.email_address")+":"
%input.chunky.small-12.columns{ id: 'enterprise_email_address', name: 'email_address', type: 'email', placeholder: t('admin.enterprises.form.contact.email_address_placeholder'), ng: { model: 'enterprise.email_address' } }
.row
.small-12.columns.field
%label{ for: 'enterprise_phone' } {{'enterprise.registration.modal.steps.contact.phone_field' | t}}:
%input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'enterprise.registration.modal.steps.contact.phone_field_placeholder' | t}}", ng: { model: 'enterprise.phone' } }
%label{ for: 'enterprise_phone' }= t(".phone_field")+":"
%input.chunky.small-12.columns{ id: 'enterprise_phone', name: 'phone', placeholder: "{{'registration.steps.contact.phone_field_placeholder' | t}}", ng: { model: 'enterprise.phone' } }
.small-12.medium-12.large-5.hide-for-small-only
.row.buttons

View File

@@ -4,60 +4,59 @@
.row
.small-12.columns
%header
%h2 {{'enterprise.registration.modal.steps.details.headline' | t}}
%h5{ ng: { if: "::enterprise.type != 'own'" } } {{'enterprise.registration.modal.steps.details.enterprise' | t}}
%h5{ ng: { if: "::enterprise.type == 'own'" } } {{'enterprise.registration.modal.steps.details.producer' | t}}
%h2= t('.headline')
%h5{ ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise")
%h5{ ng: { if: "::enterprise.type == 'own'" } }= t(".producer")
%form{ name: 'details', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "selectIfValid('contact',details)" } }
.row
.small-12.medium-9.large-12.columns.end
.field
%label{ for: 'enterprise_name', ng: { if: "::enterprise.type != 'own'" } } {{'enterprise.registration.modal.steps.details.enterprise_name_field' | t}}
%label{ for: 'enterprise_name', ng: { if: "::enterprise.type == 'own'" } } {{'enterprise.registration.modal.steps.details.producer_name_field' | t}}
%input.chunky{ id: 'enterprise_name', name: 'name', placeholder: "{{'enterprise.registration.modal.steps.details.producer_name_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.name' } }
%label{ for: 'enterprise_name', ng: { if: "::enterprise.type != 'own'" } }= t(".enterprise_name_field")
%label{ for: 'enterprise_name', ng: { if: "::enterprise.type == 'own'" } }= t(".producer_name_field")
%input.chunky{ id: 'enterprise_name', name: 'name', placeholder: "{{'registration.steps.details.producer_name_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.name' } }
%span.error{ ng: { show: "details.name.$error.required && submitted" } }
{{'enterprise.registration.modal.steps.details.producer_name_field_error' | t}}
= t(".producer_name_field_error")
.row
.small-12.medium-9.large-6.columns
.field
%label{ for: 'enterprise_address' } {{'enterprise.registration.modal.steps.details.address1_field' | t}}
%input.chunky{ id: 'enterprise_address', name: 'address1', required: true, placeholder: "{{'enterprise.registration.modal.steps.details.address1_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.address.address1' } }
%label{ for: 'enterprise_address' }= t(".address1_field")
%input.chunky{ id: 'enterprise_address', name: 'address1', required: true, placeholder: "{{'registration.steps.details.address1_field_placeholder' | t}}", required: true, ng: { model: 'enterprise.address.address1' } }
%span.error{ ng: { show: "details.address1.$error.required && submitted" } }
{{'enterprise.registration.modal.steps.details.address1_field_error' | t}}
= t(".address1_field_error")
.field
%label{ for: 'enterprise_address2' } {{'enterprise.registration.modal.steps.details.address2_field' | t}}
%label{ for: 'enterprise_address2' }= t(".address2_field")
%input.chunky{ id: 'enterprise_address2', name: 'address2', required: false, placeholder: "", required: false, ng: { model: 'enterprise.address.address2' } }
.small-12.medium-9.large-6.columns.end
.row
.small-12.medium-8.large-8.columns
.field
%label{ for: 'enterprise_city' } {{'enterprise.registration.modal.steps.details.suburb_field' | t}}
%input.chunky{ id: 'enterprise_city', name: 'city', required: true, placeholder: "{{'enterprise.registration.modal.steps.details.suburb_field_placeholder' | t}}", ng: { model: 'enterprise.address.city' } }
%label{ for: 'enterprise_city' }= t('.suburb_field')
%input.chunky{ id: 'enterprise_city', name: 'city', required: true, placeholder: "{{'registration.steps.details.suburb_field_placeholder' | t}}", ng: { model: 'enterprise.address.city' } }
%span.error{ ng: { show: "details.city.$error.required && submitted" } }
{{'enterprise.registration.modal.steps.details.suburb_field_error' | t}}
= t(".suburb_field_error")
.small-12.medium-4.large-4.columns
.field
%label{ for: 'enterprise_zipcode' } {{'enterprise.registration.modal.steps.details.postcode_field' | t}}
%input.chunky{ id: 'enterprise_zipcode', name: 'zipcode', required: true, placeholder: "{{'enterprise.registration.modal.steps.details.postcode_field_placeholder' | t}}", ng: { model: 'enterprise.address.zipcode' } }
%label{ for: 'enterprise_zipcode' }= t(".postcode_field")
%input.chunky{ id: 'enterprise_zipcode', name: 'zipcode', required: true, placeholder: "{{'registration.steps.details.postcode_field_placeholder' | t}}", ng: { model: 'enterprise.address.zipcode' } }
%span.error{ ng: { show: "details.zipcode.$error.required && submitted" } }
{{'enterprise.registration.modal.steps.details.postcode_field_error' | t}}
= t(".postcode_field_error")
.row
.small-12.medium-4.large-4.columns
.field
%label{ for: 'enterprise_state' } {{'enterprise.registration.modal.steps.details.state_field' | t}}
%label{ for: 'enterprise_state' }= t(".state_field")
%select.chunky{ id: 'enterprise_state', name: 'state', ng: { model: 'enterprise.address.state_id', options: 's.id as s.abbr for s in enterprise.country.states', show: 'countryHasStates()', required: 'countryHasStates()' } }
%span.error{ ng: { show: "details.state.$error.required && submitted" } }
{{'enterprise.registration.modal.steps.details.state_field_error' | t}}
= t(".state_field_error")
.small-12.medium-8.large-8.columns
.field
%label{ for: 'enterprise_country' } {{'enterprise.registration.modal.steps.details.country_field' | t}}
%label{ for: 'enterprise_country' }= t(".country_field")
%select.chunky{ id: 'enterprise_country', name: 'country', required: true, ng: { init: "setDefaultCountry(#{Spree::Config[:default_country_id]})", model: 'enterprise.country', options: 'c as c.name for c in countries' } }
%span.error{ ng: { show: "details.country.$error.required && submitted" } }
{{'enterprise.registration.modal.steps.details.country_field_error' | t}}
= t(".country_field_error")
.row.buttons
.small-12.columns

View File

@@ -3,10 +3,10 @@
.row
.small-12.columns.pad-top
%header
%h2 {{'registration_finished_headline' | t}}
%h2= t(".headline")
.panel.callout
%p{ "ng-bind" => "'registration_finished_thanks' | t:{enterprise: enterprise.name}" }
%p {{'registration_finished_login' | t}}
%p{ "ng-bind" => "'registration.steps.finished.thanks' | t:{enterprise: enterprise.name}" }
%p= t(".login")
.row
.small-12.columns.text-center
%a.button.primary{ type: "button", href: "/" } {{'registration_finished_action' | t}} &gt;
%a.button.primary{ type: "button", href: "/" }= "#{t(".action")} >"

View File

@@ -2,35 +2,35 @@
.row
.small-12.columns
%header
%h2 {{'registration_greeting' | t}}
%h2= t(".registration_greeting")
%h4
%small
%i.ofn-i_040-hub
{{'registration_intro' | t}}
= t(".registration_intro")
.row{ 'data-equalizer' => true }
.small-12.medium-12.large-6.columns.pad-top{ 'data-equalizer-watch' => true }
%h5 {{'registration_checklist' | t}}:
%h5= t(".registration_checklist")+":"
%ul.check-list
%li
{{'registration_time' | t}}
= t(".registration_time")
%li
{{'registration_enterprise_address' | t}}
= t(".registration_enterprise_address")
%li
{{'registration_contact_details' | t}}
= t(".registration_contact_details")
%li
{{'registration_logo' | t}}
= t(".registration_logo")
%li
{{'registration_promo_image' | t}}
= t(".registration_promo_image")
%li
{{'registration_about_us' | t}}
= t(".registration_about_us")
.small-9.medium-8.large-5.columns.pad-top.end{ 'data-equalizer-watch' => true}
%h5
{{'registration_outcome_headline' | t}}
%p{ "ng-bind-html" => "t('registration_outcome1_html')" }
%p {{'registration_outcome2' | t}}
%p {{'registration_outcome3' | t}}
= t(".registration_outcome_headline")
%p= t(".registration_outcome1_html")
%p= t(".registration_outcome2")
%p= t(".registration_outcome3")
.row{'ng-init' => "tos_required=#{Spree::Config.enterprises_require_tos}" }
%hr
@@ -43,4 +43,4 @@
%label{for: "accept_terms"} #{t(:enterprise_tos_agree)}
.small-12.medium-6.columns
%input.button.primary.left{ type: "button", value: "{{'registration_action' | t}}", ng: { click: "select('details')", disabled: "tos_required && !tos_accepted", model: "tos_accepted"} }
%input.button.primary.left{ type: "button", value: "{{'registration.steps.introduction.registration_action' | t}}", ng: { click: "select('details')", disabled: "tos_required && !tos_accepted", model: "tos_accepted"} }

View File

@@ -2,16 +2,16 @@
.row
.small-12.columns
%header
%h2 {{'limit_reached_headline' | t}}
%h4 {{'limit_reached_message' | t}}
%h2= t(".headline")
%h4= t(".message")
.row
.small-12.medium-3.large-2.columns.text-right.hide-for-small-only
%img{:src => "/assets/potatoes.png"}
.small-12.medium-9.large-10.columns
%p
{{'limit_reached_text' | t}}
= t(".text")
%strong Open Food Network.
.row
.small-12.columns
%hr
%input.button.primary{ type: "button", value: "{{'limit_reached_action' | t}}", ng: { click: "close()" } }
%input.button.primary{ type: "button", value: "{{'registration.steps.limit_reached.action' | t}}", ng: { click: "close()" } }

View File

@@ -5,42 +5,42 @@
.row
.small-12.columns.center
%h4
{{'select_logo' | t}}
= t(".select_logo")
.row
.small-12.columns.center
%span.small
{{'logo_tip' | t}}
= t(".logo_tip")
.row.pad-top
.small-12.columns
.image-select.small-12.columns
%label.small-12.columns.button{ for: 'image-select' } {{'logo_label' | t}}
%label.small-12.columns.button{ for: 'image-select' }= t(".logo_label")
%input#image-select{ type: 'file', hidden: true, 'nv-file-select' => true, uploader: "imageUploader", options: '{ alias: imageStep }' }
.row.show-for-large-up
.large-12.columns
%span#or.large-12.columns
{{'action_or' | t}}
= t("action_or")
.row.show-for-large-up
.large-12.columns
#image-over{ 'nv-file-over' => true, uploader: "imageUploader" }
{{'logo_drag' | t}}
= t(".logo_drag")
.small-12.medium-12.large-6.columns
.row
.small-12.columns.center
.row
.small-12.columns.center
%h4
{{'review_logo' | t}}
= t(".review_logo")
.row
.small-12.columns.center
%span.small
{{'review_logo_tip' | t}}
= t(".review_logo_tip")
.row.pad-top
.small-12.columns.center
#image-placeholder.logo
%img{ ng: { show: "imageSrc() && !imageUploader.isUploading", src: '{{ imageSrc() }}' } }
.message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } }
{{'logo_placeholder' | t}}
= t(".logo_placeholder")
.loading{ ng: { hide: "!imageUploader.isUploading" } }
%img.spinner{ src: "/assets/spinning-circles.svg" }
%br/
{{'uploading' | t}}
= t("registration.steps.images.uploading")

View File

@@ -3,42 +3,42 @@
.row
.small-12.columns.center
%h4
{{'select_promo_image' | t}}
= t(".select_promo_image")
.row
.small-12.medium-12.large-5.columns.center
.row
.small-12.columns.center
%span.small
{{'promo_image_tip' | t}}
= t(".promo_image_tip")
.row.pad-top
.small-12.columns
.image-select.small-12.columns
%label.small-12.columns.button{ for: 'image-select' } {{'promo_image_label' | t}}
%label.small-12.columns.button{ for: 'image-select' }= t(".promo_image_label")
%input#image-select{ type: 'file', hidden: true, 'nv-file-select' => true, uploader: "imageUploader", options: '{ alias: imageStep }' }
.large-2.columns
%span#or.horizontal.large-12.columns
{{'action_or' | t}}
= t("action_or")
.large-5.columns
#image-over{ 'nv-file-over' => true, uploader: "imageUploader" }
{{'promo_image_drag' | t}}
= t(".promo_image_drag")
.small-12.medium-12.large-12.columns.pad-top
.row
.small-12.columns.center
%h4
{{'review_promo_image' | t}}
= t(".review_promo_image")
.row
.small-12.columns.center
.row
.small-12.columns.center
%span.small
{{'review_promo_image_tip' | t}}
= t(".review_promo_image_tip")
.row.pad-top
.small-12.columns.center
#image-placeholder.promo
%img{ ng: { show: "imageSrc() && !imageUploader.isUploading", src: '{{ imageSrc() }}' } }
.message{ ng: { hide: "imageSrc() || imageUploader.isUploading" } }
{{'promo_image_placeholder' | t}}
= t(".promo_image_placeholder")
.loading{ ng: { hide: "!imageUploader.isUploading" } }
%img.spinner{ src: "/assets/spinning-circles.svg" }
%br/
{{'uploading' | t}}
= t("registration.steps.images.uploading")

View File

@@ -5,8 +5,8 @@
.row
.small-12.columns
%header
%h2 {{'enterprise_final_step' | t}}
%h5{ "ng-bind" => "'enterprise_social_text' | t:{enterprise: enterprise.name}" }
%h2= t(".enterprise_final_step")
%h5{ "ng-bind" => "'registration.steps.social.enterprise_social_text' | t:{enterprise: enterprise.name}" }
%form{ name: 'social', novalidate: true, ng: { controller: "RegistrationFormCtrl", submit: "update('finished',social)" } }
.row.content
@@ -14,29 +14,29 @@
.row
.small-12.columns
.field
%label{ for: 'enterprise_website' } {{'website' | t}}:
%input.chunky{ id: 'enterprise_website', placeholder: "{{'website_placeholder' | t}}", ng: { model: 'enterprise.website' } }
%label{ for: 'enterprise_website' }= t(".website")+":"
%input.chunky{ id: 'enterprise_website', placeholder: "{{'registration.steps.social.website_placeholder' | t}}", ng: { model: 'enterprise.website' } }
.row
.small-12.columns
.field
%label{ for: 'enterprise_facebook' } {{'facebook' | t}}:
%input.chunky{ id: 'enterprise_facebook', placeholder: "{{'facebook_placeholder' | t}}", ng: { model: 'enterprise.facebook' } }
%label{ for: 'enterprise_facebook' }= t(".facebook")+":"
%input.chunky{ id: 'enterprise_facebook', placeholder: "{{'registration.steps.social.facebook_placeholder' | t}}", ng: { model: 'enterprise.facebook' } }
.row
.small-12.columns
.field
%label{ for: 'enterprise_linkedin' } {{'linkedin' | t}}:
%input.chunky{ id: 'enterprise_linkedin', placeholder: "{{'linkedin_placeholder' | t}}", ng: { model: 'enterprise.linkedin' } }
%label{ for: 'enterprise_linkedin' }= t(".linkedin")+":"
%input.chunky{ id: 'enterprise_linkedin', placeholder: "{{'registration.steps.social.linkedin_placeholder' | t}}", ng: { model: 'enterprise.linkedin' } }
.small-12.large-5.columns
.row
.small-12.columns
.field
%label{ for: 'enterprise_twitter' } {{'twitter' | t}}:
%input.chunky{ id: 'enterprise_twitter', placeholder: "{{'twitter_placeholder' | t}}", ng: { model: 'enterprise.twitter' } }
%label{ for: 'enterprise_twitter' }= t(".twitter")+":"
%input.chunky{ id: 'enterprise_twitter', placeholder: "{{'registration.steps.social.twitter_placeholder' | t}}", ng: { model: 'enterprise.twitter' } }
.row
.small-12.columns
.field
%label{ for: 'enterprise_instagram' } {{'instagram' | t}}:
%input.chunky{ id: 'enterprise_instagram', placeholder: "{{'instagram_placeholder' | t}}", ng: { model: 'enterprise.instagram' } }
%label{ for: 'enterprise_instagram' }= t(".instagram")+":"
%input.chunky{ id: 'enterprise_instagram', placeholder: "{{'registration.steps.social.instagram_placeholder' | t}}", ng: { model: 'enterprise.instagram' } }
.row.buttons
.small-12.columns

View File

@@ -1,5 +1,5 @@
%script{ type: "text/ng-template", id: "registration/steps.html" }
.row#progress-bar
.small-12.medium-2.columns.item{ ng: { repeat: 'step in steps', class: "{active: (currentStep() == step),'show-for-medium-up': (currentStep() != step)}" } }
{{ $index+1 + ". " + ('enterprise.registration.modal.steps.' + step + '.title' | t) }}
{{ $index+1 + ". " + ('registration.steps.' + step + '.title' | t) }}

View File

@@ -1,4 +1,4 @@
= render :partial => 'spree/admin/shared/product_sub_menu'
= render partial: 'admin/shared/product_sub_menu'
= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Group Buy Options' }
= render :partial => 'spree/shared/error_messages', :locals => { :target => @product }

View File

@@ -7,6 +7,6 @@
%li#new_product_link
= button_link_to t(:new_product), new_object_url, { :remote => true, :icon => 'icon-plus', :id => 'admin_new_product' }
= render :partial => 'spree/admin/shared/product_sub_menu'
= render partial: 'admin/shared/product_sub_menu'
%div#new_product(data-hook)

View File

@@ -1,4 +1,4 @@
= render :partial => 'spree/admin/shared/product_sub_menu'
= render partial: 'admin/shared/product_sub_menu'
= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Product Distributions' }
= render :partial => 'spree/shared/error_messages', :locals => { :target => @product }

View File

@@ -1,4 +1,4 @@
= render :partial => 'spree/admin/shared/product_sub_menu'
= render partial: 'admin/shared/product_sub_menu'
= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => t(:Search) }
= render :partial => 'spree/shared/error_messages', :locals => { :target => @product }