From 552c553b77d1d54ef1735d409cec46c4d71ff418 Mon Sep 17 00:00:00 2001 From: benni Date: Mon, 15 Oct 2012 21:19:17 +0200 Subject: [PATCH] Fixed admin, orders, wiki views. Converted all erb to haml. --- app/assets/images/arrow_down_red.png | Bin 351 -> 0 bytes app/assets/images/arrow_right_red.png | Bin 356 -> 0 bytes app/assets/images/arrow_up_red.png | Bin 341 -> 0 bytes .../bootstrap_and_overrides.css.less | 92 +++++++- .../admin/ordergroups_controller.rb | 7 +- app/controllers/admin/users_controller.rb | 12 +- .../admin/workgroups_controller.rb | 7 +- app/controllers/group_orders_controller.rb | 3 +- app/controllers/invites_controller.rb | 10 +- app/controllers/orders_controller.rb | 15 +- app/helpers/application_helper.rb | 4 +- app/helpers/orders_helper.rb | 11 +- app/views/admin/base/index.html.haml | 80 ++++--- app/views/admin/ordergroups/_form.html.haml | 14 +- .../admin/ordergroups/_ordergroups.html.haml | 20 +- app/views/admin/ordergroups/index.html.haml | 39 ++-- app/views/admin/ordergroups/index.js.erb | 1 - app/views/admin/ordergroups/index.js.haml | 1 + app/views/admin/ordergroups/new.html.haml | 2 +- app/views/admin/ordergroups/show.html.haml | 17 +- app/views/admin/users/_form.html.haml | 5 + app/views/admin/users/_users.html.haml | 24 +- app/views/admin/users/edit.html.haml | 12 +- app/views/admin/users/index.html.haml | 32 ++- app/views/admin/users/index.js.erb | 1 - app/views/admin/users/index.js.haml | 1 + app/views/admin/users/new.html.haml | 12 +- app/views/admin/users/show.html.erb | 52 ----- app/views/admin/users/show.html.haml | 39 ++++ app/views/admin/workgroups/_form.html.haml | 7 +- .../admin/workgroups/_workgroups.html.haml | 22 +- app/views/admin/workgroups/edit.html.haml | 2 +- app/views/admin/workgroups/index.html.haml | 40 ++-- app/views/admin/workgroups/index.js.erb | 1 - app/views/admin/workgroups/index.js.haml | 1 + app/views/admin/workgroups/new.html.haml | 4 +- app/views/admin/workgroups/show.html.haml | 16 +- app/views/articles/create.js.erb | 2 - app/views/articles/create.js.haml | 2 + app/views/articles/destroy.js.erb | 5 - app/views/articles/destroy.js.haml | 4 + app/views/articles/index.js.erb | 1 - app/views/articles/index.js.haml | 1 + app/views/articles/new.js.erb | 1 - app/views/articles/new.js.haml | 1 + app/views/articles/shared.js.erb | 1 - app/views/articles/shared.js.haml | 1 + app/views/articles/update.js.erb | 2 - app/views/articles/update.js.haml | 2 + app/views/deliveries/add_stock_change.js.erb | 1 - app/views/deliveries/add_stock_change.js.haml | 1 + app/views/finance/balancing/edit_note.js.erb | 1 - app/views/finance/balancing/edit_note.js.haml | 1 + app/views/finance/balancing/new.js.erb | 1 - app/views/finance/balancing/new.js.haml | 1 + .../finance/balancing/update_note.js.erb | 2 - .../finance/balancing/update_note.js.haml | 2 + .../financial_transactions/index.js.erb | 1 - .../financial_transactions/index.js.haml | 1 + .../finance/group_order_articles/edit.js.erb | 1 - .../finance/group_order_articles/edit.js.haml | 1 + .../finance/group_order_articles/new.js.erb | 1 - .../finance/group_order_articles/new.js.haml | 1 + .../group_order_articles/update.js.erb | 5 - .../group_order_articles/update.js.haml | 5 + app/views/finance/invoices/edit.html.erb | 6 - app/views/finance/invoices/edit.html.haml | 5 + app/views/finance/invoices/index.html.erb | 40 ---- app/views/finance/invoices/index.html.haml | 30 +++ app/views/finance/invoices/new.html.erb | 4 - app/views/finance/invoices/new.html.haml | 3 + .../finance/order_articles/create.js.erb | 3 - .../finance/order_articles/create.js.haml | 3 + .../finance/order_articles/destroy.js.erb | 1 - .../finance/order_articles/destroy.js.haml | 1 + app/views/finance/order_articles/edit.js.erb | 1 - app/views/finance/order_articles/edit.js.haml | 1 + app/views/finance/order_articles/new.js.erb | 1 - app/views/finance/order_articles/new.js.haml | 1 + .../finance/order_articles/update.js.erb | 3 - .../finance/order_articles/update.js.haml | 3 + app/views/finance/ordergroups/index.js.erb | 1 - app/views/finance/ordergroups/index.js.haml | 1 + app/views/foodcoop/ordergroups/index.js.erb | 1 - app/views/foodcoop/ordergroups/index.js.haml | 1 + app/views/foodcoop/users/index.js.erb | 1 - app/views/foodcoop/users/index.js.haml | 1 + app/views/group_orders/_form.html.haml | 206 ++++++++---------- app/views/group_orders/_orders.html.haml | 9 +- .../group_orders/_switch_order.html.haml | 17 +- app/views/group_orders/archive.html.haml | 11 +- app/views/group_orders/archive.js.erb | 1 - app/views/group_orders/archive.js.haml | 1 + app/views/group_orders/index.html.haml | 58 +++-- app/views/group_orders/show.html.haml | 105 ++++----- app/views/home/ordergroup.html.erb | 47 ---- app/views/home/ordergroup.html.haml | 35 +++ app/views/home/ordergroup.js.erb | 1 - app/views/home/ordergroup.js.haml | 1 + app/views/invites/_modal_form.html.haml | 12 + app/views/invites/create.js.haml | 1 + app/views/invites/new.js.haml | 2 + app/views/layouts/application.html.haml | 5 +- app/views/layouts/email.text.erb | 6 - app/views/layouts/email.text.haml | 5 + app/views/mailer/feedback.text.erb | 3 - app/views/mailer/feedback.text.haml | 4 + app/views/mailer/foodsoft_message.text.erb | 7 - app/views/mailer/foodsoft_message.text.haml | 6 + app/views/mailer/invite.text.erb | 17 -- app/views/mailer/invite.text.haml | 17 ++ app/views/mailer/negative_balance.text.erb | 9 - app/views/mailer/negative_balance.text.haml | 9 + .../mailer/not_enough_users_assigned.text.erb | 11 - .../not_enough_users_assigned.text.haml | 10 + app/views/mailer/order_result.text.erb | 14 -- app/views/mailer/order_result.text.haml | 14 ++ ...word.text.erb => reset_password.text.haml} | 14 +- app/views/mailer/upcoming_tasks.text.erb | 15 -- app/views/mailer/upcoming_tasks.text.haml | 11 + app/views/order_comments/_form.html.haml | 6 +- app/views/order_comments/create.js.erb | 1 - app/views/order_comments/create.js.haml | 1 + app/views/order_comments/new.js.erb | 1 - app/views/order_comments/new.js.haml | 1 + app/views/ordergroups/edit.html.erb | 88 -------- app/views/ordergroups/edit.html.haml | 84 +++++++ app/views/ordergroups/index.html.erb | 52 ----- app/views/ordergroups/index.html.haml | 46 ++++ app/views/orders/_articles.html.haml | 62 +++--- app/views/orders/_orders.html.haml | 14 +- .../orders/_template_orders_script.html.erb | 20 -- .../orders/_template_orders_script.html.haml | 17 ++ app/views/orders/index.haml | 43 ---- app/views/orders/index.html.haml | 41 ++++ app/views/orders/index.js.haml | 1 + app/views/orders/show.html.haml | 121 +++++----- app/views/orders/show.js.erb | 1 - app/views/orders/show.js.haml | 2 + .../shared/_articles_by_articles.html.haml | 11 +- .../shared/_articles_by_groups.html.haml | 12 +- app/views/shared/_comments.haml | 14 +- app/views/shared/_group.html.haml | 4 +- app/views/shared/_open_orders.html.haml | 6 +- app/views/tasks/_list.haml | 6 +- app/views/tasks/archive.js.erb | 1 - app/views/tasks/archive.js.haml | 1 + app/views/workgroups/edit.html.erb | 88 -------- app/views/workgroups/edit.html.haml | 84 +++++++ app/views/workgroups/index.html.erb | 52 ----- app/views/workgroups/index.html.haml | 46 ++++ config/locales/de.yml | 36 +-- config/navigation.rb | 1 + script/about | 3 - script/breakpointer | 3 - script/console | 3 - script/dbconsole | 3 - script/delayed_job | 5 - script/destroy | 3 - script/generate | 3 - script/performance/benchmarker | 3 - script/performance/profiler | 3 - script/performance/request | 3 - script/plugin | 3 - script/process/inspector | 3 - script/process/reaper | 3 - script/process/spawner | 3 - script/runner | 3 - script/server | 3 - 169 files changed, 1158 insertions(+), 1307 deletions(-) delete mode 100644 app/assets/images/arrow_down_red.png delete mode 100644 app/assets/images/arrow_right_red.png delete mode 100644 app/assets/images/arrow_up_red.png delete mode 100644 app/views/admin/ordergroups/index.js.erb create mode 100644 app/views/admin/ordergroups/index.js.haml create mode 100644 app/views/admin/users/_form.html.haml delete mode 100644 app/views/admin/users/index.js.erb create mode 100644 app/views/admin/users/index.js.haml delete mode 100644 app/views/admin/users/show.html.erb create mode 100644 app/views/admin/users/show.html.haml delete mode 100644 app/views/admin/workgroups/index.js.erb create mode 100644 app/views/admin/workgroups/index.js.haml delete mode 100644 app/views/articles/create.js.erb create mode 100644 app/views/articles/create.js.haml delete mode 100644 app/views/articles/destroy.js.erb create mode 100644 app/views/articles/destroy.js.haml delete mode 100644 app/views/articles/index.js.erb create mode 100644 app/views/articles/index.js.haml delete mode 100644 app/views/articles/new.js.erb create mode 100644 app/views/articles/new.js.haml delete mode 100644 app/views/articles/shared.js.erb create mode 100644 app/views/articles/shared.js.haml delete mode 100644 app/views/articles/update.js.erb create mode 100644 app/views/articles/update.js.haml delete mode 100644 app/views/deliveries/add_stock_change.js.erb create mode 100644 app/views/deliveries/add_stock_change.js.haml delete mode 100644 app/views/finance/balancing/edit_note.js.erb create mode 100644 app/views/finance/balancing/edit_note.js.haml delete mode 100644 app/views/finance/balancing/new.js.erb create mode 100644 app/views/finance/balancing/new.js.haml delete mode 100644 app/views/finance/balancing/update_note.js.erb create mode 100644 app/views/finance/balancing/update_note.js.haml delete mode 100644 app/views/finance/financial_transactions/index.js.erb create mode 100644 app/views/finance/financial_transactions/index.js.haml delete mode 100644 app/views/finance/group_order_articles/edit.js.erb create mode 100644 app/views/finance/group_order_articles/edit.js.haml delete mode 100644 app/views/finance/group_order_articles/new.js.erb create mode 100644 app/views/finance/group_order_articles/new.js.haml delete mode 100644 app/views/finance/group_order_articles/update.js.erb create mode 100644 app/views/finance/group_order_articles/update.js.haml delete mode 100644 app/views/finance/invoices/edit.html.erb create mode 100644 app/views/finance/invoices/edit.html.haml delete mode 100644 app/views/finance/invoices/index.html.erb create mode 100644 app/views/finance/invoices/index.html.haml delete mode 100644 app/views/finance/invoices/new.html.erb create mode 100644 app/views/finance/invoices/new.html.haml delete mode 100644 app/views/finance/order_articles/create.js.erb create mode 100644 app/views/finance/order_articles/create.js.haml delete mode 100644 app/views/finance/order_articles/destroy.js.erb create mode 100644 app/views/finance/order_articles/destroy.js.haml delete mode 100644 app/views/finance/order_articles/edit.js.erb create mode 100644 app/views/finance/order_articles/edit.js.haml delete mode 100644 app/views/finance/order_articles/new.js.erb create mode 100644 app/views/finance/order_articles/new.js.haml delete mode 100644 app/views/finance/order_articles/update.js.erb create mode 100644 app/views/finance/order_articles/update.js.haml delete mode 100644 app/views/finance/ordergroups/index.js.erb create mode 100644 app/views/finance/ordergroups/index.js.haml delete mode 100644 app/views/foodcoop/ordergroups/index.js.erb create mode 100644 app/views/foodcoop/ordergroups/index.js.haml delete mode 100644 app/views/foodcoop/users/index.js.erb create mode 100644 app/views/foodcoop/users/index.js.haml delete mode 100644 app/views/group_orders/archive.js.erb create mode 100644 app/views/group_orders/archive.js.haml delete mode 100644 app/views/home/ordergroup.html.erb create mode 100644 app/views/home/ordergroup.html.haml delete mode 100644 app/views/home/ordergroup.js.erb create mode 100644 app/views/home/ordergroup.js.haml create mode 100644 app/views/invites/_modal_form.html.haml create mode 100644 app/views/invites/create.js.haml create mode 100644 app/views/invites/new.js.haml delete mode 100644 app/views/layouts/email.text.erb create mode 100644 app/views/layouts/email.text.haml delete mode 100644 app/views/mailer/feedback.text.erb create mode 100644 app/views/mailer/feedback.text.haml delete mode 100644 app/views/mailer/foodsoft_message.text.erb create mode 100644 app/views/mailer/foodsoft_message.text.haml delete mode 100644 app/views/mailer/invite.text.erb create mode 100644 app/views/mailer/invite.text.haml delete mode 100644 app/views/mailer/negative_balance.text.erb create mode 100644 app/views/mailer/negative_balance.text.haml delete mode 100644 app/views/mailer/not_enough_users_assigned.text.erb create mode 100644 app/views/mailer/not_enough_users_assigned.text.haml delete mode 100644 app/views/mailer/order_result.text.erb create mode 100644 app/views/mailer/order_result.text.haml rename app/views/mailer/{reset_password.text.erb => reset_password.text.haml} (54%) delete mode 100644 app/views/mailer/upcoming_tasks.text.erb create mode 100644 app/views/mailer/upcoming_tasks.text.haml delete mode 100644 app/views/order_comments/create.js.erb create mode 100644 app/views/order_comments/create.js.haml delete mode 100644 app/views/order_comments/new.js.erb create mode 100644 app/views/order_comments/new.js.haml delete mode 100644 app/views/ordergroups/edit.html.erb create mode 100644 app/views/ordergroups/edit.html.haml delete mode 100644 app/views/ordergroups/index.html.erb create mode 100644 app/views/ordergroups/index.html.haml delete mode 100644 app/views/orders/_template_orders_script.html.erb create mode 100644 app/views/orders/_template_orders_script.html.haml delete mode 100644 app/views/orders/index.haml create mode 100644 app/views/orders/index.html.haml create mode 100644 app/views/orders/index.js.haml delete mode 100644 app/views/orders/show.js.erb create mode 100644 app/views/orders/show.js.haml delete mode 100644 app/views/tasks/archive.js.erb create mode 100644 app/views/tasks/archive.js.haml delete mode 100644 app/views/workgroups/edit.html.erb create mode 100644 app/views/workgroups/edit.html.haml delete mode 100644 app/views/workgroups/index.html.erb create mode 100644 app/views/workgroups/index.html.haml delete mode 100755 script/about delete mode 100755 script/breakpointer delete mode 100755 script/console delete mode 100755 script/dbconsole delete mode 100755 script/delayed_job delete mode 100755 script/destroy delete mode 100755 script/generate delete mode 100755 script/performance/benchmarker delete mode 100755 script/performance/profiler delete mode 100755 script/performance/request delete mode 100755 script/plugin delete mode 100755 script/process/inspector delete mode 100755 script/process/reaper delete mode 100755 script/process/spawner delete mode 100755 script/runner delete mode 100755 script/server diff --git a/app/assets/images/arrow_down_red.png b/app/assets/images/arrow_down_red.png deleted file mode 100644 index abfe29a198e87e54c9c5991cfd35fab5ede6d1a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 351 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP`t2{RwPrwqgt=R6ZN@JbW7^ZbCp#XXF-4%W^We(Y<4;xn(9tUMh4m@RRiah-R@T6Lgz7(8A5T-G@yGywpf?TMNI diff --git a/app/assets/images/arrow_right_red.png b/app/assets/images/arrow_right_red.png deleted file mode 100644 index bf351f6d65592ad7160934a4cf46922748973320..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPggaMp*$S^AFLg9zY@464!_l=ltB< z)VvY~=c3falGGH1^30M9g^-L?1$R&1fcGh?c|e7`JzX3_EKc8@Y{+%ULBMrB*L}A| z6K>qN6~S5d$Z*Y;OQ+6x=_e$go4{Sc6D|FbPcDJ)fzlDRqnq+3M(i@sdGn`I=X3gl z{r#RZJzG7S;~Cv2drg*8>rI}uP5s?W6GP3?*DGj0LnS}iR zGx@D7{&}6BDI?5P=*g}FHdb&7EkZo)?*T4Uu=*fm@qA6b4g~@)%iJ_j6eT>^Pju7t;;7gB_@2%>J!nfaau;J zwdSojaar%jytQ3_3KlaJvdJ{|nV)K$dOpAMkzE0kTRo4SaPl`r_T55;2kz)5 params[:page], :per_page => @per_page) - - respond_to do |format| - format.html # index.html.haml - format.js { render :layout => false } # index.js.erb - end + @ordergroups = @ordergroups.page(params[:page]).per(@per_page) end def destroy diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index c71a0628..e83ecc11 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -5,15 +5,11 @@ class Admin::UsersController < Admin::BaseController @users = User.order('nick ASC') # if somebody uses the search field: - unless params[:query].blank? - @users = @users.where(({:first_name.matches => "%#{params[:query]}%"}) | ({:last_name.matches => "%#{params[:query]}%"}) | ({:nick.matches => "%#{params[:query]}%"})) + unless params[:user_name].blank? + @users = @users.where("first_name LIKE :user_name OR last_name LIKE :user_name OR nick LIKE :user_name", + user_name: "%#{params[:user_name]}%") end - @users = @users.paginate(:page => params[:page], :per_page => @per_page) - - respond_to do |format| - format.html # index.html.haml - format.js { render :layout => false } # index.js.erb - end + @users = @users.page(params[:page]).per(@per_page) end end diff --git a/app/controllers/admin/workgroups_controller.rb b/app/controllers/admin/workgroups_controller.rb index d8bbf5d1..6aa7a1e4 100644 --- a/app/controllers/admin/workgroups_controller.rb +++ b/app/controllers/admin/workgroups_controller.rb @@ -7,12 +7,7 @@ class Admin::WorkgroupsController < Admin::BaseController # if somebody uses the search field: @workgroups = @workgroups.where('name LIKE ?', "%#{params[:query]}%") unless params[:query].blank? - @workgroups = @workgroups.paginate(:page => params[:page], :per_page => @per_page) - - respond_to do |format| - format.html # index.html.haml - format.js { render :layout => false } # index.js.erb - end + @workgroups = @workgroups.page(params[:page]).per(@per_page) end def destroy diff --git a/app/controllers/group_orders_controller.rb b/app/controllers/group_orders_controller.rb index a7cacd7d..76c23372 100644 --- a/app/controllers/group_orders_controller.rb +++ b/app/controllers/group_orders_controller.rb @@ -54,8 +54,7 @@ class GroupOrdersController < ApplicationController # if selected, it shows all orders of the foodcoop def archive # get only orders belonging to the ordergroup - @closed_orders = Order.paginate :page => params[:page], :per_page => 10, - :conditions => { :state => 'closed' }, :order => "orders.ends DESC" + @closed_orders = Order.closed.page(params[:page]).per(10) respond_to do |format| format.html # archive.html.haml diff --git a/app/controllers/invites_controller.rb b/app/controllers/invites_controller.rb index 48a395c5..3074d485 100644 --- a/app/controllers/invites_controller.rb +++ b/app/controllers/invites_controller.rb @@ -11,9 +11,15 @@ class InvitesController < ApplicationController @invite = Invite.new(params[:invite]) if @invite.save Mailer.delay.invite(FoodsoftConfig.scope, @invite.id) - redirect_to back_or_default_path, notice: "Benutzerin wurde erfolgreich eingeladen." + + respond_to do |format| + format.html do + redirect_to back_or_default_path, notice: "Benutzerin wurde erfolgreich eingeladen." + end + format.js { render layout: false } + end + else - logger.debug "[debug] errors: #{@invite.errors.messages}" render action: :new end end diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index d010ac9a..bb15350b 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -20,18 +20,7 @@ class OrdersController < ApplicationController else sort = "ends DESC" end - @orders = Order.paginate :page => params[:page], :per_page => @per_page, - :order => sort, :conditions => "state != 'open'", - :include => :supplier - - respond_to do |format| - format.html - format.js do - render :update do |page| - page.replace_html 'orders_table', :partial => "orders" - end - end - end + @orders = Order.page(params[:page]).per(@per_page).order(sort).where("state != 'open'").includes(:supplier) end # Gives a view for the results to a specific order @@ -43,7 +32,7 @@ class OrdersController < ApplicationController format.html format.js do @partial = case params[:view] - when 'normal' then "articles" + when 'default' then "articles" when 'groups'then 'shared/articles_by_groups' when 'articles'then 'shared/articles_by_articles' else 'articles' diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 55a07948..5b843b39 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -68,7 +68,9 @@ module ApplicationHelper # Generates a link to the top of the website def link_to_top - link_to image_tag("arrow_up_red.png", :size => "16x16", :border => "0", :alt => "Nach oben"), "#" + link_to '#' do + content_tag :i, nil, class: 'icon-arrow-up icon-large' + end end # Returns the weekday. 0 is sunday, 1 is monday and so on diff --git a/app/helpers/orders_helper.rb b/app/helpers/orders_helper.rb index bfab6b0e..0f1db1fa 100644 --- a/app/helpers/orders_helper.rb +++ b/app/helpers/orders_helper.rb @@ -2,18 +2,17 @@ module OrdersHelper def update_articles_link(order, text, view) - link_to text, order_path(order, :view => view), :remote => true + link_to text, order_path(order, view: view), remote: true end - def order_pdf(order, document) - link_to image_tag("save_pdf.png", :size => "16x16", :border => "0", :alt => "PDF erstellen"), - order_path(order, :document => document, :format => :pdf), { :title => "PDF erstellen" } + def order_pdf(order, document, text) + link_to text, order_path(order, document: document, format: :pdf), title: "PDF erstellen" end def options_for_suppliers_to_select options = [["Lieferantin/Lager auswählen"]] - options += Supplier.all.map {|s| [ s.name, url_for(:action => "new", :supplier_id => s)] } - options += [["Lager", url_for(:action => 'new', :supplier_id => 0)]] + options += Supplier.all.map {|s| [ s.name, url_for(action: "new", supplier_id: s)] } + options += [["Lager", url_for(action: 'new', supplier_id: 0)]] options_for_select(options) end end diff --git a/app/views/admin/base/index.html.haml b/app/views/admin/base/index.html.haml index 8c2876ba..f41dcc3e 100644 --- a/app/views/admin/base/index.html.haml +++ b/app/views/admin/base/index.html.haml @@ -2,44 +2,42 @@ %p %i Hier kannst Du die Gruppen und Benutzerinnen der Foodsoft verwalten. -.left_column{:style => "width:48%"} - .box_title - %h2 Neuste Benutzerinnen - .column_content - %table - %tr - %th Benutzername - %th Name - %th Erstellt am - - for user in @users - %tr{:class => cycle('even','odd', :name => 'users')} - %td= link_to user.nick, [:admin, user] - %td=h user.name - %td= format_date(user.created_on) - %br/ - = link_to 'Alle Benutzerinnen', admin_users_path - | - = link_to "Neue Benutzerin", new_admin_user_path - -.right_column{:style => "width:48%"} - .box_title - %h2 Neuste Gruppen - .column_content - %table - %tr - %th Gruppenname - %th Typ - %th Mitglieder - - for group in @groups - %tr{:class => cycle('even','odd', :name => 'groups')} - %td= link_to group.name, [:admin, group] - %td= group.class.model_name.human - %td= group.users.size - %br/ - = link_to 'Alle Bestellgruppen', admin_ordergroups_path - | - = link_to "Neue Bestellgruppe", new_admin_ordergroup_path - | - = link_to 'Alle Arbeitsgruppen', admin_workgroups_path - | - = link_to "Neue Arbeitsgruppe", new_admin_workgroup_path +.row-fluid + .span6 + %section + %h2 Neuste Benutzerinnen + %table.table.table-striped + %thead + %tr + %th Benutzername + %th Name + %th Erstellt am + - for user in @users + %tr{:class => cycle('even','odd', :name => 'users')} + %td= link_to user.nick, [:admin, user] + %td=h user.name + %td= format_date(user.created_on) + = link_to 'Alle Benutzerinnen', admin_users_path + | + = link_to "Neue Benutzerin", new_admin_user_path, class: 'btn btn-primary btn-small' + .span6 + %section + %h2 Neuste Gruppen + %table.table.table-striped + %thead + %tr + %th Gruppenname + %th Typ + %th Mitglieder + - for group in @groups + %tr{:class => cycle('even','odd', :name => 'groups')} + %td= link_to group.name, [:admin, group] + %td= group.class.model_name.human + %td= group.users.size + = link_to 'Alle Bestellgruppen', admin_ordergroups_path + | + = link_to "Neue Bestellgruppe", new_admin_ordergroup_path, class: 'btn btn-primary btn-small' + | + = link_to 'Alle Arbeitsgruppen', admin_workgroups_path + | + = link_to "Neue Arbeitsgruppe", new_admin_workgroup_path, class: 'btn btn-primary btn-small' diff --git a/app/views/admin/ordergroups/_form.html.haml b/app/views/admin/ordergroups/_form.html.haml index ffecc4fe..9d0ca635 100644 --- a/app/views/admin/ordergroups/_form.html.haml +++ b/app/views/admin/ordergroups/_form.html.haml @@ -1,12 +1,14 @@ -%p - Neue Mitglieder kannst du - = link_to "hier", new_invite_path(id: @ordergroup.id) - einladen. +- unless @ordergroup.new_record? + %p + Neue Mitglieder kannst du + = link_to "hier", new_invite_path(id: @ordergroup.id), remote: true + einladen. = simple_form_for [:admin, @ordergroup] do |f| = render :layout => 'shared/group_form_fields', :locals => {:f => f} do = f.input :contact_person = f.input :contact_phone = f.input :contact_address = f.input :ignore_apple_restriction - = f.submit - = link_to "oder abbrechen", admin_ordergroups_path + .form-actions + = f.button :submit + = link_to "oder abbrechen", :back diff --git a/app/views/admin/ordergroups/_ordergroups.html.haml b/app/views/admin/ordergroups/_ordergroups.html.haml index 401b00d7..696e0f92 100644 --- a/app/views/admin/ordergroups/_ordergroups.html.haml +++ b/app/views/admin/ordergroups/_ordergroups.html.haml @@ -1,18 +1,14 @@ -%p - %table{:style => "width:100%"} - %tr - %td - = pagination_links_remote @ordergroups - %td{:style => "text-align:right"} - = items_per_page -%table.list +- if Ordergroup.count > 20 + = items_per_page += pagination_links_remote @ordergroups +%table.table.table-striped %thead %tr %th Name %th Kontakt %th Adresse %th Mitglieder - %th + %th Aktionen %tbody - for ordergroup in @ordergroups %tr{:class => cycle('even','odd', :name => 'groups')} @@ -21,6 +17,6 @@ %td= link_to_gmaps ordergroup.contact_address %td= ordergroup.users.size %td - = link_to icon(:edit), edit_admin_ordergroup_path(ordergroup) - = link_to icon(:delete), [:admin, ordergroup], :confirm => "Willst du #{ordergroup.name} wirklich löschen?", - :method => :delete \ No newline at end of file + = link_to "Bearbeiten", edit_admin_ordergroup_path(ordergroup), class: 'btn btn-mini' + = link_to "Löschen", [:admin, ordergroup], :confirm => "Willst du #{ordergroup.name} wirklich löschen?", + :method => :delete, class: 'btn btn-mini btn-danger' \ No newline at end of file diff --git a/app/views/admin/ordergroups/index.html.haml b/app/views/admin/ordergroups/index.html.haml index ba4eee38..8a606acb 100644 --- a/app/views/admin/ordergroups/index.html.haml +++ b/app/views/admin/ordergroups/index.html.haml @@ -1,26 +1,23 @@ - title "Bestellgruppen" -%p - %i +- 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 anlegen, Gruppen bearbeiten und löschen. - -%p - Beachte dabei den Unterschied zwischen Gruppe und Bestellgruppe: - Eine Bestellgruppe hat ein Konto und kann Essen bestellen. In einer - %em= link_to 'Arbeitsgruppe', admin_workgroups_path - (z.b. 'Soritiergruppe') - koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten. - Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören. -.left_column{:style => "width:100%"} - .box_title - %h2 Gruppenübersicht - .column_content - #group_filter - = form_tag admin_ordergroups_path, :method => :get, :style=>"display:inline;", :id => 'ordergroup_search', - :remote => true, 'data-submit-onchange' => true do - %label{:for => 'article_name'} Suche nach Name: - = text_field_tag :query, params[:query], :size => 10 - #ordergroups - = render :partial => "ordergroups" \ No newline at end of file + %p + Beachte dabei den Unterschied zwischen Gruppe und Bestellgruppe: + Eine Bestellgruppe hat ein Konto und kann Essen bestellen. In einer + %em= link_to 'Arbeitsgruppe', admin_workgroups_path + (z.b. 'Soritiergruppe') + koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten. + Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören. + +.well.well-small + = form_tag admin_ordergroups_path, :method => :get, :remote => true, + 'data-submit-onchange' => true, class: 'form-search' do + = text_field_tag :query, params[:query], class: 'input-medium search-query', + placeholder: 'Name ...' +#ordergroups + = render "ordergroups" \ No newline at end of file diff --git a/app/views/admin/ordergroups/index.js.erb b/app/views/admin/ordergroups/index.js.erb deleted file mode 100644 index 97537932..00000000 --- a/app/views/admin/ordergroups/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>'); \ No newline at end of file diff --git a/app/views/admin/ordergroups/index.js.haml b/app/views/admin/ordergroups/index.js.haml new file mode 100644 index 00000000..e991afec --- /dev/null +++ b/app/views/admin/ordergroups/index.js.haml @@ -0,0 +1 @@ +$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}'); diff --git a/app/views/admin/ordergroups/new.html.haml b/app/views/admin/ordergroups/new.html.haml index 6d376644..1ee8679b 100644 --- a/app/views/admin/ordergroups/new.html.haml +++ b/app/views/admin/ordergroups/new.html.haml @@ -1,3 +1,3 @@ - title "Bestellgruppe anlegen" -= render :partial => 'form' \ No newline at end of file += render 'form' \ No newline at end of file diff --git a/app/views/admin/ordergroups/show.html.haml b/app/views/admin/ordergroups/show.html.haml index f4bef271..3d6dfa26 100644 --- a/app/views/admin/ordergroups/show.html.haml +++ b/app/views/admin/ordergroups/show.html.haml @@ -1,13 +1,6 @@ - title "Bestellgruppe #{@ordergroup.name}" -.left_column{:style => "width:45em"} - .box_title - %h2 Übersicht - .column_content - = render :partial => 'shared/group', :locals => { :group => @ordergroup } - %p - = link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_ordergroup_path(@ordergroup) - | - = link_to 'Löschen', [:admin, @ordergroup], :confirm => 'Bist Du sicher?', :method => :delete - | - = link_to 'Nachricht senden', new_message_path(:message => {:group_id => @ordergroup.id}) -%p{:style => "clear:both"}= link_to "Gruppenübersicht", admin_ordergroups_path \ No newline at end of file + +%section= render 'shared/group', group: @ordergroup += link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_ordergroup_path(@ordergroup), class: 'btn' += link_to 'Löschen', [:admin, @ordergroup], :confirm => 'Bist Du sicher?', :method => :delete, class: 'btn btn-danger' += link_to 'Nachricht senden', new_message_path(:message => {:group_id => @ordergroup.id}), class: 'btn' diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml new file mode 100644 index 00000000..1b8ed55c --- /dev/null +++ b/app/views/admin/users/_form.html.haml @@ -0,0 +1,5 @@ += simple_form_for([:admin, @user]) do |f| + = render :partial => 'shared/user_form_fields', :locals => {:f => f} + .form-actions + = f.submit + = link_to 'oder abbrechen', :back diff --git a/app/views/admin/users/_users.html.haml b/app/views/admin/users/_users.html.haml index 88a5d444..f7ce0ebd 100644 --- a/app/views/admin/users/_users.html.haml +++ b/app/views/admin/users/_users.html.haml @@ -1,12 +1,7 @@ -%p - %table{:style => "width:100%"} - %tr - %td - = pagination_links_remote @users - %td{:style => "text-align:right"} - - if @users.size > 20 - = items_per_page -%table.list +- if User.count > 20 + = items_per_page += pagination_links_remote @users +%table.table.table-striped %thead %tr %th Login @@ -14,17 +9,16 @@ %th Email %th Zugriff auf %th Letzter login - %th{:style => "width:3em"} + %th Aktionen %tbody - for user in @users - - %tr{:class => cycle('even','odd', :name => '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 icon(:edit), edit_admin_user_path(user) - = link_to icon(:delete), [:admin, user], :confirm => "Willst du #{user.name} wirklich löschen?", - :method => :delete + = 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?", + :method => :delete, class: 'btn btn-danger btn-mini' diff --git a/app/views/admin/users/edit.html.haml b/app/views/admin/users/edit.html.haml index 9de7993f..1a16569a 100644 --- a/app/views/admin/users/edit.html.haml +++ b/app/views/admin/users/edit.html.haml @@ -1,9 +1,3 @@ -%h1 Benutzerin bearbeiten -#newUser{:style => "width:65em"} - .box_title - %h2 Benutzerin bearbeiten - #userForm.column_content - - simple_form_for([:admin, @user]) do |f| - = render :partial => 'shared/user_form_fields', :locals => {:f => f} - = f.submit - = link_to 'oder abbrechen', admin_users_path +- title "Benutzerin bearbeiten" + += render 'form' diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 14a08686..71446b3d 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,18 +1,16 @@ - title "Admin/Benutzerinnen" -%p - %i - Hier kannst du Benutzer_innen - = link_to 'neu Anlegen', new_admin_user_path - , bearbeiten und natürlich auch löschen. -.left_column{:style => "width:100%"} - .box_title - %h2 Benutzerinnenübersicht - .column_content - #user_filter{:style => "float:left; margin-right:2em;"} - = form_tag admin_users_path, :method => :get, :style=>"display:inline;", :id => 'user_search', - :remote => true, 'data-submit-onchange' => true do - %label{:for => 'article_name'} Suche nach Name: - = text_field_tag :query, params[:query], :size => 10 - #users - = render :partial => "users" - %p= link_to 'Neue Benutzerin', new_admin_user_path \ No newline at end of file + +- 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. + +.well.well-small + = form_tag admin_users_path, :method => :get, :remote => true, + 'data-submit-onchange' => true, class: 'form-search' do + = text_field_tag :user_name, params[:user_name], class: 'input-medium search-query', + placeholder: 'Name ...' + +#users + = render "users" \ No newline at end of file diff --git a/app/views/admin/users/index.js.erb b/app/views/admin/users/index.js.erb deleted file mode 100644 index 14521518..00000000 --- a/app/views/admin/users/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#users').html('<%= escape_javascript(render("users")) %>'); \ No newline at end of file diff --git a/app/views/admin/users/index.js.haml b/app/views/admin/users/index.js.haml new file mode 100644 index 00000000..0bf47722 --- /dev/null +++ b/app/views/admin/users/index.js.haml @@ -0,0 +1 @@ +$('#users').html('#{escape_javascript(render("users"))}'); diff --git a/app/views/admin/users/new.html.haml b/app/views/admin/users/new.html.haml index 327580eb..9a83b451 100644 --- a/app/views/admin/users/new.html.haml +++ b/app/views/admin/users/new.html.haml @@ -1,11 +1,3 @@ -- title "Neue Benutzerin" +- title "Neue Benutzerin anlegen" -#newUser - .box_title - %h2 Neue Benutzerin - .column_content#userForm - = simple_form_for([:admin, @user]) do |f| - = render :partial => 'shared/user_form_fields', :locals => {:f => f} - = f.submit - = link_to 'oder abbrechen', admin_users_path -%p= link_to 'Benutzerinnenübersicht', admin_users_path \ No newline at end of file += render 'form' \ No newline at end of file diff --git a/app/views/admin/users/show.html.erb b/app/views/admin/users/show.html.erb deleted file mode 100644 index 8af5edc5..00000000 --- a/app/views/admin/users/show.html.erb +++ /dev/null @@ -1,52 +0,0 @@ -

