voluntary 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2012 YOURNAME
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
= Voluntary
|
|
2
|
+
|
|
3
|
+
This is a gem which turns your rails application into a crowdsourcing platform to run on your intranet or on the internet.
|
|
4
|
+
|
|
5
|
+
Then you can add existing voluntary products like text creation or create your own products.
|
|
6
|
+
|
|
7
|
+
== Installation
|
|
8
|
+
|
|
9
|
+
Run this in your console:
|
|
10
|
+
|
|
11
|
+
rvm --create use 1.9.3@your_crowdsourcing_platform_name
|
|
12
|
+
gem update bundler
|
|
13
|
+
gem install rails --no-rdoc --no-ri
|
|
14
|
+
rails new your_crowdsourcing_platform_name
|
|
15
|
+
cd your_crowdsourcing_platform_name
|
|
16
|
+
|
|
17
|
+
Add this to your Gemfile:
|
|
18
|
+
|
|
19
|
+
gem 'voluntary'
|
|
20
|
+
|
|
21
|
+
Run this in your console:
|
|
22
|
+
|
|
23
|
+
bundle install
|
|
24
|
+
|
|
25
|
+
Run this in your console (confirm all overwrite questions):
|
|
26
|
+
|
|
27
|
+
rails g voluntary:install
|
|
28
|
+
rake voluntary:install:migrations
|
|
29
|
+
|
|
30
|
+
Remove gem 'sqlite3' from your Gemfile.
|
|
31
|
+
|
|
32
|
+
Copy the content of config/database.example.yml into config/database.yml
|
|
33
|
+
|
|
34
|
+
Remove public/index.html
|
|
35
|
+
|
|
36
|
+
Add at least 1 controller with 1 action, 1 view and a root route.
|
|
37
|
+
|
|
38
|
+
Run this in your console:
|
|
39
|
+
|
|
40
|
+
bundle install
|
|
41
|
+
rake db:create
|
|
42
|
+
rake db:migrate
|
|
43
|
+
rake db:seed
|
|
44
|
+
rails s
|
|
45
|
+
|
|
46
|
+
= License
|
|
47
|
+
|
|
48
|
+
This project uses MIT-LICENSE.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
begin
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
rescue LoadError
|
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
6
|
+
end
|
|
7
|
+
begin
|
|
8
|
+
require 'rdoc/task'
|
|
9
|
+
rescue LoadError
|
|
10
|
+
require 'rdoc/rdoc'
|
|
11
|
+
require 'rake/rdoctask'
|
|
12
|
+
RDoc::Task = Rake::RDocTask
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
17
|
+
rdoc.title = 'Voluntary'
|
|
18
|
+
rdoc.options << '--line-numbers'
|
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
Bundler::GemHelper.install_tasks
|
|
27
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
$(document).ready ->
|
|
2
|
+
$( '.accordions' ).each (k, v) ->
|
|
3
|
+
$(v).accordion({ autoHeight: false });
|
|
4
|
+
|
|
5
|
+
$('.tabs').each (k, v) ->
|
|
6
|
+
$(v).tabs({ autoHeight: false });
|
|
7
|
+
|
|
8
|
+
$('form').on 'click', '.remove_fields', (event) ->
|
|
9
|
+
#$(this).prev('input[type=hidden]').val('1')
|
|
10
|
+
$(this).closest('fieldset').remove()
|
|
11
|
+
event.preventDefault()
|
|
12
|
+
|
|
13
|
+
$('form').on 'click', '.add_fields', (event) ->
|
|
14
|
+
time = new Date().getTime()
|
|
15
|
+
regexp = new RegExp($(this).data('id'), 'g')
|
|
16
|
+
target = $(this)
|
|
17
|
+
|
|
18
|
+
if $(this).data('target')
|
|
19
|
+
target = $('#' + $(this).data('target'))
|
|
20
|
+
|
|
21
|
+
target.before($(this).data('fields').replace(regexp, time))
|
|
22
|
+
event.preventDefault()
|
|
23
|
+
|
|
24
|
+
$('input[data-autocomplete]').each (k, v) ->
|
|
25
|
+
$(v).autocomplete({
|
|
26
|
+
source: $(this).attr('data-autocomplete'),
|
|
27
|
+
select: (event, ui) ->
|
|
28
|
+
$(this).val(ui.item.value)
|
|
29
|
+
|
|
30
|
+
if ($(this).attr('id_element'))
|
|
31
|
+
$($(this).attr('id_element')).val(ui.item.id)
|
|
32
|
+
|
|
33
|
+
return false;
|
|
34
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function delete_link(id) {
|
|
2
|
+
link = $(id)
|
|
3
|
+
|
|
4
|
+
if(!confirm(link.data('confirm'))) {
|
|
5
|
+
return
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
var href = $.rails.href(link),
|
|
9
|
+
method = link.data('method'),
|
|
10
|
+
target = link.attr('target'),
|
|
11
|
+
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
|
12
|
+
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
|
13
|
+
form = $('<form method="post" action="' + href + '"></form>'),
|
|
14
|
+
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />'
|
|
15
|
+
|
|
16
|
+
if (csrf_param !== undefined && csrf_token !== undefined) {
|
|
17
|
+
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (target) { form.attr('target', target) }
|
|
21
|
+
|
|
22
|
+
form.hide().append(metadata_input).appendTo('body')
|
|
23
|
+
form.submit()
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Place all the behaviors and hooks related to the matching controller here.
|
|
2
|
+
# All this logic will automatically be available in application.js.
|
|
3
|
+
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
|
4
|
+
jQuery ->
|
|
5
|
+
$('#user_area_tokens').tokenInput '/areas.json'
|
|
6
|
+
theme: 'facebook'
|
|
7
|
+
prePopulate: $('#user_area_tokens').data('load')
|
|
8
|
+
|
|
9
|
+
jQuery ->
|
|
10
|
+
$('#user_foreign_language_tokens').tokenInput '/users/languages.json'
|
|
11
|
+
theme: 'facebook'
|
|
12
|
+
prePopulate: $('#user_foreign_language_tokens').data('load')
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
+
* listed below.
|
|
4
|
+
*
|
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
|
7
|
+
*
|
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
|
10
|
+
*
|
|
11
|
+
*= require_self
|
|
12
|
+
*= require token-input-facebook
|
|
13
|
+
*= require 'voluntary/bootstrap_and_overrides'
|
|
14
|
+
*= require 'voluntary/base'
|
|
15
|
+
*/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*= require jquery.ui.all
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/*body {
|
|
6
|
+
font-family: Arial;
|
|
7
|
+
}*/
|
|
8
|
+
|
|
9
|
+
.ui-widget {
|
|
10
|
+
font-family: Arial;
|
|
11
|
+
font-size: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
html, body, div, span {
|
|
15
|
+
font-family: Arial;
|
|
16
|
+
font-size: 10px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.nav a {
|
|
20
|
+
font-family: Arial;
|
|
21
|
+
font-size: 10px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.nested_comments {
|
|
25
|
+
margin-left: 30px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.nested_comments .nested_comments .nested_comments .nested_comments {
|
|
29
|
+
margin-left: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.footer {
|
|
33
|
+
margin-top: 20px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.floating_form fieldset .control-group {
|
|
37
|
+
float: left;
|
|
38
|
+
margin-right: 10px;
|
|
39
|
+
margin-bottom: 0px;
|
|
40
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@import "twitter/bootstrap/bootstrap";
|
|
2
|
+
/*body {
|
|
3
|
+
padding-top: 60px;
|
|
4
|
+
padding-left: 20px;
|
|
5
|
+
}*/
|
|
6
|
+
|
|
7
|
+
@import "twitter/bootstrap/responsive";
|
|
8
|
+
|
|
9
|
+
pre {
|
|
10
|
+
background-color: white;
|
|
11
|
+
border: 0px;
|
|
12
|
+
border-radius: 0px;
|
|
13
|
+
display: block;
|
|
14
|
+
font-size: 10px;
|
|
15
|
+
line-height: 18px;
|
|
16
|
+
margin: 0px;
|
|
17
|
+
padding: 0px;
|
|
18
|
+
white-space: pre-wrap;
|
|
19
|
+
word-wrap: break-word;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
code, pre {
|
|
23
|
+
font-family: Arial;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
code {
|
|
27
|
+
border-radius: 0px;
|
|
28
|
+
border-width: 0px;
|
|
29
|
+
color: black;
|
|
30
|
+
background-color: white;
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
padding: 0px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.nav a {
|
|
36
|
+
font-size:14px ! important;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Set the correct sprite paths
|
|
40
|
+
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
|
|
41
|
+
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');
|
|
42
|
+
|
|
43
|
+
// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
|
|
44
|
+
// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not
|
|
45
|
+
// have the proper paths. So for now we use the absolute path.
|
|
46
|
+
@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot';
|
|
47
|
+
@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff';
|
|
48
|
+
@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf';
|
|
49
|
+
@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg';
|
|
50
|
+
|
|
51
|
+
// Font Awesome
|
|
52
|
+
@import "fontawesome";
|
|
53
|
+
|
|
54
|
+
// Your custom LESS stylesheets goes here
|
|
55
|
+
//
|
|
56
|
+
// Since bootstrap was imported above you have access to its mixins which
|
|
57
|
+
// you may use and inherit here
|
|
58
|
+
//
|
|
59
|
+
// If you'd like to override bootstrap's own variables, you can do so here as well
|
|
60
|
+
// See http://twitter.github.com/bootstrap/less.html for their names and documentation
|
|
61
|
+
//
|
|
62
|
+
// Example:
|
|
63
|
+
// @linkColor: #ff0000;
|
|
64
|
+
|
|
65
|
+
.auto_width {
|
|
66
|
+
width: auto;
|
|
67
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
class AreasController < ApplicationController
|
|
2
|
+
include Applicat::Mvc::Controller::Resource
|
|
3
|
+
|
|
4
|
+
load_and_authorize_resource
|
|
5
|
+
|
|
6
|
+
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
|
7
|
+
|
|
8
|
+
respond_to :html, :js, :json
|
|
9
|
+
|
|
10
|
+
def index
|
|
11
|
+
@areas = Area.order(:name)
|
|
12
|
+
|
|
13
|
+
respond_to do |format|
|
|
14
|
+
format.html
|
|
15
|
+
format.json { render json: @areas.tokens(params[:q]) }
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def show
|
|
20
|
+
@area = Area.find(params[:id])
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def new
|
|
24
|
+
@area = Area.new
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def create
|
|
28
|
+
@area = Area.new(params[:area])
|
|
29
|
+
|
|
30
|
+
if @area.save
|
|
31
|
+
redirect_to @area, notice: t('general.form.successfully_created')
|
|
32
|
+
else
|
|
33
|
+
render :new
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def edit
|
|
38
|
+
@area = Area.find(params[:id])
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def update
|
|
42
|
+
@area = Area.find(params[:id])
|
|
43
|
+
|
|
44
|
+
if @area.update_attributes(params[:area])
|
|
45
|
+
redirect_to @area, notice: t('general.form.successfully_updated')
|
|
46
|
+
else
|
|
47
|
+
render :edit
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def destroy
|
|
52
|
+
@area = Area.find(params[:id])
|
|
53
|
+
@area.destroy
|
|
54
|
+
redirect_to areas_url, notice: t('general.form.destroyed')
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def resource
|
|
58
|
+
@area
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
private
|
|
62
|
+
|
|
63
|
+
def not_found
|
|
64
|
+
redirect_to areas_path, notice: t('areas.exceptions.not_found')
|
|
65
|
+
end
|
|
66
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
class CandidaturesController < ApplicationController
|
|
2
|
+
include Applicat::Mvc::Controller::Resource
|
|
3
|
+
|
|
4
|
+
load_and_authorize_resource
|
|
5
|
+
|
|
6
|
+
before_filter :find_vacancy, only: [:index, :new, :edit]
|
|
7
|
+
|
|
8
|
+
transition_actions Candidature::EVENTS
|
|
9
|
+
|
|
10
|
+
helper_method :parent
|
|
11
|
+
|
|
12
|
+
respond_to :html, :js, :json
|
|
13
|
+
|
|
14
|
+
def index
|
|
15
|
+
@candidatures = @vacancy ? @vacancy.candidatures.includes(:vacancy, :user) : Candidature.includes(:vacancy, :user).all
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def show
|
|
19
|
+
@candidature = Candidature.includes(:vacancy, :user, :comments).find(params[:id])
|
|
20
|
+
@vacancy = @candidature.vacancy
|
|
21
|
+
@comments = @candidature.comments
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def new
|
|
25
|
+
@candidature = Candidature.new
|
|
26
|
+
@candidature.vacancy = parent
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def create
|
|
30
|
+
@candidature = Candidature.new(params[:candidature])
|
|
31
|
+
@candidature.user_id = current_user.id
|
|
32
|
+
|
|
33
|
+
if @candidature.save
|
|
34
|
+
redirect_to @candidature, notice: t('general.form.successfully_created')
|
|
35
|
+
else
|
|
36
|
+
render :new
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def edit
|
|
41
|
+
@candidature = Candidature.find(params[:id])
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def update
|
|
45
|
+
@candidature = Candidature.find(params[:id])
|
|
46
|
+
|
|
47
|
+
if @candidature.update_attributes(params[:candidature])
|
|
48
|
+
redirect_to @candidature, notice: t('general.form.successfully_updated')
|
|
49
|
+
else
|
|
50
|
+
render :edit
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def destroy
|
|
55
|
+
@candidature = Candidature.find(params[:id])
|
|
56
|
+
@candidature.destroy
|
|
57
|
+
redirect_to candidatures_url, notice: t('general.form.destroyed')
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def resource
|
|
61
|
+
@candidature
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def parent
|
|
65
|
+
@vacancy
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
protected
|
|
69
|
+
|
|
70
|
+
def set_twitter_sidenav_level
|
|
71
|
+
@twitter_sidenav_level = 5
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
private
|
|
75
|
+
|
|
76
|
+
def find_vacancy
|
|
77
|
+
@vacancy = params[:vacancy_id].present? ? Vacancy.find(params[:vacancy_id]) : nil
|
|
78
|
+
end
|
|
79
|
+
end
|