├── VERSION
├── lib
├── tasks
│ ├── .gitkeep
│ └── rspec.rake
├── api
│ └── errors.rb
└── templates
│ └── haml
│ └── scaffold
│ └── _form.html.haml
├── public
├── favicon.ico
├── apple-touch-icon.png
├── apple-touch-icon-57x57.png
├── apple-touch-icon-72x72.png
├── apple-touch-icon-76x76.png
├── apple-touch-icon-114x114.png
├── apple-touch-icon-120x120.png
├── apple-touch-icon-144x144.png
├── apple-touch-icon-152x152.png
├── apple-touch-icon-180x180.png
├── robots.txt
└── 503.html
├── .ruby-version
├── tmp
└── .gitignore
├── vendor
├── javascript
│ └── .keep
└── assets
│ └── fonts
│ ├── OpenSans-Bold.ttf
│ ├── OpenSans-Italic.ttf
│ ├── OpenSans-Regular.ttf
│ └── OpenSans-BoldItalic.ttf
├── app
├── assets
│ ├── stylesheets
│ │ ├── .gitkeep
│ │ ├── list.unlist.css
│ │ ├── ie_hacks.css
│ │ ├── list.missing.css
│ │ └── application.scss
│ ├── images
│ │ ├── error.png
│ │ ├── euro.png
│ │ ├── rails.png
│ │ ├── b_drop.png
│ │ ├── b_edit.png
│ │ ├── b_user.png
│ │ ├── b_users.png
│ │ ├── loader.gif
│ │ ├── package.png
│ │ ├── b_browse.png
│ │ ├── dots-white.gif
│ │ ├── euro_new.png
│ │ ├── lamp_grey.png
│ │ ├── lamp_red.png
│ │ ├── package-bg.png
│ │ ├── role-admin.png
│ │ ├── save_pdf.png
│ │ ├── text_file.png
│ │ ├── icon_message.gif
│ │ ├── role-finance.png
│ │ ├── role-orders.png
│ │ ├── role-pickups.png
│ │ ├── redbox_spinner.gif
│ │ ├── role-invoices.png
│ │ ├── role-suppliers.png
│ │ └── role-article_meta.png
│ └── javascripts
│ │ └── bootstrap.js
├── views
│ ├── articles
│ │ ├── edit.html.haml
│ │ ├── index.js.haml
│ │ ├── copy.js.haml
│ │ ├── new.js.haml
│ │ ├── update.js.haml
│ │ ├── _destroy_active_article.html.haml
│ │ ├── sync.html.haml
│ │ ├── prepare_units_migration.haml
│ │ ├── destroy.js.haml
│ │ ├── create.js.haml
│ │ ├── parse_upload.html.haml
│ │ └── edit_all.html.haml
│ ├── group_orders
│ │ ├── edit.html.haml
│ │ ├── new.html.haml
│ │ ├── archive.js.haml
│ │ ├── _switch_order.html.haml
│ │ └── archive.html.haml
│ ├── invites
│ │ ├── create.js.haml
│ │ ├── new.js.haml
│ │ └── new.html.haml
│ ├── admin
│ │ ├── users
│ │ │ ├── new.html.haml
│ │ │ ├── edit.html.haml
│ │ │ └── index.js.haml
│ │ ├── workgroups
│ │ │ ├── new.html.haml
│ │ │ ├── edit.html.haml
│ │ │ ├── index.js.haml
│ │ │ └── show.html.haml
│ │ ├── ordergroups
│ │ │ ├── edit.html.haml
│ │ │ ├── new.html.haml
│ │ │ ├── index.js.haml
│ │ │ └── show.html.haml
│ │ ├── bank_accounts
│ │ │ └── new.js.haml
│ │ ├── bank_gateways
│ │ │ └── new.js.haml
│ │ ├── supplier_categories
│ │ │ └── new.js.haml
│ │ ├── mail_delivery_status
│ │ │ ├── index.js.haml
│ │ │ └── index.html.haml
│ │ ├── financial_transaction_classes
│ │ │ └── new.js.haml
│ │ ├── financial_transaction_types
│ │ │ └── new.js.haml
│ │ ├── finances
│ │ │ ├── update_bank_accounts.js.haml
│ │ │ ├── update_bank_gateways.js.haml
│ │ │ ├── update_transaction_types.js.haml
│ │ │ ├── update_supplier_categories.js.haml
│ │ │ └── _form.html.haml
│ │ └── configs
│ │ │ ├── list.html.haml
│ │ │ ├── _tab_security.html.haml
│ │ │ ├── _tab_messages.html.haml
│ │ │ └── show.html.haml
│ ├── suppliers
│ │ ├── edit.html.haml
│ │ └── new.html.haml
│ ├── shared
│ │ ├── alert.js.erb
│ │ ├── _base_errors.haml
│ │ ├── _alert_success.haml
│ │ ├── _comments.haml
│ │ └── _custom_form_fields.html.haml
│ ├── article_categories
│ │ ├── edit.html.haml
│ │ ├── new.html.haml
│ │ └── _form.html.haml
│ ├── finance
│ │ ├── balancing
│ │ │ ├── index.js.haml
│ │ │ ├── update_summary.js.haml
│ │ │ ├── edit_note.js.haml
│ │ │ ├── update_note.js.haml
│ │ │ ├── edit_transport.js.haml
│ │ │ ├── new.js.haml
│ │ │ ├── index.html.haml
│ │ │ ├── _order_article_result.html.haml
│ │ │ └── _edit_note.html.haml
│ │ ├── invoices
│ │ │ ├── index.js.haml
│ │ │ ├── delete_attachment.js.erb
│ │ │ ├── new.html.haml
│ │ │ ├── edit.html.haml
│ │ │ ├── index.html.haml
│ │ │ └── _form_js.html.haml
│ │ ├── bank_transactions
│ │ │ └── index.js.haml
│ │ ├── ordergroups
│ │ │ └── index.js.haml
│ │ ├── bank_accounts
│ │ │ ├── import.html.haml
│ │ │ └── import.js.haml
│ │ ├── financial_links
│ │ │ ├── index_invoice.js.haml
│ │ │ ├── index_bank_transaction.js.haml
│ │ │ ├── new_financial_transaction.js.haml
│ │ │ ├── index_financial_transaction.js.haml
│ │ │ └── incomplete.html.haml
│ │ └── financial_transactions
│ │ │ ├── index.js.erb
│ │ │ ├── index_collection.js.erb
│ │ │ ├── index_collection.html.haml
│ │ │ ├── _ordergroup.haml
│ │ │ └── _order_note.html.haml
│ ├── deliveries
│ │ ├── edit.html.haml
│ │ ├── new.html.haml
│ │ └── _stock_change.html.haml
│ ├── foodcoop
│ │ ├── users
│ │ │ └── index.js.haml
│ │ ├── ordergroups
│ │ │ └── index.js.haml
│ │ └── workgroups
│ │ │ ├── index.html.haml
│ │ │ ├── _workgroup.html.haml
│ │ │ └── edit.html.haml
│ ├── tasks
│ │ ├── archive.js.haml
│ │ ├── _form_sidebar.html.haml
│ │ ├── archive.haml
│ │ ├── workgroup.haml
│ │ ├── new.haml
│ │ ├── user.html.haml
│ │ ├── index.haml
│ │ ├── _archive_tasks.html.haml
│ │ └── edit.haml
│ ├── article_units
│ │ ├── search.js.haml
│ │ ├── _create_link.html.haml
│ │ ├── _destroy_link.html.haml
│ │ ├── create.js.haml
│ │ └── destroy.js.haml
│ ├── orders
│ │ ├── index.js.erb
│ │ ├── edit.html.haml
│ │ ├── new.html.haml
│ │ └── receive_on_order_article_update.js.erb
│ ├── layouts
│ │ ├── action_text
│ │ │ └── contents
│ │ │ │ └── _content.html.erb
│ │ ├── email.text.haml
│ │ ├── email.html.haml
│ │ └── login.html.haml
│ ├── stock_takings
│ │ ├── index.js.haml
│ │ ├── edit.html.haml
│ │ ├── index.html.haml
│ │ └── new_on_stock_article_create.js.erb
│ ├── home
│ │ ├── ordergroup.js.haml
│ │ └── _apple_bar.html.haml
│ ├── mailer
│ │ ├── order_result_supplier.text.haml
│ │ ├── reset_password.text.haml
│ │ ├── welcome.text.haml
│ │ ├── not_enough_users_assigned.text.haml
│ │ ├── negative_balance.text.haml
│ │ ├── upcoming_tasks.text.haml
│ │ └── invite.text.haml
│ ├── order_articles
│ │ ├── new.js.haml
│ │ ├── destroy.js.haml
│ │ ├── edit.js.haml
│ │ ├── create.js.erb
│ │ └── update.js.erb
│ ├── group_order_articles
│ │ ├── new.js.erb
│ │ ├── update.js.erb
│ │ └── create.js.erb
│ ├── errors
│ │ ├── not_found.html.haml
│ │ ├── internal_server_error.html.haml
│ │ └── _error.html.haml
│ ├── order_comments
│ │ ├── new.js.haml
│ │ ├── create.js.haml
│ │ └── _form.html.haml
│ ├── supplier_shares
│ │ ├── update.js.haml
│ │ └── _share_link.html.haml
│ ├── stockit
│ │ ├── copy.js.erb
│ │ ├── derive.js.erb
│ │ ├── edit.js.erb
│ │ ├── new.js.erb
│ │ ├── _destroy_fail.js.haml
│ │ ├── destroy.js.erb
│ │ ├── create.js.erb
│ │ ├── update.js.erb
│ │ ├── index_on_stock_article_create.js.erb
│ │ ├── show_on_stock_article_update.js.erb
│ │ └── index_on_stock_article_update.js.erb
│ ├── login
│ │ ├── forgot_password.html.haml
│ │ ├── new_password.html.haml
│ │ └── accept_invitation.html.haml
│ ├── kaminari
│ │ ├── _gap.html.haml
│ │ ├── _first_page.html.haml
│ │ ├── _next_page.html.haml
│ │ ├── _prev_page.html.haml
│ │ └── _page.html.haml
│ └── active_storage
│ │ └── blobs
│ │ └── _blob.html.haml
├── helpers
│ ├── home_helper.rb
│ ├── users_helper.rb
│ ├── foodcoop_helper.rb
│ ├── sessions_helper.rb
│ ├── stock_takings_helper.rb
│ ├── order_comments_helper.rb
│ ├── article_categories_helper.rb
│ ├── finance
│ │ ├── ordergroups_helper.rb
│ │ ├── invoices_helper.rb
│ │ └── balancing_helper.rb
│ ├── order_articles_helper.rb
│ ├── path_helper.rb
│ ├── admin
│ │ └── ordergroups_helper.rb
│ ├── shared_helper.rb
│ └── suppliers_helper.rb
├── jobs
│ ├── application_job.rb
│ ├── notify_negative_balance_job.rb
│ ├── notify_finished_order_job.rb
│ └── notify_received_order_job.rb
├── models
│ ├── application_record.rb
│ ├── assignment.rb
│ ├── mail_delivery_status.rb
│ ├── stock_event.rb
│ ├── order_comment.rb
│ ├── stock_taking.rb
│ ├── article_unit_ratio.rb
│ ├── bank_gateway.rb
│ ├── group_order_article_quantity.rb
│ ├── concerns
│ │ └── custom_fields.rb
│ └── membership.rb
├── serializers
│ ├── article_unit_serializer.rb
│ ├── user_serializer.rb
│ ├── article_category_serializer.rb
│ ├── financial_transaction_class_serializer.rb
│ ├── stock_article_serializer.rb
│ ├── group_order_article_serializer.rb
│ ├── order_serializer.rb
│ ├── order_article_serializer.rb
│ ├── article_serializer.rb
│ └── financial_transaction_serializer.rb
├── javascript
│ ├── application.js
│ └── trix-editor-overrides.js
├── controllers
│ ├── api
│ │ └── v1
│ │ │ ├── user
│ │ │ └── users_controller.rb
│ │ │ ├── configs_controller.rb
│ │ │ ├── orders_controller.rb
│ │ │ ├── article_categories_controller.rb
│ │ │ └── financial_transaction_classes_controller.rb
│ ├── admin
│ │ └── base_controller.rb
│ ├── users_controller.rb
│ ├── order_comments_controller.rb
│ ├── finance
│ │ └── base_controller.rb
│ ├── supplier_shares_controller.rb
│ ├── errors_controller.rb
│ └── concerns
│ │ └── send_order_pdf.rb
└── inputs
│ └── date_picker_input.rb
├── plugins
├── discourse
│ ├── config
│ │ ├── locales
│ │ │ ├── fr.yml
│ │ │ ├── en.yml
│ │ │ ├── es.yml
│ │ │ ├── tr.yml
│ │ │ ├── de.yml
│ │ │ └── nl.yml
│ │ └── routes.rb
│ ├── lib
│ │ ├── foodsoft_discourse
│ │ │ ├── version.rb
│ │ │ └── engine.rb
│ │ └── foodsoft_discourse.rb
│ └── app
│ │ └── overrides
│ │ └── sessions
│ │ └── new
│ │ └── insert_link.html.haml.deface
├── links
│ ├── lib
│ │ ├── foodsoft_links.rb
│ │ └── foodsoft_links
│ │ │ └── version.rb
│ ├── app
│ │ ├── views
│ │ │ └── admin
│ │ │ │ └── links
│ │ │ │ ├── edit.js.haml
│ │ │ │ ├── update_links.js.haml
│ │ │ │ └── index.html.haml
│ │ └── models
│ │ │ └── link.rb
│ ├── config
│ │ └── routes.rb
│ └── db
│ │ └── migrate
│ │ └── 20181203000000_create_links.rb
├── polls
│ ├── app
│ │ ├── views
│ │ │ └── polls
│ │ │ │ ├── edit.html.haml
│ │ │ │ ├── new.html.haml
│ │ │ │ ├── index.js.haml
│ │ │ │ ├── index.html.haml
│ │ │ │ └── _choice.haml
│ │ ├── models
│ │ │ ├── poll_choice.rb
│ │ │ └── poll_vote.rb
│ │ └── overrides
│ │ │ └── admin
│ │ │ └── configs
│ │ │ └── _tab_others
│ │ │ └── add_polls_config.html.haml.deface
│ ├── lib
│ │ ├── foodsoft_polls
│ │ │ └── version.rb
│ │ └── foodsoft_polls.rb
│ ├── db
│ │ └── migrate
│ │ │ └── 20181120000000_increase_choices_size.rb
│ └── config
│ │ └── routes.rb
├── wiki
│ ├── app
│ │ ├── views
│ │ │ └── pages
│ │ │ │ ├── edit.html.haml
│ │ │ │ ├── new.html.haml
│ │ │ │ ├── diff.html.haml
│ │ │ │ ├── _body.html.haml
│ │ │ │ ├── variables.html.haml
│ │ │ │ ├── _title_list.html.haml
│ │ │ │ ├── _page_list_item.html.haml
│ │ │ │ ├── _site_map.html.haml
│ │ │ │ └── version.html.haml
│ │ ├── assets
│ │ │ └── images
│ │ │ │ └── icons
│ │ │ │ ├── feed-icon-14x14.png
│ │ │ │ └── feed-icon-28x28.png
│ │ └── overrides
│ │ │ ├── admin
│ │ │ └── configs
│ │ │ │ └── _tab_others
│ │ │ │ └── add_wiki_config.html.haml.deface
│ │ │ ├── sessions
│ │ │ └── new
│ │ │ │ └── public_frontpage.html.haml.deface
│ │ │ └── home
│ │ │ └── index
│ │ │ └── dashboard.html.haml.deface
│ ├── lib
│ │ ├── foodsoft_wiki
│ │ │ └── version.rb
│ │ └── foodsoft_wiki.rb
│ └── config
│ │ └── routes.rb
├── b85
│ ├── lib
│ │ ├── foodsoft_b85
│ │ │ ├── version.rb
│ │ │ └── engine.rb
│ │ └── foodsoft_b85.rb
│ └── doc
│ │ ├── Biofakt B85 BNN-3.0_Bestellungen.pdf
│ │ └── Bestellung_Lieferavis_Schnittstelle_2025.pdf
├── mollie
│ ├── lib
│ │ └── foodsoft_mollie
│ │ │ ├── version.rb
│ │ │ └── engine.rb
│ ├── app
│ │ ├── views
│ │ │ └── payments
│ │ │ │ └── mollie
│ │ │ │ └── new.html.haml
│ │ └── overrides
│ │ │ └── home
│ │ │ ├── ordergroup
│ │ │ └── new_payment_button.html.haml.deface
│ │ │ └── index
│ │ │ └── new_payment_link.html.haml.deface
│ ├── .gitignore
│ ├── Gemfile
│ ├── config
│ │ └── routes.rb
│ └── script
│ │ └── rails
├── printer
│ ├── app
│ │ ├── views
│ │ │ └── printer_jobs
│ │ │ │ └── index.js.haml
│ │ ├── models
│ │ │ └── printer_job_update.rb
│ │ └── overrides
│ │ │ ├── orders
│ │ │ └── show
│ │ │ │ └── add_print_button.html.haml.deface
│ │ │ └── admin
│ │ │ └── configs
│ │ │ └── _tab_others
│ │ │ └── add_printer_config.html.haml.deface
│ ├── lib
│ │ ├── foodsoft_printer
│ │ │ └── version.rb
│ │ └── foodsoft_printer.rb
│ └── config
│ │ └── routes.rb
├── messages
│ ├── app
│ │ ├── views
│ │ │ ├── admin
│ │ │ │ └── messagegroups
│ │ │ │ │ ├── new.html.haml
│ │ │ │ │ ├── edit.html.haml
│ │ │ │ │ ├── index.js.haml
│ │ │ │ │ ├── _form.html.haml
│ │ │ │ │ └── show.html.haml
│ │ │ ├── messages
│ │ │ │ ├── index.js.haml
│ │ │ │ ├── index.html.haml
│ │ │ │ └── _actionbar.haml
│ │ │ ├── message_threads
│ │ │ │ ├── show.js.haml
│ │ │ │ ├── show.haml
│ │ │ │ ├── index.html.haml
│ │ │ │ └── _groupmessage_threads.html.haml
│ │ │ ├── messagegroups
│ │ │ │ ├── index.html.haml
│ │ │ │ └── _messagegroup.html.haml
│ │ │ └── messages_mailer
│ │ │ │ ├── foodsoft_message.text.haml
│ │ │ │ └── foodsoft_message.html.haml
│ │ ├── models
│ │ │ ├── messagegroup.rb
│ │ │ └── message_recipient.rb
│ │ ├── overrides
│ │ │ ├── foodcoop
│ │ │ │ ├── users
│ │ │ │ │ └── _users
│ │ │ │ │ │ └── new_message.html.haml.deface
│ │ │ │ ├── ordergroups
│ │ │ │ │ └── _ordergroups
│ │ │ │ │ │ └── new_message.html.haml.deface
│ │ │ │ └── workgroups
│ │ │ │ │ └── _workgroup
│ │ │ │ │ └── new_message.html.haml.deface
│ │ │ ├── admin
│ │ │ │ ├── workgroups
│ │ │ │ │ └── show
│ │ │ │ │ │ └── new_message.html.haml.deface
│ │ │ │ ├── users
│ │ │ │ │ └── show
│ │ │ │ │ │ └── new_message.html.haml.deface
│ │ │ │ ├── ordergroups
│ │ │ │ │ └── show
│ │ │ │ │ │ └── new_message.html.haml.deface
│ │ │ │ └── configs
│ │ │ │ │ └── _tab_messages
│ │ │ │ │ └── add_config.html.haml.deface
│ │ │ ├── home
│ │ │ │ └── _start_nav
│ │ │ │ │ └── new_message.html.haml.deface
│ │ │ ├── orders
│ │ │ │ └── show
│ │ │ │ │ └── add_message_button.html.haml.deface
│ │ │ └── shared
│ │ │ │ └── _user_form_fields
│ │ │ │ └── add_messages_prefs.html.haml.deface
│ │ └── controllers
│ │ │ └── message_threads_controller.rb
│ ├── lib
│ │ ├── foodsoft_messages
│ │ │ ├── version.rb
│ │ │ └── mail_receiver.rb
│ │ └── foodsoft_messages.rb
│ └── db
│ │ └── migrate
│ │ └── 20160226000000_add_email_to_message.rb
├── documents
│ ├── lib
│ │ ├── foodsoft_documents
│ │ │ └── version.rb
│ │ └── foodsoft_documents.rb
│ ├── app
│ │ ├── views
│ │ │ └── documents
│ │ │ │ ├── index.js.haml
│ │ │ │ ├── new.js.haml
│ │ │ │ └── move.js.haml
│ │ └── overrides
│ │ │ └── admin
│ │ │ └── configs
│ │ │ └── _tab_others
│ │ │ └── add_documents_config.html.haml.deface
│ ├── config
│ │ ├── locales
│ │ │ └── fr.yml
│ │ └── routes.rb
│ └── db
│ │ └── migrate
│ │ ├── 20171105000000_add_parent_to_document.rb
│ │ └── 20160220000000_create_documents.rb
├── uservoice
│ └── lib
│ │ └── foodsoft_uservoice
│ │ ├── version.rb
│ │ └── engine.rb
└── current_orders
│ ├── app
│ ├── views
│ │ └── current_orders
│ │ │ ├── articles
│ │ │ ├── index.html.haml
│ │ │ ├── show.html.haml
│ │ │ ├── index.js.erb
│ │ │ ├── show.js.erb
│ │ │ ├── _articles.html.haml
│ │ │ ├── _actions.html.haml
│ │ │ ├── show_on_group_order_article_create.js.erb
│ │ │ └── _article.html.haml
│ │ │ ├── ordergroups
│ │ │ ├── index.html.haml
│ │ │ ├── show.html.haml
│ │ │ ├── show.js.erb
│ │ │ ├── show_on_group_order_article_update.js.erb
│ │ │ └── show_on_group_order_article_create.js.erb
│ │ │ └── group_orders
│ │ │ ├── index.html.haml
│ │ │ └── _payment_bar.html.haml
│ ├── controllers
│ │ └── current_orders_controller.rb
│ └── overrides
│ │ ├── admin
│ │ └── configs
│ │ │ └── _tab_others
│ │ │ └── add_current_orders.html.haml.deface
│ │ └── group_orders
│ │ └── show
│ │ └── add_pdf_download.html.haml.deface
│ ├── lib
│ ├── foodsoft_current_orders
│ │ └── version.rb
│ └── foodsoft_current_orders.rb
│ └── config
│ └── locales
│ └── fr.yml
├── config
├── initializers
│ ├── prawn_pdf.rb
│ ├── active_model_serializers.rb
│ ├── time_formats.rb
│ ├── mail_receiver.rb
│ ├── bullet.rb
│ ├── simple_navigation.rb
│ ├── zeitwerk.rb
│ ├── gaffe.rb
│ ├── mime_types.rb
│ ├── rack.rb
│ ├── application_controller_renderer.rb
│ ├── cookies_serializer.rb
│ ├── 01_load_app_config.rb
│ ├── resque.rb
│ ├── currency_display.rb
│ ├── extensions.rb
│ ├── backtrace_silencers.rb
│ ├── filter_parameter_logging.rb
│ ├── permissions_policy.rb
│ └── wrap_parameters.rb
├── spring.rb
├── environment.rb
├── importmap.rb
├── boot.rb
├── i18n-js.yml
└── locales
│ └── overrides.yml
├── .yardopts
├── bin
├── rake
├── importmap
├── bundle
├── rails
├── rubocop
├── test
├── yarn
├── resque
├── rspec
├── autospec
├── resque-web
└── mailcatcher
├── spec
├── fixtures
│ ├── foodsoft_file_01.ods
│ ├── foodsoft_file_01.xls
│ ├── foodsoft_file_01.xlsx
│ └── foodsoft_file_02.csv
├── support
│ ├── integration.rb
│ ├── factory_bot.rb
│ ├── faker.rb
│ └── session_helper.rb
├── factories
│ ├── group_order_article.rb
│ ├── delivery.rb
│ ├── group_order_article_quantity.rb
│ ├── article_unit.rb
│ ├── article_category.rb
│ ├── article_unit_ratio.rb
│ ├── group_order.rb
│ ├── bank_transaction_type.rb
│ ├── invoice.rb
│ ├── doorkeeper.rb
│ └── financial_transaction_type.rb
├── requests
│ └── api
│ │ └── v1
│ │ └── configs_controller_spec.rb
└── i18n_spec.rb
├── doc
└── building blocks
│ └── finance
│ └── finance.png
├── db
├── seeds.rb
└── migrate
│ ├── 20160217152621_add_pickup_to_order.rb
│ ├── 20150923190747_add_boxfill_to_order.rb
│ ├── 20160217115252_add_deleted_at_to_user.rb
│ ├── 20150301000000_add_last_activity_to_user.rb
│ ├── 20140921104907_remove_stale_memberships.rb
│ ├── 20171001000000_add_last_sent_mail_to_order.rb
│ ├── 20181204060000_change_delivered_on_to_date.rb
│ ├── 20140521142651_add_sync_method_to_supplier.rb
│ ├── 20171001020000_add_end_action_to_order.rb
│ ├── 20160217124256_add_created_by_user_id_to_invoice.rb
│ ├── 20171105000000_add_parent_to_document.foodsoft_documents_engine.rb
│ ├── 20181120000000_increase_choices_size.foodsoft_polls_engine.rb
│ ├── 20160217164552_add_break_to_group.rb
│ ├── 20171111000000_add_role_pickups_to_group.rb
│ ├── 20190100000008_add_bank_account_to_supplier_category.rb
│ ├── 20160217194036_add_role_invoices_to_group.rb
│ ├── 20181201000210_add_group_order_to_financial_transaction.rb
│ ├── 20161001000000_add_iban_to_supplier_and_user.rb
│ ├── 20240726083744_add_unit_migration_completed_to_suppliers.rb
│ ├── 20181205010000_add_bank_account_to_financial_transaction_type.rb
│ ├── 20250528114335_add_remote_auto_sync_to_suppliers.rb
│ ├── 20181013195028_add_confidential_to_applications.rb
│ ├── 20181201000300_allow_emtpy_ordergroup_in_financial_transaction.rb
│ ├── 020_add_users_last_login.rb
│ ├── 20090811144901_add_weekly_to_tasks.rb
│ ├── 20130624084223_remove_weekly_from_tasks.rb
│ ├── 20150227161931_add_replyto_and_groupid_to_messages.rb
│ ├── 20121216180646_remove_assigned_from_tasks.rb
│ ├── 20090812110010_add_note_to_deliveries.rb
│ ├── 20130930132511_add_quantities_to_order_article.rb
│ ├── 20160218151041_add_attachment_to_invoice.rb
│ ├── 20110507184920_add_duration_to_tasks.rb
│ ├── 017_add_min_order_quantity.rb
│ ├── 025_extend_comments.rb
│ ├── 20140102170431_add_result_computed_to_group_order_articles.rb
│ ├── 20181201000220_add_transport_to_order.rb
│ ├── 20240410093313_change_bank_account_desc.rb
│ ├── 20171201000000_add_name_short_to_financial_transaction_type.rb
│ ├── 20110507192928_add_task_duration_to_workgroups.rb
│ ├── 20121112093327_add_created_by_user_id_to_orders.rb
│ ├── 20121230142516_remove_account_updated_from_ordergroups.rb
│ ├── 20181201000200_add_deleted_to_financial_transaction_type.rb
│ ├── 20090731132547_add_stats_to_groups.rb
│ ├── 20130920201529_allow_missing_nick.rb
│ ├── 20181205000000_add_user_to_task.rb
│ ├── 20190100000007_add_ignore_for_account_balance_to_financial_transaction_classes.rb
│ ├── 20181204000000_clear_invalid_invoices_from_orders.rb
│ ├── 20120622094337_add_next_weekly_tasks_number_to_workgroups.rb
│ ├── 20120929155541_add_ignore_apple_restriction_to_groups.rb
│ ├── 20090405131156_modify_group_order_article_result.rb
│ ├── 20141211210719_increase_account_balance_precision.rb
│ ├── 20160224201529_allow_stock_group_order.rb
│ ├── 20160226000000_add_email_to_message.foodsoft_messages_engine.rb
│ ├── 20181204010000_change_marked_as_deleted_names.rb
│ ├── 20240404004950_add_use_financial_links_setting.rb
│ ├── 20130615073715_create_periodic_task_groups.rb
│ ├── 20140318173000_delete_empty_group_order_articles.rb
│ ├── 20181201000302_change_stock_supplier_to_null_in_order.rb
│ ├── 019_remove_uniqueness_of_article_name.rb
│ ├── 010_user_password_reset.rb
│ ├── 20181203000000_create_links.foodsoft_links.rb
│ ├── 20190100000009_create_bank_gateways.rb
│ ├── 20230106144440_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb
│ ├── 20120512211613_add_order_indexes.rb
│ ├── 20090317175355_add_profit_to_orders.rb
│ ├── 20160220000000_create_documents.foodsoft_documents_engine.rb
│ ├── 20210205090257_introduce_received_state_in_orders.rb
│ ├── 20170801000000_create_mail_delivery_status.rb
│ ├── 20250322103203_fix_schema_inconsistent_with_migration_history.rb
│ ├── 024_add_deposit_defaults.rb
│ ├── 20171002000000_create_financial_links.rb
│ ├── 20250519093453_rename_order_timestamp_and_add_remote_order_fields_to_supplier.rb
│ ├── 20190100000006_change_order_article_result_types.rb
│ ├── 20130718183100_create_settings.rb
│ ├── 018_create_invites.rb
│ └── 015_change_result_quantities.rb
├── .github
├── ISSUE_TEMPLATE
│ └── custom.md
└── workflows
│ └── rubocop.yml
├── .gitattributes
├── Procfile
├── config.ru
├── script
└── rails
├── Rakefile
├── .eslintrc.js
└── .rubocop.yml
/VERSION:
--------------------------------------------------------------------------------
1 | 4.9.1
2 |
--------------------------------------------------------------------------------
/lib/tasks/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 3.4.6
2 |
--------------------------------------------------------------------------------
/tmp/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/vendor/javascript/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/plugins/discourse/config/locales/fr.yml:
--------------------------------------------------------------------------------
1 | fr:
2 |
--------------------------------------------------------------------------------
/app/views/articles/edit.html.haml:
--------------------------------------------------------------------------------
1 |
2 | =render("form")
--------------------------------------------------------------------------------
/app/views/group_orders/edit.html.haml:
--------------------------------------------------------------------------------
1 | = render 'form'
--------------------------------------------------------------------------------
/app/views/group_orders/new.html.haml:
--------------------------------------------------------------------------------
1 | = render 'form'
--------------------------------------------------------------------------------
/app/helpers/home_helper.rb:
--------------------------------------------------------------------------------
1 | module HomeHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/users_helper.rb:
--------------------------------------------------------------------------------
1 | module UsersHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/foodcoop_helper.rb:
--------------------------------------------------------------------------------
1 | module FoodcoopHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/sessions_helper.rb:
--------------------------------------------------------------------------------
1 | module SessionsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/views/invites/create.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').modal('hide');
--------------------------------------------------------------------------------
/app/helpers/stock_takings_helper.rb:
--------------------------------------------------------------------------------
1 | module StockTakingsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/plugins/links/lib/foodsoft_links.rb:
--------------------------------------------------------------------------------
1 | require 'foodsoft_links/engine'
2 |
--------------------------------------------------------------------------------
/app/helpers/order_comments_helper.rb:
--------------------------------------------------------------------------------
1 | module OrderCommentsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | class ApplicationJob < ActiveJob::Base
2 | end
3 |
--------------------------------------------------------------------------------
/app/views/admin/users/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
--------------------------------------------------------------------------------
/config/initializers/prawn_pdf.rb:
--------------------------------------------------------------------------------
1 | Prawn::Font::AFM.hide_m17n_warning = true
2 |
--------------------------------------------------------------------------------
/app/helpers/article_categories_helper.rb:
--------------------------------------------------------------------------------
1 | module ArticleCategoriesHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/views/admin/workgroups/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
--------------------------------------------------------------------------------
/app/views/suppliers/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render "form"
4 |
--------------------------------------------------------------------------------
/app/views/suppliers/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render "form"
4 |
--------------------------------------------------------------------------------
/app/helpers/finance/ordergroups_helper.rb:
--------------------------------------------------------------------------------
1 | module Finance::OrdergroupsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/views/admin/ordergroups/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
--------------------------------------------------------------------------------
/app/views/admin/ordergroups/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
--------------------------------------------------------------------------------
/app/views/admin/users/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/app/views/admin/workgroups/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
--------------------------------------------------------------------------------
/app/views/shared/alert.js.erb:
--------------------------------------------------------------------------------
1 | $('#main').prepend('<%= bootstrap_flash_patched %>');
2 |
--------------------------------------------------------------------------------
/.yardopts:
--------------------------------------------------------------------------------
1 | -o doc/api --no-private --protected app/**/*.rb lib/**/*.rb - *.md doc/**/*.md
2 |
--------------------------------------------------------------------------------
/app/views/article_categories/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/app/views/article_categories/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#ordersTable').html('#{j(render('orders'))}');
--------------------------------------------------------------------------------
/app/views/finance/invoices/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#invoicesTable').html('#{j(render('invoices'))}');
--------------------------------------------------------------------------------
/plugins/polls/app/views/polls/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/plugins/polls/app/views/polls/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/list.unlist.css:
--------------------------------------------------------------------------------
1 | .list .unlisted:not(.no-unlist) {
2 | display: none;
3 | }
--------------------------------------------------------------------------------
/app/views/admin/users/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#users').html('#{escape_javascript(render("users"))}');
2 |
--------------------------------------------------------------------------------
/app/views/articles/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#table').html('#{escape_javascript(render("articles"))}');
2 |
--------------------------------------------------------------------------------
/app/views/deliveries/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render :partial => 'form'
4 |
--------------------------------------------------------------------------------
/config/initializers/active_model_serializers.rb:
--------------------------------------------------------------------------------
1 | ActiveModelSerializers.config.adapter = :json
2 |
--------------------------------------------------------------------------------
/config/initializers/time_formats.rb:
--------------------------------------------------------------------------------
1 | Time::DATE_FORMATS[:foodsoft_datetime] = '%d.%m.%Y %H:%M'
2 |
--------------------------------------------------------------------------------
/plugins/wiki/lib/foodsoft_wiki/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftWiki
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/app/views/foodcoop/users/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#users').html('#{escape_javascript(render("users"))}');
2 |
--------------------------------------------------------------------------------
/app/views/tasks/archive.js.haml:
--------------------------------------------------------------------------------
1 | $('#tasks').html('#{escape_javascript(render("archive_tasks"))}');
2 |
--------------------------------------------------------------------------------
/plugins/b85/lib/foodsoft_b85/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftB85
2 | VERSION = '1.0.0'.freeze
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/links/lib/foodsoft_links/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftLinks
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/mollie/lib/foodsoft_mollie/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftMollie
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/polls/lib/foodsoft_polls/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftPolls
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/printer/app/views/printer_jobs/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#jobsTable').html('#{j(render('jobs'))}');
2 |
--------------------------------------------------------------------------------
/app/assets/images/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/error.png
--------------------------------------------------------------------------------
/app/assets/images/euro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/euro.png
--------------------------------------------------------------------------------
/app/assets/images/rails.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/rails.png
--------------------------------------------------------------------------------
/app/views/article_units/search.js.haml:
--------------------------------------------------------------------------------
1 | $('#article_units_search_results').html('#{j(render("rows"))}');
2 |
--------------------------------------------------------------------------------
/app/views/finance/invoices/delete_attachment.js.erb:
--------------------------------------------------------------------------------
1 | $("#attachment_<%= params[:attachment_id] %>").remove();
--------------------------------------------------------------------------------
/app/views/orders/index.js.erb:
--------------------------------------------------------------------------------
1 | $('#orders_table').html('<%= escape_javascript(render('orders')) %>');
2 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/admin/messagegroups/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/plugins/polls/app/views/polls/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#polls').html('#{escape_javascript(render("polls"))}');
2 |
--------------------------------------------------------------------------------
/plugins/printer/lib/foodsoft_printer/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftPrinter
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/app/assets/images/b_drop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/b_drop.png
--------------------------------------------------------------------------------
/app/assets/images/b_edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/b_edit.png
--------------------------------------------------------------------------------
/app/assets/images/b_user.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/b_user.png
--------------------------------------------------------------------------------
/app/assets/images/b_users.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/b_users.png
--------------------------------------------------------------------------------
/app/assets/images/loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/loader.gif
--------------------------------------------------------------------------------
/app/assets/images/package.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/package.png
--------------------------------------------------------------------------------
/app/views/admin/workgroups/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#workgroups').html('#{escape_javascript(render("workgroups"))}');
2 |
--------------------------------------------------------------------------------
/app/views/deliveries/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', supplier: @supplier.name)
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/app/views/orders/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', name: @order.name)
2 |
3 | = render :partial => 'form'
4 |
--------------------------------------------------------------------------------
/app/views/tasks/_form_sidebar.html.haml:
--------------------------------------------------------------------------------
1 | - content_for :sidebar do
2 | = render "shared/workgroup_members"
3 |
--------------------------------------------------------------------------------
/app/views/tasks/archive.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 | = render 'nav'
3 |
4 | #tasks= render 'archive_tasks'
5 |
--------------------------------------------------------------------------------
/plugins/discourse/lib/foodsoft_discourse/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftDiscourse
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/documents/lib/foodsoft_documents/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftDocuments
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/admin/messagegroups/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/plugins/messages/lib/foodsoft_messages/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftMessages
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/uservoice/lib/foodsoft_uservoice/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftUservoice
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/app/assets/images/b_browse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/b_browse.png
--------------------------------------------------------------------------------
/app/assets/images/dots-white.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/dots-white.gif
--------------------------------------------------------------------------------
/app/assets/images/euro_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/euro_new.png
--------------------------------------------------------------------------------
/app/assets/images/lamp_grey.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/lamp_grey.png
--------------------------------------------------------------------------------
/app/assets/images/lamp_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/lamp_red.png
--------------------------------------------------------------------------------
/app/assets/images/package-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/package-bg.png
--------------------------------------------------------------------------------
/app/assets/images/role-admin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/role-admin.png
--------------------------------------------------------------------------------
/app/assets/images/save_pdf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/save_pdf.png
--------------------------------------------------------------------------------
/app/assets/images/text_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/text_file.png
--------------------------------------------------------------------------------
/app/views/admin/ordergroups/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');
2 |
--------------------------------------------------------------------------------
/app/views/finance/bank_transactions/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#transactionsTable').html('#{j(render('transactions'))}');
2 |
--------------------------------------------------------------------------------
/app/views/layouts/action_text/contents/_content.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= yield -%>
3 |
4 |
--------------------------------------------------------------------------------
/app/views/stock_takings/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#StockTakingsTable').html('#{escape_javascript(render('stock_takings'))}');
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative "../config/boot"
3 | require "rake"
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/plugins/messages/app/models/messagegroup.rb:
--------------------------------------------------------------------------------
1 | class Messagegroup < Group
2 | validates_uniqueness_of :name
3 | end
4 |
--------------------------------------------------------------------------------
/app/assets/images/icon_message.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/icon_message.gif
--------------------------------------------------------------------------------
/app/assets/images/role-finance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/role-finance.png
--------------------------------------------------------------------------------
/app/assets/images/role-orders.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/role-orders.png
--------------------------------------------------------------------------------
/app/assets/images/role-pickups.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/role-pickups.png
--------------------------------------------------------------------------------
/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | class ApplicationRecord < ActiveRecord::Base
2 | self.abstract_class = true
3 | end
4 |
--------------------------------------------------------------------------------
/app/models/assignment.rb:
--------------------------------------------------------------------------------
1 | class Assignment < ApplicationRecord
2 | belongs_to :user
3 | belongs_to :task
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/articles/copy.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/finance/ordergroups/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#ordergroupsTable').html('#{escape_javascript(render("ordergroups"))}');
2 |
--------------------------------------------------------------------------------
/app/views/foodcoop/ordergroups/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');
2 |
--------------------------------------------------------------------------------
/app/views/invites/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render('modal_form'))}');
2 | $('#modalContainer').modal();
--------------------------------------------------------------------------------
/bin/importmap:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 |
3 | require_relative "../config/application"
4 | require "importmap/commands"
5 |
--------------------------------------------------------------------------------
/public/apple-touch-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon-57x57.png
--------------------------------------------------------------------------------
/public/apple-touch-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon-72x72.png
--------------------------------------------------------------------------------
/public/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/spec/fixtures/foodsoft_file_01.ods:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/spec/fixtures/foodsoft_file_01.ods
--------------------------------------------------------------------------------
/spec/fixtures/foodsoft_file_01.xls:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/spec/fixtures/foodsoft_file_01.xls
--------------------------------------------------------------------------------
/app/assets/images/redbox_spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/redbox_spinner.gif
--------------------------------------------------------------------------------
/app/assets/images/role-invoices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/role-invoices.png
--------------------------------------------------------------------------------
/app/assets/images/role-suppliers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/role-suppliers.png
--------------------------------------------------------------------------------
/app/views/finance/invoices/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 | = render :partial => 'form', :locals => {:invoice_id => 0}
3 |
--------------------------------------------------------------------------------
/app/views/home/ordergroup.js.haml:
--------------------------------------------------------------------------------
1 | $('#transactions').html('#{j(render("finance/financial_transactions/transactions"))}');
2 |
--------------------------------------------------------------------------------
/app/views/mailer/order_result_supplier.text.haml:
--------------------------------------------------------------------------------
1 | = raw t '.text', user: show_user(@user), foodcoop: FoodsoftConfig[:name]
2 |
--------------------------------------------------------------------------------
/app/views/order_articles/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("new"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/articles/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title'), false
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/ordergroups/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/plugins/current_orders/lib/foodsoft_current_orders/version.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftCurrentOrders
2 | VERSION = '0.0.1'
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/documents/app/views/documents/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#documentsTable').html('#{escape_javascript(render("documents"))}');
2 |
--------------------------------------------------------------------------------
/plugins/mollie/lib/foodsoft_mollie/engine.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftMollie
2 | class Engine < ::Rails::Engine
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/public/apple-touch-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon-114x114.png
--------------------------------------------------------------------------------
/public/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/public/apple-touch-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon-144x144.png
--------------------------------------------------------------------------------
/public/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/public/apple-touch-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/public/apple-touch-icon-180x180.png
--------------------------------------------------------------------------------
/spec/fixtures/foodsoft_file_01.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/spec/fixtures/foodsoft_file_01.xlsx
--------------------------------------------------------------------------------
/vendor/assets/fonts/OpenSans-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/vendor/assets/fonts/OpenSans-Bold.ttf
--------------------------------------------------------------------------------
/app/assets/images/role-article_meta.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/app/assets/images/role-article_meta.png
--------------------------------------------------------------------------------
/app/views/admin/bank_accounts/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/admin/bank_gateways/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/update_summary.js.haml:
--------------------------------------------------------------------------------
1 | $('#summary').html('#{j(render('finance/balancing/summary', order: @order))}');
--------------------------------------------------------------------------------
/app/views/group_order_articles/new.js.erb:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('<%= j render("form") %>');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/doc/building blocks/finance/finance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/doc/building blocks/finance/finance.png
--------------------------------------------------------------------------------
/plugins/mollie/app/views/payments/mollie/new.html.haml:
--------------------------------------------------------------------------------
1 | - title (params[:title] or t('.title'))
2 | = render :partial => 'form'
3 |
--------------------------------------------------------------------------------
/plugins/polls/app/models/poll_choice.rb:
--------------------------------------------------------------------------------
1 | class PollChoice < ActiveRecord::Base
2 | belongs_to :poll_vote, touch: true
3 | end
4 |
--------------------------------------------------------------------------------
/vendor/assets/fonts/OpenSans-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/vendor/assets/fonts/OpenSans-Italic.ttf
--------------------------------------------------------------------------------
/app/serializers/article_unit_serializer.rb:
--------------------------------------------------------------------------------
1 | class ArticleUnitSerializer < ActiveModel::Serializer
2 | attributes :id, :unit
3 | end
4 |
--------------------------------------------------------------------------------
/app/serializers/user_serializer.rb:
--------------------------------------------------------------------------------
1 | class UserSerializer < ActiveModel::Serializer
2 | attributes :id, :name, :email, :locale
3 | end
4 |
--------------------------------------------------------------------------------
/app/views/admin/supplier_categories/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/errors/not_found.html.haml:
--------------------------------------------------------------------------------
1 | - page = capture do
2 | %p= t '.text'
3 |
4 | = render 'error', title: t('.title'), page: page
5 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/edit_note.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("edit_note"))}');
2 | $('#modalContainer').modal();
--------------------------------------------------------------------------------
/app/views/finance/invoices/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 | = render :partial => 'form', :locals => {:invoice_id => @invoice.id}
3 |
--------------------------------------------------------------------------------
/app/views/order_articles/destroy.js.haml:
--------------------------------------------------------------------------------
1 | $('#order_article_#{@order_article.id}, #group_order_articles_#{@order_article.id}').hide();
2 |
--------------------------------------------------------------------------------
/plugins/discourse/lib/foodsoft_discourse/engine.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftDiscourse
2 | class Engine < ::Rails::Engine
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/documents/app/views/documents/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/plugins/links/app/views/admin/links/edit.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/messages/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#messages').html('#{j(render('messages', messages: @messages, pagination: true))}');
--------------------------------------------------------------------------------
/plugins/printer/app/models/printer_job_update.rb:
--------------------------------------------------------------------------------
1 | class PrinterJobUpdate < ActiveRecord::Base
2 | belongs_to :printer_job
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/uservoice/lib/foodsoft_uservoice/engine.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftUservoice
2 | class Engine < ::Rails::Engine
3 | end
4 | end
5 |
--------------------------------------------------------------------------------
/vendor/assets/fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/vendor/assets/fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/app/views/admin/mail_delivery_status/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#maildeliverystatus').html('#{escape_javascript(render("maildeliverystatus"))}');
2 |
--------------------------------------------------------------------------------
/app/views/articles/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').addClass('modal-xl').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/finance/bank_accounts/import.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', name: @bank_account.name)
2 |
3 | #import
4 | = render "import"
5 |
--------------------------------------------------------------------------------
/config/initializers/mail_receiver.rb:
--------------------------------------------------------------------------------
1 | Rails.application.config.to_prepare do
2 | FoodsoftMailReceiver.register BounceMailReceiver
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/documents/app/views/documents/move.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("move"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/admin/messagegroups/index.js.haml:
--------------------------------------------------------------------------------
1 | $('#messagegroups').html('#{escape_javascript(render("messagegroups"))}');
2 |
--------------------------------------------------------------------------------
/vendor/assets/fonts/OpenSans-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/vendor/assets/fonts/OpenSans-BoldItalic.ttf
--------------------------------------------------------------------------------
/app/serializers/article_category_serializer.rb:
--------------------------------------------------------------------------------
1 | class ArticleCategorySerializer < ActiveModel::Serializer
2 | attributes :id, :name
3 | end
4 |
--------------------------------------------------------------------------------
/app/views/admin/financial_transaction_classes/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/admin/financial_transaction_types/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("form"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/update_note.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').modal('hide');
2 | $('#note').html('#{j(simple_format(@order.note))}');
3 |
--------------------------------------------------------------------------------
/app/views/mailer/reset_password.text.haml:
--------------------------------------------------------------------------------
1 | = raw t '.text', user: show_user(@user), link: @link, expires: I18n.l(@user.reset_password_expires)
2 |
--------------------------------------------------------------------------------
/app/views/order_articles/edit.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').addClass('modal-xl').html('#{j(render("edit"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/ordergroups/show.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', name: @ordergroup.name)
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/edit_transport.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("edit_transport"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/finance/financial_links/index_invoice.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("index_invoice"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/order_comments/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#new_comment').html('#{escape_javascript(render('form', :locals => { :order_comment => @order_comment}))}');
2 |
--------------------------------------------------------------------------------
/config/spring.rb:
--------------------------------------------------------------------------------
1 | %w[
2 | .ruby-version
3 | .rbenv-vars
4 | tmp/restart.txt
5 | tmp/caching-dev.txt
6 | ].each { |path| Spring.watch(path) }
7 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # default seed is minimal
2 | require Rails.root.join('db/seeds/small.en.seeds.rb')
3 |
4 | # to generate new seeds, use the seed_dumper gem
5 |
--------------------------------------------------------------------------------
/plugins/b85/doc/Biofakt B85 BNN-3.0_Bestellungen.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/plugins/b85/doc/Biofakt B85 BNN-3.0_Bestellungen.pdf
--------------------------------------------------------------------------------
/plugins/links/app/views/admin/links/update_links.js.haml:
--------------------------------------------------------------------------------
1 | $('#links').html('#{escape_javascript(render("links"))}');
2 | $('#modalContainer').modal('hide');
3 |
--------------------------------------------------------------------------------
/plugins/mollie/.gitignore:
--------------------------------------------------------------------------------
1 | .bundle/
2 | log/*.log
3 | pkg/
4 | test/dummy/db/*.sqlite3
5 | test/dummy/log/*.log
6 | test/dummy/tmp/
7 | test/dummy/.sass-cache
8 |
--------------------------------------------------------------------------------
/spec/support/integration.rb:
--------------------------------------------------------------------------------
1 | # @see http://stackoverflow.com/a/11048669/2866660
2 | def scrolldown
3 | page.execute_script 'window.scrollBy(0,10000)'
4 | end
5 |
--------------------------------------------------------------------------------
/app/assets/javascripts/bootstrap.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | $("a[rel~=popover], .has-popover").popover()
3 | $("a[rel~=tooltip], .has-tooltip").tooltip()
4 | });
5 |
--------------------------------------------------------------------------------
/app/serializers/financial_transaction_class_serializer.rb:
--------------------------------------------------------------------------------
1 | class FinancialTransactionClassSerializer < ActiveModel::Serializer
2 | attributes :id, :name
3 | end
4 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path("../config/application", __dir__)
3 | require_relative "../config/boot"
4 | require "rails/commands"
5 |
--------------------------------------------------------------------------------
/plugins/messages/lib/foodsoft_messages/mail_receiver.rb:
--------------------------------------------------------------------------------
1 | ActiveSupport.on_load(:after_initialize) do
2 | FoodsoftMailReceiver.register MessagesMailReceiver
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/wiki/app/assets/images/icons/feed-icon-14x14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/plugins/wiki/app/assets/images/icons/feed-icon-14x14.png
--------------------------------------------------------------------------------
/plugins/wiki/app/assets/images/icons/feed-icon-28x28.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/plugins/wiki/app/assets/images/icons/feed-icon-28x28.png
--------------------------------------------------------------------------------
/spec/support/factory_bot.rb:
--------------------------------------------------------------------------------
1 | RSpec.configure do |config|
2 | # load FactoryBot shortcuts create(), etc.
3 | config.include FactoryBot::Syntax::Methods
4 | end
5 |
--------------------------------------------------------------------------------
/app/views/finance/financial_links/index_bank_transaction.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("index_bank_transaction"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/finance/financial_transactions/index.js.erb:
--------------------------------------------------------------------------------
1 | $('#transactions').html('<%= escape_javascript(render("transactions", with_csv: true, with_hidden: true)) %>');
2 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require_relative 'application'
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/articles/show.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', name: @order_article.article_version.name), false
2 |
3 | = render 'form'
4 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom issue template
3 | about: Other Issue
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/views/finance/financial_links/new_financial_transaction.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("new_financial_transaction"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/app/views/group_orders/archive.js.haml:
--------------------------------------------------------------------------------
1 | $('#closed_orders').html('#{escape_javascript(render("orders", orders: @closed_orders_including_group_order, pagination: true))}');
2 |
--------------------------------------------------------------------------------
/config/initializers/bullet.rb:
--------------------------------------------------------------------------------
1 | if defined? Bullet
2 | Bullet.enable = true
3 | # Bullet.alert = true
4 | Bullet.bullet_logger = true
5 | Bullet.console = true
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/b85/doc/Bestellung_Lieferavis_Schnittstelle_2025.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/foodcoops/foodsoft/HEAD/plugins/b85/doc/Bestellung_Lieferavis_Schnittstelle_2025.pdf
--------------------------------------------------------------------------------
/plugins/current_orders/app/controllers/current_orders_controller.rb:
--------------------------------------------------------------------------------
1 | class CurrentOrdersController < ApplicationController
2 | before_action :authenticate_orders
3 | end
4 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/message_threads/show.js.haml:
--------------------------------------------------------------------------------
1 | $('#message_threads').html('#{j(render('message_threads', message_threads: @message_threads, pagination: true))}');
2 |
--------------------------------------------------------------------------------
/app/views/finance/financial_links/index_financial_transaction.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('#{j(render("index_financial_transaction"))}');
2 | $('#modalContainer').modal();
3 |
--------------------------------------------------------------------------------
/config/initializers/simple_navigation.rb:
--------------------------------------------------------------------------------
1 | # do not generate id elements as they're used at other places too, breaking js
2 | SimpleNavigation.config.autogenerate_item_ids = false
3 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/messagegroups/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | %p= t('.body')
4 |
5 | = render :partial => "messagegroup", :collection => @messagegroups
6 |
--------------------------------------------------------------------------------
/spec/factories/group_order_article.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | # requires order_article
5 | factory :group_order_article do
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/articles/update.js.haml:
--------------------------------------------------------------------------------
1 | $('#article_#{@article.id}').replaceWith('#{escape_javascript(render(@article))}');
2 | $('#modalContainer').removeClass('modal-xl').modal('hide');
3 |
--------------------------------------------------------------------------------
/app/views/errors/internal_server_error.html.haml:
--------------------------------------------------------------------------------
1 | - page = capture do
2 | %p= t '.text1'
3 | %p= t '.text2'
4 |
5 | = render 'error', title: t('.title'), type: :error, page: page
6 |
--------------------------------------------------------------------------------
/app/views/finance/financial_transactions/index_collection.js.erb:
--------------------------------------------------------------------------------
1 | $('#transactions').html('<%= escape_javascript(render("transactions", with_ordergroup: true, with_csv: true)) %>');
2 |
--------------------------------------------------------------------------------
/app/views/order_comments/create.js.haml:
--------------------------------------------------------------------------------
1 | $('#comments').html('#{escape_javascript(render(:partial => 'shared/comments', :locals => { :comments => @order_comment.order.comments }))}');
2 |
--------------------------------------------------------------------------------
/app/views/supplier_shares/update.js.haml:
--------------------------------------------------------------------------------
1 | $('#share_link').html('#{j(render(partial: 'share_link', locals: {external_uuid: @supplier.external_uuid}))}');
2 | $('.btn.share').toggle();
3 |
--------------------------------------------------------------------------------
/config/initializers/zeitwerk.rb:
--------------------------------------------------------------------------------
1 | # config/initializers/zeitwerk.rb
2 | ActiveSupport::Dependencies
3 | .autoload_paths
4 | .delete(Rails.root.join('app/controllers/concerns').to_s)
5 |
--------------------------------------------------------------------------------
/db/migrate/20160217152621_add_pickup_to_order.rb:
--------------------------------------------------------------------------------
1 | class AddPickupToOrder < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :orders, :pickup, :date
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2 |
3 | # Disallow all robot access:
4 | User-agent: *
5 | Disallow: /
--------------------------------------------------------------------------------
/app/views/admin/finances/update_bank_accounts.js.haml:
--------------------------------------------------------------------------------
1 | $('#bank_accounts_table').html('#{escape_javascript(render("admin/finances/bank_accounts"))}');
2 | $('#modalContainer').modal('hide');
3 |
--------------------------------------------------------------------------------
/app/views/admin/finances/update_bank_gateways.js.haml:
--------------------------------------------------------------------------------
1 | $('#bank_gateways_table').html('#{escape_javascript(render("admin/finances/bank_gateways"))}');
2 | $('#modalContainer').modal('hide');
3 |
--------------------------------------------------------------------------------
/db/migrate/20150923190747_add_boxfill_to_order.rb:
--------------------------------------------------------------------------------
1 | class AddBoxfillToOrder < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :orders, :boxfill, :datetime
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/b85/lib/foodsoft_b85.rb:
--------------------------------------------------------------------------------
1 | require 'foodsoft_b85/engine'
2 | require 'foodsoft_b85/order_b85'
3 | require 'foodsoft_b85/order_extensions'
4 | require 'foodsoft_b85/supplier_extensions'
5 |
--------------------------------------------------------------------------------
/spec/factories/delivery.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | factory :delivery do
5 | supplier { create(:supplier) }
6 | date { Time.now }
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20160217115252_add_deleted_at_to_user.rb:
--------------------------------------------------------------------------------
1 | class AddDeletedAtToUser < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :users, :deleted_at, :datetime
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/documents/config/locales/fr.yml:
--------------------------------------------------------------------------------
1 | fr:
2 | activerecord:
3 | attributes:
4 | document:
5 | created_at: Créé le
6 | created_by: Crée par
7 | name: Nom
8 |
--------------------------------------------------------------------------------
/spec/factories/group_order_article_quantity.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | # requires order_article
5 | factory :group_order_article_quantity do
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Fixes line endings for Windows (Docker) environment, which are by default converted to crlf
2 | * text=auto
3 | *.sh text eol=lf
4 | proc-start text eol=lf
5 | Rakefile text eol=lf
6 |
--------------------------------------------------------------------------------
/config/importmap.rb:
--------------------------------------------------------------------------------
1 | # Pin npm packages by running ./bin/importmap
2 | pin 'application', preload: true
3 | pin 'trix'
4 | pin '@rails/actiontext', to: 'actiontext.js'
5 | pin 'trix-editor-overrides'
6 |
--------------------------------------------------------------------------------
/plugins/discourse/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | discourse:
3 | callback:
4 | invalid_nonce: Invalid nonce
5 | invalid_signature: Invalid signature
6 | logged_in: Logged in!
7 |
--------------------------------------------------------------------------------
/plugins/discourse/config/locales/es.yml:
--------------------------------------------------------------------------------
1 | es:
2 | discourse:
3 | callback:
4 | invalid_nonce: Nonce inválido
5 | invalid_signature: Firma inválida
6 | logged_in: Estás adentro!
7 |
--------------------------------------------------------------------------------
/plugins/discourse/config/locales/tr.yml:
--------------------------------------------------------------------------------
1 | tr:
2 | discourse:
3 | callback:
4 | invalid_nonce: Geçersiz nonce
5 | invalid_signature: Geçersiz imza
6 | logged_in: Giriş yapıldı!
7 |
--------------------------------------------------------------------------------
/spec/support/faker.rb:
--------------------------------------------------------------------------------
1 | module Faker
2 | class Unit
3 | class << self
4 | def unit
5 | %w[kg 1L 100ml piece bunch 500g].sample
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/serializers/stock_article_serializer.rb:
--------------------------------------------------------------------------------
1 | class StockArticleSerializer < ArticleSerializer
2 | attribute :quantity_available
3 |
4 | def quantity_available
5 | object.quantity
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/admin/finances/update_transaction_types.js.haml:
--------------------------------------------------------------------------------
1 | $('#transaction_types_table').html('#{escape_javascript(render("admin/finances/transaction_types"))}');
2 | $('#modalContainer').modal('hide');
3 |
--------------------------------------------------------------------------------
/app/views/shared/_base_errors.haml:
--------------------------------------------------------------------------------
1 | .alert.alert-danger
2 | %a.close{:href => '#', :data => {:dismiss => 'alert'}}
3 | = t('ui.marks.close').html_safe
4 | %ul
5 | = error_messages.html_safe
6 |
--------------------------------------------------------------------------------
/config/initializers/gaffe.rb:
--------------------------------------------------------------------------------
1 | if Rails.env.production? || Rails.env.staging?
2 | Gaffe.configure do |config|
3 | config.errors_controller = 'ErrorsController'
4 | end
5 | Gaffe.enable!
6 | end
7 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/db/migrate/20150301000000_add_last_activity_to_user.rb:
--------------------------------------------------------------------------------
1 | class AddLastActivityToUser < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :users, :last_activity, :datetime
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/overrides/admin/configs/_tab_others/add_current_orders.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains(":use_nick")'
2 | = config_input form, :use_current_orders, as: :boolean
3 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/articles/index.js.erb:
--------------------------------------------------------------------------------
1 | $('#article_list li:not(.keep)').remove();
2 | $('#article_list').append('<%= j(render('articles', orders: @current_orders)) %>');
3 |
--------------------------------------------------------------------------------
/plugins/discourse/config/locales/de.yml:
--------------------------------------------------------------------------------
1 | de:
2 | discourse:
3 | callback:
4 | invalid_nonce: Ungültige nonce
5 | invalid_signature: Ungültige Signature
6 | logged_in: Angemeldet!
7 |
--------------------------------------------------------------------------------
/plugins/messages/app/models/message_recipient.rb:
--------------------------------------------------------------------------------
1 | class MessageRecipient < ActiveRecord::Base
2 | belongs_to :message
3 | belongs_to :user
4 |
5 | enum email_state: %i[pending sent skipped]
6 | end
7 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: bundle exec rails server --binding=0.0.0.0 --port=$PORT
2 | worker: QUEUE=* bundle exec rake resque:work
3 | mail: bundle exec rake foodsoft:reply_email_smtp_server
4 | cron: supercronic crontab
5 |
--------------------------------------------------------------------------------
/app/models/mail_delivery_status.rb:
--------------------------------------------------------------------------------
1 | class MailDeliveryStatus < ApplicationRecord
2 | self.table_name = 'mail_delivery_status'
3 |
4 | belongs_to :user, foreign_key: 'email', primary_key: 'email'
5 | end
6 |
--------------------------------------------------------------------------------
/app/views/admin/finances/update_supplier_categories.js.haml:
--------------------------------------------------------------------------------
1 | $('#supplier_categories_table').html('#{escape_javascript(render("admin/finances/supplier_categories"))}');
2 | $('#modalContainer').modal('hide');
3 |
--------------------------------------------------------------------------------
/app/views/article_units/_create_link.html.haml:
--------------------------------------------------------------------------------
1 | = link_to t('.add'), article_units_path(unit: unit), class: 'btn default btn-xs', remote: true, method: :post, data: {'for-unit': unit, 'e2e-create-unit': unit}
2 |
--------------------------------------------------------------------------------
/db/migrate/20140921104907_remove_stale_memberships.rb:
--------------------------------------------------------------------------------
1 | class RemoveStaleMemberships < ActiveRecord::Migration[4.2]
2 | def up
3 | Membership.where.not(group_id: Group.ids).delete_all
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20171001000000_add_last_sent_mail_to_order.rb:
--------------------------------------------------------------------------------
1 | class AddLastSentMailToOrder < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :orders, :last_sent_mail, :datetime
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20181204060000_change_delivered_on_to_date.rb:
--------------------------------------------------------------------------------
1 | class ChangeDeliveredOnToDate < ActiveRecord::Migration[4.2]
2 | def change
3 | rename_column :deliveries, :delivered_on, :date
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/lib/api/errors.rb:
--------------------------------------------------------------------------------
1 | module Api::Errors
2 | class Error < StandardError; end
3 |
4 | # Authentication is handled by Doorkeeper, so no errors for that here
5 | class PermissionRequired < Error; end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/discourse/config/locales/nl.yml:
--------------------------------------------------------------------------------
1 | nl:
2 | discourse:
3 | callback:
4 | invalid_nonce: Onjuiste nonce
5 | invalid_signature: Onjuiste digitale handtekening
6 | logged_in: Ingelogd!
7 |
--------------------------------------------------------------------------------
/plugins/links/app/models/link.rb:
--------------------------------------------------------------------------------
1 | class Link < ApplicationRecord
2 | belongs_to :workgroup, optional: true
3 |
4 | validates_presence_of :name, :url
5 |
6 | scope :ordered, -> { order(:name) }
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/messages/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'actionbar', active: 'messages'
4 |
5 | #messages
6 | = render 'messages', messages: @messages, pagination: true
7 |
--------------------------------------------------------------------------------
/plugins/polls/app/overrides/admin/configs/_tab_others/add_polls_config.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_before ':root:first-child'
2 | .row
3 | .col-md-4
4 | = config_input form, :use_polls, as: :boolean
5 |
--------------------------------------------------------------------------------
/plugins/wiki/app/overrides/admin/configs/_tab_others/add_wiki_config.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_before ':root:first-child'
2 | .row
3 | .col-md-4
4 | = config_input form, :use_wiki, as: :boolean
5 |
--------------------------------------------------------------------------------
/plugins/wiki/app/overrides/sessions/new/public_frontpage.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'noscript'
2 | - if FoodsoftWiki.enabled? && (page = Page.public_front_page)
3 | = wikified_body page.body, page.title
4 |
--------------------------------------------------------------------------------
/app/views/admin/finances/_form.html.haml:
--------------------------------------------------------------------------------
1 | = simple_form_for [:admin, @financial_transaction_class] do |f|
2 | = f.input :name
3 | .form-group
4 | = f.button :submit
5 | = link_to t('ui.or_cancel'), :back
6 |
--------------------------------------------------------------------------------
/app/views/finance/bank_accounts/import.js.haml:
--------------------------------------------------------------------------------
1 | - if @js_redirect
2 | document.location.replace('#{escape_javascript(@js_redirect)}');
3 | - else
4 | $('#import').html('#{escape_javascript(render("import"))}');
5 |
--------------------------------------------------------------------------------
/db/migrate/20140521142651_add_sync_method_to_supplier.rb:
--------------------------------------------------------------------------------
1 | class AddSyncMethodToSupplier < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :suppliers, :shared_sync_method, :string
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/foodcoop/users/_users/new_message.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_bottom 'tbody tr'
2 | - if FoodsoftMessages.enabled?
3 | %td= link_to_new_message(message_params: {mail_to: user.id})
4 |
--------------------------------------------------------------------------------
/plugins/polls/app/views/polls/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | - content_for :actionbar do
4 | = link_to t('.new_poll'), new_poll_path, class: 'btn btn-primary'
5 |
6 | #polls
7 | = render 'polls'
8 |
--------------------------------------------------------------------------------
/plugins/polls/db/migrate/20181120000000_increase_choices_size.rb:
--------------------------------------------------------------------------------
1 | class IncreaseChoicesSize < ActiveRecord::Migration[4.2]
2 | def up
3 | change_column :polls, :choices, :text, limit: 65_535
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/javascript/application.js:
--------------------------------------------------------------------------------
1 | // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2 | import "trix"
3 | import "@rails/actiontext"
4 | import "trix-editor-overrides"
5 |
--------------------------------------------------------------------------------
/db/migrate/20171001020000_add_end_action_to_order.rb:
--------------------------------------------------------------------------------
1 | class AddEndActionToOrder < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :orders, :end_action, :integer, default: 0, null: false
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/documents/db/migrate/20171105000000_add_parent_to_document.rb:
--------------------------------------------------------------------------------
1 | class AddParentToDocument < ActiveRecord::Migration[4.2]
2 | def change
3 | add_reference :documents, :parent, index: true
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/spec/factories/article_unit.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | factory :article_unit do
5 | sequence(:unit) { |n| Faker::Lorem.characters(number: rand(2..12)) + " ##{n}" }
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/models/stock_event.rb:
--------------------------------------------------------------------------------
1 | class StockEvent < ApplicationRecord
2 | has_many :stock_changes, dependent: :destroy
3 | has_many :stock_articles, through: :stock_changes
4 |
5 | validates :date, presence: true
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160217124256_add_created_by_user_id_to_invoice.rb:
--------------------------------------------------------------------------------
1 | class AddCreatedByUserIdToInvoice < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :invoices, :created_by_user_id, :integer
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20171105000000_add_parent_to_document.foodsoft_documents_engine.rb:
--------------------------------------------------------------------------------
1 | class AddParentToDocument < ActiveRecord::Migration[4.2]
2 | def change
3 | add_reference :documents, :parent, index: true
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20181120000000_increase_choices_size.foodsoft_polls_engine.rb:
--------------------------------------------------------------------------------
1 | class IncreaseChoicesSize < ActiveRecord::Migration[4.2]
2 | def up
3 | change_column :polls, :choices, :text, limit: 65_535
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/ordergroups/show.js.erb:
--------------------------------------------------------------------------------
1 | // untested
2 | $('h1, title').html('<%= j t('.title', name: @ordergroup.name) %>');
3 | $('#articles_by_groups').html('<%= j render('articles') %>');
4 |
--------------------------------------------------------------------------------
/plugins/polls/app/models/poll_vote.rb:
--------------------------------------------------------------------------------
1 | class PollVote < ActiveRecord::Base
2 | belongs_to :poll
3 | belongs_to :ordergroup, optional: true
4 | belongs_to :user
5 | has_many :poll_choices, dependent: :destroy
6 | end
7 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/ie_hacks.css:
--------------------------------------------------------------------------------
1 | #nav {
2 | text-align: left; }
3 | #nav ul {
4 | margin: 0; }
5 | #nav ul li.current a:hover {
6 | color: white; }
7 | #nav ul li.current ul {
8 | width: 100%; }
9 |
--------------------------------------------------------------------------------
/app/views/shared/_alert_success.haml:
--------------------------------------------------------------------------------
1 | .alert.fade.in.alert-success
2 | %a.close{:href => '#', :data => {:dismiss => 'alert'}}
3 | = t('ui.marks.close').html_safe
4 | = t('ui.marks.success').html_safe
5 | = alert_message
6 |
--------------------------------------------------------------------------------
/app/views/tasks/workgroup.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', workgroup: @group.name)
2 | = render 'nav'
3 |
4 | %section
5 | %h3= t '.title_all'
6 | = render 'shared/task_list', tasks: @group.open_tasks
7 | %br/
8 | = link_to_top
9 |
--------------------------------------------------------------------------------
/db/migrate/20160217164552_add_break_to_group.rb:
--------------------------------------------------------------------------------
1 | class AddBreakToGroup < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :groups, :break_start, :date
4 | add_column :groups, :break_end, :date
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20171111000000_add_role_pickups_to_group.rb:
--------------------------------------------------------------------------------
1 | class AddRolePickupsToGroup < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :groups, :role_pickups, :boolean, default: false, null: false
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20190100000008_add_bank_account_to_supplier_category.rb:
--------------------------------------------------------------------------------
1 | class AddBankAccountToSupplierCategory < ActiveRecord::Migration[4.2]
2 | def change
3 | add_reference :supplier_categories, :bank_account
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/admin/workgroups/show/new_message.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains("delete")'
2 | - if FoodsoftMessages.enabled?
3 | = link_to_new_message(message_params: {group_id: @workgroup.id})
4 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/foodcoop/ordergroups/_ordergroups/new_message.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_bottom 'tbody tr'
2 | - if FoodsoftMessages.enabled?
3 | %td= link_to_new_message(message_params: {group_id: ordergroup.id})
4 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/home/_start_nav/new_message.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains("tasks")'
2 | - if FoodsoftMessages.enabled?
3 | = link_to t('.write_message'), new_message_path, class: 'list-group-item'
4 |
--------------------------------------------------------------------------------
/plugins/wiki/app/overrides/home/index/dashboard.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb[silent]:contains("")'
2 | - if FoodsoftWiki.enabled? && (page = Page.dashboard)
3 | = wikified_body page.body, page.title
4 |
--------------------------------------------------------------------------------
/spec/factories/article_category.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | factory :article_category do
5 | sequence(:name) { |n| Faker::Lorem.characters(number: rand(2..12)) + " ##{n}" }
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/models/order_comment.rb:
--------------------------------------------------------------------------------
1 | class OrderComment < ApplicationRecord
2 | belongs_to :order
3 | belongs_to :user
4 |
5 | validates :order_id, :user_id, :text, presence: true
6 | validates :text, length: { minimum: 3 }
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/stock_takings/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = simple_form_for(@stock_taking) do |f|
4 | = f.input :date
5 | = f.input :note
6 | = f.button :submit
7 | = link_to t('ui.or_cancel'), stock_takings_path
8 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 | require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
5 |
--------------------------------------------------------------------------------
/db/migrate/20160217194036_add_role_invoices_to_group.rb:
--------------------------------------------------------------------------------
1 | class AddRoleInvoicesToGroup < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :groups, :role_invoices, :boolean, default: false, null: false
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/documents/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | scope '/:foodcoop' do
3 | resources :documents do
4 | get :move
5 | get :new
6 | get :new_folder
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/links/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | scope '/:foodcoop' do
3 | resources :links, only: [:show]
4 |
5 | namespace :admin do
6 | resources :links
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/foodcoop/workgroups/_workgroup/new_message.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains("tasks")'
2 | - if FoodsoftMessages.enabled?
3 | = link_to_new_message message_params: {group_id: workgroup.id}
4 |
--------------------------------------------------------------------------------
/app/views/foodcoop/workgroups/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = t('.body').html_safe
4 |
5 | = render :partial => "workgroup", :collection => @workgroups
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/db/migrate/20181201000210_add_group_order_to_financial_transaction.rb:
--------------------------------------------------------------------------------
1 | class AddGroupOrderToFinancialTransaction < ActiveRecord::Migration[4.2]
2 | def change
3 | add_reference :financial_transactions, :group_order
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/current_orders/lib/foodsoft_current_orders.rb:
--------------------------------------------------------------------------------
1 | require 'deface'
2 | require 'foodsoft_current_orders/engine'
3 |
4 | module FoodsoftCurrentOrders
5 | def self.enabled?
6 | FoodsoftConfig[:use_current_orders]
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/links/app/views/admin/links/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | - content_for :actionbar do
4 | = link_to t('.new_link'), new_admin_link_path, remote: true, class: 'btn btn-primary'
5 |
6 | #links
7 | = render "links"
8 |
--------------------------------------------------------------------------------
/plugins/polls/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | scope '/:foodcoop' do
3 | resources :polls do
4 | member do
5 | get :vote
6 | post :vote
7 | end
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/articles/_destroy_active_article.html.haml:
--------------------------------------------------------------------------------
1 | %tr.edit_inline{:id=> "edit_"+@article.id.to_s}
2 | %td{:colspan=>"10"}
3 | = t('.note', article: h(@article.name), drop_link: link_to(t('.drop'), edit_order_path(@order))).html_safe
4 |
--------------------------------------------------------------------------------
/config/initializers/rack.rb:
--------------------------------------------------------------------------------
1 | # Increase key space for post request.
2 | # Warning, this is dangerous. See http://stackoverflow.com/questions/12243694/getting-error-exceeded-available-parameter-key-space
3 | Rack::Utils.key_space_limit = 262_144
4 |
--------------------------------------------------------------------------------
/db/migrate/20161001000000_add_iban_to_supplier_and_user.rb:
--------------------------------------------------------------------------------
1 | class AddIbanToSupplierAndUser < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :suppliers, :iban, :string
4 | add_column :users, :iban, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/mollie/app/overrides/home/ordergroup/new_payment_button.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb[silent]:contains("")'
2 | = link_to t('.credit_your_account'), new_payments_mollie_path, class: 'btn btn-default'
3 |
--------------------------------------------------------------------------------
/spec/factories/article_unit_ratio.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | factory :article_unit_ratio do
5 | unit { 'XPP' }
6 | sort { 1 }
7 | quantity { 1 }
8 | article_version
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20240726083744_add_unit_migration_completed_to_suppliers.rb:
--------------------------------------------------------------------------------
1 | class AddUnitMigrationCompletedToSuppliers < ActiveRecord::Migration[5.2]
2 | def change
3 | add_column :suppliers, :unit_migration_completed, :datetime
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/message_threads/show.haml:
--------------------------------------------------------------------------------
1 | - if @group.nil?
2 | - title t '.general'
3 | - else
4 | - title @group.name
5 |
6 | #message_threads
7 | = render 'message_threads', message_threads: @message_threads, pagination: true
8 |
--------------------------------------------------------------------------------
/app/views/article_units/_destroy_link.html.haml:
--------------------------------------------------------------------------------
1 | =link_to t('.delete'), article_unit, method: :delete, class: 'btn btn-xs btn-danger', remote: true, data: { confirm: t('.confirm'), 'for-unit': article_unit.unit, 'e2e-destroy-unit': article_unit.unit }
2 |
--------------------------------------------------------------------------------
/db/migrate/20181205010000_add_bank_account_to_financial_transaction_type.rb:
--------------------------------------------------------------------------------
1 | class AddBankAccountToFinancialTransactionType < ActiveRecord::Migration[4.2]
2 | def change
3 | add_reference :financial_transaction_types, :bank_account
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20250528114335_add_remote_auto_sync_to_suppliers.rb:
--------------------------------------------------------------------------------
1 | class AddRemoteAutoSyncToSuppliers < ActiveRecord::Migration[7.0]
2 | def change
3 | add_column :suppliers, :remote_auto_sync, :boolean, null: false, default: false
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/admin/users/show/new_message.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains("delete")'
2 | - if FoodsoftMessages.enabled?
3 | = link_to t('.send_message'), new_message_path(:message => {:mail_to => @user.id}), class: 'btn'
4 |
--------------------------------------------------------------------------------
/plugins/mollie/app/overrides/home/index/new_payment_link.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb[silent]:contains("")'
2 | = link_to new_payments_mollie_path do
3 | = t '.credit_your_account'
4 | %i.icon.icon-chevron-right
5 |
--------------------------------------------------------------------------------
/app/controllers/api/v1/user/users_controller.rb:
--------------------------------------------------------------------------------
1 | class Api::V1::User::UsersController < Api::V1::BaseController
2 | before_action -> { doorkeeper_authorize! 'user:read', 'user:write' }
3 |
4 | def show
5 | render json: current_user
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/helpers/order_articles_helper.rb:
--------------------------------------------------------------------------------
1 | module OrderArticlesHelper
2 | def article_label_with_unit(article)
3 | pkg_info = pkg_helper(article, plain: true)
4 | "#{article.name} (#{[article.unit, pkg_info].compact_blank.join(' ')})"
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/views/mailer/welcome.text.haml:
--------------------------------------------------------------------------------
1 | = raw t '.text0', user: show_user(@user)
2 | - if @additional_text
3 | \
4 | = raw @additional_text
5 | \
6 | = raw t '.text1', link: @link, expires: I18n.l(@user.reset_password_expires), foodcoop: FoodsoftConfig[:name]
7 |
--------------------------------------------------------------------------------
/app/views/shared/_comments.haml:
--------------------------------------------------------------------------------
1 | - comments.each do |comment|
2 | .comment[comment]
3 | %strong= comment.user.try(:ordergroup_name)
4 | %small (#{show_user comment.user} am #{format_time(comment.created_at)}):
5 | = simple_format(comment.text)
6 |
--------------------------------------------------------------------------------
/app/views/stockit/copy.js.erb:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('<%= j(render(
2 | :partial => "form",
3 | :locals => {
4 | :title => t('.title'),
5 | :stock_article => @stock_article
6 | }
7 | )) %>');
8 |
9 | $('#modalContainer').modal();
10 |
--------------------------------------------------------------------------------
/app/views/stockit/derive.js.erb:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('<%= j(render(
2 | :partial => "form",
3 | :locals => {
4 | :title => t('.title'),
5 | :stock_article => @stock_article
6 | }
7 | )) %>');
8 |
9 | $('#modalContainer').modal();
10 |
--------------------------------------------------------------------------------
/app/views/stockit/edit.js.erb:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('<%= j(render(
2 | :partial => "form",
3 | :locals => {
4 | :title => t('.title'),
5 | :stock_article => @stock_article
6 | }
7 | )) %>');
8 |
9 | $('#modalContainer').modal();
10 |
--------------------------------------------------------------------------------
/app/views/stockit/new.js.erb:
--------------------------------------------------------------------------------
1 | $('#modalContainer').html('<%= j(render(
2 | :partial => "form",
3 | :locals => {
4 | :title => t('.title'),
5 | :stock_article => @stock_article
6 | }
7 | )) %>');
8 |
9 | $('#modalContainer').modal();
10 |
--------------------------------------------------------------------------------
/db/migrate/20181013195028_add_confidential_to_applications.rb:
--------------------------------------------------------------------------------
1 | class AddConfidentialToApplications < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :oauth_applications, :confidential, :boolean, null: false, default: true
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/views/stock_takings/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | .well.well-small
4 | .btn-group
5 | = link_to t('.new_inventory'), new_stock_taking_path, class: 'btn btn-primary'
6 |
7 | #StockTakingsTable= render 'stock_takings'
8 |
9 |
10 |
--------------------------------------------------------------------------------
/db/migrate/20181201000300_allow_emtpy_ordergroup_in_financial_transaction.rb:
--------------------------------------------------------------------------------
1 | class AllowEmtpyOrdergroupInFinancialTransaction < ActiveRecord::Migration[4.2]
2 | def change
3 | change_column_null :financial_transactions, :ordergroup_id, true
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/020_add_users_last_login.rb:
--------------------------------------------------------------------------------
1 | class AddUsersLastLogin < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :users, :last_login, :datetime
4 | end
5 |
6 | def self.down
7 | remove_column :users, :last_login
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20090811144901_add_weekly_to_tasks.rb:
--------------------------------------------------------------------------------
1 | class AddWeeklyToTasks < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :tasks, :weekly, :boolean
4 | end
5 |
6 | def self.down
7 | remove_column :tasks, :weekly
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20130624084223_remove_weekly_from_tasks.rb:
--------------------------------------------------------------------------------
1 | class RemoveWeeklyFromTasks < ActiveRecord::Migration[4.2]
2 | def up
3 | remove_column :tasks, :weekly
4 | end
5 |
6 | def down
7 | add_column :tasks, :weekly, :boolean
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20150227161931_add_replyto_and_groupid_to_messages.rb:
--------------------------------------------------------------------------------
1 | class AddReplytoAndGroupidToMessages < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :messages, :reply_to, :integer
4 | add_column :messages, :group_id, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/admin/ordergroups/show/new_message.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains("delete")'
2 | - if FoodsoftMessages.enabled?
3 | = link_to t('.send_message'), new_message_path(:message => {:group_id => @ordergroup.id}), class: 'btn'
4 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/orders/show/add_message_button.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains("title t(\'.title\'")'
2 | - content_for :actionbar do
3 | - if FoodsoftMessages.enabled?
4 | = link_to_new_message message_params: {order_id: @order.id}
5 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/admin/messagegroups/_form.html.haml:
--------------------------------------------------------------------------------
1 | .col-md-4
2 | = simple_form_for [:admin, @messagegroup] do |f|
3 | = render 'shared/group_form_fields', :f => f
4 | %div
5 | = f.button :submit
6 | = link_to t('ui.or_cancel'), :back
7 |
--------------------------------------------------------------------------------
/plugins/printer/lib/foodsoft_printer.rb:
--------------------------------------------------------------------------------
1 | require 'foodsoft_printer/engine'
2 | require 'foodsoft_printer/order_printer_jobs'
3 | require 'tubesock'
4 |
5 | module FoodsoftPrinter
6 | def self.enabled?
7 | FoodsoftConfig[:use_printer]
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20121216180646_remove_assigned_from_tasks.rb:
--------------------------------------------------------------------------------
1 | class RemoveAssignedFromTasks < ActiveRecord::Migration[4.2]
2 | def up
3 | remove_column :tasks, :assigned
4 | end
5 |
6 | def down
7 | add_column :tasks, :assigned, :boolean
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/models/stock_taking.rb:
--------------------------------------------------------------------------------
1 | class StockTaking < StockEvent
2 | def stock_change_attributes=(stock_change_attributes)
3 | for attributes in stock_change_attributes
4 | stock_changes.build(attributes) unless attributes[:quantity].to_i == 0
5 | end
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20090812110010_add_note_to_deliveries.rb:
--------------------------------------------------------------------------------
1 | class AddNoteToDeliveries < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :deliveries, :note, :text
4 | end
5 |
6 | def self.down
7 | remove_column :deliveries, :note
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/articles/show.js.erb:
--------------------------------------------------------------------------------
1 | $('#order_article').replaceWith('<%= j(render('article', order_article: @order_article)) if @order_article %>');
2 | // add javascript improvements (delta)
3 | $(document).trigger('#update_articles_summary');
4 |
--------------------------------------------------------------------------------
/plugins/messages/db/migrate/20160226000000_add_email_to_message.rb:
--------------------------------------------------------------------------------
1 | class AddEmailToMessage < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :messages, :salt, :string
4 | add_column :messages, :received_email, :binary, limit: 1.megabyte
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/views/mailer/not_enough_users_assigned.text.haml:
--------------------------------------------------------------------------------
1 | = raw t '.text', user: @user.first_name, task: @task.name, when: I18n.l(@task.due_date, format: t('mailer.dateformat')), workgroup_tasks_url: workgroup_tasks_url(workgroup_id: @task.workgroup_id), user_tasks_url: user_tasks_url
2 |
--------------------------------------------------------------------------------
/db/migrate/20130930132511_add_quantities_to_order_article.rb:
--------------------------------------------------------------------------------
1 | class AddQuantitiesToOrderArticle < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :order_articles, :units_billed, :integer
4 | add_column :order_articles, :units_received, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160218151041_add_attachment_to_invoice.rb:
--------------------------------------------------------------------------------
1 | class AddAttachmentToInvoice < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :invoices, :attachment_mime, :string
4 | add_column :invoices, :attachment_data, :binary, limit: 8.megabytes
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/documents/app/overrides/admin/configs/_tab_others/add_documents_config.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after ':root:last-child'
2 | .row
3 | .col-md-4
4 | = config_use_heading form, :use_documents do
5 | = config_input form, :documents_allowed_extension, as: :string
6 |
--------------------------------------------------------------------------------
/app/helpers/path_helper.rb:
--------------------------------------------------------------------------------
1 | module PathHelper
2 | def finance_group_transactions_path(ordergroup)
3 | if ordergroup
4 | finance_ordergroup_transactions_path(ordergroup)
5 | else
6 | finance_foodcoop_financial_transactions_path
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/serializers/group_order_article_serializer.rb:
--------------------------------------------------------------------------------
1 | class GroupOrderArticleSerializer < ActiveModel::Serializer
2 | attributes :id, :order_article_id
3 | attributes :quantity, :tolerance, :result, :total_price
4 |
5 | def total_price
6 | object.total_price.to_f
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/article_categories/_form.html.haml:
--------------------------------------------------------------------------------
1 | = simple_form_for @article_category do |f|
2 | = f.input :name
3 | = f.input :description, as: :text, input_html: {class: 'form-control'}
4 | %div
5 | = f.button :submit
6 | = link_to t('ui.or_cancel'), article_categories_path
7 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require File.expand_path('config/environment', __dir__)
4 |
5 | # https://gist.github.com/ebeigarts/5450422
6 | map ENV.fetch('RAILS_RELATIVE_URL_ROOT', '/') do
7 | run Foodsoft::Application
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20110507184920_add_duration_to_tasks.rb:
--------------------------------------------------------------------------------
1 | class AddDurationToTasks < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :tasks, :duration, :integer, default: 1
4 | end
5 |
6 | def self.down
7 | remove_column :tasks, :duration
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/discourse/app/overrides/sessions/new/insert_link.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'noscript'
2 | - if FoodsoftDiscourse.enabled? && !FoodsoftConfig[:discourse_sso]
3 | .center
4 | = link_to t('.discourse_login'), discourse_initiate_path, class: 'btn btn-primary'
5 | %hr
6 |
--------------------------------------------------------------------------------
/plugins/discourse/lib/foodsoft_discourse.rb:
--------------------------------------------------------------------------------
1 | require 'foodsoft_discourse/engine'
2 | require 'foodsoft_discourse/redirect_to_login'
3 |
4 | module FoodsoftDiscourse
5 | def self.enabled?
6 | FoodsoftConfig[:discourse_url] && FoodsoftConfig[:discourse_sso_secret]
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/admin/configs/_tab_messages/add_config.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_bottom ':root:last-child'
2 | = config_use_heading form, :use_messages do
3 | = config_input form, :mailing_list, as: :string
4 | = config_input form, :mailing_list_subscribe, as: :string
5 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/diff.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', title: @page.title, old: @old_version.lock_version, new: @new_version.lock_version)
2 |
3 | %style= Diffy::CSS
4 | = raw @diff
5 |
6 | %hr
7 | = link_to t('ui.back'), 'javascript:history.go(-1)', class: 'btn btn-primary'
8 |
--------------------------------------------------------------------------------
/spec/factories/group_order.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | # requires order
5 | factory :group_order do
6 | ordergroup { create(:user, groups: [FactoryBot.create(:ordergroup)]).ordergroup }
7 | updated_by { create(:user) }
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/javascript/trix-editor-overrides.js:
--------------------------------------------------------------------------------
1 | // app/javascript/trix-editor-overrides.js
2 | window.addEventListener("trix-file-accept", function(event) {
3 | if (event.file.size > 1024 * 1024 * 512) {
4 | event.preventDefault()
5 | alert(I18n.t('js.trix_editor.file_size_alert'))
6 | }
7 | })
--------------------------------------------------------------------------------
/app/views/admin/mail_delivery_status/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | - content_for :actionbar do
4 | = link_to t('.destroy_all'), admin_mail_delivery_status_index_path, :method => :delete, class: 'btn btn-danger'
5 |
6 | #maildeliverystatus
7 | = render "maildeliverystatus"
8 |
--------------------------------------------------------------------------------
/app/views/invites/new.html.haml:
--------------------------------------------------------------------------------
1 | = t('.body', group: @invite.group.name).html_safe
2 | = simple_form_for @invite do |form|
3 | = form.hidden_field :user_id
4 | = form.hidden_field :group_id
5 | = form.input :email
6 | = form.submit t('.action')
7 | = link_to t('ui.or_cancel'), :back
8 |
--------------------------------------------------------------------------------
/db/migrate/017_add_min_order_quantity.rb:
--------------------------------------------------------------------------------
1 | class AddMinOrderQuantity < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :suppliers, :min_order_quantity, :string
4 | end
5 |
6 | def self.down
7 | remove_column :suppliers, :min_order_quantity
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/025_extend_comments.rb:
--------------------------------------------------------------------------------
1 | class ExtendComments < ActiveRecord::Migration[4.2]
2 | def self.up
3 | change_column :comments, :comment, :text, default: ''
4 | end
5 |
6 | def self.down
7 | change_column :comments, :comment, :string, default: ''
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20140102170431_add_result_computed_to_group_order_articles.rb:
--------------------------------------------------------------------------------
1 | class AddResultComputedToGroupOrderArticles < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :group_order_articles, :result_computed,
4 | :decimal, precision: 8, scale: 3
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/discourse/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | scope '/:foodcoop' do
3 | get '/discourse/callback' => 'discourse_login#callback'
4 | get '/discourse/initiate' => 'discourse_login#initiate'
5 | get '/discourse/sso' => 'discourse_sso#sso'
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/mollie/Gemfile:
--------------------------------------------------------------------------------
1 | source 'http://rubygems.org'
2 |
3 | # Declare your gem's dependencies in foodsoft_mollie.gemspec.
4 | # Bundler will treat runtime dependencies like base dependencies, and
5 | # development dependencies will be added by default to the :development group.
6 | gemspec
7 |
--------------------------------------------------------------------------------
/plugins/polls/app/views/polls/_choice.haml:
--------------------------------------------------------------------------------
1 | .row.mt-1
2 | .col-md-10
3 | = text_field_tag 'poll[choices][]', value, class: 'form-control'
4 | .col-md-2
5 | = link_to t('.remove'), "#", title: t('.remove_choice'), 'data-remove-choice' => true,
6 | class: 'btn btn-default btn-sm'
7 |
--------------------------------------------------------------------------------
/app/helpers/finance/invoices_helper.rb:
--------------------------------------------------------------------------------
1 | module Finance::InvoicesHelper
2 | def format_delivery_item(delivery)
3 | format_date(delivery.date)
4 | end
5 |
6 | def format_order_item(order)
7 | "#{format_date(order.ends)} (#{number_to_currency(order.sum)})"
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/views/layouts/email.text.haml:
--------------------------------------------------------------------------------
1 | = yield
2 | \
3 | = t '.footer_1_separator'
4 | = t '.footer_2_foodsoft', url: root_url
5 | = t '.footer_3_homepage', url: FoodsoftConfig[:homepage] if FoodsoftConfig[:homepage]
6 | = t '.footer_4_help', url: FoodsoftConfig[:help_url] if FoodsoftConfig[:help_url]
7 |
--------------------------------------------------------------------------------
/app/views/order_articles/create.js.erb:
--------------------------------------------------------------------------------
1 | // Publish database changes.
2 | // See publish/subscribe design pattern in /doc.
3 | $(document).trigger({
4 | type: 'OrderArticle#create',
5 | order_article_id: <%= @order_article.id %>
6 | });
7 |
8 | $('#modalContainer').modal('hide');
9 |
10 |
--------------------------------------------------------------------------------
/app/views/order_articles/update.js.erb:
--------------------------------------------------------------------------------
1 | // Publish database changes.
2 | // See publish/subscribe design pattern in /doc.
3 | $(document).trigger({
4 | type: 'OrderArticle#update',
5 | order_article_id: <%= @order_article.id %>
6 | });
7 |
8 | $('#modalContainer').modal('hide');
9 |
10 |
--------------------------------------------------------------------------------
/app/views/orders/new.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'form'
4 | - if @order.article_ids.empty?
5 | - content_for :javascript do
6 | :javascript
7 | // select all articles by default
8 | $(function() {
9 | $('#checkall').click();
10 | });
11 |
--------------------------------------------------------------------------------
/config/initializers/application_controller_renderer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # ActiveSupport::Reloader.to_prepare do
4 | # ApplicationController.renderer.defaults.merge!(
5 | # http_host: 'example.org',
6 | # https: false
7 | # )
8 | # end
9 |
--------------------------------------------------------------------------------
/db/migrate/20181201000220_add_transport_to_order.rb:
--------------------------------------------------------------------------------
1 | class AddTransportToOrder < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :orders, :transport, :decimal, precision: 8, scale: 2
4 | add_column :group_orders, :transport, :decimal, precision: 8, scale: 2
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/serializers/order_serializer.rb:
--------------------------------------------------------------------------------
1 | class OrderSerializer < ActiveModel::Serializer
2 | attributes :id, :name, :starts, :ends, :boxfill, :pickup, :is_open, :is_boxfill
3 |
4 | def is_open
5 | object.open?
6 | end
7 |
8 | def is_boxfill
9 | object.boxfill?
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Specify a serializer for the signed and encrypted cookie jars.
4 | # Valid options are :json, :marshal, and :hybrid.
5 | Rails.application.config.action_dispatch.cookies_serializer = :marshal
6 |
--------------------------------------------------------------------------------
/db/migrate/20240410093313_change_bank_account_desc.rb:
--------------------------------------------------------------------------------
1 | class ChangeBankAccountDesc < ActiveRecord::Migration[7.0]
2 | def up
3 | change_column :bank_accounts, :description, :text
4 | end
5 |
6 | def down
7 | change_column :bank_accounts, :description, :string
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/inputs/date_picker_input.rb:
--------------------------------------------------------------------------------
1 | class DatePickerInput < SimpleForm::Inputs::StringInput
2 | def input(wrapper_options)
3 | options = merge_wrapper_options(input_html_options, wrapper_options)
4 | @builder.text_field attribute_name, options.merge(class: 'form-control datepicker')
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/models/article_unit_ratio.rb:
--------------------------------------------------------------------------------
1 | class ArticleUnitRatio < ApplicationRecord
2 | belongs_to :article_version
3 |
4 | default_scope { order(sort: :asc) }
5 |
6 | validates :quantity, :sort, :unit, presence: true
7 | validates :quantity, numericality: { greater_than: 0, less_than: 10**35 }
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/order_comments/_form.html.haml:
--------------------------------------------------------------------------------
1 | .col-md-3
2 | = simple_form_for order_comment, remote: true, wrapper: :vertical_form do |f|
3 | = f.hidden_field :order_id
4 | = f.hidden_field :user_id
5 | = f.input :text, input_html: {class: 'col-md-3', rows: '5', cols: '3'}
6 | = f.button :submit
7 |
--------------------------------------------------------------------------------
/bin/rubocop:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require "rubygems"
3 | require "bundler/setup"
4 |
5 | # explicit rubocop config increases performance slightly while avoiding config confusion.
6 | ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7 |
8 | load Gem.bin_path("rubocop", "rubocop")
9 |
--------------------------------------------------------------------------------
/bin/test:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # We use TEST_DATABASE_URL to make sure we don't accidentaly overwrite dev/prod db
4 | unset DATABASE_URL; export DATABASE_URL
5 | [ "$TEST_DATABASE_URL" ] && export DATABASE_URL="$TEST_DATABASE_URL"
6 | export RAILS_ENV=test
7 |
8 | # Start tests
9 | bundle exec rspec $@
10 |
--------------------------------------------------------------------------------
/bin/yarn:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_ROOT = File.expand_path('..', __dir__)
3 | Dir.chdir(APP_ROOT) do
4 | exec 'yarnpkg', *ARGV
5 | rescue Errno::ENOENT
6 | warn 'Yarn executable was not detected in the system.'
7 | warn 'Download Yarn at https://yarnpkg.com/en/docs/install'
8 | exit 1
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20171201000000_add_name_short_to_financial_transaction_type.rb:
--------------------------------------------------------------------------------
1 | class AddNameShortToFinancialTransactionType < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :financial_transaction_types, :name_short, :string
4 | add_index :financial_transaction_types, :name_short
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/_body.html.haml:
--------------------------------------------------------------------------------
1 | - content = wikified_body @page.body, @page.title
2 | - toc = generate_toc @page.body
3 |
4 | - unless toc.blank? || params[:preview]
5 | - content_for :sidebar do
6 | #wikitoc.well.well-small
7 | %h3= t '.title_toc'
8 | = toc
9 | = content
10 |
--------------------------------------------------------------------------------
/app/controllers/api/v1/configs_controller.rb:
--------------------------------------------------------------------------------
1 | class Api::V1::ConfigsController < Api::V1::BaseController
2 | before_action -> { doorkeeper_authorize! 'config:user', 'config:read', 'config:write' }
3 |
4 | def show
5 | render json: FoodsoftConfig, serializer: ConfigSerializer, root: 'config'
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/finance/invoices/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | - content_for :actionbar do
4 | = link_to t('.show_unpaid'), unpaid_finance_invoices_path, class: 'btn btn-default'
5 | = link_to t('.action_new'), new_finance_invoice_path, class: 'btn btn-primary'
6 |
7 | #invoicesTable= render 'invoices'
8 |
--------------------------------------------------------------------------------
/app/views/mailer/negative_balance.text.haml:
--------------------------------------------------------------------------------
1 | = raw t '.text', group: @group.name, when: format_time(@transaction.created_on), balance: number_to_currency(@group.account_balance), amount: number_to_currency(@transaction.amount), note: @transaction.note, user: show_user(@transaction.user), foodcoop: FoodsoftConfig[:name]
2 |
--------------------------------------------------------------------------------
/db/migrate/20110507192928_add_task_duration_to_workgroups.rb:
--------------------------------------------------------------------------------
1 | class AddTaskDurationToWorkgroups < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :groups, :task_duration, :integer, default: 1
4 | end
5 |
6 | def self.down
7 | remove_column :groups, :task_duration
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20121112093327_add_created_by_user_id_to_orders.rb:
--------------------------------------------------------------------------------
1 | class AddCreatedByUserIdToOrders < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :orders, :created_by_user_id, :integer
4 | end
5 |
6 | def self.down
7 | remove_column :orders, :created_by_user_id
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20121230142516_remove_account_updated_from_ordergroups.rb:
--------------------------------------------------------------------------------
1 | class RemoveAccountUpdatedFromOrdergroups < ActiveRecord::Migration[4.2]
2 | def up
3 | remove_column :groups, :account_updated
4 | end
5 |
6 | def down
7 | add_column :groups, :account_updated, :datetime
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20181201000200_add_deleted_to_financial_transaction_type.rb:
--------------------------------------------------------------------------------
1 | class AddDeletedToFinancialTransactionType < ActiveRecord::Migration[4.2]
2 | def change
3 | change_table :financial_transactions do |t|
4 | t.integer :reverts_id
5 | t.index :reverts_id, unique: true
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/group_orders/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | // Article box
4 | %section
5 | .column_content#result
6 | = render 'result'
7 |
8 | .well
9 | = render 'payment_bar', ordergroup: @ordergroup
10 |
11 | %br/
12 | = link_to_top
13 |
14 |
--------------------------------------------------------------------------------
/script/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3 |
4 | APP_PATH = File.expand_path('../config/application', __dir__)
5 | require File.expand_path('../config/boot', __dir__)
6 | require 'rails/commands'
7 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env rake
2 | # Add your own tasks in files placed in lib/tasks ending in .rake,
3 |
4 | require File.expand_path('config/application', __dir__)
5 | require 'rake'
6 | require 'rspec-rerun/tasks' if defined?(RSpec) # http://stackoverflow.com/a/16853615/2866660
7 |
8 | Foodsoft::Application.load_tasks
9 |
--------------------------------------------------------------------------------
/app/models/bank_gateway.rb:
--------------------------------------------------------------------------------
1 | class BankGateway < ApplicationRecord
2 | has_many :bank_accounts, dependent: :nullify
3 | belongs_to :unattended_user, class_name: 'User', optional: true
4 |
5 | scope :with_unattended_support, -> { where.not(unattended_user: nil) }
6 |
7 | validates :name, :url, presence: true
8 | end
9 |
--------------------------------------------------------------------------------
/config/initializers/01_load_app_config.rb:
--------------------------------------------------------------------------------
1 | # Initial load the default config and database from rails environment
2 | # See config/app_config.yml for further details
3 | # Load Config, start by selecting defaults via current environment
4 | require 'foodsoft_config'
5 | FoodsoftConfig.init
6 | FoodsoftConfig.init_mailing
7 |
--------------------------------------------------------------------------------
/db/migrate/20090731132547_add_stats_to_groups.rb:
--------------------------------------------------------------------------------
1 | class AddStatsToGroups < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :groups, :stats, :text
4 |
5 | Ordergroup.all.each { |o| o.update_stats! }
6 | end
7 |
8 | def self.down
9 | remove_column :groups, :stats
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20130920201529_allow_missing_nick.rb:
--------------------------------------------------------------------------------
1 | class AllowMissingNick < ActiveRecord::Migration[4.2]
2 | def self.up
3 | change_column :users, :nick, :string, default: nil, null: true
4 | end
5 |
6 | def self.down
7 | change_column :users, :nick, :string, default: '', null: false
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/serializers/order_article_serializer.rb:
--------------------------------------------------------------------------------
1 | class OrderArticleSerializer < ActiveModel::Serializer
2 | attributes :id, :order_id, :price
3 | attributes :quantity, :tolerance, :units_to_order
4 |
5 | has_one :article_version
6 |
7 | def price
8 | object.article_version.fc_price.to_f
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/new.js.haml:
--------------------------------------------------------------------------------
1 | $('#results').html('#{j(render(balancing_view_partial, order: @order))}');
2 | $('*[name="group_order_article[result]"]').each((_, field) => $(field).unitConversionField({units: unitsData, popoverTemplate$: $('#unit_conversion_popover_content_template'), useTargetUnitForStep: false}));
3 |
--------------------------------------------------------------------------------
/app/views/layouts/email.html.haml:
--------------------------------------------------------------------------------
1 | = yield
2 | \
3 | %hr
4 | %ul
5 | %li
6 | %a{href: root_url} Foodsoft
7 | - if FoodsoftConfig[:homepage]
8 | %li
9 | %a{href: FoodsoftConfig[:homepage]} Foodcoop
10 | - if FoodsoftConfig[:help_url]
11 | %li
12 | %a{href: FoodsoftConfig[:help_url]}= t '.help'
--------------------------------------------------------------------------------
/plugins/mollie/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | scope '/:foodcoop' do
3 | namespace :payments do
4 | resource :mollie, controller: 'mollie', only: %i[new create] do
5 | post :check
6 | get :result
7 | get :cancel
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/polls/lib/foodsoft_polls.rb:
--------------------------------------------------------------------------------
1 | require 'foodsoft_polls/engine'
2 |
3 | module FoodsoftPolls
4 | # Return whether the polls are used or not.
5 | # Enabled by default in {FoodsoftConfig} since it used to be part of the foodsoft core.
6 | def self.enabled?
7 | FoodsoftConfig[:use_polls]
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | - content_for :actionbar do
4 | - if FoodsoftConfig[:charge_members_manually]
5 | = link_to t('.close_all_direct_with_invoice'), close_all_direct_with_invoice_finance_order_index_path, method: :post, class: 'btn'
6 |
7 | #ordersTable= render 'orders'
8 |
--------------------------------------------------------------------------------
/db/migrate/20181205000000_add_user_to_task.rb:
--------------------------------------------------------------------------------
1 | class AddUserToTask < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :tasks, :created_by_user_id, :integer
4 |
5 | reversible do |dir|
6 | dir.up do
7 | change_column :tasks, :description, :text
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/current_orders/config/locales/fr.yml:
--------------------------------------------------------------------------------
1 | fr:
2 | current_orders:
3 | articles:
4 | article_info:
5 | supplied_by: de %{supplier}
6 | supplied_and_made_by: fait par %{manufacturer}
7 | from: de %{supplier}
8 | ordergroups:
9 | show:
10 | title: Articles pour %{name}
11 |
--------------------------------------------------------------------------------
/db/migrate/20190100000007_add_ignore_for_account_balance_to_financial_transaction_classes.rb:
--------------------------------------------------------------------------------
1 | class AddIgnoreForAccountBalanceToFinancialTransactionClasses < ActiveRecord::Migration[4.2]
2 | def change
3 | add_column :financial_transaction_classes, :ignore_for_account_balance, :boolean, default: false, null: false
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/views/articles/sync.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = form_tag update_synchronized_supplier_articles_path(@supplier) do
4 | = hidden_field_tag :from_action, 'sync'
5 | = render 'sync'
6 | %div
7 | = submit_tag t('.submit'), class: 'btn btn-primary'
8 | = link_to t('ui.or_cancel'), supplier_articles_path(@supplier)
9 |
--------------------------------------------------------------------------------
/app/views/layouts/login.html.haml:
--------------------------------------------------------------------------------
1 | = render layout: 'layouts/header' do
2 | .container
3 | .row
4 | .col-md-offset-3.col-md-6
5 | = bootstrap_flash_patched
6 | - if show_title?
7 | .page-header
8 | %h1= yield(:title)
9 | = yield
10 |
11 | = render 'layouts/footer'
12 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/message_threads/index.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'messages/actionbar', active: 'message_threads'
4 |
5 | = render 'groupmessage_threads', group: nil, name: t('.general'), id: 0
6 |
7 | - for group in @groups
8 | = render 'groupmessage_threads', group: group, name: group.name, id: group.id
9 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/list.missing.css:
--------------------------------------------------------------------------------
1 | .list .missing-many td, .list .missing-many:hover td {
2 | background-color: #ebbebe;
3 | }
4 |
5 | .list .missing-few td, .list .missing-few:hover td {
6 | background-color: #ffee75;
7 | }
8 |
9 | .list .missing-none td, .list .missing-none:hover td {
10 | background-color: #E4EED6;
11 | }
12 |
--------------------------------------------------------------------------------
/app/controllers/admin/base_controller.rb:
--------------------------------------------------------------------------------
1 | class Admin::BaseController < ApplicationController
2 | before_action :authenticate_admin
3 |
4 | def index
5 | @user = current_user
6 | @groups = Group.where(deleted_at: nil).order('created_on DESC').limit(10)
7 | @users = User.order('created_on DESC').limit(10)
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/serializers/article_serializer.rb:
--------------------------------------------------------------------------------
1 | class ArticleSerializer < ActiveModel::Serializer
2 | attributes :id, :name
3 | attributes :supplier_id, :supplier_name
4 | attributes :unit, :unit_quantity, :note, :manufacturer, :origin, :article_category_id
5 |
6 | def supplier_name
7 | object.supplier.try(:name)
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/views/article_units/create.js.haml:
--------------------------------------------------------------------------------
1 | $('#main').prepend('#{j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.success', name: @available_units[@article_unit.unit][:name])}))}')
2 | $('a[data-for-unit="#{@article_unit.unit}"]').replaceWith('#{j(render(partial: "destroy_link", locals: {article_unit: @article_unit}))}')
3 |
--------------------------------------------------------------------------------
/app/views/article_units/destroy.js.haml:
--------------------------------------------------------------------------------
1 | $('#main').prepend('#{j(render(:partial => 'shared/alert_success', :locals => {:alert_message => t('.success', name: @available_units[@article_unit.unit][:name])}))}')
2 | $('a[data-for-unit="#{@article_unit.unit}"]').replaceWith('#{j(render(partial: "create_link", locals: {unit: @article_unit.unit}))}')
3 |
--------------------------------------------------------------------------------
/db/migrate/20181204000000_clear_invalid_invoices_from_orders.rb:
--------------------------------------------------------------------------------
1 | class ClearInvalidInvoicesFromOrders < ActiveRecord::Migration[4.2]
2 | class Order < ActiveRecord::Base; end
3 |
4 | class Invoice < ActiveRecord::Base; end
5 |
6 | def up
7 | Order.where.not(invoice_id: Invoice.all).update_all(invoice_id: nil)
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/views/login/forgot_password.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 | = t('.body').html_safe
3 | .row
4 | .col-sm-12
5 | = simple_form_for User.new, url: reset_password_path do |form|
6 | = form.input :email
7 | %div
8 | = form.submit t('.submit'), class: 'btn btn-default'
9 | = link_to t('ui.or_cancel'), :back
10 |
--------------------------------------------------------------------------------
/config/initializers/resque.rb:
--------------------------------------------------------------------------------
1 | # Initializer to configure resque daemon
2 | if Rails.env.test?
3 | Resque.inline = true
4 | elsif ENV['REDIS_URL']
5 | Resque.redis = ENV['REDIS_URL']
6 | else
7 | puts 'WARNING: redis is not installed, so Resque is using inline method. (not recommended for production)'
8 | Resque.inline = true
9 | end
10 |
--------------------------------------------------------------------------------
/lib/templates/haml/scaffold/_form.html.haml:
--------------------------------------------------------------------------------
1 | = simple_form_for(@<%= singular_table_name %>) do |f|
2 | = f.error_notification
3 |
4 | .form-inputs
5 | <%- attributes.each do |attribute| -%>
6 | = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
7 | <%- end -%>
8 |
9 | %div
10 | = f.button :submit
11 |
--------------------------------------------------------------------------------
/plugins/documents/lib/foodsoft_documents.rb:
--------------------------------------------------------------------------------
1 | require 'foodsoft_documents/engine'
2 |
3 | module FoodsoftDocuments
4 | # Return whether the documents are used or not.
5 | # Enabled by default in {FoodsoftConfig} since it used to be part of the foodsoft core.
6 | def self.enabled?
7 | FoodsoftConfig[:use_documents]
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/fixtures/foodsoft_file_02.csv:
--------------------------------------------------------------------------------
1 | avail.;Order number;Name;Supplier order unit;Unit;Ratios to supplier order unit;Minimum order quantity;Billing unit;Group order granularity;Group order unit;Price (net);Price unit;VAT;Deposit;Note;Category;Origin;Manufacturer
2 | Yes;1;Tomatoes;;500 g;20 Piece;;;1;;1.2;;6;0;organic;Vegetables;Somewhere, UK;Tommy farm
3 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "env": {
3 | "browser": true,
4 | "jquery": true,
5 | "es6": true
6 | },
7 | "extends": "eslint:recommended",
8 | "parserOptions": {
9 | "ecmaVersion": 6
10 | },
11 | "rules": {
12 | "no-unused-vars": ["error", { "vars": "local" }]
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/db/migrate/20120622094337_add_next_weekly_tasks_number_to_workgroups.rb:
--------------------------------------------------------------------------------
1 | class AddNextWeeklyTasksNumberToWorkgroups < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :groups, :next_weekly_tasks_number, :integer, default: 8
4 | end
5 |
6 | def self.down
7 | remove_column :groups, :next_weekly_tasks_number
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20120929155541_add_ignore_apple_restriction_to_groups.rb:
--------------------------------------------------------------------------------
1 | class AddIgnoreAppleRestrictionToGroups < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :groups, :ignore_apple_restriction, :boolean, default: false
4 | end
5 |
6 | def self.down
7 | remove_column :groups, :ignore_apple_restriction
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/factories/bank_transaction_type.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | factory :bank_account do
5 | name { Faker::Bank.name }
6 | iban { Faker::Bank.iban }
7 | end
8 |
9 | factory :bank_transaction do
10 | date { Faker::Date.backward(days: 14) }
11 | text { Faker::Lorem.sentence }
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/spec/factories/invoice.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | factory :invoice do
5 | supplier
6 | number { rand(1..99_999) }
7 | amount { rand(0.1..26.0).round(2) }
8 | created_by { create(:user) }
9 |
10 | after :create do |invoice|
11 | invoice.supplier.reload
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/db/migrate/20090405131156_modify_group_order_article_result.rb:
--------------------------------------------------------------------------------
1 | class ModifyGroupOrderArticleResult < ActiveRecord::Migration[4.2]
2 | def self.up
3 | change_column :group_order_articles, :result, :decimal, precision: 8, scale: 3
4 | end
5 |
6 | def self.down
7 | change_column :group_order_articles, :result, :integer
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/views/admin/workgroups/show.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title', name: @workgroup.name
2 |
3 | %section= render 'shared/group', group: @workgroup
4 | = link_to t('ui.edit'), edit_admin_workgroup_path(@workgroup), class: 'btn btn-default'
5 | = link_to t('ui.delete'), [:admin, @workgroup], :data => {:confirm => t('.confirm')}, :method => :delete, class: 'btn btn-danger'
6 |
--------------------------------------------------------------------------------
/app/views/finance/financial_transactions/index_collection.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | - content_for :actionbar do
4 | = link_to t('.show_groups'), finance_ordergroups_path, class: 'btn btn-default'
5 |
6 | = render 'transactions_search', url: finance_transactions_path
7 |
8 | #transactions= render 'transactions', with_ordergroup: true, with_csv: true
9 |
--------------------------------------------------------------------------------
/db/migrate/20141211210719_increase_account_balance_precision.rb:
--------------------------------------------------------------------------------
1 | class IncreaseAccountBalancePrecision < ActiveRecord::Migration[4.2]
2 | def up
3 | change_column :groups, :account_balance, :decimal, precision: 12, scale: 2
4 | end
5 |
6 | def down
7 | change_column :groups, :account_balance, :decimal, precision: 8, scale: 2
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20160224201529_allow_stock_group_order.rb:
--------------------------------------------------------------------------------
1 | class AllowStockGroupOrder < ActiveRecord::Migration[4.2]
2 | def self.up
3 | change_column :group_orders, :ordergroup_id, :integer, default: nil, null: true
4 | end
5 |
6 | def self.down
7 | change_column :group_orders, :ordergroup_id, :integer, default: 0, null: false
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20160226000000_add_email_to_message.foodsoft_messages_engine.rb:
--------------------------------------------------------------------------------
1 | # This migration comes from foodsoft_messages_engine (originally 20160226000000)
2 | class AddEmailToMessage < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :messages, :salt, :string
5 | add_column :messages, :received_email, :binary, limit: 1.megabyte
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/helpers/admin/ordergroups_helper.rb:
--------------------------------------------------------------------------------
1 | module Admin::OrdergroupsHelper
2 | def ordergroup_members_title(ordergroup)
3 | s = ''
4 | s += ordergroup.users.map(&:name).join(', ') if ordergroup.users.any?
5 | s += "\n" + Ordergroup.human_attribute_name(:contact) + ': ' + ordergroup.contact_person if ordergroup.contact_person.present?
6 | s
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/stockit/_destroy_fail.js.haml:
--------------------------------------------------------------------------------
1 | -# please polish the following line if you know how, same in view destroy
2 | var errorDiv = $('');
3 |
4 | errorDiv.append(document.createTextNode('#{j(fail_msg)}'));
5 | $('#main').prepend(errorDiv);
6 |
--------------------------------------------------------------------------------
/db/migrate/20181204010000_change_marked_as_deleted_names.rb:
--------------------------------------------------------------------------------
1 | class ChangeMarkedAsDeletedNames < ActiveRecord::Migration[4.2]
2 | def up
3 | execute "UPDATE groups SET name = REPLACE(name, '\\u2020', '\u2020') WHERE deleted_at IS NOT NULL"
4 | execute "UPDATE suppliers SET name = REPLACE(name, '\\u2020', '\u2020') WHERE deleted_at IS NOT NULL"
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20240404004950_add_use_financial_links_setting.rb:
--------------------------------------------------------------------------------
1 | class AddUseFinancialLinksSetting < ActiveRecord::Migration[7.0]
2 | def up
3 | FoodsoftConfig[:use_financial_links] = true if FinancialLink.any? || FinancialTransaction.where(ordergroup: nil).any?
4 | end
5 |
6 | def down
7 | FoodsoftConfig[:use_financial_links] = nil
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/mollie/script/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3 |
4 | ENGINE_ROOT = File.expand_path('..', __dir_)
5 | ENGINE_PATH = File.expand_path('../lib/foodsoft_mollie/engine', __dir__)
6 |
7 | require 'rails/all'
8 | require 'rails/engine/commands'
9 |
--------------------------------------------------------------------------------
/app/controllers/users_controller.rb:
--------------------------------------------------------------------------------
1 | class UsersController < ApplicationController
2 | # Currently used to display users nick and ids for autocomplete
3 | def index
4 | @users = User.undeleted.natural_search(params[:q])
5 | respond_to do |format|
6 | format.json { render json: @users.map(&:token_attributes).to_json }
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/views/admin/ordergroups/show.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title', name: @ordergroup.name
2 |
3 | %section= render 'shared/group', group: @ordergroup
4 | = link_to t('ui.edit'), edit_admin_ordergroup_path(@ordergroup), class: 'btn btn-default'
5 | = link_to t('ui.delete'), [:admin, @ordergroup], :data => {:confirm => t('.confirm')}, :method => :delete, class: 'btn btn-danger'
6 |
--------------------------------------------------------------------------------
/plugins/b85/lib/foodsoft_b85/engine.rb:
--------------------------------------------------------------------------------
1 | module FoodsoftB85
2 | class Engine < ::Rails::Engine
3 | config.to_prepare do
4 | if FoodsoftConfig[:use_b85]
5 | Supplier.register_remote_order_method(:ftp_b85, OrderB85)
6 | Supplier.include(SupplierExtensions)
7 | Order.include(OrderExtensions)
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/models/group_order_article_quantity.rb:
--------------------------------------------------------------------------------
1 | # stores the quantity, tolerance and timestamp of an GroupOrderArticle
2 | # Considers every update of an article-order, so may rows for one group_order_article ar possible.
3 |
4 | class GroupOrderArticleQuantity < ApplicationRecord
5 | belongs_to :group_order_article
6 |
7 | validates :group_order_article_id, presence: true
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/login/new_password.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 | = raw t('.body', user: h(show_user(@user)))
3 | = simple_form_for @user, :url => {:action => 'update_password', :id => @user.id, :token => @user.reset_password_token} do |form|
4 | = form.input :password
5 | = form.input :password_confirmation
6 | %div
7 | = form.submit t('.submit'), class: 'btn btn-default'
8 |
--------------------------------------------------------------------------------
/app/views/tasks/new.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | = render 'form_sidebar'
4 |
5 | .col-md-7
6 | = simple_form_for @task do |form|
7 | = render 'form', form: form, periodic: nil
8 | %div
9 | = form.submit class: 'btn btn-primary'
10 | = form.submit t('.submit_periodic'), name: 'periodic', class: 'btn'
11 | = link_to t('ui.or_cancel'), :back
12 |
--------------------------------------------------------------------------------
/plugins/printer/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | scope '/:foodcoop' do
3 | resources :printer, only: [:show] do
4 | get :socket, on: :collection
5 | end
6 |
7 | resources :printer_jobs, only: %i[index create show destroy] do
8 | post :requeue, on: :member
9 | get :document, on: :member
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/variables.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title'
2 |
3 | %p= t '.description'
4 |
5 | %table.table.table-hover
6 | %thead
7 | %tr
8 | %th= t '.variable'
9 | %th= t '.value'
10 | %tbody
11 | - @variables.each do |key, value|
12 | %tr
13 | %td
14 | %tt= "{{#{key}}}"
15 | %td
16 | = value
17 |
--------------------------------------------------------------------------------
/db/migrate/20130615073715_create_periodic_task_groups.rb:
--------------------------------------------------------------------------------
1 | class CreatePeriodicTaskGroups < ActiveRecord::Migration[4.2]
2 | def change
3 | create_table :periodic_task_groups do |t|
4 | t.date :next_task_date
5 |
6 | t.timestamps
7 | end
8 |
9 | change_table :tasks do |t|
10 | t.references :periodic_task_group
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/db/migrate/20140318173000_delete_empty_group_order_articles.rb:
--------------------------------------------------------------------------------
1 | class DeleteEmptyGroupOrderArticles < ActiveRecord::Migration[4.2]
2 | def up
3 | # up until recently, group_order_articles with all quantities zero were saved
4 | GroupOrderArticle.where(quantity: 0, tolerance: 0, result: [0, nil], result_computed: [0, nil]).delete_all
5 | end
6 |
7 | def down; end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20181201000302_change_stock_supplier_to_null_in_order.rb:
--------------------------------------------------------------------------------
1 | class ChangeStockSupplierToNullInOrder < ActiveRecord::Migration[4.2]
2 | class Order < ActiveRecord::Base; end
3 |
4 | def up
5 | Order.where(supplier_id: 0).update_all(supplier_id: nil)
6 | end
7 |
8 | def down
9 | Order.where(supplier_id: nil).update_all(supplier_id: 0)
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/019_remove_uniqueness_of_article_name.rb:
--------------------------------------------------------------------------------
1 | class RemoveUniquenessOfArticleName < ActiveRecord::Migration[4.2]
2 | def self.up
3 | remove_index :articles, :name
4 | add_index :articles, %i[name supplier_id]
5 | end
6 |
7 | def self.down
8 | remove_index :articles, %i[name supplier_id]
9 | add_index :articles, :name, unique: true
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/messages_mailer/foodsoft_message.text.haml:
--------------------------------------------------------------------------------
1 | = raw @message.body
2 | ======================================================================
3 | \
4 | - if @message.group
5 | = raw t '.footer_group', group: @message.group.name
6 | = raw t '.footer', reply_url: new_message_url('message[reply_to]' => @message.id), msg_url: message_url(@message), profile_url: my_profile_url
7 |
--------------------------------------------------------------------------------
/app/jobs/notify_negative_balance_job.rb:
--------------------------------------------------------------------------------
1 | class NotifyNegativeBalanceJob < ApplicationJob
2 | def perform(ordergroup, transaction)
3 | ordergroup.users.each do |user|
4 | next unless user.settings.notify['negative_balance']
5 |
6 | Mailer.deliver_now_with_user_locale user do
7 | Mailer.negative_balance(user, transaction)
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/010_user_password_reset.rb:
--------------------------------------------------------------------------------
1 | class UserPasswordReset < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :users, :reset_password_token, :string
4 | add_column :users, :reset_password_expires, :timestamp
5 | end
6 |
7 | def self.down
8 | remove_column :users, :reset_password_token
9 | remove_column :users, :reset_password_expires
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20181203000000_create_links.foodsoft_links.rb:
--------------------------------------------------------------------------------
1 | class CreateLinks < ActiveRecord::Migration[4.2]
2 | def change
3 | create_table :links do |t|
4 | t.string :name, null: false
5 | t.string :url, null: false
6 | t.references :workgroup
7 | t.boolean :indirect, null: false, default: false
8 | t.string :authorization
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/ordergroups/show_on_group_order_article_update.js.erb:
--------------------------------------------------------------------------------
1 | // Handle more advanced DOM update after AJAX database manipulation.
2 | // See publish/subscribe design pattern in /doc.
3 | (function(w) {
4 | // table update is done by group_order_article hook already
5 | $('#to_pay_message').html('<%= j to_pay_message(@ordergroup) %>');
6 | })(window);
7 |
8 |
--------------------------------------------------------------------------------
/plugins/links/db/migrate/20181203000000_create_links.rb:
--------------------------------------------------------------------------------
1 | class CreateLinks < ActiveRecord::Migration[4.2]
2 | def change
3 | create_table :links do |t|
4 | t.string :name, null: false
5 | t.string :url, null: false
6 | t.references :workgroup
7 | t.boolean :indirect, null: false, default: false
8 | t.string :authorization
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/_order_article_result.html.haml:
--------------------------------------------------------------------------------
1 | %tr[order_article]
2 | = render :partial => 'finance/balancing/order_article', :locals => {:order_article => order_article}
3 |
4 | %tr{:id => "group_order_articles_#{order_article.id}", :class => "results", :style => "display:none"}
5 | = render :partial => 'finance/balancing/group_order_articles', :locals => {:order_article => order_article}
--------------------------------------------------------------------------------
/config/initializers/currency_display.rb:
--------------------------------------------------------------------------------
1 | # remove all currency translations, so that we can set the default language and
2 | # have it shown in all other languages too
3 | I18n.available_locales.each do |locale|
4 | unless locale == I18n.default_locale
5 | I18n.backend.store_translations(locale,
6 | number: { currency: { format: { unit: nil } } })
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/foodcoop/workgroups/_workgroup.html.haml:
--------------------------------------------------------------------------------
1 | %section.well
2 | %h3= workgroup.name
3 | = render :partial => 'shared/group', :locals => { :group => workgroup }
4 | = link_to t('.show_tasks'), workgroup_tasks_path(workgroup_id: workgroup), class: 'btn btn-default'
5 | - if workgroup.member?(current_user)
6 | = link_to t('.edit'), edit_foodcoop_workgroup_path(workgroup), class: 'btn btn-default'
7 |
--------------------------------------------------------------------------------
/db/migrate/20190100000009_create_bank_gateways.rb:
--------------------------------------------------------------------------------
1 | class CreateBankGateways < ActiveRecord::Migration[4.2]
2 | def change
3 | create_table :bank_gateways do |t|
4 | t.string :name, null: false
5 | t.string :url, null: false
6 | t.string :authorization
7 | t.integer :unattended_user_id
8 | end
9 |
10 | add_reference :bank_accounts, :bank_gateway
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20230106144440_remove_not_null_on_active_storage_blobs_checksum.active_storage.rb:
--------------------------------------------------------------------------------
1 | # This migration comes from active_storage (originally 20211119233751)
2 | class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
3 | def change
4 | return unless table_exists?(:active_storage_blobs)
5 |
6 | change_column_null(:active_storage_blobs, :checksum, true)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/_title_list.html.haml:
--------------------------------------------------------------------------------
1 | %table.table.table-striped
2 | %thead
3 | %tr
4 | %th= sort_link_helper t('pages.title'), "title", :remote => false
5 | %th= sort_link_helper t('pages.last_updated'), "last_updated", :remote => false
6 | %tbody
7 | - for page in @pages
8 | = render :partial => "page_list_item", :locals => {:page => page, :level => 0, :siteMap => 0}
9 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/group_orders/_payment_bar.html.haml:
--------------------------------------------------------------------------------
1 | .pull-right
2 | = link_to t('ui.back'), root_path(anchor: ''), class: 'btn'
3 |
4 | %p.pull-left
5 | = link_to t('current_orders.ordergroups.payment_bar.account_balance'), my_ordergroup_path
6 | = number_to_currency (ordergroup.account_balance)
7 |
8 | %p#to_pay_message{style: 'text-align: center'}= to_pay_message(ordergroup)
9 |
--------------------------------------------------------------------------------
/app/helpers/finance/balancing_helper.rb:
--------------------------------------------------------------------------------
1 | module Finance::BalancingHelper
2 | def balancing_view_partial
3 | view = params[:view] || 'edit_results'
4 | case view
5 | when 'edit_results'
6 | 'edit_results_by_articles'
7 | when 'groups_overview'
8 | 'shared/articles_by/groups'
9 | when 'articles_overview'
10 | 'shared/articles_by/articles'
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/views/deliveries/_stock_change.html.haml:
--------------------------------------------------------------------------------
1 | - if stock_change.stock_article.new_record?
2 | = simple_fields_for "delivery[new_stock_changes_new_stock_article][]", stock_change do |f|
3 | = render :partial => 'stock_change_fields', :locals => {:f => f}
4 | - else
5 | = simple_fields_for "delivery[new_stock_changes][]", stock_change do |f|
6 | = render :partial => 'stock_change_fields', :locals => {:f => f}
7 |
--------------------------------------------------------------------------------
/app/views/group_orders/_switch_order.html.haml:
--------------------------------------------------------------------------------
1 | - orders = Order.open.started.reject{ |order| order == current_order }
2 | - unless orders.empty?
3 | %h2= t '.title'
4 | %ul.list-unstyled
5 | - orders.each do |order|
6 | %li
7 | = link_to_ordering(order, 'data-confirm_switch_order' => true)
8 | - if order.ends
9 | = t '.remaining', remaining: time_ago_in_words(order.ends)
10 |
--------------------------------------------------------------------------------
/db/migrate/20120512211613_add_order_indexes.rb:
--------------------------------------------------------------------------------
1 | class AddOrderIndexes < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_index :group_order_articles, :group_order_id
4 | add_index :group_order_articles, :order_article_id
5 | end
6 |
7 | def self.down
8 | remove_index :group_order_articles, :group_order_id
9 | remove_index :group_order_articles, :order_article_id
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/admin/configs/list.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title'), false
2 |
3 | = render 'tabs'
4 |
5 | %table.table
6 | %thead
7 | %tr
8 | %th= t '.key'
9 | %th= t '.value'
10 | %tbody
11 | - @keys.each do |key|
12 | %tr
13 | %td
14 | %tt= key
15 | %td{style: if @cfg[key] != @dfl[key] then 'font-weight: bold' end}
16 | = show_config_value key, @cfg[key]
17 |
--------------------------------------------------------------------------------
/app/views/articles/prepare_units_migration.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', supplier: @supplier.name)
2 | %p.mb-1
3 | =simple_format(t('.explanation'))
4 | = link_to t('.download'), supplier_articles_path(@supplier, format: :csv), class: 'btn'
5 | %br/
6 | %br/
7 | %p.mt-1
8 | = link_to t('.migrate_units') + '...', migrate_units_supplier_articles_path(@supplier), class: 'btn btn-success' if @supplier.unit_migration_completed.nil?
9 |
--------------------------------------------------------------------------------
/public/503.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 | Die Foodsoft wird gewartet!
9 | In ein paar Minuten dürfte aber wieder alles wieder funktionieren.... Nur Geduld ...
10 |
11 |
12 |
--------------------------------------------------------------------------------
/spec/factories/doorkeeper.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 | require 'doorkeeper'
3 |
4 | FactoryBot.define do
5 | factory :oauth2_application, class: 'Doorkeeper::Application' do
6 | name { Faker::App.name }
7 | redirect_uri { 'https://example.com:1234/app' }
8 | end
9 |
10 | factory :oauth2_access_token, class: 'Doorkeeper::AccessToken' do
11 | application factory: :oauth2_application
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/helpers/shared_helper.rb:
--------------------------------------------------------------------------------
1 | module SharedHelper
2 | # provide input_html for password autocompletion
3 | def autocomplete_flag_to_password_html(password_autocomplete)
4 | case password_autocomplete
5 | when true then { autocomplete: 'on' }
6 | when false then { autocomplete: 'off' }
7 | when 'store-only' then { autocomplete: 'off', data: { store: 'on' } }
8 | else {}
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/errors/_error.html.haml:
--------------------------------------------------------------------------------
1 | - title local_assigns[:title], false
2 |
3 | - unless login_layout?
4 | %i.hidden-xs.glyphicon.glyphicon-exclamation-sign
5 | %div(class="#{login_layout? ? '' : 'col-md-6'}")
6 | %h1= local_assigns[:title]
7 | %div(class='alert alert-#{local_assigns[:type] || 'warn'}')
8 | = local_assigns[:page]
9 | = link_to t('ui.back'), 'javascript:history.go(-1)', class: 'btn btn-primary'
10 |
--------------------------------------------------------------------------------
/app/views/group_order_articles/update.js.erb:
--------------------------------------------------------------------------------
1 | // and trigger hooks for views including this
2 | $(document).trigger({
3 | type: 'GroupOrderArticle#update',
4 | order_article_id: <%= @group_order_article.order_article_id %>,
5 | group_order_id: <%= @group_order_article.group_order_id %>,
6 | group_order_article_id: <%= @group_order_article.id %>,
7 | group_order_article_price: <%= @group_order_article.total_price %>
8 | });
9 |
--------------------------------------------------------------------------------
/db/migrate/20090317175355_add_profit_to_orders.rb:
--------------------------------------------------------------------------------
1 | class AddProfitToOrders < ActiveRecord::Migration[4.2]
2 | def self.up
3 | add_column :orders, :foodcoop_result, :decimal, precision: 8, scale: 2
4 |
5 | Order.closed.each do |order|
6 | order.update_attribute(:foodcoop_result, order.profit)
7 | end
8 | end
9 |
10 | def self.down
11 | remove_column :orders, :foodcoop_result
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/messages_mailer/foodsoft_message.html.haml:
--------------------------------------------------------------------------------
1 | = raw @message.body
2 | %hr
3 | %ul
4 | - if @message.group
5 | %li= t '.footer_group', group: @message.group.name
6 | %li
7 | %a{href: new_message_url('message[reply_to]' => @message.id)}= t '.reply'
8 | %li
9 | %a{href: message_url(@message)}= t '.see_message_online'
10 | %li
11 | %a{href: my_profile_url}= t '.messaging_options'
12 |
--------------------------------------------------------------------------------
/app/views/articles/destroy.js.haml:
--------------------------------------------------------------------------------
1 | - if @order
2 | $('#article_#{@article.id}').after('#{escape_javascript(render("destroy_active_article"))}');
3 | - else
4 | $('#article_#{@article.id}').remove();
5 | const importActionsCell$ = $('#import #search_results td[data-order-number="#{escape_javascript(@article.order_number)}"]');
6 | importActionsCell$.find('.icon-ok').hide();
7 | importActionsCell$.find('.article_import_btn').show();
8 |
--------------------------------------------------------------------------------
/app/views/stockit/destroy.js.erb:
--------------------------------------------------------------------------------
1 | $('#main').prepend('<%= j(render(
2 | :partial => 'shared/alert_success',
3 | :locals => {
4 | :alert_message => t('.notice', :name => @stock_article.name)
5 | }
6 | )) %>');
7 |
8 | // Publish database changes.
9 | // See publish/subscribe design pattern in /doc.
10 | $(document).trigger({
11 | type: 'StockArticle#destroy',
12 | stock_article_id: <%= @stock_article.id %>
13 | });
14 |
--------------------------------------------------------------------------------
/config/i18n-js.yml:
--------------------------------------------------------------------------------
1 | # only serve selected strings for i18n-js to keep filesize down
2 | translations:
3 | - file: 'app/assets/javascripts/i18n/translations.js'
4 | only: [
5 | '*.js.*',
6 | '*.errors.*',
7 | '*.number.*',
8 | '*.date.formats.*',
9 | # foodsoft-specific texts to keep js with normal translations
10 | '*.orders.edit_amount.*',
11 | '*.orders.receive.*',
12 | 'no_articles_available'
13 | ]
14 |
--------------------------------------------------------------------------------
/plugins/documents/db/migrate/20160220000000_create_documents.rb:
--------------------------------------------------------------------------------
1 | class CreateDocuments < ActiveRecord::Migration[4.2]
2 | def self.up
3 | create_table :documents do |t|
4 | t.string :name
5 | t.string :mime
6 | t.binary :data, limit: 16.megabytes
7 | t.integer :created_by_user_id
8 | t.timestamps
9 | end
10 | end
11 |
12 | def self.down
13 | drop_table :documents
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/spec/factories/financial_transaction_type.rb:
--------------------------------------------------------------------------------
1 | require 'factory_bot'
2 |
3 | FactoryBot.define do
4 | factory :financial_transaction_class do
5 | sequence(:name) { |n| Faker::Lorem.characters(number: rand(2..12)) + " ##{n}" }
6 | end
7 |
8 | factory :financial_transaction_type do
9 | financial_transaction_class
10 | sequence(:name) { |n| Faker::Lorem.words(number: rand(2..4)).join(' ') + " ##{n}" }
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/models/concerns/custom_fields.rb:
--------------------------------------------------------------------------------
1 | module CustomFields
2 | extend ActiveSupport::Concern
3 | include RailsSettings::Extend
4 |
5 | attr_accessor :custom_fields
6 |
7 | included do
8 | after_initialize do
9 | settings.defaults['custom_fields'] = {} unless settings.custom_fields
10 | end
11 |
12 | after_save do
13 | settings.custom_fields = custom_fields if custom_fields
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/app/models/membership.rb:
--------------------------------------------------------------------------------
1 | class Membership < ApplicationRecord
2 | belongs_to :user
3 | belongs_to :group
4 |
5 | before_destroy :check_last_admin
6 |
7 | protected
8 |
9 | # check if this is the last admin-membership and deny
10 | def check_last_admin
11 | raise I18n.t('model.membership.no_admin_delete') if group.role_admin? && group.memberships.size == 1 && Group.where(role_admin: true).count == 1
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/config/initializers/extensions.rb:
--------------------------------------------------------------------------------
1 | # extend the BigDecimal class
2 | class String
3 | # remove comma from decimal inputs
4 | def self.delocalized_decimal(string)
5 | if string.present? and string.is_a?(String)
6 | BigDecimal(string.sub(',', '.'))
7 | else
8 | string
9 | end
10 | end
11 | end
12 |
13 | class Array
14 | def cumulative_sum
15 | csum = 0
16 | map { |val| csum += val }
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/db/migrate/20160220000000_create_documents.foodsoft_documents_engine.rb:
--------------------------------------------------------------------------------
1 | class CreateDocuments < ActiveRecord::Migration[4.2]
2 | def self.up
3 | create_table :documents do |t|
4 | t.string :name
5 | t.string :mime
6 | t.binary :data, limit: 16.megabytes
7 | t.integer :created_by_user_id
8 | t.timestamps
9 | end
10 | end
11 |
12 | def self.down
13 | drop_table :documents
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/db/migrate/20210205090257_introduce_received_state_in_orders.rb:
--------------------------------------------------------------------------------
1 | class IntroduceReceivedStateInOrders < ActiveRecord::Migration[5.2]
2 | def up
3 | Order.where(state: 'finished').each do |order|
4 | order.update_attribute(:state, 'received') if order.order_articles.where.not(units_received: nil).any?
5 | end
6 | end
7 |
8 | def down
9 | Order.where(state: 'received').update_all(state: 'finished')
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/messages/lib/foodsoft_messages.rb:
--------------------------------------------------------------------------------
1 | require 'foodsoft_messages/engine'
2 | require 'foodsoft_messages/mail_receiver'
3 | require 'foodsoft_messages/user_link'
4 | require 'deface'
5 |
6 | module FoodsoftMessages
7 | # Return whether messages are used or not.
8 | # Enabled by default in {FoodsoftConfig} since it used to be part of the foodsoft core.
9 | def self.enabled?
10 | FoodsoftConfig[:use_messages]
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/views/articles/create.js.haml:
--------------------------------------------------------------------------------
1 | $('#modalContainer').modal('hide');
2 | $('#listbody').prepend('#{escape_javascript(render(@article))}');
3 | const importActionsCell$ = $('#import #search_results td[data-order-number="#{escape_javascript(@article.order_number)}"]');
4 | importActionsCell$.find('.icon-ok').show();
5 | importActionsCell$.find('.article_import_btn').hide();
6 | = render 'import_article_added', article: @article if @article.shared_article
7 |
--------------------------------------------------------------------------------
/app/views/orders/receive_on_order_article_update.js.erb:
--------------------------------------------------------------------------------
1 | // Handle more advanced DOM update after AJAX database manipulation.
2 | // See publish/subscribe design pattern in /doc.
3 | (function(w) {
4 | $('table#order_articles').parents('form').receiveOrderForm('replace', {
5 | id: <%= @order_article.id %>,
6 | newEntry: $('<%= j render(partial: 'edit_amount', locals: {order_article: @order_article}) %>')
7 | });
8 | })(window);
9 |
10 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/articles/_articles.html.haml:
--------------------------------------------------------------------------------
1 | - @order_articles.includes(:order => :supplier).reorder('suppliers.name, articles.article_category_id, articles.name').group_by {|oa| oa.order.name}.each do |name, articles|
2 | %li.nav-header= name
3 | - articles.each do |oa|
4 | %li= link_to oa.article_version.name, current_orders_articles_path(order_id: oa.order_id, id: oa.id, anchor: 'order_article'), remote: true
5 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/_page_list_item.html.haml:
--------------------------------------------------------------------------------
1 | -ident = 20 * level
2 | %tr
3 | %td{:style => "padding-left: #{ident}px"}
4 | = link_to page.title, wiki_page_path(page.permalink)
5 | %td #{show_user page.user} (#{format_datetime_timespec(page.updated_at, t('.date_format'))})
6 | -if siteMap == 1
7 | -for child in page.children.all
8 | = render :partial => 'page_list_item', :locals => {:page => child, :level => level+1, :siteMap => 1}
9 |
--------------------------------------------------------------------------------
/app/views/mailer/upcoming_tasks.text.haml:
--------------------------------------------------------------------------------
1 | = raw t '.text0', user: @user.name, task: @task.name, when: I18n.l(@task.due_date, format: t('mailer.dateformat'))
2 | - if @next_tasks.size > 0
3 | = raw t '.nextweek'
4 | - for next_task in @next_tasks
5 | - next if next_task == @task
6 | * #{raw I18n.l next_task.due_date, format: t('mailer.dateformat')} #{raw next_task.name}
7 | = raw t '.text1', user_tasks_url: user_tasks_url, foodcoop: FoodsoftConfig[:name]
8 |
--------------------------------------------------------------------------------
/db/migrate/20170801000000_create_mail_delivery_status.rb:
--------------------------------------------------------------------------------
1 | class CreateMailDeliveryStatus < ActiveRecord::Migration[4.2]
2 | def change
3 | create_table :mail_delivery_status do |t|
4 | t.datetime :created_at
5 | t.string :email, null: false
6 | t.string :message, null: false
7 | t.string :attachment_mime
8 | t.binary :attachment_data, limit: 16.megabytes
9 |
10 | t.index :email
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/helpers/suppliers_helper.rb:
--------------------------------------------------------------------------------
1 | module SuppliersHelper
2 | def shared_sync_method_collection
3 | # TODO: See if we really need the import limit `shared_supplier_article_sync_limit`
4 | # also see https://github.com/foodcoops/foodsoft/pull/609/files and https://github.com/foodcoopsat/foodsoft_hackathon/issues/89
5 | Supplier.shared_sync_methods.keys.map do |m|
6 | [t("suppliers.shared_supplier_methods.#{m}"), m]
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/views/group_order_articles/create.js.erb:
--------------------------------------------------------------------------------
1 | $('#modalContainer').modal('hide');
2 |
3 | // trigger hooks for views
4 | $(document).trigger({
5 | type: 'GroupOrderArticle#create',
6 | order_article_id: <%= @group_order_article.order_article_id %>,
7 | group_order_id: <%= @group_order_article.group_order_id %>,
8 | group_order_article_id: <%= @group_order_article.id %>,
9 | group_order_article_price: <%= @group_order_article.total_price %>
10 | });
11 |
--------------------------------------------------------------------------------
/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/db/migrate/20250322103203_fix_schema_inconsistent_with_migration_history.rb:
--------------------------------------------------------------------------------
1 | class FixSchemaInconsistentWithMigrationHistory < ActiveRecord::Migration[7.0]
2 | def up
3 | change_column :article_versions, :created_at, :datetime
4 | end
5 |
6 | def down
7 | change_column :article_versions, :created_at, :datetime, precision: nil
8 | end
9 |
10 | def change
11 | change_column_null :suppliers, :supplier_category_id, false
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/spec/support/session_helper.rb:
--------------------------------------------------------------------------------
1 | module SessionHelper
2 | def login(user = nil, password = nil)
3 | visit login_path
4 | user = FactoryBot.create(:user) if user.nil?
5 | if user.instance_of? ::User
6 | nick = user.nick
7 | password = user.password
8 | else
9 | nick = user
10 | end
11 | fill_in 'nick', with: nick
12 | fill_in 'password', with: password
13 | find('input[type=submit]').click
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/views/kaminari/_gap.html.haml:
--------------------------------------------------------------------------------
1 | -#
2 | Non-link tag that stands for skipped pages...
3 | - available local variables
4 | current_page: a page object for the currently displayed page
5 | num_pages: total number of pages
6 | per_page: number of items to fetch per page
7 | remote: data-remote
8 |
9 | %li{:class => "page gap disabled"}
10 | %a{:href => "#", :onclick => "return false;"}
11 | = raw(t 'views.pagination.truncate')
--------------------------------------------------------------------------------
/db/migrate/024_add_deposit_defaults.rb:
--------------------------------------------------------------------------------
1 | class AddDepositDefaults < ActiveRecord::Migration[4.2]
2 | def self.up
3 | change_column_default :articles, :deposit, 0.0
4 | change_column_default :order_article_results, :net_price, 0.0
5 | change_column_default :order_article_results, :deposit, 0.0
6 | change_column_default :orders, :deposit, 0.0
7 | change_column_default :orders, :deposit_credit, 0.0
8 | end
9 |
10 | def self.down; end
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/articles/parse_upload.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', supplier: @supplier.name)
2 |
3 | = form_tag update_synchronized_supplier_articles_path(@supplier) do
4 | = hidden_field_tag :from_action, 'parse_upload'
5 | = hidden_field_tag :enable_unit_migration, @enable_unit_migration ? '1' : '0'
6 | = render 'sync'
7 | %div
8 | = submit_tag t('.submit'), class: 'btn btn-primary'
9 | = link_to t('ui.or_cancel'), upload_supplier_articles_path(@supplier)
10 |
--------------------------------------------------------------------------------
/app/views/mailer/invite.text.haml:
--------------------------------------------------------------------------------
1 | = raw t '.text', user: @invite.user.name, mail: @invite.user.email, group: @invite.group.name, link: @link, expires: I18n.l(@invite.expires_at)
2 | -# append english text only if the locale is not english
3 | - if not I18n.locale.to_s.start_with?('en')
4 | =======
5 | \
6 | = raw t '.text', user: @invite.user.name, mail: @invite.user.email, group: @invite.group.name, link: @link, expires: I18n.l(@invite.expires_at, locale: :en), locale: :en
7 |
--------------------------------------------------------------------------------
/app/views/articles/edit_all.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', supplier: @supplier.name)
2 | %p
3 | %i= t '.note'
4 | = form_tag(update_all_supplier_articles_path(@supplier)) do
5 | = render 'edit_all_table'
6 | = hidden_field_tag :complete_migration, true unless @original_units.nil?
7 | %br/
8 | %i= t '.warning'
9 | %div
10 | = submit_tag t('.submit'), class: 'btn btn-primary', disabled: true
11 | = link_to t('ui.or_cancel'), supplier_articles_path(@supplier)
12 |
--------------------------------------------------------------------------------
/app/views/shared/_custom_form_fields.html.haml:
--------------------------------------------------------------------------------
1 | - if FoodsoftConfig[:custom_fields] && FoodsoftConfig[:custom_fields][type]
2 | = f.simple_fields_for :custom_fields, defaults: { required: false } do |s|
3 | - FoodsoftConfig[:custom_fields][type].each do |options|
4 | - options = options.deep_symbolize_keys
5 | - name = options.delete(:name)
6 | - value = f.object.settings.custom_fields[name]
7 | = s.input name, options.deep_merge(input_html: {value:value})
8 |
--------------------------------------------------------------------------------
/app/views/stockit/create.js.erb:
--------------------------------------------------------------------------------
1 | $('#main').prepend('<%= j(render(
2 | :partial => 'shared/alert_success',
3 | :locals => {
4 | :alert_message => t('.notice', :name => @stock_article.name)
5 | }
6 | )) %>');
7 |
8 | // Publish database changes.
9 | // See publish/subscribe design pattern in /doc.
10 | $(document).trigger({
11 | type: 'StockArticle#create',
12 | stock_article_id: <%= @stock_article.id %>
13 | });
14 |
15 | $('#modalContainer').modal('hide');
16 |
--------------------------------------------------------------------------------
/app/views/stockit/update.js.erb:
--------------------------------------------------------------------------------
1 | $('#main').prepend('<%= j(render(
2 | :partial => 'shared/alert_success',
3 | :locals => {
4 | :alert_message => t('.notice', :name => @stock_article.name)
5 | }
6 | )) %>');
7 |
8 | // Publish database changes.
9 | // See publish/subscribe design pattern in /doc.
10 | $(document).trigger({
11 | type: 'StockArticle#update',
12 | stock_article_id: <%= @stock_article.id %>
13 | });
14 |
15 | $('#modalContainer').modal('hide');
16 |
--------------------------------------------------------------------------------
/app/controllers/api/v1/orders_controller.rb:
--------------------------------------------------------------------------------
1 | class Api::V1::OrdersController < Api::V1::BaseController
2 | include Concerns::CollectionScope
3 |
4 | before_action -> { doorkeeper_authorize! 'orders:read', 'orders:write' }
5 |
6 | def index
7 | render_collection search_scope
8 | end
9 |
10 | def show
11 | render json: scope.find(params.require(:id))
12 | end
13 |
14 | private
15 |
16 | def scope
17 | Order.includes(:supplier)
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/app/controllers/order_comments_controller.rb:
--------------------------------------------------------------------------------
1 | class OrderCommentsController < ApplicationController
2 | def new
3 | @order = Order.find(params[:order_id])
4 | @order_comment = @order.comments.build(user: current_user)
5 | end
6 |
7 | def create
8 | @order_comment = OrderComment.new(params[:order_comment])
9 | if @order_comment.save
10 | render layout: false
11 | else
12 | render action: :new, layout: false
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/views/finance/financial_transactions/_ordergroup.haml:
--------------------------------------------------------------------------------
1 | %tr.transaction
2 | %td
3 | = select_tag 'financial_transactions[][ordergroup_id]',
4 | options_for_select(Ordergroup.undeleted.order(:name).map { |g| [ g.name, g.id ] }),
5 | class: 'form-control'
6 | %td= text_field_tag 'financial_transactions[][amount]', nil, class: 'form-control'
7 | %td= link_to t('.remove'), "#", :title => t('.remove_group'), 'data-remove-transaction' => true,
8 | class: 'btn btn-sm'
9 |
--------------------------------------------------------------------------------
/db/migrate/20171002000000_create_financial_links.rb:
--------------------------------------------------------------------------------
1 | class CreateFinancialLinks < ActiveRecord::Migration[4.2]
2 | def change
3 | create_table :financial_links do |t|
4 | t.text :note
5 | end
6 |
7 | add_column :financial_transactions, :financial_link_id, :integer
8 | add_column :invoices, :financial_link_id, :integer
9 |
10 | add_index :financial_transactions, :financial_link_id
11 | add_index :invoices, :financial_link_id
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/overrides/group_orders/show/add_pdf_download.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_before '#articles_table'
2 | - if FoodsoftCurrentOrders.enabled?
3 | - unless @orders.nil? or @orders.empty? or @order_articles.nil? or @order_articles.empty?
4 | - content_for :actionbar do
5 | = link_to url_for(controller: 'current_orders/orders', action: 'my', id: @orders.map(&:id).join('+'), format: 'pdf'), class: 'btn' do
6 | = fa_icon :download
7 | PDF
8 |
9 |
--------------------------------------------------------------------------------
/app/views/finance/financial_links/incomplete.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | %table.table.table-striped
4 | %thead
5 | %tr
6 | %th= heading_helper FinancialLink, :id
7 | %th= heading_helper FinancialLink, :note
8 | %th= heading_helper FinancialTransaction, :amount
9 | %tbody
10 | - for fl in @financial_links
11 | %tr
12 | %td= link_to fl.id, finance_link_path(fl)
13 | %td= fl.note
14 | %td= format_currency fl.full_sum
15 |
--------------------------------------------------------------------------------
/bin/resque:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'resque' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('resque', 'resque')
17 |
--------------------------------------------------------------------------------
/bin/rspec:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'rspec' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('rspec-core', 'rspec')
17 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/ordergroups/show_on_group_order_article_create.js.erb:
--------------------------------------------------------------------------------
1 | // Handle more advanced DOM update after AJAX database manipulation.
2 | // See publish/subscribe design pattern in /doc.
3 | (function(w) {
4 | $('#goa_<%= @goa.id %>').remove(); // just to be sure: remove table row which is added below
5 | $('#articles_by_groups tbody').append('<%= j render('article', goa: @goa, base_unit: params[:base_unit]) %>').addClass('success');
6 | })(window);
7 |
8 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/articles/_actions.html.haml:
--------------------------------------------------------------------------------
1 | .btn-group.pull-right
2 | = link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
3 | = t 'orders.show.download.title'
4 | %span.caret
5 | %ul.dropdown-menu
6 | %li= link_to t('orders.show.download.group_pdf'), current_orders_orders_path(document: :groups, format: :pdf)
7 | %li= link_to t('orders.show.download.article_pdf'), current_orders_orders_path(document: :articles, format: :pdf)
8 |
--------------------------------------------------------------------------------
/plugins/messages/app/controllers/message_threads_controller.rb:
--------------------------------------------------------------------------------
1 | class MessageThreadsController < ApplicationController
2 | before_action -> { require_plugin_enabled FoodsoftMessages }
3 |
4 | def index
5 | @groups = Group.order(:name)
6 | end
7 |
8 | def show
9 | @group = Group.find_by_id(params[:id])
10 | @message_threads = Message.readable_for(current_user).threads.where(group: @group).page(params[:page]).per(@per_page).order(created_at: :desc)
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/wiki/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | scope '/:foodcoop' do
3 | resources :pages do
4 | get :all, on: :collection
5 | get :version, on: :member
6 | get :revert, on: :member
7 | get :diff, on: :member
8 | end
9 | get '/wiki/:permalink' => 'pages#show', :as => 'wiki_page' # , :constraints => {:permalink => /[^\s]+/}
10 | get '/wiki' => 'pages#show', :defaults => { permalink: 'Home' }, :as => 'wiki'
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/controllers/finance/base_controller.rb:
--------------------------------------------------------------------------------
1 | class Finance::BaseController < ApplicationController
2 | before_action :authenticate_finance
3 |
4 | def index
5 | @financial_transactions = FinancialTransaction.with_ordergroup.includes(:ordergroup).order(created_on: :desc).limit(8)
6 | @orders = Order.finished_not_closed.includes(:supplier).limit(8)
7 | @unpaid_invoices = Invoice.unpaid.includes(:supplier).limit(8)
8 |
9 | render template: 'finance/index'
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/tasks/user.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 | = render 'nav'
3 |
4 | - unless @unaccepted_tasks.empty?
5 | %section
6 | %h3= t '.title_open'
7 | = render 'shared/task_list', tasks: @unaccepted_tasks
8 |
9 | %section
10 | %h3= t '.title_accepted'
11 | - unless @accepted_tasks.empty?
12 | = render 'shared/task_list', tasks: @accepted_tasks
13 | - else
14 | = t('.more', tasks_link: link_to(t('.tasks_link'), tasks_path)).html_safe
15 | %br/
16 | = link_to_top
17 |
--------------------------------------------------------------------------------
/bin/autospec:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'autospec' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('rspec-core', 'autospec')
17 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4 | # Use this to limit dissemination of sensitive information.
5 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6 | Rails.application.config.filter_parameters += %i[
7 | passw secret token _key crypt salt certificate otp ssn
8 | ]
9 |
--------------------------------------------------------------------------------
/db/migrate/20250519093453_rename_order_timestamp_and_add_remote_order_fields_to_supplier.rb:
--------------------------------------------------------------------------------
1 | class RenameOrderTimestampAndAddRemoteOrderFieldsToSupplier < ActiveRecord::Migration[7.0]
2 | def change
3 | change_table :orders do |t|
4 | t.rename :last_sent_mail, :remote_ordered_at
5 | end
6 | change_table :suppliers do |t|
7 | t.column :remote_order_method, :string, null: false, default: 'email'
8 | t.column :remote_order_url, :string
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/application.scss:
--------------------------------------------------------------------------------
1 | // "bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
2 | @import "bootstrap-sprockets";
3 | @import "bootstrap";
4 | @import "font-awesome";
5 | @import "bootstrap_and_overrides";
6 | @import "select2";
7 | @import "select2-bootstrap";
8 | @import "token-input-bootstrappy";
9 | @import "bootstrap-datepicker3";
10 | @import "list.unlist";
11 | @import "list.missing";
12 | @import "recurring_select";
13 | @import "actiontext";
14 |
--------------------------------------------------------------------------------
/app/jobs/notify_finished_order_job.rb:
--------------------------------------------------------------------------------
1 | class NotifyFinishedOrderJob < ApplicationJob
2 | def perform(order)
3 | order.group_orders.each do |group_order|
4 | next unless group_order.ordergroup
5 |
6 | group_order.ordergroup.users.each do |user|
7 | next unless user.settings.notify['order_finished']
8 |
9 | Mailer.deliver_now_with_user_locale user do
10 | Mailer.order_result(user, group_order)
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/bin/resque-web:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'resque-web' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('resque', 'resque-web')
17 |
--------------------------------------------------------------------------------
/app/jobs/notify_received_order_job.rb:
--------------------------------------------------------------------------------
1 | class NotifyReceivedOrderJob < ApplicationJob
2 | def perform(order)
3 | order.group_orders.each do |group_order|
4 | next unless group_order.ordergroup
5 |
6 | group_order.ordergroup.users.each do |user|
7 | next unless user.settings.notify['order_received']
8 |
9 | Mailer.deliver_now_with_user_locale user do
10 | Mailer.order_received(user, group_order)
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/views/foodcoop/workgroups/edit.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 |
3 | - unless FoodsoftConfig[:disable_invite]
4 | %p= t('.invite_new', invite_link: link_to(t('.invite_link'), new_invite_path(id: @workgroup.id))).html_safe
5 |
6 | .col-md-3
7 | = simple_form_for [:foodcoop, @workgroup] do |f|
8 | = render 'shared/group_form_fields', f: f
9 | .form-group
10 | .col-sm-offset-2.col-sm-10
11 | = f.button :submit
12 | = link_to t('ui.or_cancel'), foodcoop_workgroups_path
13 |
--------------------------------------------------------------------------------
/bin/mailcatcher:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | #
3 | # This file was generated by Bundler.
4 | #
5 | # The application 'mailcatcher' is installed as part of a gem, and
6 | # this file is here to facilitate running it.
7 | #
8 |
9 | require 'pathname'
10 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
11 | Pathname.new(__FILE__).realpath)
12 |
13 | require 'rubygems'
14 | require 'bundler/setup'
15 |
16 | load Gem.bin_path('mailcatcher', 'mailcatcher')
17 |
--------------------------------------------------------------------------------
/db/migrate/20190100000006_change_order_article_result_types.rb:
--------------------------------------------------------------------------------
1 | class ChangeOrderArticleResultTypes < ActiveRecord::Migration[4.2]
2 | def self.up
3 | change_column :order_articles, :units_billed, :decimal, precision: 8, scale: 3
4 | change_column :order_articles, :units_received, :decimal, precision: 8, scale: 3
5 | end
6 |
7 | def self.down
8 | change_column :order_articles, :units_billed, :integer
9 | change_column :order_articles, :units_received, :integer
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/wiki/lib/foodsoft_wiki.rb:
--------------------------------------------------------------------------------
1 | require 'wikicloth'
2 | require 'acts_as_versioned'
3 | require 'diffy'
4 | require 'content_for_in_controllers'
5 | require 'foodsoft_wiki/engine'
6 | require 'foodsoft_wiki/mailer'
7 | require 'foodsoft_wiki/wiki_parser'
8 |
9 | module FoodsoftWiki
10 | # Return whether the wiki is used or not.
11 | # Enabled by default in {FoodsoftConfig} since it used to be part of the foodsoft core.
12 | def self.enabled?
13 | FoodsoftConfig[:use_wiki]
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/printer/app/overrides/orders/show/add_print_button.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains("title t(\'.title\'")'
2 | - content_for :actionbar do
3 | - if FoodsoftPrinter.enabled?
4 | = link_to content_tag(:i, nil, class: 'icon-print'), printer_jobs_path(order: @order), method: :post,
5 | class: "btn#{' btn-primary' unless @order.printer_jobs.any?}",
6 | data: {confirm: @order.printer_jobs.any? && t('.confirm_create_printer_job') },
7 | title: t('helpers.submit.printer_job.create')
8 |
--------------------------------------------------------------------------------
/.rubocop.yml:
--------------------------------------------------------------------------------
1 | inherit_from: .rubocop_todo.yml
2 |
3 | inherit_mode:
4 | merge:
5 | - Exclude
6 |
7 | require:
8 | - rubocop-rails
9 | - rubocop-rspec
10 | - rubocop-rspec_rails
11 | - rubocop-capybara
12 | - rubocop-factory_bot
13 |
14 | AllCops:
15 | NewCops: enable
16 | Exclude:
17 | - 'db/**/*'
18 | - 'bin/*'
19 |
20 | Gemspec/OrderedDependencies:
21 | Exclude:
22 | - 'plugins/*/*.gemspec'
23 |
24 | Metrics/BlockLength:
25 | Exclude:
26 | - 'lib/tasks/foodsoft.rake'
27 |
--------------------------------------------------------------------------------
/app/controllers/api/v1/article_categories_controller.rb:
--------------------------------------------------------------------------------
1 | class Api::V1::ArticleCategoriesController < Api::V1::BaseController
2 | include Concerns::CollectionScope
3 |
4 | def index
5 | render json: search_scope
6 | end
7 |
8 | def show
9 | render json: scope.find(params.require(:id))
10 | end
11 |
12 | private
13 |
14 | def max_per_page
15 | nil
16 | end
17 |
18 | def default_per_page
19 | nil
20 | end
21 |
22 | def scope
23 | ArticleCategory.all
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/articles/show_on_group_order_article_create.js.erb:
--------------------------------------------------------------------------------
1 | // Handle more advanced DOM update after AJAX database manipulation.
2 | // See publish/subscribe design pattern in /doc.
3 | (function(w) {
4 | $('#goa_<%= @goa.id %>').remove(); // just to be sure: remove table row which is added below
5 | $('#articles_by_articles tbody').append('<%= j render('shared/articles_by/article_single_goa', goa: @goa, base_unit: params[:base_unit]) %>').addClass('success');
6 | })(window);
7 |
8 |
--------------------------------------------------------------------------------
/app/controllers/supplier_shares_controller.rb:
--------------------------------------------------------------------------------
1 | class SupplierSharesController < ApplicationController
2 | before_action :authenticate_suppliers
3 |
4 | def create
5 | @supplier = Supplier.find(params[:supplier_id])
6 | @supplier.update_attribute(:external_uuid, SecureRandom.uuid)
7 |
8 | render 'update'
9 | end
10 |
11 | def destroy
12 | @supplier = Supplier.find(params[:supplier_id])
13 | @supplier.update_attribute(:external_uuid, nil)
14 |
15 | render 'update'
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/app/views/stockit/index_on_stock_article_create.js.erb:
--------------------------------------------------------------------------------
1 | // Handle more advanced DOM update after AJAX database manipulation.
2 | // See publish/subscribe design pattern in /doc.
3 | (function() {
4 | $('#articles-tbody tr').removeClass('success');
5 |
6 | var stock_article_row = $('<%= j(render(
7 | :partial => 'stock_article',
8 | :locals => {
9 | :stock_article => @stock_article
10 | }
11 | )) %>').addClass('success');
12 |
13 | $('#articles-tbody').prepend(stock_article_row);
14 | })();
15 |
--------------------------------------------------------------------------------
/db/migrate/20130718183100_create_settings.rb:
--------------------------------------------------------------------------------
1 | class CreateSettings < ActiveRecord::Migration[4.2]
2 | def self.up
3 | create_table :settings do |t|
4 | t.string :var, null: false
5 | t.text :value, null: true
6 | t.integer :thing_id, null: true
7 | t.string :thing_type, limit: 30, null: true
8 | t.timestamps
9 | end
10 |
11 | add_index :settings, %i[thing_type thing_id var], unique: true
12 | end
13 |
14 | def self.down
15 | drop_table :settings
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/app/controllers/errors_controller.rb:
--------------------------------------------------------------------------------
1 | class ErrorsController < ApplicationController
2 | include Gaffe::Errors
3 |
4 | skip_before_action :authenticate
5 |
6 | layout :current_layout
7 |
8 | def show
9 | render "errors/#{@rescue_response}", formats: :html, status: @status_code
10 | end
11 |
12 | private
13 |
14 | def current_layout
15 | current_user ? 'application' : 'login'
16 | end
17 |
18 | def login_layout?
19 | current_user.nil?
20 | end
21 | helper_method :login_layout?
22 | end
23 |
--------------------------------------------------------------------------------
/app/views/finance/financial_transactions/_order_note.html.haml:
--------------------------------------------------------------------------------
1 | - financial_transaction = local_assigns[:financial_transaction]
2 | - with_grouporder_link = local_assigns[:with_grouporder_link]
3 | - if financial_transaction.group_order
4 | - if with_grouporder_link
5 | = link_to financial_transaction.note, financial_transaction.group_order
6 | - else
7 | = link_to financial_transaction.note, new_finance_order_path(order_id: financial_transaction.group_order.order.id)
8 | - else
9 | = financial_transaction.note
10 |
--------------------------------------------------------------------------------
/app/views/kaminari/_first_page.html.haml:
--------------------------------------------------------------------------------
1 | -#
2 | Link to the "First" page
3 | - available local variables
4 | url: url to the first page
5 | current_page: a page object for the currently displayed page
6 | num_pages: total number of pages
7 | per_page: number of items to fetch per page
8 | remote: data-remote
9 |
10 | - unless current_page.first?
11 | %li{:class => "first"}
12 | = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
--------------------------------------------------------------------------------
/app/views/stockit/show_on_stock_article_update.js.erb:
--------------------------------------------------------------------------------
1 | // Handle more advanced DOM update after AJAX database manipulation.
2 | // See publish/subscribe design pattern in /doc.
3 | (function() {
4 | var stock_article_details = $('<%= j(render(
5 | :partial => 'stock_article_details',
6 | :locals => {
7 | :stock_article => @stock_article
8 | }
9 | )) %>');
10 |
11 | $('#stockArticleDetails').replaceWith(stock_article_details);
12 | $('h1').first().text('<%= j(@stock_article.name) %>');
13 | })();
14 |
--------------------------------------------------------------------------------
/db/migrate/018_create_invites.rb:
--------------------------------------------------------------------------------
1 | class CreateInvites < ActiveRecord::Migration[4.2]
2 | def self.up
3 | create_table :invites do |t|
4 | t.column :token, :string, null: false
5 | t.column :expires_at, :timestamp, null: false
6 | t.column :group_id, :integer, null: false
7 | t.column :user_id, :integer, null: false
8 | t.column :email, :string, null: false
9 | end
10 | add_index :invites, :token
11 | end
12 |
13 | def self.down
14 | drop_table :invites
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/messagegroups/_messagegroup.html.haml:
--------------------------------------------------------------------------------
1 | %section.well
2 | %h3= messagegroup.name
3 | = render :partial => 'shared/group', :locals => { :group => messagegroup }
4 | = link_to_new_message(message_params: {group_id: messagegroup.id})
5 | - if messagegroup.member?(current_user)
6 | = link_to t('.leave'), leave_messagegroup_path(messagegroup), class: 'btn btn-default', method: :post
7 | - else
8 | = link_to t('.join'), join_messagegroup_path(messagegroup), class: 'btn btn-default', method: :post
9 |
--------------------------------------------------------------------------------
/app/views/admin/configs/_tab_security.html.haml:
--------------------------------------------------------------------------------
1 | .col-md-4
2 | %h4= t '.default_roles_title'
3 | = t '.default_roles_paragraph'
4 | = config_input form, :default_role_suppliers, as: :boolean
5 | = config_input form, :default_role_article_meta, as: :boolean
6 | = config_input form, :default_role_orders, as: :boolean
7 | = config_input form, :default_role_pickups, as: :boolean
8 | = config_input form, :default_role_finance, as: :boolean
9 | = config_input form, :default_role_invoices, as: :boolean
10 |
--------------------------------------------------------------------------------
/app/views/stock_takings/new_on_stock_article_create.js.erb:
--------------------------------------------------------------------------------
1 | // Handle more advanced DOM update after AJAX database manipulation.
2 | // See publish/subscribe design pattern in /doc.
3 | (function() {
4 | $('#stock_changes p').removeClass('alert alert-success');
5 |
6 | var stock_change = $('<%= j(render(
7 | :partial => 'stock_change',
8 | :locals => {
9 | :stock_change => @stock_change
10 | }
11 | )) %>').addClass('alert alert-success');
12 |
13 | $('#stock_changes').prepend(stock_change);
14 | })();
15 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/message_threads/_groupmessage_threads.html.haml:
--------------------------------------------------------------------------------
1 | - message_threads = Message.readable_for(current_user).threads.where(group: group).order(created_at: :desc).limit(5)
2 | - unless message_threads.empty?
3 | %section
4 | %h3
5 | = name
6 | %small
7 | = link_to message_thread_path(id) do
8 | = t '.show_message_threads'
9 | %i.icon.icon-chevron-right
10 | = render 'message_threads', message_threads: message_threads, pagination: false
11 | = link_to_top
12 |
--------------------------------------------------------------------------------
/app/views/admin/configs/_tab_messages.html.haml:
--------------------------------------------------------------------------------
1 | .col-md-4
2 | %fieldset
3 | %label
4 | %h4= t '.emails_title'
5 | = config_input form, :email_from, as: :string, input_html: {class: 'form-control', placeholder: "#{@cfg[:name]} <#{@cfg[:contact][:email]}>"}
6 | = config_input form, :email_replyto, as: :string, input_html: {class: 'form-control'}
7 | -# sender is better configured by server administrator, since it affects SPF records
8 | -#= config_input form, :email_sender, as: :string, input_html: {class: 'form-control'}
9 |
--------------------------------------------------------------------------------
/app/views/kaminari/_next_page.html.haml:
--------------------------------------------------------------------------------
1 | -#
2 | Link to the "Next" page
3 | - available local variables
4 | url: url to the next page
5 | current_page: a page object for the currently displayed page
6 | num_pages: total number of pages
7 | per_page: number of items to fetch per page
8 | remote: data-remote
9 |
10 | - unless current_page.last?
11 | %li{:class=>"next_page"}
12 | = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
--------------------------------------------------------------------------------
/app/views/login/accept_invitation.html.haml:
--------------------------------------------------------------------------------
1 | - content_for :javascript do
2 | :javascript
3 | $(#{FoodsoftConfig[:use_nick] ? 'user_nick' : 'user_first_name'}).focus();
4 |
5 | - title t('.title', name: FoodsoftConfig[:name])
6 | = t('.body', group: h(@invite.group.name), foodcoop: h(FoodsoftConfig[:name])).html_safe
7 | = simple_form_for @user, url: accept_invitation_path do |form|
8 | = render partial: 'shared/user_form_fields', locals: {f: form}
9 | %div
10 | = submit_tag t('.submit'), class: 'btn btn-default'
11 |
12 |
--------------------------------------------------------------------------------
/app/views/group_orders/archive.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', group: @ordergroup.name)
2 | %p
3 | = t('.desc', link: link_to(t('.open_orders'), group_orders_path)).html_safe
4 |
5 | .row
6 | .col-md-6
7 | %h2= t '.title_open'
8 | = render partial: 'orders', locals: {orders: @finished_not_closed_orders_including_group_order, pagination: false}
9 |
10 | .col-md-6
11 | %h2= t '.title_closed'
12 | #closed_orders
13 | = render partial: 'orders', locals: {orders: @closed_orders_including_group_order, pagination: true}
14 |
--------------------------------------------------------------------------------
/lib/tasks/rspec.rake:
--------------------------------------------------------------------------------
1 | begin
2 | require 'rspec/core/rake_task'
3 | task(:spec).clear
4 | RSpec::Core::RakeTask.new(:spec) do |t|
5 | t.pattern = 'spec/**/*_spec.rb,plugins/**/*_spec.rb'
6 | end
7 | task default: :spec
8 |
9 | # Use `rspec` to run a single test. When a test fails in rake but not
10 | # with rspec, you can use the following to run a single test using rake:
11 | # RSpec::Core::RakeTask.new('spec:foo') do |t|
12 | # t.pattern = "spec/integration/foo_spec.rb"
13 | # end
14 | rescue LoadError
15 | end
16 |
--------------------------------------------------------------------------------
/spec/requests/api/v1/configs_controller_spec.rb:
--------------------------------------------------------------------------------
1 | require 'swagger_helper'
2 |
3 | describe Api::V1::ConfigsController do
4 | include ApiHelper
5 |
6 | path '/config' do
7 | get 'configuration variables' do
8 | tags 'General'
9 | produces 'application/json'
10 | let(:api_scopes) { ['config:user'] }
11 |
12 | response '200', 'success' do
13 | schema type: :object, properties: {}
14 | run_test!
15 | end
16 |
17 | it_handles_invalid_token_and_scope
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/app/controllers/api/v1/financial_transaction_classes_controller.rb:
--------------------------------------------------------------------------------
1 | class Api::V1::FinancialTransactionClassesController < Api::V1::BaseController
2 | include Concerns::CollectionScope
3 |
4 | def index
5 | render json: search_scope
6 | end
7 |
8 | def show
9 | render json: scope.find(params.require(:id))
10 | end
11 |
12 | private
13 |
14 | def max_per_page
15 | nil
16 | end
17 |
18 | def default_per_page
19 | nil
20 | end
21 |
22 | def scope
23 | FinancialTransactionClass.all
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/app/views/kaminari/_prev_page.html.haml:
--------------------------------------------------------------------------------
1 | -#
2 | Link to the "Previous" page
3 | - available local variables
4 | url: url to the previous page
5 | current_page: a page object for the currently displayed page
6 | num_pages: total number of pages
7 | per_page: number of items to fetch per page
8 | remote: data-remote
9 |
10 | - unless current_page.first?
11 | %li{:class=>"prev"}
12 | = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
--------------------------------------------------------------------------------
/config/locales/overrides.yml:
--------------------------------------------------------------------------------
1 | # This file contains overrides that do not go through localeapp.
2 | # If there's a key in one language, it forces presence in other languages
3 | # which means that we can't override in specific languages only. This file
4 | # makes that possible.
5 | en:
6 | number:
7 | currency:
8 | format:
9 | unit: ! "€\u202f"
10 | nl:
11 | number:
12 | currency:
13 | format:
14 | delimiter: ! "\u202f"
15 | unit: ! "€\u202f"
16 | format:
17 | delimiter: ! "\u202f"
18 |
--------------------------------------------------------------------------------
/app/serializers/financial_transaction_serializer.rb:
--------------------------------------------------------------------------------
1 | class FinancialTransactionSerializer < ActiveModel::Serializer
2 | include ApplicationHelper
3 |
4 | attributes :id, :user_id, :user_name, :amount, :note, :created_at
5 | attributes :financial_transaction_type_id, :financial_transaction_type_name
6 |
7 | def user_name
8 | show_user object.user
9 | end
10 |
11 | def financial_transaction_type_name
12 | object.financial_transaction_type.name
13 | end
14 |
15 | def amount
16 | object.amount.to_f
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/app/views/stockit/index_on_stock_article_update.js.erb:
--------------------------------------------------------------------------------
1 | // Handle more advanced DOM update after AJAX database manipulation.
2 | // See publish/subscribe design pattern in /doc.
3 | (function() {
4 | $('#articles-tbody tr').removeClass('success');
5 |
6 | var stock_article_row = $('<%= j(render(
7 | :partial => 'stock_article',
8 | :locals => {
9 | :stock_article => @stock_article
10 | }
11 | )) %>').addClass('success');
12 |
13 | $('#stockArticle-<%= @stock_article.id %>').replaceWith(stock_article_row);
14 | })();
15 |
--------------------------------------------------------------------------------
/app/views/tasks/index.haml:
--------------------------------------------------------------------------------
1 | - title t('.title')
2 | = render 'nav'
3 |
4 | - unless @non_group_tasks.empty?
5 | %section
6 | %h3= t '.title_non_group'
7 | = render 'shared/task_list', tasks: @non_group_tasks
8 |
9 |
10 | - for group in @groups
11 | - tasks = group.open_tasks
12 | - unless tasks.empty?
13 | %section
14 | %h3
15 | = group.name
16 | %small= link_to t('.show_group_tasks'), workgroup_tasks_path(workgroup_id: group)
17 | = render 'shared/task_list', tasks: tasks
18 | = link_to_top
19 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/admin/messagegroups/show.html.haml:
--------------------------------------------------------------------------------
1 | - title t '.title', name: @messagegroup.name
2 |
3 | %section= render 'shared/group', group: @messagegroup
4 | = link_to t('ui.edit'), edit_admin_messagegroup_path(@messagegroup), class: 'btn btn-default'
5 | = link_to t('ui.delete'), [:admin, @messagegroup], :data => {:confirm => t('ui.confirm_delete', name: @messagegroup.name)}, :method => :delete, class: 'btn btn-danger'
6 | = link_to t('.send_message'), new_message_path(:message => {:group_id => @messagegroup.id}), class: 'btn btn-default'
7 |
--------------------------------------------------------------------------------
/plugins/printer/app/overrides/admin/configs/_tab_others/add_printer_config.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after ':root:last-child'
2 | .row
3 | .col-md-4
4 | = config_use_heading form, :use_printer do
5 | = config_input form, :printer_token, as: :string
6 | = config_input form, :printer_print_order_fax, as: :boolean
7 | = config_input form, :printer_print_order_articles, as: :boolean
8 | = config_input form, :printer_print_order_groups, as: :boolean
9 | = config_input form, :printer_print_order_matrix, as: :boolean
10 |
--------------------------------------------------------------------------------
/spec/i18n_spec.rb:
--------------------------------------------------------------------------------
1 | require 'spec_helper'
2 | require 'i18n-spec'
3 |
4 | Dir.glob('config/locales/??{-*,}.yml').each do |locale_file|
5 | describe "#{locale_file}" do
6 | it_behaves_like 'a valid locale file', locale_file
7 | # We're currently allowing both German and English as source language
8 | # besides, we're using localeapp, so that it's ok if pull requests
9 | # don't have this - a localapp pull will fix that right away.
10 | # it { expect(locale_file).to be_a_subset_of 'config/locales/en.yml' }
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/controllers/concerns/send_order_pdf.rb:
--------------------------------------------------------------------------------
1 | module Concerns::SendOrderPdf
2 | extend ActiveSupport::Concern
3 |
4 | protected
5 |
6 | def send_order_pdf(order, document)
7 | klass = case document
8 | when 'groups' then OrderByGroups
9 | when 'articles' then OrderByArticles
10 | when 'fax' then OrderFax
11 | when 'matrix' then OrderMatrix
12 | end
13 | pdf = klass.new order
14 | send_data pdf.to_pdf, filename: pdf.filename, type: 'application/pdf'
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/app/views/home/_apple_bar.html.haml:
--------------------------------------------------------------------------------
1 | = t '.points', points: apple_bar.apples
2 | .progress
3 | %div{class: "progress-bar progress-bar-#{apple_bar.group_bar_state}", style: "width: #{apple_bar.group_bar_width}%"}
4 |
5 | %span.description
6 | = t '.desc', amount: number_to_currency(apple_bar.mean_order_amount_per_job, :precision=>0)
7 | - if FoodsoftConfig[:stop_ordering_under].present?
8 | %strong= t('.warning', threshold: FoodsoftConfig[:stop_ordering_under])
9 | = link_to t('.more_info'), FoodsoftConfig[:applepear_url], target: '_blank'
10 |
--------------------------------------------------------------------------------
/app/views/tasks/_archive_tasks.html.haml:
--------------------------------------------------------------------------------
1 | - if Task.done.count > 20
2 | = items_per_page
3 | = pagination_links_remote @tasks
4 |
5 | %table.table.table-striped
6 | %thead
7 | %tr
8 | %th= heading_helper Task, :due_date
9 | %th= heading_helper Task, :name
10 | %th= heading_helper Task, :user_list
11 | %th
12 | %tbody
13 | - @tasks.each do |task|
14 | %tr
15 | %td= task.due_date unless task.due_date.nil?
16 | %td= link_to task_title(task), task_path(task)
17 | %td= task_assignments task
18 |
--------------------------------------------------------------------------------
/app/views/active_storage/blobs/_blob.html.haml:
--------------------------------------------------------------------------------
1 | %figure{class: "attachment attachment--#{blob.representable? ? "preview" : "file"} attachment--#{blob.filename.extension}"}
2 | - if blob.representable?
3 | = image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ])
4 | %figcaption.attachment__caption
5 | - if caption = blob.try(:caption)
6 | = caption
7 | - else
8 | %span.attachment__name= link_to blob.filename, blob
9 | %span.attachment__size= number_to_human_size blob.byte_size
10 |
--------------------------------------------------------------------------------
/app/views/kaminari/_page.html.haml:
--------------------------------------------------------------------------------
1 | -#
2 | Link showing page number
3 | - available local variables
4 | page: a page object for "this" page
5 | url: url to this page
6 | current_page: a page object for the currently displayed page
7 | num_pages: total number of pages
8 | per_page: number of items to fetch per page
9 | remote: data-remote
10 | %li{:class=>"page #{' active' if page.current? }"}
11 | = link_to page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
--------------------------------------------------------------------------------
/db/migrate/015_change_result_quantities.rb:
--------------------------------------------------------------------------------
1 | class ChangeResultQuantities < ActiveRecord::Migration[4.2]
2 | def self.up
3 | change_column :group_order_article_results, :quantity, :decimal, precision: 6, scale: 3
4 | change_column :order_article_results, :units_to_order, :decimal, precision: 6, scale: 3, null: false
5 | end
6 |
7 | def self.down
8 | change_column :group_order_article_results, :quantity, :integer, null: false
9 | change_column :order_article_results, :units_to_order, :integer, default: 0, null: false
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/views/admin/configs/show.html.haml:
--------------------------------------------------------------------------------
1 | - title t('admin.configs.tabs.title'), false
2 |
3 | -# disable validations, because browsers can't handle inputs hidden in another tab
4 | = simple_form_for :config, method: :patch, html: {novalidate: true} do |f|
5 |
6 | = render 'tabs', url: nil
7 |
8 | .tab-content.row.pt-5.pl-5
9 | - for tab in @tabs
10 | .tab-pane{class: ('active' if @current_tab==tab), id: "tab-#{tab}"}= render "tab_#{tab}", form: f
11 |
12 | .col-md-8.pull-right
13 | = f.submit t('.submit'), class: 'btn btn-primary '
14 |
15 |
--------------------------------------------------------------------------------
/plugins/current_orders/app/views/current_orders/articles/_article.html.haml:
--------------------------------------------------------------------------------
1 | #order_article
2 |
3 | - if order_article
4 | = render 'article_info', order_article: order_article
5 | = render 'ordergroups', order_article: order_article
6 |
7 | - else
8 | %h2= t('current_orders.articles.index.title')
9 | #articles_by_articles
10 | %p
11 | %i= t '.counts', ordergroups: Ordergroup.joins(:orders).where(orders: {state: 'finished'}).count(distinct: true), articles: @order_articles.count
12 | %p
13 | %i= t '.no_selection'
14 |
--------------------------------------------------------------------------------
/plugins/messages/app/views/messages/_actionbar.haml:
--------------------------------------------------------------------------------
1 | - content_for :actionbar do
2 | .btn-group
3 | = link_to message_threads_path, class: "btn btn-default #{'active' if active == 'message_threads'}" do
4 | = fa_icon "align-left", title: t('.message_threads')
5 | = link_to messages_path, class: "btn btn-default #{'active' if active == 'messages'}" do
6 | = fa_icon "align-justify", title: t('.messages')
7 | = link_to t('.messagegroups'), messagegroups_path, class: 'btn btn-default'
8 | = link_to t('.new'), new_message_path, class: 'btn btn-primary'
9 |
--------------------------------------------------------------------------------
/.github/workflows/rubocop.yml:
--------------------------------------------------------------------------------
1 | name: RuboCop
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | test:
7 | runs-on: ubuntu-latest
8 |
9 | steps:
10 | - name: Checkout source code
11 | uses: actions/checkout@v2
12 | - name: Install libmagic-dev
13 | run: sudo apt-get update && sudo apt-get install -y libmagic-dev
14 | - name: Setup ruby
15 | uses: ruby/setup-ruby@v1
16 | with:
17 | bundler-cache: true
18 | - name: Run RuboCop
19 | run: bundle exec rubocop --format github --parallel
20 |
--------------------------------------------------------------------------------
/config/initializers/permissions_policy.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Define an application-wide HTTP permissions policy. For further
4 | # information see: https://developers.google.com/web/updates/2018/06/feature-policy
5 |
6 | # Rails.application.config.permissions_policy do |policy|
7 | # policy.camera :none
8 | # policy.gyroscope :none
9 | # policy.microphone :none
10 | # policy.usb :none
11 | # policy.fullscreen :self
12 | # policy.payment :self, "https://secure.example.com"
13 | # end
14 |
--------------------------------------------------------------------------------
/plugins/messages/app/overrides/shared/_user_form_fields/add_messages_prefs.html.haml.deface:
--------------------------------------------------------------------------------
1 | / insert_after 'erb:contains("notify.input \'upcoming_tasks\'")'
2 | - if FoodsoftMessages.enabled?
3 | = s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |messages|
4 | = messages.input 'send_as_email', as: :boolean, input_html: { checked: f.object.settings.messages['send_as_email'] }
5 | - if Messagegroup.any?
6 | %div
7 | = link_to messagegroups_path do
8 | = t '.messagegroups'
9 | %i.icon.icon-chevron-right
10 |
--------------------------------------------------------------------------------
/app/views/finance/invoices/_form_js.html.haml:
--------------------------------------------------------------------------------
1 | - content_for :javascript do
2 | :javascript
3 | $(function() {
4 | if ($('#invoice_delivery_ids').length)
5 | $('#invoice_delivery_ids').select2();
6 | $('#invoice_order_ids').select2();
7 | $('#invoice_supplier_id').change(function(e) {
8 | $.ajax({
9 | url: '#{form_on_supplier_id_change_finance_invoices_path}',
10 | type: 'get',
11 | data: {invoice_id: #{invoice_id}, supplier_id: $('#invoice_supplier_id').val()}
12 | });
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/app/views/supplier_shares/_share_link.html.haml:
--------------------------------------------------------------------------------
1 | - if external_uuid.nil?
2 | = t('.not_shared')
3 | - else
4 | - share_url = api_v1_shared_supplier_articles_url(external_uuid)
5 | %div#copy-share-link-button.user-select-none{:role => 'button'}
6 | %span= share_url
7 | %i.icon-copy
8 |
9 | :javascript
10 | document
11 | .getElementById('copy-share-link-button')
12 | .addEventListener('click', () => {
13 | navigator.clipboard.writeText('#{share_url}');
14 | alert('#{t(".share_link_copied_to_clipboard")}');
15 | });
16 |
17 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/_site_map.html.haml:
--------------------------------------------------------------------------------
1 | %table.table.table-striped
2 | %thead
3 | %tr
4 | %th= t 'pages.title'
5 | %th= t 'pages.last_updated'
6 | - homepage = Page.find_by_permalink('Home')
7 | - unless homepage.nil?
8 | = render :partial => 'page_list_item', :locals => {:page => homepage, :level => 0, :siteMap => 1}
9 | %tbody
10 | - for page in @pages
11 | - if page.id != homepage.try(:id) && !page.parent_id?
12 | = render :partial => 'page_list_item', :locals => {:page => page, :level => 0, :siteMap => 1}
13 |
--------------------------------------------------------------------------------
/plugins/wiki/app/views/pages/version.html.haml:
--------------------------------------------------------------------------------
1 | - title t('.title', title: @page.title, version: @version.lock_version)
2 |
3 | - content_for :sidebar do
4 | %h3= t '.title_version'
5 | %b= "#{format_datetime_timespec(@version.updated_at, t('.date_format'))}"
6 | %ul
7 | %li= t '.author', user: show_user(User.find_by(id: @version.updated_by))
8 | %li= link_to t('.view_current'), wiki_page_path(:permalink => @page.permalink)
9 | %li= link_to t('.revert'), revert_page_path(@page, :version => @version.lock_version)
10 |
11 | = wikified_body @version.body
12 |
--------------------------------------------------------------------------------
/app/views/finance/balancing/_edit_note.html.haml:
--------------------------------------------------------------------------------
1 | = simple_form_for @order, url: update_note_finance_order_path(@order), remote: true, method: :put do |f|
2 | .modal-dialog
3 | .modal-content
4 | .modal-header
5 | = close_button :modal
6 | %h3.modal-title= t('.title')
7 | .modal-body
8 | = f.input :note, input_html: {class: 'form-control', rows: 10, cols: 80}
9 | .modal-footer
10 | = link_to t('ui.close'), '#', class: 'btn btn-default', data: {dismiss: 'modal'}
11 | = f.submit t('ui.save'), class: 'btn btn-primary'
12 |
--------------------------------------------------------------------------------
/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json]
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/app/views/tasks/edit.haml:
--------------------------------------------------------------------------------
1 | - title @periodic ? t('.title_periodic') : t('.title')
2 |
3 | - if @task.periodic? && !@periodic
4 | .alert.alert-info= raw t('tasks.edit.warning_periodic')
5 |
6 | = render 'form_sidebar'
7 |
8 | .col-md-7
9 | = simple_form_for @task do |form|
10 | = render 'form', form: form, periodic: @periodic
11 | %div
12 | - if @periodic
13 | = form.submit t('.submit_periodic'), name: 'periodic', class: 'btn btn-primary'
14 | - else
15 | = form.submit class: 'btn btn-primary'
16 | = link_to t('ui.or_cancel'), :back
17 |
--------------------------------------------------------------------------------