<%=h @user.nick %>

-
-
-

Übersicht

-
-
-

- Mitglied seit <%= distance_of_time_in_words(Time.now, @user.created_on) -%> -

-
-

Person

-

Nick: <%=h @user.nick %>

-

Name: <%=h @user.name %>

-

Email: <%=h @user.email %>

-

Telefon: <%=h @user.phone %>

-
-
-

- Einstellungen -

- - - <% for setting in User::setting_keys.keys -%> - - - - - <% end -%> - -
<%= User::setting_keys[setting] %><%= @user.settings[setting] == '1' ? 'ja' : 'nein' %>
-

- Benutzer_in hat Zugriff auf: -

-

- <%=h format_roles(@user) %> -

-
-

- <%= link_to 'Bearbeiten', edit_admin_user_path(@user) %> - | <%= link_to 'Löschen', [:admin, @user], :confirm => "Willst du #{@user.first_name} wirklich rausschmeißen?", :method => :delete %> - | <%= link_to "Nachricht senden", new_message_path(:message => {:mail_to => @user.id}) %> -

-
-

Gruppenabos

-
- <% for membership in Membership.find_all_by_user_id(@user.id) -%> -

- <%= link_to(membership.group.name, [:admin, membership.group]) %> -

- <% end -%> -
-
diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml new file mode 100644 index 00000000..0e1ee9c4 --- /dev/null +++ b/app/views/admin/users/show.html.haml @@ -0,0 +1,39 @@ +- title @user.nick + +.row-fluid + .span3 + .well + %h4 Person + %p Mitglied seit #{distance_of_time_in_words(Time.now, @user.created_on)} + %dl + %dt Nick + %dd= @user.nick + %dt Name + %dd= h @user.name + %dt Email + %dd= @user.email + %dt Telefon + %dd= @user.phone + %dt Zugriff auf + %dd= format_roles(@user) + .span5 + .well + %h4 Einstellungen + %table.table + - for setting in User::setting_keys.keys + %tr + %td= User::setting_keys[setting] + %td= @user.settings[setting] == '1' ? 'ja' : 'nein' + .span3 + .well + %h4 Gruppenabos + %ul.unstyled + - for membership in Membership.find_all_by_user_id(@user.id) + %li= link_to(membership.group.name, [:admin, membership.group]) + +%hr/ +%p + = link_to 'Bearbeiten', edit_admin_user_path(@user), class: 'btn' + = link_to 'Löschen', [:admin, @user], :confirm => "Willst du #{@user.first_name} wirklich rausschmeißen?", + :method => :delete, class: 'btn btn-danger' + = link_to "Nachricht senden", new_message_path(:message => {:mail_to => @user.id}), class: 'btn' diff --git a/app/views/admin/workgroups/_form.html.haml b/app/views/admin/workgroups/_form.html.haml index 3944356d..12329a3b 100644 --- a/app/views/admin/workgroups/_form.html.haml +++ b/app/views/admin/workgroups/_form.html.haml @@ -4,11 +4,12 @@ einladen. = simple_form_for [:admin, @workgroup] do |f| = render :layout => 'shared/group_form_fields', :locals => {:f => f} do - %h3 Zugriff auf .. + %h4 Zugriff auf = f.input :role_admin = f.input :role_finance = f.input :role_suppliers = f.input :role_article_meta = f.input :role_orders - = f.submit - = link_to "oder abbrechen", admin_workgroups_path + .form-actions + = f.button :submit + = link_to "oder abbrechen", :back diff --git a/app/views/admin/workgroups/_workgroups.html.haml b/app/views/admin/workgroups/_workgroups.html.haml index 754d3770..1e04d49c 100644 --- a/app/views/admin/workgroups/_workgroups.html.haml +++ b/app/views/admin/workgroups/_workgroups.html.haml @@ -1,24 +1,20 @@ -%p - %table{:style => "width:100%"} - %tr - %td - = pagination_links_remote @workgroups - %td{:style => "text-align:right"} - = items_per_page -%table.list +- if Workgroup.count > 20 + = items_per_page += pagination_links_remote @workgroups +%table.table.table-striped %thead %tr %th Name %th Mitglieder %th Zugriff auf - %th + %th Aktionen %tbody - for workgroup in @workgroups - %tr{:class => cycle('even','odd', :name => 'groups')} + %tr %td= link_to workgroup.name, [:admin, workgroup] %td= workgroup.users.size %td= format_roles(workgroup) %td - = link_to icon(:edit), edit_admin_workgroup_path(workgroup) - = link_to icon(:delete), [:admin, workgroup], :confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?', - :method => :delete + = link_to "Bearbeiten", edit_admin_workgroup_path(workgroup), class: 'btn btn-mini' + = link_to "Löschen", [:admin, workgroup], :confirm => 'Willst du ' + workgroup.name + ' wirklich löschen?', + :method => :delete, class: 'btn btn-mini btn-danger' diff --git a/app/views/admin/workgroups/edit.html.haml b/app/views/admin/workgroups/edit.html.haml index 3b7ae553..d6632674 100644 --- a/app/views/admin/workgroups/edit.html.haml +++ b/app/views/admin/workgroups/edit.html.haml @@ -1,3 +1,3 @@ - title "Arbeitsgruppe bearbeiten" -= render :partial => 'form' \ No newline at end of file += render 'form' \ No newline at end of file diff --git a/app/views/admin/workgroups/index.html.haml b/app/views/admin/workgroups/index.html.haml index 232f5521..d91e0cde 100644 --- a/app/views/admin/workgroups/index.html.haml +++ b/app/views/admin/workgroups/index.html.haml @@ -1,26 +1,22 @@ -- title "List workgroups" +- title "Arbeitsgruppen" -%p - %i +- 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 anlegen, Gruppen bearbeiten und löschen. - -%p - Beachte dabei den Unterschied zwischen Gruppe und Bestellgruppe: - Eine - %em= link_to 'Bestellgruppe', '/admin/ordergroups' - hat ein Konto und kann Essen bestellen. In einer Arbeitsgruppe (z.b. 'Soritiergruppe') - koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten. - Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören. -.left_column{:style => "width:100%"} - .box_title - %h2 Gruppenübersicht - .column_content - #group_filter - = form_tag admin_workgroups_path, :method => :get, :style=>"display:inline;", :id => 'ordergroup_search', - :remote => true, 'data-submit-onchange' => true do - %label{:for => 'article_name'} Suche nach Name: - = text_field_tag :query, params[:query], :size => 10 - #workgroups - = render :partial => "workgroups" \ No newline at end of file + %p + Beachte dabei den Unterschied zwischen Gruppe und Bestellgruppe: + Eine #{link_to 'Bestellgruppe', '/admin/ordergroups'} + hat ein Konto und kann Essen bestellen. In einer Arbeitsgruppe (z.b. 'Soritiergruppe') + koordinieren sich die Mitglieder mittels Aufgaben und Nachrichten. + Nutzer_innen können immer nur einer Bestellgruppe, aber beliebig vielen anderen Gruppen angehören. + +.well.well-small + = form_tag admin_workgroups_path, :method => :get, :remote => true, + 'data-submit-onchange' => true, class: 'form-search' do + = text_field_tag :query, params[:query], class: 'input-medium search-query', + placeholder: 'Name ...' +#workgroups + = render "workgroups" \ No newline at end of file diff --git a/app/views/admin/workgroups/index.js.erb b/app/views/admin/workgroups/index.js.erb deleted file mode 100644 index 70fb16c9..00000000 --- a/app/views/admin/workgroups/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#workgroups').html('<%= escape_javascript(render("workgroups")) %>'); \ No newline at end of file diff --git a/app/views/admin/workgroups/index.js.haml b/app/views/admin/workgroups/index.js.haml new file mode 100644 index 00000000..e21e8b7d --- /dev/null +++ b/app/views/admin/workgroups/index.js.haml @@ -0,0 +1 @@ +$('#workgroups').html('#{escape_javascript(render("workgroups"))}'); diff --git a/app/views/admin/workgroups/new.html.haml b/app/views/admin/workgroups/new.html.haml index 41145331..bf11697d 100644 --- a/app/views/admin/workgroups/new.html.haml +++ b/app/views/admin/workgroups/new.html.haml @@ -1,3 +1,3 @@ -- title "Erstelle Arbeitsgruppe" +- title "Arbeitsgruppe anlegen" -= render :partial => 'form' \ No newline at end of file += render 'form' \ No newline at end of file diff --git a/app/views/admin/workgroups/show.html.haml b/app/views/admin/workgroups/show.html.haml index 11b7cd8b..b739ca27 100644 --- a/app/views/admin/workgroups/show.html.haml +++ b/app/views/admin/workgroups/show.html.haml @@ -1,14 +1,6 @@ - title "Arbeitsgruppe #{@workgroup.name}" -.left_column{:style => "width:45em"} - .box_title - %h2 Übersicht - .column_content - = render :partial => 'shared/group', :locals => { :group => @workgroup } - %p - = link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_workgroup_path(@workgroup) - | - = link_to 'Löschen', [:admin, @workgroup], :confirm => 'Bist Du sicher?', :method => :delete - | - = link_to 'Nachricht senden', new_message_path(:message => {:group_id => @workgroup.id}) -%p{:style => "clear:both"}= link_to "Gruppenübersicht", admin_workgroups_path \ No newline at end of file +%section= render :partial => 'shared/group', :locals => { :group => @workgroup } += link_to 'Gruppe/Mitglieder bearbeiten', edit_admin_workgroup_path(@workgroup), class: 'btn' += link_to 'Löschen', [:admin, @workgroup], :confirm => 'Bist Du sicher?', :method => :delete, class: 'btn btn-danger' += link_to_new_message(message_params: {group_id: @workgroup.id}) \ No newline at end of file diff --git a/app/views/articles/create.js.erb b/app/views/articles/create.js.erb deleted file mode 100644 index 001d42eb..00000000 --- a/app/views/articles/create.js.erb +++ /dev/null @@ -1,2 +0,0 @@ -$('#listbody').prepend('<%= escape_javascript(render(@article)) %>'); -$.fancybox.close(); \ No newline at end of file diff --git a/app/views/articles/create.js.haml b/app/views/articles/create.js.haml new file mode 100644 index 00000000..9d93b54e --- /dev/null +++ b/app/views/articles/create.js.haml @@ -0,0 +1,2 @@ +$('#listbody').prepend('#{escape_javascript(render(@article))}'); +$.fancybox.close(); diff --git a/app/views/articles/destroy.js.erb b/app/views/articles/destroy.js.erb deleted file mode 100644 index 17ec0157..00000000 --- a/app/views/articles/destroy.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% if @order %> -$('#article_<%= @article.id %>').after('<%= escape_javascript(render("destroy_active_article")) %>'); -<% else %> -$('#article_<%= @article.id %>').remove(); -<% end %> \ No newline at end of file diff --git a/app/views/articles/destroy.js.haml b/app/views/articles/destroy.js.haml new file mode 100644 index 00000000..da7c5a62 --- /dev/null +++ b/app/views/articles/destroy.js.haml @@ -0,0 +1,4 @@ +- if @order + $('#article_#{@article.id}').after('#{escape_javascript(render("destroy_active_article"))}'); +- else + $('#article_#{@article.id}').remove(); diff --git a/app/views/articles/index.js.erb b/app/views/articles/index.js.erb deleted file mode 100644 index 1af9cf9d..00000000 --- a/app/views/articles/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#table').html('<%= escape_javascript(render("articles")) %>'); \ No newline at end of file diff --git a/app/views/articles/index.js.haml b/app/views/articles/index.js.haml new file mode 100644 index 00000000..a66bcf54 --- /dev/null +++ b/app/views/articles/index.js.haml @@ -0,0 +1 @@ +$('#table').html('#{escape_javascript(render("articles"))}'); diff --git a/app/views/articles/new.js.erb b/app/views/articles/new.js.erb deleted file mode 100644 index 3c8d6f34..00000000 --- a/app/views/articles/new.js.erb +++ /dev/null @@ -1 +0,0 @@ -$.fancybox('<%= escape_javascript(render("form")) %>'); \ No newline at end of file diff --git a/app/views/articles/new.js.haml b/app/views/articles/new.js.haml new file mode 100644 index 00000000..76013027 --- /dev/null +++ b/app/views/articles/new.js.haml @@ -0,0 +1 @@ +$.fancybox('#{escape_javascript(render("form"))}'); diff --git a/app/views/articles/shared.js.erb b/app/views/articles/shared.js.erb deleted file mode 100644 index 08ce3fa7..00000000 --- a/app/views/articles/shared.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#search_results').html('<%= escape_javascript(render("import_search_results")) %>'); \ No newline at end of file diff --git a/app/views/articles/shared.js.haml b/app/views/articles/shared.js.haml new file mode 100644 index 00000000..23816d7e --- /dev/null +++ b/app/views/articles/shared.js.haml @@ -0,0 +1 @@ +$('#search_results').html('#{escape_javascript(render("import_search_results"))}'); diff --git a/app/views/articles/update.js.erb b/app/views/articles/update.js.erb deleted file mode 100644 index d0bbc47e..00000000 --- a/app/views/articles/update.js.erb +++ /dev/null @@ -1,2 +0,0 @@ -$('#article_<%= @article.id %>').replaceWith('<%= escape_javascript(render(@article)) %>'); -$.fancybox.close(); \ No newline at end of file diff --git a/app/views/articles/update.js.haml b/app/views/articles/update.js.haml new file mode 100644 index 00000000..41ce37f0 --- /dev/null +++ b/app/views/articles/update.js.haml @@ -0,0 +1,2 @@ +$('#article_#{@article.id}').replaceWith('#{escape_javascript(render(@article))}'); +$.fancybox.close(); diff --git a/app/views/deliveries/add_stock_change.js.erb b/app/views/deliveries/add_stock_change.js.erb deleted file mode 100644 index d6262fee..00000000 --- a/app/views/deliveries/add_stock_change.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#stock_changes').append('<%= escape_javascript(render(:partial => 'stock_change', :locals => {:stock_change => StockChange.new, :supplier => @supplier})) %>'); \ No newline at end of file diff --git a/app/views/deliveries/add_stock_change.js.haml b/app/views/deliveries/add_stock_change.js.haml new file mode 100644 index 00000000..43659e20 --- /dev/null +++ b/app/views/deliveries/add_stock_change.js.haml @@ -0,0 +1 @@ +$('#stock_changes').append('#{escape_javascript(render(:partial => 'stock_change', :locals => {:stock_change => StockChange.new, :supplier => @supplier}))}'); diff --git a/app/views/finance/balancing/edit_note.js.erb b/app/views/finance/balancing/edit_note.js.erb deleted file mode 100644 index 1a4766fe..00000000 --- a/app/views/finance/balancing/edit_note.js.erb +++ /dev/null @@ -1 +0,0 @@ -$.fancybox('<%= escape_javascript(render("edit_note")) %>'); \ No newline at end of file diff --git a/app/views/finance/balancing/edit_note.js.haml b/app/views/finance/balancing/edit_note.js.haml new file mode 100644 index 00000000..d8a47632 --- /dev/null +++ b/app/views/finance/balancing/edit_note.js.haml @@ -0,0 +1 @@ +$.fancybox('#{escape_javascript(render("edit_note"))}'); diff --git a/app/views/finance/balancing/new.js.erb b/app/views/finance/balancing/new.js.erb deleted file mode 100644 index 041f636f..00000000 --- a/app/views/finance/balancing/new.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#results').html('<%= escape_javascript(render(partial: balancing_view_partial, locals: {order: @order})) %>'); \ No newline at end of file diff --git a/app/views/finance/balancing/new.js.haml b/app/views/finance/balancing/new.js.haml new file mode 100644 index 00000000..bc70b799 --- /dev/null +++ b/app/views/finance/balancing/new.js.haml @@ -0,0 +1 @@ +$('#results').html('#{escape_javascript(render(partial: balancing_view_partial, locals: {order: @order}))}'); diff --git a/app/views/finance/balancing/update_note.js.erb b/app/views/finance/balancing/update_note.js.erb deleted file mode 100644 index f91361ac..00000000 --- a/app/views/finance/balancing/update_note.js.erb +++ /dev/null @@ -1,2 +0,0 @@ -$.fancybox.close(); -$('#note').html('<%= escape_javascript(simple_format(@order.note)) %>'); diff --git a/app/views/finance/balancing/update_note.js.haml b/app/views/finance/balancing/update_note.js.haml new file mode 100644 index 00000000..1fb35c3d --- /dev/null +++ b/app/views/finance/balancing/update_note.js.haml @@ -0,0 +1,2 @@ +$.fancybox.close(); +$('#note').html('#{escape_javascript(simple_format(@order.note))}'); diff --git a/app/views/finance/financial_transactions/index.js.erb b/app/views/finance/financial_transactions/index.js.erb deleted file mode 100644 index 5fd8de68..00000000 --- a/app/views/finance/financial_transactions/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#transactions').html('<%= escape_javascript(render("transactions")) %>'); \ No newline at end of file diff --git a/app/views/finance/financial_transactions/index.js.haml b/app/views/finance/financial_transactions/index.js.haml new file mode 100644 index 00000000..53f69018 --- /dev/null +++ b/app/views/finance/financial_transactions/index.js.haml @@ -0,0 +1 @@ +$('#transactions').html('#{escape_javascript(render("transactions"))}'); diff --git a/app/views/finance/group_order_articles/edit.js.erb b/app/views/finance/group_order_articles/edit.js.erb deleted file mode 100644 index 1eb75cd7..00000000 --- a/app/views/finance/group_order_articles/edit.js.erb +++ /dev/null @@ -1 +0,0 @@ -$.fancybox('<%= escape_javascript(render('form')) %>'); \ No newline at end of file diff --git a/app/views/finance/group_order_articles/edit.js.haml b/app/views/finance/group_order_articles/edit.js.haml new file mode 100644 index 00000000..09419d16 --- /dev/null +++ b/app/views/finance/group_order_articles/edit.js.haml @@ -0,0 +1 @@ +$.fancybox('#{escape_javascript(render('form'))}'); diff --git a/app/views/finance/group_order_articles/new.js.erb b/app/views/finance/group_order_articles/new.js.erb deleted file mode 100644 index 3c8d6f34..00000000 --- a/app/views/finance/group_order_articles/new.js.erb +++ /dev/null @@ -1 +0,0 @@ -$.fancybox('<%= escape_javascript(render("form")) %>'); \ No newline at end of file diff --git a/app/views/finance/group_order_articles/new.js.haml b/app/views/finance/group_order_articles/new.js.haml new file mode 100644 index 00000000..76013027 --- /dev/null +++ b/app/views/finance/group_order_articles/new.js.haml @@ -0,0 +1 @@ +$.fancybox('#{escape_javascript(render("form"))}'); diff --git a/app/views/finance/group_order_articles/update.js.erb b/app/views/finance/group_order_articles/update.js.erb deleted file mode 100644 index a4341f91..00000000 --- a/app/views/finance/group_order_articles/update.js.erb +++ /dev/null @@ -1,5 +0,0 @@ -$.fancybox.close(); -$('#order_article_<%= @order_article.id %>'). - html('<%= escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article})) %>'); -$('#group_order_articles_<%= @order_article.id %>'). - html('<%= escape_javascript(render(partial: 'finance/balancing/group_order_articles', locals: {order_article: @order_article})) %>'); \ 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 new file mode 100644 index 00000000..1fa42370 --- /dev/null +++ b/app/views/finance/group_order_articles/update.js.haml @@ -0,0 +1,5 @@ +$.fancybox.close(); +$('#order_article_#{@order_article.id}'). +html('#{escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article}))}'); +$('#group_order_articles_#{@order_article.id}'). +html('#{escape_javascript(render(partial: 'finance/balancing/group_order_articles', locals: {order_article: @order_article}))}'); diff --git a/app/views/finance/invoices/edit.html.erb b/app/views/finance/invoices/edit.html.erb deleted file mode 100644 index 59d3a3ea..00000000 --- a/app/views/finance/invoices/edit.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -<% title "Rechnung bearbeiten" %> - -<%= render :partial => 'form' %> - -<%= link_to "Anzeigen", [:finance, @invoice] %> | -<%= link_to 'Zurück', finance_invoices_path %> diff --git a/app/views/finance/invoices/edit.html.haml b/app/views/finance/invoices/edit.html.haml new file mode 100644 index 00000000..3a3425fc --- /dev/null +++ b/app/views/finance/invoices/edit.html.haml @@ -0,0 +1,5 @@ +- title "Rechnung bearbeiten" += render :partial => 'form' += link_to "Anzeigen", [:finance, @invoice] +| +\#{link_to 'Zurück', finance_invoices_path} diff --git a/app/views/finance/invoices/index.html.erb b/app/views/finance/invoices/index.html.erb deleted file mode 100644 index b6f55c04..00000000 --- a/app/views/finance/invoices/index.html.erb +++ /dev/null @@ -1,40 +0,0 @@ -<% title "Rechnungen" %> - -

