From 1e011256e9715a6112fb17058fcdce3e151b34a4 Mon Sep 17 00:00:00 2001 From: sandoz Date: Tue, 7 Apr 2009 01:54:07 +0800 Subject: [PATCH 1/4] Remove all non-digits before sorting by order number in finance/balancing * Since order_number is a string, there can be more than a-zA-Z + digits Signed-off-by: bennibu --- app/controllers/finance/balancing_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/finance/balancing_controller.rb b/app/controllers/finance/balancing_controller.rb index 30d907d3..d2292d9a 100644 --- a/app/controllers/finance/balancing_controller.rb +++ b/app/controllers/finance/balancing_controller.rb @@ -34,9 +34,9 @@ class Finance::BalancingController < ApplicationController ) if params[:sort] == "order_number" - @articles = @articles.sort { |a,b| a.article.order_number.gsub(/[a-zA-Z]/, "").to_i <=> b.article.order_number.gsub(/[a-zA-Z]/, "").to_i } + @articles = @articles.sort { |a,b| a.article.order_number.gsub(/[^[:digit:]]/, "").to_i <=> b.article.order_number.gsub(/[^[:digit:]]/, "").to_i } elsif params[:sort] == "order_number_reverse" - @articles = @articles.sort { |a,b| b.article.order_number.gsub(/[a-zA-Z]/, "").to_i <=> a.article.order_number.gsub(/[a-zA-Z]/, "").to_i } + @articles = @articles.sort { |a,b| b.article.order_number.gsub(/[^[:digit:]]/, "").to_i <=> a.article.order_number.gsub(/[^[:digit:]]/, "").to_i } end view = params[:view] From e3f9df0a0c956c6ad13e5224f91432ff59f8e949 Mon Sep 17 00:00:00 2001 From: sandoz Date: Tue, 7 Apr 2009 02:06:53 +0800 Subject: [PATCH 2/4] Replaced account_balance by available_funds in ordergroup view. Signed-off-by: bennibu --- app/views/home/ordergroup.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/home/ordergroup.html.erb b/app/views/home/ordergroup.html.erb index 8f23abfb..d8f772fb 100644 --- a/app/views/home/ordergroup.html.erb +++ b/app/views/home/ordergroup.html.erb @@ -5,7 +5,7 @@

Beschreibung: <%=h @ordergroup.description %> <%= link_to '(ändern)', :controller => 'foodcoop', :action => 'edit_group', :id => @ordergroup %>

-

Kontostand: <%= number_to_currency(@ordergroup.account_balance) %>

+

Verfügbares Guthaben: <%= number_to_currency(@ordergroup.get_available_funds()) %>

