diff --git a/app/models/ordergroup.rb b/app/models/ordergroup.rb index ea8a4dee..3da57269 100644 --- a/app/models/ordergroup.rb +++ b/app/models/ordergroup.rb @@ -9,7 +9,7 @@ class Ordergroup < Group acts_as_paranoid # Avoid deleting the ordergroup for consistency of order-results serialize :stats - has_many :financial_transactions, :order => "created_on DESC" + has_many :financial_transactions has_many :group_orders has_many :orders, :through => :group_orders diff --git a/app/views/admin/ordergroups/index.html.haml b/app/views/admin/ordergroups/index.html.haml index 8a606acb..4b37102c 100644 --- a/app/views/admin/ordergroups/index.html.haml +++ b/app/views/admin/ordergroups/index.html.haml @@ -1,7 +1,9 @@ - title "Bestellgruppen" +- content_for :actionbar do + = link_to "Neue Bestellgruppe anlegen", new_admin_ordergroup_path, class: 'btn btn-primary' + - content_for :sidebar do - %p= link_to "Neue Bestellgruppe anlegen", new_admin_ordergroup_path, class: 'btn btn-primary' %p Hier kannst du = link_to 'neue Bestellgruppen', new_admin_ordergroup_path diff --git a/app/views/admin/users/_users.html.haml b/app/views/admin/users/_users.html.haml index f7ce0ebd..6e3a63c1 100644 --- a/app/views/admin/users/_users.html.haml +++ b/app/views/admin/users/_users.html.haml @@ -9,16 +9,15 @@ %th Email %th Zugriff auf %th Letzter login - %th Aktionen + %th(colspan="2") Aktionen %tbody - for user in @users %tr %td= link_to user.nick, [:admin, user] - %td=h user.name - %td=h user.email - %td=h format_roles(user) - %td=h format_time(user.last_login) - %td - = link_to 'Bearbeiten', edit_admin_user_path(user), class: 'btn btn-mini' - = link_to 'Löschen', [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?", + %td= user.name + %td= user.email + %td= format_roles(user) + %td= format_time(user.last_login) + %td= link_to 'Bearbeiten', edit_admin_user_path(user), class: 'btn btn-mini' + %td= link_to 'Löschen', [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?", :method => :delete, class: 'btn btn-danger btn-mini' diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 71446b3d..207c5de6 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,7 +1,9 @@ - title "Admin/Benutzerinnen" +- content_for :actionbar do + = link_to 'Neue Benutzerin anlegen', new_admin_user_path, class: 'btn btn-primary' + - content_for :sidebar do - %p= link_to 'Neue Benutzerin anlegen', new_admin_user_path, class: 'btn btn-primary' %p Hier kannst du Benutzer_innen #{link_to 'neu Anlegen', new_admin_user_path}, bearbeiten und natürlich auch löschen. diff --git a/app/views/admin/workgroups/index.html.haml b/app/views/admin/workgroups/index.html.haml index d91e0cde..ba634654 100644 --- a/app/views/admin/workgroups/index.html.haml +++ b/app/views/admin/workgroups/index.html.haml @@ -1,7 +1,9 @@ - title "Arbeitsgruppen" +- content_for :actionbar do + = link_to "Neue Arbeitsgruppe anlegen", new_admin_workgroup_path, class: 'btn btn-primary' + - content_for :sidebar do - %p= link_to "Neue Arbeitsgruppe anlegen", new_admin_workgroup_path, class: 'btn btn-primary' %p Hier kannst du = link_to 'neue Arbeitsgruppen', new_admin_workgroup_path diff --git a/app/views/finance/balancing/_edit_results_by_articles.html.haml b/app/views/finance/balancing/_edit_results_by_articles.html.haml index b3a1d766..fd8227c5 100644 --- a/app/views/finance/balancing/_edit_results_by_articles.html.haml +++ b/app/views/finance/balancing/_edit_results_by_articles.html.haml @@ -1,5 +1,3 @@ -%h3 Bestellung bearbeiten - %table.ordered-articles.table.table-striped %thead %tr diff --git a/app/views/finance/balancing/new.html.haml b/app/views/finance/balancing/new.html.haml index 1b057d5e..50cb3d4c 100644 --- a/app/views/finance/balancing/new.html.haml +++ b/app/views/finance/balancing/new.html.haml @@ -22,28 +22,26 @@ %h3 Kommentare #comments= render :partial => 'shared/comments', locals: {comments: @order.comments} -.well.well-small - .btn-toolbar - .btn-group - - unless @order.invoice or @order.stockit? - = link_to "Rechnung anlegen", new_finance_invoice_path(:order_id => @order, :supplier_id => @order.supplier), - class: 'btn' - - unless @order.closed? - = link_to "Bestellung abschließen", confirm_finance_order_path(@order), class: 'btn btn-primary' +- content_for :actionbar do + .btn-group + - unless @order.invoice or @order.stockit? + = link_to "Rechnung anlegen", new_finance_invoice_path(:order_id => @order, :supplier_id => @order.supplier), + class: 'btn' + - unless @order.closed? + = link_to "Bestellung abschließen", confirm_finance_order_path(@order), class: 'btn btn-primary' - #editOrderNav.btn-group.pull-right - = link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do - Ansichtsoptionen - %span.caret - %ul.dropdown-menu - %li= link_to 'Bestellung bearbeiten', new_finance_order_path(order_id: @order.id, view: 'edit_results'), - remote: true - %li= link_to 'Gruppenübersicht', new_finance_order_path(order_id: @order.id, view: 'groups_overview'), - remote: true - %li= link_to 'Artikelübersicht', new_finance_order_path(order_id: @order.id, view: 'articles_overview'), - remote: true + #editOrderNav.btn-group.pull-right + = link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do + Ansichtsoptionen + %span.caret + %ul.dropdown-menu + %li= link_to 'Bestellung bearbeiten', new_finance_order_path(order_id: @order.id, view: 'edit_results'), + remote: true + %li= link_to 'Gruppenübersicht', new_finance_order_path(order_id: @order.id, view: 'groups_overview'), + remote: true + %li= link_to 'Artikelübersicht', new_finance_order_path(order_id: @order.id, view: 'articles_overview'), + remote: true %section#results = render 'edit_results_by_articles' -%p= link_to_top -#edit_box{:style => 'display:none'} \ No newline at end of file +%p= link_to_top \ No newline at end of file diff --git a/app/views/finance/financial_transactions/index.html.haml b/app/views/finance/financial_transactions/index.html.haml index bdcd573c..258e85d0 100644 --- a/app/views/finance/financial_transactions/index.html.haml +++ b/app/views/finance/financial_transactions/index.html.haml @@ -1,7 +1,9 @@ - title "Kontoauszug für #{@ordergroup.name}" +- content_for :actionbar do + = link_to 'Neue Transaktion anlegen', new_finance_ordergroup_transaction_path(@ordergroup), class: 'btn btn-primary' + - content_for :sidebar do - %p= link_to 'Neue Transaktion anlegen', new_finance_ordergroup_transaction_path(@ordergroup), class: 'btn btn-primary' .well.well-small %strong Kontostand: #{number_to_currency(@ordergroup.account_balance)} %br/ diff --git a/app/views/finance/financial_transactions/new.html.haml b/app/views/finance/financial_transactions/new.html.haml index 3fd7ae20..459669d1 100644 --- a/app/views/finance/financial_transactions/new.html.haml +++ b/app/views/finance/financial_transactions/new.html.haml @@ -7,5 +7,6 @@ = f.hidden_field :ordergroup_id = f.input :amount = f.input :note, :as => :text - = f.submit - = link_to "oder abbrechen", finance_ordergroup_transactions_path(@ordergroup) \ No newline at end of file + .form-actions + = f.submit class: 'btn btn-primary' + = link_to "oder abbrechen", finance_ordergroup_transactions_path(@ordergroup) \ No newline at end of file diff --git a/app/views/finance/group_order_articles/update.js.haml b/app/views/finance/group_order_articles/update.js.haml index cff2d68a..b4ff3c4e 100644 --- a/app/views/finance/group_order_articles/update.js.haml +++ b/app/views/finance/group_order_articles/update.js.haml @@ -1,3 +1,4 @@ $('#modalContainer').modal('hide'); $('#order_article_#{@order_article.id}').html('#{j(render('finance/balancing/order_article', order_article: @order_article))}'); $('#group_order_articles_#{@order_article.id}').html('#{j(render('finance/balancing/group_order_articles', order_article: @order_article))}'); +$('#summary').html('#{j(render('finance/balancing/summary', order: @order_article.order))}'); diff --git a/app/views/finance/invoices/index.html.haml b/app/views/finance/invoices/index.html.haml index f1b6c55e..fdf5869d 100644 --- a/app/views/finance/invoices/index.html.haml +++ b/app/views/finance/invoices/index.html.haml @@ -1,5 +1,6 @@ - title "Rechnungen" -= link_to 'Neue Rechnung anlegen', new_finance_invoice_path, class: 'btn btn-primary' +- content_for :actionbar do + = link_to 'Neue Rechnung anlegen', new_finance_invoice_path, class: 'btn btn-primary' #invoicesTable= render 'invoices' diff --git a/app/views/finance/ordergroups/index.html.haml b/app/views/finance/ordergroups/index.html.haml index 1bd13900..7af84246 100644 --- a/app/views/finance/ordergroups/index.html.haml +++ b/app/views/finance/ordergroups/index.html.haml @@ -1,9 +1,7 @@ - title "Konten verwalten" -- content_for :sidebar do - .well.well-small - Hier kannst du mehrere Transaktionen gleichzeitig anlegen: - = link_to "Neue Überweisungen eingeben", finance_new_transaction_collection_path, class: 'btn btn-primary' +- content_for :actionbar do + = link_to "Neue Überweisungen eingeben", finance_new_transaction_collection_path, class: 'btn btn-primary' .well.well-small = form_tag finance_ordergroups_path, :method => :get, :remote => true, diff --git a/app/views/group_orders/index.html.haml b/app/views/group_orders/index.html.haml index d6e613f4..49e3dd79 100644 --- a/app/views/group_orders/index.html.haml +++ b/app/views/group_orders/index.html.haml @@ -1,4 +1,4 @@ -- title "Bestellüberblick" +- title "Bestellüberblick", false - content_for :sidebar do .well.well-small diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 4eddff2c..eab20826 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -54,7 +54,7 @@ %th Wer %th Notiz %th Betrag - - for ft in current_user.ordergroup.financial_transactions.limit(5) + - for ft in current_user.ordergroup.financial_transactions.limit(5).order('created_on DESC') %tr %td= format_time(ft.created_on) %td= h(ft.user.nil? ? '?' : ft.user.nick) diff --git a/app/views/home/ordergroup.html.haml b/app/views/home/ordergroup.html.haml index 923671bf..73f0271e 100644 --- a/app/views/home/ordergroup.html.haml +++ b/app/views/home/ordergroup.html.haml @@ -1,4 +1,4 @@ --title "Meine Bestellgruppe" +- title "Meine Bestellgruppe", false .row-fluid .span4 @@ -11,10 +11,10 @@ %b Verfügbares Guthaben: = number_to_currency(@ordergroup.get_available_funds()) %h2 Personen - %ul{:style => "list-style-type:decimal;"} + %ul - for membership in @ordergroup.memberships %li= membership.user.nick - = link_to('Person einladen', new_invite_path(:id => @ordergroup), :remote => true) + = link_to 'Neue Person einladen', new_invite_path(:id => @ordergroup), :remote => true, class: 'btn btn-primary' .span8 %h2 Kontoauszug .well.well-small diff --git a/app/views/invites/_modal_form.html.haml b/app/views/invites/_modal_form.html.haml index 17a4aaf5..5be1b0a4 100644 --- a/app/views/invites/_modal_form.html.haml +++ b/app/views/invites/_modal_form.html.haml @@ -1,8 +1,14 @@ = simple_form_for @invite, remote: true do |form| .modal-header = button_tag "x", class: 'close', data: {dismiss: 'modal'} - %h3 Person in die Gruppe #{@invite.group.name} einladen + %h3 Person einladen .modal-body + %p + Hier kannst du eine Person in die Gruppe + %b=h @invite.group.name + einladen, die noch nicht Mitglied der Foodcoop ist. + %br/ + Die Person ist dann nach erstmaliger Anmeldung automatisch Mitglied dieser Gruppe. = form.hidden_field :user_id = form.hidden_field :group_id = form.input :email diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 6da5e282..f718139a 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -19,12 +19,16 @@ = yield(:sidebar) .span9 = bootstrap_flash + - if content_for?(:actionbar) + .btn-toolbar.pull-right= yield(:actionbar) - if show_title? .page-header %h1= yield(:title) = yield - else = bootstrap_flash + - if content_for?(:actionbar) + .btn-toolbar.pull-right= yield(:actionbar) - if show_title? .page-header %h1= yield(:title) diff --git a/app/views/messages/index.html.haml b/app/views/messages/index.html.haml index be7a9230..48885289 100644 --- a/app/views/messages/index.html.haml +++ b/app/views/messages/index.html.haml @@ -1,5 +1,6 @@ - title "Nachrichten" -= link_to 'Neue Nachricht', new_message_path, class: 'btn btn-primary' +- content_for :actionbar do + = link_to 'Neue Nachricht', new_message_path, class: 'btn btn-primary' #messages = render 'messages', messages: @messages, pagination: true \ No newline at end of file diff --git a/app/views/orders/index.html.haml b/app/views/orders/index.html.haml index 1263025c..1ebe04f0 100644 --- a/app/views/orders/index.html.haml +++ b/app/views/orders/index.html.haml @@ -1,14 +1,15 @@ - title "Bestellungen verwalten" -.well - .btn-group.pull-right +- content_for :actionbar do + .btn-group = link_to '#', data: {toggle: 'dropdown'}, class: 'btn btn-primary dropdown-toggle' do - Neue Bestellung für .. + Neue Bestellung anlegen %span.caret %ul.dropdown-menu - Supplier.all.each do |supplier| %li= link_to supplier.name, new_order_path(supplier_id: supplier.id), tabindex: -1 +.well %h2 Laufende Bestellungen - unless @open_orders.empty? %table.table.table-striped @@ -26,7 +27,7 @@ %td= format_time(order.ends) unless order.ends.nil? %td= truncate(order.note) %td= link_to "Beenden", finish_order_path(order), - confirm: "Willst Du wirklich die Bestellung \"#{order.name}\" beenden?\nEs gibt kein zurück.", + confirm: "Willst Du wirklich die Bestellung \"#{order.name}\" beenden? Es gibt kein zurück.", method: :post, class: 'btn btn-small btn-success' %td diff --git a/app/views/suppliers/index.haml b/app/views/suppliers/index.haml index 62378bf4..4697f573 100644 --- a/app/views/suppliers/index.haml +++ b/app/views/suppliers/index.haml @@ -1,10 +1,8 @@ - title "Lieferanten" -%p +- content_for :actionbar do = link_to 'Neue Lieferantin anlegen', new_supplier_path, class: 'btn btn-primary' - oder - = link_to 'importiere', shared_suppliers_suppliers_path - aus der externen Artikeldatenbank. + = link_to 'Lieferantin aus externer Datenbank importieren', shared_suppliers_suppliers_path, class: 'btn' %table.table.table-striped %thead %tr diff --git a/app/views/tasks/_nav.haml b/app/views/tasks/_nav.haml index aa6e9516..9f5e86fc 100644 --- a/app/views/tasks/_nav.haml +++ b/app/views/tasks/_nav.haml @@ -1,10 +1,13 @@ -%p= link_to "Neue Aufgabe erstellen", new_task_path, class: 'btn btn-primary' -.well.well-small - %ul.nav.nav-list - %li.nav-header Seiten - %li= link_to "Meine Aufgaben", user_tasks_path - %li= link_to "Alle Aufgaben", tasks_path - %li= link_to "Erledigte Aufgaben (Archiv)", archive_tasks_path - %li.nav-header Gruppenaufgaben - - for group in Workgroup.all - %li= link_to group.name, workgroup_tasks_path(workgroup_id: group.id) \ No newline at end of file +- content_for :actionbar do + = link_to "Neue Aufgabe erstellen", new_task_path, class: 'btn btn-primary' + +- content_for :sidebar do + .well.well-small + %ul.nav.nav-list + %li.nav-header Seiten + %li= link_to "Meine Aufgaben", user_tasks_path + %li= link_to "Alle Aufgaben", tasks_path + %li= link_to "Erledigte Aufgaben (Archiv)", archive_tasks_path + %li.nav-header Gruppenaufgaben + - for group in Workgroup.all + %li= link_to group.name, workgroup_tasks_path(workgroup_id: group.id) \ No newline at end of file diff --git a/app/views/tasks/archive.haml b/app/views/tasks/archive.haml index 32467e28..eb6996bd 100644 --- a/app/views/tasks/archive.haml +++ b/app/views/tasks/archive.haml @@ -1,5 +1,4 @@ - title "Aufgabenarchiv" -- content_for :sidebar do - = render 'nav' += render 'nav' #tasks= render 'archive_tasks' diff --git a/app/views/tasks/index.haml b/app/views/tasks/index.haml index 71bf9c8c..b979f2aa 100644 --- a/app/views/tasks/index.haml +++ b/app/views/tasks/index.haml @@ -1,6 +1,5 @@ - title "Aufgaben" -- content_for :sidebar do - = render 'nav' += render 'nav' - unless @non_group_tasks.empty? %section diff --git a/app/views/tasks/show.haml b/app/views/tasks/show.haml index 33e32489..d74bcb9f 100644 --- a/app/views/tasks/show.haml +++ b/app/views/tasks/show.haml @@ -1,6 +1,5 @@ - title "Aufgabe anzeigen" -- content_for :sidebar do - = render 'nav' += render 'nav' %section %dl.dl-horizontal diff --git a/app/views/tasks/user.html.haml b/app/views/tasks/user.html.haml index b03c8251..3efc1c23 100644 --- a/app/views/tasks/user.html.haml +++ b/app/views/tasks/user.html.haml @@ -1,6 +1,5 @@ - title "Meine Aufgaben" -- content_for :sidebar do - = render 'nav' += render 'nav' - unless @unaccepted_tasks.empty? %section diff --git a/app/views/tasks/workgroup.haml b/app/views/tasks/workgroup.haml index 2bbb79c9..e706222a 100644 --- a/app/views/tasks/workgroup.haml +++ b/app/views/tasks/workgroup.haml @@ -1,6 +1,5 @@ - title "Aufgaben für #{@group.name}" -- content_for :sidebar do - = render 'nav' += render 'nav' %section.well %h3 Wöchentliche Aufgaben