<%= will_paginate @invoices %>

- - - - - - - - - - - - - - - - - - <% for invoice in @invoices %> - - - - - - - - - - - - - <% end %> - -
NummerLieferantinDatumBezahlt amBetragLieferungBestellungNote
<%= link_to h(invoice.number), finance_invoice_path(invoice)%><%= invoice.supplier.name %><%= format_date invoice.date %><%= format_date invoice.paid_on %><%= number_to_currency invoice.amount %><%= link_to "Lieferung", [invoice.supplier,invoice.delivery] if invoice.delivery %><%= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order %><%= truncate(invoice.note) %><%= link_to icon(:edit), edit_finance_invoice_path(invoice) %><%= link_to icon(:delete), finance_invoice_path(invoice), :confirm => 'Are you sure?', :method => :delete %>
- -
- -<%= link_to 'Neue Rechnung anlegen', new_finance_invoice_path %> diff --git a/app/views/finance/invoices/index.html.haml b/app/views/finance/invoices/index.html.haml new file mode 100644 index 00000000..c90a0286 --- /dev/null +++ b/app/views/finance/invoices/index.html.haml @@ -0,0 +1,30 @@ +- title "Rechnungen" +%p= will_paginate @invoices +%table.list{:style => "width:70em"} + %thead + %tr + %th Nummer + %th Lieferantin + %th Datum + %th Bezahlt am + %th Betrag + %th Lieferung + %th Bestellung + %th Note + %th + %th + %tbody + - for invoice in @invoices + %tr + %td= link_to h(invoice.number), finance_invoice_path(invoice) + %td= invoice.supplier.name + %td= format_date invoice.date + %td= format_date invoice.paid_on + %td= number_to_currency invoice.amount + %td= link_to "Lieferung", [invoice.supplier,invoice.delivery] if invoice.delivery + %td= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order + %td= truncate(invoice.note) + %td= link_to icon(:edit), edit_finance_invoice_path(invoice) + %td= link_to icon(:delete), finance_invoice_path(invoice), :confirm => 'Are you sure?', :method => :delete +%br/ += link_to 'Neue Rechnung anlegen', new_finance_invoice_path diff --git a/app/views/finance/invoices/new.html.erb b/app/views/finance/invoices/new.html.erb deleted file mode 100644 index 65c24e2f..00000000 --- a/app/views/finance/invoices/new.html.erb +++ /dev/null @@ -1,4 +0,0 @@ -<% title "Neue Rechnung anlegen" -%> - -<%= render :partial => 'form' %> -<%= link_to 'Zurück', finance_invoices_path %> diff --git a/app/views/finance/invoices/new.html.haml b/app/views/finance/invoices/new.html.haml new file mode 100644 index 00000000..73112145 --- /dev/null +++ b/app/views/finance/invoices/new.html.haml @@ -0,0 +1,3 @@ +- title "Neue Rechnung anlegen" += render :partial => 'form' += link_to 'Zurück', finance_invoices_path diff --git a/app/views/finance/order_articles/create.js.erb b/app/views/finance/order_articles/create.js.erb deleted file mode 100644 index e2b8b504..00000000 --- a/app/views/finance/order_articles/create.js.erb +++ /dev/null @@ -1,3 +0,0 @@ -$.fancybox.close(); -$('#result_table'). - prepend('<%= escape_javascript(render(partial: 'finance/balancing/order_article_result', locals: {order_article: @order_article}))%>'); \ No newline at end of file diff --git a/app/views/finance/order_articles/create.js.haml b/app/views/finance/order_articles/create.js.haml new file mode 100644 index 00000000..9557e5f1 --- /dev/null +++ b/app/views/finance/order_articles/create.js.haml @@ -0,0 +1,3 @@ +$.fancybox.close(); +$('#result_table'). +prepend('#{escape_javascript(render(partial: 'finance/balancing/order_article_result', locals: {order_article: @order_article}))}'); diff --git a/app/views/finance/order_articles/destroy.js.erb b/app/views/finance/order_articles/destroy.js.erb deleted file mode 100644 index 9e2afb5a..00000000 --- a/app/views/finance/order_articles/destroy.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#order_article_<%= @order_article.id %>, #group_order_articles_<%= @order_article.id %>').hide(); \ No newline at end of file diff --git a/app/views/finance/order_articles/destroy.js.haml b/app/views/finance/order_articles/destroy.js.haml new file mode 100644 index 00000000..9e431e7d --- /dev/null +++ b/app/views/finance/order_articles/destroy.js.haml @@ -0,0 +1 @@ +$('#order_article_#{@order_article.id}, #group_order_articles_#{@order_article.id}').hide(); diff --git a/app/views/finance/order_articles/edit.js.erb b/app/views/finance/order_articles/edit.js.erb deleted file mode 100644 index dbfced30..00000000 --- a/app/views/finance/order_articles/edit.js.erb +++ /dev/null @@ -1 +0,0 @@ -$.fancybox('<%= escape_javascript(render("edit")) %>'); \ No newline at end of file diff --git a/app/views/finance/order_articles/edit.js.haml b/app/views/finance/order_articles/edit.js.haml new file mode 100644 index 00000000..d90c20f3 --- /dev/null +++ b/app/views/finance/order_articles/edit.js.haml @@ -0,0 +1 @@ +$.fancybox('#{escape_javascript(render("edit"))}'); diff --git a/app/views/finance/order_articles/new.js.erb b/app/views/finance/order_articles/new.js.erb deleted file mode 100644 index c19ec9ad..00000000 --- a/app/views/finance/order_articles/new.js.erb +++ /dev/null @@ -1 +0,0 @@ -$.fancybox('<%= escape_javascript(render("new")) %>'); \ No newline at end of file diff --git a/app/views/finance/order_articles/new.js.haml b/app/views/finance/order_articles/new.js.haml new file mode 100644 index 00000000..6d021e97 --- /dev/null +++ b/app/views/finance/order_articles/new.js.haml @@ -0,0 +1 @@ +$.fancybox('#{escape_javascript(render("new"))}'); diff --git a/app/views/finance/order_articles/update.js.erb b/app/views/finance/order_articles/update.js.erb deleted file mode 100644 index b9ef3b5f..00000000 --- a/app/views/finance/order_articles/update.js.erb +++ /dev/null @@ -1,3 +0,0 @@ -$.fancybox.close(); -$('#order_article_<%= @order_article.id %>'). - html('<%= escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article})) %>'); \ No newline at end of file diff --git a/app/views/finance/order_articles/update.js.haml b/app/views/finance/order_articles/update.js.haml new file mode 100644 index 00000000..fd9a5cbf --- /dev/null +++ b/app/views/finance/order_articles/update.js.haml @@ -0,0 +1,3 @@ +$.fancybox.close(); +$('#order_article_#{@order_article.id}'). +html('#{escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article}))}'); diff --git a/app/views/finance/ordergroups/index.js.erb b/app/views/finance/ordergroups/index.js.erb deleted file mode 100644 index 97537932..00000000 --- a/app/views/finance/ordergroups/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>'); \ No newline at end of file diff --git a/app/views/finance/ordergroups/index.js.haml b/app/views/finance/ordergroups/index.js.haml new file mode 100644 index 00000000..e991afec --- /dev/null +++ b/app/views/finance/ordergroups/index.js.haml @@ -0,0 +1 @@ +$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}'); diff --git a/app/views/foodcoop/ordergroups/index.js.erb b/app/views/foodcoop/ordergroups/index.js.erb deleted file mode 100644 index 97537932..00000000 --- a/app/views/foodcoop/ordergroups/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#ordergroups').html('<%= escape_javascript(render("ordergroups")) %>'); \ No newline at end of file diff --git a/app/views/foodcoop/ordergroups/index.js.haml b/app/views/foodcoop/ordergroups/index.js.haml new file mode 100644 index 00000000..e991afec --- /dev/null +++ b/app/views/foodcoop/ordergroups/index.js.haml @@ -0,0 +1 @@ +$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}'); diff --git a/app/views/foodcoop/users/index.js.erb b/app/views/foodcoop/users/index.js.erb deleted file mode 100644 index 3b47479f..00000000 --- a/app/views/foodcoop/users/index.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#users').html('<%= escape_javascript(render("users")) %>'); diff --git a/app/views/foodcoop/users/index.js.haml b/app/views/foodcoop/users/index.js.haml new file mode 100644 index 00000000..0bf47722 --- /dev/null +++ b/app/views/foodcoop/users/index.js.haml @@ -0,0 +1 @@ +$('#users').html('#{escape_javascript(render("users"))}'); diff --git a/app/views/group_orders/_form.html.haml b/app/views/group_orders/_form.html.haml index 9c3204bc..b3b2ad91 100644 --- a/app/views/group_orders/_form.html.haml +++ b/app/views/group_orders/_form.html.haml @@ -1,4 +1,4 @@ -- content_for :head do +- content_for :javascript do :javascript $(function() { #{data_to_js(@ordering_data)} @@ -10,123 +10,107 @@ - title "Bestellen" -.left_column{:style => "width:49em"} - .box_title - %h2=h @order.name - .column_content - %table - %tr{:valign => "top"} - %td{:width => "60%"} - %p - %b Lieferantin: - =h @order.name - %p - %b Ende: - =h format_time(@order.ends) - - if @group_order && @group_order.updated_by - %p - %b Zuletzt bestellt: - =h @group_order.updated_by.nick if @group_order.updated_by - = "(#{format_time(@group_order.updated_on)})" - %p - %b Verfügbares Guthaben: - = number_to_currency(@ordering_data[:available_funds]) - %td - - unless @order.note.empty? - %p - %b Notiz: - = simple_format(@order.note) - - unless @order.stockit? || @order.supplier.min_order_quantity.blank? - %p - %b Mindestellmenge: - =h @order.supplier.min_order_quantity - %p - %b Gesamtbestellmenge bisher: - = number_to_currency @order.sum +.well.pull-left + %h2= @order.name + %dl.dl-horizontal + - unless @order.note.blank? + %dt Notiz + %dd= @order.note + %dt Ende + %dd= format_time(@order.ends) + - unless @order.stockit? or @order.supplier.min_order_quantity.blank? + %dt Mindestbestellmenge + %dd= @order.supplier.min_order_quantity + %dt Gesamtbestellmenge bisher: + %dd= number_to_currency @order.sum + %dt Zuletzt bestellt + %dd + = @group_order.updated_by.nick if @group_order.updated_by + (#{format_time(@group_order.updated_on)}) + %dt Guthaben + %dd= number_to_currency(@ordering_data[:available_funds]) -= render :partial => 'switch_order', :locals => {:current_order => @order} +.well.pull-right + = render 'switch_order', current_order: @order = form_for @group_order do |f| = f.hidden_field :lock_version = f.hidden_field :order_id = f.hidden_field :updated_by_user_id = f.hidden_field :ordergroup_id - .single_column{:style => "clear:both;margin-bottom:7em;"} - .box_title - %h2 Artikel - .column_content - %table#order.list - %thead - %tr - %th Name - %th{:style => "width:13px;"} - %th{:style => "width:4.5em;"} Preis - %th{:style => "width:4.5em;"} Einheit - - unless @order.stockit? - %th{:style => "width:70px;"} Fehlende Einheiten - %th#col_required Menge - %th#col_tolerance Toleranz - - else - %th(style="width:20px") Verfügbar - %th#col_required Menge - %th{:style => "width:15px;"} Summe - %tbody - - @order.articles_grouped_by_category.each do |category, order_articles| - %tr{:style => "background-color:#EFEFEF"} - %td{:style => "text-align:left"} - %b= h category - %td{:colspan => "9"} - - order_articles.each do |order_article| - %tr{:class => "#{cycle('even', 'odd', :name => 'articles')} order-article", :valign => "top"} - %td.name= order_article.article.name - %td= h order_article.article.origin - %td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price]) - %td= order_article.article.unit - %td - - if @order.stockit? - = @ordering_data[:order_articles][order_article.id][:quantity_available] - - else - %span{:id => "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units] + %table.table.table-hover + %thead + %tr + %th Name + %th{style: "width:13px;"} + %th{style: "width:4.5em;"} Preis + %th{style: "width:4.5em;"} Einheit + - unless @order.stockit? + %th{style: "width:70px;"} Fehlende Einheiten + %th#col_required Menge + %th#col_tolerance Toleranz + - else + %th(style="width:20px") Verfügbar + %th#col_required Menge + %th{style: "width:15px;"} Summe + %tbody + - @order.articles_grouped_by_category.each do |category, order_articles| + %tr.article-category + %td + = category + %i.icon-tag + %td{colspan: "9"} + - order_articles.each do |order_article| + %tr{class: "#{cycle('even', 'odd', name: 'articles')} order-article", valign: "top"} + %td.name= order_article.article.name + %td= h order_article.article.origin + %td= number_to_currency(@ordering_data[:order_articles][order_article.id][:price]) + %td= order_article.article.unit + %td + - if @order.stockit? + = @ordering_data[:order_articles][order_article.id][:quantity_available] + - else + %span{id: "missing_units_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:missing_units] - %td.quantity - %input{:id => "q_#{order_article.id}", :name => "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", :size => "2", :type => "hidden", :value => @ordering_data[:order_articles][order_article.id][:quantity]}/ - %span.used{:id => "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity] - + - %span.unused{:id => "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity] - %input{:type => 'button', :value => '+', 'data-increase_quantity' => order_article.id} - %input{:type => 'button', :value => '-', 'data-decrease_quantity' => order_article.id} + %td.quantity + %input{id: "q_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][quantity]", size: "2", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:quantity]}/ + %span.used{id: "q_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_quantity] + + + %span.unused{id: "q_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] - @ordering_data[:order_articles][order_article.id][:used_quantity] + %input{type: 'button', value: '+', 'data-increase_quantity' => order_article.id} + %input{type: 'button', value: '-', 'data-decrease_quantity' => order_article.id} - %td.tolerance{:style => ('display:none' if @order.stockit?)} - %input{:id => "t_#{order_article.id}", :name => "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", :size => "2", :type => "hidden", :value => @ordering_data[:order_articles][order_article.id][:tolerance]}/ - - if (@ordering_data[:order_articles][order_article.id][:unit] > 1) - %span.used{:id => "t_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_tolerance] - + - %span.unused{:id => "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance] - %input{:type => 'button', :value => '+', 'data-increase_tolerance' => order_article.id} - %input{:type => 'button', :value => '-', 'data-decrease_tolerance' => order_article.id} + %td.tolerance{style: ('display:none' if @order.stockit?)} + %input{id: "t_#{order_article.id}", name: "group_order[group_order_articles_attributes][#{order_article.id}][tolerance]", size: "2", type: "hidden", value: @ordering_data[:order_articles][order_article.id][:tolerance]}/ + - if (@ordering_data[:order_articles][order_article.id][:unit] > 1) + %span.used{id: "t_used_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:used_tolerance] + + + %span.unused{id: "t_unused_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] - @ordering_data[:order_articles][order_article.id][:used_tolerance] + %input{type: 'button', value: '+', 'data-increase_tolerance' => order_article.id} + %input{type: 'button', value: '-', 'data-decrease_tolerance' => order_article.id} - %td{:id => "td_price_#{order_article.id}", :style => "text-align:right; padding-right:10px; width:4em"} - %span{:id => "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price], :unit => "") - € - .article-info - %h3= order_article.article.name - .right - Volle Gebinde: - %span{:id => "units_#{order_article.id}"}= order_article.units_to_order - %br/ - Gesamt-Einheiten: - %span{:id => "q_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] + @ordering_data[:order_articles][order_article.id][:others_quantity] - %br/ - Gesamt-Toleranz: - %span{:id => "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance] - %br/ - .left - Hersteller: #{order_article.article.manufacturer} - %br/ - Gebinde: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit} - %br/ - Notiz: #{order_article.article.note} - %br/ + %td{id: "td_price_#{order_article.id}", style: "text-align:right; padding-right:10px; width:4em"} + %span{id: "price_#{order_article.id}_display"}= number_to_currency(@ordering_data[:order_articles][order_article.id][:total_price], unit: "") + € + .article-info + .article-name= order_article.article.name + .pull-right + Volle Gebinde: + %span{id: "units_#{order_article.id}"}= order_article.units_to_order + %br/ + Gesamt-Einheiten: + %span{id: "q_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:quantity] + @ordering_data[:order_articles][order_article.id][:others_quantity] + %br/ + Gesamt-Toleranz: + %span{id: "t_total_#{order_article.id}"}= @ordering_data[:order_articles][order_article.id][:tolerance] + @ordering_data[:order_articles][order_article.id][:others_tolerance] + %br/ + .pull-left + Hersteller: #{order_article.article.manufacturer} + %br/ + Gebinde: #{@order.stockit? ? order_article.article.quantity_available : @ordering_data[:order_articles][order_article.id][:unit]} * #{h order_article.article.unit} + %br/ + Notiz: #{order_article.article.note} + %br/ #order-footer #info-box #total-sum @@ -146,7 +130,7 @@ %span#new_balance= @ordergroup.account_balance - @group_order.price € #order-button - = submit_tag( "Bestellung speichern", :id => 'submit_button' ) + = submit_tag( "Bestellung speichern", id: 'submit_button', class: 'btn btn-primary' ) oder #{link_to "abbrechen", group_orders_path} - %input#total_balance{:name => "total_balance", :type => "hidden", :value => @ordergroup.account_balance - @group_order.price}/ - %input{:name => "version", :type => "hidden", :value => @version}/ \ No newline at end of file + %input#total_balance{name: "total_balance", type: "hidden", value: @ordergroup.account_balance - @group_order.price}/ + %input{name: "version", type: "hidden", value: @version}/ \ No newline at end of file diff --git a/app/views/group_orders/_orders.html.haml b/app/views/group_orders/_orders.html.haml index 70d14b1a..435841de 100644 --- a/app/views/group_orders/_orders.html.haml +++ b/app/views/group_orders/_orders.html.haml @@ -1,6 +1,4 @@ -- if pagination - = pagination_links_remote @closed_orders, :per_page => 10, :update => 'closed_orders' -%table.list +%table.table.table-striped %thead %tr %th Lieferantin @@ -13,5 +11,6 @@ %tr{:class=> cycle('even', 'odd', :name => 'orders'), :style => order_class} %td= group_order.present? ? link_to(order.name, group_order_path(group_order)) : order.name %td= format_time(order.ends) - %td{:class => "currency"}= group_order ? number_to_currency(group_order.price) : "--" - \ No newline at end of file + %td.numeric= group_order ? number_to_currency(group_order.price) : "--" +- if pagination + = pagination_links_remote @closed_orders \ No newline at end of file diff --git a/app/views/group_orders/_switch_order.html.haml b/app/views/group_orders/_switch_order.html.haml index e30c86c6..e63b4aea 100644 --- a/app/views/group_orders/_switch_order.html.haml +++ b/app/views/group_orders/_switch_order.html.haml @@ -1,12 +1,9 @@ - orders = Order.open.reject{ |order| order == current_order } - unless orders.empty? - .right_column{:style => "width:22em"} - .box_title - %h2 Laufende Bestellungen - .column_content - %table - - for order in orders - %tr - %td - = link_to_ordering(order, 'data-confirm_switch_order' => true) - %td= "noch #{time_ago_in_words(order.ends)}" if order.ends \ No newline at end of file + %h2 Laufende Bestellungen + %ul.unstyled + - orders.each do |order| + %li + = link_to_ordering(order, 'data-confirm_switch_order' => true) + - if order.ends + noch #{time_ago_in_words(order.ends)} \ No newline at end of file diff --git a/app/views/group_orders/archive.html.haml b/app/views/group_orders/archive.html.haml index f3426c84..42b10f3a 100644 --- a/app/views/group_orders/archive.html.haml +++ b/app/views/group_orders/archive.html.haml @@ -3,15 +3,12 @@ Siehe hier alle = link_to "laufenden Bestellungen.", group_orders_path -.single_column{:style => "width:50em"} - .box_title +.row-fluid + .span6 %h2 beendet/nicht abgerechnet - .column_content = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} - -.single_column{:style => "width:50em"} - .box_title + + .span6 %h2 abgerechnet - .column_content #closed_orders = render :partial => "orders", :locals => {:orders => @closed_orders, :pagination => true} diff --git a/app/views/group_orders/archive.js.erb b/app/views/group_orders/archive.js.erb deleted file mode 100644 index 75e5a9b3..00000000 --- a/app/views/group_orders/archive.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#closed_orders').html('<%= escape_javascript(render("orders", orders: @closed_orders, pagination: true)) %>'); \ No newline at end of file diff --git a/app/views/group_orders/archive.js.haml b/app/views/group_orders/archive.js.haml new file mode 100644 index 00000000..574031d3 --- /dev/null +++ b/app/views/group_orders/archive.js.haml @@ -0,0 +1 @@ +$('#closed_orders').html('#{escape_javascript(render("orders", orders: @closed_orders, pagination: true))}'); diff --git a/app/views/group_orders/index.html.haml b/app/views/group_orders/index.html.haml index 3f074b10..d6e613f4 100644 --- a/app/views/group_orders/index.html.haml +++ b/app/views/group_orders/index.html.haml @@ -1,43 +1,39 @@ - title "Bestellüberblick" -// Ordergroups Account Balance -.left_column{:style => "width:26%"} - .box_title - %h2=h @ordergroup.name - .column_content - %table +- content_for :sidebar do + .well.well-small + // Ordergroups Account Balance + %h2 Guthaben + %table.table.table-striped %tr %td Kontostand: - %td{:class => "currency", :style => "width:5em"}= number_to_currency(@ordergroup.account_balance) + %td.numeric{:style => "width:5em"}= number_to_currency(@ordergroup.account_balance) %tr - %td= "- laufende Bestellungen:" - %td{:class => "currency"}= number_to_currency(@ordergroup.value_of_open_orders) + %td - laufende Bestellungen: + %td.numeric= number_to_currency(@ordergroup.value_of_open_orders) %tr %td= "- nicht abgerechnete Bestellungen:" - %td{:class => "currency"}= number_to_currency(@ordergroup.value_of_finished_orders) + %td.numeric= number_to_currency(@ordergroup.value_of_finished_orders) %tr %th verfügbares Guthaben: - %th{:class => "currency"}= number_to_currency(@ordergroup.get_available_funds) + %th.numeric= number_to_currency(@ordergroup.get_available_funds) -.right_column{:style => "width:70%"} - = render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup} += render :partial => "shared/open_orders", :locals => {:ordergroup => @ordergroup} - // finished orders - - unless Order.finished.empty? - .box_title - %h2 Nicht abgerechnete Bestellungen - .column_content - = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} - - if @ordergroup.value_of_finished_orders > 0 - %p - Gesamtsumme: - %b= number_to_currency(@ordergroup.value_of_finished_orders) +// finished orders +- unless Order.finished.empty? + %section + %h2 Nicht abgerechnete Bestellungen + = render :partial => "orders", :locals => {:orders => Order.finished_not_closed, :pagination => false} + - if @ordergroup.value_of_finished_orders > 0 + %p + Gesamtsumme: + %b= number_to_currency(@ordergroup.value_of_finished_orders) - // closed orders - - unless Order.closed.empty? - .box_title - %h2 Abgerechnete Bestellungen - .column_content - = render :partial => "orders", :locals => {:orders => Order.closed.all(:limit => 5), :pagination => false} - %br/ - = link_to "mehr...", archive_group_orders_path \ No newline at end of file +// closed orders +- unless Order.closed.empty? + %section + %h2 Abgerechnete Bestellungen + = render :partial => "orders", :locals => {:orders => Order.closed.all(:limit => 5), :pagination => false} + %br/ + = link_to "mehr...", archive_group_orders_path \ No newline at end of file diff --git a/app/views/group_orders/show.html.haml b/app/views/group_orders/show.html.haml index 12f4e072..5c38b955 100644 --- a/app/views/group_orders/show.html.haml +++ b/app/views/group_orders/show.html.haml @@ -1,4 +1,4 @@ -- content_for :head do +- content_for :javascript do :javascript $(function() { $('tr.ignored').hide(); @@ -6,55 +6,42 @@ - title "Dein Bestellergebnis für #{@order.name}" -// Order summary -.left_column{:style => "width:45em"} - .box_title - %h2 Zusammenfassung - .column_content - %table - %tr{:valign => "top"} - %td{:style => "width:50%"} - %p - Lieferantin: - %b=h @order.name - - unless @order.note.blank? - %p - Notiz: - =h @order.note - %p - Ende: - %b=h format_time(@order.ends) - %p - Bestellsumme: - - if @group_order - %b=h number_to_currency(@group_order.price) - - else - %b Du hast nicht bestellt. - - if @order.closed? - %p - = "Abgerechnet von #{@order.updated_by.nick}" - = link_to "Kommentare lesen/schreiben", "#comments" - -= render :partial => "switch_order", :locals => {:current_order => @order} +.well + // Order summary + %dl.dl-horizontal + %dt Lieferantin + %dd= @order.name + %dt Notiz + %dd= @order.note + %dt Ende + %dd= format_time(@order.ends) + %dt Bestellsumme + %dd + - if @group_order + = number_to_currency(@group_order.price) + - else + Du hast nicht bestellt. + - if @order.closed? + %p Abgerechnet von #{@order.updated_by.nick} + = link_to "Kommentare lesen/schreiben", "#comments" // Article box -.single_column{:style => "clear:both; width:70em;"} - .box_title - %h2 Artikelübersicht +%section + %h2 Artikelübersicht .column_content#result - if @group_order - %p(style="float:right")= link_to "Zeige/Verstecke nicht bestellte Artikel", '#', 'data-toggle-this' => 'tr.ignored' - %p= link_to("Bestellung ändern", edit_group_order_path(@group_order, :order_id => @order.id)) if @order.open? - %table.list + %p.pull-right= link_to "Zeige/Verstecke nicht bestellte Artikel", '#', 'data-toggle-this' => 'tr.ignored' + %p= link_to("Bestellung anpassen", edit_group_order_path(@group_order, order_id: @order.id), class: 'btn btn-primary') if @order.open? + %table.table.table-hover %thead %tr - %th{:style => "width:40%"} Name + %th{style: "width:40%"} Name %th Gebinde %th Einzelpreis %th - %abbr{:title => "Menge + Toleranz"} Bestellt + %abbr{title: "Menge + Toleranz"} Bestellt %th - %abbr{:title => "Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen"} + %abbr{title: "Unter Berücksichtigung der derzeitigen Bestellungen aller Gruppen"} - if @order.open? Zu Erhalten @@ -62,9 +49,11 @@ %tbody - total = 0 #set counter for order-sum - for category_name, order_articles in @order.articles_grouped_by_category - %tr{:style => "background-color:#EFEFEF"} - %td{:style => "text-align:left;"}=h category_name - %td{:colspan => "9"} + %tr.article-category + %td + = category_name + %i.icon-tag + %td{colspan: "9"} - for oa in order_articles - # get the order-results for the ordergroup - goa = oa.group_order_articles.find_by_group_order_id(@group_order.id) @@ -73,11 +62,11 @@ - result = goa.result - sub_total = goa.total_price - total += sub_total - %tr{:class => cycle('even', 'odd', :name => 'articles') + " " + order_article_class_name(quantity, tolerance, result)} - %td{:style => "width:40%"} + %tr{class: cycle('even', 'odd', name: 'articles') + " " + order_article_class_name(quantity, tolerance, result)} + %td{style: "width:40%"} =h oa.article.name - unless oa.article.note.blank? - = image_tag("lamp_grey.png", {:alt => "Notiz anzeigen", :size => "15x16", :border => "0", :onmouseover => "$('note_#{oa.id}').show();", :onmouseout => "$('note_#{oa.id}').hide();"}) + = image_tag("lamp_grey.png", {alt: "Notiz anzeigen", size: "15x16", border: "0", onmouseover: "$('note_#{oa.id}').show();", onmouseout: "$('note_#{oa.id}').hide();"}) %td= "#{oa.price.unit_quantity} x #{oa.article.unit}" %td= number_to_currency(oa.price.fc_price) %td @@ -86,26 +75,24 @@ %td= result > 0 ? result : "0" %td= number_to_currency(sub_total) - unless oa.article.note.blank? - %tr{:id => "note_#{oa.id}", :class => "note even", :style => "display:none"} - %td{:colspan => "6"}=h oa.article.note - %tr{:class => cycle('even', 'odd', :name => 'articles')} - %th{:colspan => "5"} Summe + %tr{id: "note_#{oa.id}", class: "note even", style: "display:none"} + %td{colspan: "6"}=h oa.article.note + %tr{class: cycle('even', 'odd', name: 'articles')} + %th{colspan: "5"} Summe %th= number_to_currency(total) %br/ = link_to_top - else - if @order.open? Du hast noch nicht bestellt. - = link_to "Das ist Deine Chance!", :action => "order", :id => @order + = link_to "Das ist Deine Chance!", action: "order", id: @order - else Die Bestellung is leider schon zu Ende. Beim nächsten mal früher aufstehen... // Comments box -.single_column{:style => "width:70em;"} - .box_title - %h2 Kommentare - .column_content - #comments - = render :partial => 'shared/comments', :locals => { :comments => @order.comments } - #new_comment= render :partial => 'order_comments/form', :locals => { :order_comment => @order.comments.build(:user => current_user)} - = link_to_top +%section + %h2 Kommentare + #comments + = render 'shared/comments', comments: @order.comments + #new_comment= render 'order_comments/form', order_comment: @order.comments.build(user: current_user) + = link_to_top diff --git a/app/views/home/ordergroup.html.erb b/app/views/home/ordergroup.html.erb deleted file mode 100644 index 52c07f29..00000000 --- a/app/views/home/ordergroup.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -

