voluntary 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +48 -0
- data/Rakefile +27 -0
- data/app/assets/javascripts/voluntary/application.js +6 -0
- data/app/assets/javascripts/voluntary/base.js.coffee +34 -0
- data/app/assets/javascripts/voluntary/bootstrap.js.coffee +4 -0
- data/app/assets/javascripts/voluntary/functions.js +24 -0
- data/app/assets/javascripts/voluntary/users.js.coffee +12 -0
- data/app/assets/stylesheets/voluntary/application.css +15 -0
- data/app/assets/stylesheets/voluntary/base.css.scss +40 -0
- data/app/assets/stylesheets/voluntary/bootstrap_and_overrides.css.less +67 -0
- data/app/controllers/areas_controller.rb +66 -0
- data/app/controllers/candidatures_controller.rb +79 -0
- data/app/controllers/comments_controller.rb +70 -0
- data/app/controllers/devise_extensions/registrations_controller.rb +37 -0
- data/app/controllers/home_controller.rb +7 -0
- data/app/controllers/organizations_controller.rb +67 -0
- data/app/controllers/pages_controller.rb +54 -0
- data/app/controllers/products_controller.rb +62 -0
- data/app/controllers/professions_controller.rb +66 -0
- data/app/controllers/projects_controller.rb +56 -0
- data/app/controllers/results_controller.rb +93 -0
- data/app/controllers/stories_controller.rb +96 -0
- data/app/controllers/tasks_controller.rb +88 -0
- data/app/controllers/users_controller.rb +52 -0
- data/app/controllers/vacancies_controller.rb +79 -0
- data/app/controllers/voluntary/application_controller.rb +92 -0
- data/app/controllers/workflow/candidatures_controller.rb +20 -0
- data/app/controllers/workflow/products_controller.rb +6 -0
- data/app/controllers/workflow/project_owner_controller.rb +33 -0
- data/app/controllers/workflow/stories_controller.rb +6 -0
- data/app/controllers/workflow/tasks_controller.rb +147 -0
- data/app/controllers/workflow/user_controller.rb +6 -0
- data/app/controllers/workflow/vacancies_controller.rb +17 -0
- data/app/controllers/workflow_controller.rb +7 -0
- data/app/helpers/application_helper.rb +65 -0
- data/app/helpers/collection_helper.rb +31 -0
- data/app/helpers/comments_helper.rb +11 -0
- data/app/helpers/form_helper.rb +39 -0
- data/app/helpers/language_helper.rb +15 -0
- data/app/helpers/layout_helper.rb +24 -0
- data/app/helpers/product_helper.rb +32 -0
- data/app/helpers/show_helper.rb +65 -0
- data/app/helpers/wizard_helper.rb +27 -0
- data/app/models/area.rb +19 -0
- data/app/models/area_user.rb +19 -0
- data/app/models/candidature.rb +35 -0
- data/app/models/comment.rb +16 -0
- data/app/models/history_tracker.rb +3 -0
- data/app/models/mongo_db_document.rb +11 -0
- data/app/models/organization.rb +19 -0
- data/app/models/page.rb +30 -0
- data/app/models/product.rb +99 -0
- data/app/models/product/new_product.rb +3 -0
- data/app/models/product/project_management.rb +29 -0
- data/app/models/profession.rb +13 -0
- data/app/models/project.rb +66 -0
- data/app/models/project_user.rb +13 -0
- data/app/models/result.rb +55 -0
- data/app/models/role.rb +8 -0
- data/app/models/role/admin.rb +2 -0
- data/app/models/role/master.rb +2 -0
- data/app/models/role/project_owner.rb +2 -0
- data/app/models/role/user.rb +2 -0
- data/app/models/state_machines/candidature.rb +42 -0
- data/app/models/state_machines/page.rb +18 -0
- data/app/models/state_machines/story.rb +51 -0
- data/app/models/state_machines/task.rb +46 -0
- data/app/models/state_machines/vacancy.rb +41 -0
- data/app/models/story.rb +82 -0
- data/app/models/task.rb +85 -0
- data/app/models/user.rb +95 -0
- data/app/models/user_role.rb +6 -0
- data/app/models/vacancy.rb +41 -0
- data/app/observers/candidature_observer.rb +29 -0
- data/app/observers/story_observer.rb +6 -0
- data/app/observers/task_observer.rb +34 -0
- data/app/presenters/layout/application_presenter.rb +3 -0
- data/app/presenters/layout_presenter.rb +9 -0
- data/app/presenters/presenter.rb +46 -0
- data/app/presenters/resource_presenter.rb +30 -0
- data/app/presenters/resources/general/wizard_presenter.rb +17 -0
- data/app/presenters/resources/general/wizards/story/steps/activate_presenter.rb +3 -0
- data/app/presenters/resources/general/wizards/story/steps/setup_tasks_presenter.rb +5 -0
- data/app/presenters/resources/general/wizards/story_presenter.rb +3 -0
- data/app/presenters/resources/user/form_presenter.rb +16 -0
- data/app/presenters/shared/collection/table_presenter.rb +33 -0
- data/app/views/areas/_form.html.erb +11 -0
- data/app/views/areas/edit.html.erb +3 -0
- data/app/views/areas/index.html.erb +5 -0
- data/app/views/areas/new.html.erb +3 -0
- data/app/views/areas/show.html.erb +6 -0
- data/app/views/candidatures/_form.html.erb +13 -0
- data/app/views/candidatures/edit.html.erb +3 -0
- data/app/views/candidatures/index.html.erb +11 -0
- data/app/views/candidatures/new.html.erb +3 -0
- data/app/views/candidatures/show.html.erb +18 -0
- data/app/views/comments/_form.html.erb +16 -0
- data/app/views/comments/_resource.html.erb +16 -0
- data/app/views/comments/edit.html.erb +3 -0
- data/app/views/comments/new.html.erb +3 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +10 -0
- data/app/views/devise/registrations/new.html.erb +5 -0
- data/app/views/general/wizard.html.erb +16 -0
- data/app/views/kaminari/_first_page.html.erb +13 -0
- data/app/views/kaminari/_gap.html.erb +8 -0
- data/app/views/kaminari/_last_page.html.erb +13 -0
- data/app/views/kaminari/_next_page.html.erb +13 -0
- data/app/views/kaminari/_page.html.erb +12 -0
- data/app/views/kaminari/_paginator.html.erb +25 -0
- data/app/views/kaminari/_prev_page.html.erb +13 -0
- data/app/views/layouts/application.html.erb +48 -0
- data/app/views/layouts/shared/_flash_messages.html.erb +7 -0
- data/app/views/layouts/shared/_navigation.html.erb +7 -0
- data/app/views/organizations/_form.html.erb +11 -0
- data/app/views/organizations/edit.html.erb +3 -0
- data/app/views/organizations/index.html.erb +5 -0
- data/app/views/organizations/new.html.erb +3 -0
- data/app/views/organizations/show.html.erb +6 -0
- data/app/views/pages/_form.html.erb +12 -0
- data/app/views/pages/edit.html.erb +3 -0
- data/app/views/pages/index.html.erb +5 -0
- data/app/views/pages/new.html.erb +3 -0
- data/app/views/pages/show.html.erb +10 -0
- data/app/views/products/_form.html.erb +28 -0
- data/app/views/products/edit.html.erb +3 -0
- data/app/views/products/index.html.erb +5 -0
- data/app/views/products/mixins/_keywords.html.erb +4 -0
- data/app/views/products/new.html.erb +3 -0
- data/app/views/products/show.html.erb +11 -0
- data/app/views/products/types/text_creation/stories/_form.html.erb +19 -0
- data/app/views/products/types/text_creation/stories/_task_fields.html.erb +7 -0
- data/app/views/projects/_form.html.erb +16 -0
- data/app/views/projects/edit.html.erb +3 -0
- data/app/views/projects/index.html.erb +5 -0
- data/app/views/projects/new.html.erb +3 -0
- data/app/views/projects/show.html.erb +13 -0
- data/app/views/shared/_comments.html.erb +7 -0
- data/app/views/shared/collection/_list.html.erb +37 -0
- data/app/views/shared/collection/_table.html.erb +36 -0
- data/app/views/shared/form/_error_messages.html.erb +10 -0
- data/app/views/shared/resource/_actions.html.erb +26 -0
- data/app/views/shared/resource/_event_elements.html.erb +7 -0
- data/app/views/stories/_collection.html.erb +8 -0
- data/app/views/stories/_form.html.erb +19 -0
- data/app/views/stories/_task_fields.html.erb +11 -0
- data/app/views/stories/index.html.erb +1 -0
- data/app/views/stories/show.html.erb +13 -0
- data/app/views/stories/steps/_activate.html.erb +17 -0
- data/app/views/stories/steps/_setup_tasks.html.erb +35 -0
- data/app/views/stories/tasks.html.erb +0 -0
- data/app/views/tasks/_collection.html.erb +12 -0
- data/app/views/users/_form.html.erb +43 -0
- data/app/views/users/edit.html.erb +3 -0
- data/app/views/users/index.html.erb +6 -0
- data/app/views/users/new.html.erb +3 -0
- data/app/views/users/preferences.html.erb +11 -0
- data/app/views/users/show.html.erb +6 -0
- data/app/views/vacancies/_form.html.erb +15 -0
- data/app/views/vacancies/edit.html.erb +3 -0
- data/app/views/vacancies/index.html.erb +7 -0
- data/app/views/vacancies/new.html.erb +3 -0
- data/app/views/vacancies/show.html.erb +17 -0
- data/app/views/workflow/index.html.erb +0 -0
- data/app/views/workflow/products/show.html.erb +34 -0
- data/app/views/workflow/project_owner/_candidatures.html.erb +31 -0
- data/app/views/workflow/project_owner/_stories.html.erb +29 -0
- data/app/views/workflow/project_owner/_tasks.html.erb +34 -0
- data/app/views/workflow/project_owner/_vacancies.html.erb +27 -0
- data/app/views/workflow/project_owner/index.html.erb +24 -0
- data/app/views/workflow/tasks/_work_form.html.erb +8 -0
- data/app/views/workflow/tasks/_work_head.html.erb +15 -0
- data/app/views/workflow/tasks/edit.html.erb +3 -0
- data/app/views/workflow/tasks/index.html.erb +31 -0
- data/app/views/workflow/tasks/next.html.erb +0 -0
- data/app/views/workflow/tasks/steps/_complete.html.erb +11 -0
- data/app/views/workflow/tasks/steps/_review.html.erb +13 -0
- data/app/views/workflow/tasks/steps/_work.html.erb +17 -0
- data/app/views/workflow/user/_tasks.html.erb +30 -0
- data/app/views/workflow/user/index.html.erb +14 -0
- data/config/initializers/1_initialize_app_config.rb +5 -0
- data/config/initializers/devise.rb +193 -0
- data/config/initializers/locale_settings.rb +42 -0
- data/config/initializers/mongoid-history.rb +2 -0
- data/config/initializers/recaptcha.rb +7 -0
- data/config/initializers/simple_form.rb +178 -0
- data/config/initializers/simple_navigation.rb +2 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/locales/en.yml +26 -0
- data/config/locales/general/en.yml +71 -0
- data/config/locales/resources/area/en.yml +12 -0
- data/config/locales/resources/candidature/en.yml +19 -0
- data/config/locales/resources/comment/en.yml +11 -0
- data/config/locales/resources/organization/en.yml +11 -0
- data/config/locales/resources/page/en.yml +11 -0
- data/config/locales/resources/product/en.yml +23 -0
- data/config/locales/resources/project/en.yml +9 -0
- data/config/locales/resources/result/en.yml +9 -0
- data/config/locales/resources/story/en.yml +34 -0
- data/config/locales/resources/task/en.yml +36 -0
- data/config/locales/resources/user/en.yml +14 -0
- data/config/locales/resources/vacancy/en.yml +29 -0
- data/config/locales/simple_form.en.yml +26 -0
- data/config/locales/workflow/en.yml +37 -0
- data/config/routes.rb +188 -0
- data/db/migrate/20120907144853_create_schema.rb +217 -0
- data/db/migrate/20120911093743_remove_timestamps_from_habtm_tables.rb +21 -0
- data/db/migrate/20120919161831_add_unique_index_for_one_user_candidature_per_vacancy.rb +9 -0
- data/db/migrate/20120922201955_create_mongo_db_documents.rb +13 -0
- data/db/migrate/20120923140109_add_product_to_project.rb +6 -0
- data/db/migrate/20121004061413_add_extra_user_attributes.rb +9 -0
- data/db/migrate/20121004132105_create_professions.rb +13 -0
- data/db/migrate/20121006162913_add_public_attribute_to_roles.rb +6 -0
- data/db/migrate/20121006170407_add_type_attribute_to_roles.rb +5 -0
- data/db/migrate/20121007071543_add_foreign_languages_to_user.rb +6 -0
- data/db/migrate/20121028073712_create_organizations.rb +13 -0
- data/db/seeds.rb +14 -0
- data/lib/applicat/mvc/controller.rb +171 -0
- data/lib/applicat/mvc/controller/error_handling.rb +40 -0
- data/lib/applicat/mvc/controller/resource.rb +19 -0
- data/lib/applicat/mvc/controller/transition_actions.rb +43 -0
- data/lib/applicat/mvc/model/resource/base.rb +56 -0
- data/lib/applicat/mvc/model/tokenable.rb +24 -0
- data/lib/applicat/mvc/model/tree.rb +82 -0
- data/lib/db_seed.rb +150 -0
- data/lib/environment_configuration.rb +54 -0
- data/lib/generators/voluntary/install/install_generator.rb +118 -0
- data/lib/generators/voluntary/install/templates/app/controllers/application_controller.rb +3 -0
- data/lib/generators/voluntary/install/templates/app/models/ability.rb +49 -0
- data/lib/generators/voluntary/install/templates/app/models/app_config.rb +32 -0
- data/lib/generators/voluntary/install/templates/app/views/layouts/application.html.erb +50 -0
- data/lib/generators/voluntary/install/templates/config/application.yml +147 -0
- data/lib/generators/voluntary/install/templates/config/cucumber.yml +8 -0
- data/lib/generators/voluntary/install/templates/config/database.example.yml +28 -0
- data/lib/generators/voluntary/install/templates/config/deploy.rb +59 -0
- data/lib/generators/voluntary/install/templates/config/email.example.yml +9 -0
- data/lib/generators/voluntary/install/templates/config/initializers/recaptcha_example +4 -0
- data/lib/generators/voluntary/install/templates/config/locale_settings.yml +121 -0
- data/lib/generators/voluntary/install/templates/config/main_navigation.rb +262 -0
- data/lib/generators/voluntary/install/templates/config/mongoid.yml +78 -0
- data/lib/generators/voluntary/install/templates/config/nginx.conf +27 -0
- data/lib/generators/voluntary/install/templates/config/unicorn.rb +9 -0
- data/lib/generators/voluntary/install/templates/config/unicorn_init.sh +84 -0
- data/lib/generators/voluntary/install/templates/db/seeds.rb +14 -0
- data/lib/generators/voluntary/install/templates/features/step_definitions/email_steps.rb +89 -0
- data/lib/generators/voluntary/install/templates/features/step_definitions/factory_steps.rb +120 -0
- data/lib/generators/voluntary/install/templates/features/step_definitions/javascript_steps.rb +15 -0
- data/lib/generators/voluntary/install/templates/features/step_definitions/navigation_steps.rb +3 -0
- data/lib/generators/voluntary/install/templates/features/step_definitions/resources_steps.rb +8 -0
- data/lib/generators/voluntary/install/templates/features/step_definitions/session_steps.rb +35 -0
- data/lib/generators/voluntary/install/templates/features/step_definitions/web_steps.rb +271 -0
- data/lib/generators/voluntary/install/templates/features/support/database_cleaner_patches.rb +24 -0
- data/lib/generators/voluntary/install/templates/features/support/env.rb +83 -0
- data/lib/generators/voluntary/install/templates/features/support/integration_sessions_controller.rb +32 -0
- data/lib/generators/voluntary/install/templates/features/support/integration_sessions_form.html.erb +1 -0
- data/lib/generators/voluntary/install/templates/features/support/paths.rb +98 -0
- data/lib/generators/voluntary/install/templates/features/support/selectors.rb +44 -0
- data/lib/generators/voluntary/install/templates/features/support/spork_env +72 -0
- data/lib/generators/voluntary/install/templates/features/support/user_cuke_helpers.rb +78 -0
- data/lib/generators/voluntary/install/templates/lib/volontariat_seed.rb +36 -0
- data/lib/generators/voluntary/install/templates/spec/spec_helper.rb +72 -0
- data/lib/generators/voluntary/install/templates/spec/support/deferred_garbage_collector.rb +45 -0
- data/lib/generators/voluntary/install/templates/spec/support/devise.rb +3 -0
- data/lib/generators/voluntary/install/templates/spec/support/mongo_database_cleaner.rb +19 -0
- data/lib/generators/voluntary/install/templates/vendor/assets/javascripts/jquery.tokeninput.js +915 -0
- data/lib/generators/voluntary/install/templates/vendor/assets/stylesheets/token-input-facebook.css +122 -0
- data/lib/generators/voluntary/install/templates/vendor/assets/stylesheets/token-input-mac.css +204 -0
- data/lib/generators/voluntary/install/templates/vendor/assets/stylesheets/token-input.css +127 -0
- data/lib/i18n_interpolation_fallbacks.rb +21 -0
- data/lib/model/mongo_db/commentable.rb +17 -0
- data/lib/model/mongo_db/core_extensions.rb +10 -0
- data/lib/model/mongo_db/customizable.rb +23 -0
- data/lib/model/mongo_db/product/keywords.rb +31 -0
- data/lib/model/mongo_db/state_version_attributes.rb +15 -0
- data/lib/tasks/cucumber.rake +65 -0
- data/lib/tasks/voluntary_tasks.rake +4 -0
- data/lib/vendors/active_model/naming.rb +14 -0
- data/lib/vendors/simple_navigation/renderer/breadcrumbs_without_method_links.rb +30 -0
- data/lib/vendors/simple_navigation/renderer/twitter_sidenav.rb +34 -0
- data/lib/voluntary.rb +87 -0
- data/lib/voluntary/engine.rb +11 -0
- data/lib/voluntary/helpers/application.rb +69 -0
- data/lib/voluntary/helpers/collection.rb +35 -0
- data/lib/voluntary/helpers/comments.rb +15 -0
- data/lib/voluntary/helpers/form.rb +43 -0
- data/lib/voluntary/helpers/language.rb +19 -0
- data/lib/voluntary/helpers/layout.rb +28 -0
- data/lib/voluntary/helpers/product.rb +36 -0
- data/lib/voluntary/helpers/show.rb +69 -0
- data/lib/voluntary/helpers/wizard.rb +31 -0
- data/lib/voluntary/version.rb +3 -0
- data/lib/wizard.rb +58 -0
- data/lib/wizard/controller/concerns/paths.rb +31 -0
- data/lib/wizard/controller/concerns/steps.rb +142 -0
- metadata +1217 -0
@@ -0,0 +1,118 @@
|
|
1
|
+
module Voluntary
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < ::Rails::Generators::Base
|
4
|
+
source_root File.expand_path("../templates", __FILE__)
|
5
|
+
|
6
|
+
def copy_templates
|
7
|
+
['app', 'config', 'features', 'spec', 'vendor', 'lib'].each do |directory_name|
|
8
|
+
directory directory_name
|
9
|
+
end
|
10
|
+
|
11
|
+
=begin
|
12
|
+
Dir["#{File.expand_path(File.dirname(__FILE__))}/**/*.*"].each do |file_path|
|
13
|
+
file_path = file_path.split('/')
|
14
|
+
|
15
|
+
file_path.each do |part|
|
16
|
+
file_path.shift
|
17
|
+
|
18
|
+
break if part == 'templates'
|
19
|
+
end
|
20
|
+
|
21
|
+
file_path = file_path.join('/')
|
22
|
+
|
23
|
+
copy_file file_path, file_path
|
24
|
+
chmod file_path, 0755
|
25
|
+
end
|
26
|
+
=end
|
27
|
+
end
|
28
|
+
|
29
|
+
def gem_dependencies
|
30
|
+
add_source "http://gems.github.com"
|
31
|
+
|
32
|
+
# core
|
33
|
+
gem 'rack-cors', '~> 0.2.4', require: 'rack/cors'
|
34
|
+
gem 'thin', '~> 1.3.1', require: false
|
35
|
+
|
36
|
+
# model
|
37
|
+
gem 'settingslogic', git: 'https://github.com/binarylogic/settingslogic.git'
|
38
|
+
gem 'acts-as-taggable-on', git: 'https://github.com/mbleigh/acts-as-taggable-on.git'
|
39
|
+
|
40
|
+
# view
|
41
|
+
gem 'acts_as_markup', git: 'git://github.com/vigetlabs/acts_as_markup.git'
|
42
|
+
gem 'auto_html', git: 'git://github.com/Applicat/auto_html'
|
43
|
+
gem 'recaptcha', require: 'recaptcha/rails'
|
44
|
+
|
45
|
+
# queue
|
46
|
+
|
47
|
+
gem 'sinatra', require: false
|
48
|
+
|
49
|
+
# URIs and HTTP
|
50
|
+
|
51
|
+
gem 'addressable', '~> 2.2', require: 'addressable/uri'
|
52
|
+
|
53
|
+
# test
|
54
|
+
|
55
|
+
gem 'jasmine', git: 'https://github.com/pivotal/jasmine-gem.git'
|
56
|
+
|
57
|
+
# misc
|
58
|
+
|
59
|
+
# invalid byte sequence in US-ASCII on production
|
60
|
+
# gem 'markerb', git: 'https://github.com/plataformatec/markerb.git'
|
61
|
+
|
62
|
+
gem_group :development do
|
63
|
+
gem 'linecache', '0.46', platforms: :mri_18
|
64
|
+
gem 'capistrano', require: false
|
65
|
+
gem 'capistrano_colors', require: false
|
66
|
+
gem 'capistrano-ext', require: false
|
67
|
+
gem 'yard', require: false
|
68
|
+
end
|
69
|
+
|
70
|
+
gem_group :test do
|
71
|
+
gem 'cucumber-rails', '1.3.0', require: false
|
72
|
+
gem 'rspec-instafail', '>= 0.1.7', require: false
|
73
|
+
gem 'webmock', '~> 1.7', require: false
|
74
|
+
gem 'simplecov', require: false
|
75
|
+
end
|
76
|
+
|
77
|
+
gem_group :development, :test do
|
78
|
+
gem 'debugger', platforms: :mri_19
|
79
|
+
gem 'ruby-debug', platforms: :mri_18
|
80
|
+
end
|
81
|
+
|
82
|
+
gem_group :assets do
|
83
|
+
gem 'therubyracer', platforms: :ruby
|
84
|
+
|
85
|
+
# asset_sync is required as needed by application.rb
|
86
|
+
gem 'asset_sync', require: nil
|
87
|
+
end
|
88
|
+
|
89
|
+
gem_group :production do
|
90
|
+
# dependency nokogiri is incompatible with cucumber-rails
|
91
|
+
# gem 'rails_admin', git: 'git://github.com/halida/rails_admin.git'
|
92
|
+
gem 'fastercsv', '1.5.5', require: false
|
93
|
+
gem 'rack-ssl', require: 'rack/ssl'
|
94
|
+
gem 'rack-rewrite', '~> 1.2.1', require: false
|
95
|
+
|
96
|
+
# analytics
|
97
|
+
gem 'rack-google-analytics', require: 'rack/google-analytics'
|
98
|
+
gem 'rack-piwik', require: 'rack/piwik', require: false
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
def append_load_seed_data
|
103
|
+
create_file 'db/seeds.rb' unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
|
104
|
+
append_file 'db/seeds.rb', :verbose => true do
|
105
|
+
<<-EOH
|
106
|
+
delivery_method_was = ActionMailer::Base.delivery_method
|
107
|
+
ActionMailer::Base.delivery_method = :test
|
108
|
+
|
109
|
+
db_seed = VolontariatSeed.new
|
110
|
+
db_seed.create_fixtures
|
111
|
+
|
112
|
+
ActionMailer::Base.delivery_method = delivery_method_was
|
113
|
+
EOH
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class Ability
|
2
|
+
include CanCan::Ability
|
3
|
+
|
4
|
+
def initialize(user, options = {})
|
5
|
+
controller_namespace = options[:controller_namespace] || ""
|
6
|
+
project = options[:project] || nil
|
7
|
+
|
8
|
+
alias_action :index, :show, :autocomplete, :parents, :childs, :tree, to: :read
|
9
|
+
|
10
|
+
alias_action :new, :create, :edit, :update, :destroy, to: :restful_actions
|
11
|
+
alias_action [], to: :admin_actions
|
12
|
+
alias_action [], to: :moderation_actions
|
13
|
+
alias_action :assign, :reject, :hold_on, to: :supervisor_actions
|
14
|
+
|
15
|
+
alias_action :restful_actions, :admin_actions, to: :administrate
|
16
|
+
alias_action :restful_actions, :moderation_actions, to: :moderate
|
17
|
+
alias_action :read, :assign_actions, to: :supervisor
|
18
|
+
|
19
|
+
can :read, [
|
20
|
+
Area, Profession, Product, Project, Vacancy, Candidature, Story, Task, Result, Comment
|
21
|
+
]
|
22
|
+
can [:read, :check_name, :check_url, :check_email, :check_email_unblocked], User
|
23
|
+
can :show, Page
|
24
|
+
|
25
|
+
if user.present?
|
26
|
+
can :destroy, User, id: user.id
|
27
|
+
|
28
|
+
can [:new, :create], [Area, Profession, Project, Vacancy, Candidature, Comment]
|
29
|
+
can :assign, Task
|
30
|
+
can [:update, :cancel, :review], Task, user_id: user.id
|
31
|
+
|
32
|
+
{
|
33
|
+
user_id: [Product, Project, Candidature, Comment, ProjectUser, Result],
|
34
|
+
offeror_id: [Vacancy, Story, Task]
|
35
|
+
}.each do |attribute, classes|
|
36
|
+
can :restful_actions, classes, attribute => user.id
|
37
|
+
end
|
38
|
+
|
39
|
+
can Candidature::EVENTS, Candidature, offeror_id: user.id
|
40
|
+
can Vacancy::EVENTS, Vacancy, offeror_id: user.id
|
41
|
+
can Story::EVENTS, Story, offeror_id: user.id
|
42
|
+
can Task::EVENTS + [:update], Task, offeror_id: user.id
|
43
|
+
|
44
|
+
if user.name == 'Master'
|
45
|
+
can [:manage, :moderate, :administrate, :supervisor], :all
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
2
|
+
# licensed under the Affero General Public License version 3 or later. See
|
3
|
+
# the COPYRIGHT file.
|
4
|
+
|
5
|
+
require 'uri'
|
6
|
+
|
7
|
+
class AppConfig < Settingslogic
|
8
|
+
def self.source_file_name
|
9
|
+
if ENV['application_yml'].present?
|
10
|
+
puts "using remote application.yml"
|
11
|
+
return ENV['application_yml']
|
12
|
+
end
|
13
|
+
config_file = Rails.root.join("config", "application.yml")
|
14
|
+
if !File.exists?(config_file) && (Rails.env == 'test' || Rails.env.include?("integration") || EnvironmentConfiguration.heroku?)
|
15
|
+
config_file = Rails.root.join("config", "application.yml.example")
|
16
|
+
end
|
17
|
+
config_file
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.load!
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.setup!
|
24
|
+
end
|
25
|
+
|
26
|
+
source source_file_name
|
27
|
+
namespace Rails.env
|
28
|
+
|
29
|
+
def self.new_relic_app_name
|
30
|
+
self[:new_relic_app_name] || self[:pod_uri].host
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%= t('layout.title') %></title>
|
5
|
+
<meta charset='utf-8'>
|
6
|
+
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
|
7
|
+
<%= stylesheet_link_tag 'voluntary/application', media: 'all' %>
|
8
|
+
<%= stylesheet_link_tag 'application', media: 'all' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<%= render 'layouts/shared/navigation' %>
|
12
|
+
|
13
|
+
<div class="container-fluid">
|
14
|
+
<% unless flash.empty? %>
|
15
|
+
<div class="row-fluid">
|
16
|
+
<div class="span12">
|
17
|
+
<%= render 'layouts/shared/flash_messages' %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
<div class="row-fluid">
|
22
|
+
<div class="span9">
|
23
|
+
<%= breadcrumbs %>
|
24
|
+
|
25
|
+
<%= yield %>
|
26
|
+
</div>
|
27
|
+
<div class="span3">
|
28
|
+
<%= sidenav %>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
<div class="container-fluid">
|
33
|
+
<div class="row-fluid footer">
|
34
|
+
<div class="span12">
|
35
|
+
<%= footer_navigation %>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
39
|
+
<%= javascript_include_tag 'voluntary/application' %>
|
40
|
+
<%= javascript_include_tag 'application' %>
|
41
|
+
<%= csrf_meta_tags %>
|
42
|
+
<%= javascript_tag do %>
|
43
|
+
<%= yield :top_javascript %>
|
44
|
+
|
45
|
+
$(function() {
|
46
|
+
<%= yield(:document_ready) %>
|
47
|
+
});
|
48
|
+
<% end %>
|
49
|
+
</body>
|
50
|
+
</html>
|
@@ -0,0 +1,147 @@
|
|
1
|
+
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
2
|
+
# licensed under the Affero General Public License version 3 or later. See
|
3
|
+
# the COPYRIGHT file.
|
4
|
+
|
5
|
+
defaults: &defaults
|
6
|
+
|
7
|
+
######################################################
|
8
|
+
# Environment Configuration
|
9
|
+
######################################################
|
10
|
+
|
11
|
+
## Set the hostname of the machine you're running Diaspora on, as seen
|
12
|
+
## from the internet. This should be the URL you want to use to
|
13
|
+
## access the pod. So if you plan to reverse proxy it, it should be
|
14
|
+
## the URL the proxy listens on.
|
15
|
+
## DO NOT CHNANGE THIS AFTER INITIAL SETUP
|
16
|
+
## UNLESS YOU KNOW WHAT YOU'RE DOING!
|
17
|
+
## However changing http to https is okay and has no consquences.
|
18
|
+
## If you do change it you have to start over as it's hardcoded into
|
19
|
+
## the database.
|
20
|
+
pod_url: "http://localhost:3000/"
|
21
|
+
|
22
|
+
## Setting the bundle of certificate authorities (CA) certificates.
|
23
|
+
## This is operating system specific.
|
24
|
+
## Examples, uncomment one or add your own:
|
25
|
+
ca_file: '/etc/pki/tls/certs/ca-bundle.crt'
|
26
|
+
|
27
|
+
## Name of your pod
|
28
|
+
pod_name: "Volontari.at*"
|
29
|
+
|
30
|
+
######################################################
|
31
|
+
# Email Configuration
|
32
|
+
######################################################
|
33
|
+
|
34
|
+
## First you need to enable it ;)
|
35
|
+
mailer_on: false
|
36
|
+
|
37
|
+
## Sender address used in mail send by Diaspora
|
38
|
+
#sender_address: 'no-reply@example.org'
|
39
|
+
|
40
|
+
## This selects which mailer should be used. Take 'smtp' for a smtp
|
41
|
+
## connection, 'sendmail' to use the sendmail binary or
|
42
|
+
## 'messagebus' to use the messagebus service.
|
43
|
+
mailer_method: 'smtp'
|
44
|
+
|
45
|
+
# Address/port to smtp server handling outgoing mail.
|
46
|
+
smtp_address: 'smtp.example.com'
|
47
|
+
smtp_port: '587'
|
48
|
+
|
49
|
+
#API key if you are using message bus
|
50
|
+
message_bus_api_key: ''
|
51
|
+
|
52
|
+
# The path to the sendmail binary. Ignored if mailer_method is not set to sendmail
|
53
|
+
sendmail_location: '/usr/sbin/sendmail'
|
54
|
+
|
55
|
+
# Set this to true if you want to use exim and sendmail
|
56
|
+
sendmail_exim_fix: false
|
57
|
+
|
58
|
+
# Authentication required to send mail. Use one of 'plain',
|
59
|
+
# 'login' or 'cram_md5'. Use 'none' if server does not support
|
60
|
+
# authentication
|
61
|
+
smtp_authentication: 'plain'
|
62
|
+
|
63
|
+
# Automatically enable TLS? Ignored if smtp_authentication is set to none
|
64
|
+
smtp_starttls_auto: true
|
65
|
+
|
66
|
+
# OpenSSL verify mode used when connecting to a SMTP server with TLS.
|
67
|
+
# Set this to none if you have a self signed certificate, keep it empty (not '') for the default
|
68
|
+
# Possible values: none, peer, client_once, fail_if_no_peer_cert
|
69
|
+
smtp_openssl_verify_mode:
|
70
|
+
|
71
|
+
# Domain of smtp server.
|
72
|
+
# This should match the common name of the certificate
|
73
|
+
# the SMTP server sends. If he sends one
|
74
|
+
smtp_domain: 'example.com'
|
75
|
+
|
76
|
+
# Credentials to log in to the SMTP server - may be necessary if
|
77
|
+
# smtp_authentication is not 'none'
|
78
|
+
smtp_username: 'smtp_username'
|
79
|
+
smtp_password: 'secret'
|
80
|
+
|
81
|
+
# Sender address in Diaspora's outgoing mail.
|
82
|
+
smtp_sender_address: 'no-reply@volontari.at'
|
83
|
+
|
84
|
+
######################################################
|
85
|
+
# Social Service Configuration
|
86
|
+
######################################################
|
87
|
+
|
88
|
+
## OAuth credentials for Facebook:
|
89
|
+
facebook_app_id: ''
|
90
|
+
facebook_app_secret: ''
|
91
|
+
|
92
|
+
#this will be the namespace for your object, it should be configured in your FB app
|
93
|
+
open_graph_namespace: ''
|
94
|
+
|
95
|
+
|
96
|
+
## OAuth credentials for Twitter:
|
97
|
+
twitter_consumer_key: ''
|
98
|
+
twitter_consumer_secret: ''
|
99
|
+
|
100
|
+
## OAuth credentials for Tumblr
|
101
|
+
tumblr_consumer_key: ''
|
102
|
+
tumblr_consumer_secret: ''
|
103
|
+
|
104
|
+
|
105
|
+
######################################################
|
106
|
+
# Debugging Service Tool Integration
|
107
|
+
######################################################
|
108
|
+
|
109
|
+
## Resque is the background processing sysem used by Diaspora
|
110
|
+
## Resque web is an admin tool for it. This settings decides wheter
|
111
|
+
## or not to inline it into Diaspora.
|
112
|
+
mount_resque_web: true
|
113
|
+
|
114
|
+
## If you use Airbrake provide your API key here:
|
115
|
+
airbrake_api_key: ''
|
116
|
+
|
117
|
+
## If you use NewRelic provide your credentials here:
|
118
|
+
NEW_RELIC_LICENSE_KEY: ''
|
119
|
+
new_relic_app_name: ''
|
120
|
+
|
121
|
+
######################################################
|
122
|
+
# Overrides
|
123
|
+
######################################################
|
124
|
+
|
125
|
+
development:
|
126
|
+
<<: *defaults
|
127
|
+
|
128
|
+
production:
|
129
|
+
<<: *defaults
|
130
|
+
|
131
|
+
##################################################
|
132
|
+
# FEDERATION LOGGER ##############################
|
133
|
+
# Do not touch unless you know what you're doing!#
|
134
|
+
##################################################
|
135
|
+
|
136
|
+
test:
|
137
|
+
<<: *defaults
|
138
|
+
pod_url: "http://localhost:9887/"
|
139
|
+
socket_port: 8081
|
140
|
+
|
141
|
+
integration1:
|
142
|
+
<<: *defaults
|
143
|
+
pod_url: "http://localhost:3001/"
|
144
|
+
|
145
|
+
integration2:
|
146
|
+
<<: *defaults
|
147
|
+
pod_url: "http://localhost:3002/"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%
|
2
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
3
|
+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
|
+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
|
5
|
+
%>
|
6
|
+
default: <%= std_opts %> features
|
7
|
+
wip: --tags @wip:3 --wip features
|
8
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
@@ -0,0 +1,28 @@
|
|
1
|
+
development:
|
2
|
+
adapter: postgresql
|
3
|
+
database: volontariat_development
|
4
|
+
encoding: unicode
|
5
|
+
username: root
|
6
|
+
password:
|
7
|
+
encoding: unicode
|
8
|
+
|
9
|
+
test: &TEST
|
10
|
+
adapter: postgresql
|
11
|
+
encoding: unicode
|
12
|
+
database: volontariat_test
|
13
|
+
pool: 5
|
14
|
+
username: root
|
15
|
+
password:
|
16
|
+
|
17
|
+
production:
|
18
|
+
adapter: postgresql
|
19
|
+
encoding: unicode
|
20
|
+
database: volontariat_production
|
21
|
+
encoding: utf8
|
22
|
+
pool: 5
|
23
|
+
host: localhost
|
24
|
+
username: volontariat
|
25
|
+
password:
|
26
|
+
|
27
|
+
cucumber:
|
28
|
+
<<: *TEST
|