Personen

    <% for membership in @ordergroup.memberships -%> From 00696c0e64f5219c9fe43195980846b299bdfd3f Mon Sep 17 00:00:00 2001 From: sandoz Date: Tue, 7 Apr 2009 02:09:52 +0800 Subject: [PATCH 3/4] Replaced account balance by available funds on start page. * Closes #206 Signed-off-by: bennibu --- app/views/home/index.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index a13790d8..3461e105 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -47,8 +47,8 @@ %p %b= @ordergroup.name | - Kontostand: - = number_to_currency(@ordergroup.account_balance) + Verfügbares Guthaben: + = number_to_currency(@ordergroup.get_available_funds()) %span{:style => "color:grey"} (zuletzt aktualisiert vor = distance_of_time_in_words(Time.now, @ordergroup.account_updated) + "(n))" From 582e4b1c1bbbee918d01aefac2be3c87d8a4d4a5 Mon Sep 17 00:00:00 2001 From: sandoz Date: Tue, 7 Apr 2009 03:58:07 +0800 Subject: [PATCH 4/4] Beautified navigation on top of page. Signed-off-by: bennibu --- public/stylesheets/main.css | 3 +-- public/stylesheets/nav.css | 14 +++++++------- public/stylesheets/print.css | 3 +-- public/stylesheets/sass/main.sass | 3 +-- public/stylesheets/sass/nav.sass | 10 +++++----- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index 56e98bb1..db2dbd7e 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -128,10 +128,9 @@ span.click-me { #logininfo ul { list-style: none; } #logininfo ul li { - margin: 0 3px; + margin: 0 0 0 5px; float: left; } #logininfo a { - padding: 0.2em; color: #737272; font-weight: bold; } #logininfo a:hover { diff --git a/public/stylesheets/nav.css b/public/stylesheets/nav.css index 423e6334..632d586c 100644 --- a/public/stylesheets/nav.css +++ b/public/stylesheets/nav.css @@ -2,7 +2,8 @@ #nav { position: relative; height: 3em; - text-align: right; } + text-align: right; + margin-top: 5px; } #nav ul { padding: 0 0 0 0; margin: -2.3em 0 0 0; @@ -10,9 +11,10 @@ #nav ul li { display: inline; list-style: none; - padding: 0.3em 0.3em 0.3em 0; - margin: 0 0.2em; - background: none; } + padding: 0.3em 0 0.3em 0; + margin: 0 0 0 0.2em; + background: none; + vertical-align: middle; } #nav ul li a { margin: 0.1em 0 0 0; text-align: center; @@ -21,9 +23,8 @@ text-decoration: none; color: #737272; border: none; - border-bottom: none; background: #e3e3e3; - padding: 0.5em 1.2em 0.1em 1.2em; + padding: 0.5em 1.2em 0.6em 1.2em; margin-top: 0; } #nav ul li a:hover { color: #ED0606; } @@ -43,7 +44,6 @@ border: none; background: none; color: #FFF; - padding: 0.7em; font-style: normal; font-size: 1em; } #nav ul li.current a { diff --git a/public/stylesheets/print.css b/public/stylesheets/print.css index 9c02ca49..14afed69 100644 --- a/public/stylesheets/print.css +++ b/public/stylesheets/print.css @@ -128,10 +128,9 @@ span.click-me { #logininfo ul { list-style: none; } #logininfo ul li { - margin: 0 3px; + margin: 0 0 0 5px; float: left; } #logininfo a { - padding: 0.2em; color: #737272; font-weight: bold; } #logininfo a:hover { diff --git a/public/stylesheets/sass/main.sass b/public/stylesheets/sass/main.sass index 739b0abd..cc09abaf 100644 --- a/public/stylesheets/sass/main.sass +++ b/public/stylesheets/sass/main.sass @@ -143,10 +143,9 @@ span.click-me ul :list-style none li - :margin 0 3px + :margin 0 0 0 5px :float left a - :padding 0.2em :color #737272 :font-weight bold a:hover diff --git a/public/stylesheets/sass/nav.sass b/public/stylesheets/sass/nav.sass index ef23ae9e..966b8d12 100644 --- a/public/stylesheets/sass/nav.sass +++ b/public/stylesheets/sass/nav.sass @@ -3,6 +3,7 @@ :position relative :height 3em :text-align right + :margin-top 5px ul :padding 0 0 0 0 :margin -2.3em 0 0 0 @@ -10,9 +11,10 @@ li :display inline :list-style none - :padding 0.3em 0.3em 0.3em 0 - :margin 0 0.2em + :padding 0.3em 0 0.3em 0 + :margin 0 0 0 0.2em :background none + :vertical-align middle a :margin 0.1em 0 0 0 :text-align center @@ -21,9 +23,8 @@ :text-decoration none :color #737272 :border none - :border-bottom none :background #e3e3e3 - :padding 0.5em 1.2em 0.1em 1.2em + :padding 0.5em 1.2em 0.6em 1.2em :margin-top 0 a:hover :color #ED0606 @@ -45,7 +46,6 @@ :border none :background none :color #FFF - :padding 0.7em :font-style normal :font-size 1em