Meine Bestellgruppe

-
-

<%=h @ordergroup.name %>

-
-

- Beschreibung: <%=h @ordergroup.description %> -

-

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

-

Personen

-
    - <% for membership in @ordergroup.memberships -%> -
  • <%= membership.user.nick -%>
  • - <% end -%> -
- <%= link_to('Person einladen', new_invite_path(:id => @ordergroup), :remote => true) %> -
-
- -
-
-

Kontoauszug

-
-
- <%= form_tag my_ordergroup_url, :method => :get, :style => 'display:inline;', :id => 'transactions_search', - :remote => true do %> - <%= label_tag "financial_transaction_note", "Filter für Notizen:" %> - <%= text_field_tag("query", params['query'], :size => 10 ) %> - <% end %> -
- <%= render :partial => "/finance/transactions/list" %> -
-
-
- - -<% content_for :head do %> - -<% end %> - diff --git a/app/views/home/ordergroup.html.haml b/app/views/home/ordergroup.html.haml new file mode 100644 index 00000000..45ce2387 --- /dev/null +++ b/app/views/home/ordergroup.html.haml @@ -0,0 +1,35 @@ +%h1 Meine Bestellgruppe +.left_column + .box_title + %h2= h @ordergroup.name + .column_content + %p + %b Beschreibung: + = h @ordergroup.description + %p + %b Verfügbares Guthaben: + = number_to_currency(@ordergroup.get_available_funds()) + %h2 Personen + %ul{:style => "list-style-type:decimal;"} + - for membership in @ordergroup.memberships + %li= membership.user.nick + = link_to('Person einladen', new_invite_path(:id => @ordergroup), :remote => true) +.right_column + .box_title + %h2 Kontoauszug + .column_content + = form_tag my_ordergroup_url, :method => :get, :style => 'display:inline;', :id => 'transactions_search', | + :remote => true do | + = label_tag "financial_transaction_note", "Filter für Notizen:" + = text_field_tag("query", params['query'], :size => 10 ) + #transactions + = render :partial => "/finance/transactions/list" +#edit_box{:style => "display:none"} +- content_for :head do + :javascript + $(function() { + $('#query').observe_field(1, function() { + $('#transactions_search').submit(); + }); + }) + \ No newline at end of file diff --git a/app/views/home/ordergroup.js.erb b/app/views/home/ordergroup.js.erb deleted file mode 100644 index ba71bff1..00000000 --- a/app/views/home/ordergroup.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#transactions').html('<%= escape_javascript(render("finance/transactions/list")) %>'); \ No newline at end of file diff --git a/app/views/home/ordergroup.js.haml b/app/views/home/ordergroup.js.haml new file mode 100644 index 00000000..e2d0bfd0 --- /dev/null +++ b/app/views/home/ordergroup.js.haml @@ -0,0 +1 @@ +$('#transactions').html('#{escape_javascript(render("finance/transactions/list"))}'); diff --git a/app/views/invites/_modal_form.html.haml b/app/views/invites/_modal_form.html.haml new file mode 100644 index 00000000..3ef038ea --- /dev/null +++ b/app/views/invites/_modal_form.html.haml @@ -0,0 +1,12 @@ +#modalForm.modal(tabindex="-1" role="dialog") + = 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 + .modal-body + = form.hidden_field :user_id + = form.hidden_field :group_id + = form.input :email + .modal-footer + = button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'} + = form.submit class: 'btn btn-primary' diff --git a/app/views/invites/create.js.haml b/app/views/invites/create.js.haml new file mode 100644 index 00000000..490abae1 --- /dev/null +++ b/app/views/invites/create.js.haml @@ -0,0 +1 @@ +$('#modalForm').modal('hide'); \ No newline at end of file diff --git a/app/views/invites/new.js.haml b/app/views/invites/new.js.haml new file mode 100644 index 00000000..6aeee9b9 --- /dev/null +++ b/app/views/invites/new.js.haml @@ -0,0 +1,2 @@ +$('#modalContainer').html('#{escape_javascript(render('modal_form'))}'); +$('#modalForm').modal(); \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ec423f02..607386c3 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -15,9 +15,9 @@ .container-fluid .row-fluid - if content_for?(:sidebar) - .span2 + .span3 = yield(:sidebar) - .span10 + .span9 = bootstrap_flash - if show_title? .page-header @@ -33,3 +33,4 @@ %footer %p Foodsoft, open source software to manage a non-profit food coop. + #modalContainer diff --git a/app/views/layouts/email.text.erb b/app/views/layouts/email.text.erb deleted file mode 100644 index 6c02affb..00000000 --- a/app/views/layouts/email.text.erb +++ /dev/null @@ -1,6 +0,0 @@ -<%= yield %> - --- -FoodSoft: <%= root_url %> -Foodcoop-Homepage: <%= FoodsoftConfig[:homepage] %> -Hilfe/Help: <%= FoodsoftConfig[:help_url] %> diff --git a/app/views/layouts/email.text.haml b/app/views/layouts/email.text.haml new file mode 100644 index 00000000..89494dcb --- /dev/null +++ b/app/views/layouts/email.text.haml @@ -0,0 +1,5 @@ += yield +\-- +FoodSoft: #{root_url} +Foodcoop-Homepage: #{FoodsoftConfig[:homepage]} +Hilfe/Help: #{FoodsoftConfig[:help_url]} diff --git a/app/views/mailer/feedback.text.erb b/app/views/mailer/feedback.text.erb deleted file mode 100644 index 6f01036c..00000000 --- a/app/views/mailer/feedback.text.erb +++ /dev/null @@ -1,3 +0,0 @@ -<%= @user.nick %> schrieb am <%= I18n.l Time.now, :format => :short %>: - -<%= @feedback %> diff --git a/app/views/mailer/feedback.text.haml b/app/views/mailer/feedback.text.haml new file mode 100644 index 00000000..c5e4c805 --- /dev/null +++ b/app/views/mailer/feedback.text.haml @@ -0,0 +1,4 @@ += @user.nick +schrieb am #{I18n.l Time.now, :format => :short}: + +\#{@feedback} diff --git a/app/views/mailer/foodsoft_message.text.erb b/app/views/mailer/foodsoft_message.text.erb deleted file mode 100644 index 9dc136f0..00000000 --- a/app/views/mailer/foodsoft_message.text.erb +++ /dev/null @@ -1,7 +0,0 @@ -<%= @message.body %> - -====================================================================== - -Antworten: <%= new_message_url('message[reply_to]' => @message.id) %> -Nachricht online einsehen: <%= message_url(@message) %> -Nachrichten-Einstellungen: <%= my_profile_url %> \ No newline at end of file diff --git a/app/views/mailer/foodsoft_message.text.haml b/app/views/mailer/foodsoft_message.text.haml new file mode 100644 index 00000000..bacd287a --- /dev/null +++ b/app/views/mailer/foodsoft_message.text.haml @@ -0,0 +1,6 @@ += @message.body +\====================================================================== + +Antworten: #{new_message_url('message[reply_to]' => @message.id)} +Nachricht online einsehen: #{message_url(@message)} +Nachrichten-Einstellungen: #{my_profile_url} diff --git a/app/views/mailer/invite.text.erb b/app/views/mailer/invite.text.erb deleted file mode 100644 index 0eecc686..00000000 --- a/app/views/mailer/invite.text.erb +++ /dev/null @@ -1,17 +0,0 @@ -Hallo! - -<%= @invite.user.first_name %> <%= @invite.user.last_name %> (<%= @invite.user.email %>) hat dich in die Gruppe "<%= @invite.group.name %>" eingeladen. -Um die Einladung anzunehmen und der Foodcoop beizutreten, gehe zu: <%= @link %> -Dieser Link kann nur einmal aufgerufen werden und ist nur bis <%= I18n.l @invite.expires_at %> gültig. - -Grüße sendet die Foodsoft! - -======= - -Hi! - -<%= @invite.user.first_name %> <%= @invite.user.last_name %> (<%= @invite.user.email %>) has invited you to join the group "<%= @invite.group.name %>". -To accept the invitation and to join the foodcoop please follow this link: <%= @link %> -This link works only once and expires on <%= I18n.l @invite.expires_at, locale: :en %>. - -Greetings, your FoodSoft Team! diff --git a/app/views/mailer/invite.text.haml b/app/views/mailer/invite.text.haml new file mode 100644 index 00000000..163f52d5 --- /dev/null +++ b/app/views/mailer/invite.text.haml @@ -0,0 +1,17 @@ +Hallo! + +\#{@invite.user.first_name} #{@invite.user.last_name} (#{@invite.user.email}) hat dich in die Gruppe "#{@invite.group.name}" eingeladen. +Um die Einladung anzunehmen und der Foodcoop beizutreten, gehe zu: #{@link} +Dieser Link kann nur einmal aufgerufen werden und ist nur bis #{I18n.l @invite.expires_at} gültig. + +Grüße sendet die Foodsoft! + +\======= + +Hi! + +\#{@invite.user.first_name} #{@invite.user.last_name} (#{@invite.user.email}) has invited you to join the group "#{@invite.group.name}". +To accept the invitation and to join the foodcoop please follow this link: #{@link} +This link works only once and expires on #{I18n.l @invite.expires_at, locale: :en}. + +Greetings, your FoodSoft Team! diff --git a/app/views/mailer/negative_balance.text.erb b/app/views/mailer/negative_balance.text.erb deleted file mode 100644 index 15e5e39b..00000000 --- a/app/views/mailer/negative_balance.text.erb +++ /dev/null @@ -1,9 +0,0 @@ -Liebe <%= @group.name %>, - -euer Kontostand ist durch eine Buchung am <%= @transaction.created_on.strftime('%d.%m.%Y um %H:%M') %> ins Minus gerutscht: <%= @group.account_balance %> - -Es wurden <%= @transaction.amount %> für "<%= @transaction.note %>" abgebucht, die Buchung wurde von <%= @transaction.user.nick %> erstellt. - -Bitte zahlt so bald wie möglich wieder Geld ein, um das Gruppenkonto auszugleichen. - -Viele Grüße von <%= FoodsoftConfig[:name] %> \ No newline at end of file diff --git a/app/views/mailer/negative_balance.text.haml b/app/views/mailer/negative_balance.text.haml new file mode 100644 index 00000000..0e0c2def --- /dev/null +++ b/app/views/mailer/negative_balance.text.haml @@ -0,0 +1,9 @@ +Liebe #{@group.name}, + +euer Kontostand ist durch eine Buchung am #{@transaction.created_on.strftime('%d.%m.%Y um %H:%M')} ins Minus gerutscht: #{@group.account_balance} + +Es wurden #{@transaction.amount} für "#{@transaction.note}" abgebucht, die Buchung wurde von #{@transaction.user.nick} erstellt. + +Bitte zahlt so bald wie möglich wieder Geld ein, um das Gruppenkonto auszugleichen. + +Viele Grüße von #{FoodsoftConfig[:name]} diff --git a/app/views/mailer/not_enough_users_assigned.text.erb b/app/views/mailer/not_enough_users_assigned.text.erb deleted file mode 100644 index c08ffc97..00000000 --- a/app/views/mailer/not_enough_users_assigned.text.erb +++ /dev/null @@ -1,11 +0,0 @@ -Liebe(r) <%= @user.first_name %>, - -Der Job '<%= @task.name -%>' Deiner Arbeitsgruppe ist am <%= I18n.l @task.due_date, format: "%d. %b" %> fällig -und es fehlen noch Mitstreiterinnen! - -Sofern Du Dich noch nicht für diese Aufgabe eingetragen hast ist das jetzt die Chance: - <%= workgroup_tasks_url(workgroup_id: task.workgroup_id) %> - --- -Deine Aufgaben: <%= user_tasks_url %> - diff --git a/app/views/mailer/not_enough_users_assigned.text.haml b/app/views/mailer/not_enough_users_assigned.text.haml new file mode 100644 index 00000000..7d56f035 --- /dev/null +++ b/app/views/mailer/not_enough_users_assigned.text.haml @@ -0,0 +1,10 @@ +Liebe(r) #{@user.first_name}, + +Der Job '#{@task.name}' Deiner Arbeitsgruppe ist am #{I18n.l @task.due_date, format: "%d. %b"} fällig +und es fehlen noch Mitstreiterinnen! + +Sofern Du Dich noch nicht für diese Aufgabe eingetragen hast ist das jetzt die Chance: +\#{workgroup_tasks_url(workgroup_id: task.workgroup_id)} + +\-- +Deine Aufgaben: #{user_tasks_url} diff --git a/app/views/mailer/order_result.text.erb b/app/views/mailer/order_result.text.erb deleted file mode 100644 index 97e9aaf4..00000000 --- a/app/views/mailer/order_result.text.erb +++ /dev/null @@ -1,14 +0,0 @@ -Liebe <%= @group_order.ordergroup.name %>, - -die Bestellung für "<%= @order.name %>" wurde am <%= I18n.l @order.ends %> von <%= @order.updated_by.nick %> beendet. - -Für Euch wurden die folgenden Artikel bestellt: -<% 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 %> -<% end -%> -Gesamtpreis: <%= @group_order.price %> - -Bestellung online einsehen: <%= group_order_url(@group_order) %> - -Viele Grüße von <%= FoodsoftConfig[:name] %> \ No newline at end of file diff --git a/app/views/mailer/order_result.text.haml b/app/views/mailer/order_result.text.haml new file mode 100644 index 00000000..b74d3ab8 --- /dev/null +++ b/app/views/mailer/order_result.text.haml @@ -0,0 +1,14 @@ +Liebe #{@group_order.ordergroup.name}, + +die Bestellung für "#{@order.name}" wurde am #{I18n.l @order.ends} von #{@order.updated_by.nick} beendet. + +Für Euch wurden die folgenden Artikel bestellt: +- 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} +Gesamtpreis: #{@group_order.price} + +Bestellung online einsehen: #{group_order_url(@group_order)} + +Viele Grüße von #{FoodsoftConfig[:name]} diff --git a/app/views/mailer/reset_password.text.erb b/app/views/mailer/reset_password.text.haml similarity index 54% rename from app/views/mailer/reset_password.text.erb rename to app/views/mailer/reset_password.text.haml index 562166c1..adf9dbfa 100644 --- a/app/views/mailer/reset_password.text.erb +++ b/app/views/mailer/reset_password.text.haml @@ -1,18 +1,18 @@ -Hallo <%= @user.nick %>, +Hallo #{@user.nick}, du (oder jemand anderes) hat auf der FoodSoft-Website ein neues Passwort angefordert. -Um ein neues Passwort einzugeben, gehe zu: <%= raw @link %> -Dieser Link kann nur einmal aufgerufen werden und läuft am <%= I18n.l @user.reset_password_expires %> ab. +Um ein neues Passwort einzugeben, gehe zu: #{raw @link} +Dieser Link kann nur einmal aufgerufen werden und läuft am #{I18n.l @user.reset_password_expires} ab. Wenn du das Passwort nicht ändern möchtest oder diese Email nicht ausgelöst hast, brauchst du nichts zu tun. Dein bisheriges Passwort wurde nicht geändert. Grüße sendet die Foodsoft! :) -=========== +\=========== -Hi <%= @user.nick %>, +Hi #{@user.nick}, you have (or someone else has) requested a new password. -In order to choose a new password follow this link: <%= raw @link %> -This link works only once and expires on <%= I18n.l @user.reset_password_expires, locale: :en %>. +In order to choose a new password follow this link: #{raw @link} +This link works only once and expires on #{I18n.l @user.reset_password_expires, locale: :en}. If you don't want to change your password, just ignore this message. Your password hasn't been changed yet. Greetings, your FoodSoft Team! diff --git a/app/views/mailer/upcoming_tasks.text.erb b/app/views/mailer/upcoming_tasks.text.erb deleted file mode 100644 index 3f41a8d0..00000000 --- a/app/views/mailer/upcoming_tasks.text.erb +++ /dev/null @@ -1,15 +0,0 @@ -Liebe(r) <%= @user.name %>, - -Du bist für "<%= @task.name -%>" eingetragen. Die Aufgabe ist morgen (<%= I18n.l @task.due_date, format: "%d. %b" %>) fällig! - -<% if @user.next_tasks.size > 0 %> -Aufgaben für die nächste Woche: - <% for next_task in @user.next_tasks -%> - <% next if next_task == @task -%> -* <%= I18n.l next_task.due_date, format: "%d. %b" -%> <%= next_task.name %> - <% end -%> -<% end -%> - -Meine Aufgaben: <%= user_tasks_url %> - -Viele Grüße von <%= FoodsoftConfig[:name] %> \ No newline at end of file diff --git a/app/views/mailer/upcoming_tasks.text.haml b/app/views/mailer/upcoming_tasks.text.haml new file mode 100644 index 00000000..98d5dbca --- /dev/null +++ b/app/views/mailer/upcoming_tasks.text.haml @@ -0,0 +1,11 @@ +Liebe(r) #{@user.name}, + +Du bist für "#{@task.name}" eingetragen. Die Aufgabe ist morgen (#{I18n.l @task.due_date, format: "%d. %b"}) fällig! +- if @user.next_tasks.size > 0 + Aufgaben für die nächste Woche: + - for next_task in @user.next_tasks + - next if next_task == @task + * #{I18n.l next_task.due_date, format: "%d. %b"} #{next_task.name} +Meine Aufgaben: #{user_tasks_url} + +Viele Grüße von #{FoodsoftConfig[:name]} diff --git a/app/views/order_comments/_form.html.haml b/app/views/order_comments/_form.html.haml index b8faff9d..b91b7cc5 100644 --- a/app/views/order_comments/_form.html.haml +++ b/app/views/order_comments/_form.html.haml @@ -1,5 +1,5 @@ -= simple_form_for order_comment, :remote => true, :validate => true do |f| += simple_form_for order_comment, remote: true, html: {class: 'form-vertical'} do |f| = f.hidden_field :order_id = f.hidden_field :user_id - = f.input :text, :input_html => {:size => "50x6"} - = f.submit \ No newline at end of file + = f.input :text, input_html: {class: 'input-xlarge', rows: '5'} + = f.submit class: 'btn' \ No newline at end of file diff --git a/app/views/order_comments/create.js.erb b/app/views/order_comments/create.js.erb deleted file mode 100644 index 3ad08df1..00000000 --- a/app/views/order_comments/create.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#comments').html('<%= escape_javascript(render(:partial => 'shared/comments', :locals => { :comments => @order_comment.order.comments })) %>'); \ No newline at end of file diff --git a/app/views/order_comments/create.js.haml b/app/views/order_comments/create.js.haml new file mode 100644 index 00000000..70b15fe0 --- /dev/null +++ b/app/views/order_comments/create.js.haml @@ -0,0 +1 @@ +$('#comments').html('#{escape_javascript(render(:partial => 'shared/comments', :locals => { :comments => @order_comment.order.comments }))}'); diff --git a/app/views/order_comments/new.js.erb b/app/views/order_comments/new.js.erb deleted file mode 100644 index 1ffe2e75..00000000 --- a/app/views/order_comments/new.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#new_comment').html('<%= escape_javascript(render('form', :locals => { :order_comment => @order_comment})) %>'); \ No newline at end of file diff --git a/app/views/order_comments/new.js.haml b/app/views/order_comments/new.js.haml new file mode 100644 index 00000000..6d7d03ad --- /dev/null +++ b/app/views/order_comments/new.js.haml @@ -0,0 +1 @@ +$('#new_comment').html('#{escape_javascript(render('form', :locals => { :order_comment => @order_comment}))}'); diff --git a/app/views/ordergroups/edit.html.erb b/app/views/ordergroups/edit.html.erb deleted file mode 100644 index a7fd7911..00000000 --- a/app/views/ordergroups/edit.html.erb +++ /dev/null @@ -1,88 +0,0 @@ -<% title "Edit Ordergroup" %> - -<% form_for @ordergroup do |f| %> - <%= f.error_messages %> -

