Resolve merge conflicts
This commit is contained in:
commit
a5565b436f
18 changed files with 72 additions and 880 deletions
|
|
@ -4,8 +4,9 @@
|
|||
//= require select2
|
||||
//= require twitter/bootstrap
|
||||
//= require jquery.tokeninput
|
||||
//= require bootstrap-datepicker
|
||||
//= require bootstrap-datepicker.de
|
||||
//= require bootstrap-datepicker/core
|
||||
//= require bootstrap-datepicker/locales/bootstrap-datepicker.de
|
||||
//= require bootstrap-datepicker/locales/bootstrap-datepicker.nl
|
||||
//= require jquery.observe_field
|
||||
//= require rails.validations
|
||||
//= require_self
|
||||
|
|
@ -141,7 +142,7 @@ $(function() {
|
|||
});
|
||||
|
||||
// Use bootstrap datepicker for dateinput
|
||||
$('.datepicker').datepicker({format: 'yyyy-mm-dd', weekStart: 1, language: 'de'});
|
||||
$('.datepicker').datepicker({format: 'yyyy-mm-dd', language: I18n.locale});
|
||||
|
||||
// Init table sorting
|
||||
var myBars = $('.sorter-bar');
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
*= require bootstrap_and_overrides
|
||||
*= require select2
|
||||
*= require token-input-bootstrappy
|
||||
*/
|
||||
*= require bootstrap-datepicker
|
||||
|
|
|
|||
|
|
@ -31,10 +31,6 @@ body {
|
|||
// Example:
|
||||
// @linkColor: #ff0000;
|
||||
|
||||
|
||||
// Bootstrap datepicker
|
||||
@import "datepicker";
|
||||
|
||||
// Custom styles
|
||||
|
||||
// Fix empty dd tags in horizontal dl, see https://github.com/twitter/bootstrap/issues/4062
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class ArticlesController < ApplicationController
|
|||
end
|
||||
|
||||
def new
|
||||
@article = @supplier.articles.build(:tax => 7.0)
|
||||
@article = @supplier.articles.build(:tax => FoodsoftConfig[:tax_default])
|
||||
render :layout => false
|
||||
end
|
||||
|
||||
|
|
@ -145,19 +145,22 @@ class ArticlesController < ApplicationController
|
|||
begin
|
||||
@articles = Array.new
|
||||
articles, outlisted_articles = FoodsoftFile::parse(params[:articles]["file"])
|
||||
no_category = ArticleCategory.new
|
||||
articles.each do |row|
|
||||
# fallback to Others category
|
||||
category = (ArticleCategory.find_by_name(row[:category]) or no_category)
|
||||
# creates a new article and price
|
||||
article = Article.new( :name => row[:name],
|
||||
:note => row[:note],
|
||||
:manufacturer => row[:manufacturer],
|
||||
:origin => row[:origin],
|
||||
:unit => row[:unit],
|
||||
:article_category => ArticleCategory.find_by_name(row[:category]),
|
||||
:article_category => category,
|
||||
:price => row[:price],
|
||||
:unit_quantity => row[:unit_quantity],
|
||||
:order_number => row[:number],
|
||||
:deposit => row[:deposit],
|
||||
:tax => row[:tax])
|
||||
:tax => (row[:tax] or FoodsoftConfig[:tax_default]))
|
||||
# stop parsing, when an article isn't valid
|
||||
unless article.valid?
|
||||
raise I18n.t('articles.controller.error_parse', :msg => article.errors.full_messages.join(", "), :line => (articles.index(row) + 2).to_s)
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class GroupOrdersController < ApplicationController
|
|||
@order = Order.find((params[:order_id] || params[:group_order][:order_id]),
|
||||
:include => [:supplier, :order_articles])
|
||||
unless @order.open?
|
||||
flash[:notice] = I18n.t('group_orders.error_closed')
|
||||
flash[:notice] = I18n.t('group_orders.errors.closed')
|
||||
redirect_to :action => 'index'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
- @articles.each_with_index do |article, index|
|
||||
= fields_for "articles[#{article.id || index}]", article do |form|
|
||||
%tr
|
||||
%td= form.check_box 'availability'
|
||||
%td
|
||||
= yield form # allow to add hidden fields to form
|
||||
= form.check_box 'availability'
|
||||
%td= form.text_field 'name', class: 'input-medium'
|
||||
%td= form.text_field 'unit', class: 'input-mini'
|
||||
%td= form.text_field 'price', class: 'input-mini'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
%p= t('.body').html_safe
|
||||
|
||||
= form_tag(create_from_upload_supplier_articles_path(@supplier)) do
|
||||
= render 'edit_all_table'
|
||||
= render layout: 'edit_all_table' do |form|
|
||||
= form.hidden_field :manufacturer
|
||||
= form.hidden_field :origin
|
||||
.form-actions
|
||||
= submit_tag t('.submit', supplier: @supplier.name), class: 'btn btn-primary'
|
||||
= link_to t('ui.or_cancel'), upload_supplier_articles_path(@supplier)
|
||||
|
|
|
|||
|
|
@ -22,5 +22,7 @@
|
|||
Javascripts
|
||||
\==================================================
|
||||
/ Placed at the end of the document so the pages load faster
|
||||
:javascript
|
||||
I18n = {locale: '#{j(I18n.locale.to_s)}'}
|
||||
= javascript_include_tag "application"
|
||||
= yield(:javascript)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
= t '.text0', ordergroup: @group_order.ordergroup.name, order: @order.name, when: I18n.l(@order.ends), user: @order.updated_by.nick
|
||||
= raw t '.text0', ordergroup: @group_order.ordergroup.name, order: @order.name, when: I18n.l(@order.ends), user: @order.updated_by.nick
|
||||
- for group_order_article in @group_order.group_order_articles.ordered.all(:include => :order_article)
|
||||
- article = group_order_article.order_article.article
|
||||
#{article.name}: #{group_order_article.result} x #{article.unit} = #{group_order_article.result * article.fc_price}
|
||||
= t '.text1', sum: @group_order.price, order_url: group_order_url(@group_order), foodcoop: FoodsoftConfig[:name]
|
||||
- article = group_order_article.order_article.article
|
||||
\- #{article.name}: #{group_order_article.result} x #{article.unit} = #{group_order_article.result * article.fc_price}
|
||||
= raw t '.text1', sum: @group_order.price, order_url: group_order_url(@group_order), foodcoop: FoodsoftConfig[:name]
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class UserNotifier
|
|||
|
||||
# Resque style method to perform every class method defined here
|
||||
def self.perform(foodcoop, method_name, *args)
|
||||
FoodsoftConfig.select_foodcoop(foodcoop)
|
||||
FoodsoftConfig.select_foodcoop(foodcoop) if FoodsoftConfig[:multi_coop_install]
|
||||
self.send method_name, args
|
||||
end
|
||||
|
||||
|
|
@ -40,4 +40,4 @@ class UserNotifier
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue