diff --git a/.gitignore b/.gitignore index e30ea9cd..0a79a468 100644 --- a/.gitignore +++ b/.gitignore @@ -1,52 +1,65 @@ -# Boring files -# ============ -*~ -.#* -_darcs -DEADJOE +# See https://help.github.com/articles/ignoring-files for more about ignoring files. +# +# If you find yourself ignoring temporary files generated by your text editor +# or operating system, you probably want to add a global ignore instead: +# git config --global core.excludesfile '~/.gitignore_global' # Rails # ===== -.bundle -db/*.sqlite3 -log/*.log -tmp/**/* -.sass-cache/ -# Vendor -vendor/cache -vendor/bundle +# Ignore bundler config. +/.bundle + +# Ignore the default SQLite database. +/db/*.sqlite3 +/db/*.sqlite3-journal + +# Ignore all logfiles and tempfiles. +/log +/tmp + +# Sensitive data. +.env* + +# Ignore coverage report +/doc/coverage # Volatile doc/api doc/app -public/stylesheets/all.css + +# Coverage +/doc/coverage + +# Application +# =========== +# Backup +db/backup + +# Data Dumps +db/data.yml # Local config/database.yml -system +data/ + +# Gems +# ==== +# carrierwave +uploads/ -# Passenger -# ========= -tmp/restart.txt +# guard +tmp/rspec_guard_result -# Rails Plugins -# ============= -# restful-authentication -config/initializers/site_keys.rb +# capistrano +config/deploy/*.rb -# carrier-wave -uploads +# simplecov +/doc/coverage -# Sphinx Freetext Search +# thinking-sphinx db/sphinx config/*.sphinx.conf config/sphinx/ -# SwissMatch +# swissmatch config/swissmatch.yml - -# CyDoc -# ===== -data/ -db/backup/ -public/esr_files diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..cd57a8b9 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.1.5 diff --git a/CHANGELOG b/CHANGELOG index cefd284f..3e0f91fc 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,23 @@ +2.0.0 (unreleased) +===== +This is a major release of CyDoc. It has a fresh look, better Tarmed support and +lots of small fixes. + +We now provide more settings in the user interface, remote printing among them. +There is now a much better patient search and forms have been improved. + +We actualy rewrote most parts. Mainly porting to Rails 3, switching UI to be +built on Twitter Bootstrap, and providing fulltext search for patients +and more. + +CyDoc also uses more common code with other projects like Bookyt and Hozr +by using factored out code. + +Fixes since RC8: +* Drop currency formatting in insurance recipe as it broke on amounts > 1000. +* Add role translations from Hozr. +* Restrict access to bookkeeping controller actions. + 2.0.0.rc8 ========= Some gems got updated, mainly Rails. The installation instructions diff --git a/Gemfile b/Gemfile index 9231d314..4a9175f5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,136 +1,154 @@ +# Gemfile +# ======= +# Policies: +# * We do not add versioned dependencies unless needed +# * If we add versioned dependencies, we document the reason +# * We use single quotes +# * We use titles to group related gems + # Settings # ======== -source 'http://rubygems.org' +source 'https://rubygems.org' # Rails # ===== -gem 'rails' +gem 'rails', '~> 3.2' # Unicorn # ======= gem 'unicorn' # Database -gem 'sqlite3' +# ======== gem 'mysql2' +gem 'sqlite3' -# Gems used only for assets and not required -# in production environments by default. -group :assets do - gem 'coffee-rails' - gem 'therubyracer' - gem 'uglifier' -end - -# Development -# =========== -group :development do - # RDoc - gem 'rdoc' - - # Deployment - gem 'capones_recipes' -end +# Asset Pipeline +# ============== +gem 'less-rails' +gem 'sass-rails' +gem 'uglifier' +gem 'coffee-rails' +gem 'therubyracer' +gem 'quiet_assets' -# Test +# CRUD # ==== -group :test do - gem 'cucumber' -end +gem 'inherited_resources' +gem 'has_scope' +gem 'kaminari' +gem 'show_for' +gem 'i18n_rails_helpers' -group :test, :development do - # Console - gem 'pry-rails' - gem 'pry-doc' - gem 'pry-debugger' -end +# I18n +# ==== +gem 'routing-filter' -# Standard helpers -# ================ -gem 'haml' -gem 'sass' +# UI +# == gem 'jquery-rails' - -# Styling -gem 'lyb_sidebar' -gem 'less-rails' +gem 'haml' gem 'twitter-bootstrap-rails' +gem 'lyb_sidebar' +gem 'simple-navigation' -gem 'formtastic' +# Forms +# ===== gem 'simple_form' -gem 'kaminari' -gem 'inherited_resources' -gem 'has_scope' -gem 'i18n_rails_helpers' -gem 'show_for' +gem 'select2-rails' +gem 'in_place_editing' -# Navigation -gem 'simple-navigation' -# CyDoc -# ===== -# Authentication +# Access Control +# ============== +gem 'devise', '~> 2.2' # Changed API +gem 'devise-i18n' +gem 'cancan', '1.6.8' # Issue with aliases +gem 'lyb_devise_admin' + +# State Machine gem 'aasm' # Date/Time handling gem 'validates_timeliness' +# Application Settings +gem 'ledermann-rails-settings', '1.2.0', :require => 'rails-settings' # Changed API, 1.2.1 broken + # Addresses gem 'unicode_utils' -gem 'has_vcards' +gem 'has_vcards', '~> 0.20' # Data model changes, needs synced release with CyDoc gem 'autocompletion' gem 'swissmatch' +gem 'swissmatch-location', :require => 'swissmatch/location/autoload' + +# Files +gem 'carrierwave' # Billing -gem 'has_accounts' -gem 'has_accounts_engine' +gem 'has_accounts', '~> 1.1' # Changed API +gem 'has_accounts_engine', '~> 1.1' # Changed API gem 'acts-as-taggable-on' +gem 'vesr' -# Import +# Import / Export gem 'fastercsv' gem 'activerecord-sqlserver-adapter' +gem 'csv-mapper' # Multiple Databases gem 'use_db' -# Forms -gem 'in_place_editing' -gem 'select2-rails' - -# CRUD helpers -gem 'inherited_resources_views' +# PDF generation +gem 'prawn', '1.0.0.rc2' # table support needs porting, group has been dropped -# Authentication -gem 'devise' -gem 'cancan' -gem 'lyb_devise_admin' +# Printing +gem 'cupsffi' # Search -gem 'thinking-sphinx' +gem 'thinking-sphinx', '~> 2.0' # Changed API -# Uploads -gem 'carrierwave' -# PDF -gem 'prawn', :git => 'https://github.com/prawnpdf/prawn.git' -gem 'prawnto' +# Development +# =========== +group :development do + # Debugging + gem 'better_errors' + gem 'binding_of_caller' # Needed by binding_of_caller to enable html console + # Deployment + gem 'capones_recipes' +end -# Locale setting -gem 'routing-filter' +# Dev and Test +# ============ +group :development, :test do + # Testing Framework + gem 'rspec-rails' + gem 'rspec-activemodel-mocks' -# Settings -gem 'ledermann-rails-settings', :require => 'rails-settings' + # Browser + gem 'capybara' + gem 'capybara-screenshot' + gem 'poltergeist' + gem 'selenium-webdriver' -# ESR support -gem 'vesr' + # Matchers/Helpers + gem 'accept_values_for' -# Printing -gem 'cupsffi' -gem 'ffi' + # Debugger + gem 'pry-rails' + gem 'pry-byebug' -# CSV Export -gem 'csv-mapper' + # Fixtures + gem 'database_cleaner' + gem 'connection_pool' + gem "factory_girl_rails" +end -# XML -gem 'nokogiri' +# Docs +# ==== +group :doc do + # Docs + gem 'rdoc' +end diff --git a/Gemfile.lock b/Gemfile.lock index fec788a7..13ecf0f9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,22 +1,17 @@ -GIT - remote: https://github.com/prawnpdf/prawn.git - revision: 2f56ac32f4a2761e727994216d30f24c45733349 - specs: - prawn (1.0.0.rc1) - pdf-reader (>= 0.9.0, < 2.0) - ttfunk (~> 1.0.3) - GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: Ascii85 (1.0.2) - aasm (3.0.13) - actionmailer (3.2.19) - actionpack (= 3.2.19) + aasm (4.0.8) + accept_values_for (0.7.1) + activemodel (>= 3, < 5) + rspec (>= 2.0, < 4.0) + actionmailer (3.2.21) + actionpack (= 3.2.21) mail (~> 2.5.4) - actionpack (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) + actionpack (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -24,31 +19,45 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activemodel (3.2.19) - activesupport (= 3.2.19) + activemodel (3.2.21) + activesupport (= 3.2.21) builder (~> 3.0.0) - activerecord (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) + activerecord (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activerecord-sqlserver-adapter (3.2.9) + activerecord-sqlserver-adapter (3.2.12) activerecord (~> 3.2.0) - activeresource (3.2.19) - activemodel (= 3.2.19) - activesupport (= 3.2.19) - activesupport (3.2.19) + activeresource (3.2.21) + activemodel (= 3.2.21) + activesupport (= 3.2.21) + activesupport (3.2.21) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) - acts-as-taggable-on (2.4.1) - rails (>= 3, < 5) + acts-as-taggable-on (3.4.2) + activerecord (>= 3.2, < 5) + addressable (2.3.6) + afm (0.2.2) arel (3.0.3) autocompletion (0.0.3) - bcrypt-ruby (3.0.1) + bcrypt (3.1.9) + bcrypt-ruby (3.1.5) + bcrypt (>= 3.1.3) + better_errors (2.1.0) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) builder (3.0.4) + byebug (3.5.1) + columnize (~> 0.8) + debugger-linecache (~> 1.2) + slop (~> 3.6) cancan (1.6.8) cap-recipes (0.3.39) - capistrano (2.14.2) + capistrano (2.15.5) highline net-scp (>= 1.0.0) net-sftp (>= 2.0.0) @@ -57,62 +66,73 @@ GEM capistrano-ext (1.2.1) capistrano (>= 1.0.0) capistrano_colors (0.5.5) - capones_recipes (1.18.0) + capones_recipes (1.20.1) cap-recipes - capistrano + capistrano (~> 2.0) capistrano-ext capistrano_colors - carrierwave (0.7.0) + capybara (2.4.4) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + xpath (~> 2.0) + capybara-screenshot (1.0.3) + capybara (>= 1.0, < 3) + colored + launchy + carrierwave (0.10.0) activemodel (>= 3.2.0) activesupport (>= 3.2.0) + json (>= 1.7) + mime-types (>= 1.16) + childprocess (0.5.5) + ffi (~> 1.0, >= 1.0.11) + cliver (0.3.2) coderay (1.1.0) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) - coffee-script (2.2.0) + coffee-script (2.3.0) coffee-script-source execjs - coffee-script-source (1.4.0) - columnize (0.3.6) - commonjs (0.2.6) + coffee-script-source (1.8.0) + colored (1.2) + columnize (0.9.0) + commonjs (0.2.7) + connection_pool (2.1.0) csv-mapper (0.5.1) fastercsv - cucumber (1.2.1) - builder (>= 2.1.2) - diff-lcs (>= 1.1.3) - gherkin (~> 2.11.0) - json (>= 1.4.6) - cupsffi (0.1.1) - debugger (1.6.5) - columnize (>= 0.3.1) - debugger-linecache (~> 1.2.0) - debugger-ruby_core_source (~> 1.3.1) + cupsffi (0.1.4) + ffi + database_cleaner (1.3.0) + debug_inspector (0.0.2) debugger-linecache (1.2.0) - debugger-ruby_core_source (1.3.1) - devise (2.1.2) + devise (2.2.8) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) railties (~> 3.1) warden (~> 1.2.1) - diff-lcs (1.1.3) + devise-i18n (0.11.3) + diff-lcs (1.2.5) erubis (2.7.0) - execjs (1.4.0) - multi_json (~> 1.0) + execjs (2.2.2) + factory_girl (4.5.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.5.0) + factory_girl (~> 4.5.0) + railties (>= 3.0.0) fastercsv (1.5.5) - ffi (1.9.3) - formtastic (2.2.1) - actionpack (>= 3.0) - gherkin (2.11.5) - json (>= 1.4.6) - haml (4.0.4) + ffi (1.9.6) + haml (4.0.6) tilt - has_accounts (1.1.1) + has_accounts (1.1.3) acts-as-taggable-on has_vcards inherited_resources rails (~> 3.1) validates_timeliness - has_accounts_engine (1.1.0) + has_accounts_engine (1.1.2) acts-as-taggable-on has_accounts (>= 1.0.2) has_vcards @@ -126,35 +146,36 @@ GEM inherited_resources rails (~> 3.0) simple_form - hashery (2.0.1) - highline (1.6.15) + hashery (2.1.1) + highline (1.6.21) hike (1.2.3) - i18n (0.6.11) - i18n_rails_helpers (1.3.0) + i18n (0.7.0) + i18n_rails_helpers (1.4.12) in_place_editing (1.2.0) inherited_resources (1.4.0) has_scope (~> 0.5.0) responders (~> 0.9) - inherited_resources_views (0.4.1) - inherited_resources (>= 1.0) + innertube (1.0.2) journey (1.0.4) - jquery-rails (2.1.3) - railties (>= 3.1.0, < 5.0) - thor (~> 0.14) + jquery-rails (3.1.2) + railties (>= 3.0, < 5.0) + thor (>= 0.14, < 2.0) json (1.8.1) - kaminari (0.14.1) + kaminari (0.16.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - kgio (2.7.4) + kgio (2.9.2) + launchy (2.4.3) + addressable (~> 2.3) ledermann-rails-settings (1.2.0) activerecord (>= 2.3) - less (2.2.2) - commonjs (~> 0.2.6) - less-rails (2.2.6) + less (2.6.0) + commonjs (~> 0.2.7) + less-rails (2.6.0) actionpack (>= 3.1) - less (~> 2.2.0) - libv8 (3.3.10.4) - lyb_devise_admin (0.3.5) + less (~> 2.6.0) + libv8 (3.16.14.7) + lyb_devise_admin (0.3.6) lyb_sidebar (0.1.1) rails (~> 3.1) mail (2.5.4) @@ -162,37 +183,47 @@ GEM treetop (~> 1.4.8) method_source (0.8.2) mime-types (1.25.1) + mini_portile (0.6.2) multi_json (1.10.1) - mysql2 (0.3.11) - net-scp (1.1.0) + mysql2 (0.3.17) + net-scp (1.2.1) net-ssh (>= 2.6.5) - net-sftp (2.1.1) + net-sftp (2.1.2) net-ssh (>= 2.6.5) - net-ssh (2.6.5) + net-ssh (2.9.1) net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) - nokogiri (1.5.6) - orm_adapter (0.4.0) - pdf-reader (1.2.0) + nokogiri (1.6.5) + mini_portile (~> 0.6.0) + orm_adapter (0.5.0) + pdf-reader (1.3.3) Ascii85 (~> 1.0.0) + afm (~> 0.2.0) hashery (~> 2.0) ruby-rc4 + ttfunk + poltergeist (1.5.1) + capybara (~> 2.1) + cliver (~> 0.3.1) + multi_json (~> 1.0) + websocket-driver (>= 0.2.0) polyglot (0.3.5) - prawnto (0.1.1) - prawn - rails (>= 2.1) - pry (0.9.12.6) - coderay (~> 1.0) - method_source (~> 0.8) + prawn (1.0.0.rc2) + afm + pdf-reader (>= 0.9.0, < 2.0) + ruby-rc4 + ttfunk (~> 1.0.3) + pry (0.10.1) + coderay (~> 1.1.0) + method_source (~> 0.8.1) slop (~> 3.4) - pry-debugger (0.2.2) - debugger (~> 1.3) - pry (~> 0.9.10) - pry-doc (0.5.1) - pry (>= 0.9) - yard (>= 0.8) + pry-byebug (2.0.0) + byebug (~> 3.4) + pry (~> 0.10) pry-rails (0.3.2) pry (>= 0.9.10) + quiet_assets (1.1.0) + railties (>= 3.1, < 5.0) rack (1.4.5) rack-cache (1.2) rack (>= 0.4) @@ -200,68 +231,105 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.19) - actionmailer (= 3.2.19) - actionpack (= 3.2.19) - activerecord (= 3.2.19) - activeresource (= 3.2.19) - activesupport (= 3.2.19) + rails (3.2.21) + actionmailer (= 3.2.21) + actionpack (= 3.2.21) + activerecord (= 3.2.21) + activeresource (= 3.2.21) + activesupport (= 3.2.21) bundler (~> 1.0) - railties (= 3.2.19) - railties (3.2.19) - actionpack (= 3.2.19) - activesupport (= 3.2.19) + railties (= 3.2.21) + railties (3.2.21) + actionpack (= 3.2.21) + activesupport (= 3.2.21) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - raindrops (0.10.0) - rake (10.3.2) + raindrops (0.13.0) + rake (10.4.2) rdoc (3.12.2) json (~> 1.4) + ref (1.0.5) responders (0.9.3) railties (~> 3.1) - riddle (1.5.3) + riddle (1.5.11) routing-filter (0.3.1) actionpack + rspec (3.1.0) + rspec-core (~> 3.1.0) + rspec-expectations (~> 3.1.0) + rspec-mocks (~> 3.1.0) + rspec-activemodel-mocks (1.0.1) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) + rspec-core (3.1.7) + rspec-support (~> 3.1.0) + rspec-expectations (3.1.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.1.0) + rspec-mocks (3.1.3) + rspec-support (~> 3.1.0) + rspec-rails (3.1.0) + actionpack (>= 3.0) + activesupport (>= 3.0) + railties (>= 3.0) + rspec-core (~> 3.1.0) + rspec-expectations (~> 3.1.0) + rspec-mocks (~> 3.1.0) + rspec-support (~> 3.1.0) + rspec-support (3.1.2) ruby-rc4 (0.1.5) - rubyzip (0.9.9) - sass (3.2.12) - select2-rails (3.2.1) + rubyzip (1.1.6) + sass (3.4.9) + sass-rails (3.2.6) + railties (~> 3.2.0) + sass (>= 3.1.10) + tilt (~> 1.3) + select2-rails (3.5.9.1) thor (~> 0.14) - show_for (0.2.5) - actionpack (~> 3.0) - activemodel (~> 3.0) - simple-navigation (3.9.0) + selenium-webdriver (2.44.0) + childprocess (~> 0.5) + multi_json (~> 1.0) + rubyzip (~> 1.0) + websocket (~> 1.0) + show_for (0.3.0) + actionpack (>= 3.2, < 5) + activemodel (>= 3.2, < 5) + simple-navigation (3.13.0) activesupport (>= 2.3.2) - simple_form (2.1.1) + simple_form (2.1.2) actionpack (~> 3.0) activemodel (~> 3.0) - slop (3.4.7) - sprockets (2.2.2) + slop (3.6.0) + sprockets (2.2.3) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.6) - swissmatch (0.0.3) - swissmatch-directories - swissmatch-location - swissmatch-rails - swissmatch-street + sqlite3 (1.3.10) + swissmatch (0.1.1) + swissmatch-directories (>= 0.0.1) + swissmatch-location (>= 0.1.1) + swissmatch-rails (>= 0.0.3) + swissmatch-street (>= 0.0.1) swissmatch-directories (0.0.1) nokogiri (>= 1.5.0) - swissmatch-location (0.0.1.201208) - autocompletion (>= 0.0.2) + swissmatch-location (0.1.2.201409) + autocompletion (>= 0.0.3) rubyzip - swissmatch-rails (0.0.3) + unicode + swissmatch-rails (0.0.4) swissmatch-street (0.0.1) - therubyracer (0.10.2) - libv8 (~> 3.3.10) - thinking-sphinx (2.0.13) + therubyracer (0.12.1) + libv8 (~> 3.16.14.0) + ref + thinking-sphinx (2.1.0) activerecord (>= 3.0.3) builder (>= 2.1.2) - riddle (>= 1.5.3) + innertube (~> 1.0.2) + riddle (>= 1.5.6) thor (0.19.1) tilt (1.4.1) timeliness (0.3.7) @@ -269,80 +337,95 @@ GEM polyglot polyglot (>= 0.3.1) ttfunk (1.0.3) - twitter-bootstrap-rails (2.2.0) + twitter-bootstrap-rails (2.2.8) actionpack (>= 3.1) execjs + rails (>= 3.1) railties (>= 3.1) - tzinfo (0.3.41) - uglifier (1.3.0) + tzinfo (0.3.42) + uglifier (2.6.1) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) + json (>= 1.8.0) + unicode (0.4.4.2) unicode_utils (1.4.0) - unicorn (4.3.1) + unicorn (4.8.3) kgio (~> 2.6) rack raindrops (~> 0.7) use_db (0.2.0) validates_timeliness (3.0.14) timeliness (~> 0.3.6) - vesr (0.13.0) - warden (1.2.1) + vesr (0.13.1) + warden (1.2.3) rack (>= 1.0) - yard (0.8.7.3) + websocket (1.2.1) + websocket-driver (0.5.1) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.1) + xpath (2.0.0) + nokogiri (~> 1.3) PLATFORMS ruby DEPENDENCIES aasm + accept_values_for activerecord-sqlserver-adapter acts-as-taggable-on autocompletion - cancan + better_errors + binding_of_caller + cancan (= 1.6.8) capones_recipes + capybara + capybara-screenshot carrierwave coffee-rails + connection_pool csv-mapper - cucumber cupsffi - devise + database_cleaner + devise (~> 2.2) + devise-i18n + factory_girl_rails fastercsv - ffi - formtastic haml - has_accounts - has_accounts_engine + has_accounts (~> 1.1) + has_accounts_engine (~> 1.1) has_scope - has_vcards + has_vcards (~> 0.20) i18n_rails_helpers in_place_editing inherited_resources - inherited_resources_views jquery-rails kaminari - ledermann-rails-settings + ledermann-rails-settings (= 1.2.0) less-rails lyb_devise_admin lyb_sidebar mysql2 - nokogiri - prawn! - prawnto - pry-debugger - pry-doc + poltergeist + prawn (= 1.0.0.rc2) + pry-byebug pry-rails - rails + quiet_assets + rails (~> 3.2) rdoc routing-filter - sass + rspec-activemodel-mocks + rspec-rails + sass-rails select2-rails + selenium-webdriver show_for simple-navigation simple_form sqlite3 swissmatch + swissmatch-location therubyracer - thinking-sphinx + thinking-sphinx (~> 2.0) twitter-bootstrap-rails uglifier unicode_utils diff --git a/INSTALL.textile b/INSTALL.textile index be91cb46..1dfc7583 100644 --- a/INSTALL.textile +++ b/INSTALL.textile @@ -2,7 +2,7 @@ We currently support installing on Debian 5.0 Lenny and Ubuntu 12.04 systems. h2. Install Ruby'n'Rails -CyDoc is developed and tested using Rails 3.2 and Ruby 1.9. +CyDoc is developed and tested using Rails 3.2 and Ruby 2.1. Install packages to needed: @@ -42,7 +42,7 @@ h2. Install CyDoc Install current CyDoc from git repostory. We'll use this checkout as working directory from now on:
-sudo git clone http://github.com/huerlisi/CyDoc.git +git clone http://github.com/huerlisi/CyDoc.git cd CyDocdiff --git a/agpl-3.0.txt b/LICENSE similarity index 100% rename from agpl-3.0.txt rename to LICENSE diff --git a/app/assets/javascripts/covercard.js b/app/assets/javascripts/covercard.js index 193071db..add00437 100644 --- a/app/assets/javascripts/covercard.js +++ b/app/assets/javascripts/covercard.js @@ -1,5 +1,5 @@ jQuery(document).ready(function(){ - jQuery('.reset-updated-attribute').live('click', function(){ + jQuery(document).on('click', '.reset-updated-attribute', function(){ var link = jQuery(this) var value = link.attr('data-value'); var input = link.prev(); diff --git a/app/assets/javascripts/nested_form.js b/app/assets/javascripts/nested_form.js index 47cdf915..b6d4bacc 100644 --- a/app/assets/javascripts/nested_form.js +++ b/app/assets/javascripts/nested_form.js @@ -1,5 +1,5 @@ function addNestedFormBehaviour() { - $(".delete-nested-form-item").live("click", function(event) { + $('body').on('click', '.delete-nested-form-item', function(event) { var item = $(this).parents('.nested-form-item'); // Hide item item.hide(); diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 51bdd47f..c9ac0672 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -8,14 +8,14 @@ // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) // Note: If you use asset_path() here, your compiled bootstrap_and_overrides.css will not // have the proper paths. So for now we use the absolute path. -@fontAwesomeEotPath: asset-path("fontawesome-webfont.eot"); -@fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot#iefix"); -@fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff"); -@fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf"); -@fontAwesomeSvgPath: asset-path("fontawesome-webfont.svg"); +// @fontAwesomeEotPath: asset-path("fontawesome-webfont.eot"); +// @fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot#iefix"); +// @fontAwesomeWoffPath: asset-path("fontawesome-webfont.woff"); +// @fontAwesomeTtfPath: asset-path("fontawesome-webfont.ttf"); +// @fontAwesomeSvgPath: asset-path("fontawesome-webfont.svg"); // Font Awesome -@import "fontawesome"; +// @import "fontawesome"; // Glyphicons //@import "twitter/bootstrap/sprites.less"; diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5457147b..f19d97d0 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -70,75 +70,6 @@ def regexp_for_sqlite end end -module ActionView - module Helpers - module FormHelper - def date_field(object_name, method, options = {}) - instance_tag = InstanceTag.new(object_name, method, self, options.delete(:object)) - - # Let InstanceTag do the object/attribute lookup for us - value = instance_tag.value(instance_tag.object) - - # value is empty when re-showing field after error, use params - options["value"] = value.to_s(:text_field) if value.is_a?(Date) - options["value"] ||= params[object_name][method] if params[object_name] - - instance_tag.to_input_field_tag("text", options) - end - - def time_field(object_name, method, options = {}) - instance_tag = InstanceTag.new(object_name, method, self, options.delete(:object)) - - # Let InstanceTag do the object/attribute lookup for us - value = instance_tag.value(instance_tag.object) - - # value is empty when re-showing field after error, use params - options["value"] = value.to_s(:text_field) if (value.is_a?(Time) or value.is_a?(DateTime)) - options["value"] ||= params[object_name][method] if params[object_name] - - instance_tag.to_input_field_tag("text", options) - end - end - - class FormBuilder - def date_field(method, options = {}) - @template.date_field(@object_name, method, objectify_options(options)) - end - - def time_field(method, options = {}) - @template.time_field(@object_name, method, objectify_options(options)) - end - end - end -end - -# Monkay patch formtastic -class Formtastic::SemanticFormBuilder - # Outputs a label and standard Rails text field inside the wrapper. - def date_field_input(method, options) - basic_input_helper(:date_field, :string, method, options) - end - - def time_field_input(method, options) - basic_input_helper(:time_field, :string, method, options) - end - - # Add :validates_date to requiring validations - def method_required?(attribute) - if @object && @object.class.respond_to?(:reflect_on_validations_for) - attribute_sym = attribute.to_s.sub(/_id$/, '').to_sym - - @object.class.reflect_on_validations_for(attribute_sym).any? do |validation| - [:validates_presence_of, :validates_date, :validates_time].include?(validation.macro) && - validation.name == attribute_sym && !(validation.options.present? && (validation.options[:allow_nil] || validation.options[:allow_blank])) && - (validation.options.present? ? options_require_validation?(validation.options) : true) - end - else - false - end - end -end - # Monkey patching Date class class Date # Date helpers diff --git a/app/controllers/appointments_controller.rb b/app/controllers/appointments_controller.rb deleted file mode 100644 index d74bee71..00000000 --- a/app/controllers/appointments_controller.rb +++ /dev/null @@ -1,139 +0,0 @@ -# -*- encoding : utf-8 -*- -class AppointmentsController < AuthorizedController - # Filter - has_scope :by_period, :using => [:from, :to] - - # GET /appointments - def index - @appointments = apply_scopes(Appointment).active.order(:date).page params['page'] - @recalls = apply_scopes(Recall).active.order(:due_date).page params['page'] - end - - # GET /patients/1/appointments/new - def new - @patient = Patient.find(params[:patient_id]) - @appointment = @patient.appointments.build - - respond_to do |format| - format.html { } - format.js { - render :update do |page| - page.replace_html "new_appointment", :partial => 'form' - end - } - end - end - - # PUT /patients/1/appointment - def create - @patient = Patient.find(params[:patient_id]) - @appointment = @patient.appointments.build(params[:appointment]) - - if @appointment.save - respond_to do |format| - format.html { } - format.js { - render :update do |page| - page.replace_html 'appointments', :partial => 'appointments/patient_item', :collection => @patient.appointments.active - page.replace_html 'new_appointment' - end - } - end - else - respond_to do |format| - format.html { } - format.js { - render :update do |page| - page.replace 'appointment_form', :partial => 'appointments/form', :object => @appointment - end - } - end - end - end - - # GET /appointment/1/edit - def edit - @patient = Patient.find(params[:patient_id]) - @appointment = Appointment.find(params[:id]) - - respond_to do |format| - format.html { } - format.js { - render :update do |page| - page.replace_html 'new_appointment', :partial => 'appointments/form' - end - } - end - end - - # PUT /appointment/1 - # PUT /patients/1/appointment/2 - def update - @patient = Patient.find(params[:patient_id]) - @appointment = Appointment.find(params[:id]) - - if @appointment.update_attributes(params[:appointment]) - respond_to do |format| - format.html { } - format.js { - render :update do |page| - page.replace_html 'appointments', :partial => 'appointments/patient_item', :collection => @patient.appointments.active - page.replace_html 'new_appointment' - end - } - end - else - respond_to do |format| - format.html { } - format.js { - render :update do |page| - page.replace_html 'appointment_form', :partial => 'appointments/form' - end - } - end - end - end - - # POST /appointment/1/obey - def obey - @appointment = Appointment.find(params[:id]) - @appointment.obey - @appointment.save - - respond_to do |format| - format.html { } - format.js { - render :update do |page| - page.remove "appointment_#{@appointment.id}" - end - } - end - end - - # DELETE /appointment/1 - def destroy - @appointment = Appointment.find(params[:id]) - @appointment.destroy - - respond_to do |format| - format.html { } - format.js { - render :update do |page| - page.remove "appointment_#{@appointment.id}" - end - } - end - end - - # GET /patients/1/appointments/1 - def show - @appointment = Appointment.find(params[:id]) - @patient = @appointment.patient - - respond_to do |format| - format.pdf { - render :layout => false - } - end - end -end diff --git a/app/controllers/bookkeeping_controller.rb b/app/controllers/bookkeeping_controller.rb index c429f1be..b1e3a29e 100644 --- a/app/controllers/bookkeeping_controller.rb +++ b/app/controllers/bookkeeping_controller.rb @@ -1,7 +1,13 @@ # -*- encoding : utf-8 -*- -class BookkeepingController < ApplicationController +class BookkeepingController < AuthorizedController + skip_load_and_authorize_resource + before_filter :set_value_period + def index + authorize! :read, Account + end + def set_value_period if by_value_period = params[:by_value_period] @value_date_begin = by_value_period[:from] @@ -14,6 +20,8 @@ def set_value_period end def report + authorize! :read, Account + @total_invoiced = Account.find_by_code(current_tenant.settings['invoices.profit_account_code']).saldo(@value_date_range) @total_paid = Account.find_by_code('1000').saldo(@value_date_range) + Account.find_by_code('1020').saldo(@value_date_range) @open_items = Account.find_by_code(current_tenant.settings['invoices.balance_account_code']).saldo(@value_date_end) @@ -24,6 +32,8 @@ def report end def open_invoices + authorize! :read, Account + debit_account_id = Account.find_by_code(current_tenant.settings['invoices.balance_account_code']).id @invoices = Invoice .joins(:bookings) @@ -34,6 +44,8 @@ def open_invoices end def open_invoices_csv + authorize! :read, Account + debit_account_id = Account.find_by_code(current_tenant.settings['invoices.balance_account_code']).id @invoices = Invoice.all( :select => "invoices.*, sum(IF(bookings.debit_account_id = #{debit_account_id}, -bookings.amount, bookings.amount)) AS current_due_amount", diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 4fa53ce9..c69fe7ca 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -1,6 +1,3 @@ # -*- encoding : utf-8 -*- class WelcomeController < ApplicationController - - def index - end end diff --git a/app/models/appointment.rb b/app/models/appointment.rb deleted file mode 100644 index 101c6d91..00000000 --- a/app/models/appointment.rb +++ /dev/null @@ -1,51 +0,0 @@ -# -*- encoding : utf-8 -*- -class Appointment < ActiveRecord::Base - # Associations - belongs_to :patient - has_one :recall - - # Validations - validates_presence_of :patient - validates_date :date - - # State Machine - include AASM - aasm_column :state - - aasm_initial_state :scheduled - - aasm_state :proposed - aasm_state :scheduled - aasm_state :canceled - scope :active, :conditions => {:state => ['proposed', 'scheduled']} - - aasm_event :accept do - transitions :to => :scheduled, :from => :proposed - end - aasm_event :cancel do - transitions :to => :canceled, :from => [:proposed, :scheduled] - end - - # Scopes - scope :by_period, lambda {|from, to| { :conditions => { :date => from..to } } } - - def from - duration_from.try(:to_time) - end - - def from=(value) - self.duration_from = Time.zone.parse(value) - end - - def to - duration_to.try(:to_time) - end - - def to=(value) - self.duration_to = Time.zone.parse(value) - end - - def to_s - "#{date} #{[from, to].compact.join(' - ')}" - end -end diff --git a/app/models/covercard/patient.rb b/app/models/covercard/patient.rb index da2c337b..cdf55b5d 100644 --- a/app/models/covercard/patient.rb +++ b/app/models/covercard/patient.rb @@ -2,7 +2,6 @@ require 'net/http' require 'net/https' require 'uri' -require 'nokogiri' module Covercard class Patient < ActiveRecord::Base diff --git a/app/models/insurance.rb b/app/models/insurance.rb index c62fbf67..f78e43d1 100644 --- a/app/models/insurance.rb +++ b/app/models/insurance.rb @@ -13,6 +13,7 @@ def to_s # Vcard has_vcards + has_one :vcard, :as => :object accepts_nested_attributes_for :vcard attr_accessible :vcard, :vcard_attributes def name diff --git a/app/models/insurance_policy.rb b/app/models/insurance_policy.rb index 5aac39a0..e4107407 100644 --- a/app/models/insurance_policy.rb +++ b/app/models/insurance_policy.rb @@ -5,7 +5,7 @@ class InsurancePolicy < ActiveRecord::Base # Scopes scope :by_policy_type, lambda {|policy_type| - {:conditions => {:policy_type => policy_type}} + where(:policy_type => policy_type) } # Associations @@ -15,10 +15,15 @@ class InsurancePolicy < ActiveRecord::Base # Validations # validates_presence_of :insurance - def to_s - s = "#{policy_type}: #{insurance.to_s}" - s += " ##{number}" unless number.blank? + def to_s(format = :default) + ident = insurance.to_s + ident += " ##{number}" unless number.blank? - return s + case format + when :long + return "#{policy_type}: #{ident}" + else + return ident + end end end diff --git a/app/models/insurances/import.rb b/app/models/insurances/import.rb index 83d4bf0c..9ee813dc 100644 --- a/app/models/insurances/import.rb +++ b/app/models/insurances/import.rb @@ -37,4 +37,5 @@ def import_all end end -Insurance.send :include, Insurances::Import +# TODO: fix as this triggeres stack level too deep +# Insurance.send :include, Insurances::Import diff --git a/app/models/patient.rb b/app/models/patient.rb index 2482df77..e5813659 100644 --- a/app/models/patient.rb +++ b/app/models/patient.rb @@ -45,7 +45,6 @@ def insurance_nr=(value) has_many :sessions has_many :recalls, :order => 'due_date', :dependent => :destroy - has_many :appointments, :order => 'date', :dependent => :destroy # Vcards has_vcards diff --git a/app/models/recall.rb b/app/models/recall.rb index 6c40f645..d9491d62 100644 --- a/app/models/recall.rb +++ b/app/models/recall.rb @@ -16,27 +16,30 @@ class Recall < ActiveRecord::Base # State Machine include AASM - aasm_column :state + aasm do + initial_state = :scheduled - aasm_initial_state :scheduled + state :scheduled + state :canceled + state :prepared + state :sent + state :obeyed - aasm_state :scheduled - aasm_state :canceled - aasm_state :prepared - aasm_state :sent - aasm_state :obeyed + event :cancel do + transitions :to => :canceled, :from => [:scheduled, :sent] + end - aasm_event :cancel do - transitions :to => :canceled, :from => [:scheduled, :sent] - end - aasm_event :prepare do - transitions :to => :prepared, :from => :scheduled - end - aasm_event :send_notice do - transitions :to => :sent, :from => [:prepared, :scheduled], :on_transition => :sending - end - aasm_event :obey do - transitions :to => :obeyed, :from => :sent + event :prepare do + transitions :to => :prepared, :from => :scheduled + end + + event :send_notice do + transitions :to => :sent, :from => [:prepared, :scheduled], :on_transition => :sending + end + + event :obey do + transitions :to => :obeyed, :from => :sent + end end # Scopes diff --git a/app/models/returned_invoice.rb b/app/models/returned_invoice.rb index bf1ff891..790248cb 100644 --- a/app/models/returned_invoice.rb +++ b/app/models/returned_invoice.rb @@ -13,25 +13,25 @@ def to_s # State Machine include AASM - aasm_column :state - validates :state , :presence => true - - aasm_initial_state :ready - aasm_state :ready - aasm_state :request_pending - aasm_state :resolved + aasm do + initial_state = :ready + state :ready + state :request_pending + state :resolved - aasm_event :queue_request do - transitions :from => :ready, :to => :request_pending - end + event :queue_request do + transitions :from => :ready, :to => :request_pending + end - aasm_event :reactivate do - transitions :from => [:ready, :request_pending], :to => :resolved - end + event :reactivate do + transitions :from => [:ready, :request_pending], :to => :resolved + end - aasm_event :write_off do - transitions :from => [:ready, :request_pending], :to => :resolved + event :write_off do + transitions :from => [:ready, :request_pending], :to => :resolved + end end + validates :state , :presence => true scope :by_state, lambda {|value| {:conditions => {:state => value} } } scope :active, :conditions => {:state => ["ready", "request_pending"]} diff --git a/app/models/session.rb b/app/models/session.rb index 506ed067..0587d1a7 100644 --- a/app/models/session.rb +++ b/app/models/session.rb @@ -20,18 +20,19 @@ class Session < ActiveRecord::Base # State Machine include AASM - aasm_column :state + aasm do + initial_state = :active - aasm_initial_state :active + state :active + state :charged - aasm_state :active - aasm_state :charged + event :charge do + transitions :to => :charged, :from => :active + end - aasm_event :charge do - transitions :to => :charged, :from => :active - end - aasm_event :reactivate do - transitions :to => :active, :from => :charged + event :reactivate do + transitions :to => :active, :from => :charged + end end def to_s(format = :default) diff --git a/app/models/tarmed/leistung_digniquali.rb b/app/models/tarmed/leistung_digniquali.rb index bfed46da..1aacb63a 100644 --- a/app/models/tarmed/leistung_digniquali.rb +++ b/app/models/tarmed/leistung_digniquali.rb @@ -1,5 +1,5 @@ # -*- encoding : utf-8 -*- class Tarmed::LeistungDigniquali < Tarmed::Base - set_table_name 'LEISTUNG_DIGNIQUALI' - set_primary_key 'LNR' + self.table_name = 'LEISTUNG_DIGNIQUALI' + self.primary_key = 'LNR' end diff --git a/app/models/tarmed/leistung_hierarchie.rb b/app/models/tarmed/leistung_hierarchie.rb index 1bbd29b9..8aa47765 100644 --- a/app/models/tarmed/leistung_hierarchie.rb +++ b/app/models/tarmed/leistung_hierarchie.rb @@ -1,6 +1,6 @@ # -*- encoding : utf-8 -*- class Tarmed::LeistungHierarchie < Tarmed::Base - set_table_name "LEISTUNG_HIERARCHIE" + self.table_name = "LEISTUNG_HIERARCHIE" belongs_to :master, :class_name => 'Leistung', :foreign_key => 'LNR_MASTER' belongs_to :slave, :class_name => 'Leistung', :foreign_key => 'LNR_SLAVE' diff --git a/app/models/tarmed/leistung_text.rb b/app/models/tarmed/leistung_text.rb index 136bd90e..2e9a79dd 100644 --- a/app/models/tarmed/leistung_text.rb +++ b/app/models/tarmed/leistung_text.rb @@ -1,8 +1,8 @@ # -*- encoding : utf-8 -*- class Tarmed::LeistungText < Tarmed::Base - set_table_name 'LEISTUNG_TEXT' - set_primary_key "LNR" - + self.table_name = 'LEISTUNG_TEXT' + self.primary_key = "LNR" + belongs_to :leistung, :class_name => 'Tarmed::Leistung', :foreign_key => 'LNR' has_one :digniquali, :class_name => 'LeistungDigniquali', :foreign_key => 'LNR' end diff --git a/app/prawn/insurance_recipe.rb b/app/prawn/insurance_recipe.rb index 0910c92b..9d2415ed 100644 --- a/app/prawn/insurance_recipe.rb +++ b/app/prawn/insurance_recipe.rb @@ -201,13 +201,13 @@ def tarmed_footer(invoice) [ "▪ " + I18n::translate(:pfl, :scope => "activerecord.attributes.invoice"), I18n::translate(:tarmed_al, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value_mt("001")), + invoice.amount_mt("001").currency_round, tax_points_mt(invoice, "001"), I18n::translate(:physio, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value("311")), + invoice.amount("311").currency_round, tax_points(invoice, "311"), I18n::translate(:mi_gel, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value("452")), + invoice.amount("452").currency_round, tax_points(invoice, "452"), I18n::translate(:others, :scope => "activerecord.attributes.invoice"), "0.00", @@ -216,13 +216,13 @@ def tarmed_footer(invoice) [ '', I18n::translate(:tarmed_tl, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value_tt("001")), + invoice.amount_tt("001").currency_round, tax_points_tt(invoice, "001"), I18n::translate(:laboratory, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value(["316", "317"])), + invoice.amount(["316", "317"]).currency_round, tax_points(invoice, ["316", "317"]), I18n::translate(:medi, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.value("400")), + invoice.amount("400").currency_round, tax_points(invoice, "400"), I18n::translate(:cantonal, :scope => "activerecord.attributes.invoice"), "0.00", @@ -230,16 +230,16 @@ def tarmed_footer(invoice) ], [ {:content => "▪ " + I18n::translate(:total_amount, :scope => "activerecord.attributes.invoice"), :colspan => 2}, - currency_fmt(invoice.amount.currency_round), + invoice.amount.currency_round, '', I18n::translate(:amount_pfl, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.obligation_amount.currency_round), + invoice.obligation_amount.currency_round, '', I18n::translate(:prepayment, :scope => "activerecord.attributes.invoice"), "0.00", '', I18n::translate(:amount_due, :scope => "activerecord.attributes.invoice"), - currency_fmt(invoice.amount.currency_round), + invoice.amount.currency_round, '' ] ] @@ -312,7 +312,7 @@ def sub_total(records) temp_cursor = cursor text_box "Zwischentotal", :style => :bold, :at => [0, temp_cursor] text_box "CHF", :at => [RECORD_INDENT, temp_cursor], :style => :bold - text_box "#{currency_fmt(records.sum(&:amount).currency_round)}", :width => 5.cm, + text_box "#{records.sum(&:amount).currency_round}", :width => 5.cm, :at => [bounds.width - 5.cm, temp_cursor], :align => :right, :style => :bold @@ -345,7 +345,7 @@ def service_entry(record) 1, 0, 0, - currency_fmt(record.amount) + record.amount ] table [data], :cell_style => {:overflow => :shrink_to_fit} do @@ -453,7 +453,7 @@ def summary(invoice) [ "0", "0.00", - currency_fmt(invoice.amount.currency_round), + invoice.amount.currency_round, "0.00" ] ] @@ -462,7 +462,7 @@ def summary(invoice) [ I18n::translate(:total, :scope => "activerecord.attributes.invoice"), '', - currency_fmt(invoice.amount.currency_round), + invoice.amount.currency_round, "0.00" ] ] diff --git a/app/views/appointments/_form.html.haml b/app/views/appointments/_form.html.haml deleted file mode 100644 index 2afdc20c..00000000 --- a/app/views/appointments/_form.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -= javascript_tag "$('appointment_date').focus()" -#appointment_form - = semantic_form_for [@patient, @appointment], :remote => true do |form| - = form.semantic_errors - = form.inputs do - = form.input :date, :as => :date_field, :input_html => {:size => 12, :autocomplete => 'off'} - = form.input :from, :as => :time_field, :input_html => {:size => 12, :autocomplete => 'off'} - = form.input :to, :as => :time_field, :input_html => {:size => 12, :autocomplete => 'off'} - = form.input :remarks, :input_html => {:rows => 3} - = form.buttons do - = form.submit "Speichern", :class => "icon icon-save" - = button_to_function "Abbrechen", "Element.update('new_appointment')", :class => "icon icon-cancel" diff --git a/app/views/appointments/_item.html.haml b/app/views/appointments/_item.html.haml deleted file mode 100644 index 4c03de23..00000000 --- a/app/views/appointments/_item.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -%tr{:id => "appointment_#{item.id}"} - %td= item.date - %td= [item.from, item.to].compact.join(' - ') - %td= link_to item.patient, item.patient - %td= item.remarks - %td - - for state in item.aasm_events_for_current_state - = case state | - when :accept | - link_to image_tag('true.png'), :url => accept_patient_appointment_path(item.patient, item), :title => "Termin akzeptiert", :remote => true | - when :cancel | - link_to image_tag('delete.png'), :url => patient_appointment_path(item.patient, item), :title => "Termin löschen", :method => :delete, :remote => true | - end | diff --git a/app/views/appointments/_list.html.haml b/app/views/appointments/_list.html.haml deleted file mode 100644 index 26c2589a..00000000 --- a/app/views/appointments/_list.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%table#appointments.table - = render :partial => 'appointments/list_header' - = render :partial => 'appointments/item', :collection => @appointments - = render :partial => 'appointments/list_footer' diff --git a/app/views/appointments/_list_footer.html.haml b/app/views/appointments/_list_footer.html.haml deleted file mode 100644 index 3130abea..00000000 --- a/app/views/appointments/_list_footer.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%tr - %th{:colspan => "5", :style => "text-align: right"}= paginate diff --git a/app/views/appointments/_list_header.html.haml b/app/views/appointments/_list_header.html.haml deleted file mode 100644 index c8d9dc98..00000000 --- a/app/views/appointments/_list_header.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%tr - %th Datum - %th Zeit - %th Patient - %th Bemerkungen - %th diff --git a/app/views/appointments/_patient_item.html.haml b/app/views/appointments/_patient_item.html.haml deleted file mode 100644 index 61244045..00000000 --- a/app/views/appointments/_patient_item.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%tr{:id => "appointment_#{patient_item.id}"} - %th= patient_item.date - %td= [patient_item.from, patient_item.to].compact.join(' - ') - %td= patient_item.remarks - %td - = link_to image_tag('edit.png'), {:url => edit_patient_appointment_path(@patient, patient_item), :method => :get}, :remote => true - - for state in patient_item.aasm_events_for_current_state - = case state | - # when :obey: link_to image_tag('true.png'), :url => obey_patient_appointment_path(patient_item.patient, patient_item), :title => "Erledigt", :remote => true | - when :cancel | - link_to image_tag('delete.png'), :url => patient_appointment_path(patient_item.patient, patient_item), :method => :delete, :remote => true | - end | diff --git a/app/views/appointments/_patient_list.html.haml b/app/views/appointments/_patient_list.html.haml deleted file mode 100644 index e88a978f..00000000 --- a/app/views/appointments/_patient_list.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -.contextual - = link_to "Termin erfassen", {:url => new_patient_appointment_url(@patient), :method => :get}, :class => "icon icon-add" unless @patient.new_record?, :remote => true -%h3 Termine -.box - #new_appointment.new_appointment - %table#appointments - = render :partial => 'appointments/patient_item', :collection => @patient.appointments.open diff --git a/app/views/appointments/_sidebar.html.haml b/app/views/appointments/_sidebar.html.haml deleted file mode 100644 index bb0f05f1..00000000 --- a/app/views/appointments/_sidebar.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -- content_for :sidebar do - .sub-tabs - %h3 Filter - %ul - %li= link_to "Alle", url_for(:overwrite_params => {:by_period => nil}) - - for in_month in 0..6 - - month = Date.today.in(in_month.month) - %li= link_to l(month, :format => :month), url_for(:params => params.merge({:by_period => {:from => month.beginning_of_month.to_s(:db), :to => month.end_of_month.to_s(:db)}})) diff --git a/app/views/appointments/index.html.haml b/app/views/appointments/index.html.haml deleted file mode 100644 index 396c877a..00000000 --- a/app/views/appointments/index.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -= tab_container 'appointments', "Termine", [ | - {:name => 'appointments', :partial => 'list', :label => 'Termine'}, | - {:name => 'recalls', :partial => 'recalls/list', :label => 'Recalls'}, | - ] | diff --git a/app/views/invoices/show.html.haml b/app/views/invoices/show.html.haml index 9dbcfe0f..efad1271 100644 --- a/app/views/invoices/show.html.haml +++ b/app/views/invoices/show.html.haml @@ -1,6 +1,6 @@ .contextual = icon_link_to t_title(:show, Patient), resource.patient, :icon => :show - = contextual_link_to :print, nil, :method => :post, :remote => true + = contextual_link_to :print, nil, { :method => :post, :remote => true } = render 'show' diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb deleted file mode 100644 index 4772d864..00000000 --- a/config/initializers/formtastic.rb +++ /dev/null @@ -1,56 +0,0 @@ -# -*- encoding : utf-8 -*- - -# Set the default text field size when input is a string. Default is 50. -# Formtastic::SemanticFormBuilder.default_text_field_size = 50 - -# Set the default text area height when input is a text. Default is 20. -# Formtastic::SemanticFormBuilder.default_text_area_height = 5 - -# Should all fields be considered "required" by default? -# Defaults to true, see ValidationReflection notes below. -Formtastic::FormBuilder.all_fields_required_by_default = false - -# Should select fields have a blank option/prompt by default? -# Defaults to true. -# Formtastic::SemanticFormBuilder.include_blank_for_select_by_default = true - -# Set the string that will be appended to the labels/fieldsets which are required -# It accepts string or procs and the default is a localized version of -# '*'. In other words, if you configure formtastic.required -# in your locale, it will replace the abbr title properly. But if you don't want to use -# abbr tag, you can simply give a string as below -# Formtastic::SemanticFormBuilder.required_string = "(required)" - -# Set the string that will be appended to the labels/fieldsets which are optional -# Defaults to an empty string ("") and also accepts procs (see required_string above) -# Formtastic::SemanticFormBuilder.optional_string = "(optional)" - -# Set the way inline errors will be displayed. -# Defaults to :sentence, valid options are :sentence, :list and :none -# Formtastic::SemanticFormBuilder.inline_errors = :sentence - -# Set the method to call on label text to transform or format it for human-friendly -# reading when formtastic is user without object. Defaults to :humanize. -# Formtastic::SemanticFormBuilder.label_str_method = :humanize - -# Set the array of methods to try calling on parent objects in :select and :radio inputs -# for the text inside each @