- <%= f.label :type %>
- <%= f.text_field :type %> -

-

- <%= f.label :name %>
- <%= f.text_field :name %> -

-

- <%= f.label :description %>
- <%= f.text_field :description %> -

-

- <%= f.label :account_balance %>
- <%= f.text_field :account_balance %> -

-

- <%= f.label :account_updated %>
- <%= f.datetime_select :account_updated %> -

-

- <%= f.label :created_on %>
- <%= f.datetime_select :created_on %> -

-

- <%= f.label :role_admin %>
- <%= f.check_box :role_admin %> -

-

- <%= f.label :role_suppliers %>
- <%= f.check_box :role_suppliers %> -

-

- <%= f.label :role_article_meta %>
- <%= f.check_box :role_article_meta %> -

-

- <%= f.label :role_finance %>
- <%= f.check_box :role_finance %> -

-

- <%= f.label :role_orders %>
- <%= f.check_box :role_orders %> -

-

- <%= f.label :weekly_task %>
- <%= f.check_box :weekly_task %> -

-

- <%= f.label :weekday %>
- <%= f.text_field :weekday %> -

-

- <%= f.label :task_name %>
- <%= f.text_field :task_name %> -

-

- <%= f.label :task_description %>
- <%= f.text_field :task_description %> -

-

