diff --git a/app/views/layouts/application.haml b/app/views/layouts/application.haml index a033b52c..1fffe16a 100644 --- a/app/views/layouts/application.haml +++ b/app/views/layouts/application.haml @@ -13,6 +13,7 @@ = javascript_include_tag 'controls' = javascript_include_tag 'application' = javascript_include_tag('ordering') if (controller.controller_name == "ordering") + = yield(:head) %body #logininfo= render :partial => 'shared/loginInfo' @@ -38,4 +39,4 @@ - if flash[:notice] = javascript_tag("new Effect.Highlight('flashNotice', {delay:0.8, duration:1});") - if flash[:error] - = javascript_tag("new Effect.Highlight('flashError', {delay:0.8, duration:1});") \ No newline at end of file + = javascript_tag("new Effect.Highlight('flashError', {delay:0.8, duration:1});") diff --git a/app/views/ordering/my_order_result.haml b/app/views/ordering/my_order_result.haml index 21d9dc14..fa47343d 100644 --- a/app/views/ordering/my_order_result.haml +++ b/app/views/ordering/my_order_result.haml @@ -1,3 +1,14 @@ +- content_for :head do + :javascript + document.observe("dom:loaded", function() { + // initially hide all ignored articles + $$('tr.ignored').invoke('hide'); + }); + function toggleIgnoredArticles() { + $$('tr.ignored').invoke('toggle'); + }; + + - title "Dein Bestellergebnis für #{@order.name}" #element_navigation = link_to_unless @order.previous == @order, "<< #{@order.previous.name}", :action => "my_order_result", :id => @order.previous @@ -52,6 +63,7 @@ %h2 Artikelübersicht .column_content#result - if @group_order + %p(style="float:right")= link_to_function "Zeige/Verstecke nicht bestellte Artikel", "toggleIgnoredArticles();" %p= link_to("Bestellung ändern", :action => "order", :id => @order) if @order.open? %table.list %thead @@ -88,10 +100,10 @@ - quantity, tolerance, result, sub_total = 0, 0, 0, 0 - total += sub_total - # give the article different colors, dependent on order-result - - style = "grey" + - class_name = "ignored" - if (quantity > 0) - - style = result > 0 ? 'green' : 'red' - %tr{:class => cycle('even', 'odd', :name => 'articles'), :style => "color:#{style}"} + - class_name = result > 0 ? 'success' : 'failed' + %tr{:class => cycle('even', 'odd', :name => 'articles') + " " + class_name} %td{:style => "width:40%"} =h oa.article.name - unless oa.article.note.blank? @@ -129,4 +141,4 @@ = form.text_area :text, :cols => 50, :rows => 6 %br/ = submit_tag "Kommentar hinzufügen" - = link_to_top \ No newline at end of file + = link_to_top diff --git a/public/stylesheets/main.css b/public/stylesheets/main.css index d6d97fb8..76b667b9 100644 --- a/public/stylesheets/main.css +++ b/public/stylesheets/main.css @@ -239,6 +239,12 @@ table { background-color: #ffffc2; } table tr.click-me { cursor: pointer; } + table tr.ignored { + color: grey; } + table tr.success { + color: green; } + table tr.failed { + color: red; } table.list tr { border: 1px solid #e3e3e3; } diff --git a/public/stylesheets/print.css b/public/stylesheets/print.css index 43b4628c..55f26348 100644 --- a/public/stylesheets/print.css +++ b/public/stylesheets/print.css @@ -239,6 +239,12 @@ table { background-color: #ffffc2; } table tr.click-me { cursor: pointer; } + table tr.ignored { + color: grey; } + table tr.success { + color: green; } + table tr.failed { + color: red; } table.list tr { border: 1px solid #e3e3e3; } diff --git a/public/stylesheets/sass/main.sass b/public/stylesheets/sass/main.sass index 7d859f27..99ed387f 100644 --- a/public/stylesheets/sass/main.sass +++ b/public/stylesheets/sass/main.sass @@ -264,6 +264,12 @@ table :background-color #ffffc2 tr.click-me :cursor pointer + tr.ignored + color: grey + tr.success + color: green + tr.failed + color: red table.list //:border 2px solid #78b74e