- <%= f.label :task_required_users %>
- <%= f.text_field :task_required_users %> -

-

- <%= f.label :deleted_at %>
- <%= f.datetime_select :deleted_at %> -

-

- <%= f.label :contact_person %>
- <%= f.text_field :contact_person %> -

-

- <%= f.label :contact_phone %>
- <%= f.text_field :contact_phone %> -

-

- <%= f.label :contact_address %>
- <%= f.text_field :contact_address %> -

-

<%= f.submit "Submit" %>

-<% end %> - - diff --git a/app/views/ordergroups/edit.html.haml b/app/views/ordergroups/edit.html.haml new file mode 100644 index 00000000..e81314a2 --- /dev/null +++ b/app/views/ordergroups/edit.html.haml @@ -0,0 +1,84 @@ +- title "Edit Ordergroup" +- form_for @ordergroup do |f| + = f.error_messages + %p + = f.label :type + %br/ + = f.text_field :type + %p + = f.label :name + %br/ + = f.text_field :name + %p + = f.label :description + %br/ + = f.text_field :description + %p + = f.label :account_balance + %br/ + = f.text_field :account_balance + %p + = f.label :account_updated + %br/ + = f.datetime_select :account_updated + %p + = f.label :created_on + %br/ + = f.datetime_select :created_on + %p + = f.label :role_admin + %br/ + = f.check_box :role_admin + %p + = f.label :role_suppliers + %br/ + = f.check_box :role_suppliers + %p + = f.label :role_article_meta + %br/ + = f.check_box :role_article_meta + %p + = f.label :role_finance + %br/ + = f.check_box :role_finance + %p + = f.label :role_orders + %br/ + = f.check_box :role_orders + %p + = f.label :weekly_task + %br/ + = f.check_box :weekly_task + %p + = f.label :weekday + %br/ + = f.text_field :weekday + %p + = f.label :task_name + %br/ + = f.text_field :task_name + %p + = f.label :task_description + %br/ + = f.text_field :task_description + %p + = f.label :task_required_users + %br/ + = f.text_field :task_required_users + %p + = f.label :deleted_at + %br/ + = f.datetime_select :deleted_at + %p + = f.label :contact_person + %br/ + = f.text_field :contact_person + %p + = f.label :contact_phone + %br/ + = f.text_field :contact_phone + %p + = f.label :contact_address + %br/ + = f.text_field :contact_address + %p= f.submit "Submit" diff --git a/app/views/ordergroups/index.html.erb b/app/views/ordergroups/index.html.erb deleted file mode 100644 index fca03433..00000000 --- a/app/views/ordergroups/index.html.erb +++ /dev/null @@ -1,52 +0,0 @@ -<% title "Ordergroups" %> - - - - - - - - - - - - - - - - - - - - - - - - - <% for ordergroup in @ordergroups %> - - - - - - - - - - - - - - - - - - - - - - - - <% end %> -
TypeNameDescriptionAccount BalanceAccount UpdatedCreated OnRole AdminRole SuppliersRole Article MetaRole FinanceRole OrdersWeekly TaskWeekdayTask NameTask DescriptionTask Required UsersDeleted AtContact PersonContact PhoneContact Address
<%=h ordergroup.type %><%=h ordergroup.name %><%=h ordergroup.description %><%=h ordergroup.account_balance %><%=h ordergroup.account_updated %><%=h ordergroup.created_on %><%=h ordergroup.role_admin %><%=h ordergroup.role_suppliers %><%=h ordergroup.role_article_meta %><%=h ordergroup.role_finance %><%=h ordergroup.role_orders %><%=h ordergroup.weekly_task %><%=h ordergroup.weekday %><%=h ordergroup.task_name %><%=h ordergroup.task_description %><%=h ordergroup.task_required_users %><%=h ordergroup.deleted_at %><%=h ordergroup.contact_person %><%=h ordergroup.contact_phone %><%=h ordergroup.contact_address %><%= link_to "Edit", edit_ordergroup_path(ordergroup) %>
- diff --git a/app/views/ordergroups/index.html.haml b/app/views/ordergroups/index.html.haml new file mode 100644 index 00000000..cb46b0bc --- /dev/null +++ b/app/views/ordergroups/index.html.haml @@ -0,0 +1,46 @@ +- title "Ordergroups" +%table + %tr + %th Type + %th Name + %th Description + %th Account Balance + %th Account Updated + %th Created On + %th Role Admin + %th Role Suppliers + %th Role Article Meta + %th Role Finance + %th Role Orders + %th Weekly Task + %th Weekday + %th Task Name + %th Task Description + %th Task Required Users + %th Deleted At + %th Contact Person + %th Contact Phone + %th Contact Address + - for ordergroup in @ordergroups + %tr + %td= h ordergroup.type + %td= h ordergroup.name + %td= h ordergroup.description + %td= h ordergroup.account_balance + %td= h ordergroup.account_updated + %td= h ordergroup.created_on + %td= h ordergroup.role_admin + %td= h ordergroup.role_suppliers + %td= h ordergroup.role_article_meta + %td= h ordergroup.role_finance + %td= h ordergroup.role_orders + %td= h ordergroup.weekly_task + %td= h ordergroup.weekday + %td= h ordergroup.task_name + %td= h ordergroup.task_description + %td= h ordergroup.task_required_users + %td= h ordergroup.deleted_at + %td= h ordergroup.contact_person + %td= h ordergroup.contact_phone + %td= h ordergroup.contact_address + %td= link_to "Edit", edit_ordergroup_path(ordergroup) diff --git a/app/views/orders/_articles.html.haml b/app/views/orders/_articles.html.haml index 546d088f..87ea4efd 100644 --- a/app/views/orders/_articles.html.haml +++ b/app/views/orders/_articles.html.haml @@ -1,32 +1,36 @@ -%table - %tr - %th Name - %th Gebinde - %th Netto-/Bruttopreis - %th Bestellte Einheiten - - unless order.stockit? - %th Volle Gebinde - - total_net, total_gross, counter = 0, 0, 0 - - order.articles_grouped_by_category.each do |category_name, order_articles| - %tr{:style => "background-color:#EFEFEF"} - %td{:style => "text-align:left; color: grey;"}=h category_name - %td{:colspan => "9"} - - order_articles.each do |order_article| - - net_price = order_article.price.price - - gross_price = order_article.price.gross_price - - units = order_article.units_to_order - - unit_quantity = order_article.price.unit_quantity - - total_net += units * unit_quantity * net_price - - total_gross += units * unit_quantity * gross_price - %tr{:class => cycle('even', 'odd', :name => 'articles'), :style => "color: #{units > 0 ? 'green' : 'red'}"} - %td=h order_article.article.name - %td= "#{unit_quantity} x #{order_article.article.unit}" - %td= "#{number_to_currency(net_price)} / #{number_to_currency(gross_price)}" - - if order.stockit? - %td= units - - else - %td= "#{order_article.quantity} + #{order_article.tolerance}" if unit_quantity > 1 - %td= units +%table.table.table-hover + %thead + %tr + %th Name + %th Gebinde + %th Netto-/Bruttopreis + %th Bestellte Einheiten + - unless order.stockit? + %th Volle Gebinde + - total_net, total_gross, counter = 0, 0, 0 + %tbody + - order.articles_grouped_by_category.each do |category_name, order_articles| + %tr.article-category + %td + = category_name + %i.icon-tag + %td{:colspan => "9"} + - order_articles.each do |order_article| + - net_price = order_article.price.price + - gross_price = order_article.price.gross_price + - units = order_article.units_to_order + - unit_quantity = order_article.price.unit_quantity + - total_net += units * unit_quantity * net_price + - total_gross += units * unit_quantity * gross_price + %tr{:class => cycle('even', 'odd', :name => 'articles'), :style => "color: #{units > 0 ? 'green' : 'red'}"} + %td=h order_article.article.name + %td= "#{unit_quantity} x #{order_article.article.unit}" + %td= "#{number_to_currency(net_price)} / #{number_to_currency(gross_price)}" + - if order.stockit? + %td= units + - else + %td= "#{order_article.quantity} + #{order_article.tolerance}" if unit_quantity > 1 + %td= units %p Summe (Netto/Brutto-Preise): = "#{number_to_currency(total_net)} / #{number_to_currency(total_gross)}" diff --git a/app/views/orders/_orders.html.haml b/app/views/orders/_orders.html.haml index 8cd1611a..8d88af76 100644 --- a/app/views/orders/_orders.html.haml +++ b/app/views/orders/_orders.html.haml @@ -1,5 +1,5 @@ = pagination_links_remote @orders, :params => {:sort => params[:sort]} -%table.list{:style => "width: 100%"} +%table.table.table-striped %thead %tr %th[sort_td_class_helper("supplier")] @@ -11,9 +11,9 @@ %th{:colspan => "2"} %tbody - @orders.each do |order| - %tr{:class => cycle('even', 'odd', :name => 'orders')} - %td=h order.name - %td=h format_time(order.starts) - %td=h format_time(order.ends) - %td= order.state - %td= link_to "Anzeigen", order \ No newline at end of file + %tr + %td= order.name + %td= format_time(order.starts) + %td= format_time(order.ends) + %td= t(order.state, scope: 'orders.state') + %td= link_to "Anzeigen", order, class: 'btn btn-small' \ No newline at end of file diff --git a/app/views/orders/_template_orders_script.html.erb b/app/views/orders/_template_orders_script.html.erb deleted file mode 100644 index da9c2b33..00000000 --- a/app/views/orders/_template_orders_script.html.erb +++ /dev/null @@ -1,20 +0,0 @@ - \ No newline at end of file diff --git a/app/views/orders/_template_orders_script.html.haml b/app/views/orders/_template_orders_script.html.haml new file mode 100644 index 00000000..181b4818 --- /dev/null +++ b/app/views/orders/_template_orders_script.html.haml @@ -0,0 +1,17 @@ +:javascript + // + // Preset selected order articles per template order: + var template = new Array(); + current_article_ids = @order.supplier.articles.available.map(&:id) + i = -1; for order in @template_orders + template[#{i += 1}] = new Array(#{current_article_ids.collect { |id| order.article_ids.include?(id) }.join(', ')}); + // Call with index into template-array to select order articles from template. + function useTemplate(id) { + if (id >= 0 && id < template.length) { + i = -1; for article_id in current_article_ids + var status = template[id][#{i += 1}] + $('checkbox_#{article_id}').checked = status; + highlightRow('#{article_id}',status); + } + } + // diff --git a/app/views/orders/index.haml b/app/views/orders/index.haml deleted file mode 100644 index e24cc2a6..00000000 --- a/app/views/orders/index.haml +++ /dev/null @@ -1,43 +0,0 @@ -- title "Bestellungen verwalten" - -%p - - form_tag do - Neue Bestellung anlegen für - = select_tag :switch_supplier, - options_for_suppliers_to_select, - :style => "font-size: 0.9em;margin-left:1em;", - 'data-redirect-to' => true -%br/ -.left_column{:style => "width:55em"} - .box_title - %h2 Laufende Bestellungen - .column_content - - unless @open_orders.empty? - %table.list - %thead - %tr - %th Lieferantin - %th Ende - %th Notiz - %th{:colspan => "2"} - %tbody - - for order in @open_orders - - tr_class = cycle('even', 'odd', :name => 'open_orders') - - tr_class += " active" if order.expired? - %tr{:class => tr_class} - %td=h order.name - %td=h format_time(order.ends) unless order.ends.nil? - %td=h 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.", :method => :post - %td - = link_to "Anzeigen", order - = link_to icon(:edit), edit_order_path(order) - = link_to icon(:delete), order, :confirm => "Bist Du sicher die Bestellung zu beenden?", :method => :delete - - else - Derzeit gibt es keine laufende Bestellungen. - -.left_column{:style => "width:75em"} - .box_title - %h2 Beendete Bestellungen - .column_content#orders_table - = render :partial => 'orders' \ No newline at end of file diff --git a/app/views/orders/index.html.haml b/app/views/orders/index.html.haml new file mode 100644 index 00000000..fb8118b8 --- /dev/null +++ b/app/views/orders/index.html.haml @@ -0,0 +1,41 @@ +- title "Bestellungen verwalten" + +%p + - form_tag do + Neue Bestellung anlegen für + = select_tag :switch_supplier, + options_for_suppliers_to_select, + style: "font-size: 0.9em;margin-left:1em;", + 'data-redirect-to' => true +.well + %h2 Laufende Bestellungen + - unless @open_orders.empty? + %table.table.table-striped + %thead + %tr + %th Lieferantin + %th Ende + %th Notiz + %th{colspan: "2"} + %tbody + - for order in @open_orders + - tr_class = " active" if order.expired? + %tr{class: tr_class} + %td= order.name + %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.", + method: :post, class: 'btn btn-small btn-success' + + %td + = link_to "Anzeigen", order, class: 'btn btn-small' + = link_to "Bearbeiten", edit_order_path(order), class: 'btn btn-small' + = link_to "Löschen", order, confirm: "Willst Du wirklich die Bestellung löschen?", method: :delete, + class: 'btn btn-small btn-danger' + - else + Derzeit gibt es keine laufende Bestellungen. + +%h2 Beendete Bestellungen +#orders_table + = render partial: 'orders' \ No newline at end of file diff --git a/app/views/orders/index.js.haml b/app/views/orders/index.js.haml new file mode 100644 index 00000000..3fd3db1c --- /dev/null +++ b/app/views/orders/index.js.haml @@ -0,0 +1 @@ +$('#orders_table').html('#{escape_javascript(render('orders'))}'); \ No newline at end of file diff --git a/app/views/orders/show.html.haml b/app/views/orders/show.html.haml index 7b7b546e..8dfdded7 100644 --- a/app/views/orders/show.html.haml +++ b/app/views/orders/show.html.haml @@ -1,80 +1,61 @@ - title "Bestellung: #{@order.name}" +- if @order.finished? and !@order.closed? + .alert.alert-warning Achtung, Bestellung wurde noch nicht abgerechnet. + // Order summary -.left_column{:style => "width:65em"} - .box_title - %h2 Zusammenfassung - .column_content - - if @order.finished? and !@order.closed? - %p - %b{:style => "color:red"} Bestellung wurde noch nicht abgerechnet. - %p - Lieferantin: - %b=h @order.name - - unless @order.note.empty? - %p - Notiz: - =h @order.note - %p - Beginn: - %b=h format_time(@order.starts) - | - Ende: - %b=h format_time(@order.ends) - %p - Gruppenbestellungen: - %b= @order.group_orders.count +.well + %dl.dl-horizontal + %dt Lieferantin + %dd= @order.name + %dt Notiz + %dd= @order.note + %dt Beginn + %dd= format_time(@order.starts) + %dt Ende + %dd= format_time(@order.ends) + %dt Gruppenbestellungen: + %dd + = @order.group_orders.count = "[#{@order.group_orders.includes(:ordergroup).all.collect{|g| g.ordergroup.name}.join(', ')}]" - %p - Netto/Bruttosumme aller Artikel: - %b= "#{number_to_currency(@order.sum(:net))} / #{number_to_currency(@order.sum(:gross))}" - %p - Bestellte Artikel: - %b= @order.order_articles.ordered.count + %dt Netto/Bruttosumme aller Artikel: + %dd= "#{number_to_currency(@order.sum(:net))} / #{number_to_currency(@order.sum(:gross))}" + %dt Bestellte Artikel: + %dd= @order.order_articles.ordered.count - %p - Aktionen: + .form-actions - if @order.open? - = link_to "Bearbeiten", edit_order_path(@order) - | - = link_to 'Beenden!', finish_order_path(@order), :method => :post, :confirm => "Willst Du wirklich die Bestellung beenden?\nEs gibt kein zurück.." - | + = link_to "Bearbeiten", edit_order_path(@order), class: 'btn' + = link_to 'Beenden!', finish_order_path(@order), method: :post, + confirm: "Willst Du wirklich die Bestellung beenden?\nEs gibt kein zurück..", class: 'btn' - unless @order.closed? - = link_to "Löschen", @order, :confirm => "Willst du wirklich die Bestellung löschen?", :method => :delete - - - - unless @order.open? - %p - = update_articles_link(@order, "Artikelübersicht", :normal) - | - = update_articles_link(@order, "Sortiert nach Gruppen", :groups) - = order_pdf(@order, :groups) - | - = update_articles_link(@order, "Sortiert nach Artikeln", :articles) - = order_pdf(@order, :articles) - | - Matrix: - = order_pdf(@order, :matrix) - | - Faxvorlage: - = order_pdf(@order, :fax) - = link_to image_tag("text_file.png", :size => "16x16", :border => "0", :alt => "Textdatei erstellen"), { :action => 'text_fax_template', :id => @order }, { :title => "Download file" } - | - = link_to 'Kommentare', '#comments' - -.single_column{:style => "clear:both; width:70em;"} - .box_title - %h2 Artikel - .column_content#articles - = render :partial => 'articles', :locals => { :order => @order } + = link_to "Löschen", @order, confirm: "Willst du wirklich die Bestellung löschen?", method: :delete, + class: 'btn btn-danger' -.single_column{:style => "width:70em;"} - .box_title - %h2 Kommentare - .column_content - #comments - = render :partial => 'shared/comments', :locals => { :comments => @order.comments } - #new_comment= render :partial => 'order_comments/form', :locals => { :order_comment => @order.comments.build(:user => current_user)} - = link_to_top \ No newline at end of file +- unless @order.open? + %ul.nav.nav-pills + %li.active= update_articles_link(@order, "Artikelübersicht", :default) + %li= update_articles_link(@order, "Sortiert nach Gruppen", :groups) + %li= update_articles_link(@order, "Sortiert nach Artikeln", :articles) + %li= link_to 'Kommentare', '#comments' + %li.dropdown + = link_to '#', class: 'dropdown-toggle', data: {toggle: 'dropdown'} do + Download + %b.caret + %ul.dropdown-menu + %li= order_pdf(@order, :groups, "Gruppenpdf") + %li= order_pdf(@order, :articles, "Artikelpdf") + %li= order_pdf(@order, :matrix, "Matrix") + %li= order_pdf(@order, :fax, "Fax PDF") + %li= link_to "Fax Text", {action: 'text_fax_template', id: @order }, {title: "Download file"} + +%section#articles_table + = render 'articles', order: @order + +%h2 Kommentare +#comments + = render partial: 'shared/comments', locals: { comments: @order.comments } +#new_comment= render partial: 'order_comments/form', locals: { order_comment: @order.comments.build(user: current_user)} += link_to_top \ No newline at end of file diff --git a/app/views/orders/show.js.erb b/app/views/orders/show.js.erb deleted file mode 100644 index 4ed51162..00000000 --- a/app/views/orders/show.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#articles').html('<%= escape_javascript(render(:partial => @partial, :locals => {:order => @order})) %>'); \ No newline at end of file diff --git a/app/views/orders/show.js.haml b/app/views/orders/show.js.haml new file mode 100644 index 00000000..da1e0a4a --- /dev/null +++ b/app/views/orders/show.js.haml @@ -0,0 +1,2 @@ +$('#articles_table').html('#{escape_javascript(render(@partial, order: @order))}'); + diff --git a/app/views/shared/_articles_by_articles.html.haml b/app/views/shared/_articles_by_articles.html.haml index 340a1d2b..18f4c8d1 100644 --- a/app/views/shared/_articles_by_articles.html.haml +++ b/app/views/shared/_articles_by_articles.html.haml @@ -1,15 +1,12 @@ -.legend - %table.legend{:style => "margin-bottom:1em"} - %tr - %th{:colspan => '3'} Legende +%table.table.table-hover + %thead %tr %th{:style => 'width:70%'} Bestellgruppe %th Bestellt (Menge + Toleranz) %th Bekommen %th Gesamtpreis -- for order_article in order.order_articles.ordered.all(:include => [:article, :article_price]) - %table{:style => "margin-bottom:1em"} + - for order_article in order.order_articles.ordered.all(:include => [:article, :article_price]) %thead %tr %th{:colspan => "4"} @@ -23,4 +20,6 @@ %td %b= goa.result %td= number_to_currency(order_article.price.fc_price * goa.result) + %tr + %td(colspan="4" ) - reset_cycle('groups') \ No newline at end of file diff --git a/app/views/shared/_articles_by_groups.html.haml b/app/views/shared/_articles_by_groups.html.haml index 486973e6..15607a4a 100644 --- a/app/views/shared/_articles_by_groups.html.haml +++ b/app/views/shared/_articles_by_groups.html.haml @@ -1,5 +1,5 @@ -.legend - %table.legend{:style => "margin-bottom:1em"} +%table.table.table-hover + %thead %tr %th{:style => "width:40%"} Name %th @@ -11,11 +11,11 @@ %th Einheit %th Gesamtpreis -- for group_order in order.group_orders.all - %table{:style => "margin-bottom:1em"} + - for group_order in order.group_orders.all %thead %tr - %th{:colspan => "6"}=h group_order.ordergroup.name + %th{:colspan => "6"} + %h4= group_order.ordergroup.name %tbody - total = 0 - for goa in group_order.group_order_articles.ordered.all(:include => :order_article) @@ -33,4 +33,6 @@ %tr{:class => cycle('even', 'odd', :name => 'articles')} %th{:colspan => "5"} Summe %th= number_to_currency(total) + %tr + %th(colspan="6") - reset_cycle("articles") \ No newline at end of file diff --git a/app/views/shared/_comments.haml b/app/views/shared/_comments.haml index 7fdea92d..27da9138 100644 --- a/app/views/shared/_comments.haml +++ b/app/views/shared/_comments.haml @@ -1,9 +1,5 @@ -- unless comments.empty? - - comments.each do |comment| - .comment[comment] - .timestamp - %b=h "#{comment.user.try(:ordergroup_name)}" - = "(#{comment.user.try(:nick)} am #{format_time(comment.created_at)}):" - = simple_format(comment.text) -- else - es gibt derzeit keine Kommentare. \ No newline at end of file +- comments.each do |comment| + .comment[comment] + %strong= comment.user.try(:ordergroup_name) + %small (#{comment.user.try(:nick)} am #{format_time(comment.created_at)}): + = simple_format(comment.text) diff --git a/app/views/shared/_group.html.haml b/app/views/shared/_group.html.haml index 1e4947fd..2f65403a 100644 --- a/app/views/shared/_group.html.haml +++ b/app/views/shared/_group.html.haml @@ -1,4 +1,4 @@ -%dl.dl-horizontal +%dl %dt Beschreibung: %dd=h group.description - if group.is_a?(Ordergroup) and (@current_user.role_admin? or @current_user.role_finance?) @@ -22,4 +22,4 @@ kein wöchentlicher Job definiert - else %dt Äpfel-Bestellbeschränkung - %dd= group.ignore_apple_restriction ? 'deaktiviert' : 'aktiviert' + %dd= group.ignore_apple_restriction ? 'deaktiviert' : 'aktiviert' \ No newline at end of file diff --git a/app/views/shared/_open_orders.html.haml b/app/views/shared/_open_orders.html.haml index 9d9712d0..ae07971b 100644 --- a/app/views/shared/_open_orders.html.haml +++ b/app/views/shared/_open_orders.html.haml @@ -15,11 +15,11 @@ - Order.open.each do |order| %tr %td= link_to_ordering(order) - %td=h format_time(order.ends) unless order.ends.nil? + %td= format_time(order.ends) unless order.ends.nil? - if group_order = order.group_order(ordergroup) - total += group_order.price %td= "#{group_order.updated_by.nick} (#{format_time(group_order.updated_on)})" - %td= number_to_currency(group_order.price) + %td.numeric= number_to_currency(group_order.price) - else %td{:colspan => 2} - if total > 0 @@ -27,6 +27,6 @@ %tr %th(colspan="2") %th Gesamtsumme: - %th= number_to_currency(total) + %th.numeric= number_to_currency(total) - else %i Derzeit gibt es keine laufenden Bestellungen \ No newline at end of file diff --git a/app/views/tasks/_list.haml b/app/views/tasks/_list.haml index 3ff943b5..c0f7f867 100644 --- a/app/views/tasks/_list.haml +++ b/app/views/tasks/_list.haml @@ -17,10 +17,10 @@ = highlighted_required_users task %td - if !task.is_accepted?(current_user) - = link_to "Aufgabe übernehmen", accept_task_path(task), method: :post, class: 'btn' - = link_to "Aufgabe ablehnen", reject_task_path(task), method: :post, class: 'btn' if task.is_assigned?(current_user) + = link_to "Aufgabe übernehmen", accept_task_path(task), method: :post, class: 'btn btn-small' + = link_to "Aufgabe ablehnen", reject_task_path(task), method: :post, class: 'btn btn-small' if task.is_assigned?(current_user) - elsif !task.done - = link_to set_done_task_path(task), method: :post, class: 'btn', + = link_to set_done_task_path(task), method: :post, class: 'btn btn-small', title: 'Aufgabe als erledigt markieren' do %i.icon-ok Erledigt? diff --git a/app/views/tasks/archive.js.erb b/app/views/tasks/archive.js.erb deleted file mode 100644 index 0ce64049..00000000 --- a/app/views/tasks/archive.js.erb +++ /dev/null @@ -1 +0,0 @@ -$('#tasks').html('<%= escape_javascript(render("archive_tasks")) %>'); \ No newline at end of file diff --git a/app/views/tasks/archive.js.haml b/app/views/tasks/archive.js.haml new file mode 100644 index 00000000..ff02f99f --- /dev/null +++ b/app/views/tasks/archive.js.haml @@ -0,0 +1 @@ +$('#tasks').html('#{escape_javascript(render("archive_tasks"))}'); diff --git a/app/views/workgroups/edit.html.erb b/app/views/workgroups/edit.html.erb deleted file mode 100644 index 59c4d480..00000000 --- a/app/views/workgroups/edit.html.erb +++ /dev/null @@ -1,88 +0,0 @@ -<% title "Edit Workgroup" %> - -<% form_for @workgroup do |f| %> - <%= f.error_messages %> -

- <%= f.label :type %>
- <%= f.text_field :type %> -

-

- <%= f.label :name %>
- <%= f.text_field :name %> -

-

- <%= f.label :description %>
- <%= f.text_field :description %> -

-

- <%= f.label :account_balance %>
- <%= f.text_field :account_balance %> -

-

- <%= f.label :account_updated %>
- <%= f.datetime_select :account_updated %> -

-

- <%= f.label :created_on %>
- <%= f.datetime_select :created_on %> -

-

- <%= f.label :role_admin %>
- <%= f.check_box :role_admin %> -

-

- <%= f.label :role_suppliers %>
- <%= f.check_box :role_suppliers %> -

-

- <%= f.label :role_article_meta %>
- <%= f.check_box :role_article_meta %> -

-

- <%= f.label :role_finance %>
- <%= f.check_box :role_finance %> -

-

- <%= f.label :role_orders %>
- <%= f.check_box :role_orders %> -

-

- <%= f.label :weekly_task %>
- <%= f.check_box :weekly_task %> -

-

- <%= f.label :weekday %>
- <%= f.text_field :weekday %> -

-

- <%= f.label :task_name %>
- <%= f.text_field :task_name %> -

-

- <%= f.label :task_description %>
- <%= f.text_field :task_description %> -

-

- <%= f.label :task_required_users %>
- <%= f.text_field :task_required_users %> -

-

- <%= f.label :deleted_at %>
- <%= f.datetime_select :deleted_at %> -

-

- <%= f.label :contact_person %>
- <%= f.text_field :contact_person %> -

-

- <%= f.label :contact_phone %>
- <%= f.text_field :contact_phone %> -

-

- <%= f.label :contact_address %>
- <%= f.text_field :contact_address %> -

-

<%= f.submit "Submit" %>

-<% end %> - - diff --git a/app/views/workgroups/edit.html.haml b/app/views/workgroups/edit.html.haml new file mode 100644 index 00000000..bdb2655c --- /dev/null +++ b/app/views/workgroups/edit.html.haml @@ -0,0 +1,84 @@ +- title "Edit Workgroup" +- form_for @workgroup do |f| + = f.error_messages + %p + = f.label :type + %br/ + = f.text_field :type + %p + = f.label :name + %br/ + = f.text_field :name + %p + = f.label :description + %br/ + = f.text_field :description + %p + = f.label :account_balance + %br/ + = f.text_field :account_balance + %p + = f.label :account_updated + %br/ + = f.datetime_select :account_updated + %p + = f.label :created_on + %br/ + = f.datetime_select :created_on + %p + = f.label :role_admin + %br/ + = f.check_box :role_admin + %p + = f.label :role_suppliers + %br/ + = f.check_box :role_suppliers + %p + = f.label :role_article_meta + %br/ + = f.check_box :role_article_meta + %p + = f.label :role_finance + %br/ + = f.check_box :role_finance + %p + = f.label :role_orders + %br/ + = f.check_box :role_orders + %p + = f.label :weekly_task + %br/ + = f.check_box :weekly_task + %p + = f.label :weekday + %br/ + = f.text_field :weekday + %p + = f.label :task_name + %br/ + = f.text_field :task_name + %p + = f.label :task_description + %br/ + = f.text_field :task_description + %p + = f.label :task_required_users + %br/ + = f.text_field :task_required_users + %p + = f.label :deleted_at + %br/ + = f.datetime_select :deleted_at + %p + = f.label :contact_person + %br/ + = f.text_field :contact_person + %p + = f.label :contact_phone + %br/ + = f.text_field :contact_phone + %p + = f.label :contact_address + %br/ + = f.text_field :contact_address + %p= f.submit "Submit" diff --git a/app/views/workgroups/index.html.erb b/app/views/workgroups/index.html.erb deleted file mode 100644 index 1025a124..00000000 --- a/app/views/workgroups/index.html.erb +++ /dev/null @@ -1,52 +0,0 @@ -<% title "Workgroups" %> - - - - - - - - - - - - - - - - - - - - - - - - - <% for workgroup in @workgroups %> - - - - - - - - - - - - - - - - - - - - - - - - <% end %> -
TypeNameDescriptionAccount BalanceAccount UpdatedCreated OnRole AdminRole SuppliersRole Article MetaRole FinanceRole OrdersWeekly TaskWeekdayTask NameTask DescriptionTask Required UsersDeleted AtContact PersonContact PhoneContact Address
<%=h workgroup.type %><%=h workgroup.name %><%=h workgroup.description %><%=h workgroup.account_balance %><%=h workgroup.account_updated %><%=h workgroup.created_on %><%=h workgroup.role_admin %><%=h workgroup.role_suppliers %><%=h workgroup.role_article_meta %><%=h workgroup.role_finance %><%=h workgroup.role_orders %><%=h workgroup.weekly_task %><%=h workgroup.weekday %><%=h workgroup.task_name %><%=h workgroup.task_description %><%=h workgroup.task_required_users %><%=h workgroup.deleted_at %><%=h workgroup.contact_person %><%=h workgroup.contact_phone %><%=h workgroup.contact_address %><%= link_to "Edit", edit_workgroup_path(workgroup) %>
- diff --git a/app/views/workgroups/index.html.haml b/app/views/workgroups/index.html.haml new file mode 100644 index 00000000..67c3793f --- /dev/null +++ b/app/views/workgroups/index.html.haml @@ -0,0 +1,46 @@ +- title "Workgroups" +%table + %tr + %th Type + %th Name + %th Description + %th Account Balance + %th Account Updated + %th Created On + %th Role Admin + %th Role Suppliers + %th Role Article Meta + %th Role Finance + %th Role Orders + %th Weekly Task + %th Weekday + %th Task Name + %th Task Description + %th Task Required Users + %th Deleted At + %th Contact Person + %th Contact Phone + %th Contact Address + - for workgroup in @workgroups + %tr + %td= h workgroup.type + %td= h workgroup.name + %td= h workgroup.description + %td= h workgroup.account_balance + %td= h workgroup.account_updated + %td= h workgroup.created_on + %td= h workgroup.role_admin + %td= h workgroup.role_suppliers + %td= h workgroup.role_article_meta + %td= h workgroup.role_finance + %td= h workgroup.role_orders + %td= h workgroup.weekly_task + %td= h workgroup.weekday + %td= h workgroup.task_name + %td= h workgroup.task_description + %td= h workgroup.task_required_users + %td= h workgroup.deleted_at + %td= h workgroup.contact_person + %td= h workgroup.contact_phone + %td= h workgroup.contact_address + %td= link_to "Edit", edit_workgroup_path(workgroup) diff --git a/config/locales/de.yml b/config/locales/de.yml index 8cc3b4e5..cd9d7df8 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,6 +1,10 @@ de: - groups: - + orders: + state: + open: laufend + finished: beendet + closed: abgerechnet + home: index: title: Startseite @@ -142,13 +146,6 @@ de: header: one: ! 'Konnte %{model} nicht speichern: ein Fehler.' other: ! 'Konnte %{model} nicht speichern: %{count} Fehler.' - helpers: - select: - prompt: Bitte wählen - submit: - create: ! '%{model} erstellen' - submit: ! '%{model} speichern' - update: ! '%{model} aktualisieren' number: currency: format: @@ -255,11 +252,15 @@ de: note: Notiz helpers: + select: + prompt: Bitte wählen submit: create: "%{model} speichern" update: "Änderungen speichern" message: create: 'Nachricht verschicken' + invite: + create: Einladung verschicken # Simple form i18n is used to build the forms simple_form: @@ -268,22 +269,8 @@ de: required: text: 'benötigt' mark: '*' - # You can uncomment the line below if you need to overwrite the whole required html. - # When using html, text and mark won't be used. - # html: '*' error_notification: default_message: "Fehler wurden gefunden. Bitte das Formular überprüfen." - # Labels and hints examples - # labels: - # password: 'Password' - # user: - # new: - # email: 'E-mail para efetuar o sign in.' - # edit: - # email: 'E-mail.' - # hints: - # username: 'User name to sign in.' - # password: 'No special characters, please.' labels: defaults: password: 'Passwort' @@ -368,7 +355,7 @@ de: nick: "Benutzername" last_name: "Nachname" order_comment: - text: 'Kommentar' + text: Kommentiere diese Bestellung ... order: starts: "Läuft vom" ends: "Endet am" @@ -385,6 +372,7 @@ de: deposit: Pfand berechnet deposit_credit: Pfand gutgeschrieben + hints: tax: 'In Prozent, Standard sind 7,0' task: diff --git a/config/navigation.rb b/config/navigation.rb index 0011b6dc..3b098dd3 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -38,6 +38,7 @@ SimpleNavigation::Configuration.run do |navigation| end primary.item :admin, 'Administration', '#', if: Proc.new { current_user.role_admin? } do |subnav| + subnav.item :admin_home, 'Übersicht', admin_root_path subnav.item :users, 'Benutzerinnen', admin_users_path, id: nil subnav.item :ordergroups, 'Bestellgruppen', admin_ordergroups_path, id: nil subnav.item :workgroups, 'Arbeitsgruppen', admin_workgroups_path, id: nil diff --git a/script/about b/script/about deleted file mode 100755 index 7b07d46a..00000000 --- a/script/about +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/about' \ No newline at end of file diff --git a/script/breakpointer b/script/breakpointer deleted file mode 100755 index 64af76ed..00000000 --- a/script/breakpointer +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/breakpointer' \ No newline at end of file diff --git a/script/console b/script/console deleted file mode 100755 index 42f28f7d..00000000 --- a/script/console +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/console' \ No newline at end of file diff --git a/script/dbconsole b/script/dbconsole deleted file mode 100755 index caa60ce8..00000000 --- a/script/dbconsole +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/dbconsole' diff --git a/script/delayed_job b/script/delayed_job deleted file mode 100755 index edf19598..00000000 --- a/script/delayed_job +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env ruby - -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) -require 'delayed/command' -Delayed::Command.new(ARGV).daemonize diff --git a/script/destroy b/script/destroy deleted file mode 100755 index fa0e6fcd..00000000 --- a/script/destroy +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/destroy' \ No newline at end of file diff --git a/script/generate b/script/generate deleted file mode 100755 index ef976e09..00000000 --- a/script/generate +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/generate' \ No newline at end of file diff --git a/script/performance/benchmarker b/script/performance/benchmarker deleted file mode 100755 index c842d35d..00000000 --- a/script/performance/benchmarker +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/performance/benchmarker' diff --git a/script/performance/profiler b/script/performance/profiler deleted file mode 100755 index d855ac8b..00000000 --- a/script/performance/profiler +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/performance/profiler' diff --git a/script/performance/request b/script/performance/request deleted file mode 100755 index ae3f38c7..00000000 --- a/script/performance/request +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/performance/request' diff --git a/script/plugin b/script/plugin deleted file mode 100755 index 26ca64c0..00000000 --- a/script/plugin +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/plugin' \ No newline at end of file diff --git a/script/process/inspector b/script/process/inspector deleted file mode 100755 index bf25ad86..00000000 --- a/script/process/inspector +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/process/inspector' diff --git a/script/process/reaper b/script/process/reaper deleted file mode 100755 index c77f0453..00000000 --- a/script/process/reaper +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/process/reaper' diff --git a/script/process/spawner b/script/process/spawner deleted file mode 100755 index 7118f398..00000000 --- a/script/process/spawner +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../../config/boot' -require 'commands/process/spawner' diff --git a/script/runner b/script/runner deleted file mode 100755 index ccc30f9d..00000000 --- a/script/runner +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/runner' \ No newline at end of file diff --git a/script/server b/script/server deleted file mode 100755 index dfabcb88..00000000 --- a/script/server +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.dirname(__FILE__) + '/../config/boot' -require 'commands/server' \ No newline at end of file