Mercurial > hg > soundsoftware-site
changeset 1117:b4b72f1eb644 redmine-2.2-integration
Moved all the plugins from the vendor folder to the application root folder.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 08 Jan 2013 12:32:05 +0000 |
parents | bb32da3bea34 |
children | 35686c1667de |
files | plugins/embedded/COPYING plugins/embedded/README plugins/embedded/RUNNING_TESTS plugins/embedded/app/controllers/embedded_controller.rb plugins/embedded/app/helpers/embedded_helper.rb plugins/embedded/app/views/embedded/index.html.erb plugins/embedded/app/views/settings/_embedded.html.erb plugins/embedded/assets/javascripts/rcov.js plugins/embedded/assets/stylesheets/doxygen.css plugins/embedded/assets/stylesheets/javadoc.css plugins/embedded/assets/stylesheets/rcov.css plugins/embedded/init.rb plugins/embedded/lib/embedded.rb plugins/embedded/test/fixtures/html/app-controllers-account_controller_rb.html plugins/embedded/test/fixtures/html/index.html plugins/embedded/test/fixtures/html/misc/misc.html plugins/embedded/test/fixtures/html/misc/misc.txt plugins/embedded/test/functional/embedded_controller_test.rb plugins/embedded/test/test_helper.rb plugins/embedded/test/unit/embedded_test.rb plugins/engines/generators/plugin_migration/templates/plugin_migration.html.erb plugins/redmine_bibliography/README.rdoc plugins/redmine_bibliography/app/controllers/authors_controller.rb plugins/redmine_bibliography/app/controllers/authorships_controller.rb plugins/redmine_bibliography/app/controllers/bibtex_entries_controller.rb plugins/redmine_bibliography/app/controllers/publications_controller.rb plugins/redmine_bibliography/app/helpers/authors_helper.rb plugins/redmine_bibliography/app/helpers/authorships_helper.rb plugins/redmine_bibliography/app/helpers/bibtex_entries_helper.rb plugins/redmine_bibliography/app/helpers/my_helper.rb plugins/redmine_bibliography/app/helpers/publications_helper.rb plugins/redmine_bibliography/app/models/author.rb plugins/redmine_bibliography/app/models/authorship.rb plugins/redmine_bibliography/app/models/bibtex_entry.rb plugins/redmine_bibliography/app/models/bibtex_entry_type.rb plugins/redmine_bibliography/app/models/publication.rb plugins/redmine_bibliography/app/views/authors/index.html.erb plugins/redmine_bibliography/app/views/authors/show.html.erb plugins/redmine_bibliography/app/views/authorships/update.html.erb plugins/redmine_bibliography/app/views/mailer/publication_added.html.erb plugins/redmine_bibliography/app/views/mailer/publication_added.text.erb plugins/redmine_bibliography/app/views/my/blocks/_publications_box.html.erb plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb plugins/redmine_bibliography/app/views/projects/_publications_box.html.erb plugins/redmine_bibliography/app/views/projects/show.html.erb plugins/redmine_bibliography/app/views/publications/_add_project_form.html.erb plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb plugins/redmine_bibliography/app/views/publications/_form.html.erb plugins/redmine_bibliography/app/views/publications/_identify_author_form.html.erb plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb plugins/redmine_bibliography/app/views/publications/_new_bibtex_step.html.erb plugins/redmine_bibliography/app/views/publications/_review_bibtex_step.html.erb plugins/redmine_bibliography/app/views/publications/add_project.rjs plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.html.erb plugins/redmine_bibliography/app/views/publications/autocomplete_for_project.html.erb plugins/redmine_bibliography/app/views/publications/create.html.erb plugins/redmine_bibliography/app/views/publications/edit.html.erb plugins/redmine_bibliography/app/views/publications/import.html.erb plugins/redmine_bibliography/app/views/publications/index.html.erb plugins/redmine_bibliography/app/views/publications/new.html.erb plugins/redmine_bibliography/app/views/publications/show.html.erb plugins/redmine_bibliography/app/views/publications/update.html.erb plugins/redmine_bibliography/app/views/settings/_bibliography.html.erb plugins/redmine_bibliography/app/views/users/show.html.erb plugins/redmine_bibliography/assets/javascripts/authors.js plugins/redmine_bibliography/assets/javascripts/bibtex.js plugins/redmine_bibliography/assets/stylesheets/bibliography.css plugins/redmine_bibliography/config/locales/en.yml plugins/redmine_bibliography/config/routes.rb plugins/redmine_bibliography/db/migrate/001_create_authors.rb plugins/redmine_bibliography/db/migrate/002_create_publications.rb plugins/redmine_bibliography/db/migrate/003_create_authorships.rb plugins/redmine_bibliography/db/migrate/004_create_bibtex_entries.rb plugins/redmine_bibliography/db/migrate/005_create_projects_publications_join_table.rb plugins/redmine_bibliography/db/migrate/006_create_bibtex_entry_types.rb plugins/redmine_bibliography/db/migrate/007_add_external_url_column_to_publications.rb plugins/redmine_bibliography/db/migrate/008_add_doi_and_timestamp_columns_to_publications.rb plugins/redmine_bibliography/db/migrate/009_add_timestamp_columns_to_authors.rb plugins/redmine_bibliography/db/seed_data/bibtex_entry_types_list.txt plugins/redmine_bibliography/init.rb plugins/redmine_bibliography/lang/en.yml plugins/redmine_bibliography/lib/bibliography/mailer_patch.rb plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb plugins/redmine_bibliography/lib/tasks/seed_bibtex_entry_types.rake plugins/redmine_bibliography/test/fixtures/authors.yml plugins/redmine_bibliography/test/fixtures/authorships.yml plugins/redmine_bibliography/test/fixtures/bibtex_entries.yml plugins/redmine_bibliography/test/fixtures/publications.yml plugins/redmine_bibliography/test/functional/authors_controller_test.rb plugins/redmine_bibliography/test/functional/authorships_controller_test.rb plugins/redmine_bibliography/test/functional/publications_controller_test.rb plugins/redmine_bibliography/test/test_helper.rb plugins/redmine_bibliography/test/unit/author_test.rb plugins/redmine_bibliography/test/unit/authorship_test.rb plugins/redmine_bibliography/test/unit/bibtex_entry_test.rb plugins/redmine_bibliography/test/unit/publication_test.rb plugins/redmine_checkout/README.rdoc plugins/redmine_checkout/Rakefile plugins/redmine_checkout/app/views/projects/settings/_repository_checkout.html.erb plugins/redmine_checkout/app/views/projects/settings/_repository_checkout_protocol.html.erb plugins/redmine_checkout/app/views/redmine_checkout_hooks/_view_repositories_show_contextual.html.erb plugins/redmine_checkout/app/views/settings/_checkout.html.erb plugins/redmine_checkout/app/views/settings/_checkout_protocol.html.erb plugins/redmine_checkout/app/views/settings/_checkout_scm.html.erb plugins/redmine_checkout/app/views/settings/_redmine_checkout.html.erb plugins/redmine_checkout/assets/images/ZeroClipboard.as plugins/redmine_checkout/assets/images/ZeroClipboard.swf plugins/redmine_checkout/assets/images/button.svg plugins/redmine_checkout/assets/images/button_focus.svg plugins/redmine_checkout/assets/images/button_selected.svg plugins/redmine_checkout/assets/images/paste.png plugins/redmine_checkout/assets/javascripts/ZeroClipboard.js plugins/redmine_checkout/assets/javascripts/checkout.js plugins/redmine_checkout/assets/javascripts/subform.js plugins/redmine_checkout/assets/stylesheets/checkout.css plugins/redmine_checkout/assets/stylesheets/checkout_alternate.css plugins/redmine_checkout/config/locales/de.yml plugins/redmine_checkout/config/locales/en-GB.yml plugins/redmine_checkout/config/locales/en.yml plugins/redmine_checkout/config/locales/es.yml plugins/redmine_checkout/config/locales/fr.yml plugins/redmine_checkout/config/locales/it.yml plugins/redmine_checkout/config/locales/ja.yml plugins/redmine_checkout/config/locales/ko.yml plugins/redmine_checkout/config/locales/nl.yml plugins/redmine_checkout/config/locales/pl.yml plugins/redmine_checkout/config/locales/ro.yml plugins/redmine_checkout/db/migrate/20091208210439_add_checkout_url_info.rb plugins/redmine_checkout/db/migrate/20091220173312_add_display_login.rb plugins/redmine_checkout/db/migrate/20100118174556_add_render_link.rb plugins/redmine_checkout/db/migrate/20100118235845_remove_defaults.rb plugins/redmine_checkout/db/migrate/20100118235909_add_overwrite_option.rb plugins/redmine_checkout/db/migrate/20100203202320_update_settings.rb plugins/redmine_checkout/db/migrate/20100426154202_rename_render_link_to_render_type.rb plugins/redmine_checkout/db/migrate/20100512135418_consolidate_repository_options.rb plugins/redmine_checkout/db/migrate/20100609153630_apply_setting_changes.rb plugins/redmine_checkout/db/migrate/20100808185600_change_protocol_storage_from_hash_to_array.rb plugins/redmine_checkout/doc/COPYING plugins/redmine_checkout/init.rb plugins/redmine_checkout/lib/checkout/protocol.rb plugins/redmine_checkout/lib/checkout/repositories_helper_patch.rb plugins/redmine_checkout/lib/checkout/repository_hooks.rb plugins/redmine_checkout/lib/checkout/repository_patch.rb plugins/redmine_checkout/lib/checkout/setting_patch.rb plugins/redmine_checkout/lib/checkout/settings_controller_patch.rb plugins/redmine_checkout/lib/checkout/settings_helper_patch.rb plugins/redmine_checkout/lib/checkout_helper.rb plugins/redmine_checkout/lib/tasks/set_default.rake plugins/redmine_checkout/lib/tasks/spec.rake plugins/redmine_checkout/spec/controllers/repositories_controller_spec.rb plugins/redmine_checkout/spec/fixtures/enabled_modules.yml plugins/redmine_checkout/spec/fixtures/projects.yml plugins/redmine_checkout/spec/fixtures/repositories.yml plugins/redmine_checkout/spec/fixtures/roles.yml plugins/redmine_checkout/spec/fixtures/settings.yml plugins/redmine_checkout/spec/macros/macro_spec.rb plugins/redmine_checkout/spec/models/protocol_spec.rb plugins/redmine_checkout/spec/models/repository_spec.rb plugins/redmine_checkout/spec/models/setting_spec.rb plugins/redmine_checkout/spec/sanity_spec.rb plugins/redmine_checkout/spec/spec.opts plugins/redmine_checkout/spec/spec_helper.rb plugins/redmine_tags/COPYING plugins/redmine_tags/LICENSE plugins/redmine_tags/README.rdoc plugins/redmine_tags/app/helpers/filters_helper.rb plugins/redmine_tags/app/helpers/tags_helper.rb plugins/redmine_tags/app/views/auto_completes/_search_tag_list.html.erb plugins/redmine_tags/app/views/auto_completes/_tag_list.html.erb plugins/redmine_tags/app/views/issues/_tags.html.erb plugins/redmine_tags/app/views/issues/_tags_form.html.erb plugins/redmine_tags/app/views/issues/_tags_sidebar.html.erb plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb plugins/redmine_tags/app/views/projects/_filter_tags.html.erb plugins/redmine_tags/app/views/projects/_filtered_projects.html.erb plugins/redmine_tags/app/views/projects/_my_projects.html.erb plugins/redmine_tags/app/views/projects/_tagcloud.html.erb plugins/redmine_tags/app/views/projects/_tags.html.erb plugins/redmine_tags/app/views/projects/_tags_form.html.erb plugins/redmine_tags/app/views/projects/index.html.erb plugins/redmine_tags/app/views/tags/_settings.html.erb plugins/redmine_tags/assets/javascripts/projects_index.js plugins/redmine_tags/assets/javascripts/tags_input.js plugins/redmine_tags/assets/stylesheets/redmine_tags.css plugins/redmine_tags/config/locales/de.yml plugins/redmine_tags/config/locales/en.yml plugins/redmine_tags/config/locales/fr.yml plugins/redmine_tags/config/locales/ru.yml plugins/redmine_tags/config/routes.rb plugins/redmine_tags/db/migrate/001_acts_as_taggable_on_migration.rb plugins/redmine_tags/init.rb plugins/redmine_tags/lib/redmine_project_filtering.rb plugins/redmine_tags/lib/redmine_tags/hooks/model_issue_hook.rb plugins/redmine_tags/lib/redmine_tags/hooks/model_project_hook.rb plugins/redmine_tags/lib/redmine_tags/hooks/views_issues_hook.rb plugins/redmine_tags/lib/redmine_tags/hooks/views_projects_hook.rb plugins/redmine_tags/lib/redmine_tags/patches/auto_completes_controller_patch.rb plugins/redmine_tags/lib/redmine_tags/patches/issue_patch.rb plugins/redmine_tags/lib/redmine_tags/patches/issues_helper_patch.rb plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb plugins/redmine_tags/lib/redmine_tags/patches/queries_helper_patch.rb plugins/redmine_tags/lib/redmine_tags/patches/query_patch.rb vendor/plugins/embedded/COPYING vendor/plugins/embedded/README vendor/plugins/embedded/RUNNING_TESTS vendor/plugins/embedded/app/controllers/embedded_controller.rb vendor/plugins/embedded/app/helpers/embedded_helper.rb vendor/plugins/embedded/app/views/embedded/index.html.erb vendor/plugins/embedded/app/views/settings/_embedded.html.erb vendor/plugins/embedded/assets/javascripts/rcov.js vendor/plugins/embedded/assets/stylesheets/doxygen.css vendor/plugins/embedded/assets/stylesheets/javadoc.css vendor/plugins/embedded/assets/stylesheets/rcov.css vendor/plugins/embedded/init.rb vendor/plugins/embedded/lib/embedded.rb vendor/plugins/embedded/test/fixtures/html/app-controllers-account_controller_rb.html vendor/plugins/embedded/test/fixtures/html/index.html vendor/plugins/embedded/test/fixtures/html/misc/misc.html vendor/plugins/embedded/test/fixtures/html/misc/misc.txt vendor/plugins/embedded/test/functional/embedded_controller_test.rb vendor/plugins/embedded/test/test_helper.rb vendor/plugins/embedded/test/unit/embedded_test.rb vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.html.erb vendor/plugins/redmine_bibliography/README.rdoc vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb vendor/plugins/redmine_bibliography/app/controllers/authorships_controller.rb vendor/plugins/redmine_bibliography/app/controllers/bibtex_entries_controller.rb vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb vendor/plugins/redmine_bibliography/app/helpers/authorships_helper.rb vendor/plugins/redmine_bibliography/app/helpers/bibtex_entries_helper.rb vendor/plugins/redmine_bibliography/app/helpers/my_helper.rb vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb vendor/plugins/redmine_bibliography/app/models/author.rb vendor/plugins/redmine_bibliography/app/models/authorship.rb vendor/plugins/redmine_bibliography/app/models/bibtex_entry.rb vendor/plugins/redmine_bibliography/app/models/bibtex_entry_type.rb vendor/plugins/redmine_bibliography/app/models/publication.rb vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb vendor/plugins/redmine_bibliography/app/views/authors/show.html.erb vendor/plugins/redmine_bibliography/app/views/authorships/update.html.erb vendor/plugins/redmine_bibliography/app/views/mailer/publication_added.html.erb vendor/plugins/redmine_bibliography/app/views/mailer/publication_added.text.erb vendor/plugins/redmine_bibliography/app/views/my/blocks/_publications_box.html.erb vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb vendor/plugins/redmine_bibliography/app/views/projects/_publications_box.html.erb vendor/plugins/redmine_bibliography/app/views/projects/show.html.erb vendor/plugins/redmine_bibliography/app/views/publications/_add_project_form.html.erb vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb vendor/plugins/redmine_bibliography/app/views/publications/_identify_author_form.html.erb vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb vendor/plugins/redmine_bibliography/app/views/publications/_new_bibtex_step.html.erb vendor/plugins/redmine_bibliography/app/views/publications/_review_bibtex_step.html.erb vendor/plugins/redmine_bibliography/app/views/publications/add_project.rjs vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.html.erb vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_project.html.erb vendor/plugins/redmine_bibliography/app/views/publications/create.html.erb vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb vendor/plugins/redmine_bibliography/app/views/publications/import.html.erb vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb vendor/plugins/redmine_bibliography/app/views/publications/update.html.erb vendor/plugins/redmine_bibliography/app/views/settings/_bibliography.html.erb vendor/plugins/redmine_bibliography/app/views/users/show.html.erb vendor/plugins/redmine_bibliography/assets/javascripts/authors.js vendor/plugins/redmine_bibliography/assets/javascripts/bibtex.js vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css vendor/plugins/redmine_bibliography/config/locales/en.yml vendor/plugins/redmine_bibliography/config/routes.rb vendor/plugins/redmine_bibliography/db/migrate/001_create_authors.rb vendor/plugins/redmine_bibliography/db/migrate/002_create_publications.rb vendor/plugins/redmine_bibliography/db/migrate/003_create_authorships.rb vendor/plugins/redmine_bibliography/db/migrate/004_create_bibtex_entries.rb vendor/plugins/redmine_bibliography/db/migrate/005_create_projects_publications_join_table.rb vendor/plugins/redmine_bibliography/db/migrate/006_create_bibtex_entry_types.rb vendor/plugins/redmine_bibliography/db/migrate/007_add_external_url_column_to_publications.rb vendor/plugins/redmine_bibliography/db/migrate/008_add_doi_and_timestamp_columns_to_publications.rb vendor/plugins/redmine_bibliography/db/migrate/009_add_timestamp_columns_to_authors.rb vendor/plugins/redmine_bibliography/db/seed_data/bibtex_entry_types_list.txt vendor/plugins/redmine_bibliography/init.rb vendor/plugins/redmine_bibliography/lang/en.yml vendor/plugins/redmine_bibliography/lib/bibliography/mailer_patch.rb vendor/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb vendor/plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb vendor/plugins/redmine_bibliography/lib/tasks/seed_bibtex_entry_types.rake vendor/plugins/redmine_bibliography/test/fixtures/authors.yml vendor/plugins/redmine_bibliography/test/fixtures/authorships.yml vendor/plugins/redmine_bibliography/test/fixtures/bibtex_entries.yml vendor/plugins/redmine_bibliography/test/fixtures/publications.yml vendor/plugins/redmine_bibliography/test/functional/authors_controller_test.rb vendor/plugins/redmine_bibliography/test/functional/authorships_controller_test.rb vendor/plugins/redmine_bibliography/test/functional/publications_controller_test.rb vendor/plugins/redmine_bibliography/test/test_helper.rb vendor/plugins/redmine_bibliography/test/unit/author_test.rb vendor/plugins/redmine_bibliography/test/unit/authorship_test.rb vendor/plugins/redmine_bibliography/test/unit/bibtex_entry_test.rb vendor/plugins/redmine_bibliography/test/unit/publication_test.rb vendor/plugins/redmine_checkout/README.rdoc vendor/plugins/redmine_checkout/Rakefile vendor/plugins/redmine_checkout/app/views/projects/settings/_repository_checkout.html.erb vendor/plugins/redmine_checkout/app/views/projects/settings/_repository_checkout_protocol.html.erb vendor/plugins/redmine_checkout/app/views/redmine_checkout_hooks/_view_repositories_show_contextual.html.erb vendor/plugins/redmine_checkout/app/views/settings/_checkout.html.erb vendor/plugins/redmine_checkout/app/views/settings/_checkout_protocol.html.erb vendor/plugins/redmine_checkout/app/views/settings/_checkout_scm.html.erb vendor/plugins/redmine_checkout/app/views/settings/_redmine_checkout.html.erb vendor/plugins/redmine_checkout/assets/images/ZeroClipboard.as vendor/plugins/redmine_checkout/assets/images/ZeroClipboard.swf vendor/plugins/redmine_checkout/assets/images/button.svg vendor/plugins/redmine_checkout/assets/images/button_focus.svg vendor/plugins/redmine_checkout/assets/images/button_selected.svg vendor/plugins/redmine_checkout/assets/images/paste.png vendor/plugins/redmine_checkout/assets/javascripts/ZeroClipboard.js vendor/plugins/redmine_checkout/assets/javascripts/checkout.js vendor/plugins/redmine_checkout/assets/javascripts/subform.js vendor/plugins/redmine_checkout/assets/stylesheets/checkout.css vendor/plugins/redmine_checkout/assets/stylesheets/checkout_alternate.css vendor/plugins/redmine_checkout/config/locales/de.yml vendor/plugins/redmine_checkout/config/locales/en-GB.yml vendor/plugins/redmine_checkout/config/locales/en.yml vendor/plugins/redmine_checkout/config/locales/es.yml vendor/plugins/redmine_checkout/config/locales/fr.yml vendor/plugins/redmine_checkout/config/locales/it.yml vendor/plugins/redmine_checkout/config/locales/ja.yml vendor/plugins/redmine_checkout/config/locales/ko.yml vendor/plugins/redmine_checkout/config/locales/nl.yml vendor/plugins/redmine_checkout/config/locales/pl.yml vendor/plugins/redmine_checkout/config/locales/ro.yml vendor/plugins/redmine_checkout/db/migrate/20091208210439_add_checkout_url_info.rb vendor/plugins/redmine_checkout/db/migrate/20091220173312_add_display_login.rb vendor/plugins/redmine_checkout/db/migrate/20100118174556_add_render_link.rb vendor/plugins/redmine_checkout/db/migrate/20100118235845_remove_defaults.rb vendor/plugins/redmine_checkout/db/migrate/20100118235909_add_overwrite_option.rb vendor/plugins/redmine_checkout/db/migrate/20100203202320_update_settings.rb vendor/plugins/redmine_checkout/db/migrate/20100426154202_rename_render_link_to_render_type.rb vendor/plugins/redmine_checkout/db/migrate/20100512135418_consolidate_repository_options.rb vendor/plugins/redmine_checkout/db/migrate/20100609153630_apply_setting_changes.rb vendor/plugins/redmine_checkout/db/migrate/20100808185600_change_protocol_storage_from_hash_to_array.rb vendor/plugins/redmine_checkout/doc/COPYING vendor/plugins/redmine_checkout/init.rb vendor/plugins/redmine_checkout/lib/checkout/protocol.rb vendor/plugins/redmine_checkout/lib/checkout/repositories_helper_patch.rb vendor/plugins/redmine_checkout/lib/checkout/repository_hooks.rb vendor/plugins/redmine_checkout/lib/checkout/repository_patch.rb vendor/plugins/redmine_checkout/lib/checkout/setting_patch.rb vendor/plugins/redmine_checkout/lib/checkout/settings_controller_patch.rb vendor/plugins/redmine_checkout/lib/checkout/settings_helper_patch.rb vendor/plugins/redmine_checkout/lib/checkout_helper.rb vendor/plugins/redmine_checkout/lib/tasks/set_default.rake vendor/plugins/redmine_checkout/lib/tasks/spec.rake vendor/plugins/redmine_checkout/spec/controllers/repositories_controller_spec.rb vendor/plugins/redmine_checkout/spec/fixtures/enabled_modules.yml vendor/plugins/redmine_checkout/spec/fixtures/projects.yml vendor/plugins/redmine_checkout/spec/fixtures/repositories.yml vendor/plugins/redmine_checkout/spec/fixtures/roles.yml vendor/plugins/redmine_checkout/spec/fixtures/settings.yml vendor/plugins/redmine_checkout/spec/macros/macro_spec.rb vendor/plugins/redmine_checkout/spec/models/protocol_spec.rb vendor/plugins/redmine_checkout/spec/models/repository_spec.rb vendor/plugins/redmine_checkout/spec/models/setting_spec.rb vendor/plugins/redmine_checkout/spec/sanity_spec.rb vendor/plugins/redmine_checkout/spec/spec.opts vendor/plugins/redmine_checkout/spec/spec_helper.rb vendor/plugins/redmine_tags/COPYING vendor/plugins/redmine_tags/LICENSE vendor/plugins/redmine_tags/README.rdoc vendor/plugins/redmine_tags/app/helpers/filters_helper.rb vendor/plugins/redmine_tags/app/helpers/tags_helper.rb vendor/plugins/redmine_tags/app/views/auto_completes/_search_tag_list.html.erb vendor/plugins/redmine_tags/app/views/auto_completes/_tag_list.html.erb vendor/plugins/redmine_tags/app/views/issues/_tags.html.erb vendor/plugins/redmine_tags/app/views/issues/_tags_form.html.erb vendor/plugins/redmine_tags/app/views/issues/_tags_sidebar.html.erb vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb vendor/plugins/redmine_tags/app/views/projects/_filter_tags.html.erb vendor/plugins/redmine_tags/app/views/projects/_filtered_projects.html.erb vendor/plugins/redmine_tags/app/views/projects/_my_projects.html.erb vendor/plugins/redmine_tags/app/views/projects/_tagcloud.html.erb vendor/plugins/redmine_tags/app/views/projects/_tags.html.erb vendor/plugins/redmine_tags/app/views/projects/_tags_form.html.erb vendor/plugins/redmine_tags/app/views/projects/index.html.erb vendor/plugins/redmine_tags/app/views/tags/_settings.html.erb vendor/plugins/redmine_tags/assets/javascripts/projects_index.js vendor/plugins/redmine_tags/assets/javascripts/tags_input.js vendor/plugins/redmine_tags/assets/stylesheets/redmine_tags.css vendor/plugins/redmine_tags/config/locales/de.yml vendor/plugins/redmine_tags/config/locales/en.yml vendor/plugins/redmine_tags/config/locales/fr.yml vendor/plugins/redmine_tags/config/locales/ru.yml vendor/plugins/redmine_tags/config/routes.rb vendor/plugins/redmine_tags/db/migrate/001_acts_as_taggable_on_migration.rb vendor/plugins/redmine_tags/init.rb vendor/plugins/redmine_tags/lib/redmine_project_filtering.rb vendor/plugins/redmine_tags/lib/redmine_tags/hooks/model_issue_hook.rb vendor/plugins/redmine_tags/lib/redmine_tags/hooks/model_project_hook.rb vendor/plugins/redmine_tags/lib/redmine_tags/hooks/views_issues_hook.rb vendor/plugins/redmine_tags/lib/redmine_tags/hooks/views_projects_hook.rb vendor/plugins/redmine_tags/lib/redmine_tags/patches/auto_completes_controller_patch.rb vendor/plugins/redmine_tags/lib/redmine_tags/patches/issue_patch.rb vendor/plugins/redmine_tags/lib/redmine_tags/patches/issues_helper_patch.rb vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb vendor/plugins/redmine_tags/lib/redmine_tags/patches/queries_helper_patch.rb vendor/plugins/redmine_tags/lib/redmine_tags/patches/query_patch.rb |
diffstat | 412 files changed, 10367 insertions(+), 10367 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/COPYING Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/README Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,6 @@ +Embedded plugin for Redmine +Copyright (C) 2008 Jean-Philippe Lang + +The plugin lets you embed html pages (eg. documentation, test reports) in your projects. + +See: http://www.redmine.org/wiki/redmine/PluginEmbedded
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/RUNNING_TESTS Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +rake test:plugins PLUGIN=embedded
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/app/controllers/embedded_controller.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,112 @@ +# Redmine - project management software +# Copyright (C) 2008 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require 'iconv' + +class EmbeddedController < ApplicationController + class EmbeddedControllerError < StandardError; end + + unloadable + layout 'base' + before_filter :find_project, :authorize + + def index + path = get_real_path(params[:path]) + if File.directory?(path) + file = get_index_file(path) + target = params[:path] || [] + target << file + # Forces redirect to the index file when the requested path is a directory + # so that relative links in embedded html pages work + redirect_to :path => target + return + end + + # Check file extension + raise EmbeddedControllerError.new('This file can not be viewed (invalid extension).') unless Redmine::Plugins::Embedded.valid_extension?(path) + + if Redmine::MimeType.is_type?('image', path) + send_file path, :disposition => 'inline', :type => Redmine::MimeType.of(path) + else + embed_file path + end + + rescue Errno::ENOENT => e + # File was not found + render_404 + rescue Errno::EACCES => e + # Can not read the file + render_error "Unable to read the file: #{e.message}" + rescue EmbeddedControllerError => e + render_error e.message + end + + private + + def find_project + @project = Project.find(params[:id]) + rescue ActiveRecord::RecordNotFound + render_404 + end + + # Return the path to the html root directory for the current project + def get_project_directory + @project_directory ||= Setting.plugin_embedded['path'].to_s.gsub('{PROJECT}', @project.identifier) + end + + # Returns the absolute path of the requested file + # Parameter is an Array + def get_real_path(path) + real = get_project_directory + real = File.join(real, path) unless path.nil? || path.empty? + dir = File.expand_path(get_project_directory) + real = File.expand_path(real) + raise Errno::ENOENT unless real.starts_with?(dir) && File.exist?(real) + real + end + + # Returns the index file in the given directory + # and raises an exception if none is found + def get_index_file(dir) + indexes = Setting.plugin_embedded['index'].to_s.split + file = indexes.find {|f| File.exist?(File.join(dir, f))} + raise EmbeddedControllerError.new("No index file found in #{dir} (#{indexes.join(', ')}).") if file.nil? + file + end + + # Renders a given HTML file + def embed_file(path) + @content = File.read(path) + + # Extract html title from embedded page + if @content =~ %r{<title>([^<]*)</title>}mi + @title = $1.strip + end + + # Keep html body only + @content.gsub!(%r{^.*<body[^>]*>(.*)</body>.*$}mi, '\\1') + + # Re-encode content if needed + source_encoding = Setting.plugin_embedded['encoding'].to_s + unless source_encoding.blank? + begin; @content = Iconv.new('UTF-8', source_encoding).iconv(@content); rescue; end + end + + @doc_template = Redmine::Plugins::Embedded.detect_template_from_path(path) + render :action => 'index' + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/app/helpers/embedded_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,35 @@ +# Redmine - project management software +# Copyright (C) 2008 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +module EmbeddedHelper + + # Adds include tags for assets of the given template + def asset_include_tags(template) + + Redmine::Plugins::Embedded.assets(template).each { |asset| content_for(:header_tags) { asset_include_tag(asset) } } + end + + private + + def asset_include_tag(asset) + if asset =~ %r{\.js$} + javascript_include_tag(asset, :plugin => 'embedded') + else + stylesheet_link_tag(asset, :plugin => 'embedded') + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/app/views/embedded/index.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,9 @@ +<!-- Embedded page --> +<div class="embedded"> +<%= @content %> +</div> +<!-- Embedded page end --> + +<% html_title(@title) if @title %> + +<% asset_include_tags(@doc_template) %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/app/views/settings/_embedded.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,22 @@ +<p><label>HTML directory</label> +<%= text_field_tag 'settings[path]', @settings['path'], :size => 80 %> +<br /><em>Use {PROJECT} to include the project identifier in the path</em></p> + +<p><label>Index files</label> +<%= text_area_tag 'settings[index]', @settings['index'], :cols => 60, :rows => 3 %> +<br /><em>Space separated list of index files by priority</em></p> + +<p><label>Valid extensions</label> +<%= text_area_tag 'settings[extensions]', @settings['extensions'], :cols => 60, :rows => 3 %> +<br /><em>Space separated list of file extensions that can be viewed (case insensitive)</em></p> + +<p><label>Default template</label> +<%= select_tag 'settings[template]', options_for_select([''] + Redmine::Plugins::Embedded.available_templates, @settings['template']) %></p> + +<p><label>Files encoding</label> +<%= text_field_tag 'settings[encoding]', @settings['encoding'] %> +<br /><em>Eg. ISO-8859-1<br />Leave this field empty if HTML files are UTF-8 encoded</em></p> + +<p><label>Menu caption</label> +<%= text_field_tag 'settings[menu]', @settings['menu'], :size => 30 %> +<br /><em>Clear this field if you don't want to add a tab to the project menu</em></p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/assets/javascripts/rcov.js Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,18 @@ +function toggleCode( id ) { + if ( document.getElementById ) + elem = document.getElementById( id ); + else if ( document.all ) + elem = eval( "document.all." + id ); + else + return false; + + elemStyle = elem.style; + + if ( elemStyle.display != "block" ) { + elemStyle.display = "block" + } else { + elemStyle.display = "none" + } + + return true; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/assets/stylesheets/doxygen.css Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,174 @@ +#content { + font-family: Geneva, Arial, Helvetica, sans-serif; +} +#content h1, h2, h3 {border: 0;} +#content h1 {margin-bottom: 1em;} +#content CAPTION { font-weight: bold } +#content DIV.qindex { + line-height: 120%; + margin-bottom: 1em; +} +#content A.qindex { + text-decoration: none; + font-weight: bold; + padding: 2px; +} +#content A.qindexHL { + text-decoration: underline; + font-weight: bold; + padding: 2px; +} +#content A.el { text-decoration: none; font-weight: bold } +#content A.elRef { font-weight: bold } +#content A.code { text-decoration: none; font-weight: normal; color: #1A419D} +#content A.codeRef { font-weight: normal; color: #1A419D} +#content DL.el { margin-left: -1cm } +#content PRE.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + margin-top: 4px; + margin-bottom: 4px; + margin-left: 2px; + margin-right: 8px; + padding-left: 6px; + padding-right: 6px; + padding-top: 4px; + padding-bottom: 4px; +} +#content DIV.fragment { + border: 1px solid #CCCCCC; + background-color: #f5f5f5; + padding: 6px; +} +#content DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } +#content TD.md { background-color: #F4F4FB; font-weight: bold; } +#content TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } +#content TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } +#content DIV.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; + font-family: Geneva, Arial, Helvetica, sans-serif; +} +#content DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px } +#content TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +#content TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px; + border: 1px solid #CCCCCC; +} +#content TR.memlist { + background-color: #f0f0f0; +} +#content P.formulaDsp { text-align: center; } +#content IMG.formulaDsp { } +#content IMG.formulaInl { vertical-align: middle; } +#content SPAN.keyword { color: #008000 } +#content SPAN.keywordtype { color: #604020 } +#content SPAN.keywordflow { color: #e08000 } +#content SPAN.comment { color: #800000 } +#content SPAN.preprocessor { color: #806020 } +#content SPAN.stringliteral { color: #002080 } +#content SPAN.charliteral { color: #008080 } +#content .mdTable { + border: 1px solid #868686; + background-color: #F4F4FB; +} +#content .mdRow { + padding: 8px 10px; +} +#content .mdescLeft { + padding: 0px 8px 4px 8px; + font-size: 14px; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +#content .mdescRight { + padding: 0px 8px 4px 8px; + font-size: 14px; + font-style: italic; + background-color: #FAFAFA; + border-top: 1px none #E0E0E0; + border-right: 1px none #E0E0E0; + border-bottom: 1px none #E0E0E0; + border-left: 1px none #E0E0E0; + margin: 0px; +} +#content .memItemLeft { + padding: 1px 0px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-style: solid; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-family: Geneva, Arial, Helvetica, sans-serif; + font-size: 12px; +} +#content .memItemRight { + padding: 1px 8px 0px 8px; + margin: 4px; + border-top-width: 1px; + border-right-width: 1px; + border-bottom-width: 1px; + border-left-width: 1px; + border-top-style: solid; + border-top-color: #E0E0E0; + border-right-color: #E0E0E0; + border-bottom-color: #E0E0E0; + border-left-color: #E0E0E0; + border-right-style: none; + border-bottom-style: none; + border-left-style: none; + background-color: #FAFAFA; + font-family: Geneva, Arial, Helvetica, sans-serif; + font-size: 13px; +} +#content .search { color: #003399; + font-weight: bold; +} +#content FORM.search { + margin-bottom: 0px; + margin-top: 0px; +} +#content INPUT.search { font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #eeeeff; +} +#content TD.tiny { font-size: 75%; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/assets/stylesheets/javadoc.css Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,23 @@ +/* Javadoc style sheet */ + +/* Table colors */ +.TableHeadingColor { background: #eef; } /* Dark mauve */ +.TableHeadingColor th b { font-size: 70%; } +.TableSubHeadingColor { background: #EEEEee; } /* Light mauve */ +.TableRowColor { background: #FFFFFF; } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } +.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color: inherit; } /* Light mauve */ +.NavBarCell1Rev { background-color: inherit; } /* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; font-style: underline; } + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000; display: none;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} + +#content table { border-collapse: collapse; border-color: #ddd; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/assets/stylesheets/rcov.css Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,525 @@ +span.cross-ref-title { + font-size: 140%; +} +span.cross-ref a { + text-decoration: none; +} +span.cross-ref { + background-color:#f3f7fa; + border: 1px dashed #333; + margin: 1em; + padding: 0.5em; + overflow: hidden; +} +a.crossref-toggle { + text-decoration: none; +} +span.marked0 { + background-color: rgb(185, 210, 200); + display: block; +} +span.marked1 { + background-color: rgb(190, 215, 205); + display: block; +} +span.inferred0 { + background-color: rgb(175, 200, 200); + display: block; +} +span.inferred1 { + background-color: rgb(180, 205, 205); + display: block; +} +span.uncovered0 { + background-color: rgb(225, 110, 110); + display: block; +} +span.uncovered1 { + background-color: rgb(235, 120, 120); + display: block; +} +span.overview { + border-bottom: 8px solid black; +} +div.overview { + border-bottom: 8px solid black; +} +#content div.footer { + font-size: 68%; + margin-top: 1.5em; +} +#content h1, h2, h3, h4, h5, h6 { + margin-bottom: 0.5em; +} +h5 { + margin-top: 0.5em; +} +.hidden { + display: none; +} +div.separator { + height: 10px; +} +/* Commented out for better readability, esp. on IE */ +/* +table tr td, table tr th { + font-size: 68%; +} +td.value table tr td { + font-size: 11px; +} +*/ +table.percent_graph { + height: 12px; + border: #808080 1px solid; + empty-cells: show; +} +table.percent_graph td.covered { + height: 10px; + background: #00f000; +} +table.percent_graph td.uncovered { + height: 10px; + background: #e00000; +} +table.percent_graph td.NA { + height: 10px; + background: #eaeaea; +} +table.report { + border-collapse: collapse; + width: 100%; +} +table.report td.heading { + background: #dcecff; + border: #d0d0d0 1px solid; + font-weight: bold; + text-align: center; +} +table.report td.heading:hover { + background: #c0ffc0; +} +table.report td.text { + border: #d0d0d0 1px solid; +} +table.report td.value, +table.report td.lines_total, +table.report td.lines_code { + text-align: right; + border: #d0d0d0 1px solid; +} +table.report tr.light { + background-color: #f6f7f8; +} +table.report tr.dark { + background-color: #fff; +} +span.run0 { + background-color: rgb(178, 204, 255); + display: block; +} +span.run1 { + background-color: rgb(178, 206, 255); + display: block; +} +span.run2 { + background-color: rgb(178, 209, 255); + display: block; +} +span.run3 { + background-color: rgb(178, 211, 255); + display: block; +} +span.run4 { + background-color: rgb(178, 214, 255); + display: block; +} +span.run5 { + background-color: rgb(178, 218, 255); + display: block; +} +span.run6 { + background-color: rgb(178, 220, 255); + display: block; +} +span.run7 { + background-color: rgb(178, 223, 255); + display: block; +} +span.run8 { + background-color: rgb(178, 225, 255); + display: block; +} +span.run9 { + background-color: rgb(178, 228, 255); + display: block; +} +span.run10 { + background-color: rgb(178, 232, 255); + display: block; +} +span.run11 { + background-color: rgb(178, 234, 255); + display: block; +} +span.run12 { + background-color: rgb(178, 237, 255); + display: block; +} +span.run13 { + background-color: rgb(178, 239, 255); + display: block; +} +span.run14 { + background-color: rgb(178, 242, 255); + display: block; +} +span.run15 { + background-color: rgb(178, 246, 255); + display: block; +} +span.run16 { + background-color: rgb(178, 248, 255); + display: block; +} +span.run17 { + background-color: rgb(178, 251, 255); + display: block; +} +span.run18 { + background-color: rgb(178, 253, 255); + display: block; +} +span.run19 { + background-color: rgb(178, 255, 253); + display: block; +} +span.run20 { + background-color: rgb(178, 255, 249); + display: block; +} +span.run21 { + background-color: rgb(178, 255, 247); + display: block; +} +span.run22 { + background-color: rgb(178, 255, 244); + display: block; +} +span.run23 { + background-color: rgb(178, 255, 242); + display: block; +} +span.run24 { + background-color: rgb(178, 255, 239); + display: block; +} +span.run25 { + background-color: rgb(178, 255, 235); + display: block; +} +span.run26 { + background-color: rgb(178, 255, 233); + display: block; +} +span.run27 { + background-color: rgb(178, 255, 230); + display: block; +} +span.run28 { + background-color: rgb(178, 255, 228); + display: block; +} +span.run29 { + background-color: rgb(178, 255, 225); + display: block; +} +span.run30 { + background-color: rgb(178, 255, 221); + display: block; +} +span.run31 { + background-color: rgb(178, 255, 219); + display: block; +} +span.run32 { + background-color: rgb(178, 255, 216); + display: block; +} +span.run33 { + background-color: rgb(178, 255, 214); + display: block; +} +span.run34 { + background-color: rgb(178, 255, 211); + display: block; +} +span.run35 { + background-color: rgb(178, 255, 207); + display: block; +} +span.run36 { + background-color: rgb(178, 255, 205); + display: block; +} +span.run37 { + background-color: rgb(178, 255, 202); + display: block; +} +span.run38 { + background-color: rgb(178, 255, 200); + display: block; +} +span.run39 { + background-color: rgb(178, 255, 197); + display: block; +} +span.run40 { + background-color: rgb(178, 255, 193); + display: block; +} +span.run41 { + background-color: rgb(178, 255, 191); + display: block; +} +span.run42 { + background-color: rgb(178, 255, 188); + display: block; +} +span.run43 { + background-color: rgb(178, 255, 186); + display: block; +} +span.run44 { + background-color: rgb(178, 255, 183); + display: block; +} +span.run45 { + background-color: rgb(178, 255, 179); + display: block; +} +span.run46 { + background-color: rgb(179, 255, 178); + display: block; +} +span.run47 { + background-color: rgb(182, 255, 178); + display: block; +} +span.run48 { + background-color: rgb(184, 255, 178); + display: block; +} +span.run49 { + background-color: rgb(187, 255, 178); + display: block; +} +span.run50 { + background-color: rgb(191, 255, 178); + display: block; +} +span.run51 { + background-color: rgb(193, 255, 178); + display: block; +} +span.run52 { + background-color: rgb(196, 255, 178); + display: block; +} +span.run53 { + background-color: rgb(198, 255, 178); + display: block; +} +span.run54 { + background-color: rgb(201, 255, 178); + display: block; +} +span.run55 { + background-color: rgb(205, 255, 178); + display: block; +} +span.run56 { + background-color: rgb(207, 255, 178); + display: block; +} +span.run57 { + background-color: rgb(210, 255, 178); + display: block; +} +span.run58 { + background-color: rgb(212, 255, 178); + display: block; +} +span.run59 { + background-color: rgb(215, 255, 178); + display: block; +} +span.run60 { + background-color: rgb(219, 255, 178); + display: block; +} +span.run61 { + background-color: rgb(221, 255, 178); + display: block; +} +span.run62 { + background-color: rgb(224, 255, 178); + display: block; +} +span.run63 { + background-color: rgb(226, 255, 178); + display: block; +} +span.run64 { + background-color: rgb(229, 255, 178); + display: block; +} +span.run65 { + background-color: rgb(233, 255, 178); + display: block; +} +span.run66 { + background-color: rgb(235, 255, 178); + display: block; +} +span.run67 { + background-color: rgb(238, 255, 178); + display: block; +} +span.run68 { + background-color: rgb(240, 255, 178); + display: block; +} +span.run69 { + background-color: rgb(243, 255, 178); + display: block; +} +span.run70 { + background-color: rgb(247, 255, 178); + display: block; +} +span.run71 { + background-color: rgb(249, 255, 178); + display: block; +} +span.run72 { + background-color: rgb(252, 255, 178); + display: block; +} +span.run73 { + background-color: rgb(255, 255, 178); + display: block; +} +span.run74 { + background-color: rgb(255, 252, 178); + display: block; +} +span.run75 { + background-color: rgb(255, 248, 178); + display: block; +} +span.run76 { + background-color: rgb(255, 246, 178); + display: block; +} +span.run77 { + background-color: rgb(255, 243, 178); + display: block; +} +span.run78 { + background-color: rgb(255, 240, 178); + display: block; +} +span.run79 { + background-color: rgb(255, 238, 178); + display: block; +} +span.run80 { + background-color: rgb(255, 234, 178); + display: block; +} +span.run81 { + background-color: rgb(255, 232, 178); + display: block; +} +span.run82 { + background-color: rgb(255, 229, 178); + display: block; +} +span.run83 { + background-color: rgb(255, 226, 178); + display: block; +} +span.run84 { + background-color: rgb(255, 224, 178); + display: block; +} +span.run85 { + background-color: rgb(255, 220, 178); + display: block; +} +span.run86 { + background-color: rgb(255, 218, 178); + display: block; +} +span.run87 { + background-color: rgb(255, 215, 178); + display: block; +} +span.run88 { + background-color: rgb(255, 212, 178); + display: block; +} +span.run89 { + background-color: rgb(255, 210, 178); + display: block; +} +span.run90 { + background-color: rgb(255, 206, 178); + display: block; +} +span.run91 { + background-color: rgb(255, 204, 178); + display: block; +} +span.run92 { + background-color: rgb(255, 201, 178); + display: block; +} +span.run93 { + background-color: rgb(255, 198, 178); + display: block; +} +span.run94 { + background-color: rgb(255, 196, 178); + display: block; +} +span.run95 { + background-color: rgb(255, 192, 178); + display: block; +} +span.run96 { + background-color: rgb(255, 189, 178); + display: block; +} +span.run97 { + background-color: rgb(255, 187, 178); + display: block; +} +span.run98 { + background-color: rgb(255, 184, 178); + display: block; +} +span.run99 { + background-color: rgb(255, 182, 178); + display: block; +} +span.run100 { + background-color: rgb(255, 178, 178); + display: block; +} +pre { + white-space: pre-wrap; /* CSS2.1 compliant */ + white-space: -moz-pre-wrap; /* Mozilla-based browsers */ + white-space: -o-pre-wrap; /* Opera 7+ */ +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/init.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,33 @@ +require 'redmine' +require 'embedded' + +Redmine::Plugin.register :embedded do + name 'Embedded' + author 'Jean-Philippe Lang' + description 'Embed various documentations in your projects' + version '0.0.1' + settings :default => { 'path' => '/var/doc/{PROJECT}/html', + 'index' => 'main.html overview-summary.html index.html', + 'extensions' => 'html png gif', + 'template' => '', + 'encoding' => '', + 'menu' => 'Embedded' }, + :partial => 'settings/embedded' + + project_module :embedded do + permission :view_embedded_doc, {:embedded => :index} + end + + menu :project_menu, :embedded, { :controller => 'embedded', :action => 'index', :path => nil }, + :caption => Proc.new { Setting.plugin_embedded['menu'] }, + :if => Proc.new { !Setting.plugin_embedded['menu'].blank? } +end + +# Routes +class << ActionController::Routing::Routes;self;end.class_eval do + define_method :clear!, lambda {} +end + +ActionController::Routing::Routes.draw do |map| + map.connect 'embedded/:id/*path', :controller => 'embedded', :action => 'index' +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/lib/embedded.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,64 @@ +# Redmine - project management software +# Copyright (C) 2008 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +module Redmine + module Plugins + module Embedded + class << self + + # Returns an Array of available templates + def available_templates + assets_by_template.keys.sort + end + + # Returns the assets for a given template + def assets(template) + assets_by_template.has_key?(template) ? assets_by_template[template] : [] + end + + def detect_template_from_path(path) + t = path.to_s.split(%r{[/\\]}) & available_templates + t.empty? ? Setting.plugin_embedded['template'].to_s : t.first + end + + def valid_extension?(path) + extensions = Setting.plugin_embedded['extensions'].to_s.split.each(&:downcase) + extensions.include?(File.extname(path).downcase[1..-1]) + end + + private + + # A Hash of available assets by template + def assets_by_template + @@assets_by_template ||= scan_assets + end + + # Scans assets directory for templates + # and returns a Hash of available assets by template + def scan_assets + a = Hash.new {|h,k| h[k] = [] } + Dir.glob(File.join(File.dirname(__FILE__), '../assets/*/*.{css,js}')).each do |asset| + asset = File.basename(asset) + template = asset.gsub(%r{\.(js|css)$}, '') + a[template] << asset + end + a + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/test/fixtures/html/app-controllers-account_controller_rb.html Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,783 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><title>app/controllers/account_controller.rb - C0 code coverage information</title> + <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style> + <style type='text/css'>span.cross-ref-title { + font-size: 140%; +} +span.cross-ref a { + text-decoration: none; +} +span.cross-ref { + background-color:#f3f7fa; + border: 1px dashed #333; + margin: 1em; + padding: 0.5em; + overflow: hidden; +} +a.crossref-toggle { + text-decoration: none; +} +span.marked0 { + background-color: rgb(185, 210, 200); + display: block; +} +span.marked1 { + background-color: rgb(190, 215, 205); + display: block; +} +span.inferred0 { + background-color: rgb(175, 200, 200); + display: block; +} +span.inferred1 { + background-color: rgb(180, 205, 205); + display: block; +} +span.uncovered0 { + background-color: rgb(225, 110, 110); + display: block; +} +span.uncovered1 { + background-color: rgb(235, 120, 120); + display: block; +} +span.overview { + border-bottom: 8px solid black; +} +div.overview { + border-bottom: 8px solid black; +} +body { + font-family: verdana, arial, helvetica; +} +div.footer { + font-size: 68%; + margin-top: 1.5em; +} +h1, h2, h3, h4, h5, h6 { + margin-bottom: 0.5em; +} +h5 { + margin-top: 0.5em; +} +.hidden { + display: none; +} +div.separator { + height: 10px; +} +/* Commented out for better readability, esp. on IE */ +/* +table tr td, table tr th { + font-size: 68%; +} +td.value table tr td { + font-size: 11px; +} +*/ +table.percent_graph { + height: 12px; + border: #808080 1px solid; + empty-cells: show; +} +table.percent_graph td.covered { + height: 10px; + background: #00f000; +} +table.percent_graph td.uncovered { + height: 10px; + background: #e00000; +} +table.percent_graph td.NA { + height: 10px; + background: #eaeaea; +} +table.report { + border-collapse: collapse; + width: 100%; +} +table.report td.heading { + background: #dcecff; + border: #d0d0d0 1px solid; + font-weight: bold; + text-align: center; +} +table.report td.heading:hover { + background: #c0ffc0; +} +table.report td.text { + border: #d0d0d0 1px solid; +} +table.report td.value, +table.report td.lines_total, +table.report td.lines_code { + text-align: right; + border: #d0d0d0 1px solid; +} +table.report tr.light { + background-color: rgb(240, 240, 245); +} +table.report tr.dark { + background-color: rgb(230, 230, 235); +} +</style> + <script type='text/javascript'> +// <![CDATA[ + function toggleCode( id ) { + if ( document.getElementById ) + elem = document.getElementById( id ); + else if ( document.all ) + elem = eval( "document.all." + id ); + else + return false; + + elemStyle = elem.style; + + if ( elemStyle.display != "block" ) { + elemStyle.display = "block" + } else { + elemStyle.display = "none" + } + + return true; + } + + // Make cross-references hidden by default + document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" ) + // ]]> +</script> + <style type='text/css'>span.run0 { + background-color: rgb(178, 204, 255); + display: block; +} +span.run1 { + background-color: rgb(178, 206, 255); + display: block; +} +span.run2 { + background-color: rgb(178, 209, 255); + display: block; +} +span.run3 { + background-color: rgb(178, 211, 255); + display: block; +} +span.run4 { + background-color: rgb(178, 214, 255); + display: block; +} +span.run5 { + background-color: rgb(178, 218, 255); + display: block; +} +span.run6 { + background-color: rgb(178, 220, 255); + display: block; +} +span.run7 { + background-color: rgb(178, 223, 255); + display: block; +} +span.run8 { + background-color: rgb(178, 225, 255); + display: block; +} +span.run9 { + background-color: rgb(178, 228, 255); + display: block; +} +span.run10 { + background-color: rgb(178, 232, 255); + display: block; +} +span.run11 { + background-color: rgb(178, 234, 255); + display: block; +} +span.run12 { + background-color: rgb(178, 237, 255); + display: block; +} +span.run13 { + background-color: rgb(178, 239, 255); + display: block; +} +span.run14 { + background-color: rgb(178, 242, 255); + display: block; +} +span.run15 { + background-color: rgb(178, 246, 255); + display: block; +} +span.run16 { + background-color: rgb(178, 248, 255); + display: block; +} +span.run17 { + background-color: rgb(178, 251, 255); + display: block; +} +span.run18 { + background-color: rgb(178, 253, 255); + display: block; +} +span.run19 { + background-color: rgb(178, 255, 253); + display: block; +} +span.run20 { + background-color: rgb(178, 255, 249); + display: block; +} +span.run21 { + background-color: rgb(178, 255, 247); + display: block; +} +span.run22 { + background-color: rgb(178, 255, 244); + display: block; +} +span.run23 { + background-color: rgb(178, 255, 242); + display: block; +} +span.run24 { + background-color: rgb(178, 255, 239); + display: block; +} +span.run25 { + background-color: rgb(178, 255, 235); + display: block; +} +span.run26 { + background-color: rgb(178, 255, 233); + display: block; +} +span.run27 { + background-color: rgb(178, 255, 230); + display: block; +} +span.run28 { + background-color: rgb(178, 255, 228); + display: block; +} +span.run29 { + background-color: rgb(178, 255, 225); + display: block; +} +span.run30 { + background-color: rgb(178, 255, 221); + display: block; +} +span.run31 { + background-color: rgb(178, 255, 219); + display: block; +} +span.run32 { + background-color: rgb(178, 255, 216); + display: block; +} +span.run33 { + background-color: rgb(178, 255, 214); + display: block; +} +span.run34 { + background-color: rgb(178, 255, 211); + display: block; +} +span.run35 { + background-color: rgb(178, 255, 207); + display: block; +} +span.run36 { + background-color: rgb(178, 255, 205); + display: block; +} +span.run37 { + background-color: rgb(178, 255, 202); + display: block; +} +span.run38 { + background-color: rgb(178, 255, 200); + display: block; +} +span.run39 { + background-color: rgb(178, 255, 197); + display: block; +} +span.run40 { + background-color: rgb(178, 255, 193); + display: block; +} +span.run41 { + background-color: rgb(178, 255, 191); + display: block; +} +span.run42 { + background-color: rgb(178, 255, 188); + display: block; +} +span.run43 { + background-color: rgb(178, 255, 186); + display: block; +} +span.run44 { + background-color: rgb(178, 255, 183); + display: block; +} +span.run45 { + background-color: rgb(178, 255, 179); + display: block; +} +span.run46 { + background-color: rgb(179, 255, 178); + display: block; +} +span.run47 { + background-color: rgb(182, 255, 178); + display: block; +} +span.run48 { + background-color: rgb(184, 255, 178); + display: block; +} +span.run49 { + background-color: rgb(187, 255, 178); + display: block; +} +span.run50 { + background-color: rgb(191, 255, 178); + display: block; +} +span.run51 { + background-color: rgb(193, 255, 178); + display: block; +} +span.run52 { + background-color: rgb(196, 255, 178); + display: block; +} +span.run53 { + background-color: rgb(198, 255, 178); + display: block; +} +span.run54 { + background-color: rgb(201, 255, 178); + display: block; +} +span.run55 { + background-color: rgb(205, 255, 178); + display: block; +} +span.run56 { + background-color: rgb(207, 255, 178); + display: block; +} +span.run57 { + background-color: rgb(210, 255, 178); + display: block; +} +span.run58 { + background-color: rgb(212, 255, 178); + display: block; +} +span.run59 { + background-color: rgb(215, 255, 178); + display: block; +} +span.run60 { + background-color: rgb(219, 255, 178); + display: block; +} +span.run61 { + background-color: rgb(221, 255, 178); + display: block; +} +span.run62 { + background-color: rgb(224, 255, 178); + display: block; +} +span.run63 { + background-color: rgb(226, 255, 178); + display: block; +} +span.run64 { + background-color: rgb(229, 255, 178); + display: block; +} +span.run65 { + background-color: rgb(233, 255, 178); + display: block; +} +span.run66 { + background-color: rgb(235, 255, 178); + display: block; +} +span.run67 { + background-color: rgb(238, 255, 178); + display: block; +} +span.run68 { + background-color: rgb(240, 255, 178); + display: block; +} +span.run69 { + background-color: rgb(243, 255, 178); + display: block; +} +span.run70 { + background-color: rgb(247, 255, 178); + display: block; +} +span.run71 { + background-color: rgb(249, 255, 178); + display: block; +} +span.run72 { + background-color: rgb(252, 255, 178); + display: block; +} +span.run73 { + background-color: rgb(255, 255, 178); + display: block; +} +span.run74 { + background-color: rgb(255, 252, 178); + display: block; +} +span.run75 { + background-color: rgb(255, 248, 178); + display: block; +} +span.run76 { + background-color: rgb(255, 246, 178); + display: block; +} +span.run77 { + background-color: rgb(255, 243, 178); + display: block; +} +span.run78 { + background-color: rgb(255, 240, 178); + display: block; +} +span.run79 { + background-color: rgb(255, 238, 178); + display: block; +} +span.run80 { + background-color: rgb(255, 234, 178); + display: block; +} +span.run81 { + background-color: rgb(255, 232, 178); + display: block; +} +span.run82 { + background-color: rgb(255, 229, 178); + display: block; +} +span.run83 { + background-color: rgb(255, 226, 178); + display: block; +} +span.run84 { + background-color: rgb(255, 224, 178); + display: block; +} +span.run85 { + background-color: rgb(255, 220, 178); + display: block; +} +span.run86 { + background-color: rgb(255, 218, 178); + display: block; +} +span.run87 { + background-color: rgb(255, 215, 178); + display: block; +} +span.run88 { + background-color: rgb(255, 212, 178); + display: block; +} +span.run89 { + background-color: rgb(255, 210, 178); + display: block; +} +span.run90 { + background-color: rgb(255, 206, 178); + display: block; +} +span.run91 { + background-color: rgb(255, 204, 178); + display: block; +} +span.run92 { + background-color: rgb(255, 201, 178); + display: block; +} +span.run93 { + background-color: rgb(255, 198, 178); + display: block; +} +span.run94 { + background-color: rgb(255, 196, 178); + display: block; +} +span.run95 { + background-color: rgb(255, 192, 178); + display: block; +} +span.run96 { + background-color: rgb(255, 189, 178); + display: block; +} +span.run97 { + background-color: rgb(255, 187, 178); + display: block; +} +span.run98 { + background-color: rgb(255, 184, 178); + display: block; +} +span.run99 { + background-color: rgb(255, 182, 178); + display: block; +} +span.run100 { + background-color: rgb(255, 178, 178); + display: block; +} +</style> + </head> + <body><h3>C0 code coverage information</h3> + <p>Generated on Tue Jun 24 21:43:53 +0200 2008 with <a href='http://eigenclass.org/hiki/rcov'>rcov 0.8.1.2</a> + </p> + <hr/> + <pre><span class='marked0'>Code reported as executed by Ruby looks like this... +</span><span class='marked1'>and this: this line is also marked as covered. +</span><span class='inferred0'>Lines considered as run by rcov, but not reported by Ruby, look like this, +</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics). +</span><span class='uncovered0'>Finally, here's a line marked as not executed. +</span></pre> +<table class='report'><thead><tr><td class='heading'>Name</td> + <td class='heading'>Total lines</td> + <td class='heading'>Lines of code</td> + <td class='heading'>Total coverage</td> + <td class='heading'>Code coverage</td> + </tr> + </thead> + <tbody><tr class='light'><td><a href='app-controllers-account_controller_rb.html'>app/controllers/account_controller.rb</a> + </td> + <td class='lines_total'><tt>173</tt> + </td> + <td class='lines_code'><tt>129</tt> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>98.8%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='99'/> + <td class='uncovered' width='1'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>98.4%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='98'/> + <td class='uncovered' width='2'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + </tbody> + </table> +<pre><span class="inferred0"><a name="line1"></a> 1 # redMine - project management software +</span><span class="inferred1"><a name="line2"></a> 2 # Copyright (C) 2006-2007 Jean-Philippe Lang +</span><span class="inferred0"><a name="line3"></a> 3 # +</span><span class="inferred1"><a name="line4"></a> 4 # This program is free software; you can redistribute it and/or +</span><span class="inferred0"><a name="line5"></a> 5 # modify it under the terms of the GNU General Public License +</span><span class="inferred1"><a name="line6"></a> 6 # as published by the Free Software Foundation; either version 2 +</span><span class="inferred0"><a name="line7"></a> 7 # of the License, or (at your option) any later version. +</span><span class="inferred1"><a name="line8"></a> 8 # +</span><span class="inferred0"><a name="line9"></a> 9 # This program is distributed in the hope that it will be useful, +</span><span class="inferred1"><a name="line10"></a> 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of +</span><span class="inferred0"><a name="line11"></a> 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +</span><span class="inferred1"><a name="line12"></a> 12 # GNU General Public License for more details. +</span><span class="inferred0"><a name="line13"></a> 13 # +</span><span class="inferred1"><a name="line14"></a> 14 # You should have received a copy of the GNU General Public License +</span><span class="inferred0"><a name="line15"></a> 15 # along with this program; if not, write to the Free Software +</span><span class="inferred1"><a name="line16"></a> 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +</span><span class="inferred0"><a name="line17"></a> 17 +</span><span class="marked1"><a name="line18"></a> 18 class AccountController < ApplicationController +</span><span class="marked0"><a name="line19"></a> 19 layout 'base' +</span><span class="marked1"><a name="line20"></a> 20 helper :custom_fields +</span><span class="marked0"><a name="line21"></a> 21 include CustomFieldsHelper +</span><span class="inferred1"><a name="line22"></a> 22 +</span><span class="inferred0"><a name="line23"></a> 23 # prevents login action to be filtered by check_if_login_required application scope filter +</span><span class="marked1"><a name="line24"></a> 24 skip_before_filter :check_if_login_required, :only => [:login, :lost_password, :register, :activate] +</span><span class="inferred0"><a name="line25"></a> 25 +</span><span class="inferred1"><a name="line26"></a> 26 # Show user's account +</span><span class="marked0"><a name="line27"></a> 27 def show +</span><span class="marked1"><a name="line28"></a> 28 @user = User.find_active(params[:id]) +</span><span class="marked0"><a name="line29"></a> 29 @custom_values = @user.custom_values.find(:all, :include => :custom_field) +</span><span class="inferred1"><a name="line30"></a> 30 +</span><span class="inferred0"><a name="line31"></a> 31 # show only public projects and private projects that the logged in user is also a member of +</span><span class="marked1"><a name="line32"></a> 32 @memberships = @user.memberships.select do |membership| +</span><span class="marked0"><a name="line33"></a> 33 membership.project.is_public? || (User.current.member_of?(membership.project)) +</span><span class="inferred1"><a name="line34"></a> 34 end +</span><span class="inferred0"><a name="line35"></a> 35 rescue ActiveRecord::RecordNotFound +</span><span class="marked1"><a name="line36"></a> 36 render_404 +</span><span class="marked0"><a name="line37"></a> 37 end +</span><span class="inferred1"><a name="line38"></a> 38 +</span><span class="inferred0"><a name="line39"></a> 39 # Login request and validation +</span><span class="marked1"><a name="line40"></a> 40 def login +</span><span class="marked0"><a name="line41"></a> 41 if request.get? +</span><span class="inferred1"><a name="line42"></a> 42 # Logout user +</span><span class="marked0"><a name="line43"></a> 43 self.logged_user = nil +</span><span class="inferred1"><a name="line44"></a> 44 else +</span><span class="inferred0"><a name="line45"></a> 45 # Authenticate user +</span><span class="marked1"><a name="line46"></a> 46 user = User.try_to_login(params[:username], params[:password]) +</span><span class="marked0"><a name="line47"></a> 47 if user +</span><span class="marked1"><a name="line48"></a> 48 self.logged_user = user +</span><span class="inferred0"><a name="line49"></a> 49 # generate a key and set cookie if autologin +</span><span class="marked1"><a name="line50"></a> 50 if params[:autologin] && Setting.autologin? +</span><span class="marked0"><a name="line51"></a> 51 token = Token.create(:user => user, :action => 'autologin') +</span><span class="marked1"><a name="line52"></a> 52 cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now } +</span><span class="inferred0"><a name="line53"></a> 53 end +</span><span class="marked1"><a name="line54"></a> 54 redirect_back_or_default :controller => 'my', :action => 'page' +</span><span class="inferred0"><a name="line55"></a> 55 else +</span><span class="marked1"><a name="line56"></a> 56 flash.now[:error] = l(:notice_account_invalid_creditentials) +</span><span class="inferred0"><a name="line57"></a> 57 end +</span><span class="inferred1"><a name="line58"></a> 58 end +</span><span class="uncovered0"><a name="line59"></a> 59 rescue User::OnTheFlyCreationFailure +</span><span class="uncovered1"><a name="line60"></a> 60 flash.now[:error] = 'Redmine could not retrieve the required information from the LDAP to create your account. Please, contact your Redmine administrator.' +</span><span class="marked0"><a name="line61"></a> 61 end +</span><span class="inferred1"><a name="line62"></a> 62 +</span><span class="inferred0"><a name="line63"></a> 63 # Log out current user and redirect to welcome page +</span><span class="marked1"><a name="line64"></a> 64 def logout +</span><span class="marked0"><a name="line65"></a> 65 cookies.delete :autologin +</span><span class="marked1"><a name="line66"></a> 66 Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged? +</span><span class="marked0"><a name="line67"></a> 67 self.logged_user = nil +</span><span class="marked1"><a name="line68"></a> 68 redirect_to home_url +</span><span class="inferred0"><a name="line69"></a> 69 end +</span><span class="inferred1"><a name="line70"></a> 70 +</span><span class="inferred0"><a name="line71"></a> 71 # Enable user to choose a new password +</span><span class="marked1"><a name="line72"></a> 72 def lost_password +</span><span class="marked0"><a name="line73"></a> 73 redirect_to(home_url) && return unless Setting.lost_password? +</span><span class="marked1"><a name="line74"></a> 74 if params[:token] +</span><span class="marked0"><a name="line75"></a> 75 @token = Token.find_by_action_and_value("recovery", params[:token]) +</span><span class="marked1"><a name="line76"></a> 76 redirect_to(home_url) && return unless @token and !@token.expired? +</span><span class="marked0"><a name="line77"></a> 77 @user = @token.user +</span><span class="marked1"><a name="line78"></a> 78 if request.post? +</span><span class="marked0"><a name="line79"></a> 79 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] +</span><span class="marked1"><a name="line80"></a> 80 if @user.save +</span><span class="marked0"><a name="line81"></a> 81 @token.destroy +</span><span class="marked1"><a name="line82"></a> 82 flash[:notice] = l(:notice_account_password_updated) +</span><span class="marked0"><a name="line83"></a> 83 redirect_to :action => 'login' +</span><span class="marked1"><a name="line84"></a> 84 return +</span><span class="inferred0"><a name="line85"></a> 85 end +</span><span class="inferred1"><a name="line86"></a> 86 end +</span><span class="marked0"><a name="line87"></a> 87 render :template => "account/password_recovery" +</span><span class="marked1"><a name="line88"></a> 88 return +</span><span class="inferred0"><a name="line89"></a> 89 else +</span><span class="marked1"><a name="line90"></a> 90 if request.post? +</span><span class="marked0"><a name="line91"></a> 91 user = User.find_by_mail(params[:mail]) +</span><span class="inferred1"><a name="line92"></a> 92 # user not found in db +</span><span class="marked0"><a name="line93"></a> 93 flash.now[:error] = l(:notice_account_unknown_email) and return unless user +</span><span class="inferred1"><a name="line94"></a> 94 # user uses an external authentification +</span><span class="marked0"><a name="line95"></a> 95 flash.now[:error] = l(:notice_can_t_change_password) and return if user.auth_source_id +</span><span class="inferred1"><a name="line96"></a> 96 # create a new token for password recovery +</span><span class="marked0"><a name="line97"></a> 97 token = Token.new(:user => user, :action => "recovery") +</span><span class="marked1"><a name="line98"></a> 98 if token.save +</span><span class="marked0"><a name="line99"></a> 99 Mailer.deliver_lost_password(token) +</span><span class="marked1"><a name="line100"></a>100 flash[:notice] = l(:notice_account_lost_email_sent) +</span><span class="marked0"><a name="line101"></a>101 redirect_to :action => 'login' +</span><span class="marked1"><a name="line102"></a>102 return +</span><span class="inferred0"><a name="line103"></a>103 end +</span><span class="inferred1"><a name="line104"></a>104 end +</span><span class="inferred0"><a name="line105"></a>105 end +</span><span class="inferred1"><a name="line106"></a>106 end +</span><span class="inferred0"><a name="line107"></a>107 +</span><span class="inferred1"><a name="line108"></a>108 # User self-registration +</span><span class="marked0"><a name="line109"></a>109 def register +</span><span class="marked1"><a name="line110"></a>110 redirect_to(home_url) && return unless Setting.self_registration? +</span><span class="marked0"><a name="line111"></a>111 if request.get? +</span><span class="marked1"><a name="line112"></a>112 @user = User.new(:language => Setting.default_language) +</span><span class="inferred0"><a name="line113"></a>113 else +</span><span class="marked1"><a name="line114"></a>114 @user = User.new(params[:user]) +</span><span class="marked0"><a name="line115"></a>115 @user.admin = false +</span><span class="marked1"><a name="line116"></a>116 @user.login = params[:user][:login] +</span><span class="marked0"><a name="line117"></a>117 @user.status = User::STATUS_REGISTERED +</span><span class="marked1"><a name="line118"></a>118 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] +</span><span class="marked0"><a name="line119"></a>119 case Setting.self_registration +</span><span class="marked1"><a name="line120"></a>120 when '1' +</span><span class="inferred0"><a name="line121"></a>121 # Email activation +</span><span class="marked1"><a name="line122"></a>122 token = Token.new(:user => @user, :action => "register") +</span><span class="marked0"><a name="line123"></a>123 if @user.save and token.save +</span><span class="marked1"><a name="line124"></a>124 Mailer.deliver_register(token) +</span><span class="marked0"><a name="line125"></a>125 flash[:notice] = l(:notice_account_register_done) +</span><span class="marked1"><a name="line126"></a>126 redirect_to :action => 'login' +</span><span class="inferred0"><a name="line127"></a>127 end +</span><span class="marked1"><a name="line128"></a>128 when '3' +</span><span class="inferred0"><a name="line129"></a>129 # Automatic activation +</span><span class="marked1"><a name="line130"></a>130 @user.status = User::STATUS_ACTIVE +</span><span class="marked0"><a name="line131"></a>131 if @user.save +</span><span class="marked1"><a name="line132"></a>132 self.logged_user = @user +</span><span class="marked0"><a name="line133"></a>133 flash[:notice] = l(:notice_account_activated) +</span><span class="marked1"><a name="line134"></a>134 redirect_to :controller => 'my', :action => 'account' +</span><span class="inferred0"><a name="line135"></a>135 end +</span><span class="inferred1"><a name="line136"></a>136 else +</span><span class="inferred0"><a name="line137"></a>137 # Manual activation by the administrator +</span><span class="marked1"><a name="line138"></a>138 if @user.save +</span><span class="inferred0"><a name="line139"></a>139 # Sends an email to the administrators +</span><span class="marked1"><a name="line140"></a>140 Mailer.deliver_account_activation_request(@user) +</span><span class="marked0"><a name="line141"></a>141 flash[:notice] = l(:notice_account_pending) +</span><span class="marked1"><a name="line142"></a>142 redirect_to :action => 'login' +</span><span class="inferred0"><a name="line143"></a>143 end +</span><span class="inferred1"><a name="line144"></a>144 end +</span><span class="inferred0"><a name="line145"></a>145 end +</span><span class="inferred1"><a name="line146"></a>146 end +</span><span class="inferred0"><a name="line147"></a>147 +</span><span class="inferred1"><a name="line148"></a>148 # Token based account activation +</span><span class="marked0"><a name="line149"></a>149 def activate +</span><span class="marked1"><a name="line150"></a>150 redirect_to(home_url) && return unless Setting.self_registration? && params[:token] +</span><span class="marked0"><a name="line151"></a>151 token = Token.find_by_action_and_value('register', params[:token]) +</span><span class="marked1"><a name="line152"></a>152 redirect_to(home_url) && return unless token and !token.expired? +</span><span class="marked0"><a name="line153"></a>153 user = token.user +</span><span class="marked1"><a name="line154"></a>154 redirect_to(home_url) && return unless user.status == User::STATUS_REGISTERED +</span><span class="marked0"><a name="line155"></a>155 user.status = User::STATUS_ACTIVE +</span><span class="marked1"><a name="line156"></a>156 if user.save +</span><span class="marked0"><a name="line157"></a>157 token.destroy +</span><span class="marked1"><a name="line158"></a>158 flash[:notice] = l(:notice_account_activated) +</span><span class="inferred0"><a name="line159"></a>159 end +</span><span class="marked1"><a name="line160"></a>160 redirect_to :action => 'login' +</span><span class="inferred0"><a name="line161"></a>161 end +</span><span class="inferred1"><a name="line162"></a>162 +</span><span class="marked0"><a name="line163"></a>163 private +</span><span class="marked1"><a name="line164"></a>164 def logged_user=(user) +</span><span class="marked0"><a name="line165"></a>165 if user && user.is_a?(User) +</span><span class="marked1"><a name="line166"></a>166 User.current = user +</span><span class="marked0"><a name="line167"></a>167 session[:user_id] = user.id +</span><span class="inferred1"><a name="line168"></a>168 else +</span><span class="marked0"><a name="line169"></a>169 User.current = User.anonymous +</span><span class="marked1"><a name="line170"></a>170 session[:user_id] = nil +</span><span class="inferred0"><a name="line171"></a>171 end +</span><span class="marked1"><a name="line172"></a>172 end +</span><span class="inferred0"><a name="line173"></a>173 end +</span></pre><hr/> + <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> + version 0.8.1.2.</p> +<p><a href='http://validator.w3.org/check/referer'><img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88'/> + </a> + <a href='http://jigsaw.w3.org/css-validator/check/referer'><img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px'/> + </a> + </p> + </body> + </html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/test/fixtures/html/index.html Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,306 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><title>C0 code coverage information</title> + <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style> + <style type='text/css'>span.cross-ref-title { + font-size: 140%; +} +span.cross-ref a { + text-decoration: none; +} +span.cross-ref { + background-color:#f3f7fa; + border: 1px dashed #333; + margin: 1em; + padding: 0.5em; + overflow: hidden; +} +a.crossref-toggle { + text-decoration: none; +} +span.marked0 { + background-color: rgb(185, 210, 200); + display: block; +} +span.marked1 { + background-color: rgb(190, 215, 205); + display: block; +} +span.inferred0 { + background-color: rgb(175, 200, 200); + display: block; +} +span.inferred1 { + background-color: rgb(180, 205, 205); + display: block; +} +span.uncovered0 { + background-color: rgb(225, 110, 110); + display: block; +} +span.uncovered1 { + background-color: rgb(235, 120, 120); + display: block; +} +span.overview { + border-bottom: 8px solid black; +} +div.overview { + border-bottom: 8px solid black; +} +body { + font-family: verdana, arial, helvetica; +} +div.footer { + font-size: 68%; + margin-top: 1.5em; +} +h1, h2, h3, h4, h5, h6 { + margin-bottom: 0.5em; +} +h5 { + margin-top: 0.5em; +} +.hidden { + display: none; +} +div.separator { + height: 10px; +} +/* Commented out for better readability, esp. on IE */ +/* +table tr td, table tr th { + font-size: 68%; +} +td.value table tr td { + font-size: 11px; +} +*/ +table.percent_graph { + height: 12px; + border: #808080 1px solid; + empty-cells: show; +} +table.percent_graph td.covered { + height: 10px; + background: #00f000; +} +table.percent_graph td.uncovered { + height: 10px; + background: #e00000; +} +table.percent_graph td.NA { + height: 10px; + background: #eaeaea; +} +table.report { + border-collapse: collapse; + width: 100%; +} +table.report td.heading { + background: #dcecff; + border: #d0d0d0 1px solid; + font-weight: bold; + text-align: center; +} +table.report td.heading:hover { + background: #c0ffc0; +} +table.report td.text { + border: #d0d0d0 1px solid; +} +table.report td.value, +table.report td.lines_total, +table.report td.lines_code { + text-align: right; + border: #d0d0d0 1px solid; +} +table.report tr.light { + background-color: rgb(240, 240, 245); +} +table.report tr.dark { + background-color: rgb(230, 230, 235); +} +</style> + <script type='text/javascript'> +// <![CDATA[ + function toggleCode( id ) { + if ( document.getElementById ) + elem = document.getElementById( id ); + else if ( document.all ) + elem = eval( "document.all." + id ); + else + return false; + + elemStyle = elem.style; + + if ( elemStyle.display != "block" ) { + elemStyle.display = "block" + } else { + elemStyle.display = "none" + } + + return true; + } + + // Make cross-references hidden by default + document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" ) + // ]]> +</script> + </head> + <body><h3>C0 code coverage information</h3> + <p>Generated on Tue Jun 24 21:43:50 +0200 2008 with <a href='http://eigenclass.org/hiki/rcov'>rcov 0.8.1.2</a> + </p> + <hr/> + <table class='report'><thead><tr><td class='heading'>Name</td> + <td class='heading'>Total lines</td> + <td class='heading'>Lines of code</td> + <td class='heading'>Total coverage</td> + <td class='heading'>Code coverage</td> + </tr> + </thead> + <tbody><tr class='light'><td>TOTAL</td> + <td class='lines_total'><tt>13757</tt> + </td> + <td class='lines_code'><tt>9314</tt> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>90.7%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='91'/> + <td class='uncovered' width='9'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>86.9%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='87'/> + <td class='uncovered' width='13'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + <tr class='dark'><td><a href='app-apis-sys_api_rb.html'>app/apis/sys_api.rb</a> + </td> + <td class='lines_total'><tt>25</tt> + </td> + <td class='lines_code'><tt>8</tt> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>100.0%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='100'/> + <td class='uncovered' width='0'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>100.0%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='100'/> + <td class='uncovered' width='0'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + <tr class='light'><td><a href='app-controllers-account_controller_rb.html'>app/controllers/account_controller.rb</a> + </td> + <td class='lines_total'><tt>173</tt> + </td> + <td class='lines_code'><tt>129</tt> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>98.8%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='99'/> + <td class='uncovered' width='1'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>98.4%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='98'/> + <td class='uncovered' width='2'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + <tr class='dark'><td><a href='app-controllers-admin_controller_rb.html'>app/controllers/admin_controller.rb</a> + </td> + <td class='lines_total'><tt>86</tt> + </td> + <td class='lines_code'><tt>57</tt> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>91.9%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='92'/> + <td class='uncovered' width='8'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>87.7%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='88'/> + <td class='uncovered' width='12'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + <tr class='light'><td><a href='app-controllers-application_rb.html'>app/controllers/application.rb</a> + </td> + <td class='lines_total'><tt>222</tt> + </td> + <td class='lines_code'><tt>162</tt> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>89.6%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='90'/> + <td class='uncovered' width='10'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>87.0%</tt> + </td> + <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='87'/> + <td class='uncovered' width='13'/> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + </tbody> + </table> +<hr/> + <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> + version 0.8.1.2.</p> +<p><a href='http://validator.w3.org/check/referer'><img src='http://www.w3.org/Icons/valid-xhtml11' height='31' alt='Valid XHTML 1.1!' width='88'/> + </a> + <a href='http://jigsaw.w3.org/css-validator/check/referer'><img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px'/> + </a> + </p> + </body> + </html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/test/fixtures/html/misc/misc.html Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +<b>Misc file</b>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/test/fixtures/html/misc/misc.txt Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +Misc file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/test/functional/embedded_controller_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,63 @@ +# Redmine - project management software +# Copyright (C) 2008 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' + +class EmbeddedControllerTest < ActionController::TestCase + fixtures :projects, :enabled_modules, :users, :roles, :members + + def setup + fixtures_path = File.dirname(__FILE__) + '/../fixtures/html' + + Setting.plugin_embedded = { 'path' => fixtures_path, + 'index' => 'main.html overview-summary.html index.html', + 'extensions' => 'html png gif', + 'template' => '', + 'encoding' => '', + 'menu' => 'Embedded' } + + Project.find(1).enabled_modules << EnabledModule.new(:name => 'embedded') + + anonymous = Role.anonymous + anonymous.permissions += [:view_embedded_doc] + assert anonymous.save + end + + def test_get_root_should_redirect_to_index_file + get :index, :id => 'ecookbook' + assert_redirected_to :path => ['index.html'] + end + + def test_get_index_file + get :index, :id => 'ecookbook', :path => ['index.html'] + assert_response :success + assert_template 'index' + assert_tag :h3, :content => 'C0 code coverage information' + end + + def test_get_subdirectory_file + get :index, :id => 'ecookbook', :path => ['misc', 'misc.html'] + assert_response :success + assert_template 'index' + assert_tag :b, :content => 'Misc file' + end + + def test_get_invalid_extension_should_be_denied + get :index, :id => 'ecookbook', :path => ['misc', 'misc.txt'] + assert_response 500 + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/test/test_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,38 @@ +ENV["RAILS_ENV"] ||= "test" +require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") +require 'test_help' + +class Test::Unit::TestCase + # Transactional fixtures accelerate your tests by wrapping each test method + # in a transaction that's rolled back on completion. This ensures that the + # test database remains unchanged so your fixtures don't have to be reloaded + # between every test method. Fewer database queries means faster tests. + # + # Read Mike Clark's excellent walkthrough at + # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting + # + # Every Active Record database supports transactions except MyISAM tables + # in MySQL. Turn off transactional fixtures in this case; however, if you + # don't care one way or the other, switching from MyISAM to InnoDB tables + # is recommended. + # + # The only drawback to using transactional fixtures is when you actually + # need to test transactions. Since your test is bracketed by a transaction, + # any transactions started in your code will be automatically rolled back. + self.use_transactional_fixtures = true + + # Instantiated fixtures are slow, but give you @david where otherwise you + # would need people(:david). If you don't want to migrate your existing + # test cases which use the @david style and don't mind the speed hit (each + # instantiated fixtures translates to a database query per test method), + # then set this back to true. + self.use_instantiated_fixtures = false + + # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. + # + # Note: You'll currently still have to declare fixtures explicitly in integration tests + # -- they do not yet inherit this setting + fixtures :all + + # Add more helper methods to be used by all tests here... +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/embedded/test/unit/embedded_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,54 @@ +# Redmine - project management software +# Copyright (C) 2008 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.dirname(__FILE__) + '/../test_helper' + +class EmbeddedTest < ActiveSupport::TestCase + + def setup + Setting.plugin_embedded = { 'path' => '/path/to', + 'index' => 'main.html overview-summary.html index.html', + 'extensions' => 'html png gif', + 'template' => 'doxygen', + 'encoding' => '', + 'menu' => 'Embedded' } + end + + def test_available_templates + assert_equal ['doxygen', 'javadoc', 'rcov'], Redmine::Plugins::Embedded.available_templates + end + + def test_assets + assert_equal ['rcov.css', 'rcov.js'], Redmine::Plugins::Embedded.assets('rcov') + end + + def test_detect_template_from_path + to_test = { '/path/to/doc' => 'doxygen', + '/path/to/javadoc/html' => 'javadoc' } + + to_test.each { |path, template| assert_equal template, Redmine::Plugins::Embedded.detect_template_from_path(path) } + end + + def test_valid_extension + to_test = {'index.html' => true, + 'path/to/index.html' => true, + 'path/to/image.png' => true, + 'path/to/something.else' => false} + + to_test.each { |path, expected| assert_equal expected, Redmine::Plugins::Embedded.valid_extension?(path) } + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/engines/generators/plugin_migration/templates/plugin_migration.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,13 @@ +class <%= class_name %> < ActiveRecord::Migration + def self.up + <%- plugins.each do |plugin| -%> + Engines.plugins["<%= plugin.name %>"].migrate(<%= new_versions[plugin.name] %>) + <%- end -%> + end + + def self.down + <%- plugins.each do |plugin| -%> + Engines.plugins["<%= plugin.name %>"].migrate(<%= current_versions[plugin.name] %>) + <%- end -%> + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/README.rdoc Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,3 @@ += bibliography + +Description goes here
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/controllers/authors_controller.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,13 @@ +class AuthorsController < ApplicationController + helper :publications + include PublicationsHelper + + def index + @authors = Author.find(:all) + end + + def show + @author = Author.find(params[:id]) + end + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/controllers/authorships_controller.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,10 @@ +class AuthorshipsController < ApplicationController + + def index + + end + + + def update + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/controllers/bibtex_entries_controller.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,3 @@ +class BibtexEntriesController < ApplicationController + +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,343 @@ +# -*- coding: utf-8 -*- +# vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb + +class PublicationsController < ApplicationController + unloadable + + model_object Publication + before_filter :find_model_object, :except => [:new, :create, :index, :get_bibtex_required_fields, :autocomplete_for_project, :add_author, :sort_author_order, :autocomplete_for_author, :get_user_info ] + before_filter :find_project_by_project_id, :authorize, :only => [ :edit, :new, :update, :create ] + + def new + find_project_by_project_id + @publication = Publication.new + + # we'll always want a new publication to have its bibtex entry + @publication.build_bibtex_entry + + # and at least one author + # @publication.authorships.build.build_author + @author_options = [["#{User.current.name} (@#{User.current.mail.partition('@')[2]})", "#{User.current.class.to_s}_#{User.current.id.to_s}"]] + end + + def create + @project = Project.find(params[:project_id]) + + @author_options = [] + + @publication = Publication.new(params[:publication]) + @publication.projects << @project unless @project.nil? + + if @publication.save + @publication.notify_authors_publication_added(@project) + + flash[:notice] = "Successfully created publication." + redirect_to :action => :show, :id => @publication, :project_id => @project + else + render :action => 'new', :project_id => @project + end + end + + def index + if !params[:project_id].nil? + find_project_by_project_id + @project = Project.find(params[:project_id]) + @publications = Publication.find :all, :joins => :projects, :conditions => ["project_id = ?", @project.id] + else + @publications = Publication.find :all + end + end + + def new_from_bibfile + @publication.current_step = session[:publication_step] + + # contents of the paste text area + bibtex_entry = params[:bibtex_entry] + + # method for creating "pasted" bibtex entries + if bibtex_entry + parse_bibtex_list bibtex_entry + end + end + + def get_bibtex_required_fields + + unless params[:value].empty? + fields = BibtexEntryType.fields(params[:value]) + end + + respond_to do |format| + format.js { + render(:update) {|page| + if params[:value].empty? + page << "hideOnLoad();" + else + page << "show_required_bibtex_fields(#{fields.to_json()});" + end + } + } + + end + end + + def add_author + if (request.xhr?) + render :text => User.find(params[:user_id]).name + else + # No? Then render an action. + #render :action => 'view_attribute', :attr => @name + logger.error { "Error while adding Author to publication." } + end + end + + def edit + find_project_by_project_id unless params[:project_id].nil? + + @edit_view = true; + @publication = Publication.find(params[:id]) + @selected_bibtex_entry_type_id = @publication.bibtex_entry.entry_type + + @author_options = [] + + @bibtype_fields = BibtexEntryType.fields(@selected_bibtex_entry_type_id) + end + + def update + @publication = Publication.find(params[:id]) + @author_options = [] + + if @publication.update_attributes(params[:publication]) + flash[:notice] = "Successfully updated Publication." + + # expires the previosly cached entries + Rails.cache.delete "publication-#{@publication.id}-ieee" + Rails.cache.delete "publication-#{@publication.id}-bibtex" + + if !params[:project_id].nil? + redirect_to :action => :show, :id => @publication, :project_id => params[:project_id] + else + redirect_to :action => :show, :id => @publication + end + else + render :action => 'edit' + end + end + + + def show + find_project_by_project_id unless params[:project_id].nil? + + if @publication.nil? + @publications = Publication.all + render "index", :alert => 'The publication was not found!' + else + @authors = @publication.authors + @bibtext_entry = @publication.bibtex_entry + end + end + + # parse string with bibtex authors + def parse_authors(authors_entry) + # in bibtex the authors are always seperated by "and" + return authors_entry.split(" and ") + end + + # parses a list of bibtex + def parse_bibtex_list(bibtex_list) + bibliography = BibTeX.parse bibtex_list + + no_entries = bibliography.data.length + + # parses the bibtex entries + bibliography.data.map do |d| + + if d.class == BibTeX::Entry + create_bibtex_entry d + end + end + end + + def create_bibtex_entry(d) + @publication = Publication.new + @bentry = BibtexEntry.new + authors = [] + institution = "" + email = "" + + d.fields.keys.map do |field| + case field.to_s + when "author" + authors = parse_authors d[field] + when "title" + @publication.title = d[field] + when "institution" + institution = d[field] + when "email" + email = d[field] + else + @bentry[field] = d[field] + end + end + + @publication.bibtex_entry = @bentry + @publication.save + + # what is this for??? + # @created_publications << @publication.id + + # need to save all authors + # and establish the author-publication association + # via the authorships table + authors.each_with_index.map do |authorname, idx| + author = Author.new(:name => authorname) + if author.save! + # todo: catch the errors... + puts "SAVED" + else + puts "NOT SAVED" + end + + author.authorships.create!( + :publication => @publication, + :institution => institution, + :email => email, + :order => idx) + end + end + + # parses the bibtex file + def parse_bibtex_file + + end + + def import + @publication = Publication.new + + + end + + def autocomplete_for_project + @publication = Publication.find(params[:id]) + + @projects = Project.active.like(params[:q]).find(:all, :limit => 100) - @publication.projects + logger.debug "Query for \"#{params[:q]}\" returned \"#{@projects.size}\" results" + render :layout => false + end + + def autocomplete_for_author + @results = [] + + object_id = params[:object_id] + @object_name = "publications[authorships_attributes][#{object_id}][search_results]" + + # cc 20110909 -- revert to like instead of like_unique -- see #289 + authorships_list = Authorship.like(params[:q]).find(:all, :limit => 100) + users_list = User.active.like(params[:q]).find(:all, :limit => 100) + + logger.debug "Query for \"#{params[:q]}\" returned \"#{authorships_list.size}\" authorships and \"#{users_list.size}\" users" + + @results = users_list + + # TODO: can be optimized… + authorships_list.each do |authorship| + flag = true + + users_list.each do |user| + if authorship.name == user.name && authorship.email == user.mail && authorship.institution == user.institution + Rails.logger.debug { "Rejecting Authorship #{authorship.id}" } + flag = false + break + end + end + + @results << authorship if flag + end + + render :layout => false + end + + def get_user_info + object_id = params[:object_id] + value = params[:value] + classname = Kernel.const_get(value.split('_')[0]) + + item = classname.find(value.split('_')[1]) + + name_field = "publication_authorships_attributes_#{object_id}_name_on_paper".to_sym + email_field = "publication_authorships_attributes_#{object_id}_email".to_sym + institution_field = "publication_authorships_attributes_#{object_id}_institution".to_sym + + yes_radio = "publication_authorships_attributes_#{object_id}_identify_author_yes".to_sym + + respond_to do |format| + format.js { + render(:update) {|page| + page[name_field].value = item.name + page[email_field].value = item.mail + page[institution_field].value = item.institution + + page[yes_radio].checked = true + page[name_field].readOnly = true + page[email_field].readOnly = true + page[institution_field].readOnly = true + } + } + end + end + + def sort_author_order + params[:authorships].each_with_index do |id, index| + Authorship.update_all(['auth_order=?', index+1], ['id=?', id]) + end + render :nothing => true + end + + def add_project + @projects = Project.find(params[:publication][:project_ids]) + @publication.projects << @projects + @project = Project.find(params[:project_id]) + + # TODO luisf should also respond to HTML??? + respond_to do |format| + format.html { redirect_to :back } + format.js { + render(:update) {|page| + page[:add_project_form].reset + page.replace_html :list_projects, :partial => 'list_projects' + } + } + end + end + + + def remove_project + @project = Project.find(params[:project_id]) + proj = Project.find(params[:remove_project_id]) + + if @publication.projects.length > 1 + if @publication.projects.exists? proj + @publication.projects.delete proj if request.post? + end + else + logger.error { "Cannot remove project from publication list" } + end + + logger.error { "CURRENT project name#{proj.name} and wanna delete #{@project.name}" } + + render(:update) {|page| + page.replace_html "list_projects", :partial => 'list_projects', :id => @publication + } + end + + def destroy + find_project_by_project_id + + @publication.destroy + + flash[:notice] = "Successfully deleted Publication." + redirect_to :controller => :publications, :action => 'index', :project_id => @project + end + + private + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/helpers/authors_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,28 @@ +module AuthorsHelper + unloadable + + def render_author_publications(author) + s = "" + pubs = [] + + author.publications.each do |pub| + pubs << link_to(pub.title, pub) + end + + if pubs.size < 3 + s << '<nobr>' << pubs.join(', ') << '</nobr>' + else + s << pubs.join(', ') + end + s + end + + + # Generates a link to an author + # todo: test options + def link_to_author(author, options={}, html_options = nil) + url = {:controller => 'authors', :action => 'show', :id => author}.merge(options) + link_to(h(author.name), url, html_options) + end + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/helpers/authorships_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,21 @@ +# -*- coding: undecided -*- +module AuthorshipsHelper + + # Generates a link to either author or user, depending on which is + # available + def link_to_authorship(authorship) + s = '' + if authorship.author.nil? + # legacy reasons… + s << h(authorship.name_on_paper) + else + if authorship.author.user.nil? + s << link_to(authorship.name_on_paper, :controller => 'authors', :action => 'show', :id => authorship.author) + else + s << link_to(authorship.name_on_paper, :controller => 'users', :action => 'show', :id => authorship.author.user) + end + end + s + end + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/helpers/bibtex_entries_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,3 @@ +module BibtexEntriesHelper + +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/helpers/my_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,38 @@ +module MyHelper + + def get_my_publications() + if not User.current.author.nil? + @my_publications = Publication.all(:include => :authors, :conditions => "authors.id = #{User.current.author.id}") + else + @my_publications = [] + end + end + + def render_publications_projects(publication) + s = "" + projs = [] + + publication.projects.each do |proj| + projs << link_to(proj.name, proj) + end + + s << projs.join(', ') + + s + end + + def render_publications_authors(publication) + s = "" + auths = [] + + publication.authorships.each do |auth| + auths << h(auth.name_on_paper) + end + + s << auths.join(', ') + + s + end + + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/helpers/publications_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,147 @@ +# -*- coding: utf-8 -*- +require 'bibtex' + +module PublicationsHelper + include AuthorshipsHelper + + def link_to_publication(publication, options={}, html_options = nil) + url = {:controller => 'publications', :action => 'show', :id => publication}.merge(options) + link_to(h(publication.title), url, html_options) + end + + def projects_check_box_tags(name, projects) + s = '' + projects.sort.each do |project| + if User.current.allowed_to?(:edit_publication, project) + s << "<label>#{ check_box_tag name, project.id, false } #{link_to_project project}</label>\n" + s << '<br />' + end + end + + s + end + + def choose_author_link(object_name, items) + # called by autocomplete_for_author (publications' action/view) + # creates the select list based on the results array + # results is an array with both Users and Authorships objects + + @author_options = [] + @results.each do |result| + email_bit = result.mail.partition('@')[2] + if email_bit != "": + email_bit = "(@#{email_bit})" + end + @author_options << ["#{result.name} #{email_bit}", "#{result.class.to_s}_#{result.id.to_s}"] + end + + if @results.size > 0 + s = select_tag( form_tag_name(object_name, :author_search_results), options_for_select(@author_options), { :id => form_tag_id(object_name, :author_search_results), :size => 3} ) + s << observe_field( form_tag_id(object_name, :author_search_results), :on => 'click', :function => "alert('Element changed')", :with => 'q') + else + s = "<em>No Authors found that match your search… sorry!</em>" + end + end + + def link_to_remove_fields(name, f) + f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)", :class => 'icon icon-del') + end + + def link_to_add_author_fields(name, f, association, action) + new_object = f.object.class.reflect_on_association(association).klass.new + fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder| + render(association.to_s.singularize + "_fields", :f => builder) + end + link_to_function(name, h("add_author_fields(this, '#{association}', '#{escape_javascript(fields)}', '#{action}')"), { :class => 'icon icon-add', :id => "add_another_author" }) + end + + def sanitized_object_name(object_name) + object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/,"_").sub(/_$/,"") + end + + def sanitized_method_name(method_name) + method_name.sub(/\?$/, "") + end + + def form_tag_name(object_name, method_name) + str = "#{object_name.to_s}[#{sanitized_method_name(method_name.to_s)}]" + str.to_sym + end + + def form_tag_id(object_name, method_name) + str = "#{sanitized_object_name(object_name.to_s)}_#{sanitized_method_name(method_name.to_s)}" + str.to_sym + end + + def form_object_id(object_name) + str = object_name.split("\[").last().gsub("\]","") + str.to_sym + end + + def render_authorships_list(publication) + s = '<p>' + + publication.authorships.each do |authorship| + s << link_to_authorship(authorship) + s << "<br /><em>#{authorship.institution}</em></p>" + end + + s + end + + def render_projects_list(publication, show_delete_icon) + s= "" + + publication.projects.visible.each do |proj| + s << link_to_project(proj, {}, :class => 'publication_project') + + if show_delete_icon + if User.current.allowed_to?(:edit_publication, @project) + if @project == proj + # todo: move this message to yml file + confirm_msg = 'Are you sure you want to remove the current project from this publication\'s projects list?' + else + confirm_msg = false + end + + s << link_to_remote(l(:button_delete), { :url => { :controller => 'publications', :action => 'remove_project', :id => publication, :remove_project_id => proj, :project_id => @project }, :method => :post, :confirm => confirm_msg }, :class => 'icon icon-del') + end + end + + s << "<br />" + end + + s + end + + def print_ieee_format(publication) + Rails.cache.fetch("publication-#{publication.id}-ieee") do + publication.print_entry(:ieee) + end + end + + def print_bibtex_format(publication) + Rails.cache.fetch("publication-#{publication.id}-bibtex") do + publication.print_entry(:bibtex) + end + end + + + def show_bibtex_fields(bibtex_entry) + s = "" + bibtex_entry.attributes.keys.sort.each do |key| + value = bibtex_entry.attributes[key].to_s + next if key == 'id' or key == 'publication_id' or value == "" + s << "<h4>" + l("field_#{key}") + "</h4>" + s << "<p>" + if key == "entry_type" + s << bibtex_entry.entry_type_label + else + s << value + end + s << "</p>" + end + s + end +end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/models/author.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,20 @@ +class Author < ActiveRecord::Base + unloadable + + has_many :authorships, :dependent => :destroy + has_many :publications, :through => :authorships + + belongs_to :user + + def <=>(author) + name.downcase <=> author.name.downcase + end + + named_scope :like, lambda {|q| + s = "%#{q.to_s.strip.downcase}%" + {:conditions => ["LOWER(name) LIKE :s", {:s => s}], + :order => 'name' + } + } + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/models/authorship.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,71 @@ +class Authorship < ActiveRecord::Base + unloadable + + belongs_to :author + belongs_to :publication + + accepts_nested_attributes_for :author + accepts_nested_attributes_for :publication + + validates_presence_of :name_on_paper + + attr_accessor :is_user, :author_user_id, :search_name, :identify_author, :search_results + before_save :associate_author_user + + named_scope :like_unique, lambda {|q| + s = "%#{q.to_s.strip.downcase}%" + {:conditions => ["LOWER(name_on_paper) LIKE :s OR LOWER(email) LIKE :s", {:s => s}], + :order => 'name_on_paper', + :group => "name_on_paper, institution, email" + } + } + + named_scope :like, lambda {|q| + s = "%#{q.to_s.strip.downcase}%" + {:conditions => ["LOWER(name_on_paper) LIKE :s OR LOWER(email) LIKE :s", {:s => s}], + :order => 'name_on_paper' + } + } + + def name + return self.name_on_paper + end + + def <=>(authorship) + name.downcase <=> authorship.name.downcase + end + + def mail + return self.email + end + + protected + def associate_author_user + case self.identify_author + when "no" + author = Author.new + author.save + self.author_id = author.id + else + selected = self.search_results + selected_classname = Kernel.const_get(selected.split('_')[0]) + selected_id = selected.split('_')[1] + object = selected_classname.find(selected_id) + + if object.respond_to? :name_on_paper + # Authorship + self.author_id = object.author.id + else + # User + unless object.author.nil? + self.author_id = object.author.id + else + author = Author.new + object.author = author + object.save + self.author_id = object.author.id + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/models/bibtex_entry.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,16 @@ +class BibtexEntry < ActiveRecord::Base + unloadable + + belongs_to :publication + validates_presence_of :entry_type + + def entry_type_name + entry_type = self.entry_type + BibtexEntryType.find(entry_type).name + end + + def entry_type_label + entry_type = self.entry_type + BibtexEntryType.find(entry_type).label + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/models/bibtex_entry_type.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,30 @@ +class BibtexEntryType < ActiveRecord::Base + unloadable + + @@fields = Hash['article', ['journal', 'year', 'volume', 'number', 'pages', 'month', 'note' ], + 'book' , [ 'editor', 'publisher', 'volume', 'series', 'address', 'edition', 'month', 'year', 'note' ], + 'booklet' , [ 'howpublished', 'address', 'year', 'month', 'note', 'key' ], + 'conference', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], + 'inbook', [ 'editor', 'publisher', 'chapter', 'pages', 'volume', 'series', 'address', 'edition', 'year', 'note' ], + 'incollection', [ 'editor', 'publisher', 'chapter', 'pages', 'volume', 'series', 'address', 'edition', 'year', 'note' ], + 'inproceedings', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], + 'manual', [ 'organization', 'address', 'edition', 'month', 'year', 'note' ], + 'masterthesis', [ 'school', 'year', 'address', 'month', 'note' ], + 'misc', [ 'howpublished', 'month', 'year', 'note' ], + 'phdthesis', [ 'school', 'year', 'address', 'month', 'note' ], + 'proceedings', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], + 'techreport', [ 'year', 'type', 'number', 'address', 'month', 'note' ], + 'unpublished', [ 'note', 'month', 'year' ]] + + def redundant? + name == 'conference' # conference is a duplicate of inproceedings + end + + def label + l("field_bibtex_#{name}") + end + + def self.fields (type) + @@fields[ self.find(type).name ] + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/models/publication.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,91 @@ +# vendor/plugins/redmine_bibliography/app/models/publication.rb + +class Publication < ActiveRecord::Base + unloadable + + has_many :authorships, :dependent => :destroy, :order => "auth_order ASC" + has_many :authors, :through => :authorships, :uniq => true + + has_one :bibtex_entry, :dependent => :destroy + + validates_presence_of :title + validates_length_of :authorships, :minimum => 1, :message => l("error_no_authors") + + accepts_nested_attributes_for :authorships + accepts_nested_attributes_for :authors, :allow_destroy => true + accepts_nested_attributes_for :bibtex_entry, :allow_destroy => true + + has_and_belongs_to_many :projects, :uniq => true + + before_save :set_initial_author_order + + # Ensure error message uses proper text instead of + # bibtex_entry.entry_type (#268). There has to be a better way to + # do this! + def self.human_attribute_name(k) + if k == 'bibtex_entry.entry_type' + l(:field_entry_type) + else + super + end + end + + def notify_authors_publication_added(project) + self.authors.each do |author| + Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." } + Mailer.deliver_publication_added(author.user, self, project) unless author.user.nil? + end + end + + def notify_authors_publication_updated(project) + self.authors.each do |author| + Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." } + Mailer.deliver_publication_updated(author.user, self, project) unless author.user.nil? + end + end + + + def set_initial_author_order + authorships = self.authorships + + logger.debug { "Publication \"#{self.title}\" has #{authorships.size} authors." } + + authorships.each_with_index do |authorship, index| + if authorship.auth_order.nil? + authorship.auth_order = index + end + end + end + + def print_bibtex_author_names + # this authors are correctly sorted because the authorships model + # already outputs the author names ASC by auth_order + self.authorships.map{|a| a.name_on_paper}.join(' and ') + end + + def print_entry(style) + bib = BibTeX::Entry.new + + bib.author = self.print_bibtex_author_names + bib.title = self.title + + self.bibtex_entry.attributes.keys.sort.each do |key| + value = self.bibtex_entry.attributes[key].to_s + next if key == 'id' or key == 'publication_id' or value == "" + + if key == "entry_type" + bib.type = BibtexEntryType.find(self.bibtex_entry.entry_type).name + else + bib[key.to_sym] = value + end + end + + if style == :ieee + CiteProc.process bib.to_citeproc, :style => :ieee, :format => :html + else + bibtex = bib.to_s :include => :meta_content + bibtex.strip! + logger.error { bibtex } + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/authors/index.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,26 @@ +<h2><%=l(:label_authors_index)%></h2> + +<table class="list authors"> + <thead><tr> + <th><%=l(:field_author_name)%></th> + <th><%=l(:field_author_username)%></th> + <th><%=l(:field_author_publications)%></th> + </tr></thead> + <tbody> + + <% @authors.each do |author|%> + <tr id="author-<%= author.id %>" class="<%= cycle('odd', 'even') %>"> + <td class="title"> + <%= link_to_author author %> + </td> + <td class="username "> + <%= link_to author.user unless author.user.nil? %> + </td> + <td class="project"> + <%= render_author_publications(author) %> + </td> + </tr> + <% end %> + </tbody> +</table> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/authors/show.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,28 @@ +<h2><%=l(:label_authors_show)%></h2> + +<div class="autoscroll"> + <table class="list authors"> + <thead> + <tr> + <th><%=l(:field_authorship_publication_title)%></th> + <th><%=l(:field_authorship_name)%></th> + <th><%=l(:field_authorship_email)%></th> + <th><%=l(:field_authorship_institution)%></th> + </tr> + </thead> + + <% @author.authorships.each do |authorship| %> + <tr id="authorship-<%= authorship.id %>" class="<%= cycle('odd', 'even') %>"> + <td class="title"><%= link_to_publication(authorship.publication) %></td> + <td class="name"><%= h authorship.name_on_paper %></td> + <td class="email"><%= h authorship.email %></td> + <td class="institution"><%= h authorship.institution %></td> + </tr> + <% end %> + </tbody> + </table> +</div> + +<% content_for :sidebar do %> +<% end %> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/authorships/update.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +<h2>Authorships#update</h2>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/mailer/publication_added.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +<%= l(:mail_body_publication_added, :publication => @publication.title, :project => @project.name) %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/mailer/publication_added.text.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,2 @@ +<%= l(:mail_body_publication_added, :publication => @publication.title, :project => @project.name) %> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/my/blocks/_publications_box.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,30 @@ +<% get_my_publications %> + +<h3><%=l(:label_my_publications_box) %> <%= "(" + @my_publications.count.to_s + ")" %> </h3> + +<table class="list publications"> + <thead><tr> + <th><%=l(:field_publication_title)%></th> + <th><%=l(:field_publication_authors)%></th> + <th><%=l(:field_publication_projects)%></th> + </tr></thead> + <tbody> + + <% @my_publications.each do |publication|%> + <tr id="publication-<%= publication.id %>" class="<%= cycle('odd', 'even') %>"> + <td class="title"> + <%= link_to publication.title, publication %> + </td> + <td class="authors"> + <%= render_publications_authors(publication) %> + </td> + <td class="project"> + <%= render_publications_projects(publication) %> + </td> + </tr> + <% end %> + </tbody> +</table> + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,29 @@ +<% content_for :header_tags do %> + <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> + <%= javascript_include_tag 'bibtex', :plugin => 'redmine_bibliography' -%> +<% end %> + +<% if @project.publications.any? %> +<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> + <div id="bibliography"> + <div class="box"> + <h3><%=l(:label_related_publication_plural)%></h3> + + <dl> + <% @project.publications.each do |publication| %> + <dt> + <%= print_ieee_format(publication) %> + </dt> + <dd> + <%= link_to("[More Details]", {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%> + + <%= link_to_function "[B<small>IB</small>T<sub>E</sub>X]", onclick="toggleBibtex(this)" -%> + </dd> + <dd class="bibtex-textarea collapsed" style="display: none;"> + <textarea readonly> <%= print_bibtex_format(publication) %> </textarea> + </dd> + <% end -%> + </dl> + </div> +</div> +<% end -%>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/projects/show.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,120 @@ +<div class="contextual"> + <% if User.current.allowed_to?(:add_subprojects, @project) %> + <%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %> + <% end %> + + <% if @project.module_enabled? :redmine_bibliography %> + <% if User.current.allowed_to?(:add_publication, @project) %> + <%= link_to l(:label_add_publication_to_project), {:controller => 'publications', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %> + <% end %> + <% end %> +</div> + +<% if @project.has_welcome_page %> +<% page = @project.wiki.find_page("Overview") %> +<% end %> + +<% if page %> + +<% if @project.module_enabled? :wiki %> +<% if User.current.allowed_to?(:edit_wiki_pages, @project) %> +<div class="contextual"> +<%= link_to(l(:button_welcome_page_edit_this), {:controller => 'wiki', :action => 'edit', :project_id => @project, :id => Wiki.titleize("Overview")}, :class => 'icon icon-edit') %> +</div> +<% end %> +<% end %> + +<div class="contextual" style="clear: right"> +<ul> +<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %> +<% if @subprojects.any? %> + <li><%=l(:label_subproject_plural)%>: + <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li> +<% end %> +</ul> +</div> + +<%= render(:partial => "wiki/content", :locals => {:content => page.content_for_version()}) %> + +<% else %> + +<h2><%=l(:label_overview)%></h2> + +<div class="splitcontentleft"> + <div class="wiki"> + <%= textilizable @project.description %> + </div> + <ul> + <% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %> + <% if @subprojects.any? %> + <li><%=l(:label_subproject_plural)%>: + <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li> + <% end %> + <% @project.visible_custom_field_values.each do |custom_value| %> + <% if !custom_value.value.blank? %> + <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> + <% end %> + <% end %> + </ul> + + <% if User.current.allowed_to?(:view_issues, @project) %> + <div class="issues box"> + <h3><%=l(:label_issue_tracking)%></h3> + <ul> + <% for tracker in @trackers %> + <li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project, + :set_filter => 1, + "tracker_id" => tracker.id %>: + <%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i, + :total => @total_issues_by_tracker[tracker].to_i) %> + </li> + <% end %> + </ul> + <p> + <%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %> + <% if User.current.allowed_to?(:view_calendar, @project, :global => true) %> + | <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %> + <% end %> + <% if User.current.allowed_to?(:view_gantt, @project, :global => true) %> + | <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %> + <% end %> + </p> + </div> + <% end %> + <%= call_hook(:view_projects_show_left, :project => @project) %> +</div> + +<div class="splitcontentright"> + + <%= render :partial => 'bibliography_box' %> + + <%= render :partial => 'members_box' %> + + <% if @news.any? && authorize_for('news', 'index') %> + <div class="news box"> + <h3><%=l(:label_news_latest)%></h3> + <%= render :partial => 'news/news', :collection => @news %> + <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p> + </div> + <% end %> + <%= call_hook(:view_projects_show_right, :project => @project) %> +</div> + +<% content_for :sidebar do %> + <%= call_hook(:view_projects_show_sidebar_top, :project => @project) %> + <% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %> + <h3><%= l(:label_spent_time) %></h3> + <p><span class="icon icon-time"><%= l_hours(@total_hours) %></span></p> + <p><%= link_to(l(:label_details), {:controller => 'timelog', :action => 'index', :project_id => @project}) %> | + <%= link_to(l(:label_report), {:controller => 'time_entry_reports', :action => 'report', :project_id => @project}) %></p> + <% end %> + <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %> +<% end %> + +<% end %> + +<% content_for :header_tags do %> +<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %> +<% end %> + +<% html_title(l(:label_overview)) -%>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/_add_project_form.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,29 @@ +<% form_remote_for(:publication, + :url => {:controller => 'publications', :action => 'add_project', :id => @publication, :project_id => @project}, + :method => :post, + :html => { :id => 'add_project_form' }, + :loading => "$('project-add-submit').disable()", + :complete => "$('project-add-submit').enable()") do |f| %> + <fieldset><legend><%=l(:label_add_project_to_publication)%></legend> + <p> + <%= label_tag "project_search", l(:label_project_search) %><%= text_field_tag 'project_search', nil %> + </p> + + <%= observe_field(:project_search, + :frequency => 0.5, + :update => :projects, + :url => { :controller => 'publications', :action => 'autocomplete_for_project', :id => @publication }, + :with => 'q') + %> + + <div id="projects"> + <% if params[:q] && params[:q].length > 1 %> + <%= projects_check_box_tags 'project[project_ids][]', @projects %> + <% end %> + </div> + + <p><%= submit_tag l(:button_add), :id => 'project-add-submit' %></p> + + + </fieldset> + <% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,58 @@ +<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> + + +<div id="authors" class="fields"> +<!-- <h4><%= l("label_author_1") %></h4> --> + + <div id="<%= form_tag_id( f.object_name, :search_author ) %>" style=<%= "display:none;" unless params[:action] == "new" %> > + <p> + <%= f.text_field :search_name, :size => 25 %> + <%= observe_field( form_tag_id(f.object_name, :search_name), :frequency => 0.5, :update => form_tag_id( f.object_name, :search_results), :url => { :controller => 'publications', :action => 'autocomplete_for_author', :object_name => form_object_id(f.object_name) }, :with => 'q' ) %> + </p> + <%# link_to_function l(:label_author_is_me), "update_author_info(this," + User.current.get_author_info.to_json + ")", :id => "add_me_as_author" %> + + <p> + <%= f.select :search_results, options_for_select(@author_options), {}, {:size => 5, + :onChange => remote_function( :url => { :controller => :publications, :action => :get_user_info, :object_id => form_object_id(f.object_name) }, :with => "'value=' + + value" )} %> + </p> + + <p style="margin-bottom: -2.5em; padding-bottom; 0"><label><%= l(:identify_author_question) %></label></p> + <p class="author_identify"> + <label class='inline'><%= radio_button_tag(:identify_author, "yes", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_yes ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_yes) %> </label><br /> + + <label class='inline'><%= radio_button_tag(:identify_author, "correct", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_corrections ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_correct) %> </label><br /> + + <label class='inline'><%= radio_button_tag(:identify_author, "no", true, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_no ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_no) %> </label><br /> + </p> + </div> + + <div class='author_edit' id="<%= form_tag_id( f.object_name, :edit_author_info ) %>"> + <p> + <%= f.text_field :name_on_paper, {:class => ("readonly" unless params[:action] == "new") } %></p> + <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_name_on_paper") %></p> + <p><%= f.text_field :institution, {:class => ("readonly" unless params[:action] == "new") } %></p> + <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_institution") %></p> + <p><%= f.text_field :email, {:class => ("readonly" unless params[:action] == "new") } %></p> + <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_email") %></p> + </p> + </div> + + + <div class="box" id="<%= form_tag_id( f.object_name, :show_author_info ) %>" style="display: none"> + + </div> + + <p> + + <%- if params[:action] == 'new' -%> + <%= button_to_function l(:label_save_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button )} %> + <%- else -%> + <%= button_to_function l(:label_edit_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button )} %> + <%- end -%> + + + <%= link_to_remove_fields l("remove_author"), f %> + </p> +</div> +<br/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,80 @@ +<p> + <label for="bibtex_entry_type"><%=l("field_entry_type")%> <span class="required">*</span></label> + <%= f.collection_select :entry_type, + BibtexEntryType.find(:all).reject { |x| x.redundant? }, + :id, + :label, + { :selected => @selected_bibtex_entry_type_id, :prompt => true }, + :onChange => remote_function( :url => { :controller => :publications, :action => :get_bibtex_required_fields}, :with => "'value=' + value" ) + %> +</p> + +<p class="bibtex hol"> + <%= f.text_field :year, :size => 4 %> +</p> +<p class="bibtex hol"> + <%= f.text_field :month, :size => 4%> +</p> +<p class="bibtex hol"> + <%= f.text_field :chapter, :size => 15%> +</p> +<p class="bibtex hol"> + <%= f.text_field :editor, :size => 33 %> +</p> +<p class="bibtex hol"> + <%= f.text_field :booktitle, :size => 33 %> +</p> +<p class="bibtex hol"> + <%= f.text_field :publisher,:size => 33 %> +</p> +<p class="bibtex hol"> + <%= f.text_field :pages, :size => 12 %> +</p> +<p class="bibtex hol"> + <%= f.text_field :address %> +</p> +<p class="bibtex hol"> + <%= f.text_field :annote %> +</p> +<p class="bibtex hol"> + <%= f.text_field :crossref %> +</p> +<p class="bibtex hol"> + <%= f.text_field :edition %> +</p> +<p class="bibtex hol"> + <%= f.text_field :eprint %> +</p> +<p class="bibtex hol"> + <%= f.text_field :howpublished %> +</p> +<p class="bibtex hol"> + <%= f.text_field :journal %> +</p> +<p class="bibtex hol"> + <%= f.text_field :key %> +</p> +<p class="bibtex hol"> + <%= f.text_field :note %> +</p> +<p class="bibtex hol"> + <%= f.text_field :number %> +</p> +<p class="bibtex hol"> + <%= f.text_field :organization %> +</p> +<p class="bibtex hol"> + <%= f.text_field :school %> +</p> +<p class="bibtex hol"> + <%= f.text_field :series %> +</p> +<p class="bibtex hol"> + <%= f.text_field :type %> +</p> +<p class="bibtex hol"> + <%= f.text_field :url %> +</p> +<p class="bibtex hol"> + <%= f.text_field :volume %> +</p> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/_form.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,36 @@ +<%= f.error_messages %> + +<h3><%= f.text_field :title, :required => true, :size => 70 %></h3> + +<div class="splitcontentleft"> + <h3><%= l(:label_publication_other_details) %></h3> + <div class="box tabular"> + <% f.fields_for :bibtex_entry do |builder| -%> + <%= render :partial => 'bibtex_fields', :locals => { :f => builder} %> + <%- end -%> + + <p> + <%= f.text_field :external_url, :size => 70 %> + <br /> + <em><%= l(:text_external_url) %></em> + </p> + <p> + <%= f.text_field :doi, :size => 70 %> + <br /> + <em><%= l(:text_doi) %></em> + </p> + + </div> +</div> + +<div class="splitcontentright"> + <h3><%= l(:authors) %></h3> + <div class="box tabular"> + <% f.fields_for :authorships do |builder| -%> + <%= render "authorship_fields", :f => builder %> + <%- end -%> + <%= link_to_add_author_fields l(:label_add_an_author), f, :authorships, params[:action] %> + </div> +</div> + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/_identify_author_form.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,25 @@ +<legend><%= "Identify Authors in the system…" %></legend> + +<%= link_to_remote "It's me!", + { :url => { :controller => 'publications', + :action => 'add_me_as_author', + :project_id => @project }, :method => 'post'}, + { :class => 'icon icon-add', :id => "add_me_as_author" } %> + +<p> + <%= label_tag "author_search", l(:label_project_search) %><%= text_field_tag 'author_search', nil %> +</p> + +<%= observe_field( form_tag_id(f.object_name, :name), + :frequency => 0.5, + :update => :identify_author, + :url => { :controller => 'publications', :action => 'autocomplete_for_author' }, + :with => 'q') +%> + +<div id="identify_author"> + <% if params[:q] && params[:q].length > 1 %> + <%= select_author_links 'author[author_ids][]', @authors %> + <% end %> +</div> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +<%= render_projects_list(@publication, true) %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/_new_bibtex_step.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,9 @@ +<h3>New Bibtex</h3> + +<h4>Paste your Bibtex entries here</h4> +<p> + <%=label_tag :bibtex_entry %> + <%=text_area_tag :bibtex_entry%> +</p> + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/_review_bibtex_step.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,2 @@ +<h2>Review new entries</h2> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/add_project.rjs Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,3 @@ +page.replace_html :list_projects, :partial => 'list_projects' +page[:add_project_form].reset +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,4 @@ +<% if params[:q] && params[:q].length > 1 %> + <%= choose_author_link @object_name, @results %> +<% end %> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/autocomplete_for_project.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,3 @@ +<% if params[:q] && params[:q].length > 1 %> + <%= projects_check_box_tags 'publication[project_ids][]', @projects %> +<% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/create.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +<h2>Publications#create</h2>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/edit.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,18 @@ +<% content_for :header_tags do %> + <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %> + <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> + <%= javascript_tag 'Event.observe(window, "load", function(e){show_required_bibtex_fields(' + @bibtype_fields.to_json + ')});' %> +<% end %> + +<h2><%=l(:label_publication_show)%></h2> + +<% form_for @publication, :url => { :project_id => @project, :action => :update }, :builder => TabularFormBuilder do |f| -%> + <%= render :partial => 'form', :locals => { :f => f } %> + + <div style="clear:both"></div> + <%= f.submit %> +<% end %> +<p> + <%= link_to l(:label_publication_show), { :controller => "publications", :action => "show", :id => @publication, :project_id => @project_id } %> | + <%= link_to l(:label_publication_index), { :controller => "publications", :action => "index", :project_id => @project } %> +</p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/import.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,12 @@ +<h1>New Publication</h1> + +<% form_for @publication, :url => { :action => "create" } do |f| %> + <% f.error_messages %> + + <%= render :partial => "#{@publication.current_step}_bibtex_step", :locals => { :f => f } %> + + <p><%= f.submit "Submit" %></p> + <p><%= f.submit "Back", :name => "back_button" unless @publication.first_step? %></p> + +<% end %> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/index.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,40 @@ +<div class="contextual"> + <% if User.current.allowed_to?(:add_publication, @project) %> + <%= link_to l(:label_publication_new), {:controller => 'publications', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %> + <% end %> +</div> + + <% if @project %> + <h3><%= l(:label_all_publications_for_project, :project => @project.name) %></h3> + <% else %> + <h3><%= l(:label_all_publications) %></h3> + <% end %> + + <div class="autoscroll"> + <table class="list publications"> + <thead><tr> + <th><%= l(:title) %></th> + <th><%= l(:authors) %></th> + <th><%= l(:year) %></th> + <th><%= l(:associated_projects) %></th> + </tr></thead> + + <%- @publications.each do |publication| -%> + <%- if publication.projects.visible.length > 0 -%> + <tr class="<%= cycle('odd', 'even') %>"> + <td class="firstcol title" align="top"><%= link_to publication.title, :controller => "publications", :action => "show", :id => publication, :project_id => @project %></td> + <td class="authors" align="top"> + <%= render_authorships_list(publication) %> + <td class="year"><%= publication.bibtex_entry.year %></td> + <td class="projects"> + <%= render_projects_list(publication, false) %> + </td> + </tr> + <%- end -%> + <%- end -%> + </table> + </div> + +<% content_for :sidebar do %> +<% end %> +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/new.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,12 @@ +<% content_for :header_tags do %> + <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %> + <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> +<% end %> + +<h2><%=l(:label_publication_new)%></h2> + +<% form_for @publication, :url => { :project_id => @project, :action => :create }, :builder => TabularFormBuilder do |f| -%> + <%= render :partial => 'form', :locals => { :f => f } %> + <div style="clear:both"></div> + <%= f.submit %> +<% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/show.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,67 @@ +<h2><%=l(:label_publication_show)%></h2> + +<div class="box"> + <h3>Publication Info</h3> + <p><%= print_ieee_format(@publication)%></p> + + <h3>B<small>IB</small>T<sub>E</sub>X Format</h3> + <pre><%=h print_bibtex_format(@publication) %></pre> +</div> + +<div class="box"> + +<h4><%= l(:authors) %></h4> +<ul id="authorships"> + <% for authorship in @publication.authorships.find(:all, :order => :auth_order) %> + <% content_tag_for :li, authorship do %> + <%- if User.current.allowed_to?(:edit_publication, @project) && @publication.authorships.length > 1 -%> + <span class="handle">[drag to reorder]</span> + <%- end -%> + <%= link_to_authorship authorship %> <em><%= h authorship.institution %></em> <br /> + <%- end -%> + <%- end -%> +</ul> + +<%- if User.current.allowed_to?(:edit_publication, @project) && @publication.authorships.length > 1 -%> + <%= sortable_element("authorships", :url => { :controller => :publications, :action => :sort_author_order }, :handle => "handle") %> +<%- end -%> + +<%- if @publication.bibtex_entry != nil -%> + <%= show_bibtex_fields(@publication.bibtex_entry) %> +<%- end -%> + +<%- unless @publication.external_url.blank? -%> + <p> + <b><%= l(:field_external_url) %>:</b> <%= link_to h(@publication.external_url), @publication.external_url, {:target => "_blank"} -%> + </p> +<%- end -%> + + +<% unless @publication.doi.blank? %> + <p> + <b><%= l(:field_doi)-%>:</b> <%= link_to h(@publication.doi), "http://dx.doi.org/#{@publication.doi}", {:target => "_blank"} -%> + </p> +<% end %> + +<br / > + <% if User.current.allowed_to?(:add_publication, @project) %> + <%= link_to l(:label_publication_edit), { :controller => "publications", :action => "edit", :id => @publication, :project_id => @project } %> | + <%= link_to "Delete", {:controller => 'publications', :action => 'destroy', :id => @publication, :project_id => @project }, + :confirm => l(:text_are_you_sure), :method => :delete, :title => l(:button_delete) %> | + <% end %> + <%= link_to l(:view_all_publications), {:controller => 'publications', :action => 'index', :project_id => @project } %> +</div> + +<% projects = Project.active.find(:all, :limit => 100, :order => 'name ASC') - @publication.projects %> + +<% content_for :sidebar do %> + <h3><%=l(:label_publication_project_index)%></h3> + + <p id="list_projects"> + <%= render :partial => 'list_projects' %> + </p> + + <%- if User.current.allowed_to?(:edit_publication, @project) -%> + <%= render :partial => 'add_project_form' %> + <%- end -%> +<% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/publications/update.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +<h2>Publications#update</h2>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/settings/_bibliography.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,3 @@ +<p><label>Menu caption</label> +<%= text_field_tag 'settings[menu]', @settings['menu'], :size => 30 %> +<br /><em>Clear this field if you don't want to add a tab to the project menu</em></p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/app/views/users/show.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,104 @@ +<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> + +<div class="contextual"> +<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? %> +</div> + +<h2><%= avatar @user, :size => "50" %> <%=h @user.name %></h2> + +<div class="splitcontentleft"> +<ul> + <% unless @user.pref.hide_mail %> + <li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li> + <% end %> + <% @user.visible_custom_field_values.each do |custom_value| %> + <% if !custom_value.value.blank? %> + <li><%=h custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> + <% end %> + <% end %> + <li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li> + <% unless @user.last_login_on.nil? %> + <li><%=l(:field_last_login_on)%>: <%= format_date(@user.last_login_on) %></li> + <% end %> +</ul> + +<h3><%=l(:label_ssamr_description)%></h3> +<%= textilizable @description %> + +<h3><%=l(:label_ssamr_institution)%></h3> +<p><%= h @institution_name %></p> + + +<% unless @memberships.empty? %> +<h3><%=l(:label_project_plural)%></h3> +<ul> +<% for membership in @memberships %> + <li><%= link_to_project(membership.project) %> + (<%=h membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li> +<% end %> +</ul> +<% end %> +<%= call_hook :view_account_left_bottom, :user => @user %> +</div> + +<div class="splitcontentright"> + + <% if @user.author %> + <div id="bibliography"> + <% @publications = Publication.all(:include => :authors, :conditions => "authors.id = #{@user.author.id}") %> + + <h3><%=l(:publications) %> <%= "(" + @publications.count.to_s + ")" %> </h3> + + <% @publications.each do |publication|%> + <dt> + <span class="authors"> + <%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %><% if !publication.authorships.empty? %>.<% end %> + </span> + <span class="title"><%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication %></span> + <% if publication.bibtex_entry.year.to_s != "" %> + <span class="year"> + (<%= publication.bibtex_entry.year %>) + </span> + <% end %> + </dt> + <dd> + </dd> + <% end %> + </div> + <% end %> + + +<% unless @events_by_day.empty? %> +<h3><%= link_to l(:label_activity), :controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :from => @events_by_day.keys.first %></h3> + +<p> +<%=l(:label_reported_issues)%>: <%= Issue.count(:conditions => ["author_id=?", @user.id]) %> +</p> + +<div id="activity"> +<% @events_by_day.keys.sort.reverse.each do |day| %> +<h4><%= format_activity_day(day) %></h4> +<dl> +<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> + <dt class="<%= e.event_type %>"> + <span class="time"><%= format_time(e.event_datetime, false) %></span> + <%= content_tag('span', h(e.project), :class => 'project') %> + <%= link_to format_activity_title(e.event_title), e.event_url %></dt> + <dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd> +<% end -%> +</dl> +<% end -%> +</div> + +<% other_formats_links do |f| %> + <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :key => User.current.rss_key} %> +<% end %> + +<% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :user_id => @user, :format => :atom, :key => User.current.rss_key) %> +<% end %> +<% end %> +<%= call_hook :view_account_right_bottom, :user => @user %> +</div> + +<% html_title @user.name %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/assets/javascripts/authors.js Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,76 @@ +function remove_fields(link) { + $(link).previous("input[type=hidden]").value = "1"; + $(link).up(".fields").hide(); +} + +function add_author_fields(link, association, content, action) { + var new_id = new Date().getTime(); + var regexp = new RegExp("new_" + association, "g"); + $(link).insert({ + before: content.replace(regexp, new_id) + }); + if(action != "new"){ + toggle_save_author(new_id, $(link)); + }; +} + +function identify_author_status(status, object_id) { + $('publication_authorships_attributes_' + object_id + '_edit_author_info').select('input').each(function(s) { + if(status == "no"){ + s.value = ""; + s.readOnly = false; + }; + + if(status == "correct"){s.readOnly = false;}; + if(status == "yes"){s.readOnly = true;}; + }); +} + +function toggle_div(div_id){ + Effect.toggle(div_id, "appear", {duration:0.3}); +} + +function toggle_input_field(field){ + if (field.classNames().inspect().include("readonly") == false){ + field.readOnly = true; + field.addClassName('readonly'); + } else { + field.readOnly = false; + field.removeClassName('readonly'); + }; +} + +function toggle_edit_save_button(object_id){ + $button = $('publication_authorships_attributes_' + object_id + '_edit_save_button'); + if ($button.value == "Edit author"){ + $button.value = "Save author"; + } else { + $button.value = "Edit author"; + }; +} + +function toggle_save_author(form_object_id, $this){ + $('publication_authorships_attributes_' + form_object_id + '_edit_author_info').select('input').each(function(s) { + toggle_input_field(s, $this); + }); + $('publication_authorships_attributes_' + form_object_id + '_edit_author_info').select('p.description').each(function(s) { + s.toggle(); + }); + toggle_edit_save_button(form_object_id); + toggle_div("publication_authorships_attributes_" + form_object_id +"_search_author"); +} + +function hide_all_bibtex_required_fields(){$$('p.bibtex').each(function(s){s.hide()})} + +// entrytype_fields is a jsno array with the fields requires by the selected bibtex entry +function show_required_bibtex_fields(entrytype_fields) { + $$('p.bibtex').each(function(s){ + if(entrytype_fields.indexOf(s.down('input').id.split('_').last()) != -1){ + s.show(); + } + else { + s.hide(); + } + }) +} + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/assets/javascripts/bibtex.js Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,6 @@ +function toggleBibtex(el) { + var dd = Element.up(el).next('dd') + + dd.toggleClassName('collapsed'); + Effect.toggle(dd, 'slide', {duration:0.2}); +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/assets/stylesheets/bibliography.css Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,63 @@ +li .handle { + font-size: 12px; + cursor: move; + color: #777; +} + +input.readonly { + border: none; + padding: 0; + margin: 0; + background-color: transparent; +} + +.tabular .author_identify label { + font-weight: normal; +} + +.tabular .author_edit p { + padding-bottom: 0; +} + +.tabular .author_edit .description { + padding-top: 0; + font-style: italic; +} + +.publication_project { + margin-right: 18px; +} + +#authors select { + min-width: 150px; +} + + +div#bibliography dd { margin-bottom: 1em; font-size: 0.9em; } + +div#bibliography dd .authors { font-style: italic; } +div#bibliography dd span.authors { color: #808080; } +div#bibliography dd span.year { padding-left: 0.6em; } + +div#bibliography .box dt { + background: url(../../../images/document.png) no-repeat 0% 4px; + padding-left: 20px; + margin-left: 0; +} +div#bibliography .box dd { + padding-left: 20px; + margin-left: 0; +} + +div#bibliography h3 { + background: url(../../../images/table_multiple.png) no-repeat 0% 50%; + padding-left: 20px; +} + +div#bibliography textarea { + width: 90%; + height: 200px; + font: normal 8px; + padding: 2px 10px; + border: solid 1px #ddd; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/config/locales/en.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,152 @@ +# English strings go here for Rails i18n +en: + project_module_redmine_bibliography: "Publications (references to papers related to the project)" + + title: "Title" + authors: "Authors" + author: "Author" + name: "Name" + year: "Year" + associated_projects: "Associated Projects" + publications_box: "My Publications" + label_my_publications_box: "My Publications" + view_all_publications: "View All Project's Publications" + publications: Publications + + identify_author_question: Is the right person selected above? + identify_author_yes: "Yes" + identify_author_correct: "Yes, but I need to correct some details below" + identify_author_no: "No, the author was not found in the search" + + error_no_authors: "Please add at least one author to this publication." + + label_all_publications: All Publications + label_all_publications_for_project: Publications associated with %{project} + label_authors_show: "Authorships associated with this author" + label_authors_index: "List of authors" + + field_authorship_publication_title: "Publication" + field_authorship_name: "Name on Paper" + field_authorship_email: "Email" + field_authorship_institution: "Institution" + + field_external_url: "External URL" + field_doi: "DOI" + field_publication_title: Title + field_publication_authors: Authors + field_publication_projects: "Associated projects" + field_author_name: Author + field_author_user: User Name + field_author_username: "Associated user" + field_author_publications: "Publications by this Author" + field_identify_author_yes: "Yes" + field_identify_author_correct: "Corrections" + field_identify_author_no: "No" + + label_author_is_me: "(I am this author)" + label_add_me_as_author: "Add me as an author" + label_add_an_author: "Add an author" + label_add_another_author: "Add another author" + field_search_name: "Search by name" + field_search_results: "" + label_save_author: "Save author" + label_edit_author: "Edit author" + label_author_information: "Author Information" + + remove_author: "Remove this author" + + label_publication_plural: "Publications" + label_related_publication_plural: "Related publications" + label_publication_new: "Create New Publication" + label_publication_index: "List of Publication" + label_add_publication_to_project: "Add publication to this project" + label_publication_edit: "Edit Publication" + label_publication_show: "Publication Details" + label_add_project_to_publication: "Add this publication to a project" + label_project_search: "Find project by name: " + label_publication_project_index: "Projects associated with this publication" + label_publication_index: "View all publications" + label_publication_other_details: "Details" + + text_external_url: "Link to the publication or to an external page about it." + text_doi: "DOI (Digital Object Identifier)." + text_author_name_on_paper: "Author's name as it appears on the paper." + text_author_institution: "Author's institution as on the paper." + text_author_email: "Author's email address as on the paper." + + text_author_search: "Search existing authors" + + # authorships model + field_institution: "Institution" + field_name_on_paper: "Name" + field_email: "Email Address" + + # bibtex_entries model + field_entry_type: "Publication Type" + field_id: "id" + field_publication_id: "Publication_id" + field_address: "Address" + field_annote: "Annote" + field_booktitle: "Title of Book or Proceedings" + field_chapter: "Chapter" + field_crossref: "Cross Reference" + field_edition: "Edition" + field_editor: "Editor" + field_eprint: "eprint" + field_howpublished: "How was it Published" + field_journal: "Journal" + field_key: "Key" + field_month: "Month" + field_note: "Note" + field_number: "Number" + field_organization: "Organization" + field_pages: "Pages" + field_publisher: "Publisher" + field_school: "School" + field_series: "Series" + field_type: "Type" + field_url: "URL" + field_volume: "Volume" + field_year: "Year" + + field_bibtex_article: Journal article + field_bibtex_book: Book + field_bibtex_booklet: Booklet + field_bibtex_conference: Article in conference proceedings + field_bibtex_inbook: Book chapter or part + field_bibtex_incollection: Part of a collection + field_bibtex_inproceedings: Article in conference proceedings + field_bibtex_manual: Technical manual + field_bibtex_masterthesis: "Master's thesis" + field_bibtex_misc: Other + field_bibtex_phdthesis: "PhD thesis" + field_bibtex_proceedings: Conference proceedings + field_bibtex_techreport: Technical report + field_bibtex_unpublished: Unpublished + + label_author_1: First author + label_author_2: Second author + label_author_3: Third author + label_author_4: Fourth author + label_author_5: Fifth author + label_author_6: Sixth author + label_author_7: Seventh author + label_author_8: Eighth author + label_author_9: Ninth author + label_author_10: Tenth author + label_author_11: Eleventh author + label_author_12: Twelfth author + label_author_13: Thirteenth author + label_author_14: Fourteenth author + label_author_15: Fifteenth author + label_author_16: Sixteenth author + label_author_17: Seventeenth author + label_author_18: Eighteenth author + label_author_19: Nineteenth author + label_author_20: Twentieth author + + mail_subject_publication_added: "You have been added as an author to a new publication" + mail_body_publication_added: "A new publication (%{publication}) has been added to the project '%{project}.'" + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/config/routes.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,3 @@ +ActionController::Routing::Routes.draw do |map| + map.resources :publications, :collection => { :sort_author_order => :post } +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/001_create_authors.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,12 @@ +class CreateAuthors < ActiveRecord::Migration + def self.up + create_table :authors do |t| + t.column :user_id, :integer + t.column :name, :string + end + end + + def self.down + drop_table :authors + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/002_create_publications.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,12 @@ +class CreatePublications < ActiveRecord::Migration + def self.up + create_table :publications do |t| + t.column :title, :string + t.column :reviewed, :boolean, :default => false + end + end + + def self.down + drop_table :publications + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/003_create_authorships.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,16 @@ +class CreateAuthorships < ActiveRecord::Migration + def self.up + create_table :authorships do |t| + t.column :author_id, :integer + t.column :publication_id, :integer + t.column :name_on_paper, :string + t.column :auth_order, :integer + t.column :institution, :string + t.column :email, :string + end + end + + def self.down + drop_table :authorships + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/004_create_bibtex_entries.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,35 @@ +class CreateBibtexEntries < ActiveRecord::Migration + def self.up + create_table :bibtex_entries do |t| + t.column :publication_id, :integer + t.column :entry_type, :integer + t.column :address, :string + t.column :annote, :string + t.column :booktitle, :string + t.column :chapter, :string + t.column :crossref, :string + t.column :edition, :string + t.column :editor, :string + t.column :eprint, :string + t.column :howpublished, :string + t.column :journal, :string + t.column :key, :string + t.column :month, :string + t.column :note, :text + t.column :number, :string + t.column :organization, :string + t.column :pages, :string + t.column :publisher, :string + t.column :school, :string + t.column :series, :string + t.column :type, :string + t.column :url, :string + t.column :volume, :integer + t.column :year, :integer + end + end + + def self.down + drop_table :bibtex_entries + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/005_create_projects_publications_join_table.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,12 @@ +class CreateProjectsPublicationsJoinTable < ActiveRecord::Migration + def self.up + create_table :projects_publications, :id => false do |t| + t.integer :project_id + t.integer :publication_id + end + end + + def self.down + drop_table :projects_publications + end +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/006_create_bibtex_entry_types.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,13 @@ +class CreateBibtexEntryTypes < ActiveRecord::Migration + def self.up + create_table :bibtex_entry_types do |t| + t.string :name + + t.timestamps + end + end + + def self.down + drop_table :bibtex_entry_types + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/007_add_external_url_column_to_publications.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,9 @@ +class AddExternalUrlColumnToPublications < ActiveRecord::Migration + def self.up + add_column :publications, :external_url, :string + end + + def self.down + remove_column :publications, :external_url + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/008_add_doi_and_timestamp_columns_to_publications.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,12 @@ +class AddDoiAndTimestampColumnsToPublications < ActiveRecord::Migration + def self.up + add_column :publications, :doi, :string + add_timestamps :publications + + end + + def self.down + remove_column :publications, :doi + remove_timestamps :publications + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/migrate/009_add_timestamp_columns_to_authors.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,9 @@ +class AddTimestampColumnsToAuthors < ActiveRecord::Migration + def self.up + add_timestamps :authors + end + + def self.down + remove_timestamps :authors + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/db/seed_data/bibtex_entry_types_list.txt Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,14 @@ +inproceedings +conference +article +masterthesis +phdthesis +book +booklet +inbook +incollection +manual +techreport +proceedings +unpublished +misc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/init.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,54 @@ +require 'redmine' +require 'dispatcher' + +require 'bibtex' +require 'citeproc' + +# Patches to the Redmine core. +Dispatcher.to_prepare :redmine_model_dependencies do + require_dependency 'project' + require_dependency 'user' + require_dependency 'mailer' + + unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch + Project.send(:include, Bibliography::ProjectPublicationsPatch) + end + + unless User.included_modules.include? Bibliography::UserAuthorPatch + User.send(:include, Bibliography::UserAuthorPatch) + end + + unless Mailer.included_modules.include? Bibliography::MailerPatch + Mailer.send(:include, Bibliography::MailerPatch) + end + + unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch) + ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch) + end +end + + +# Plugin Info +Redmine::Plugin.register :redmine_bibliography do + name 'Redmine Bibliography plugin' + author 'Chris Cannam, Luis Figueira' + description 'This is a bibliography management plugin for Redmine' + version '0.0.1' + url 'http://example.com/path/to/plugin' + author_url 'http://example.com/about' + + settings :default => { 'menu' => 'Publications' }, :partial => 'settings/bibliography' + + project_module :redmine_bibliography do + permission :publications, { :publications => :index }, :public => true + permission :edit_publication, {:publications => [:edit, :update]} + permission :add_publication, {:publications => [:new, :create]} + permission :delete_publication, {:publications => :destroy} + + end + + # extending the Project Menu + menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, + :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/lang/en.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,2 @@ +# English strings go here +my_label: "My label"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/lib/bibliography/mailer_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,31 @@ +require_dependency 'mailer' + +module Bibliography + module MailerPatch + def self.included(base) # :nodoc: + + # Builds a tmail object used to email the specified user that a publication was created and the user is + # an author of that publication + # + # Example: + # publication_added(user) => tmail object + # Mailer.deliver_add_to_project(user) => sends an email to the registered user + def publication_added(user, publication, project) + + @publication = publication + @project = project + + set_language_if_valid user.language + recipients user.mail + subject l(:mail_subject_publication_added, Setting.app_title) + body :publication_url => url_for( :controller => 'publications', :action => 'show', :id => publication.id ), + :publication_title => publication.title + + render_multipart('publication_added', body) + + end + + + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,25 @@ +require_dependency 'project' + +module Bibliography + module ProjectPublicationsPatch + def self.included(base) + base.class_eval do + has_and_belongs_to_many :publications, :uniq => true + + named_scope :like, lambda {|q| + s = "%#{q.to_s.strip.downcase}%" + {:conditions => ["LOWER(name) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}], + :order => 'name' + } + } + end + end #self.included + + module ProjectMethods + + + + + end #ProjectMethods + end #ProjectPublicationsPatch +end #RedmineBibliography \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,17 @@ +module Bibliography + module ProjectsHelperPatch + + def self.included(base) # :nodoc: + base.send(:include, InstanceMethods) + base.send(:include, PublicationsHelper) + + base.class_eval do + unloadable + end + end + + module InstanceMethods + end + end +end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,45 @@ +require_dependency 'user' + +module Bibliography + module UserAuthorPatch + def self.included(base) + base.send(:include, InstanceMethods) + extend ClassMethods + + end #self.included + + module ClassMethods + end + + module InstanceMethods + + def institution + unless self.ssamr_user_detail.nil? + institution_name = self.ssamr_user_detail.institution_name + else + institution_name = "No Institution Set" + end + return institution_name + end + + def get_author_info + # TODO: DELETE THIS METHOD?? + info = { + :name_on_paper => self.name, + :email => self.mail, + :institution => "", + :author_user_id => self.id, + :is_user => "1" + } + + if not self.ssamr_user_detail.nil? + info[:institution] = self.ssamr_user_detail.institution_name + end + + return info + end + + end #InstanceMethods + + end #UserPublicationsPatch +end #RedmineBibliography
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/lib/tasks/seed_bibtex_entry_types.rake Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,20 @@ +namespace :redmine do + namespace :plugins do + namespace :redmine_bibliography do + + task :seed_bibtex_entry_types => :environment do + desc "Seeds the Bibtex Entry Types Table" + + quoted = ActiveRecord::Base.connection.quote_table_name('bibtex_entry_types') + ActiveRecord::Base.connection.execute("TRUNCATE #{quoted}") + + open(File.dirname(__FILE__) + "/../../db/seed_data/bibtex_entry_types_list.txt") do |bibtex_entry_types| + bibtex_entry_types.read.each_line do |bibtex_entry_type| + BibtexEntryType.create(:name => bibtex_entry_type.chomp) + end + end + end + + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/fixtures/authors.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,17 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html +one: + id: 1 + user_id: + name: MyString +two: + id: 2 + user_id: + name: MyString +one: + id: 3 + user_id: + name: MyString +two: + id: 4 + user_id: + name: MyString
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/fixtures/authorships.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,33 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html +one: + id: 1 + author_id: 1 + publication_id: 1 + name_on_paper: Yih-Farn R. Chen + order: 1 + institution: + email: MyString +two: + id: 2 + author_id: 2 + publication_id: 1 + name_on_paper: Glenn S. Fowler + order: 2 + institution: + email: MyString +three: + id: 3 + author_id: 1 + publication_id: 1 + name_on_paper: Yih-Farn R. Chen + order: 1 + institution: + email: MyString +four: + id: 4 + author_id: 2 + publication_id: 1 + name_on_paper: Glenn S. Fowler + order: 2 + institution: + email: MyString
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/fixtures/bibtex_entries.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,6 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html +one: + id: 1 + entry_type: InProceedings + booktitle: International Conference on Software Maintenance + year: 1995
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/fixtures/publications.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,9 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html +one: + id: 1 + title: Test Fixture Title No1 + bibtex_entry_id: 1 +two: + id: 2 + title: MyString + bibtex_entry_id: MyString
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/functional/authors_controller_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,8 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class AuthorsControllerTest < ActionController::TestCase + # Replace this with your real tests. + def test_truth + assert true + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/functional/authorships_controller_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,8 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class AuthorshipsControllerTest < ActionController::TestCase + # Replace this with your real tests. + def test_truth + assert true + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/functional/publications_controller_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,8 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class PublicationsControllerTest < ActionController::TestCase + # Replace this with your real tests. + def test_truth + assert true + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/test_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,24 @@ +# Load the normal Rails helper +require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper') +require 'publications_controller' + +# Ensure that we are using the temporary fixture path +Engines::Testing.set_fixture_path + +class BibliographyControllerTest < ActionController::TestCase + fixtures :all + + def setup + end + + def test_publication + + end + + + def test_routing + assert_routing( + {:method => :get, :path => '/requirements'}, + :controller => 'requirements', :action => 'index' + ) + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/unit/author_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class AuthorTest < ActiveSupport::TestCase + fixtures :authors + + # Replace this with your real tests. + def test_truth + assert true + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/unit/authorship_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class AuthorshipTest < ActiveSupport::TestCase + fixtures :authorships + + # Replace this with your real tests. + def test_truth + assert true + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/unit/bibtex_entry_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class BibtexEntryTest < ActiveSupport::TestCase + fixtures :bibtex_entries + + # Replace this with your real tests. + def test_truth + assert true + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_bibliography/test/unit/publication_test.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,10 @@ +require File.dirname(__FILE__) + '/../test_helper' + +class PublicationTest < ActiveSupport::TestCase + fixtures :publications + + # Replace this with your real tests. + def test_truth + assert true + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/README.rdoc Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,43 @@ += Redmine Checkout plugin + +Author:: Holger Just +URL:: http://dev.holgerjust.de/projects/redmine-checkout + +This plugin to Redmine adds a link to the actual repository to the GUI. + +This plugin includes ZeroClipboard[http://code.google.com/p/zeroclipboard/] +by Joseph Huckaby. This software is licensed under the +{GNU Lesser General Public License}[http://www.gnu.org/licenses/lgpl.html]. + +Copyright (c) 2009, 2010 Holger Just + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + += Installation + +The installation follows the standard installation path from +http://www.redmine.org/projects/redmine/wiki/Plugins + +1. Copy the software to the vendor/plugins directory. Make sure that the name + of the directory is redmine_checkout. +2. Run rake db:migrate_plugins RAILS_ENV=production +3. Restart Redmine
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/Rakefile Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby +require 'redmine_plugin_support' + +Dir[File.expand_path(File.dirname(__FILE__)) + "/lib/tasks/**/*.rake"].sort.each { |ext| load ext } + +RedminePluginSupport::Base.setup do |plugin| + plugin.project_name = 'redmine_checkout' + plugin.default_task = [:spec] + plugin.tasks = [:doc, :release, :clean, :spec, :stats] +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/app/views/projects/settings/_repository_checkout.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,54 @@ +<p><%= form.select(:checkout_overwrite, [ + [l(:general_text_Yes), "1"], + [l(:general_text_No), "0"] + ], + {}, + :onchange => <<-EOF + Effect.toggle($('checkout_settings'), 'slide', {duration:0.2}); + EOF + )%></p> + +<div id="checkout_settings" <%= 'style="display:none;"' unless form.object.checkout_overwrite? %>><fieldset> + <legend><%=l :label_checkout %></legend> + + <p><%= form.text_area :checkout_description, :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p> + <%= wikitoolbar_for 'repository_checkout_description' %> + + <% if form.object.scm_name == 'Subversion' %> + <p><%= form.select :checkout_display_login,[ + [l(:label_display_login_none), ''], + [l(:label_display_login_username), 'username'], + [l(:label_display_login_password), 'password'] + ], + :label => :setting_checkout_display_login %></p> + <% end %> + + <p><%= form.check_box :checkout_display_command %></p> + + <% javascript_tag do %> + protocolForm = new Subform( + '<%= escape_javascript(render(:partial => "projects/settings/repository_checkout_protocol", :locals => {:protocol => Checkout::Protocol.new({:protocol => form.object.scm_name, :append_path => form.object.allow_subtree_checkout? ? 1: 0, :repository => form.object})})) %>', + <%= form.object.checkout_protocols.length %>, + 'checkout_protocol_table' + ); + <% end %> + <p><label><%=l :label_protocol_plural %></label><%=l :help_repository_checkout_protocols %></p> + <%= hidden_field_tag 'repository[checkout_protocols][-1][protocol]', 'empty' %> + <table class="list checkout_protocol_table"> + <thead><tr> + <th class="protocol_protocol" ><%= l(:setting_protocol)%></th> + <th class="protocol_command" ><%= l(:setting_checkout_command)%></th> + <th class="protocol_fixed_url" ><%= l(:setting_checkout_fixed_url) %></th> + <th class="protocol_access" ><%= l(:label_permissions) %></th> + <th class="protocol_append_path"><%= l(:label_append_path) %></th> + <th class="protocol_is_default" ><%= l(:label_default) %></th> + <th class="protocol_delete" ></th> + </tr></thead> + <tbody id="checkout_protocol_table"> + <% form.object.checkout_protocols.each_with_index do |protocol, index| %> + <%= render :partial => 'projects/settings/repository_checkout_protocol', :locals => {:protocol => protocol, :index => index, :classes => cycle('odd', 'even')} %> + <% end %> + </tbody> + </table> + <div style="text-align: right"><%= link_to_function l(:button_add_protocol), "protocolForm.add()", {:class => "icon icon-add"} %></div> +</fieldset></div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/app/views/projects/settings/_repository_checkout_protocol.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,18 @@ +<% + index ||= "--INDEX--" + classes ||= "" + + protocol = Checkout::Protocol.new(protocol) unless protocol.is_a? Checkout::Protocol +%> +<tr id="<%= "checkout_protocols_#{index}" %>" class="<%= classes %>" <%= 'style="display:none"' if index == '--INDEX--' %>> + <td class="protocol_protocol"><%= text_field_tag "repository[checkout_protocols][#{index}][protocol]", protocol.protocol, :size => 10 %></td> + <td class="protocol_command"><%= text_field_tag "repository[checkout_protocols][#{index}][command]", protocol.command, :size => 15 %></td> + <td class="protocol_fixed_url"><%= text_field_tag "repository[checkout_protocols][#{index}][fixed_url]", protocol.fixed_url, :size => 60 %></td> + <td class="protocol_access"><%= select_tag "repository[checkout_protocols][#{index}][access]", options_for_select([ + [l(:label_access_read_write), 'read+write'], + [l(:label_access_read_only), 'read-only'], + [l(:label_access_permission), 'permission']], protocol.access) %></td> + <td class="protocol_append_path"><%= check_box_tag "repository[checkout_protocols][#{index}][append_path]", 1, protocol.append_path? %></td> + <td class="protocol_is_default"><%= check_box_tag "repository[checkout_protocols][#{index}][is_default]", 1, protocol.default? %></td> + <td class="protocol_delete"><%= image_to_function 'delete.png', "var e=$('checkout_protocols_#{index}');var parent=e.up(\"tbody\");e.remove();recalculate_even_odd(parent);return false" %></td> +</tr>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/app/views/redmine_checkout_hooks/_view_repositories_show_contextual.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,52 @@ +<div class="repository-info"> + <% if repository.checkout_description.present? %> + <div class="wiki<%= ' bottomline' if protocols.present? %>"><%= textilizable repository.checkout_description %></div> + <% end %> + <% if protocols.present? %> + <div id="checkout_box"> + <ul id="checkout_protocols"> + <% protocols.each do |p| -%> + <li> + <a <%= 'class="selected"' if p == default_protocol %> id="checkout_protocol_<%= p.protocol.to_s.underscore %>" data-permission="<%= p.access_rw(User.current) %>" href="<%= URI.escape p.url(checkout_path) %>"><%=h p.protocol %></a> + </li> + <% end -%> + </ul> + <%= text_field_tag :checkout_url, h(default_protocol.full_command(checkout_path)), :readonly => true %> + <%- if Setting.checkout_use_zero_clipboard? %> + <div id="clipboard_container" title="<%= l(:label_copy_to_clipboard) %>" style="display: none;"> + <div id="clipboard_button"><%= image_tag 'paste.png', :plugin => 'redmine_checkout' %></div> + </div> + <% end -%> + + <p> + <% if User.current.logged? %> + <% if repository.is_external? %> + <%=l :label_access_type_all, :type => l(:label_access_read_only) %> + <% else %> + <% if default_protocol %><%=l :label_access_type, :type => l(default_protocol.access_label(User.current)) %><% end %> + <% end %> + <% else %> + + <% end %> + </p> + + <% javascript_tag do %> + var checkout_access = $H({<%= protocols.inject([]){|r,p| r << "'checkout_protocol_#{p.protocol.to_s.underscore}': '#{l(p.access_label(User.current))}'"}.join(', ') %>}); + var checkout_commands = $H({<%= protocols.inject([]){|r,p| r << "'checkout_protocol_#{p.protocol.to_s.underscore}': '#{escape_javascript(p.full_command(checkout_path))}'"}.join(', ') %>}); + <%- if Setting.checkout_use_zero_clipboard? %>ZeroClipboard.setMoviePath( '<%= image_path('ZeroClipboard.swf', :plugin => 'redmine_checkout') %>' );<% end %> + <% end %> + </div> + <% end%> + <% if repository.is_external? %> + <div style="clear: left"> + </div> + <p class="topline" style="padding-top: 1em"><%= l(:text_repository_external, :location => repository.external_url) %></p> + <% end %> +</div> +<div style="clear: left"></div> + +<% content_for :header_tags do %> + <%= stylesheet_link_tag 'checkout', :plugin => 'redmine_checkout' %> + <%= javascript_include_tag 'checkout', :plugin => 'redmine_checkout' %> + <%= (javascript_include_tag 'ZeroClipboard', :plugin => 'redmine_checkout') if Setting.checkout_use_zero_clipboard? %> +<% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/app/views/settings/_checkout.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,43 @@ +<% form_tag({:action => 'edit', :tab => 'checkout'}) do %> + +<% javascript_tag do %> +protocolForms = $H(); + +document.observe("dom:loaded", function() { + $('tab-content-checkout').select('fieldset.collapsed').each(function(e){ + e.down('div').hide(); + }); + <% + CheckoutHelper.supported_scm.select{|scm| Setting.enabled_scm.include?(scm)}.each do |scm| + next if Setting.send("checkout_overwrite_description_#{scm}?") + -%> + $('settings_checkout_description_<%= scm %>').up('div').up('div').hide(); + <%- end %> +}); +<% end %> + + +<div class="box tabular settings"> +<p><%= setting_check_box :checkout_display_checkout_info %></p> + +<p><%= setting_text_area :checkout_description_Abstract, :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p> +<%= wikitoolbar_for 'settings_checkout_description_Abstract' %> + +<p><%= setting_check_box :checkout_use_zero_clipboard %></p> + +<% CheckoutHelper.supported_scm.select{|scm| Setting.enabled_scm.include?(scm)}.each do |scm| -%> +<fieldset class="collapsible collapsed"> + <legend onclick="toggleFieldset(this);"><%= "Repository::#{scm}".constantize.scm_name %></legend> + <div><%= render :partial => 'checkout_scm', :locals => {:scm => scm} %></div> +</fieldset> +<%- end %> + +</div> + +<%= submit_tag l(:button_save) %> +<%- end %> + +<% content_for :header_tags do %> + <%= javascript_include_tag 'subform', :plugin => 'redmine_checkout' %> + <%= stylesheet_link_tag 'checkout', :plugin => 'redmine_checkout' %> +<% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/app/views/settings/_checkout_protocol.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,19 @@ +<% + index ||= "--INDEX--" + classes ||= "" + + protocol = Checkout::Protocol.new(protocol) unless protocol.is_a? Checkout::Protocol +%> +<tr id="<%= "checkout_protocols_#{scm}_#{index}" %>" class="<%= classes %>" <%= 'style="display:none"' if index == '--INDEX--' %>> + <td class="protocol_protocol" ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][protocol]", protocol.protocol, :size => 10 %></td> + <td class="protocol_command" ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][command]", protocol.command, :size => 15 %></td> + <td class="protocol_regex" ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][regex]", protocol.regex, :size => 30 %></td> + <td class="protocol_regex_replacement"><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][regex_replacement]", protocol.regex_replacement, :size => 30 %></td> + <td class="protocol_access" ><%= select_tag "settings[checkout_protocols_#{scm}][#{index}][access]", options_for_select([ + [l(:label_access_read_write), 'read+write'], + [l(:label_access_read_only), 'read-only'], + [l(:label_access_permission), 'permission']], protocol.access) %></td> + <td class="protocol_append_path"><%= check_box_tag "settings[checkout_protocols_#{scm}][#{index}][append_path]", 1, protocol.append_path? %></td> + <td class="protocol_is_default"><%= check_box_tag "settings[checkout_protocols_#{scm}][#{index}][is_default]", 1, protocol.default? %></td> + <td class="protocol_delete"><%= image_to_function 'delete.png', "var e=$('checkout_protocols_#{scm}_#{index}');var parent=e.up(\"tbody\");e.remove();recalculate_even_odd(parent);return false" %></td> +</tr>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/app/views/settings/_checkout_scm.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,46 @@ +<div> + <p><%= setting_check_box "checkout_overwrite_description_#{scm}", :label => :setting_checkout_overwrite_description, :onclick => <<-EOF + Effect.toggle($('settings_checkout_description_#{scm}').up("div").up("div"), 'slide', {duration:0.2}); + EOF + %></p> + + <div> + <p><%= setting_text_area "checkout_description_#{scm}", :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p> + <%= wikitoolbar_for "settings_checkout_description_#{scm}" %> + </div> + + <% if scm == 'Subversion' %> + <p><%= setting_select "checkout_display_login",[ + [l(:label_display_login_username), 'username'], + [l(:label_display_login_password), 'password'] + ], + :blank => :label_display_login_none %></p> + <% end %> + + <p><%= setting_check_box "checkout_display_command_#{scm}", :label => :field_checkout_display_command %></p> + + <% javascript_tag do %> + <% repo = "Repository::#{scm}".constantize %> + var subform = new Subform('<%= escape_javascript(render(:partial => "checkout_protocol", :locals => {:protocol => Checkout::Protocol.new({:protocol => repo.scm_name, :append_path => (repo.allow_subtree_checkout? ? '1' : '0'), :command => repo.checkout_default_command}), :scm => scm})) %>',<%= Setting.send("checkout_protocols_#{scm}").length %>,'settings_checkout_protocols_<%= scm %>'); + protocolForms.set('<%= scm %>', subform); + <% end %> + <p><label><%=l :label_protocol_plural %></label><%=l :help_checkout_protocols %></p> + <table class="list checkout_protocol_table"> + <thead><tr> + <th class="protocol_protocol" ><%= l(:setting_protocol)%></th> + <th class="protocol_command" ><%= l(:setting_checkout_command)%></th> + <th class="protocol_regex" ><%= l(:setting_checkout_url_regex) %></th> + <th class="protocol_regex_replacement"><%= l(:setting_checkout_url_regex_replacement) %></th> + <th class="protocol_access" ><%= l(:label_permissions) %></th> + <th class="protocol_append_path" ><%= l(:label_append_path) %></th> + <th class="protocol_is_default" ><%= l(:label_default) %></th> + <th class="protocol_delete" ></th> + </tr></thead> + <tbody id="settings_checkout_protocols_<%= scm %>"> + <% Setting.send("checkout_protocols_#{scm}").each_with_index do |protocol, index| %> + <%= render :partial => 'checkout_protocol', :locals => {:protocol => Checkout::Protocol.new(protocol), :scm => scm, :index => index, :classes => cycle('odd', 'even')} %> + <% end %> + </tbody> + </table> + <div style="text-align: right"><%= link_to_function l(:button_add_protocol), "protocolForms.get('#{scm}').add()", {:class => "icon icon-add"} %></div> +</div>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/app/views/settings/_redmine_checkout.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,1 @@ +<%=l(:help_moved_settings, :link => link_to(l(:label_settings_location), {:controller => 'settings', :action => 'index', :tab => 'checkout'})) %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/images/ZeroClipboard.as Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,81 @@ +package { + // Simple Set Clipboard System + // Author: Joseph Huckaby + + import flash.display.Stage; + import flash.display.Sprite; + import flash.display.LoaderInfo; + import flash.display.StageScaleMode; + import flash.events.*; + import flash.display.StageAlign; + import flash.display.StageScaleMode; + import flash.external.ExternalInterface; + import flash.system.Security; + import flash.utils.*; + import flash.system.System; + + public class ZeroClipboard extends Sprite { + + private var id:String = ''; + private var button:Sprite; + private var clipText:String = ''; + + public function ZeroClipboard() { + // constructor, setup event listeners and external interfaces + stage.scaleMode = StageScaleMode.EXACT_FIT; + flash.system.Security.allowDomain("*"); + + // import flashvars + var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters; + id = flashvars.id; + + // invisible button covers entire stage + button = new Sprite(); + button.buttonMode = true; + button.useHandCursor = true; + button.graphics.beginFill(0xCCFF00); + button.graphics.drawRect(0, 0, Math.floor(flashvars.width), Math.floor(flashvars.height)); + button.alpha = 0.0; + addChild(button); + button.addEventListener(MouseEvent.CLICK, clickHandler); + + button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event) { + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOver', null ); + } ); + button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event) { + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOut', null ); + } ); + button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event) { + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseDown', null ); + } ); + button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event) { + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseUp', null ); + } ); + + // external functions + ExternalInterface.addCallback("setHandCursor", setHandCursor); + ExternalInterface.addCallback("setText", setText); + + // signal to the browser that we are ready + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'load', null ); + } + + public function setText(newText) { + // set the maximum number of files allowed + clipText = newText; + } + + public function setHandCursor(enabled:Boolean) { + // control whether the hand cursor is shown on rollover (true) + // or the default arrow cursor (false) + button.useHandCursor = enabled; + } + + private function clickHandler(event:Event):void { + // user click copies text to clipboard + // as of flash player 10, this MUST happen from an in-movie flash click event + System.setClipboard( clipText ); + ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'complete', clipText ); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/images/button.svg Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,11 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> + <defs> + <linearGradient id="gradient" x1="100%" y1="100%"> + <stop offset="0%" style="stop-color:#ddd; stop-opacity:1" /> + <stop offset="100%" style="stop-color:#f8f8f8; stop-opacity:1" /> + </linearGradient> + </defs> + <rect width="100%" height="100%" style="fill:url(#gradient)"/> +</svg> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/images/button_focus.svg Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,11 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> + <defs> + <linearGradient id="gradient" x1="100%" y1="100%"> + <stop offset="0%" style="stop-color:#507AAA; stop-opacity:1" /> + <stop offset="100%" style="stop-color:#759fcf; stop-opacity:1" /> + </linearGradient> + </defs> + <rect width="100%" height="100%" style="fill:url(#gradient)"/> +</svg> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/images/button_selected.svg Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,11 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> + <defs> + <linearGradient id="gradient" x1="100%" y1="100%"> + <stop offset="0%" style="stop-color:#aaa; stop-opacity:1" /> + <stop offset="100%" style="stop-color:#ccc; stop-opacity:1" /> + </linearGradient> + </defs> + <rect width="100%" height="100%" style="fill:url(#gradient)"/> +</svg> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/javascripts/ZeroClipboard.js Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,311 @@ +// Simple Set Clipboard System +// Author: Joseph Huckaby + +var ZeroClipboard = { + + version: "1.0.7", + clients: {}, // registered upload clients on page, indexed by id + moviePath: 'ZeroClipboard.swf', // URL to movie + nextId: 1, // ID of next movie + + $: function(thingy) { + // simple DOM lookup utility function + if (typeof(thingy) == 'string') thingy = document.getElementById(thingy); + if (!thingy.addClass) { + // extend element with a few useful methods + thingy.hide = function() { this.style.display = 'none'; }; + thingy.show = function() { this.style.display = ''; }; + thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; }; + thingy.removeClass = function(name) { + var classes = this.className.split(/\s+/); + var idx = -1; + for (var k = 0; k < classes.length; k++) { + if (classes[k] == name) { idx = k; k = classes.length; } + } + if (idx > -1) { + classes.splice( idx, 1 ); + this.className = classes.join(' '); + } + return this; + }; + thingy.hasClass = function(name) { + return !!this.className.match( new RegExp("\\s*" + name + "\\s*") ); + }; + } + return thingy; + }, + + setMoviePath: function(path) { + // set path to ZeroClipboard.swf + this.moviePath = path; + }, + + dispatch: function(id, eventName, args) { + // receive event from flash movie, send to client + var client = this.clients[id]; + if (client) { + client.receiveEvent(eventName, args); + } + }, + + register: function(id, client) { + // register new client to receive events + this.clients[id] = client; + }, + + getDOMObjectPosition: function(obj, stopObj) { + // get absolute coordinates for dom element + var info = { + left: 0, + top: 0, + width: obj.width ? obj.width : obj.offsetWidth, + height: obj.height ? obj.height : obj.offsetHeight + }; + + while (obj && (obj != stopObj)) { + info.left += obj.offsetLeft; + info.top += obj.offsetTop; + obj = obj.offsetParent; + } + + return info; + }, + + Client: function(elem) { + // constructor for new simple upload client + this.handlers = {}; + + // unique ID + this.id = ZeroClipboard.nextId++; + this.movieId = 'ZeroClipboardMovie_' + this.id; + + // register client with singleton to receive flash events + ZeroClipboard.register(this.id, this); + + // create movie + if (elem) this.glue(elem); + } +}; + +ZeroClipboard.Client.prototype = { + + id: 0, // unique ID for us + ready: false, // whether movie is ready to receive events or not + movie: null, // reference to movie object + clipText: '', // text to copy to clipboard + handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor + cssEffects: true, // enable CSS mouse effects on dom container + handlers: null, // user event handlers + + glue: function(elem, appendElem, stylesToAdd) { + // glue to DOM element + // elem can be ID or actual DOM element object + this.domElement = ZeroClipboard.$(elem); + + // float just above object, or zIndex 99 if dom element isn't set + var zIndex = 99; + if (this.domElement.style.zIndex) { + zIndex = parseInt(this.domElement.style.zIndex, 10) + 1; + } + + if (typeof(appendElem) == 'string') { + appendElem = ZeroClipboard.$(appendElem); + } + else if (typeof(appendElem) == 'undefined') { + appendElem = document.getElementsByTagName('body')[0]; + } + + // find X/Y position of domElement + var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem); + + // create floating DIV above element + this.div = document.createElement('div'); + var style = this.div.style; + style.position = 'absolute'; + style.left = '' + box.left + 'px'; + style.top = '' + box.top + 'px'; + style.width = '' + box.width + 'px'; + style.height = '' + box.height + 'px'; + style.zIndex = zIndex; + + if (typeof(stylesToAdd) == 'object') { + for (addedStyle in stylesToAdd) { + style[addedStyle] = stylesToAdd[addedStyle]; + } + } + + // style.backgroundColor = '#f00'; // debug + + appendElem.appendChild(this.div); + + this.div.innerHTML = this.getHTML( box.width, box.height ); + }, + + getHTML: function(width, height) { + // return HTML for movie + var html = ''; + var flashvars = 'id=' + this.id + + '&width=' + width + + '&height=' + height; + + if (navigator.userAgent.match(/MSIE/)) { + // IE gets an OBJECT tag + var protocol = location.href.match(/^https/i) ? 'https://' : 'http://'; + html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>'; + } + else { + // all other browsers get an EMBED tag + html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />'; + } + return html; + }, + + hide: function() { + // temporarily hide floater offscreen + if (this.div) { + this.div.style.left = '-2000px'; + } + }, + + show: function() { + // show ourselves after a call to hide() + this.reposition(); + }, + + destroy: function() { + // destroy control and floater + if (this.domElement && this.div) { + this.hide(); + this.div.innerHTML = ''; + + var body = document.getElementsByTagName('body')[0]; + try { body.removeChild( this.div ); } catch(e) {;} + + this.domElement = null; + this.div = null; + } + }, + + reposition: function(elem) { + // reposition our floating div, optionally to new container + // warning: container CANNOT change size, only position + if (elem) { + this.domElement = ZeroClipboard.$(elem); + if (!this.domElement) this.hide(); + } + + if (this.domElement && this.div) { + var box = ZeroClipboard.getDOMObjectPosition(this.domElement); + var style = this.div.style; + style.left = '' + box.left + 'px'; + style.top = '' + box.top + 'px'; + } + }, + + setText: function(newText) { + // set text to be copied to clipboard + this.clipText = newText; + if (this.ready) this.movie.setText(newText); + }, + + addEventListener: function(eventName, func) { + // add user event listener for event + // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel + eventName = eventName.toString().toLowerCase().replace(/^on/, ''); + if (!this.handlers[eventName]) this.handlers[eventName] = []; + this.handlers[eventName].push(func); + }, + + setHandCursor: function(enabled) { + // enable hand cursor (true), or default arrow cursor (false) + this.handCursorEnabled = enabled; + if (this.ready) this.movie.setHandCursor(enabled); + }, + + setCSSEffects: function(enabled) { + // enable or disable CSS effects on DOM container + this.cssEffects = !!enabled; + }, + + receiveEvent: function(eventName, args) { + // receive event from flash + eventName = eventName.toString().toLowerCase().replace(/^on/, ''); + + // special behavior for certain events + switch (eventName) { + case 'load': + // movie claims it is ready, but in IE this isn't always the case... + // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function + this.movie = document.getElementById(this.movieId); + if (!this.movie) { + var self = this; + setTimeout( function() { self.receiveEvent('load', null); }, 1 ); + return; + } + + // firefox on pc needs a "kick" in order to set these in certain cases + if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) { + var self = this; + setTimeout( function() { self.receiveEvent('load', null); }, 100 ); + this.ready = true; + return; + } + + this.ready = true; + this.movie.setText( this.clipText ); + this.movie.setHandCursor( this.handCursorEnabled ); + break; + + case 'mouseover': + if (this.domElement && this.cssEffects) { + this.domElement.addClass('hover'); + if (this.recoverActive) this.domElement.addClass('active'); + } + break; + + case 'mouseout': + if (this.domElement && this.cssEffects) { + this.recoverActive = false; + if (this.domElement.hasClass('active')) { + this.domElement.removeClass('active'); + this.recoverActive = true; + } + this.domElement.removeClass('hover'); + } + break; + + case 'mousedown': + if (this.domElement && this.cssEffects) { + this.domElement.addClass('active'); + } + break; + + case 'mouseup': + if (this.domElement && this.cssEffects) { + this.domElement.removeClass('active'); + this.recoverActive = false; + } + break; + } // switch eventName + + if (this.handlers[eventName]) { + for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) { + var func = this.handlers[eventName][idx]; + + if (typeof(func) == 'function') { + // actual function reference + func(this, args); + } + else if ((typeof(func) == 'object') && (func.length == 2)) { + // PHP style object + method, i.e. [myObject, 'myMethod'] + func[0][ func[1] ](this, args); + } + else if (typeof(func) == 'string') { + // name of function + window[func](this, args); + } + } // foreach event handler defined + } // user defined handler for event + } + +};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/javascripts/checkout.js Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,33 @@ +document.observe("dom:loaded", function() { + /* update the checkout URL if clicked on a protocol */ + $('checkout_protocols').select('a').each(function(e) { + e.observe('click', function(event) { + $('checkout_url').value = checkout_commands.get(this.id); + $('checkout_protocols').select('a').each(function(e) { + e.removeClassName("selected"); + }); + this.addClassName("selected") + + var value = checkout_access.get(this.id); + $('checkout_access').innerHTML = value; + + event.stop(); + }); + }); + /* select the text field contents if activated */ + Event.observe('checkout_url', 'click', function(event) { + this.activate(); + }); + + if (typeof('ZeroClipboard') != 'undefined') { + $('clipboard_container').show(); + clipboard = new ZeroClipboard.Client(); + clipboard.setHandCursor( true ); + clipboard.glue('clipboard_button', 'clipboard_container'); + + clipboard.addEventListener('mouseOver', function (client) { + clipboard.setText( $('checkout_url').value ); + }); + } +}); +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/javascripts/subform.js Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,45 @@ +var Subform = Class.create({ + lineIndex: 1, + parentElement: "", + initialize: function(rawHTML, lineIndex, parentElement) { + this.rawHTML = rawHTML; + this.lineIndex = lineIndex; + this.parentElement = parentElement; + }, + + parsedHTML: function() { + return this.rawHTML.replace(/--INDEX--/g, this.lineIndex++); + }, + + add: function() { + var e = $(this.parentElement); + Element.insert(e, { bottom: this.parsedHTML()}); + Effect.toggle(e.childElements().last(), 'slide', {duration:0.2}); + recalculate_even_odd(e); + }, + + add_after: function(e) { + Element.insert(e, { after: this.parsedHTML()}); + Effect.toggle(e.next(), 'slide', {duration:0.2}); + recalculate_even_odd($(this.parentElement)); + }, + + add_on_top: function() { + var e = $(this.parentElement); + Element.insert(e, { top: this.parsedHTML()}); + Effect.toggle(e.childElements().first(), 'slide', {duration:0.2}); + recalculate_even_odd(e); + } +}); + +function recalculate_even_odd(element) { + $A(element.childElements()).inject( + 0, + function(acc, e) + { + e.removeClassName("even"); + e.removeClassName("odd"); + e.addClassName( (acc%2==0) ? "odd" : "even"); return ++acc; + } + ) +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/stylesheets/checkout.css Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,166 @@ +/* Uncomment the following line for nicer tables if you use the alternate theme (or derived). */ +/* @import url(checkout_alternate.css); */ + +table.checkout_protocol_table td { padding-right: 6px; vertical-align: middle; /* Double the border with of text input boxes */ } +table.checkout_protocol_table td.protocol_access { padding-right: 0; } +table.checkout_protocol_table td input[type=text], .checkout_protocol_table td select { width: 100%; } +table.checkout_protocol_table td.protocol_delete { width: 16px; } +table.checkout_protocol_table td.protocol_append_path, table.checkout_protocol_table td.protocol_is_default { text-align: center; } + +.icon-changeset { background-image: url(../../../images/changeset.png);} + +.repository-info { + background-color: #eee; + border: 1px solid #E4E4E4; + padding: 0 10px; + margin: 4px 0 10px; +} + +.bottomline { + border-bottom: 1px solid #ccc; +} + +.topline { + border-top: 1px solid #ccc; +} + +#checkout_box { + margin: 10px 0; +} + +#checkout_protocols { + height: 23px; + float: left; + margin: 0; + padding: 0; +} + +#checkout_protocols li { + float: left; + list-style-type: none; + margin: 0; + padding: 0; +} + +#checkout_protocols li:first-child a { + border-left-width: 1px; + + /* Standard, Opera 10, IE 9 */ + border-top-left-radius: 3px; + border-bottom-left-radius: 3px; + /* Konquerer */ + -khtml-border-top-left-radius: 3px; + -khtml-border-bottom-left-radius: 3px; + /* Gecko (Firefox, ...) */ + -moz-border-radius: 3px 0 0 3px; + /* Webkit (Chrome, Safari, ...) */ + -webkit-border-top-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + /* IE <= 9 not supported */ +} + +#checkout_protocols li a, +#clipboard_button { + background-color: #eee; + background: url(../images/button.svg) 0 0 no-repeat; /* Opera needs an "image" :( - using svg for this so it will scale properly without looking too ugly */ + background: -khtml-gradient(linear, left top, left bottom, from(#f8f8f8), to(#ddd)); /* Konquerer */ + background: -moz-linear-gradient(top, #f8f8f8, #ddd); /* Gecko (Firefox, ...) */ + background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#ddd)); /* Webkit (Chrome, Safari, ...) */ + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f8f8f8', endColorstr='#dddddd'); /* IE 5.5 - 7 */ + -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f8f8f8', endColorstr='#dddddd'); /* IE 8 */ + + border-color: #bbb; + border-style: solid; + border-width: 1px 1px 1px 0; + + color: #333; + display: block; + font-size: 11px; + font-weight: bold; + line-height: 21px; + margin: 0; + padding: 0 10px 0 11px; + text-decoration: none; + text-shadow: 1px 1px 0 #fff; + position: relative; /* to please IE */ +} + +#checkout_protocols li a:hover, +#checkout_protocols li a:focus { + background-color: #507AAA; + background: url(../images/button_focus.svg) 0 0 no-repeat; /* Opera needs an "image" :( - using svg for this so it will scale properly without looking too ugly */ + background: -khtml-gradient(linear, left top, left bottom, from(#759fcf), to(#507AAA)); /* Konquerer */ + background: -moz-linear-gradient(top, #759fcf, #507AAA); /* Gecko (Firefox, ...) */ + background: -webkit-gradient(linear, left top, left bottom, from(#759fcf), to(#507AAA)); /* Webkit (Chrome, Safari, ...) */ + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#759fcf', endColorstr='#507AAA'); /* IE 5.5 - IE 7 */ + -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#759fcf', endColorstr='#507AAA'); /* IE 8 */ + + color: #fff; + text-shadow: -1px -1px 0 rgba(0,0,0,0.4); + border-top-color: #759fcf; + border-bottom-color: #507AAA; +} + +#checkout_protocols li a.selected, +#clipboard_button.active { + background-color: #bbb; + background: url(../images/button_selected.svg) 0 0 no-repeat; /* Opera needs an "image" :( - using svg for this so it will scale properly without looking too ugly */ + background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#aaa)); /* Konquerer */ + background: -moz-linear-gradient(top, #ccc, #aaa); /* Gecko (Firefox, ...) */ + background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#aaa)); /* Webkit (Chrome, Safari, ...) */ + filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#aaaaaa'); /* IE 5.5 - IE 7 */ + -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#aaaaaa'); /* IE 8 */ + + color: #000; + text-shadow: 1px 1px 0 rgba(255,255,255,0.4); + border-color: #bbb; +} + +#checkout_url { + border: 1px solid #bbb; + border-width: 1px 1px 1px 0; + background-color: #fff; + color: #000; + font-size: 11px; + height: 16px; + padding: 3px 5px 2px; + width: 400px; + font-family: Monaco,"DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace; + margin: 0 5px 0 0; + float: left; +} + +#checkout_box p { + color: #666; + line-height: 23px; + font-size: 11px; + margin: 0 0 0 5px; +} + +span#checkout_access { + font-weight: bold; +} + +#clipboard_container { + position: relative; + float: left; + margin-right: 5px; +} + +#clipboard_button { + height: 21px; + width: 23px; + padding: 0; + border-width: 1px; + text-align: center; + + border-radius: 5px; /* Standard, Opera 10, IE 9 */ + -khtml-border-radius: 3px; /* Konquerer */ + -moz-border-radius: 3px ; /* Gecko (Firefox, ...) */ + -webkit-border-radius: 3px; /* Webkit (Chrome, Safari, ...) */ + /* IE <= 9 not supported */ +} + +#clipboard_button img { + padding-top: 2px; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/assets/stylesheets/checkout_alternate.css Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,2 @@ +table.checkout_protocol_table td { padding-right: 10px !important; /* Double the border with of text input boxes */ } +table.checkout_protocol_table td.protocol_access { padding-right: 2px !important; }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/de.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,39 @@ +de: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Checkout-Informationen anzeigen" + setting_checkout_fixed_url: "Checkout-URL" + setting_checkout_url_regex: "Regulärer Ausdruck" + setting_checkout_url_regex_replacement: "Ersatztext" + setting_checkout_display_login: "Mitgliedsnamen anzeigen" + setting_checkout_command: "Checkout-Befehl" + setting_checkout_use_zero_clipboard: "Zwischenablagen-Helfer anzeigen" + + setting_checkout_overwrite_description: "Standard-Beschreibung überschreiben" + field_checkout_overwrite: "Überschreibe Standardeinstellung für Checkout-Protokolle" + field_checkout_display_command: "Checkout-Befehl anzeigen" + + label_protocol_plural: "Protokolle" + button_add_protocol: "Protokoll hinzufügen" + + label_access_type: 'Diese URL erlaubt Zugriff zum <span id="checkout_access">{{type}}</span>.' + label_access_read_only: 'Nur-Lesen' + label_access_read_write: "Lesen+Schreiben" + label_access_permission: "Abhängig von Benutzer-Rechten" + + label_append_path: "Pfad anhängen" + + label_display_login_none: "Mitgliedsnamen nicht anzeigen" + label_display_login_username: "Mitgliedsnamen anzeigen, aber kein Kennwort" + label_display_login_password: "Mitgliedsnamen und Kennwort anzeigen" + + label_copy_to_clipboard: "In die Zwischenablage kopieren" + + help_checkout_protocols: | + Die URLs in Protokollen werden aus der originalen URL erzeugt, auf die der + reguläre Ausdruck und der Ersatztext angewendet werden. Der Ersatztext + erlaubt Rückwärtsreferenzen zu geklammerten Audrücken mit der \1 Notation. + help_repository_checkout_protocols: | + Lassen Sie das Checkout-URL-Feld leer um die URL des Projektarchivs zu verwenden. + help_moved_settings: "Die Konfigurationsseite wurde nach {{link}} verschoben." + label_settings_location: "Administration -> Konfiguration -> Checkout" \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/en-GB.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,41 @@ +en-GB: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Display checkout information" + setting_checkout_fixed_url: "Checkout URL" + setting_checkout_url_regex: "Regular expression" + setting_checkout_url_regex_replacement: "Replacement text" + setting_checkout_display_login: "Display Login" + setting_checkout_command: "Checkout command" + setting_checkout_use_zero_clipboard: "Display clipboard helper" + + setting_checkout_overwrite_description: "Overwrite default description" + field_checkout_overwrite: "Overwrite default settings for checkout protocols" + field_checkout_display_command: "Display checkout command" + + label_protocol_plural: "Protocols" + button_add_protocol: "Add Protocol" + + label_access_type: 'You have <span id="checkout_access">{{type}}</span> access to this URL.' + label_access_read_only: 'Read Only' + label_access_read_write: "Read and Write" + label_access_permission: "Depending on user's permissions" + + label_append_path: "Append path" + + label_display_login_none: "Do not show login or password" + label_display_login_username: "Show login but no password" + label_display_login_password: "Show login and password" + + label_copy_to_clipboard: "Copy to clipboard" + + help_checkout_protocols: | + The URLs in protocols are generated from applying the regular expression + and the replacement text to the original URL. The replacement text + supports back-references to braced expressions using the \1 notation. + help_repository_checkout_protocols: | + Leave the Checkout URL field empty to use the defined repository URL. + help_moved_settings: "The settings page has been moved to {{link}}." + label_settings_location: "Administration -> Settings -> Checkout" + + text_repository_external: "The primary repository for this project is hosted at <code>{{location}}</code> .<br>This repository is a read-only copy which is updated automatically."
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/en.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,43 @@ +en: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Display checkout information" + setting_checkout_fixed_url: "Checkout URL" + setting_checkout_url_regex: "Regular expression" + setting_checkout_url_regex_replacement: "Replacement text" + setting_checkout_display_login: "Display Login" + setting_checkout_command: "Checkout command" + setting_checkout_use_zero_clipboard: "Display clipboard helper" + + setting_checkout_overwrite_description: "Overwrite default description" + field_checkout_overwrite: "Overwrite default settings for checkout protocols" + field_checkout_display_command: "Display checkout command" + + label_protocol_plural: "Protocols" + button_add_protocol: "Add Protocol" + + label_access_type: 'You have <span id="checkout_access">{{type}}</span> access to this URL.' + label_access_type_all: 'All access to this URL is <span id="checkout_access">{{type}}</span>.' + label_access_read_only: 'Read Only' + label_access_read_write: "Read and Write" + label_access_permission: "Depending on user's permissions" + + label_append_path: "Append path" + + label_display_login_none: "Do not show login or password" + label_display_login_username: "Show login but no password" + label_display_login_password: "Show login and password" + + label_copy_to_clipboard: "Copy to clipboard" + + help_checkout_protocols: | + The URLs in protocols are generated from applying the regular expression + and the replacement text to the original URL. The replacement text + supports back-references to braced expressions using the \1 notation. + help_repository_checkout_protocols: | + Leave the Checkout URL field empty to use the defined repository URL. + help_moved_settings: "The settings page has been moved to {{link}}." + label_settings_location: "Administration -> Settings -> Checkout" + + text_repository_external: "The primary repository for this project is hosted at <code>{{location}}</code> .<br>This repository is a read-only copy which is updated automatically every hour." +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/es.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,39 @@ +es: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Display checkout information" + setting_checkout_fixed_url: "URL de checkout" + setting_checkout_url_regex: "Expresion regular" + setting_checkout_url_regex_replacement: "Texto de remplazo" + setting_checkout_display_login: "Mostrar usuario" + setting_checkout_command: "Comando de checkout" + setting_checkout_use_zero_clipboard: "Display clipboard helper" + + setting_checkout_overwrite_description: "Overwrite default description" + field_checkout_overwrite: "Overwrite default settings for checkout protocols" + field_checkout_display_command: "Display checkout command" + + label_protocol_plural: "Protocolos" + button_add_protocol: "Crear Protocolo" + + label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' + label_access_read_only: 'Read-Only' + label_access_read_write: "Read+Write" + label_access_permission: "Depending on user's permissions" + + label_append_path: "Append path" + + label_display_login_none: "No mostrar usuario o contraseña" + label_display_login_username: "Mostrar usuario pero no contraseña" + label_display_login_password: "Mostrar usuario y contraseña" + + label_copy_to_clipboard: "Copy to clipboard" + + help_checkout_protocols: | + The URLs in protocols are generated from applying the regular expression + and the replacement text to the original URL. The replacement text + supports back-references to braced expressions using the \1 notation. + help_repository_checkout_protocols: | + Leave the Checkout URL field empty to use the defined repository URL. + help_moved_settings: "The settings page has been moved to {{link}}." + label_settings_location: "Administration -> Settings -> Checkout"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/fr.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,39 @@ +fr: + label_checkout: "Dépôt" + + setting_checkout_display_checkout_info: "Display checkout information" + setting_checkout_fixed_url: "URL du dépôt" + setting_checkout_url_regex: "Expression Régulière" + setting_checkout_url_regex_replacement: "Texte de substitution" + setting_checkout_display_login: "Affiche le login" + setting_checkout_command: "Checkout command" + setting_checkout_use_zero_clipboard: "Display clipboard helper" + + setting_checkout_overwrite_description: "Overwrite default description" + field_checkout_overwrite: "Overwrite default settings for checkout protocols" + field_checkout_display_command: "Affiche l'URL du dépôt" + + label_protocol_plural: "Protocoles" + button_add_protocol: "Créer un protocole" + + label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' + label_access_read_only: 'Read-Only' + label_access_read_write: "Read+Write" + label_access_permission: "Depending on user's permissions" + + label_append_path: "Append path" + + label_display_login_none: "Ne pas afficher le login ni le mot de passe" + label_display_login_username: "Afficher le login, pas le mot de passe" + label_display_login_password: "Afficher le login et le mot de passe" + + label_copy_to_clipboard: "Copy to clipboard" + + help_checkout_protocols: | + The URLs in protocols are generated from applying the regular expression + and the replacement text to the original URL. The replacement text + supports back-references to braced expressions using the \1 notation. + help_repository_checkout_protocols: | + Leave the Checkout URL field empty to use the defined repository URL. + help_moved_settings: "The settings page has been moved to {{link}}." + label_settings_location: "Administration -> Settings -> Checkout"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/it.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,40 @@ +it: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Visualizza le informazioni sul checkout" + setting_checkout_fixed_url: "URL di checkout" + setting_checkout_url_regex: "Espressione regolare" + setting_checkout_url_regex_replacement: "Testo sostituito" + setting_checkout_display_login: "Login visualizzato" + setting_checkout_command: "Comando per il checkout" + setting_checkout_use_zero_clipboard: "Visualizza l'utility per la copia negli appunti" + + setting_checkout_overwrite_description: "Sovrascrivi la descrizione predefinita" + field_checkout_overwrite: "Sovrascrivi le impostazioni di checkout predefinite" + field_checkout_display_command: "Visualizza il comando per il checkout" + + label_protocol_plural: "Protocolli" + button_add_protocol: "Aggiungi Protocollo" + + label_access_type: 'Questo URL ha accesso <span id="checkout_access">{{type}}</span>.' + label_access_read_only: 'Sola-Lettura' + label_access_read_write: "Lettura+Scrittura" + label_access_permission: "Dipende dai permessi dell'utente" + + label_append_path: "Aggiungi percorso" + + label_display_login_none: "Non mostrare il login e password" + label_display_login_username: "Mostra il login senza password" + label_display_login_password: "Mostra il login e la password" + + label_copy_to_clipboard: "Copia negli appunti" + + help_checkout_protocols: | + Gli URL dei protocolli sono generati applicando le espressioni regolari + ed effettuando la sostituzione dell'URL originale con il testo specificato. + Il testo per la sostituzione può contenere riferimenti a più match usando + la notazione \1 \2... + help_repository_checkout_protocols: | + Lascia il campo URL di checkout bianco per usare l'URL definito nel repository. + help_moved_settings: "La pagina delle impostazioni è stata spostata in {{link}}." + label_settings_location: "Amministrazione -> Impostazioni -> Checkout"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/ja.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,39 @@ +ja: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Display checkout information" + setting_checkout_fixed_url: "チェックアウト URL" + setting_checkout_url_regex: "Regular expression" + setting_checkout_url_regex_replacement: "Replacement text" + setting_checkout_display_login: "ログインの表示" + setting_checkout_command: "Checkout command" + setting_checkout_use_zero_clipboard: "Display clipboard helper" + + setting_checkout_overwrite_description: "Overwrite default description" + field_checkout_overwrite: "Overwrite default settings for checkout protocols" + field_checkout_display_command: "Display checkout command" + + label_protocol_plural: "Protocols" + button_add_protocol: "Add Protocol" + + label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' + label_access_read_only: 'Read-Only' + label_access_read_write: "Read+Write" + label_access_permission: "Depending on user's permissions" + + label_append_path: "Append path" + + label_display_login_none: "ログインとパスワードを非表示" + label_display_login_username: "ログインのみ表示" + label_display_login_password: "ログインとパスワードを表示" + + label_copy_to_clipboard: "Copy to clipboard" + + help_checkout_protocols: | + The URLs in protocols are generated from applying the regular expression + and the replacement text to the original URL. The replacement text + supports back-references to braced expressions using the \1 notation. + help_repository_checkout_protocols: | + Leave the Checkout URL field empty to use the defined repository URL. + help_moved_settings: "The settings page has been moved to {{link}}." + label_settings_location: "Administration -> Settings -> Checkout"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/ko.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,40 @@ +ko: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Display checkout information" + setting_checkout_fixed_url: "체크 아웃 URL" + setting_checkout_url_regex: "정규식" + setting_checkout_url_regex_replacement: "대체 문자열" + setting_checkout_display_login: "로그인 표시" + setting_checkout_command: "Checkout command" + setting_checkout_use_zero_clipboard: "Display clipboard helper" + + setting_checkout_overwrite_description: "Overwrite default description" + field_checkout_overwrite: "Overwrite default settings for checkout protocols" + field_checkout_display_command: "Display checkout command" + + label_protocol_plural: "Protocols" + button_add_protocol: "Add Protocol" + + label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' + label_access_read_only: 'Read-Only' + label_access_read_write: "Read+Write" + label_access_permission: "Depending on user's permissions" + + label_append_path: "Append path" + + label_display_login_none: "로그인과 비밀번호를 보여주지 않습니다." + label_display_login_username: "로그인은 보여주지만 비밀번호는 보여주지 않습니다." + label_display_login_password: "로그인과 비밀번호를 보여줍니다." + + label_copy_to_clipboard: "Copy to clipboard" + + help_checkout_protocols: | + The URLs in protocols are generated from applying the regular expression + and the replacement text to the original URL. The replacement text + supports back-references to braced expressions using the \1 notation. + help_repository_checkout_protocols: | + Leave the Checkout URL field empty to use the defined repository URL. + help_moved_settings: "The settings page has been moved to {{link}}." + label_settings_location: "Administration -> Settings -> Checkout" +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/nl.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,40 @@ +nl: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Checkout-informatie tonen" + setting_checkout_fixed_url: "Checkout-URL" + setting_checkout_url_regex: "Reguliere expressie" + setting_checkout_url_regex_replacement: "Vervangingstekst" + setting_checkout_display_login: "Geef login weer" + setting_checkout_command: "Checkout-opdracht" + setting_checkout_use_zero_clipboard: "Klembord-hulp tonen" + + setting_checkout_overwrite_description: "Standaard omschrijving overschrijven" + field_checkout_overwrite: "Overschrijf standaard instellingen voor checkout-protocollen" + field_checkout_display_command: "Checkout-opdracht tonen" + + label_protocol_plural: "Protocollen" + button_add_protocol: "Protocol toevoegen" + + label_access_type: 'Deze URL heeft <span id="checkout_access">{{type}}</span> toegang.' + label_access_read_only: 'Alleen lezen' + label_access_read_write: "Lezen en schrijven" + label_access_permission: "Afhankelijk van gebruikersrechten" + + label_append_path: "Pad toevoegen" + + label_display_login_none: "Geen logingegevens tonen" + label_display_login_username: "Toon login zonder wachtwoord" + label_display_login_password: "Toon login en wachtwoord" + + label_copy_to_clipboard: "Naar klembord kopiëren" + + help_checkout_protocols: | + De URLs in protocollen worden samengesteld vanuit de originele URL, na + toepassing van de reguliere expressie en vervangingstekst. De vervangingstekst + ondersteunt referenties vanuit tussen haakjes geplaatste expressies + door middel van de \1 notatie. + help_repository_checkout_protocols: | + Laat het veld Checkout-URL leeg om de projectrepository te gebruiken. + help_moved_settings: "De instellingspagina is verplaatst naar {{link}}." + label_settings_location: "Administratie -> Instellingen -> Checkout" \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/pl.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,39 @@ +pl: + label_checkout: "Pobieranie repozytorium" + + setting_checkout_display_checkout_info: "Pokaż informację o możliwości pobrania repozytorium" + setting_checkout_fixed_url: "Adres URL pobierania repozytorium" + setting_checkout_url_regex: "Wyrażenie regularne" + setting_checkout_url_regex_replacement: "Wynikowy adres URL" + setting_checkout_display_login: "Pokaż dane logowania" + setting_checkout_command: "Komenda pobrania repozytorium" + setting_checkout_use_zero_clipboard: "Pokaż pomocnika schowka" + + setting_checkout_overwrite_description: "Nadpisz domyślny opis" + field_checkout_overwrite: "Nadpisz domyślne ustawienia dla protokołów" + field_checkout_display_command: "Pokaż komendę pobrania repozytorium" + + label_protocol_plural: "Protokoły" + button_add_protocol: "Dodaj protokół" + + label_access_type: 'Ten adres URL ma dostęp <span id="checkout_access">{{type}}</span>.' + label_access_read_only: 'Tylko do odczytu' + label_access_read_write: "Odczyt+Zapis" + label_access_permission: "Zależne od uprawnień użytkownika" + + label_append_path: "Dołącz ścieżkę" + + label_display_login_none: "Nie pokazuj loginu ani hasła" + label_display_login_username: "Pokaż tylko login" + label_display_login_password: "Pokaż login i hasło" + + label_copy_to_clipboard: "Kopiuj do schowka" + + help_checkout_protocols: | + Wynikowe adresy URL w protokołach są generowane przez zamianę oryginalnego + adresu URL repozytorium na podstawie wyrażenia regularnego. Wynikowy adres + URL wspiera referencje do grup (tzw. back-references) używając notacji \1. + help_repository_checkout_protocols: | + Pozostaw adres URL pobierania repozytorium pusty aby uzyć adresu zdefiniowanego w ustawieniach projektu. + help_moved_settings: "Ustawienia zostały przeniesione do {{link}}." + label_settings_location: "Administracja -> Ustawienia -> Pobieranie repozytorium"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/config/locales/ro.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,39 @@ +ro: + label_checkout: "Checkout" + + setting_checkout_display_checkout_info: "Display checkout information" + setting_checkout_fixed_url: "URL-ul pentru checkout" + setting_checkout_url_regex: "Expresie regulata (regexp)" + setting_checkout_url_regex_replacement: "Text inlocuitor (regexp)" + setting_checkout_display_login: "Arata datele pentru autentificare" + setting_checkout_command: "Comanda de checkout" + setting_checkout_use_zero_clipboard: "Display clipboard helper" + + setting_checkout_overwrite_description: "Overwrite default description" + field_checkout_overwrite: "Overwrite default settings for checkout protocols" + field_checkout_display_command: "Display checkout command" + + label_protocol_plural: "Protocols" + button_add_protocol: "Add Protocol" + + label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' + label_access_read_only: 'Read-Only' + label_access_read_write: "Read+Write" + label_access_permission: "Depending on user's permissions" + + label_append_path: "Append path" + + label_display_login_none: "Nu afisa username sau parola" + label_display_login_username: "Afiseaza username-ul, dar nu si parola" + label_display_login_password: "Afiseaza atat username-ul, cat si parola" + + label_copy_to_clipboard: "Copy to clipboard" + + help_checkout_protocols: | + The URLs in protocols are generated from applying the regular expression + and the replacement text to the original URL. The replacement text + supports back-references to braced expressions using the \1 notation. + help_repository_checkout_protocols: | + Leave the Checkout URL field empty to use the defined repository URL. + help_moved_settings: "The settings page has been moved to {{link}}." + label_settings_location: "Administration -> Settings -> Checkout"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20091208210439_add_checkout_url_info.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,11 @@ +class AddCheckoutUrlInfo < ActiveRecord::Migration + def self.up + add_column :repositories, :checkout_url_type, :string, :default => 'none', :null => false + add_column :repositories, :checkout_url, :string, :default => '', :null => false + end + + def self.down + remove_column :repository, :checkout_url_type + remove_column :repository, :checkout_url + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20091220173312_add_display_login.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,9 @@ +class AddDisplayLogin < ActiveRecord::Migration + def self.up + add_column :repositories, :display_login, :string, :default => 'none', :null => false + end + + def self.down + remove_column :repositories, :display_login + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20100118174556_add_render_link.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,9 @@ +class AddRenderLink < ActiveRecord::Migration + def self.up + add_column :repositories, :render_link, :boolean, :null => true + end + + def self.down + remove_column :repositories, :render_link + end +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20100118235845_remove_defaults.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,14 @@ +class RemoveDefaults < ActiveRecord::Migration + def self.up + change_column :repositories, :checkout_url_type, :string, :default => nil, :null => true + change_column :repositories, :checkout_url, :string, :default => nil, :null => true + change_column :repositories, :display_login, :string, :default => nil, :null => true + end + + def self.down + change_column :repositories, :checkout_url_type, :string, :default => 'none', :null => false + change_column :repositories, :checkout_url, :string, :default => '', :null => false + change_column :repositories, :display_login, :string, :default => 'none', :null => false + end +end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20100118235909_add_overwrite_option.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,15 @@ +class AddOverwriteOption < ActiveRecord::Migration + def self.up + add_column :repositories, :checkout_url_overwrite, :boolean, :default => false, :null => false + + # existing repositories are set to overwrite the default settings + # This is to keep continuity of settings. + Repository.reset_column_information + Repository.update_all({:checkout_url_overwrite, true}) + end + + def self.down + remove_column :repositories, :checkout_url_overwrite + end +end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20100203202320_update_settings.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,36 @@ +class UpdateSettings < ActiveRecord::Migration + def self.up + settings = Setting.plugin_redmine_checkout + if settings['checkout_url_type'] == "overwritten" + settings['checkout_url_type'] = "generated" + end + + if settings.has_key? "checkout_url_regex" + settings['checkout_url_regex_default'] = settings.delete("checkout_url_regex") + end + + if settings.has_key? "checkout_url_regex_replacement" + settings['checkout_url_regex_replacement_default'] = settings.delete("checkout_url_regex_replacement") + end + + Setting.plugin_redmine_checkout = settings + end + + def self.down + settings = Setting.plugin_redmine_checkout + if settings['checkout_url_type'] == "generated" + settings['checkout_url_type'] = "overwritten" + end + + if settings.has_key? "checkout_url_regex_default" + settings['checkout_url_regex'] = settings.delete("checkout_url_regex_default") + end + + if settings.has_key? "checkout_url_regex_replacement_default" + settings['checkout_url_regex_replacement'] = settings.delete("checkout_url_regex_replacement_default") + end + + Setting.plugin_redmine_checkout = settings + end +end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20100426154202_rename_render_link_to_render_type.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,31 @@ +class RenameRenderLinkToRenderType < ActiveRecord::Migration + def self.up + render_link = Setting.plugin_redmine_checkout.delete 'render_link' + unless render_link.nil? + Setting.plugin_redmine_checkout['render_type'] = (render_link == 'true' ? 'link' : 'url') + Setting.plugin_redmine_checkout = Setting.plugin_redmine_checkout + end + + add_column :repositories, :render_type, :string, :default => 'url', :null => false + + Repository.update_all({:render_type => 'link'}, :render_link => true) + Repository.update_all({:render_type => 'url'}, ["render_link != ?", true]) + + remove_column :repositories, :render_link + end + + def self.down + render_type = Setting.plugin_redmine_checkout.delete 'render_type' + unless render_type.nil? + Setting.plugin_redmine_checkout['render_link'] = (render_type == 'link' ? 'true' : 'false') + Setting.plugin_redmine_checkout = Setting.plugin_redmine_checkout + end + + add_column :repositories, :render_link, :boolean, :null => true + + Repository.update_all({:render_link => true}, :render_type => 'link') + Repository.update_all({:render_link => false}, ["render_type != ?", 'link']) + + remove_column :repositories, :render_type + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20100512135418_consolidate_repository_options.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,49 @@ +class ConsolidateRepositoryOptions < ActiveRecord::Migration + class Repository < ActiveRecord::Base + def self.inheritance_column + # disable single table inheritance + nil + end + + serialize :checkout_settings, Hash + end + + def self.up + add_column :repositories, :checkout_settings, :text + + Repository.all.each do |r| + r.checkout_settings = { + "checkout_url_type" => r.checkout_url_type, + "checkout_url" => r.checkout_url, + "display_login" => r.display_login, + "render_type" => r.render_type, + "checkout_url_overwrite" => r.checkout_url_overwrite + } + r.save! + end + remove_column :repositories, :checkout_url_type + remove_column :repositories, :checkout_url + remove_column :repositories, :display_login + remove_column :repositories, :render_type + remove_column :repositories, :checkout_url_overwrite + end + + def self.down + add_column :repositories, :checkout_url_type, :string, :default => nil, :null => true + add_column :repositories, :checkout_url, :string, :default => nil, :null => true + add_column :repositories, :display_login, :string, :default => nil, :null => true + add_column :repositories, :render_type, :string, :default => 'url', :null => false + add_column :repositories, :checkout_url_overwrite, :boolean, :default => false, :null => false + + Repository.all.each do |r| + r.checkout_url_type = r.checkout_settings["checkout_url_type"] + r.checkout_url = r.checkout_settings["checkout_url"] + r.display_login = r.checkout_settings["display_login"] + r.render_link = r.checkout_settings["render_link"] + r.checkout_url_overwrite = r.checkout_settings["checkout_url_overwrite"] + r.save! + end + + remove_column :repositories, :checkout_settings + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20100609153630_apply_setting_changes.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,113 @@ +class ApplySettingChanges < ActiveRecord::Migration + class Repository < ActiveRecord::Base + def self.inheritance_column + # disable single table inheritance + nil + end + + def scm_name + self.type || 'Abstract' + end + + serialize :checkout_settings, Hash + end + + def self.up + default_commands = { + 'Bazaar' => 'bzr checkout', + 'Cvs' => 'cvs checkout', + 'Darcs' => 'darcs get', + 'Git' => 'git clone', + 'Mercurial' => 'hg clone', + 'Subversion' => 'svn checkout' + } + + ## First migrate the individual repositories + + Repository.all.each do |r| + allow_subtree_checkout = ['Cvs', 'Subversion'].include? r.scm_name + + protocol = case r.checkout_settings['checkout_url_type'] + when 'none', 'generated' + nil + when 'original', 'overwritten' + HashWithIndifferentAccess.new({ "0" => HashWithIndifferentAccess.new({ + :protocol => r.scm_name, + :command => Setting.plugin_redmine_checkout["checkout_cmd_#{r.scm_name}"] || default_commands[r.scm_name], + :regex => "", + :regex_replacement => "", + :fixed_url => (r.checkout_settings['checkout_url_type'] == 'original' ? (r.url || "") : r.checkout_settings["checkout_url"]), + :access => 'permission', + :append_path => (allow_subtree_checkout ? '1' : '0'), + :is_default => '1'}) + }) + end + + r.checkout_settings = Hash.new({ + 'checkout_protocols' => protocol, + 'checkout_description' => "The data contained in this repository can be downloaded to your computer using one of several clients. +Please see the documentation of your version control software client for more information. + +Please select the desired protocol below to get the URL.", + 'checkout_display_login' => (r.checkout_settings['display_login'] == 'none' ? '' : r.checkout_settings['display_login']), + 'checkout_overwrite' => (r.checkout_settings['checkout_url_overwrite'] == 'true') ? '1': '0', + 'checkout_display_command' => (r.checkout_settings["render_type"].to_s == 'cmd') ? '1' : '0' + }) + r.save! + end + + ## Then the global settings + + settings = HashWithIndifferentAccess.new({ + 'display_login' => Setting.plugin_redmine_checkout['display_login'], + 'use_zero_clipboard' => '1', + + 'display_checkout_info' => (Setting.plugin_redmine_checkout['checkout_url_type'] == 'none' ? '0' : '1'), + 'description_Abstract' => <<-EOF +The data contained in this repository can be downloaded to your computer using one of several clients. +Please see the documentation of your version control software client for more information. + +Please select the desired protocol below to get the URL. +EOF + }) + + default_commands.keys.each do |scm| + settings["description_#{scm}"] = '' + settings["overwrite_description_#{scm}"] = '0' + + display_command = (Setting.plugin_redmine_checkout["render_type"].to_s == 'cmd') ? '1' : '0' + settings["display_command_#{scm}"] = display_command + + case Setting.plugin_redmine_checkout['checkout_url_type'] + when 'generated', 'none': + regex = Setting.plugin_redmine_checkout["checkout_url_regex_#{scm}"] + replacement = Setting.plugin_redmine_checkout["checkout_url_regex_replacement_#{scm}"] + when 'original': + regex = '' + replacement = '' + end + + settings["protocols_#{scm}"] = HashWithIndifferentAccess.new({ + # access can be one of + # read+write => this protocol always allows read/write access + # read-only => this protocol always allows read access only + # permission => Access depends on redmine permissions + '0' => HashWithIndifferentAccess.new({ + :protocol => scm, + :command => Setting.plugin_redmine_checkout["checkout_cmd_#{scm}"] || default_commands[scm], + :regex => regex, + :regex_replacement => replacement, + :fixed_url => '', + :access => 'permission', + :append_path => (['Cvs', 'Subversion'].include?(scm) ? '1' : '0'), + :is_default => '1' + }) + }) + end + Setting.plugin_redmine_checkout = settings + end + + def self.down + raise ActiveRecord::IrreversibleMigration.new "Sorry, there is no down migration yet. If you really need one, please create an issue on http://dev.holgerjust.de/projects/redmine-checkout" + end +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/db/migrate/20100808185600_change_protocol_storage_from_hash_to_array.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,58 @@ +class ChangeProtocolStorageFromHashToArray < ActiveRecord::Migration + class Repository < ActiveRecord::Base + def self.inheritance_column + # disable single table inheritance + nil + end + + def scm_name + self.type || 'Abstract' + end + + serialize :checkout_settings, Hash + end + + def self.up + ## First migrate the individual repositories + Repository.all.each do |r| + next unless r.checkout_settings + next unless r.checkout_settings['checkout_protocols'].is_a? Hash + r.checkout_settings['checkout_protocols'] = r.checkout_settings['checkout_protocols'].sort{|(ak,av),(bk,bv)|ak<=>bk}.collect{|id,protocol| protocol} + r.save! + end + + ## Then the global settings + settings = Setting.plugin_redmine_checkout + settings.keys.grep(/^protocols_/).each do |protocols| + next unless settings[protocols].is_a? Hash + settings[protocols] = settings[protocols].sort{|(ak,av),(bk,bv)|ak<=>bk}.collect{|id,protocol| protocol} + end + Setting.plugin_redmine_checkout = settings + end + + def self.down + ## First migrate the individual repositories + Repository.all.each do |r| + next unless r.checkout_settings['checkout_protocols'].is_a? Hash + r.checkout_settings['checkout_protocols'] = r.checkout_settings['checkout_protocols'].inject(HashWithIndifferentAccess.new) do |result, p| + result[result.length.to_s] = p + end + r.save! + end + + ## Then the global settings + settings = Setting.plugin_redmine_checkout + settings.keys.grep(/^protocols_/).each do |protocols| + next unless r.checkout_settings['checkout_protocols'].is_a? Hash + settings[protocols] = settings[protocols].inject(HashWithIndifferentAccess.new) do |result, p| + result[result.length.to_s] = p + end + end + Setting.plugin_redmine_checkout = settings + + + + + raise ActiveRecord::IrreversibleMigration.new "Sorry, there is no down migration yet. If you really need one, please create an issue on http://dev.holgerjust.de/projects/redmine-checkout" + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/doc/COPYING Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,22 @@ +Copyright (c) 2009 Holger Just + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/init.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,102 @@ +require 'redmine' + +require 'dispatcher' +Dispatcher.to_prepare do + # Patches + require_dependency 'checkout/settings_controller_patch' + + require_dependency 'checkout/repositories_helper_patch' + require_dependency 'checkout/repository_patch' + + require_dependency 'checkout/settings_helper_patch' + require_dependency 'checkout/setting_patch' +end + +# Hooks +require 'checkout/repository_hooks' + +Redmine::Plugin.register :redmine_checkout do + name 'Redmine Checkout plugin' + url 'http://dev.holgerjust.de/projects/redmine-checkout' + author 'Holger Just' + author_url 'http://meine-er.de' + description 'Add links to the actual repository to the repository view.' + version '0.5' + + requires_redmine :version_or_higher => '0.9' + + settings_defaults = HashWithIndifferentAccess.new({ + 'display_login' => nil, + 'use_zero_clipboard' => '1', + + 'display_checkout_info' => '1', + 'description_Abstract' => <<-EOF +The data contained in this repository can be downloaded to your computer using one of several clients. +Please see the documentation of your version control software client for more information. + +Please select the desired protocol below to get the URL. +EOF + }) + + # this is needed for setting the defaults + require 'checkout/repository_patch' + + CheckoutHelper.supported_scm.each do |scm| + klazz = "Repository::#{scm}".constantize + + settings_defaults["description_#{scm}"] = '' + settings_defaults["overwrite_description_#{scm}"] = '0' + settings_defaults["display_command_#{scm}"] = '0' + + # access can be one of + # read+write => this protocol always allows read/write access + # read-only => this protocol always allows read access only + # permission => Access depends on redmine permissions + settings_defaults["protocols_#{scm}"] = [HashWithIndifferentAccess.new({ + :protocol => scm, + :command => klazz.checkout_default_command, + :regex => '', + :regex_replacement => '', + :fixed_url => '', + :access => 'permission', + :append_path => (klazz.allow_subtree_checkout? ? '1' : '0'), + :is_default => '1' + })] + end + + settings :default => settings_defaults, :partial => 'settings/redmine_checkout' + + Redmine::WikiFormatting::Macros.register do + desc <<-EOF +Creates a checkout link to the actual repository. Example: + + use the default checkout protocol !{{repository}} + or use a specific protocol !{{repository(SVN)}} + or use the checkout protocol of a specific specific project: !{{repository(projectname:SVN)}}" +EOF + + macro :repository do |obj, args| + proto = args.first + if proto.to_s =~ %r{^([^\:]+)\:(.*)$} + project_identifier, proto = $1, $2 + project = Project.find_by_identifier(project_identifier) || Project.find_by_name(project_identifier) + else + project = @project + end + + if project && project.repository + protocols = project.repository.checkout_protocols.select{|p| p.access_rw(User.current)} + + if proto.present? + proto_obj = protocols.find{|p| p.protocol.downcase == proto.downcase} + else + proto_obj = protocols.find(&:default?) || protocols.first + end + end + raise "Checkout protocol #{proto} not found" unless proto_obj + + cmd = (project.repository.checkout_display_command? && proto_obj.command.present?) ? proto_obj.command.strip + " " : "" + cmd + link_to(proto_obj.url, proto_obj.url) + end + end +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/checkout/protocol.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,114 @@ +module Checkout + class <<self + def awesome? + # Yes, this plugin is awesome! + true + end + end + + class Protocol + attr_accessor :protocol, :regex, :regex_replacement, :access, :repository + attr_writer :default, :command, :fixed_url, :append_path + + + def initialize(args={}) + args = args.dup + + @protocol = args.delete :protocol + @command = args.delete :command # optional, if not set the default from the repo is used + + # either a fixed url + @fixed_url = args.delete :fixed_url + + # or a regex + @regex = args.delete :regex + @regex_replacement = args.delete :regex_replacement + + @access = args.delete :access + @append_path = args.delete :append_path + @default = args.delete :is_default + + @repository = args.delete :repository + end + + def full_command(path = "") + cmd = "" + if repository.checkout_display_command? + cmd = self.command.present? ? self.command.strip + " " : "" + end + cmd + URI.escape(self.url(path)) + end + + def default? + @default.to_i > 0 + end + + def command + @command || self.repository && self.repository.checkout_default_command || "" + end + + def append_path? + @append_path.to_i > 0 + end + + def access_rw(user) + # reduces the three available access levels 'read+write', 'read-only' and 'permission' + # to 'read+write' and 'read-only' and nil (not allowed) + + @access_rw ||= {} + return @access_rw[user] if @access_rw.key? user + @access_rw[user] = case access + when 'permission' + case + when user.allowed_to?(:commit_access, repository.project) && user.allowed_to?(:browse_repository, repository.project) + 'read+write' + when user.allowed_to?(:browse_repository, repository.project) + 'read-only' + else + nil + end + else + @access + end + end + + def access_label(user) + case access_rw(user) + when 'read+write': :label_access_read_write + when 'read-only': :label_access_read_only + end + end + + def fixed_url + @fixed_url.present? ? @fixed_url : begin + if (regex.blank? || regex_replacement.blank?) + repository.url + else + repository.url.gsub(Regexp.new(regex), regex_replacement) + end + end + rescue RegexpError + repository.url || "" + end + + def url(path = "") + return "" unless repository + + url = fixed_url.sub(/\/+$/, "") + if repository.allow_subtree_checkout? && self.append_path? && path.present? + url = "#{url}/#{path}" + end + + if repository.checkout_display_login? + begin + uri = URI.parse url + (uri.user = repository.login) if repository.login + (uri.password = repository.password) if (repository.checkout_display_login == 'password' && repository.login && repository.password) + url = uri.to_s + rescue URI::InvalidURIError + end + end + url + end + end +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/checkout/repositories_helper_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,34 @@ +require_dependency 'repositories_helper' + +module Checkout + module RepositoriesHelperPatch + def self.included(base) # :nodoc: + base.send(:include, InstanceMethods) + + base.class_eval do + alias_method_chain :repository_field_tags, :checkout + alias_method_chain :scm_select_tag, :javascript + end + end + + module InstanceMethods + def repository_field_tags_with_checkout(form, repository) + tags = repository_field_tags_without_checkout(form, repository) || "" + return tags if repository.class.name == "Repository" + + tags + @controller.send(:render_to_string, :partial => 'projects/settings/repository_checkout', :locals => {:form => form, :repository => repository, :scm => repository.scm_name}) + end + + def scm_select_tag_with_javascript(*args) + content_for :header_tags do + javascript_include_tag('subform', :plugin => 'redmine_checkout') + + stylesheet_link_tag('checkout', :plugin => 'redmine_checkout') + end + scm_select_tag_without_javascript(*args) + end + end + end +end + +RepositoriesHelper.send(:include, Checkout::RepositoriesHelperPatch) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/checkout/repository_hooks.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,34 @@ +module Checkout + class RepositoryHooks < Redmine::Hook::ViewListener + # Renders the checkout URL + # + # Context: + # * :project => Current project + # * :repository => Current Repository + # + def view_repositories_show_contextual(context={}) + if context[:repository].present? && Setting.checkout_display_checkout_info? + protocols = context[:repository].checkout_protocols.select do |p| + p.access_rw(User.current) + end + + path = context[:controller].instance_variable_get("@path") + if path && context[:controller].instance_variable_get("@entry") + # a single file is showing, so we return only the directory + path = File.dirname(path) + end + + default = protocols.find(&:default?) || protocols.first + + context.merge!({ + :protocols => protocols, + :default_protocol => default, + :checkout_path => path + }) + + options = {:partial => "redmine_checkout_hooks/view_repositories_show_contextual"} + context[:controller].send(:render_to_string, {:locals => context}.merge(options)) + end + end + end +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/checkout/repository_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,186 @@ +require_dependency 'repository' +require_dependency 'checkout_helper' + +module Checkout + module RepositoryPatch + def self.included(base) # :nodoc: + base.extend(ClassMethods) + base.send(:include, InstanceMethods) + + base.class_eval do + unloadable + serialize :checkout_settings, Hash + end + end + + module ClassMethods + def allow_subtree_checkout? + # default implementation + false + end + + def checkout_default_command + # default implementation + "" + end + end + + module InstanceMethods + def after_initialize + self.checkout_settings ||= {} + end + + def checkout_overwrite=(value) + checkout_settings['checkout_overwrite'] = value + end + + def checkout_overwrite + (checkout_settings['checkout_overwrite'].to_i > 0) ? '1' : '0' + end + + def checkout_overwrite? + self.scm_name != 'Abstract' && checkout_overwrite.to_i > 0 + end + + def checkout_description=(value) + checkout_settings['checkout_description'] = value + end + + def checkout_description + if checkout_overwrite? + checkout_settings['checkout_description'] + else + if CheckoutHelper.supported_scm.include?(scm_name) && Setting.send("checkout_overwrite_description_#{scm_name}?") + Setting.send("checkout_description_#{scm_name}") + else + Setting.send("checkout_description_Abstract") + end + end + end + + def checkout_protocols + @checkout_protocols ||= begin + if CheckoutHelper.supported_scm.include? scm_name + if checkout_overwrite? + protocols = checkout_settings['checkout_protocols'] || [] + else + protocols = Setting.send("checkout_protocols_#{scm_name}") || [] + end + else + protocols = [] + end + + protocols.collect do |p| + Checkout::Protocol.new p.merge({:repository => self}) + end + end + end + + def checkout_protocols=(value) + # value is an Array or a Hash + if value.is_a? Hash + value = value.dup.delete_if {|id, protocol| id.to_i < 0 } + value = value.sort{|(ak,av),(bk,bv)|ak<=>bk}.collect{|id,protocol| protocol} + end + + checkout_settings['checkout_protocols'] = value + end + + def checkout_display_login + if checkout_overwrite? && self.scm_name == "Subversion" + result = checkout_settings['checkout_display_login'] + else + result = Setting.checkout_display_login + end + (result.to_i > 0) ? '1' : '0' + end + + def checkout_display_login? + checkout_display_login.to_i > 0 + end + + def checkout_display_login=(value) + value = nil unless self.scm_name == "Subversion" + checkout_settings['checkout_display_login'] = value + end + + def checkout_display_command? + checkout_display_command.to_i > 0 + end + + def checkout_display_command=(value) + checkout_settings['checkout_display_command'] = value + end + + def checkout_display_command + if checkout_overwrite? + checkout_settings['checkout_display_command'] + else + Setting.send("checkout_display_command_#{scm_name}") + end + end + + def allow_subtree_checkout? + self.class.allow_subtree_checkout? + end + + def checkout_default_command + self.class.checkout_default_command + end + end + end +end + +Repository.send(:include, Checkout::RepositoryPatch) + +subtree_checkout_repos = ["Subversion", "Cvs"] +commands = { + 'Bazaar' => 'bzr checkout', + 'Cvs' => 'cvs checkout', + 'Darcs' => 'darcs get', + 'Git' => 'git clone', + 'Mercurial' => 'hg clone', + 'Subversion' => 'svn checkout' +} + +CheckoutHelper.supported_scm.each do |scm| + require_dependency "repository/#{scm.underscore}" + cls = Repository.const_get(scm) + + allow_subtree_checkout = "" + if subtree_checkout_repos.include? scm + allow_subtree_checkout = <<-EOS + def allow_subtree_checkout? + true + end + EOS + end + + checkout_command = "" + if commands[scm] + checkout_command = <<-EOS + def checkout_default_command + '#{commands[scm]}' + end + EOS + end + + class_mod = Module.new + class_mod.module_eval(<<-EOF + def self.included(base) + base.extend ChildClassMethods + + base.class_eval do + unloadable + serialize :checkout_settings, Hash + end + end + + module ChildClassMethods + #{allow_subtree_checkout} + #{checkout_command} + end + EOF + ) + cls.send(:include, class_mod) +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/checkout/setting_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,75 @@ +require_dependency 'setting' + +module Checkout + module SettingPatch + def self.included(base) # :nodoc: + base.extend(ClassMethods) + + base.class_eval do + unloadable + + # Defines getter and setter for each setting + # Then setting values can be read using: Setting.some_setting_name + # or set using Setting.some_setting_name = "some value" + Redmine::Plugin.find(:redmine_checkout).settings[:default].keys.each do |name| + if name.start_with?('protocols_') + default = "[]" + else + default = <<-END_SRC + begin + default = Setting.available_settings['plugin_redmine_checkout']['default']['#{name}'] + # perform a deep copy of the default + Marshal::load(Marshal::dump(default)) + end + END_SRC + end + + src = <<-END_SRC + def self.checkout_#{name} + self.plugin_redmine_checkout[:#{name}] || #{default} + end + + def self.checkout_#{name}? + self.checkout_#{name}.to_i > 0 + end + + def self.checkout_#{name}=(value) + setting = Setting.plugin_redmine_checkout + setting[:#{name}] = value + Setting.plugin_redmine_checkout = setting + end + END_SRC + class_eval src, __FILE__, __LINE__ + end + + class <<self + alias_method :store_without_checkout, :[]= + alias_method :[]=, :store_with_checkout + + alias_method :retrieve_without_checkout, :[] + alias_method :[], :retrieve_with_checkout + end + end + end + + module ClassMethods + def store_with_checkout(name, value) + if name.to_s.starts_with? "checkout_" + self.send("#{name}=", value) + else + store_without_checkout(name, value) + end + end + + def retrieve_with_checkout(name) + if name.to_s.starts_with? "checkout_" + self.send("#{name}") + else + retrieve_without_checkout(name) + end + end + end + end +end + +Setting.send(:include, Checkout::SettingPatch) \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/checkout/settings_controller_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,44 @@ +require_dependency 'settings_controller' + +module Checkout + module SettingsControllerPatch + def self.included(base) # :nodoc: + base.send(:include, InstanceMethods) + + base.class_eval do + unloadable + + alias_method_chain :edit, :checkout + end + end + + module InstanceMethods + def edit_with_checkout + if request.post? && params['tab'] == 'checkout' + if params[:settings] && params[:settings].is_a?(Hash) + settings = HashWithIndifferentAccess.new + (params[:settings] || {}).each do |name, value| + if name = name.to_s.slice(/checkout_(.+)/, 1) + case value + when Array + # remove blank values in array settings + value.delete_if {|v| v.blank? } + when Hash + # change protocols hash to array. + value = value.sort{|(ak,av),(bk,bv)|ak<=>bk}.collect{|id,protocol| protocol} if name.start_with? "protocols_" + end + settings[name.to_sym] = value + end + end + + Setting.plugin_redmine_checkout = settings + params[:settings] = {} + end + end + edit_without_checkout + end + end + end +end + +SettingsController.send(:include, Checkout::SettingsControllerPatch)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/checkout/settings_helper_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,23 @@ +require_dependency 'settings_helper' + +module Checkout + module SettingsHelperPatch + def self.included(base) # :nodoc: + base.send(:include, InstanceMethods) + + base.class_eval do + alias_method_chain :administration_settings_tabs, :checkout + end + end + + module InstanceMethods + def administration_settings_tabs_with_checkout + tabs = administration_settings_tabs_without_checkout + tabs << {:name => 'checkout', :partial => 'settings/checkout', :label => :label_checkout} + end + end + end +end + +SettingsHelper.send(:include, Checkout::SettingsHelperPatch) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/checkout_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,7 @@ +module CheckoutHelper + class <<self + def supported_scm + Object.const_defined?("REDMINE_SUPPORTED_SCM") ? REDMINE_SUPPORTED_SCM : Redmine::Scm::Base.all + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/tasks/set_default.rake Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,10 @@ +namespace :redmine do + namespace :plugins do + namespace :redmine_checkout do + desc "Sets all repositories to inherit the default setting for the checkout URL." + task :set_default => :environment do + Repository.all.each{|r| r.update_attributes(:checkout_overwrite => "0")} + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/lib/tasks/spec.rake Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,14 @@ +begin + require "spec/rake/spectask" + namespace :spec do + namespace :plugins do + desc "Runs the examples for redmine_checkout" + Spec::Rake::SpecTask.new(:redmine_checkout) do |t| + t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""] + t.spec_files = FileList['vendor/plugins/redmine_checkout/spec/**/*_spec.rb'] + end + end + end + task :spec => "spec:plugins:redmine_checkout" +rescue LoadError +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/controllers/repositories_controller_spec.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,48 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe RepositoriesController do + fixtures :settings, :repositories, :projects, :roles, :users, :enabled_modules + integrate_views + + before(:each) do + Setting.default_language = 'en' + User.current = nil + end + + def get_repo + get :show, :id => 1 + end + + it "should display the protocol selector" do + get_repo + response.should be_success + response.should render_template('show') + + response.should have_tag('ul#checkout_protocols') do + with_tag('a[id=?][href=?]', 'checkout_protocol_subversion', "file:///#{RAILS_ROOT.gsub(%r{config\/\.\.}, '')}/tmp/test/subversion_repository") + with_tag('a[id=?][href=?]', 'checkout_protocol_svn+ssh', 'svn+ssh://subversion_repository@svn.foo.bar/svn') + end + end + + it "should display the description" do + get_repo + response.should be_success + response.should render_template('show') + + response.should have_tag('div.repository-info', /Please select the desired protocol below to get the URL/) + end + + it 'should respect the use zero clipboard option' do + Setting.checkout_use_zero_clipboard = '1' + get_repo + response.should be_success + response.should render_template('show') + response.should have_tag('script[src*=?]', 'ZeroClipboard') + + Setting.checkout_use_zero_clipboard = '0' + get_repo + response.should be_success + response.should render_template('show') + response.should_not have_tag('script[src*=]', 'ZeroClipboard') + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/fixtures/enabled_modules.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,5 @@ +--- +enabled_modules_001: + name: repository + project_id: 1 + id: 1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/fixtures/projects.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,13 @@ +--- +projects_001: + created_on: 2006-07-19 19:13:59 +02:00 + name: eCookbook + updated_on: 2006-07-19 22:53:01 +02:00 + id: 1 + description: Recipes management application + homepage: http://ecookbook.somenet.foo/ + is_public: true + identifier: ecookbook + parent_id: + lft: 1 + rgt: 10
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/fixtures/repositories.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,9 @@ +--- +svn: + project_id: 1 + url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository + id: 1 + root_url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository + password: "" + login: "" + type: Subversion
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/fixtures/roles.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,187 @@ +--- +roles_001: + name: Manager + id: 1 + builtin: 0 + permissions: | + --- + - :add_project + - :edit_project + - :manage_members + - :manage_versions + - :manage_categories + - :view_issues + - :add_issues + - :edit_issues + - :manage_issue_relations + - :manage_subtasks + - :add_issue_notes + - :move_issues + - :delete_issues + - :view_issue_watchers + - :add_issue_watchers + - :delete_issue_watchers + - :manage_public_queries + - :save_queries + - :view_gantt + - :view_calendar + - :log_time + - :view_time_entries + - :edit_time_entries + - :delete_time_entries + - :manage_news + - :comment_news + - :view_documents + - :manage_documents + - :view_wiki_pages + - :export_wiki_pages + - :view_wiki_edits + - :edit_wiki_pages + - :delete_wiki_pages_attachments + - :protect_wiki_pages + - :delete_wiki_pages + - :rename_wiki_pages + - :add_messages + - :edit_messages + - :delete_messages + - :manage_boards + - :view_files + - :manage_files + - :browse_repository + - :manage_repository + - :view_changesets + - :manage_project_activities + + position: 1 +roles_002: + name: Developer + id: 2 + builtin: 0 + permissions: | + --- + - :edit_project + - :manage_members + - :manage_versions + - :manage_categories + - :view_issues + - :add_issues + - :edit_issues + - :manage_issue_relations + - :manage_subtasks + - :add_issue_notes + - :move_issues + - :delete_issues + - :view_issue_watchers + - :save_queries + - :view_gantt + - :view_calendar + - :log_time + - :view_time_entries + - :edit_own_time_entries + - :manage_news + - :comment_news + - :view_documents + - :manage_documents + - :view_wiki_pages + - :view_wiki_edits + - :edit_wiki_pages + - :protect_wiki_pages + - :delete_wiki_pages + - :add_messages + - :edit_own_messages + - :delete_own_messages + - :manage_boards + - :view_files + - :manage_files + - :browse_repository + - :view_changesets + + position: 2 +roles_003: + name: Reporter + id: 3 + builtin: 0 + permissions: | + --- + - :edit_project + - :manage_members + - :manage_versions + - :manage_categories + - :view_issues + - :add_issues + - :edit_issues + - :manage_issue_relations + - :add_issue_notes + - :move_issues + - :view_issue_watchers + - :save_queries + - :view_gantt + - :view_calendar + - :log_time + - :view_time_entries + - :manage_news + - :comment_news + - :view_documents + - :manage_documents + - :view_wiki_pages + - :view_wiki_edits + - :edit_wiki_pages + - :delete_wiki_pages + - :add_messages + - :manage_boards + - :view_files + - :manage_files + - :browse_repository + - :view_changesets + + position: 3 +roles_004: + name: Non member + id: 4 + builtin: 1 + permissions: | + --- + - :view_issues + - :add_issues + - :edit_issues + - :manage_issue_relations + - :add_issue_notes + - :move_issues + - :save_queries + - :view_gantt + - :view_calendar + - :log_time + - :view_time_entries + - :comment_news + - :view_documents + - :manage_documents + - :view_wiki_pages + - :view_wiki_edits + - :edit_wiki_pages + - :add_messages + - :view_files + - :manage_files + - :browse_repository + - :view_changesets + + position: 4 +roles_005: + name: Anonymous + id: 5 + builtin: 2 + permissions: | + --- + - :view_issues + - :add_issue_notes + - :view_gantt + - :view_calendar + - :view_time_entries + - :view_documents + - :view_wiki_pages + - :view_wiki_edits + - :view_files + - :browse_repository + - :view_changesets + + position: 5 +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/fixtures/settings.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,115 @@ +--- + settings: + name: plugin_redmine_checkout + value: | + --- !map:HashWithIndifferentAccess + display_checkout_info: "1" + description_Abstract: | + The data contained in this repository can be downloaded to your computer using one of several clients. + Please see the documentation of your version control software client for more information. + + Please select the desired protocol below to get the URL. + display_command_Bazaar: '1' + use_zero_clipboard: "1" + + overwrite_description_Bazaar: "0" + description_Bazaar: "" + display_command_Bazaar: '1' + protocols_Bazaar: + "0": !map:HashWithIndifferentAccess + command: "bzr checkout" + regex: "" + regex_replacement: "" + read_write: readwrite + append_path: "0" + is_default: "1" + protocol: Bazaar + overwrite_description_Cvs: "0" + description_Cvs: "" + display_command_Cvs: '1' + protocols_Cvs: + "0": !map:HashWithIndifferentAccess + command: "cvs checkout" + regex: "" + regex_replacement: "" + read_write: readwrite + append_path: "0" + is_default: "1" + protocol: Cvs + overwrite_description_Darcs: "0" + description_Darcs: "" + display_command_Darcs: '1' + protocols_Darcs: + "0": !map:HashWithIndifferentAccess + command: "darcs get" + regex: "" + regex_replacement: "" + read_write: readwrite + append_path: "0" + is_default: "1" + protocol: Darcs + overwrite_description_Filesystem: "0" + description_Filesystem: "" + display_command_Filesystem: '1' + protocols_Filesystem: !map:HashWithIndifferentAccess + "0": !map:HashWithIndifferentAccess + command: "" + regex: "" + append_path: "0" + is_default: "1" + protocol: Filesystem + access: read+write + regex_replacement: "" + overwrite_description_Git: "0" + description_Git: "" + display_command_Git: '1' + protocols_Git: !map:HashWithIndifferentAccess + "0": !map:HashWithIndifferentAccess + command: "git clone" + regex: "" + append_path: "0" + is_default: "1" + protocol: Git + access: read+write + regex_replacement: "" + overwrite_description_Mercurial: "0" + description_Mercurial: "" + display_command_Mercurial: '1' + protocols_Mercurial: !map:HashWithIndifferentAccess + "0": !map:HashWithIndifferentAccess + command: "hg clone" + regex: "" + append_path: "0" + is_default: "1" + protocol: Mercurial + access: read+write + regex_replacement: "" + display_login: username + overwrite_description_Subversion: "0" + description_Subversion: "" + display_command_Subversion: '1' + protocols_Subversion: !map:HashWithIndifferentAccess + "0": !map:HashWithIndifferentAccess + command: "svn checkout" + regex: foo + append_path: "1" + is_default: "1" + protocol: Subversion + access: permission + regex_replacement: bar + "1": !map:HashWithIndifferentAccess + command: "svn co" + regex: "^.*?([^/]+)/?$" + append_path: "1" + is_default: "0" + protocol: SVN+SSH + access: read-only + regex_replacement: svn+ssh://\1@svn.foo.bar/svn + "2": !map:HashWithIndifferentAccess + command: "svn checkout" + append_path: "0" + is_default: "0" + regex: "" + protocol: Root + access: read+write + regex_replacement: ""
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/macros/macro_spec.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,55 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe "Macros" do + fixtures :settings, :repositories, :projects, :enabled_modules + + include ERB::Util + include ApplicationHelper + include ActionView::Helpers::TextHelper + include ActionView::Helpers::TagHelper + include ActionView::Helpers::UrlHelper + + before(:each) do + Setting.checkout_display_command_Subversion = '0' + + @project = projects :projects_001 + end + + + it "should display default checkout url" do + text = "{{repository}}" + + url = "file:///#{RAILS_ROOT.gsub(%r{config\/\.\.}, '')}/tmp/test/subversion_repository" + textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" + end + + it "should display forced checkout url" do + text = "{{repository(svn+ssh)}}" + + url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' + textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" + end + + it "should fail without set project" do + @project = nil + + text = "{{repository(svn+ssh)}}" + textilizable(text).should eql "<p><div class=\"flash error\">Error executing the <strong>repository</strong> macro (Checkout protocol svn+ssh not found)</div></p>" + end + + it "should display checkout url from stated project" do + @project = nil + text = "{{repository(ecookbook:svn+ssh)}}" + + url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' + textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" + end + + it "should display command" do + Setting.checkout_display_command_Subversion = '1' + + text = "{{repository(svn+ssh)}}" + url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' + textilizable(text).should eql "<p>svn co <a href=\"#{url}\">#{url}</a></p>" + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/models/protocol_spec.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,36 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe Checkout::Protocol do + fixtures :settings, :repositories, :projects, :enabled_modules + + before(:each) do + @admin = User.new + @admin.admin = true + @user = User.new + + @repo = repositories :svn + @repo.url = "http://example.com/svn/testrepo" + end + + it "should use regexes for generated URL" do + protocol = @repo.checkout_protocols.find{|r| r.protocol == "SVN+SSH"} + protocol.url.should eql "svn+ssh://testrepo@svn.foo.bar/svn" + end + + it "should resolve access properties" do + protocol = @repo.checkout_protocols.find{|r| r.protocol == "Subversion"} + protocol.access.should eql "permission" + protocol.access_rw(@admin).should eql "read+write" + + User.current = @user + protocol.access_rw(@user).should eql "read-only" + end + + it "should display the checkout command" do + subversion = @repo.checkout_protocols.find{|r| r.protocol == "Subversion"} + svn_ssh = @repo.checkout_protocols.find{|r| r.protocol == "SVN+SSH"} + + subversion.command.should eql "svn checkout" + svn_ssh.command.should eql "svn co" + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/models/repository_spec.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,49 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe Repository do + fixtures :settings, :repositories + + describe "initialize" do + before(:each) do + @repo = Repository.new() + end + + it "should properly set default values" do + @repo.checkout_overwrite?.should be_false + @repo.checkout_description.should match /Please select the desired protocol below to get the URL/ + @repo.checkout_display_login?.should be_false # no subversion repo + @repo.allow_subtree_checkout?.should be_false + @repo.checkout_protocols.should eql [] + end + end + + describe "subtree checkout" do + before(:each) do + @svn = Repository::Subversion.new + @git = Repository::Git.new + end + it "should be allowed on subversion" do + @svn.allow_subtree_checkout?.should eql true + end + it "should only be possible if checked" do + + end + + it "should be forbidden on git" do + @git.allow_subtree_checkout?.should eql false + end + end + + describe "extensions" do + before(:each) do + @repo = Repository::Subversion.new + end + + it "should provide protocols" do + protocols = @repo.checkout_protocols + protocols[0].protocol.should eql "Subversion" + protocols[1].protocol.should eql "SVN+SSH" + protocols[2].protocol.should eql "Root" + end + end +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/models/setting_spec.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,14 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe Setting do + fixtures :settings + + before(:each) do + Setting.default_language = 'en' + end + + it "should recognize checkout methods" do + Setting.checkout_display_checkout_info.should eql Setting.plugin_redmine_checkout['display_checkout_info'] + Setting.checkout_display_checkout_info.should eql Setting.plugin_redmine_checkout[:display_checkout_info] + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/sanity_spec.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,11 @@ +require File.dirname(__FILE__) + '/spec_helper' + +describe Class do + it "should be a class of Class" do + Class.class.should eql(Class) + end + + it "should be awesome" do + Checkout.awesome?.should be_true + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/spec.opts Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,7 @@ +--colour +--format +progress +--loadby +mtime +--reverse +--backtrace \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_checkout/spec/spec_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,27 @@ +ENV['RAILS_ENV'] ||= 'test' + +# prevent case where we are using rubygems and test-unit 2.x is installed +begin + require 'rubygems' + gem "test-unit", "~> 1.2.3" +rescue LoadError +end + +begin + require "config/environment" unless defined? RAILS_ROOT + require RAILS_ROOT + '/spec/spec_helper' +rescue LoadError => error + puts <<-EOS + + You need to install rspec in your Redmine project. + Please execute the following code: + + gem install rspec-rails + script/generate rspec + + EOS + raise error +end + +Fixtures.create_fixtures File.join(File.dirname(__FILE__), "fixtures"), ActiveRecord::Base.connection.tables +require File.join(File.dirname(__FILE__), "..", "init.rb") \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/COPYING Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,17 @@ +redmine_tags is a redMine plugin, that adds tagging support. + +Copyright (c) 2010 Eric Davis +Copyright (c) 2010 Aleksey V Zapparov AKA ixti + +redmine_tags is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +redmine_tags is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with redmine_tags. If not, see <http://www.gnu.org/licenses/>.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/LICENSE Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,619 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/README.rdoc Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,15 @@ += Redmine Tags + +Allows marking up different models in Redmine with tags. +Inspired by original redmine_tags of Eric Davis. But in +comparison extended with some code that was already wrote +as part of my own redmine taggable_issues branch. + +== Supported models + +* Issues + +== License + +This plugin is licensed under the GNU/GPL v3. +See COPYING and LICENSE for details.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/helpers/filters_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,62 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +module FiltersHelper + # returns link to the page with issues filtered by specified filters + # === parameters + # * <i>title</i> = link title text + # * <i>filters</i> = filters to be applied (see <tt>link_to_filter_options</tt> for details) + # * <i>options</i> = (optional) base options of the link + # === example + # link_to_filter 'foobar', [[ :tags, '~', 'foobar' ]] + # link_to_filter 'foobar', [[ :tags, '~', 'foobar' ]], :project_id => project + def link_to_filter(title, filters, options = {}) + options.merge! link_to_filter_options(filters) + link_to title, options + end + + + # returns hash suitable for passing it to the <tt>to_link</tt> + # === parameters + # * <i>filters</i> = array of arrays. each child array is an array of strings: + # name, operator and value + # === example + # link_to 'foobar', link_to_filter_options [[ :tags, '~', 'foobar' ]] + # + # filters = [[ :tags, '~', 'bazbaz' ], [:status_id, 'o']] + # link_to 'bazbaz', link_to_filter_options filters + def link_to_filter_options(filters) + options = { + :controller => 'issues', + :action => 'index', + :set_filter => 1, + :fields => [], + :values => {}, + :operators => {} + } + + filters.each do |f| + name, operator, value = f + options[:fields].push(name) + options[:operators][name] = operator + options[:values][name] = [value] + end + + options + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/helpers/tags_helper.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,97 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +module TagsHelper + include ActsAsTaggableOn::TagsHelper + include FiltersHelper + + + # Returns tag link + # === Parameters + # * <i>tag</i> = Instance of Tag + # * <i>options</i> = (optional) Options (override system settings) + # * show_count - Boolean. Whenever show tag counts + # * open_only - Boolean. Whenever link to the filter with "open" issues + # only limit. + def render_tag_link(tag, options = {}) + filters = [[:tags, '=', tag.name]] + filters << [:status_id, 'o'] if options[:open_only] + + content = link_to_filter tag.name, filters, :project_id => @project + if options[:show_count] + content << content_tag('span', "(#{tag.count})", :class => 'tag-count') + end + + content_tag('span', content, :class => 'tag-label') + end + + def render_project_tag_link(tag, options = {}) + content = link_to tag.name, :controller => :projects, :action => :index, :project => { :tag_list => tag.name } + if options[:show_count] + content << content_tag('span', "(#{tag.count})", :class => 'tag-count') + end + content_tag('span', content, :class => 'tag-label') + end + + + # Renders list of tags + # Clouds are rendered as block <tt>div</tt> with internal <tt>span</t> per tag. + # Lists are rendered as unordered lists <tt>ul</tt>. Lists are ordered by + # <tt>tag.count</tt> descending. + # === Parameters + # * <i>tags</i> = Array of Tag instances + # * <i>options</i> = (optional) Options (override system settings) + # * show_count - Boolean. Whenever show tag counts + # * open_only - Boolean. Whenever link to the filter with "open" issues + # only limit. + # * style - list, cloud + def render_tags_list(tags, options = {}) + unless tags.nil? or tags.empty? + content, style = '', options.delete(:style) + + tags.sort! { |a,b| b.count <=> a.count } + + if :list == style + list_el, item_el = 'ul', 'li' + elsif :cloud == style + list_el, item_el = 'div', 'span' + tags = cloudify(tags) + else + raise "Unknown list style" + end + + tag_cloud tags, (1..8).to_a do |tag, weight| + content << " " + content_tag(item_el, render_project_tag_link(tag, options), :class => "tag-nube-#{weight}") + " " + end + + content_tag(list_el, content, :class => 'tags') + end + end + + private + # put most massive tags in the middle + def cloudify(tags) + temp, tags, trigger = tags, [], true + temp.each do |tag| + tags.send((trigger ? 'push' : 'unshift'), tag) + trigger = !trigger + end + tags + end + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/auto_completes/_search_tag_list.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,5 @@ +<ul> + <% @tags.each do |tag| -%> + <%= content_tag 'li', h('%s (%d)' % [tag.name, tag.count]), :name => tag.name %> + <% end -%> +</ul>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/auto_completes/_tag_list.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,6 @@ +<ul> +<% @tags.each do |tag| -%> + <%= content_tag 'li', h('%s (%d)' % [tag.name, tag.count]), :name => tag.name %> +<% end -%> + <%= content_tag 'li', l(:auto_complete_new_tag) % @name, :name => @name %> +</ul>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/issues/_tags.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,6 @@ +<% unless issue.tag_list.empty? %> + <tr> + <td><b><%=l(:tags)%>:</b></td> + <td><%= issue.tag_counts.collect{ |t| render_tag_link(t, :show_count => false, :open_only => false) }.join(', ') %></td> + </tr> +<% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/issues/_tags_form.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,8 @@ +<% fields_for :issue, issue, :builder => TabularFormBuilder do |f| -%> +<div> + <p id="issue_tags"><%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %></p> + <div id="issue_tag_candidates" class="autocomplete"></div> + <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> + <%= javascript_tag "observeIssueTagsField('#{url_for(:controller => 'auto_completes', :action => 'issue_tags', :project_id => issue.project)}')" %> +</div> +<% end -%>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/issues/_tags_sidebar.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,5 @@ +<% unless sidebar_tags.empty? -%> + <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %> + <h3><%= l(:tags) %></h3> + <%= render_sidebar_tags %> +<% end -%>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,12 @@ +<p class='tag'> + <%- fields_for @project, :builder => TabularFormBuilder do |f| -%> + <div> + <p id="project_tags"> + <%= f.text_field :tag_list, :label => :label_tags_search, :size => 60, :class => 'hol' -%> + </p> + <div id="project_tag_candidates" class="autocomplete"></div> + <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' -%> + <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_search_tags')}', true)" -%> + </div> + <%- end -%> +</p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/projects/_filter_tags.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,13 @@ +<p class='tag'> + <% fields_for @project, :builder => TabularFormBuilder do |f| -%> + <div> + <p id="project_tags"> + <%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %> + </p> + <div id="project_tag_candidates" class="autocomplete"></div> + <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> + + <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_tags')}')" %> + </div> + <% end -%> +</p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/projects/_filtered_projects.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,7 @@ +<% if @projects.empty? %> +<p><b><%= l(:project_filter_no_results) %></b></p> +<% else %> +<%= render_project_table_with_filtering(@projects, @question) %> +<% end %> + +<p class="pagination"><%= pagination_links_full @project_pages, @project_count %></p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/projects/_my_projects.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,17 @@ +<% if !@user_projects.empty? %> +<% if @myproj_status=="true" %> +<fieldset id="my_projects_fieldset" class="collapsible"> + <legend onclick="toggleFieldsetWithState(this);"><h2><%= l(:label_my_project_plural) %></h2></legend> +<% else %> +<fieldset id="my_projects_fieldset" class="collapsible collapsed"> + <legend onclick="toggleFieldsetWithState(this);"><h2><%= l(:label_my_project_plural) %></h2></legend> + <div style="display: none;"> +<% end %> + <div> + <%= render_my_project_hierarchy_with_tags(@user_projects)%> + </div> + <% unless @myproj_status=="true" %> + </div> + <%- end -%> +</fieldset> +<% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/projects/_tagcloud.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,6 @@ + +<div id="tags"> +<%= render_tags_list(Project.available_tags, :style => :cloud) %> +</div> + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/projects/_tags.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,7 @@ +<% unless @project.tag_list.empty? %> + <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %> + <dl class="tags"> + <dt class="tags-title"><%=l(:tags)%></dt> + <dd class="tags"><%= @project.tag_counts.collect{ |t| render_project_tag_link(t) }.join(', ') %></dd> + </dl> +<% end %>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/projects/_tags_form.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,11 @@ +<% fields_for :project, project, :builder => TabularFormBuilder do |f| -%> +<div> + <p id="project_tags"><%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %> + <br /> + <em><%= l(:text_tags_info) %></em> + </p> + <div id="project_tag_candidates" class="autocomplete"></div> + <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> + <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_tags')}', false)" %> +</div> +<% end -%> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/projects/index.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,70 @@ +<% content_for :header_tags do %> + <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> + <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %> +<% end %> +<%= javascript_include_tag 'projects_index', :plugin => 'redmine_tags' %> + + +<div class="contextual"> + <%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%> + <%= '| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> +</div> + + +<div style="clear:both;"></div> +<% if User.current.logged? %> + <%= render :partial => 'my_projects' %> +<% end %> + +<div style="clear:both;"></div> +<h2> + <%= l("label_project_all") %> +</h2> + +<div style="clear:both;"></div> + <%- form_remote_tag(:controller => :projects, :action => :index, :method => :get, :html => {:id => :project_filtering_form}) do -%> + + <% if @filter_status=="true" %> + <fieldset id="filters_fieldset" class="collapsible"> + <legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> + <%- else -%> + <fieldset id="filters_fieldset" class="collapsible collapsed"> + <legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> + <div style="display: none;"> + <%- end -%> + + <div> + <div id='filter_tags'> + <%= render :partial => 'filter_search_tags' -%> + </div> + + <p class='q'> + <%= label_tag 'q', l('project_filtering_q_label') %> + <%= text_field_tag 'q', @question, :size => 30, :id => 'search-input' %> + </p> + + <p style="display: none;"><%= submit_tag( l('button_filter'), :id => 'submitButton') -%></p> + <%= link_to l(:button_apply), {}, :onclick => "$('submitButton').click(); return false;", :class => 'icon icon-checked' -%> + <%= link_to l(:button_clear), {}, :class => 'icon icon-reload' %> + </div> + + <% unless @filter_status=="true" %> + </div> + <%- end -%> + + +<%- end -%> +</fieldset> + +<div id="projects"> + <%= render :partial => 'filtered_projects' %> +</div> + + + + +<% other_formats_links do |f| %> + <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> +<% end %> + +<% html_title(l(:label_project_plural)) -%>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/app/views/tags/_settings.html.erb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,14 @@ +<fieldset><legend><%= l(:setting_issue_tags) %></legend> + <p> + <label><%= l(:issues_sidebar) %></label> + <%= select_tag 'settings[issues_sidebar]', options_for_select(%w(none list cloud).collect{|v| [l("issue_tags_sidebar_#{v}"), v]}, @settings[:issues_sidebar]) %> + </p> + <p> + <label><%= l(:issues_show_count) %></label> + <%= check_box_tag 'settings[issues_show_count]', 1, 1 == @settings[:issues_show_count].to_i %> + </p> + <p> + <label><%= l(:issues_open_only) %></label> + <%= check_box_tag 'settings[issues_open_only]', 1, 1 == @settings[:issues_open_only].to_i %> + </p> +</fieldset>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/assets/javascripts/projects_index.js Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,37 @@ +function toggleFieldsetWithState(this_field){ + id = Element.up(this_field, 'fieldset').id; + // is the fieldset collapsed? + status = $(id).hasClassName("collapsed"); + change_session(id, status); + + toggleFieldset(this_field); + +}; + + function submitForm(){ + $('submitButton').click(); + }; + +function change_session(id, nstatus) { + var url = "projects/set_fieldset_status"; + var request = new Ajax.Request(url, { + method: 'post', + parameters: {field_id: id, status: nstatus}, + asynchronous: true + }); +} + +function keypressHandler (event){ + var key = event.which || event.keyCode; + switch (key) { + default: + break; + case Event.KEY_RETURN: + $('submitButton').click(); return false; + break; + }; +}; + +document.observe("dom:loaded", function() { + $('search-input').observe('keypress', keypressHandler); +}); \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/assets/javascripts/tags_input.js Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,121 @@ +/** + * This file is a part of redmine_tags + * redMine plugin, that adds tagging support. + * + * Copyright (c) 2010 Aleksey V Zapparov AKA ixti + * + * redmine_tags is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * redmine_tags is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + */ + +var Redmine = Redmine || {}; + +Redmine.TagsInput = Class.create({ + initialize: function(element, update) { + this.element = $(element); + this.input = new Element('input', { 'type': 'text', 'autocomplete': 'off', 'size': 10 }); + this.button = new Element('span', { 'class': 'tag-add icon icon-add' }); + this.tags = new Hash(); + + this.update = update; + + var uri_params = window.location.href.toQueryParams(); + if (uri_params["project[tag_list]"] != undefined){ + this.addTag(uri_params["project[tag_list]"].stripTags(), true); + }; + + Event.observe(this.button, 'click', this.readTags.bind(this)); + Event.observe(this.input, 'keypress', this.onKeyPress.bindAsEventListener(this)); + + this.element.insert({ 'after': this.input }); + this.input.insert({ 'after': this.button }); + this.addTagsList(this.element.value); + }, + + readTags: function() { + this.addTagsList(this.input.value); + this.input.value = ''; + if(this.update){ + submitForm(); + }; + }, + + onKeyPress: function(event) { + if (Event.KEY_RETURN == event.keyCode) { + this.readTags(event); + Event.stop(event); + } + }, + + addTag: function(tag, noSubmit) { + if (tag.blank() || this.tags.get(tag)) return; + + if(noSubmit==undefined){noSubmit=false;} + + var button = new Element('span', { 'class': 'tag-delete icon icon-del' }); + var label = new Element('span', { 'class': 'tag-label' }).insert(tag).insert(button); + + this.tags.set(tag, 1); + this.element.value = this.getTagsList(); + this.element.insert({ 'before': label }); + + if(noSubmit==false){ + if(this.update){ + submitForm(); + }; + }; + + Event.observe(button, 'click', function(){ + this.tags.unset(tag); + this.element.value = this.getTagsList(); + label.remove(); + if(this.update){submitForm();}; + }.bind(this)); + }, + + addTagsList: function(tags_list) { + var tags = tags_list.split(','); + for (var i = 0; i < tags.length; i++) { + this.addTag(tags[i].strip().stripTags().toLowerCase()); + } + }, + + getTagsList: function() { + return this.tags.keys().join(','); + }, + + autocomplete: function(container, url) { + new Ajax.Autocompleter(this.input, container, url, { + 'minChars': 1, + 'frequency': 0.5, + 'paramName': 'q', + 'updateElement': function(el) { + this.input.value = el.getAttribute('name'); + this.readTags(); + }.bind(this) + }); + } +}); + + +function observeIssueTagsField(url) { + new Redmine.TagsInput('issue_tag_list', false).autocomplete('issue_tag_candidates', url); +} + +function observeProjectTagsField(url, update) { + if(!update) { + var update = false; + }; + + new Redmine.TagsInput('project_tag_list', update).autocomplete('project_tag_candidates', url); +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/assets/stylesheets/redmine_tags.css Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,44 @@ +/** + * This file is a part of redmine_tags + * redMine plugin, that adds tagging support. + * + * Copyright (c) 2010 Aleksey V Zapparov AKA ixti + * + * redmine_tags is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * redmine_tags is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + */ + +ul.tags { list-style: none; padding: 0px; } +ul.tags li { margin: .25em 0px; } + +div.tags { text-align: center; } +div.tags h3 { text-align: left; } +div.tags .tag-label { margin: .25em; } +div.tags .tag-nube-1 { font-size: .8em; } +div.tags .tag-nube-2 { font-size: .9em; } +div.tags .tag-nube-3 { font-size: 1em; } +div.tags .tag-nube-4 { font-size: 1.1em; } +div.tags .tag-nube-5 { font-size: 1.2em; } +div.tags .tag-nube-6 { font-size: 1.3em; } +div.tags .tag-nube-7 { font-size: 1.4em; } +div.tags .tag-nube-8 { font-size: 1.5em; } + +.tag-count { font-size: .75em; margin-left: .5em; } + +ul.projects .tags, ul.projects .no-tags { padding-left: 0.5em; color: #3e442c; font-size: 0.95em } +table.projects th.tags { color: #3e442c; } + +dl.tags { margin-top: 1.5em; margin-left: 0; padding-bottom: 1em; overflow: hidden; margin-bottom: 1em; border-bottom: 1px dotted #bbbbbb; } +dt.tags-title { float: left; font-weight: bold; color: #3e442c; } +dd.tags { margin-left: .5em; float: left; color: #3e442c; } +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/config/locales/de.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,35 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# German translation for redmine_tags +# by Terence Miller aka cforce, <cforce(at)gmx.de> +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +de: + tags: Tags + field_tags: Tags + field_tag_list: Tags + setting_issue_tags: Ticket Tags + issues_sidebar: Zeige die Tags auf der Sidebar + issues_show_count: Zeige die Ticketanzahl an + issues_open_only: Zeige nur noch offene Tickets + + issue_tags_sidebar_none: Keine + issue_tags_sidebar_list: Liste + issue_tags_sidebar_cloud: Cloud + + auto_complete_new_tag: Hinzufügen...
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/config/locales/en.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,45 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# English translation for redmine_tags +# by Aleksey V Zapparov AKA ixti +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +en: + tags: Tags + field_tags: Tags + field_tag_list: Tags + field_no_tags: "No tags" + label_tags_search: "Tags: " + setting_issue_tags: Issues Tags + issues_sidebar: Display tags on sidebar as + issues_show_count: Display amount of issues + issues_open_only: Display open issues only + + issue_tags_sidebar_none: None + issue_tags_sidebar_list: List + issue_tags_sidebar_cloud: Cloud + + auto_complete_new_tag: Add new... + + project_filtering_q_label: "Search for text:" + project_filter_no_results: "No matching projects found" + button_filter: "Filter" + + text_tags_info: "A tag can be any text you like, but they're most useful if you choose tags that are already being used for the same thing by other projects (where possible). <br />Some tag examples are: library, plugin, paper, c++, mir, alpha, stable, bsd, android, ...<br />Tags help others find your work: please don't forget to tag your projects!" + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/config/locales/fr.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,35 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# French translation for redmine_tags +# by Stphane HANNEQUIN, <stephane.hannequin(at)aster-ingenierie.com> +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +fr: + tags: Tags + field_tags: Tags + field_tag_list: Tags + setting_issue_tags: Tags des demandes + issues_sidebar: Afficher les Tags comme + issues_show_count: Afficher le nombre de demande + issues_open_only: N'afficher que les demandes ouvertes + + issue_tags_sidebar_none: Ne pas afficher + issue_tags_sidebar_list: Liste + issue_tags_sidebar_cloud: Nuage + + auto_complete_new_tag: Nouveau...
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/config/locales/ru.yml Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,35 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Russian translation for redmine_tags +# by Aleksey V Zapparov AKA ixti +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +ru: + tags: Метки + field_tags: Метки + field_tag_list: Метки + setting_issue_tags: Метки задач + issues_sidebar: Боковую панель как + issues_show_count: Показать кол-во задач + issues_open_only: Только открытые задачи + + issue_tags_sidebar_none: Не показывать + issue_tags_sidebar_list: Список + issue_tags_sidebar_cloud: Облако + + auto_complete_new_tag: Добавить...
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/config/routes.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,3 @@ +ActionController::Routing::Routes.draw do |map| + map.connect 'projects/set_fieldset_status', :controller => 'projects', :action => 'set_fieldset_status', :conditions => {:method => :post} +end \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/db/migrate/001_acts_as_taggable_on_migration.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,29 @@ +class ActsAsTaggableOnMigration < ActiveRecord::Migration + def self.up + create_table :tags do |t| + t.column :name, :string + end + + create_table :taggings do |t| + t.column :tag_id, :integer + t.column :taggable_id, :integer + t.column :tagger_id, :integer + t.column :tagger_type, :string + + # You should make sure that the column created is + # long enough to store the required class names. + t.column :taggable_type, :string + t.column :context, :string + + t.column :created_at, :datetime + end + + add_index :taggings, :tag_id + add_index :taggings, [:taggable_id, :taggable_type, :context] + end + + def self.down + drop_table :taggings + drop_table :tags + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/init.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,84 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +config.gem "acts-as-taggable-on", :version => '2.0.6' + +require 'redmine' + +Redmine::Plugin.register :redmine_tags do + name 'redmine_tags' + author 'Aleksey V Zapparov AKA "ixti"' + description 'redMine tagging support' + version '1.1.4' + url 'http://www.ixti.ru/' + author_url 'http://www.ixti.ru/' + + requires_redmine :version_or_higher => '1.0.0' + + settings :default => { + :issues_sidebar => 'none', + :issues_show_count => 0, + :issues_open_only => 0 + }, :partial => 'tags/settings' +end + + +require 'dispatcher' + +Dispatcher.to_prepare :redmine_tags do + + require_dependency 'redmine_project_filtering' + + unless Project.included_modules.include?(RedmineTags::Patches::ProjectPatch) + Project.send(:include, RedmineTags::Patches::ProjectPatch) + end + + unless ProjectsHelper.included_modules.include?(RedmineTags::Patches::ProjectsHelperPatch) + ProjectsHelper.send(:include, RedmineTags::Patches::ProjectsHelperPatch) + end + + unless Issue.included_modules.include?(RedmineTags::Patches::IssuePatch) + Issue.send(:include, RedmineTags::Patches::IssuePatch) + end + + unless IssuesHelper.included_modules.include?(RedmineTags::Patches::IssuesHelperPatch) + IssuesHelper.send(:include, RedmineTags::Patches::IssuesHelperPatch) + end + + unless ProjectsController.included_modules.include?(RedmineTags::Patches::ProjectsControllerPatch) + ProjectsController.send(:include, RedmineTags::Patches::ProjectsControllerPatch) + end + + unless AutoCompletesController.included_modules.include?(RedmineTags::Patches::AutoCompletesControllerPatch) + AutoCompletesController.send(:include, RedmineTags::Patches::AutoCompletesControllerPatch) + end + + unless Query.included_modules.include?(RedmineTags::Patches::QueryPatch) + Query.send(:include, RedmineTags::Patches::QueryPatch) + end + + unless QueriesHelper.included_modules.include?(RedmineTags::Patches::QueriesHelperPatch) + QueriesHelper.send(:include, RedmineTags::Patches::QueriesHelperPatch) + end +end + + +require 'redmine_tags/hooks/model_issue_hook' +require 'redmine_tags/hooks/views_issues_hook' +require 'redmine_tags/hooks/views_projects_hook' +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_project_filtering.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,15 @@ +module RedmineProjectFiltering + + # transforms a question and a list of custom fields into something that Project.search can process + def self.calculate_tokens(question, custom_fields=nil) + list = [] + list << question if question.present? + + tokens = list.join(' ').scan(%r{((\s|^)"[\s\w]+"(\s|$)|\S+)}) + tokens = tokens.collect{ |m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '') } + + # tokens must be at least 2 characters long + tokens.select {|w| w.length > 1 } + end + +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/hooks/model_issue_hook.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,54 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Eric Davis +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +module RedmineTags + module Hooks + class ModelIssueHook < Redmine::Hook::ViewListener + def controller_issues_edit_before_save(context={}) + save_tags_to_issue(context, true) + end + + # Issue has an after_save method that calls reload (update_nested_set_attributes) + # This makes it impossible for a new record to get a tag_list, it's + # cleared on reload. So instead, hook in after the Issue#save to update + # this issue's tag_list and call #save ourselves. + def controller_issues_new_after_save(context={}) + save_tags_to_issue(context, false) + context[:issue].save + end + + def save_tags_to_issue(context, create_journal) + params = context[:params] + + if params && params[:issue] && !params[:issue][:tag_list].nil? + old_tags = context[:issue].tag_list.to_s + context[:issue].tag_list = params[:issue][:tag_list] + new_tags = context[:issue].tag_list.to_s + + if create_journal and not (old_tags == new_tags || context[:issue].current_journal.blank?) + context[:issue].current_journal.details << JournalDetail.new(:property => 'attr', + :prop_key => 'tag_list', + :old_value => old_tags, + :value => new_tags) + end + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/hooks/model_project_hook.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,58 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Eric Davis +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +module RedmineTags + module Hooks + class ModelProjectHook < Redmine::Hook::ViewListener + def controller_project_before_save(context={}) + debugger + save_tags_to_project(context, true) + end + + # Issue has an after_save method that calls reload (update_nested_set_attributes) + # This makes it impossible for a new record to get a tag_list, it's + # cleared on reload. So instead, hook in after the Issue#save to update + # this issue's tag_list and call #save ourselves. + def controller_projects_before_save(context={}) + debugger + save_tags_to_project(context, false) + context[:project].save + end + + def save_tags_to_project(context, create_journal) + params = context[:params] + debugger + logger.error { "WORKING" } + + # if params && params[:issue] && !params[:issue][:tag_list].nil? + # old_tags = context[:issue].tag_list.to_s + # context[:issue].tag_list = params[:issue][:tag_list] + # new_tags = context[:issue].tag_list.to_s + # + # if create_journal and not (old_tags == new_tags || context[:issue].current_journal.blank?) + # context[:issue].current_journal.details << JournalDetail.new(:property => 'attr', + # :prop_key => 'tag_list', + # :old_value => old_tags, + # :value => new_tags) + # end + # end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/hooks/views_issues_hook.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,28 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +module RedmineTags + module Hooks + class ViewsIssuesHook < Redmine::Hook::ViewListener + render_on :view_issues_show_details_bottom, :partial => 'issues/tags' + render_on :view_issues_form_details_bottom, :partial => 'issues/tags_form' + render_on :view_issues_sidebar_planning_bottom, :partial => 'issues/tags_sidebar' + end + end +end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/hooks/views_projects_hook.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,10 @@ +module RedmineTags + module Hooks + class ViewsProjectsHook < Redmine::Hook::ViewListener + render_on :view_projects_form, :partial => 'projects/tags_form' + render_on :view_projects_show_sidebar_top, :partial => 'projects/tags' +# render_on :view_issues_sidebar_planning_bottom, :partial => 'issues/tags_sidebar' + end + end +end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/patches/auto_completes_controller_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,50 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +require_dependency 'auto_completes_controller' + +module RedmineTags + module Patches + module AutoCompletesControllerPatch + def self.included(base) + base.send(:include, InstanceMethods) + end + + + module InstanceMethods + def issue_tags + @name = params[:q].to_s + @tags = Issue.available_tags :project_id => @project, :name_like => @name + render :layout => false, :partial => 'tag_list' + end + + def project_tags + @name = params[:q].to_s + @tags = Project.available_tags :name_like => @name + render :layout => false, :partial => 'tag_list' + end + + def project_search_tags + @name = params[:q].to_s + @tags = Project.available_tags :name_like => @name + render :layout => false, :partial => 'search_tag_list' + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/patches/issue_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,69 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +require_dependency 'issue' + +module RedmineTags + module Patches + module IssuePatch + def self.included(base) + base.extend(ClassMethods) + + base.class_eval do + unloadable + acts_as_taggable + end + end + + module ClassMethods + # Returns available issue tags + # === Parameters + # * <i>options</i> = (optional) Options hash of + # * project - Project to search in. + # * open_only - Boolean. Whenever search within open issues only. + # * name_like - String. Substring to filter found tags. + def available_tags(options = {}) + project = options[:project] + open_only = options[:open_only] + name_like = options[:name_like] + options = {} + visible = ARCondition.new + + if project + project = project.id if project.is_a? Project + visible << ["#{Issue.table_name}.project_id = ?", project] + end + + if open_only + visible << ["#{Issue.table_name}.status_id IN " + + "( SELECT issue_status.id " + + " FROM #{IssueStatus.table_name} issue_status " + + " WHERE issue_status.is_closed = ? )", false] + end + + if name_like + visible << ["#{ActsAsTaggableOn::Tag.table_name}.name LIKE ?", "%#{name_like.downcase}%"] + end + + options[:conditions] = visible.conditions + self.all_tag_counts(options) + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/patches/issues_helper_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,56 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +require_dependency 'issues_helper' + +module RedmineTags + module Patches + module IssuesHelperPatch + def self.included(base) + base.send(:include, InstanceMethods) + end + + module InstanceMethods + include TagsHelper + + def redmine_tags_settings + @redmine_tags_settings = Setting.plugin_redmine_tags unless @redmine_tags_settings + @redmine_tags_settings + end + + def sidebar_tags + unless @sidebar_tags + @sidebar_tags = [] + if :none != redmine_tags_settings[:issues_sidebar].to_sym + @sidebar_tags = Issue.available_tags(:project => @project, + :open_only => (redmine_tags_settings[:issues_open_only].to_i == 1)) + end + end + @sidebar_tags + end + + def render_sidebar_tags + render_tags_list(sidebar_tags, + :show_count => (redmine_tags_settings[:issues_show_count].to_i == 1), + :open_only => (redmine_tags_settings[:issues_open_only].to_i == 1), + :style => redmine_tags_settings[:issues_sidebar].to_sym) + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,55 @@ +# C4DM + +require_dependency 'project' + +module RedmineTags + module Patches + module ProjectPatch + def self.included(base) # :nodoc: + base.extend(ClassMethods) + base.send(:include, InstanceMethods) + + base.class_eval do + unloadable + + attr_accessor :tag_list + acts_as_taggable + + end + end + + module InstanceMethods + end + + module ClassMethods + def search_by_question(question) + if question.length > 1 + search(RedmineProjectFiltering.calculate_tokens(question), nil, :all_words => true).first.sort_by(&:lft) + else + all(:order => 'lft') + end + end + + + # Returns available project tags + # does not show tags from private projects + def available_tags( options = {} ) + + name_like = options[:name_like] + options = {} + visible = ARCondition.new + + visible << ["#{Project.table_name}.is_public = '1'"] + + if name_like + visible << ["#{ActsAsTaggableOn::Tag.table_name}.name LIKE ?", "%#{name_like.downcase}%"] + end + + options[:conditions] = visible.conditions + + self.all_tag_counts(options) + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,139 @@ +# -*- coding: utf-8 -*- +require_dependency 'projects_controller' + +module RedmineTags + module Patches + module ProjectsControllerPatch + def self.included(base) + base.send(:include, InstanceMethods) + base.class_eval do + unloadable + skip_before_filter :authorize, :only => [:set_fieldset_status] + skip_before_filter :find_project, :only => [:set_fieldset_status] + before_filter :add_tags_to_project, :only => [:save, :update] + + alias :index filtered_index + end + end + + module InstanceMethods + + def add_tags_to_project + + if params && params[:project] && !params[:project][:tag_list].nil? + old_tags = @project.tag_list.to_s.downcase + new_tags = params[:project][:tag_list].to_s.downcase + + unless (old_tags == new_tags) + @project.tag_list = ActionController::Base.helpers.strip_tags(new_tags) + end + end + end + + def paginate_projects + sort_init 'name' + sort_update %w(name lft created_on updated_on) + @limit = per_page_option + @project_count = Project.visible_roots.find(@projects).count + + @project_pages = ActionController::Pagination::Paginator.new self, @project_count, @limit, params['page'] + @offset ||= @project_pages.current.offset + end + + def set_fieldset_status + + # luisf. test for missing parameters……… + field = params[:field_id] + status = params[:status] + + session[(field + "_status").to_sym] = status + render :nothing => true + end + + # gets the status of the collabsible fieldsets + def get_fieldset_statuses + if session[:my_projects_fieldset_status].nil? + @myproj_status = "true" + else + @myproj_status = session[:my_projects_fieldset_status] + end + + if session[:filters_fieldset_status].nil? + @filter_status = "false" + else + @filter_status = session[:filters_fieldset_status] + end + + if params && params[:project] && !params[:project][:tag_list].nil? + @filter_status = "true" + end + + end + + # Lists visible projects. Paginator is for top-level projects only + # (subprojects belong to them) + def filtered_index + @project = Project.new + filter_projects + get_fieldset_statuses + + respond_to do |format| + format.html { + paginate_projects + + @projects = Project.visible_roots.find(@projects, :offset => @offset, :limit => @limit, :order => sort_clause) + + if User.current.logged? + # seems sort_by gives us case-sensitive ordering, which we don't want + # @user_projects = User.current.projects.sort_by(&:name) + @user_projects = User.current.projects.all(:order => :name) + end + + render :template => 'projects/index.html.erb', :layout => !request.xhr? + } + format.api { + @offset, @limit = api_offset_and_limit + @project_count = Project.visible.count + @projects = Project.visible.find(@projects, :offset => @offset, :limit => @limit, :order => 'lft') + } + format.atom { + projects = Project.visible.find(:all, :order => 'created_on DESC', :limit => Setting.feeds_limit.to_i) + render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}") + } + format.js { + paginate_projects + @projects = Project.visible_roots.find(@projects, :offset => @offset, :limit => @limit, :order => sort_clause) + render :update do |page| + page.replace_html 'projects', :partial => 'filtered_projects' + end + } + end + end + + private + + def filter_projects + @question = (params[:q] || "").strip + + if params.has_key?(:project) + @tag_list = (params[:project][:tag_list] || "").strip.split(",") + else + @tag_list = [] + end + + if @question == "" + @projects = Project.visible_roots + else + @projects = Project.visible_roots.find(Project.visible.search_by_question(@question)) + end + + unless @tag_list.empty? + @tagged_projects_ids = Project.visible.tagged_with(@tag_list).collect{ |project| Project.find(project.id).root } + @projects = @projects & @tagged_projects_ids + @projects = @projects.uniq + end + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,272 @@ +module RedmineTags + module Patches + module ProjectsHelperPatch + + def self.included(base) # :nodoc: + base.send(:include, InstanceMethods) + base.send(:include, TagsHelper) + + base.class_eval do + unloadable + end + end + + module InstanceMethods + # Renders a tree of projects that the current user does not belong + # to, or of all projects if the current user is not logged in. The + # given collection may be a subset of the whole project tree + # (eg. some intermediate nodes are private and can not be seen). We + # are potentially interested in various things: the project name, + # description, manager(s), creation date, last activity date, + # general activity level, whether there is anything actually hosted + # here for the project, etc. + def render_project_table_with_filtering(projects, question) + custom_fields = "" + s = "" + if projects.any? + tokens = RedmineProjectFiltering.calculate_tokens(question, custom_fields) + + s << "<div class='autoscroll'>" + s << "<table class='list projects'>" + s << "<thead><tr>" + + s << sort_header_tag('name', :caption => l("field_name")) + s << "<th class='tags'>" << l("tags") << "</th>" + s << "<th class='managers'>" << l("label_managers") << "</th>" + s << sort_header_tag('created_on', :default_order => 'desc') + s << sort_header_tag('updated_on', :default_order => 'desc') + + s << "</tr></thead><tbody>" + + original_project = @project + + projects.each do |project| + s << render_project_in_table_with_filtering(project, cycle('odd', 'even'), 0, tokens) + end + + s << "</table>" + else + s << "\n" + end + @project = original_project + + s + end + + def render_project_in_table_with_filtering(project, oddeven, level, tokens) + # set the project environment to please macros. + @project = project + + classes = (level == 0 ? 'root' : 'child') + + s = "" + + s << "<tr class='#{oddeven} #{classes} level#{level}'>" + s << "<td class='firstcol' align=top><div class='name hosted_here" + s << " no_description" if project.description.blank? + s << "'>" << link_to( highlight_tokens(project.name, tokens), {:controller => 'projects', :action => 'show', :id => project}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}") + s << "</div>" + s << highlight_tokens(render_project_short_description(project), tokens) + s << "</td>" + + # taglist + s << "<td class='tags' align=top>" << project.tag_counts.collect{ |t| render_project_tag_link(t) }.join(', ') << "</td>" + + s << "<td class='managers' align=top>" + + u = project.users_by_role + if u + u.keys.each do |r| + if r.allowed_to?(:edit_project) + mgrs = [] + u[r].sort.each do |m| + mgrs << link_to_user(m) + end + if mgrs.size < 3 + s << '<nobr>' << mgrs.join(', ') << '</nobr>' + else + s << mgrs.join(', ') + end + end + end + end + + s << "</td>" + + s << "<td class='created_on' align=top>" << format_date(project.created_on) << "</td>" + s << "<td class='updated_on' align=top>" << format_date(project.updated_on) << "</td>" + + s << "</tr>" + + project.children.each do |child| + if child.is_public? or User.current.member_of?(child) + s << render_project_in_table_with_filtering(child, oddeven, level + 1, tokens) + end + end + + s + end + + + + # Renders a tree of projects as a nested set of unordered lists + # The given collection may be a subset of the whole project tree + # (eg. some intermediate nodes are private and can not be seen) + def render_project_hierarchy_with_filtering(projects,custom_fields,question) + s = [] + if projects.any? + tokens = RedmineProjectFiltering.calculate_tokens(question, custom_fields) + debugger + + + ancestors = [] + original_project = @project + projects.each do |project| + # set the project environment to please macros. + @project = project + if (ancestors.empty? || project.is_descendant_of?(ancestors.last)) + s << "<ul class='projects #{ ancestors.empty? ? 'root' : nil}'>" + else + ancestors.pop + s << "</li>" + while (ancestors.any? && !project.is_descendant_of?(ancestors.last)) + ancestors.pop + s << "</ul></li>" + end + end + classes = (ancestors.empty? ? 'root' : 'child') + s << "<li class='#{classes}'><div class='#{classes}'>" + + link_to( highlight_tokens(project.name, tokens), + {:controller => 'projects', :action => 'show', :id => project}, + :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}" + ) + s << "<ul class='filter_fields'>" + + # CustomField.usable_for_project_filtering.each do |field| + # value_model = project.custom_value_for(field.id) + # value = value_model.present? ? value_model.value : nil + # s << "<li><b>#{field.name.humanize}:</b> #{highlight_tokens(value, tokens)}</li>" if value.present? + # end + + s << "</ul>" + s << "<div class='clear'></div>" + unless project.description.blank? + s << "<div class='wiki description'>" + s << "<b>#{ t(:field_description) }:</b>" + s << highlight_tokens(textilizable(project.short_description, :project => project), tokens) + s << "\n</div>" + end + s << "</div>" + ancestors << project + end + ancestors.size.times{ s << "</li></ul>" } + @project = original_project + end + s.join "\n" + end + + # Renders a tree of projects where the current user belongs + # as a nested set of unordered lists + # The given collection may be a subset of the whole project tree + # (eg. some intermediate nodes are private and can not be seen) + def render_my_project_hierarchy_with_tags(projects) + + s = '' + + original_project = @project + + projects.each do |project| + if project.root? || !projects.include?(project.parent) + s << render_my_project_in_hierarchy_with_tags(project) + end + end + + @project = original_project + + if s != '' + a = '' + a << "<ul class='projects root'>\n" + a << s + a << "</ul>\n" + s = a + end + + s + + end + + + + + def render_my_project_in_hierarchy_with_tags(project) + + s = '' + + if User.current.member_of?(project) + + # set the project environment to please macros. + @project = project + + classes = (project.root? ? 'root' : 'child') + + s << "<li class='#{classes}'><div class='#{classes}'>" + + link_to_project(project, {}, :class => "project my-project") + if project.is_public? + s << " <span class='public'>" << l(:field_is_public) << "</span>" + else + s << " <span class='private'>" << l(:field_is_private) << "</span>" + end + + tc = project.tag_counts + if tc.empty? + s << " <span class='no-tags'>" << l(:field_no_tags) << "</span>" + else + s << " <span class='tags'>" << tc.collect{ |t| render_project_tag_link(t) }.join(', ') << "</span>" + end + + s << render_project_short_description(project) + + s << "</div>\n" + + cs = '' + project.children.each do |child| + cs << render_my_project_in_hierarchy_with_tags(child) + end + + if cs != '' + s << "<ul class='projects'>\n" << cs << "</ul>\n"; + end + + end + + s + + end + + + + private + + # copied from search_helper. This one doesn't escape html or limit the text length + def highlight_tokens(text, tokens) + return text unless text && tokens && !tokens.empty? + re_tokens = tokens.collect {|t| Regexp.escape(t)} + regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE + result = '' + text.split(regexp).each_with_index do |words, i| + words = words.mb_chars + if i.even? + result << words + else + t = (tokens.index(words.downcase) || 0) % 4 + result << content_tag('span', words, :class => "highlight token-#{t}") + end + end + result + end + + end + end + end +end +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/patches/queries_helper_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,48 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +require_dependency 'queries_helper' + +module RedmineTags + module Patches + module QueriesHelperPatch + def self.included(base) + base.send(:include, InstanceMethods) + + base.class_eval do + alias_method :column_content_original, :column_content + alias_method :column_content, :column_content_extended + end + end + + + module InstanceMethods + include TagsHelper + + + def column_content_extended(column, issue) + if column.name.eql? :tags + column.value(issue).collect{ |t| render_tag_link(t) }.join(', ') + else + column_content_original(column, issue) + end + end + end + end + end +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/redmine_tags/lib/redmine_tags/patches/query_patch.rb Tue Jan 08 12:32:05 2013 +0000 @@ -0,0 +1,74 @@ +# This file is a part of redmine_tags +# redMine plugin, that adds tagging support. +# +# Copyright (c) 2010 Aleksey V Zapparov AKA ixti +# +# redmine_tags is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# redmine_tags is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. + +require_dependency 'query' + +module RedmineTags + module Patches + module QueryPatch + def self.included(base) + base.send(:include, InstanceMethods) + + base.class_eval do + unloadable + + alias_method :statement_original, :statement + alias_method :statement, :statement_extended + + alias_method :available_filters_original, :available_filters + alias_method :available_filters, :available_filters_extended + + base.add_available_column(QueryColumn.new(:tags)) + end + end + + + module InstanceMethods + def statement_extended + filter = filters.delete 'tags' + clauses = statement_original + + if filter + filters.merge!( 'tags' => filter ) + + values = values_for('tags').clone + compare = operator_for('tags').eql?('=') ? 'IN' : 'NOT IN' + ids_list = Issue.tagged_with(values).collect{ |issue| issue.id }.push(0).join(',') + + clauses << " AND ( #{Issue.table_name}.id #{compare} (#{ids_list}) ) " + end + + clauses + end + + + def available_filters_extended + unless @available_filters + available_filters_original.merge!({ 'tags' => { + :type => :list, + :order => 6, + :values => Issue.available_tags(:project => project).collect{ |t| [t.name, t.name] } + }}) + end + @available_filters + end + end + end + end +end +
--- a/vendor/plugins/embedded/COPYING Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License.
--- a/vendor/plugins/embedded/README Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -Embedded plugin for Redmine -Copyright (C) 2008 Jean-Philippe Lang - -The plugin lets you embed html pages (eg. documentation, test reports) in your projects. - -See: http://www.redmine.org/wiki/redmine/PluginEmbedded
--- a/vendor/plugins/embedded/RUNNING_TESTS Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -rake test:plugins PLUGIN=embedded
--- a/vendor/plugins/embedded/app/controllers/embedded_controller.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -# Redmine - project management software -# Copyright (C) 2008 Jean-Philippe Lang -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -require 'iconv' - -class EmbeddedController < ApplicationController - class EmbeddedControllerError < StandardError; end - - unloadable - layout 'base' - before_filter :find_project, :authorize - - def index - path = get_real_path(params[:path]) - if File.directory?(path) - file = get_index_file(path) - target = params[:path] || [] - target << file - # Forces redirect to the index file when the requested path is a directory - # so that relative links in embedded html pages work - redirect_to :path => target - return - end - - # Check file extension - raise EmbeddedControllerError.new('This file can not be viewed (invalid extension).') unless Redmine::Plugins::Embedded.valid_extension?(path) - - if Redmine::MimeType.is_type?('image', path) - send_file path, :disposition => 'inline', :type => Redmine::MimeType.of(path) - else - embed_file path - end - - rescue Errno::ENOENT => e - # File was not found - render_404 - rescue Errno::EACCES => e - # Can not read the file - render_error "Unable to read the file: #{e.message}" - rescue EmbeddedControllerError => e - render_error e.message - end - - private - - def find_project - @project = Project.find(params[:id]) - rescue ActiveRecord::RecordNotFound - render_404 - end - - # Return the path to the html root directory for the current project - def get_project_directory - @project_directory ||= Setting.plugin_embedded['path'].to_s.gsub('{PROJECT}', @project.identifier) - end - - # Returns the absolute path of the requested file - # Parameter is an Array - def get_real_path(path) - real = get_project_directory - real = File.join(real, path) unless path.nil? || path.empty? - dir = File.expand_path(get_project_directory) - real = File.expand_path(real) - raise Errno::ENOENT unless real.starts_with?(dir) && File.exist?(real) - real - end - - # Returns the index file in the given directory - # and raises an exception if none is found - def get_index_file(dir) - indexes = Setting.plugin_embedded['index'].to_s.split - file = indexes.find {|f| File.exist?(File.join(dir, f))} - raise EmbeddedControllerError.new("No index file found in #{dir} (#{indexes.join(', ')}).") if file.nil? - file - end - - # Renders a given HTML file - def embed_file(path) - @content = File.read(path) - - # Extract html title from embedded page - if @content =~ %r{<title>([^<]*)</title>}mi - @title = $1.strip - end - - # Keep html body only - @content.gsub!(%r{^.*<body[^>]*>(.*)</body>.*$}mi, '\\1') - - # Re-encode content if needed - source_encoding = Setting.plugin_embedded['encoding'].to_s - unless source_encoding.blank? - begin; @content = Iconv.new('UTF-8', source_encoding).iconv(@content); rescue; end - end - - @doc_template = Redmine::Plugins::Embedded.detect_template_from_path(path) - render :action => 'index' - end -end
--- a/vendor/plugins/embedded/app/helpers/embedded_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -# Redmine - project management software -# Copyright (C) 2008 Jean-Philippe Lang -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -module EmbeddedHelper - - # Adds include tags for assets of the given template - def asset_include_tags(template) - - Redmine::Plugins::Embedded.assets(template).each { |asset| content_for(:header_tags) { asset_include_tag(asset) } } - end - - private - - def asset_include_tag(asset) - if asset =~ %r{\.js$} - javascript_include_tag(asset, :plugin => 'embedded') - else - stylesheet_link_tag(asset, :plugin => 'embedded') - end - end -end
--- a/vendor/plugins/embedded/app/views/embedded/index.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -<!-- Embedded page --> -<div class="embedded"> -<%= @content %> -</div> -<!-- Embedded page end --> - -<% html_title(@title) if @title %> - -<% asset_include_tags(@doc_template) %>
--- a/vendor/plugins/embedded/app/views/settings/_embedded.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<p><label>HTML directory</label> -<%= text_field_tag 'settings[path]', @settings['path'], :size => 80 %> -<br /><em>Use {PROJECT} to include the project identifier in the path</em></p> - -<p><label>Index files</label> -<%= text_area_tag 'settings[index]', @settings['index'], :cols => 60, :rows => 3 %> -<br /><em>Space separated list of index files by priority</em></p> - -<p><label>Valid extensions</label> -<%= text_area_tag 'settings[extensions]', @settings['extensions'], :cols => 60, :rows => 3 %> -<br /><em>Space separated list of file extensions that can be viewed (case insensitive)</em></p> - -<p><label>Default template</label> -<%= select_tag 'settings[template]', options_for_select([''] + Redmine::Plugins::Embedded.available_templates, @settings['template']) %></p> - -<p><label>Files encoding</label> -<%= text_field_tag 'settings[encoding]', @settings['encoding'] %> -<br /><em>Eg. ISO-8859-1<br />Leave this field empty if HTML files are UTF-8 encoded</em></p> - -<p><label>Menu caption</label> -<%= text_field_tag 'settings[menu]', @settings['menu'], :size => 30 %> -<br /><em>Clear this field if you don't want to add a tab to the project menu</em></p>
--- a/vendor/plugins/embedded/assets/javascripts/rcov.js Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -function toggleCode( id ) { - if ( document.getElementById ) - elem = document.getElementById( id ); - else if ( document.all ) - elem = eval( "document.all." + id ); - else - return false; - - elemStyle = elem.style; - - if ( elemStyle.display != "block" ) { - elemStyle.display = "block" - } else { - elemStyle.display = "none" - } - - return true; -}
--- a/vendor/plugins/embedded/assets/stylesheets/doxygen.css Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -#content { - font-family: Geneva, Arial, Helvetica, sans-serif; -} -#content h1, h2, h3 {border: 0;} -#content h1 {margin-bottom: 1em;} -#content CAPTION { font-weight: bold } -#content DIV.qindex { - line-height: 120%; - margin-bottom: 1em; -} -#content A.qindex { - text-decoration: none; - font-weight: bold; - padding: 2px; -} -#content A.qindexHL { - text-decoration: underline; - font-weight: bold; - padding: 2px; -} -#content A.el { text-decoration: none; font-weight: bold } -#content A.elRef { font-weight: bold } -#content A.code { text-decoration: none; font-weight: normal; color: #1A419D} -#content A.codeRef { font-weight: normal; color: #1A419D} -#content DL.el { margin-left: -1cm } -#content PRE.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - margin-top: 4px; - margin-bottom: 4px; - margin-left: 2px; - margin-right: 8px; - padding-left: 6px; - padding-right: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -#content DIV.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - padding: 6px; -} -#content DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } -#content TD.md { background-color: #F4F4FB; font-weight: bold; } -#content TD.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } -#content TD.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } -#content DIV.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: bold; - font-family: Geneva, Arial, Helvetica, sans-serif; -} -#content DIV.groupText { margin-left: 16px; font-style: italic; font-size: 14px } -#content TD.indexkey { - background-color: #eeeeff; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -#content TD.indexvalue { - background-color: #eeeeff; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -#content TR.memlist { - background-color: #f0f0f0; -} -#content P.formulaDsp { text-align: center; } -#content IMG.formulaDsp { } -#content IMG.formulaInl { vertical-align: middle; } -#content SPAN.keyword { color: #008000 } -#content SPAN.keywordtype { color: #604020 } -#content SPAN.keywordflow { color: #e08000 } -#content SPAN.comment { color: #800000 } -#content SPAN.preprocessor { color: #806020 } -#content SPAN.stringliteral { color: #002080 } -#content SPAN.charliteral { color: #008080 } -#content .mdTable { - border: 1px solid #868686; - background-color: #F4F4FB; -} -#content .mdRow { - padding: 8px 10px; -} -#content .mdescLeft { - padding: 0px 8px 4px 8px; - font-size: 14px; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -#content .mdescRight { - padding: 0px 8px 4px 8px; - font-size: 14px; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -#content .memItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 12px; -} -#content .memItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-style: solid; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-family: Geneva, Arial, Helvetica, sans-serif; - font-size: 13px; -} -#content .search { color: #003399; - font-weight: bold; -} -#content FORM.search { - margin-bottom: 0px; - margin-top: 0px; -} -#content INPUT.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #eeeeff; -} -#content TD.tiny { font-size: 75%; -}
--- a/vendor/plugins/embedded/assets/stylesheets/javadoc.css Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -/* Javadoc style sheet */ - -/* Table colors */ -.TableHeadingColor { background: #eef; } /* Dark mauve */ -.TableHeadingColor th b { font-size: 70%; } -.TableSubHeadingColor { background: #EEEEee; } /* Light mauve */ -.TableRowColor { background: #FFFFFF; } /* White */ - -/* Font used in left-hand frame lists */ -.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } -.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 } - -/* Navigation bar fonts and colors */ -.NavBarCell1 { background-color: inherit; } /* Light mauve */ -.NavBarCell1Rev { background-color: inherit; } /* Dark Blue */ -.NavBarFont1 { font-family: Arial, Helvetica, sans-serif;} -.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; font-style: underline; } - -.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000; display: none;} -.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000} - -#content table { border-collapse: collapse; border-color: #ddd; }
--- a/vendor/plugins/embedded/assets/stylesheets/rcov.css Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,525 +0,0 @@ -span.cross-ref-title { - font-size: 140%; -} -span.cross-ref a { - text-decoration: none; -} -span.cross-ref { - background-color:#f3f7fa; - border: 1px dashed #333; - margin: 1em; - padding: 0.5em; - overflow: hidden; -} -a.crossref-toggle { - text-decoration: none; -} -span.marked0 { - background-color: rgb(185, 210, 200); - display: block; -} -span.marked1 { - background-color: rgb(190, 215, 205); - display: block; -} -span.inferred0 { - background-color: rgb(175, 200, 200); - display: block; -} -span.inferred1 { - background-color: rgb(180, 205, 205); - display: block; -} -span.uncovered0 { - background-color: rgb(225, 110, 110); - display: block; -} -span.uncovered1 { - background-color: rgb(235, 120, 120); - display: block; -} -span.overview { - border-bottom: 8px solid black; -} -div.overview { - border-bottom: 8px solid black; -} -#content div.footer { - font-size: 68%; - margin-top: 1.5em; -} -#content h1, h2, h3, h4, h5, h6 { - margin-bottom: 0.5em; -} -h5 { - margin-top: 0.5em; -} -.hidden { - display: none; -} -div.separator { - height: 10px; -} -/* Commented out for better readability, esp. on IE */ -/* -table tr td, table tr th { - font-size: 68%; -} -td.value table tr td { - font-size: 11px; -} -*/ -table.percent_graph { - height: 12px; - border: #808080 1px solid; - empty-cells: show; -} -table.percent_graph td.covered { - height: 10px; - background: #00f000; -} -table.percent_graph td.uncovered { - height: 10px; - background: #e00000; -} -table.percent_graph td.NA { - height: 10px; - background: #eaeaea; -} -table.report { - border-collapse: collapse; - width: 100%; -} -table.report td.heading { - background: #dcecff; - border: #d0d0d0 1px solid; - font-weight: bold; - text-align: center; -} -table.report td.heading:hover { - background: #c0ffc0; -} -table.report td.text { - border: #d0d0d0 1px solid; -} -table.report td.value, -table.report td.lines_total, -table.report td.lines_code { - text-align: right; - border: #d0d0d0 1px solid; -} -table.report tr.light { - background-color: #f6f7f8; -} -table.report tr.dark { - background-color: #fff; -} -span.run0 { - background-color: rgb(178, 204, 255); - display: block; -} -span.run1 { - background-color: rgb(178, 206, 255); - display: block; -} -span.run2 { - background-color: rgb(178, 209, 255); - display: block; -} -span.run3 { - background-color: rgb(178, 211, 255); - display: block; -} -span.run4 { - background-color: rgb(178, 214, 255); - display: block; -} -span.run5 { - background-color: rgb(178, 218, 255); - display: block; -} -span.run6 { - background-color: rgb(178, 220, 255); - display: block; -} -span.run7 { - background-color: rgb(178, 223, 255); - display: block; -} -span.run8 { - background-color: rgb(178, 225, 255); - display: block; -} -span.run9 { - background-color: rgb(178, 228, 255); - display: block; -} -span.run10 { - background-color: rgb(178, 232, 255); - display: block; -} -span.run11 { - background-color: rgb(178, 234, 255); - display: block; -} -span.run12 { - background-color: rgb(178, 237, 255); - display: block; -} -span.run13 { - background-color: rgb(178, 239, 255); - display: block; -} -span.run14 { - background-color: rgb(178, 242, 255); - display: block; -} -span.run15 { - background-color: rgb(178, 246, 255); - display: block; -} -span.run16 { - background-color: rgb(178, 248, 255); - display: block; -} -span.run17 { - background-color: rgb(178, 251, 255); - display: block; -} -span.run18 { - background-color: rgb(178, 253, 255); - display: block; -} -span.run19 { - background-color: rgb(178, 255, 253); - display: block; -} -span.run20 { - background-color: rgb(178, 255, 249); - display: block; -} -span.run21 { - background-color: rgb(178, 255, 247); - display: block; -} -span.run22 { - background-color: rgb(178, 255, 244); - display: block; -} -span.run23 { - background-color: rgb(178, 255, 242); - display: block; -} -span.run24 { - background-color: rgb(178, 255, 239); - display: block; -} -span.run25 { - background-color: rgb(178, 255, 235); - display: block; -} -span.run26 { - background-color: rgb(178, 255, 233); - display: block; -} -span.run27 { - background-color: rgb(178, 255, 230); - display: block; -} -span.run28 { - background-color: rgb(178, 255, 228); - display: block; -} -span.run29 { - background-color: rgb(178, 255, 225); - display: block; -} -span.run30 { - background-color: rgb(178, 255, 221); - display: block; -} -span.run31 { - background-color: rgb(178, 255, 219); - display: block; -} -span.run32 { - background-color: rgb(178, 255, 216); - display: block; -} -span.run33 { - background-color: rgb(178, 255, 214); - display: block; -} -span.run34 { - background-color: rgb(178, 255, 211); - display: block; -} -span.run35 { - background-color: rgb(178, 255, 207); - display: block; -} -span.run36 { - background-color: rgb(178, 255, 205); - display: block; -} -span.run37 { - background-color: rgb(178, 255, 202); - display: block; -} -span.run38 { - background-color: rgb(178, 255, 200); - display: block; -} -span.run39 { - background-color: rgb(178, 255, 197); - display: block; -} -span.run40 { - background-color: rgb(178, 255, 193); - display: block; -} -span.run41 { - background-color: rgb(178, 255, 191); - display: block; -} -span.run42 { - background-color: rgb(178, 255, 188); - display: block; -} -span.run43 { - background-color: rgb(178, 255, 186); - display: block; -} -span.run44 { - background-color: rgb(178, 255, 183); - display: block; -} -span.run45 { - background-color: rgb(178, 255, 179); - display: block; -} -span.run46 { - background-color: rgb(179, 255, 178); - display: block; -} -span.run47 { - background-color: rgb(182, 255, 178); - display: block; -} -span.run48 { - background-color: rgb(184, 255, 178); - display: block; -} -span.run49 { - background-color: rgb(187, 255, 178); - display: block; -} -span.run50 { - background-color: rgb(191, 255, 178); - display: block; -} -span.run51 { - background-color: rgb(193, 255, 178); - display: block; -} -span.run52 { - background-color: rgb(196, 255, 178); - display: block; -} -span.run53 { - background-color: rgb(198, 255, 178); - display: block; -} -span.run54 { - background-color: rgb(201, 255, 178); - display: block; -} -span.run55 { - background-color: rgb(205, 255, 178); - display: block; -} -span.run56 { - background-color: rgb(207, 255, 178); - display: block; -} -span.run57 { - background-color: rgb(210, 255, 178); - display: block; -} -span.run58 { - background-color: rgb(212, 255, 178); - display: block; -} -span.run59 { - background-color: rgb(215, 255, 178); - display: block; -} -span.run60 { - background-color: rgb(219, 255, 178); - display: block; -} -span.run61 { - background-color: rgb(221, 255, 178); - display: block; -} -span.run62 { - background-color: rgb(224, 255, 178); - display: block; -} -span.run63 { - background-color: rgb(226, 255, 178); - display: block; -} -span.run64 { - background-color: rgb(229, 255, 178); - display: block; -} -span.run65 { - background-color: rgb(233, 255, 178); - display: block; -} -span.run66 { - background-color: rgb(235, 255, 178); - display: block; -} -span.run67 { - background-color: rgb(238, 255, 178); - display: block; -} -span.run68 { - background-color: rgb(240, 255, 178); - display: block; -} -span.run69 { - background-color: rgb(243, 255, 178); - display: block; -} -span.run70 { - background-color: rgb(247, 255, 178); - display: block; -} -span.run71 { - background-color: rgb(249, 255, 178); - display: block; -} -span.run72 { - background-color: rgb(252, 255, 178); - display: block; -} -span.run73 { - background-color: rgb(255, 255, 178); - display: block; -} -span.run74 { - background-color: rgb(255, 252, 178); - display: block; -} -span.run75 { - background-color: rgb(255, 248, 178); - display: block; -} -span.run76 { - background-color: rgb(255, 246, 178); - display: block; -} -span.run77 { - background-color: rgb(255, 243, 178); - display: block; -} -span.run78 { - background-color: rgb(255, 240, 178); - display: block; -} -span.run79 { - background-color: rgb(255, 238, 178); - display: block; -} -span.run80 { - background-color: rgb(255, 234, 178); - display: block; -} -span.run81 { - background-color: rgb(255, 232, 178); - display: block; -} -span.run82 { - background-color: rgb(255, 229, 178); - display: block; -} -span.run83 { - background-color: rgb(255, 226, 178); - display: block; -} -span.run84 { - background-color: rgb(255, 224, 178); - display: block; -} -span.run85 { - background-color: rgb(255, 220, 178); - display: block; -} -span.run86 { - background-color: rgb(255, 218, 178); - display: block; -} -span.run87 { - background-color: rgb(255, 215, 178); - display: block; -} -span.run88 { - background-color: rgb(255, 212, 178); - display: block; -} -span.run89 { - background-color: rgb(255, 210, 178); - display: block; -} -span.run90 { - background-color: rgb(255, 206, 178); - display: block; -} -span.run91 { - background-color: rgb(255, 204, 178); - display: block; -} -span.run92 { - background-color: rgb(255, 201, 178); - display: block; -} -span.run93 { - background-color: rgb(255, 198, 178); - display: block; -} -span.run94 { - background-color: rgb(255, 196, 178); - display: block; -} -span.run95 { - background-color: rgb(255, 192, 178); - display: block; -} -span.run96 { - background-color: rgb(255, 189, 178); - display: block; -} -span.run97 { - background-color: rgb(255, 187, 178); - display: block; -} -span.run98 { - background-color: rgb(255, 184, 178); - display: block; -} -span.run99 { - background-color: rgb(255, 182, 178); - display: block; -} -span.run100 { - background-color: rgb(255, 178, 178); - display: block; -} -pre { - white-space: pre-wrap; /* CSS2.1 compliant */ - white-space: -moz-pre-wrap; /* Mozilla-based browsers */ - white-space: -o-pre-wrap; /* Opera 7+ */ -}
--- a/vendor/plugins/embedded/init.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -require 'redmine' -require 'embedded' - -Redmine::Plugin.register :embedded do - name 'Embedded' - author 'Jean-Philippe Lang' - description 'Embed various documentations in your projects' - version '0.0.1' - settings :default => { 'path' => '/var/doc/{PROJECT}/html', - 'index' => 'main.html overview-summary.html index.html', - 'extensions' => 'html png gif', - 'template' => '', - 'encoding' => '', - 'menu' => 'Embedded' }, - :partial => 'settings/embedded' - - project_module :embedded do - permission :view_embedded_doc, {:embedded => :index} - end - - menu :project_menu, :embedded, { :controller => 'embedded', :action => 'index', :path => nil }, - :caption => Proc.new { Setting.plugin_embedded['menu'] }, - :if => Proc.new { !Setting.plugin_embedded['menu'].blank? } -end - -# Routes -class << ActionController::Routing::Routes;self;end.class_eval do - define_method :clear!, lambda {} -end - -ActionController::Routing::Routes.draw do |map| - map.connect 'embedded/:id/*path', :controller => 'embedded', :action => 'index' -end
--- a/vendor/plugins/embedded/lib/embedded.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -# Redmine - project management software -# Copyright (C) 2008 Jean-Philippe Lang -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -module Redmine - module Plugins - module Embedded - class << self - - # Returns an Array of available templates - def available_templates - assets_by_template.keys.sort - end - - # Returns the assets for a given template - def assets(template) - assets_by_template.has_key?(template) ? assets_by_template[template] : [] - end - - def detect_template_from_path(path) - t = path.to_s.split(%r{[/\\]}) & available_templates - t.empty? ? Setting.plugin_embedded['template'].to_s : t.first - end - - def valid_extension?(path) - extensions = Setting.plugin_embedded['extensions'].to_s.split.each(&:downcase) - extensions.include?(File.extname(path).downcase[1..-1]) - end - - private - - # A Hash of available assets by template - def assets_by_template - @@assets_by_template ||= scan_assets - end - - # Scans assets directory for templates - # and returns a Hash of available assets by template - def scan_assets - a = Hash.new {|h,k| h[k] = [] } - Dir.glob(File.join(File.dirname(__FILE__), '../assets/*/*.{css,js}')).each do |asset| - asset = File.basename(asset) - template = asset.gsub(%r{\.(js|css)$}, '') - a[template] << asset - end - a - end - end - end - end -end
--- a/vendor/plugins/embedded/test/fixtures/html/app-controllers-account_controller_rb.html Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,783 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><title>app/controllers/account_controller.rb - C0 code coverage information</title> - <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style> - <style type='text/css'>span.cross-ref-title { - font-size: 140%; -} -span.cross-ref a { - text-decoration: none; -} -span.cross-ref { - background-color:#f3f7fa; - border: 1px dashed #333; - margin: 1em; - padding: 0.5em; - overflow: hidden; -} -a.crossref-toggle { - text-decoration: none; -} -span.marked0 { - background-color: rgb(185, 210, 200); - display: block; -} -span.marked1 { - background-color: rgb(190, 215, 205); - display: block; -} -span.inferred0 { - background-color: rgb(175, 200, 200); - display: block; -} -span.inferred1 { - background-color: rgb(180, 205, 205); - display: block; -} -span.uncovered0 { - background-color: rgb(225, 110, 110); - display: block; -} -span.uncovered1 { - background-color: rgb(235, 120, 120); - display: block; -} -span.overview { - border-bottom: 8px solid black; -} -div.overview { - border-bottom: 8px solid black; -} -body { - font-family: verdana, arial, helvetica; -} -div.footer { - font-size: 68%; - margin-top: 1.5em; -} -h1, h2, h3, h4, h5, h6 { - margin-bottom: 0.5em; -} -h5 { - margin-top: 0.5em; -} -.hidden { - display: none; -} -div.separator { - height: 10px; -} -/* Commented out for better readability, esp. on IE */ -/* -table tr td, table tr th { - font-size: 68%; -} -td.value table tr td { - font-size: 11px; -} -*/ -table.percent_graph { - height: 12px; - border: #808080 1px solid; - empty-cells: show; -} -table.percent_graph td.covered { - height: 10px; - background: #00f000; -} -table.percent_graph td.uncovered { - height: 10px; - background: #e00000; -} -table.percent_graph td.NA { - height: 10px; - background: #eaeaea; -} -table.report { - border-collapse: collapse; - width: 100%; -} -table.report td.heading { - background: #dcecff; - border: #d0d0d0 1px solid; - font-weight: bold; - text-align: center; -} -table.report td.heading:hover { - background: #c0ffc0; -} -table.report td.text { - border: #d0d0d0 1px solid; -} -table.report td.value, -table.report td.lines_total, -table.report td.lines_code { - text-align: right; - border: #d0d0d0 1px solid; -} -table.report tr.light { - background-color: rgb(240, 240, 245); -} -table.report tr.dark { - background-color: rgb(230, 230, 235); -} -</style> - <script type='text/javascript'> -// <![CDATA[ - function toggleCode( id ) { - if ( document.getElementById ) - elem = document.getElementById( id ); - else if ( document.all ) - elem = eval( "document.all." + id ); - else - return false; - - elemStyle = elem.style; - - if ( elemStyle.display != "block" ) { - elemStyle.display = "block" - } else { - elemStyle.display = "none" - } - - return true; - } - - // Make cross-references hidden by default - document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" ) - // ]]> -</script> - <style type='text/css'>span.run0 { - background-color: rgb(178, 204, 255); - display: block; -} -span.run1 { - background-color: rgb(178, 206, 255); - display: block; -} -span.run2 { - background-color: rgb(178, 209, 255); - display: block; -} -span.run3 { - background-color: rgb(178, 211, 255); - display: block; -} -span.run4 { - background-color: rgb(178, 214, 255); - display: block; -} -span.run5 { - background-color: rgb(178, 218, 255); - display: block; -} -span.run6 { - background-color: rgb(178, 220, 255); - display: block; -} -span.run7 { - background-color: rgb(178, 223, 255); - display: block; -} -span.run8 { - background-color: rgb(178, 225, 255); - display: block; -} -span.run9 { - background-color: rgb(178, 228, 255); - display: block; -} -span.run10 { - background-color: rgb(178, 232, 255); - display: block; -} -span.run11 { - background-color: rgb(178, 234, 255); - display: block; -} -span.run12 { - background-color: rgb(178, 237, 255); - display: block; -} -span.run13 { - background-color: rgb(178, 239, 255); - display: block; -} -span.run14 { - background-color: rgb(178, 242, 255); - display: block; -} -span.run15 { - background-color: rgb(178, 246, 255); - display: block; -} -span.run16 { - background-color: rgb(178, 248, 255); - display: block; -} -span.run17 { - background-color: rgb(178, 251, 255); - display: block; -} -span.run18 { - background-color: rgb(178, 253, 255); - display: block; -} -span.run19 { - background-color: rgb(178, 255, 253); - display: block; -} -span.run20 { - background-color: rgb(178, 255, 249); - display: block; -} -span.run21 { - background-color: rgb(178, 255, 247); - display: block; -} -span.run22 { - background-color: rgb(178, 255, 244); - display: block; -} -span.run23 { - background-color: rgb(178, 255, 242); - display: block; -} -span.run24 { - background-color: rgb(178, 255, 239); - display: block; -} -span.run25 { - background-color: rgb(178, 255, 235); - display: block; -} -span.run26 { - background-color: rgb(178, 255, 233); - display: block; -} -span.run27 { - background-color: rgb(178, 255, 230); - display: block; -} -span.run28 { - background-color: rgb(178, 255, 228); - display: block; -} -span.run29 { - background-color: rgb(178, 255, 225); - display: block; -} -span.run30 { - background-color: rgb(178, 255, 221); - display: block; -} -span.run31 { - background-color: rgb(178, 255, 219); - display: block; -} -span.run32 { - background-color: rgb(178, 255, 216); - display: block; -} -span.run33 { - background-color: rgb(178, 255, 214); - display: block; -} -span.run34 { - background-color: rgb(178, 255, 211); - display: block; -} -span.run35 { - background-color: rgb(178, 255, 207); - display: block; -} -span.run36 { - background-color: rgb(178, 255, 205); - display: block; -} -span.run37 { - background-color: rgb(178, 255, 202); - display: block; -} -span.run38 { - background-color: rgb(178, 255, 200); - display: block; -} -span.run39 { - background-color: rgb(178, 255, 197); - display: block; -} -span.run40 { - background-color: rgb(178, 255, 193); - display: block; -} -span.run41 { - background-color: rgb(178, 255, 191); - display: block; -} -span.run42 { - background-color: rgb(178, 255, 188); - display: block; -} -span.run43 { - background-color: rgb(178, 255, 186); - display: block; -} -span.run44 { - background-color: rgb(178, 255, 183); - display: block; -} -span.run45 { - background-color: rgb(178, 255, 179); - display: block; -} -span.run46 { - background-color: rgb(179, 255, 178); - display: block; -} -span.run47 { - background-color: rgb(182, 255, 178); - display: block; -} -span.run48 { - background-color: rgb(184, 255, 178); - display: block; -} -span.run49 { - background-color: rgb(187, 255, 178); - display: block; -} -span.run50 { - background-color: rgb(191, 255, 178); - display: block; -} -span.run51 { - background-color: rgb(193, 255, 178); - display: block; -} -span.run52 { - background-color: rgb(196, 255, 178); - display: block; -} -span.run53 { - background-color: rgb(198, 255, 178); - display: block; -} -span.run54 { - background-color: rgb(201, 255, 178); - display: block; -} -span.run55 { - background-color: rgb(205, 255, 178); - display: block; -} -span.run56 { - background-color: rgb(207, 255, 178); - display: block; -} -span.run57 { - background-color: rgb(210, 255, 178); - display: block; -} -span.run58 { - background-color: rgb(212, 255, 178); - display: block; -} -span.run59 { - background-color: rgb(215, 255, 178); - display: block; -} -span.run60 { - background-color: rgb(219, 255, 178); - display: block; -} -span.run61 { - background-color: rgb(221, 255, 178); - display: block; -} -span.run62 { - background-color: rgb(224, 255, 178); - display: block; -} -span.run63 { - background-color: rgb(226, 255, 178); - display: block; -} -span.run64 { - background-color: rgb(229, 255, 178); - display: block; -} -span.run65 { - background-color: rgb(233, 255, 178); - display: block; -} -span.run66 { - background-color: rgb(235, 255, 178); - display: block; -} -span.run67 { - background-color: rgb(238, 255, 178); - display: block; -} -span.run68 { - background-color: rgb(240, 255, 178); - display: block; -} -span.run69 { - background-color: rgb(243, 255, 178); - display: block; -} -span.run70 { - background-color: rgb(247, 255, 178); - display: block; -} -span.run71 { - background-color: rgb(249, 255, 178); - display: block; -} -span.run72 { - background-color: rgb(252, 255, 178); - display: block; -} -span.run73 { - background-color: rgb(255, 255, 178); - display: block; -} -span.run74 { - background-color: rgb(255, 252, 178); - display: block; -} -span.run75 { - background-color: rgb(255, 248, 178); - display: block; -} -span.run76 { - background-color: rgb(255, 246, 178); - display: block; -} -span.run77 { - background-color: rgb(255, 243, 178); - display: block; -} -span.run78 { - background-color: rgb(255, 240, 178); - display: block; -} -span.run79 { - background-color: rgb(255, 238, 178); - display: block; -} -span.run80 { - background-color: rgb(255, 234, 178); - display: block; -} -span.run81 { - background-color: rgb(255, 232, 178); - display: block; -} -span.run82 { - background-color: rgb(255, 229, 178); - display: block; -} -span.run83 { - background-color: rgb(255, 226, 178); - display: block; -} -span.run84 { - background-color: rgb(255, 224, 178); - display: block; -} -span.run85 { - background-color: rgb(255, 220, 178); - display: block; -} -span.run86 { - background-color: rgb(255, 218, 178); - display: block; -} -span.run87 { - background-color: rgb(255, 215, 178); - display: block; -} -span.run88 { - background-color: rgb(255, 212, 178); - display: block; -} -span.run89 { - background-color: rgb(255, 210, 178); - display: block; -} -span.run90 { - background-color: rgb(255, 206, 178); - display: block; -} -span.run91 { - background-color: rgb(255, 204, 178); - display: block; -} -span.run92 { - background-color: rgb(255, 201, 178); - display: block; -} -span.run93 { - background-color: rgb(255, 198, 178); - display: block; -} -span.run94 { - background-color: rgb(255, 196, 178); - display: block; -} -span.run95 { - background-color: rgb(255, 192, 178); - display: block; -} -span.run96 { - background-color: rgb(255, 189, 178); - display: block; -} -span.run97 { - background-color: rgb(255, 187, 178); - display: block; -} -span.run98 { - background-color: rgb(255, 184, 178); - display: block; -} -span.run99 { - background-color: rgb(255, 182, 178); - display: block; -} -span.run100 { - background-color: rgb(255, 178, 178); - display: block; -} -</style> - </head> - <body><h3>C0 code coverage information</h3> - <p>Generated on Tue Jun 24 21:43:53 +0200 2008 with <a href='http://eigenclass.org/hiki/rcov'>rcov 0.8.1.2</a> - </p> - <hr/> - <pre><span class='marked0'>Code reported as executed by Ruby looks like this... -</span><span class='marked1'>and this: this line is also marked as covered. -</span><span class='inferred0'>Lines considered as run by rcov, but not reported by Ruby, look like this, -</span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics). -</span><span class='uncovered0'>Finally, here's a line marked as not executed. -</span></pre> -<table class='report'><thead><tr><td class='heading'>Name</td> - <td class='heading'>Total lines</td> - <td class='heading'>Lines of code</td> - <td class='heading'>Total coverage</td> - <td class='heading'>Code coverage</td> - </tr> - </thead> - <tbody><tr class='light'><td><a href='app-controllers-account_controller_rb.html'>app/controllers/account_controller.rb</a> - </td> - <td class='lines_total'><tt>173</tt> - </td> - <td class='lines_code'><tt>129</tt> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>98.8%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='99'/> - <td class='uncovered' width='1'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>98.4%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='98'/> - <td class='uncovered' width='2'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </tbody> - </table> -<pre><span class="inferred0"><a name="line1"></a> 1 # redMine - project management software -</span><span class="inferred1"><a name="line2"></a> 2 # Copyright (C) 2006-2007 Jean-Philippe Lang -</span><span class="inferred0"><a name="line3"></a> 3 # -</span><span class="inferred1"><a name="line4"></a> 4 # This program is free software; you can redistribute it and/or -</span><span class="inferred0"><a name="line5"></a> 5 # modify it under the terms of the GNU General Public License -</span><span class="inferred1"><a name="line6"></a> 6 # as published by the Free Software Foundation; either version 2 -</span><span class="inferred0"><a name="line7"></a> 7 # of the License, or (at your option) any later version. -</span><span class="inferred1"><a name="line8"></a> 8 # -</span><span class="inferred0"><a name="line9"></a> 9 # This program is distributed in the hope that it will be useful, -</span><span class="inferred1"><a name="line10"></a> 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of -</span><span class="inferred0"><a name="line11"></a> 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -</span><span class="inferred1"><a name="line12"></a> 12 # GNU General Public License for more details. -</span><span class="inferred0"><a name="line13"></a> 13 # -</span><span class="inferred1"><a name="line14"></a> 14 # You should have received a copy of the GNU General Public License -</span><span class="inferred0"><a name="line15"></a> 15 # along with this program; if not, write to the Free Software -</span><span class="inferred1"><a name="line16"></a> 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -</span><span class="inferred0"><a name="line17"></a> 17 -</span><span class="marked1"><a name="line18"></a> 18 class AccountController < ApplicationController -</span><span class="marked0"><a name="line19"></a> 19 layout 'base' -</span><span class="marked1"><a name="line20"></a> 20 helper :custom_fields -</span><span class="marked0"><a name="line21"></a> 21 include CustomFieldsHelper -</span><span class="inferred1"><a name="line22"></a> 22 -</span><span class="inferred0"><a name="line23"></a> 23 # prevents login action to be filtered by check_if_login_required application scope filter -</span><span class="marked1"><a name="line24"></a> 24 skip_before_filter :check_if_login_required, :only => [:login, :lost_password, :register, :activate] -</span><span class="inferred0"><a name="line25"></a> 25 -</span><span class="inferred1"><a name="line26"></a> 26 # Show user's account -</span><span class="marked0"><a name="line27"></a> 27 def show -</span><span class="marked1"><a name="line28"></a> 28 @user = User.find_active(params[:id]) -</span><span class="marked0"><a name="line29"></a> 29 @custom_values = @user.custom_values.find(:all, :include => :custom_field) -</span><span class="inferred1"><a name="line30"></a> 30 -</span><span class="inferred0"><a name="line31"></a> 31 # show only public projects and private projects that the logged in user is also a member of -</span><span class="marked1"><a name="line32"></a> 32 @memberships = @user.memberships.select do |membership| -</span><span class="marked0"><a name="line33"></a> 33 membership.project.is_public? || (User.current.member_of?(membership.project)) -</span><span class="inferred1"><a name="line34"></a> 34 end -</span><span class="inferred0"><a name="line35"></a> 35 rescue ActiveRecord::RecordNotFound -</span><span class="marked1"><a name="line36"></a> 36 render_404 -</span><span class="marked0"><a name="line37"></a> 37 end -</span><span class="inferred1"><a name="line38"></a> 38 -</span><span class="inferred0"><a name="line39"></a> 39 # Login request and validation -</span><span class="marked1"><a name="line40"></a> 40 def login -</span><span class="marked0"><a name="line41"></a> 41 if request.get? -</span><span class="inferred1"><a name="line42"></a> 42 # Logout user -</span><span class="marked0"><a name="line43"></a> 43 self.logged_user = nil -</span><span class="inferred1"><a name="line44"></a> 44 else -</span><span class="inferred0"><a name="line45"></a> 45 # Authenticate user -</span><span class="marked1"><a name="line46"></a> 46 user = User.try_to_login(params[:username], params[:password]) -</span><span class="marked0"><a name="line47"></a> 47 if user -</span><span class="marked1"><a name="line48"></a> 48 self.logged_user = user -</span><span class="inferred0"><a name="line49"></a> 49 # generate a key and set cookie if autologin -</span><span class="marked1"><a name="line50"></a> 50 if params[:autologin] && Setting.autologin? -</span><span class="marked0"><a name="line51"></a> 51 token = Token.create(:user => user, :action => 'autologin') -</span><span class="marked1"><a name="line52"></a> 52 cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now } -</span><span class="inferred0"><a name="line53"></a> 53 end -</span><span class="marked1"><a name="line54"></a> 54 redirect_back_or_default :controller => 'my', :action => 'page' -</span><span class="inferred0"><a name="line55"></a> 55 else -</span><span class="marked1"><a name="line56"></a> 56 flash.now[:error] = l(:notice_account_invalid_creditentials) -</span><span class="inferred0"><a name="line57"></a> 57 end -</span><span class="inferred1"><a name="line58"></a> 58 end -</span><span class="uncovered0"><a name="line59"></a> 59 rescue User::OnTheFlyCreationFailure -</span><span class="uncovered1"><a name="line60"></a> 60 flash.now[:error] = 'Redmine could not retrieve the required information from the LDAP to create your account. Please, contact your Redmine administrator.' -</span><span class="marked0"><a name="line61"></a> 61 end -</span><span class="inferred1"><a name="line62"></a> 62 -</span><span class="inferred0"><a name="line63"></a> 63 # Log out current user and redirect to welcome page -</span><span class="marked1"><a name="line64"></a> 64 def logout -</span><span class="marked0"><a name="line65"></a> 65 cookies.delete :autologin -</span><span class="marked1"><a name="line66"></a> 66 Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) if User.current.logged? -</span><span class="marked0"><a name="line67"></a> 67 self.logged_user = nil -</span><span class="marked1"><a name="line68"></a> 68 redirect_to home_url -</span><span class="inferred0"><a name="line69"></a> 69 end -</span><span class="inferred1"><a name="line70"></a> 70 -</span><span class="inferred0"><a name="line71"></a> 71 # Enable user to choose a new password -</span><span class="marked1"><a name="line72"></a> 72 def lost_password -</span><span class="marked0"><a name="line73"></a> 73 redirect_to(home_url) && return unless Setting.lost_password? -</span><span class="marked1"><a name="line74"></a> 74 if params[:token] -</span><span class="marked0"><a name="line75"></a> 75 @token = Token.find_by_action_and_value("recovery", params[:token]) -</span><span class="marked1"><a name="line76"></a> 76 redirect_to(home_url) && return unless @token and !@token.expired? -</span><span class="marked0"><a name="line77"></a> 77 @user = @token.user -</span><span class="marked1"><a name="line78"></a> 78 if request.post? -</span><span class="marked0"><a name="line79"></a> 79 @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] -</span><span class="marked1"><a name="line80"></a> 80 if @user.save -</span><span class="marked0"><a name="line81"></a> 81 @token.destroy -</span><span class="marked1"><a name="line82"></a> 82 flash[:notice] = l(:notice_account_password_updated) -</span><span class="marked0"><a name="line83"></a> 83 redirect_to :action => 'login' -</span><span class="marked1"><a name="line84"></a> 84 return -</span><span class="inferred0"><a name="line85"></a> 85 end -</span><span class="inferred1"><a name="line86"></a> 86 end -</span><span class="marked0"><a name="line87"></a> 87 render :template => "account/password_recovery" -</span><span class="marked1"><a name="line88"></a> 88 return -</span><span class="inferred0"><a name="line89"></a> 89 else -</span><span class="marked1"><a name="line90"></a> 90 if request.post? -</span><span class="marked0"><a name="line91"></a> 91 user = User.find_by_mail(params[:mail]) -</span><span class="inferred1"><a name="line92"></a> 92 # user not found in db -</span><span class="marked0"><a name="line93"></a> 93 flash.now[:error] = l(:notice_account_unknown_email) and return unless user -</span><span class="inferred1"><a name="line94"></a> 94 # user uses an external authentification -</span><span class="marked0"><a name="line95"></a> 95 flash.now[:error] = l(:notice_can_t_change_password) and return if user.auth_source_id -</span><span class="inferred1"><a name="line96"></a> 96 # create a new token for password recovery -</span><span class="marked0"><a name="line97"></a> 97 token = Token.new(:user => user, :action => "recovery") -</span><span class="marked1"><a name="line98"></a> 98 if token.save -</span><span class="marked0"><a name="line99"></a> 99 Mailer.deliver_lost_password(token) -</span><span class="marked1"><a name="line100"></a>100 flash[:notice] = l(:notice_account_lost_email_sent) -</span><span class="marked0"><a name="line101"></a>101 redirect_to :action => 'login' -</span><span class="marked1"><a name="line102"></a>102 return -</span><span class="inferred0"><a name="line103"></a>103 end -</span><span class="inferred1"><a name="line104"></a>104 end -</span><span class="inferred0"><a name="line105"></a>105 end -</span><span class="inferred1"><a name="line106"></a>106 end -</span><span class="inferred0"><a name="line107"></a>107 -</span><span class="inferred1"><a name="line108"></a>108 # User self-registration -</span><span class="marked0"><a name="line109"></a>109 def register -</span><span class="marked1"><a name="line110"></a>110 redirect_to(home_url) && return unless Setting.self_registration? -</span><span class="marked0"><a name="line111"></a>111 if request.get? -</span><span class="marked1"><a name="line112"></a>112 @user = User.new(:language => Setting.default_language) -</span><span class="inferred0"><a name="line113"></a>113 else -</span><span class="marked1"><a name="line114"></a>114 @user = User.new(params[:user]) -</span><span class="marked0"><a name="line115"></a>115 @user.admin = false -</span><span class="marked1"><a name="line116"></a>116 @user.login = params[:user][:login] -</span><span class="marked0"><a name="line117"></a>117 @user.status = User::STATUS_REGISTERED -</span><span class="marked1"><a name="line118"></a>118 @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] -</span><span class="marked0"><a name="line119"></a>119 case Setting.self_registration -</span><span class="marked1"><a name="line120"></a>120 when '1' -</span><span class="inferred0"><a name="line121"></a>121 # Email activation -</span><span class="marked1"><a name="line122"></a>122 token = Token.new(:user => @user, :action => "register") -</span><span class="marked0"><a name="line123"></a>123 if @user.save and token.save -</span><span class="marked1"><a name="line124"></a>124 Mailer.deliver_register(token) -</span><span class="marked0"><a name="line125"></a>125 flash[:notice] = l(:notice_account_register_done) -</span><span class="marked1"><a name="line126"></a>126 redirect_to :action => 'login' -</span><span class="inferred0"><a name="line127"></a>127 end -</span><span class="marked1"><a name="line128"></a>128 when '3' -</span><span class="inferred0"><a name="line129"></a>129 # Automatic activation -</span><span class="marked1"><a name="line130"></a>130 @user.status = User::STATUS_ACTIVE -</span><span class="marked0"><a name="line131"></a>131 if @user.save -</span><span class="marked1"><a name="line132"></a>132 self.logged_user = @user -</span><span class="marked0"><a name="line133"></a>133 flash[:notice] = l(:notice_account_activated) -</span><span class="marked1"><a name="line134"></a>134 redirect_to :controller => 'my', :action => 'account' -</span><span class="inferred0"><a name="line135"></a>135 end -</span><span class="inferred1"><a name="line136"></a>136 else -</span><span class="inferred0"><a name="line137"></a>137 # Manual activation by the administrator -</span><span class="marked1"><a name="line138"></a>138 if @user.save -</span><span class="inferred0"><a name="line139"></a>139 # Sends an email to the administrators -</span><span class="marked1"><a name="line140"></a>140 Mailer.deliver_account_activation_request(@user) -</span><span class="marked0"><a name="line141"></a>141 flash[:notice] = l(:notice_account_pending) -</span><span class="marked1"><a name="line142"></a>142 redirect_to :action => 'login' -</span><span class="inferred0"><a name="line143"></a>143 end -</span><span class="inferred1"><a name="line144"></a>144 end -</span><span class="inferred0"><a name="line145"></a>145 end -</span><span class="inferred1"><a name="line146"></a>146 end -</span><span class="inferred0"><a name="line147"></a>147 -</span><span class="inferred1"><a name="line148"></a>148 # Token based account activation -</span><span class="marked0"><a name="line149"></a>149 def activate -</span><span class="marked1"><a name="line150"></a>150 redirect_to(home_url) && return unless Setting.self_registration? && params[:token] -</span><span class="marked0"><a name="line151"></a>151 token = Token.find_by_action_and_value('register', params[:token]) -</span><span class="marked1"><a name="line152"></a>152 redirect_to(home_url) && return unless token and !token.expired? -</span><span class="marked0"><a name="line153"></a>153 user = token.user -</span><span class="marked1"><a name="line154"></a>154 redirect_to(home_url) && return unless user.status == User::STATUS_REGISTERED -</span><span class="marked0"><a name="line155"></a>155 user.status = User::STATUS_ACTIVE -</span><span class="marked1"><a name="line156"></a>156 if user.save -</span><span class="marked0"><a name="line157"></a>157 token.destroy -</span><span class="marked1"><a name="line158"></a>158 flash[:notice] = l(:notice_account_activated) -</span><span class="inferred0"><a name="line159"></a>159 end -</span><span class="marked1"><a name="line160"></a>160 redirect_to :action => 'login' -</span><span class="inferred0"><a name="line161"></a>161 end -</span><span class="inferred1"><a name="line162"></a>162 -</span><span class="marked0"><a name="line163"></a>163 private -</span><span class="marked1"><a name="line164"></a>164 def logged_user=(user) -</span><span class="marked0"><a name="line165"></a>165 if user && user.is_a?(User) -</span><span class="marked1"><a name="line166"></a>166 User.current = user -</span><span class="marked0"><a name="line167"></a>167 session[:user_id] = user.id -</span><span class="inferred1"><a name="line168"></a>168 else -</span><span class="marked0"><a name="line169"></a>169 User.current = User.anonymous -</span><span class="marked1"><a name="line170"></a>170 session[:user_id] = nil -</span><span class="inferred0"><a name="line171"></a>171 end -</span><span class="marked1"><a name="line172"></a>172 end -</span><span class="inferred0"><a name="line173"></a>173 end -</span></pre><hr/> - <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> - version 0.8.1.2.</p> -<p><a href='http://validator.w3.org/check/referer'><img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88'/> - </a> - <a href='http://jigsaw.w3.org/css-validator/check/referer'><img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px'/> - </a> - </p> - </body> - </html>
--- a/vendor/plugins/embedded/test/fixtures/html/index.html Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,306 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><title>C0 code coverage information</title> - <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style> - <style type='text/css'>span.cross-ref-title { - font-size: 140%; -} -span.cross-ref a { - text-decoration: none; -} -span.cross-ref { - background-color:#f3f7fa; - border: 1px dashed #333; - margin: 1em; - padding: 0.5em; - overflow: hidden; -} -a.crossref-toggle { - text-decoration: none; -} -span.marked0 { - background-color: rgb(185, 210, 200); - display: block; -} -span.marked1 { - background-color: rgb(190, 215, 205); - display: block; -} -span.inferred0 { - background-color: rgb(175, 200, 200); - display: block; -} -span.inferred1 { - background-color: rgb(180, 205, 205); - display: block; -} -span.uncovered0 { - background-color: rgb(225, 110, 110); - display: block; -} -span.uncovered1 { - background-color: rgb(235, 120, 120); - display: block; -} -span.overview { - border-bottom: 8px solid black; -} -div.overview { - border-bottom: 8px solid black; -} -body { - font-family: verdana, arial, helvetica; -} -div.footer { - font-size: 68%; - margin-top: 1.5em; -} -h1, h2, h3, h4, h5, h6 { - margin-bottom: 0.5em; -} -h5 { - margin-top: 0.5em; -} -.hidden { - display: none; -} -div.separator { - height: 10px; -} -/* Commented out for better readability, esp. on IE */ -/* -table tr td, table tr th { - font-size: 68%; -} -td.value table tr td { - font-size: 11px; -} -*/ -table.percent_graph { - height: 12px; - border: #808080 1px solid; - empty-cells: show; -} -table.percent_graph td.covered { - height: 10px; - background: #00f000; -} -table.percent_graph td.uncovered { - height: 10px; - background: #e00000; -} -table.percent_graph td.NA { - height: 10px; - background: #eaeaea; -} -table.report { - border-collapse: collapse; - width: 100%; -} -table.report td.heading { - background: #dcecff; - border: #d0d0d0 1px solid; - font-weight: bold; - text-align: center; -} -table.report td.heading:hover { - background: #c0ffc0; -} -table.report td.text { - border: #d0d0d0 1px solid; -} -table.report td.value, -table.report td.lines_total, -table.report td.lines_code { - text-align: right; - border: #d0d0d0 1px solid; -} -table.report tr.light { - background-color: rgb(240, 240, 245); -} -table.report tr.dark { - background-color: rgb(230, 230, 235); -} -</style> - <script type='text/javascript'> -// <![CDATA[ - function toggleCode( id ) { - if ( document.getElementById ) - elem = document.getElementById( id ); - else if ( document.all ) - elem = eval( "document.all." + id ); - else - return false; - - elemStyle = elem.style; - - if ( elemStyle.display != "block" ) { - elemStyle.display = "block" - } else { - elemStyle.display = "none" - } - - return true; - } - - // Make cross-references hidden by default - document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" ) - // ]]> -</script> - </head> - <body><h3>C0 code coverage information</h3> - <p>Generated on Tue Jun 24 21:43:50 +0200 2008 with <a href='http://eigenclass.org/hiki/rcov'>rcov 0.8.1.2</a> - </p> - <hr/> - <table class='report'><thead><tr><td class='heading'>Name</td> - <td class='heading'>Total lines</td> - <td class='heading'>Lines of code</td> - <td class='heading'>Total coverage</td> - <td class='heading'>Code coverage</td> - </tr> - </thead> - <tbody><tr class='light'><td>TOTAL</td> - <td class='lines_total'><tt>13757</tt> - </td> - <td class='lines_code'><tt>9314</tt> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>90.7%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='91'/> - <td class='uncovered' width='9'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>86.9%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='87'/> - <td class='uncovered' width='13'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - <tr class='dark'><td><a href='app-apis-sys_api_rb.html'>app/apis/sys_api.rb</a> - </td> - <td class='lines_total'><tt>25</tt> - </td> - <td class='lines_code'><tt>8</tt> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>100.0%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='100'/> - <td class='uncovered' width='0'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>100.0%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='100'/> - <td class='uncovered' width='0'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - <tr class='light'><td><a href='app-controllers-account_controller_rb.html'>app/controllers/account_controller.rb</a> - </td> - <td class='lines_total'><tt>173</tt> - </td> - <td class='lines_code'><tt>129</tt> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>98.8%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='99'/> - <td class='uncovered' width='1'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>98.4%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='98'/> - <td class='uncovered' width='2'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - <tr class='dark'><td><a href='app-controllers-admin_controller_rb.html'>app/controllers/admin_controller.rb</a> - </td> - <td class='lines_total'><tt>86</tt> - </td> - <td class='lines_code'><tt>57</tt> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>91.9%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='92'/> - <td class='uncovered' width='8'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>87.7%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='88'/> - <td class='uncovered' width='12'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - <tr class='light'><td><a href='app-controllers-application_rb.html'>app/controllers/application.rb</a> - </td> - <td class='lines_total'><tt>222</tt> - </td> - <td class='lines_code'><tt>162</tt> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>89.6%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='90'/> - <td class='uncovered' width='10'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>87.0%</tt> - </td> - <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='87'/> - <td class='uncovered' width='13'/> - </tr> - </table> - </td> - </tr> - </table> - </td> - </tr> - </tbody> - </table> -<hr/> - <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> - version 0.8.1.2.</p> -<p><a href='http://validator.w3.org/check/referer'><img src='http://www.w3.org/Icons/valid-xhtml11' height='31' alt='Valid XHTML 1.1!' width='88'/> - </a> - <a href='http://jigsaw.w3.org/css-validator/check/referer'><img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px'/> - </a> - </p> - </body> - </html>
--- a/vendor/plugins/embedded/test/fixtures/html/misc/misc.html Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -<b>Misc file</b>
--- a/vendor/plugins/embedded/test/fixtures/html/misc/misc.txt Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -Misc file
--- a/vendor/plugins/embedded/test/functional/embedded_controller_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -# Redmine - project management software -# Copyright (C) 2008 Jean-Philippe Lang -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -require File.dirname(__FILE__) + '/../test_helper' - -class EmbeddedControllerTest < ActionController::TestCase - fixtures :projects, :enabled_modules, :users, :roles, :members - - def setup - fixtures_path = File.dirname(__FILE__) + '/../fixtures/html' - - Setting.plugin_embedded = { 'path' => fixtures_path, - 'index' => 'main.html overview-summary.html index.html', - 'extensions' => 'html png gif', - 'template' => '', - 'encoding' => '', - 'menu' => 'Embedded' } - - Project.find(1).enabled_modules << EnabledModule.new(:name => 'embedded') - - anonymous = Role.anonymous - anonymous.permissions += [:view_embedded_doc] - assert anonymous.save - end - - def test_get_root_should_redirect_to_index_file - get :index, :id => 'ecookbook' - assert_redirected_to :path => ['index.html'] - end - - def test_get_index_file - get :index, :id => 'ecookbook', :path => ['index.html'] - assert_response :success - assert_template 'index' - assert_tag :h3, :content => 'C0 code coverage information' - end - - def test_get_subdirectory_file - get :index, :id => 'ecookbook', :path => ['misc', 'misc.html'] - assert_response :success - assert_template 'index' - assert_tag :b, :content => 'Misc file' - end - - def test_get_invalid_extension_should_be_denied - get :index, :id => 'ecookbook', :path => ['misc', 'misc.txt'] - assert_response 500 - end -end
--- a/vendor/plugins/embedded/test/test_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -ENV["RAILS_ENV"] ||= "test" -require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") -require 'test_help' - -class Test::Unit::TestCase - # Transactional fixtures accelerate your tests by wrapping each test method - # in a transaction that's rolled back on completion. This ensures that the - # test database remains unchanged so your fixtures don't have to be reloaded - # between every test method. Fewer database queries means faster tests. - # - # Read Mike Clark's excellent walkthrough at - # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting - # - # Every Active Record database supports transactions except MyISAM tables - # in MySQL. Turn off transactional fixtures in this case; however, if you - # don't care one way or the other, switching from MyISAM to InnoDB tables - # is recommended. - # - # The only drawback to using transactional fixtures is when you actually - # need to test transactions. Since your test is bracketed by a transaction, - # any transactions started in your code will be automatically rolled back. - self.use_transactional_fixtures = true - - # Instantiated fixtures are slow, but give you @david where otherwise you - # would need people(:david). If you don't want to migrate your existing - # test cases which use the @david style and don't mind the speed hit (each - # instantiated fixtures translates to a database query per test method), - # then set this back to true. - self.use_instantiated_fixtures = false - - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - fixtures :all - - # Add more helper methods to be used by all tests here... -end
--- a/vendor/plugins/embedded/test/unit/embedded_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -# Redmine - project management software -# Copyright (C) 2008 Jean-Philippe Lang -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -require File.dirname(__FILE__) + '/../test_helper' - -class EmbeddedTest < ActiveSupport::TestCase - - def setup - Setting.plugin_embedded = { 'path' => '/path/to', - 'index' => 'main.html overview-summary.html index.html', - 'extensions' => 'html png gif', - 'template' => 'doxygen', - 'encoding' => '', - 'menu' => 'Embedded' } - end - - def test_available_templates - assert_equal ['doxygen', 'javadoc', 'rcov'], Redmine::Plugins::Embedded.available_templates - end - - def test_assets - assert_equal ['rcov.css', 'rcov.js'], Redmine::Plugins::Embedded.assets('rcov') - end - - def test_detect_template_from_path - to_test = { '/path/to/doc' => 'doxygen', - '/path/to/javadoc/html' => 'javadoc' } - - to_test.each { |path, template| assert_equal template, Redmine::Plugins::Embedded.detect_template_from_path(path) } - end - - def test_valid_extension - to_test = {'index.html' => true, - 'path/to/index.html' => true, - 'path/to/image.png' => true, - 'path/to/something.else' => false} - - to_test.each { |path, expected| assert_equal expected, Redmine::Plugins::Embedded.valid_extension?(path) } - end -end
--- a/vendor/plugins/engines/generators/plugin_migration/templates/plugin_migration.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -class <%= class_name %> < ActiveRecord::Migration - def self.up - <%- plugins.each do |plugin| -%> - Engines.plugins["<%= plugin.name %>"].migrate(<%= new_versions[plugin.name] %>) - <%- end -%> - end - - def self.down - <%- plugins.each do |plugin| -%> - Engines.plugins["<%= plugin.name %>"].migrate(<%= current_versions[plugin.name] %>) - <%- end -%> - end -end
--- a/vendor/plugins/redmine_bibliography/README.rdoc Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -= bibliography - -Description goes here
--- a/vendor/plugins/redmine_bibliography/app/controllers/authors_controller.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -class AuthorsController < ApplicationController - helper :publications - include PublicationsHelper - - def index - @authors = Author.find(:all) - end - - def show - @author = Author.find(params[:id]) - end - -end
--- a/vendor/plugins/redmine_bibliography/app/controllers/authorships_controller.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -class AuthorshipsController < ApplicationController - - def index - - end - - - def update - end -end
--- a/vendor/plugins/redmine_bibliography/app/controllers/bibtex_entries_controller.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -class BibtexEntriesController < ApplicationController - -end \ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,343 +0,0 @@ -# -*- coding: utf-8 -*- -# vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb - -class PublicationsController < ApplicationController - unloadable - - model_object Publication - before_filter :find_model_object, :except => [:new, :create, :index, :get_bibtex_required_fields, :autocomplete_for_project, :add_author, :sort_author_order, :autocomplete_for_author, :get_user_info ] - before_filter :find_project_by_project_id, :authorize, :only => [ :edit, :new, :update, :create ] - - def new - find_project_by_project_id - @publication = Publication.new - - # we'll always want a new publication to have its bibtex entry - @publication.build_bibtex_entry - - # and at least one author - # @publication.authorships.build.build_author - @author_options = [["#{User.current.name} (@#{User.current.mail.partition('@')[2]})", "#{User.current.class.to_s}_#{User.current.id.to_s}"]] - end - - def create - @project = Project.find(params[:project_id]) - - @author_options = [] - - @publication = Publication.new(params[:publication]) - @publication.projects << @project unless @project.nil? - - if @publication.save - @publication.notify_authors_publication_added(@project) - - flash[:notice] = "Successfully created publication." - redirect_to :action => :show, :id => @publication, :project_id => @project - else - render :action => 'new', :project_id => @project - end - end - - def index - if !params[:project_id].nil? - find_project_by_project_id - @project = Project.find(params[:project_id]) - @publications = Publication.find :all, :joins => :projects, :conditions => ["project_id = ?", @project.id] - else - @publications = Publication.find :all - end - end - - def new_from_bibfile - @publication.current_step = session[:publication_step] - - # contents of the paste text area - bibtex_entry = params[:bibtex_entry] - - # method for creating "pasted" bibtex entries - if bibtex_entry - parse_bibtex_list bibtex_entry - end - end - - def get_bibtex_required_fields - - unless params[:value].empty? - fields = BibtexEntryType.fields(params[:value]) - end - - respond_to do |format| - format.js { - render(:update) {|page| - if params[:value].empty? - page << "hideOnLoad();" - else - page << "show_required_bibtex_fields(#{fields.to_json()});" - end - } - } - - end - end - - def add_author - if (request.xhr?) - render :text => User.find(params[:user_id]).name - else - # No? Then render an action. - #render :action => 'view_attribute', :attr => @name - logger.error { "Error while adding Author to publication." } - end - end - - def edit - find_project_by_project_id unless params[:project_id].nil? - - @edit_view = true; - @publication = Publication.find(params[:id]) - @selected_bibtex_entry_type_id = @publication.bibtex_entry.entry_type - - @author_options = [] - - @bibtype_fields = BibtexEntryType.fields(@selected_bibtex_entry_type_id) - end - - def update - @publication = Publication.find(params[:id]) - @author_options = [] - - if @publication.update_attributes(params[:publication]) - flash[:notice] = "Successfully updated Publication." - - # expires the previosly cached entries - Rails.cache.delete "publication-#{@publication.id}-ieee" - Rails.cache.delete "publication-#{@publication.id}-bibtex" - - if !params[:project_id].nil? - redirect_to :action => :show, :id => @publication, :project_id => params[:project_id] - else - redirect_to :action => :show, :id => @publication - end - else - render :action => 'edit' - end - end - - - def show - find_project_by_project_id unless params[:project_id].nil? - - if @publication.nil? - @publications = Publication.all - render "index", :alert => 'The publication was not found!' - else - @authors = @publication.authors - @bibtext_entry = @publication.bibtex_entry - end - end - - # parse string with bibtex authors - def parse_authors(authors_entry) - # in bibtex the authors are always seperated by "and" - return authors_entry.split(" and ") - end - - # parses a list of bibtex - def parse_bibtex_list(bibtex_list) - bibliography = BibTeX.parse bibtex_list - - no_entries = bibliography.data.length - - # parses the bibtex entries - bibliography.data.map do |d| - - if d.class == BibTeX::Entry - create_bibtex_entry d - end - end - end - - def create_bibtex_entry(d) - @publication = Publication.new - @bentry = BibtexEntry.new - authors = [] - institution = "" - email = "" - - d.fields.keys.map do |field| - case field.to_s - when "author" - authors = parse_authors d[field] - when "title" - @publication.title = d[field] - when "institution" - institution = d[field] - when "email" - email = d[field] - else - @bentry[field] = d[field] - end - end - - @publication.bibtex_entry = @bentry - @publication.save - - # what is this for??? - # @created_publications << @publication.id - - # need to save all authors - # and establish the author-publication association - # via the authorships table - authors.each_with_index.map do |authorname, idx| - author = Author.new(:name => authorname) - if author.save! - # todo: catch the errors... - puts "SAVED" - else - puts "NOT SAVED" - end - - author.authorships.create!( - :publication => @publication, - :institution => institution, - :email => email, - :order => idx) - end - end - - # parses the bibtex file - def parse_bibtex_file - - end - - def import - @publication = Publication.new - - - end - - def autocomplete_for_project - @publication = Publication.find(params[:id]) - - @projects = Project.active.like(params[:q]).find(:all, :limit => 100) - @publication.projects - logger.debug "Query for \"#{params[:q]}\" returned \"#{@projects.size}\" results" - render :layout => false - end - - def autocomplete_for_author - @results = [] - - object_id = params[:object_id] - @object_name = "publications[authorships_attributes][#{object_id}][search_results]" - - # cc 20110909 -- revert to like instead of like_unique -- see #289 - authorships_list = Authorship.like(params[:q]).find(:all, :limit => 100) - users_list = User.active.like(params[:q]).find(:all, :limit => 100) - - logger.debug "Query for \"#{params[:q]}\" returned \"#{authorships_list.size}\" authorships and \"#{users_list.size}\" users" - - @results = users_list - - # TODO: can be optimized… - authorships_list.each do |authorship| - flag = true - - users_list.each do |user| - if authorship.name == user.name && authorship.email == user.mail && authorship.institution == user.institution - Rails.logger.debug { "Rejecting Authorship #{authorship.id}" } - flag = false - break - end - end - - @results << authorship if flag - end - - render :layout => false - end - - def get_user_info - object_id = params[:object_id] - value = params[:value] - classname = Kernel.const_get(value.split('_')[0]) - - item = classname.find(value.split('_')[1]) - - name_field = "publication_authorships_attributes_#{object_id}_name_on_paper".to_sym - email_field = "publication_authorships_attributes_#{object_id}_email".to_sym - institution_field = "publication_authorships_attributes_#{object_id}_institution".to_sym - - yes_radio = "publication_authorships_attributes_#{object_id}_identify_author_yes".to_sym - - respond_to do |format| - format.js { - render(:update) {|page| - page[name_field].value = item.name - page[email_field].value = item.mail - page[institution_field].value = item.institution - - page[yes_radio].checked = true - page[name_field].readOnly = true - page[email_field].readOnly = true - page[institution_field].readOnly = true - } - } - end - end - - def sort_author_order - params[:authorships].each_with_index do |id, index| - Authorship.update_all(['auth_order=?', index+1], ['id=?', id]) - end - render :nothing => true - end - - def add_project - @projects = Project.find(params[:publication][:project_ids]) - @publication.projects << @projects - @project = Project.find(params[:project_id]) - - # TODO luisf should also respond to HTML??? - respond_to do |format| - format.html { redirect_to :back } - format.js { - render(:update) {|page| - page[:add_project_form].reset - page.replace_html :list_projects, :partial => 'list_projects' - } - } - end - end - - - def remove_project - @project = Project.find(params[:project_id]) - proj = Project.find(params[:remove_project_id]) - - if @publication.projects.length > 1 - if @publication.projects.exists? proj - @publication.projects.delete proj if request.post? - end - else - logger.error { "Cannot remove project from publication list" } - end - - logger.error { "CURRENT project name#{proj.name} and wanna delete #{@project.name}" } - - render(:update) {|page| - page.replace_html "list_projects", :partial => 'list_projects', :id => @publication - } - end - - def destroy - find_project_by_project_id - - @publication.destroy - - flash[:notice] = "Successfully deleted Publication." - redirect_to :controller => :publications, :action => 'index', :project_id => @project - end - - private - -end
--- a/vendor/plugins/redmine_bibliography/app/helpers/authors_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -module AuthorsHelper - unloadable - - def render_author_publications(author) - s = "" - pubs = [] - - author.publications.each do |pub| - pubs << link_to(pub.title, pub) - end - - if pubs.size < 3 - s << '<nobr>' << pubs.join(', ') << '</nobr>' - else - s << pubs.join(', ') - end - s - end - - - # Generates a link to an author - # todo: test options - def link_to_author(author, options={}, html_options = nil) - url = {:controller => 'authors', :action => 'show', :id => author}.merge(options) - link_to(h(author.name), url, html_options) - end - -end
--- a/vendor/plugins/redmine_bibliography/app/helpers/authorships_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ -# -*- coding: undecided -*- -module AuthorshipsHelper - - # Generates a link to either author or user, depending on which is - # available - def link_to_authorship(authorship) - s = '' - if authorship.author.nil? - # legacy reasons… - s << h(authorship.name_on_paper) - else - if authorship.author.user.nil? - s << link_to(authorship.name_on_paper, :controller => 'authors', :action => 'show', :id => authorship.author) - else - s << link_to(authorship.name_on_paper, :controller => 'users', :action => 'show', :id => authorship.author.user) - end - end - s - end - -end
--- a/vendor/plugins/redmine_bibliography/app/helpers/bibtex_entries_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -module BibtexEntriesHelper - -end \ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/app/helpers/my_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -module MyHelper - - def get_my_publications() - if not User.current.author.nil? - @my_publications = Publication.all(:include => :authors, :conditions => "authors.id = #{User.current.author.id}") - else - @my_publications = [] - end - end - - def render_publications_projects(publication) - s = "" - projs = [] - - publication.projects.each do |proj| - projs << link_to(proj.name, proj) - end - - s << projs.join(', ') - - s - end - - def render_publications_authors(publication) - s = "" - auths = [] - - publication.authorships.each do |auth| - auths << h(auth.name_on_paper) - end - - s << auths.join(', ') - - s - end - - -end
--- a/vendor/plugins/redmine_bibliography/app/helpers/publications_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -# -*- coding: utf-8 -*- -require 'bibtex' - -module PublicationsHelper - include AuthorshipsHelper - - def link_to_publication(publication, options={}, html_options = nil) - url = {:controller => 'publications', :action => 'show', :id => publication}.merge(options) - link_to(h(publication.title), url, html_options) - end - - def projects_check_box_tags(name, projects) - s = '' - projects.sort.each do |project| - if User.current.allowed_to?(:edit_publication, project) - s << "<label>#{ check_box_tag name, project.id, false } #{link_to_project project}</label>\n" - s << '<br />' - end - end - - s - end - - def choose_author_link(object_name, items) - # called by autocomplete_for_author (publications' action/view) - # creates the select list based on the results array - # results is an array with both Users and Authorships objects - - @author_options = [] - @results.each do |result| - email_bit = result.mail.partition('@')[2] - if email_bit != "": - email_bit = "(@#{email_bit})" - end - @author_options << ["#{result.name} #{email_bit}", "#{result.class.to_s}_#{result.id.to_s}"] - end - - if @results.size > 0 - s = select_tag( form_tag_name(object_name, :author_search_results), options_for_select(@author_options), { :id => form_tag_id(object_name, :author_search_results), :size => 3} ) - s << observe_field( form_tag_id(object_name, :author_search_results), :on => 'click', :function => "alert('Element changed')", :with => 'q') - else - s = "<em>No Authors found that match your search… sorry!</em>" - end - end - - def link_to_remove_fields(name, f) - f.hidden_field(:_destroy) + link_to_function(name, "remove_fields(this)", :class => 'icon icon-del') - end - - def link_to_add_author_fields(name, f, association, action) - new_object = f.object.class.reflect_on_association(association).klass.new - fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder| - render(association.to_s.singularize + "_fields", :f => builder) - end - link_to_function(name, h("add_author_fields(this, '#{association}', '#{escape_javascript(fields)}', '#{action}')"), { :class => 'icon icon-add', :id => "add_another_author" }) - end - - def sanitized_object_name(object_name) - object_name.gsub(/\]\[|[^-a-zA-Z0-9:.]/,"_").sub(/_$/,"") - end - - def sanitized_method_name(method_name) - method_name.sub(/\?$/, "") - end - - def form_tag_name(object_name, method_name) - str = "#{object_name.to_s}[#{sanitized_method_name(method_name.to_s)}]" - str.to_sym - end - - def form_tag_id(object_name, method_name) - str = "#{sanitized_object_name(object_name.to_s)}_#{sanitized_method_name(method_name.to_s)}" - str.to_sym - end - - def form_object_id(object_name) - str = object_name.split("\[").last().gsub("\]","") - str.to_sym - end - - def render_authorships_list(publication) - s = '<p>' - - publication.authorships.each do |authorship| - s << link_to_authorship(authorship) - s << "<br /><em>#{authorship.institution}</em></p>" - end - - s - end - - def render_projects_list(publication, show_delete_icon) - s= "" - - publication.projects.visible.each do |proj| - s << link_to_project(proj, {}, :class => 'publication_project') - - if show_delete_icon - if User.current.allowed_to?(:edit_publication, @project) - if @project == proj - # todo: move this message to yml file - confirm_msg = 'Are you sure you want to remove the current project from this publication\'s projects list?' - else - confirm_msg = false - end - - s << link_to_remote(l(:button_delete), { :url => { :controller => 'publications', :action => 'remove_project', :id => publication, :remove_project_id => proj, :project_id => @project }, :method => :post, :confirm => confirm_msg }, :class => 'icon icon-del') - end - end - - s << "<br />" - end - - s - end - - def print_ieee_format(publication) - Rails.cache.fetch("publication-#{publication.id}-ieee") do - publication.print_entry(:ieee) - end - end - - def print_bibtex_format(publication) - Rails.cache.fetch("publication-#{publication.id}-bibtex") do - publication.print_entry(:bibtex) - end - end - - - def show_bibtex_fields(bibtex_entry) - s = "" - bibtex_entry.attributes.keys.sort.each do |key| - value = bibtex_entry.attributes[key].to_s - next if key == 'id' or key == 'publication_id' or value == "" - s << "<h4>" + l("field_#{key}") + "</h4>" - s << "<p>" - if key == "entry_type" - s << bibtex_entry.entry_type_label - else - s << value - end - s << "</p>" - end - s - end -end -
--- a/vendor/plugins/redmine_bibliography/app/models/author.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -class Author < ActiveRecord::Base - unloadable - - has_many :authorships, :dependent => :destroy - has_many :publications, :through => :authorships - - belongs_to :user - - def <=>(author) - name.downcase <=> author.name.downcase - end - - named_scope :like, lambda {|q| - s = "%#{q.to_s.strip.downcase}%" - {:conditions => ["LOWER(name) LIKE :s", {:s => s}], - :order => 'name' - } - } - -end
--- a/vendor/plugins/redmine_bibliography/app/models/authorship.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -class Authorship < ActiveRecord::Base - unloadable - - belongs_to :author - belongs_to :publication - - accepts_nested_attributes_for :author - accepts_nested_attributes_for :publication - - validates_presence_of :name_on_paper - - attr_accessor :is_user, :author_user_id, :search_name, :identify_author, :search_results - before_save :associate_author_user - - named_scope :like_unique, lambda {|q| - s = "%#{q.to_s.strip.downcase}%" - {:conditions => ["LOWER(name_on_paper) LIKE :s OR LOWER(email) LIKE :s", {:s => s}], - :order => 'name_on_paper', - :group => "name_on_paper, institution, email" - } - } - - named_scope :like, lambda {|q| - s = "%#{q.to_s.strip.downcase}%" - {:conditions => ["LOWER(name_on_paper) LIKE :s OR LOWER(email) LIKE :s", {:s => s}], - :order => 'name_on_paper' - } - } - - def name - return self.name_on_paper - end - - def <=>(authorship) - name.downcase <=> authorship.name.downcase - end - - def mail - return self.email - end - - protected - def associate_author_user - case self.identify_author - when "no" - author = Author.new - author.save - self.author_id = author.id - else - selected = self.search_results - selected_classname = Kernel.const_get(selected.split('_')[0]) - selected_id = selected.split('_')[1] - object = selected_classname.find(selected_id) - - if object.respond_to? :name_on_paper - # Authorship - self.author_id = object.author.id - else - # User - unless object.author.nil? - self.author_id = object.author.id - else - author = Author.new - object.author = author - object.save - self.author_id = object.author.id - end - end - end - end -end
--- a/vendor/plugins/redmine_bibliography/app/models/bibtex_entry.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -class BibtexEntry < ActiveRecord::Base - unloadable - - belongs_to :publication - validates_presence_of :entry_type - - def entry_type_name - entry_type = self.entry_type - BibtexEntryType.find(entry_type).name - end - - def entry_type_label - entry_type = self.entry_type - BibtexEntryType.find(entry_type).label - end -end
--- a/vendor/plugins/redmine_bibliography/app/models/bibtex_entry_type.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -class BibtexEntryType < ActiveRecord::Base - unloadable - - @@fields = Hash['article', ['journal', 'year', 'volume', 'number', 'pages', 'month', 'note' ], - 'book' , [ 'editor', 'publisher', 'volume', 'series', 'address', 'edition', 'month', 'year', 'note' ], - 'booklet' , [ 'howpublished', 'address', 'year', 'month', 'note', 'key' ], - 'conference', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], - 'inbook', [ 'editor', 'publisher', 'chapter', 'pages', 'volume', 'series', 'address', 'edition', 'year', 'note' ], - 'incollection', [ 'editor', 'publisher', 'chapter', 'pages', 'volume', 'series', 'address', 'edition', 'year', 'note' ], - 'inproceedings', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], - 'manual', [ 'organization', 'address', 'edition', 'month', 'year', 'note' ], - 'masterthesis', [ 'school', 'year', 'address', 'month', 'note' ], - 'misc', [ 'howpublished', 'month', 'year', 'note' ], - 'phdthesis', [ 'school', 'year', 'address', 'month', 'note' ], - 'proceedings', [ 'booktitle', 'year', 'editor', 'pages', 'organization', 'publisher', 'address', 'month', 'note' ], - 'techreport', [ 'year', 'type', 'number', 'address', 'month', 'note' ], - 'unpublished', [ 'note', 'month', 'year' ]] - - def redundant? - name == 'conference' # conference is a duplicate of inproceedings - end - - def label - l("field_bibtex_#{name}") - end - - def self.fields (type) - @@fields[ self.find(type).name ] - end -end
--- a/vendor/plugins/redmine_bibliography/app/models/publication.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -# vendor/plugins/redmine_bibliography/app/models/publication.rb - -class Publication < ActiveRecord::Base - unloadable - - has_many :authorships, :dependent => :destroy, :order => "auth_order ASC" - has_many :authors, :through => :authorships, :uniq => true - - has_one :bibtex_entry, :dependent => :destroy - - validates_presence_of :title - validates_length_of :authorships, :minimum => 1, :message => l("error_no_authors") - - accepts_nested_attributes_for :authorships - accepts_nested_attributes_for :authors, :allow_destroy => true - accepts_nested_attributes_for :bibtex_entry, :allow_destroy => true - - has_and_belongs_to_many :projects, :uniq => true - - before_save :set_initial_author_order - - # Ensure error message uses proper text instead of - # bibtex_entry.entry_type (#268). There has to be a better way to - # do this! - def self.human_attribute_name(k) - if k == 'bibtex_entry.entry_type' - l(:field_entry_type) - else - super - end - end - - def notify_authors_publication_added(project) - self.authors.each do |author| - Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." } - Mailer.deliver_publication_added(author.user, self, project) unless author.user.nil? - end - end - - def notify_authors_publication_updated(project) - self.authors.each do |author| - Rails.logger.debug { "Sending mail to \"#{self.title}\" publication authors." } - Mailer.deliver_publication_updated(author.user, self, project) unless author.user.nil? - end - end - - - def set_initial_author_order - authorships = self.authorships - - logger.debug { "Publication \"#{self.title}\" has #{authorships.size} authors." } - - authorships.each_with_index do |authorship, index| - if authorship.auth_order.nil? - authorship.auth_order = index - end - end - end - - def print_bibtex_author_names - # this authors are correctly sorted because the authorships model - # already outputs the author names ASC by auth_order - self.authorships.map{|a| a.name_on_paper}.join(' and ') - end - - def print_entry(style) - bib = BibTeX::Entry.new - - bib.author = self.print_bibtex_author_names - bib.title = self.title - - self.bibtex_entry.attributes.keys.sort.each do |key| - value = self.bibtex_entry.attributes[key].to_s - next if key == 'id' or key == 'publication_id' or value == "" - - if key == "entry_type" - bib.type = BibtexEntryType.find(self.bibtex_entry.entry_type).name - else - bib[key.to_sym] = value - end - end - - if style == :ieee - CiteProc.process bib.to_citeproc, :style => :ieee, :format => :html - else - bibtex = bib.to_s :include => :meta_content - bibtex.strip! - logger.error { bibtex } - end - end -end
--- a/vendor/plugins/redmine_bibliography/app/views/authors/index.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -<h2><%=l(:label_authors_index)%></h2> - -<table class="list authors"> - <thead><tr> - <th><%=l(:field_author_name)%></th> - <th><%=l(:field_author_username)%></th> - <th><%=l(:field_author_publications)%></th> - </tr></thead> - <tbody> - - <% @authors.each do |author|%> - <tr id="author-<%= author.id %>" class="<%= cycle('odd', 'even') %>"> - <td class="title"> - <%= link_to_author author %> - </td> - <td class="username "> - <%= link_to author.user unless author.user.nil? %> - </td> - <td class="project"> - <%= render_author_publications(author) %> - </td> - </tr> - <% end %> - </tbody> -</table> -
--- a/vendor/plugins/redmine_bibliography/app/views/authors/show.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -<h2><%=l(:label_authors_show)%></h2> - -<div class="autoscroll"> - <table class="list authors"> - <thead> - <tr> - <th><%=l(:field_authorship_publication_title)%></th> - <th><%=l(:field_authorship_name)%></th> - <th><%=l(:field_authorship_email)%></th> - <th><%=l(:field_authorship_institution)%></th> - </tr> - </thead> - - <% @author.authorships.each do |authorship| %> - <tr id="authorship-<%= authorship.id %>" class="<%= cycle('odd', 'even') %>"> - <td class="title"><%= link_to_publication(authorship.publication) %></td> - <td class="name"><%= h authorship.name_on_paper %></td> - <td class="email"><%= h authorship.email %></td> - <td class="institution"><%= h authorship.institution %></td> - </tr> - <% end %> - </tbody> - </table> -</div> - -<% content_for :sidebar do %> -<% end %> -
--- a/vendor/plugins/redmine_bibliography/app/views/authorships/update.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -<h2>Authorships#update</h2>
--- a/vendor/plugins/redmine_bibliography/app/views/mailer/publication_added.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -<%= l(:mail_body_publication_added, :publication => @publication.title, :project => @project.name) %>
--- a/vendor/plugins/redmine_bibliography/app/views/mailer/publication_added.text.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -<%= l(:mail_body_publication_added, :publication => @publication.title, :project => @project.name) %> -
--- a/vendor/plugins/redmine_bibliography/app/views/my/blocks/_publications_box.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -<% get_my_publications %> - -<h3><%=l(:label_my_publications_box) %> <%= "(" + @my_publications.count.to_s + ")" %> </h3> - -<table class="list publications"> - <thead><tr> - <th><%=l(:field_publication_title)%></th> - <th><%=l(:field_publication_authors)%></th> - <th><%=l(:field_publication_projects)%></th> - </tr></thead> - <tbody> - - <% @my_publications.each do |publication|%> - <tr id="publication-<%= publication.id %>" class="<%= cycle('odd', 'even') %>"> - <td class="title"> - <%= link_to publication.title, publication %> - </td> - <td class="authors"> - <%= render_publications_authors(publication) %> - </td> - <td class="project"> - <%= render_publications_projects(publication) %> - </td> - </tr> - <% end %> - </tbody> -</table> - - -
--- a/vendor/plugins/redmine_bibliography/app/views/projects/_bibliography_box.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -<% content_for :header_tags do %> - <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> - <%= javascript_include_tag 'bibtex', :plugin => 'redmine_bibliography' -%> -<% end %> - -<% if @project.publications.any? %> -<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> - <div id="bibliography"> - <div class="box"> - <h3><%=l(:label_related_publication_plural)%></h3> - - <dl> - <% @project.publications.each do |publication| %> - <dt> - <%= print_ieee_format(publication) %> - </dt> - <dd> - <%= link_to("[More Details]", {:controller => :publications, :action => :show, :id => publication.id, :project_id => @project.id}) -%> - - <%= link_to_function "[B<small>IB</small>T<sub>E</sub>X]", onclick="toggleBibtex(this)" -%> - </dd> - <dd class="bibtex-textarea collapsed" style="display: none;"> - <textarea readonly> <%= print_bibtex_format(publication) %> </textarea> - </dd> - <% end -%> - </dl> - </div> -</div> -<% end -%>
--- a/vendor/plugins/redmine_bibliography/app/views/projects/show.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -<div class="contextual"> - <% if User.current.allowed_to?(:add_subprojects, @project) %> - <%= link_to l(:label_subproject_new), {:controller => 'projects', :action => 'new', :parent_id => @project}, :class => 'icon icon-add' %> - <% end %> - - <% if @project.module_enabled? :redmine_bibliography %> - <% if User.current.allowed_to?(:add_publication, @project) %> - <%= link_to l(:label_add_publication_to_project), {:controller => 'publications', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %> - <% end %> - <% end %> -</div> - -<% if @project.has_welcome_page %> -<% page = @project.wiki.find_page("Overview") %> -<% end %> - -<% if page %> - -<% if @project.module_enabled? :wiki %> -<% if User.current.allowed_to?(:edit_wiki_pages, @project) %> -<div class="contextual"> -<%= link_to(l(:button_welcome_page_edit_this), {:controller => 'wiki', :action => 'edit', :project_id => @project, :id => Wiki.titleize("Overview")}, :class => 'icon icon-edit') %> -</div> -<% end %> -<% end %> - -<div class="contextual" style="clear: right"> -<ul> -<% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %> -<% if @subprojects.any? %> - <li><%=l(:label_subproject_plural)%>: - <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li> -<% end %> -</ul> -</div> - -<%= render(:partial => "wiki/content", :locals => {:content => page.content_for_version()}) %> - -<% else %> - -<h2><%=l(:label_overview)%></h2> - -<div class="splitcontentleft"> - <div class="wiki"> - <%= textilizable @project.description %> - </div> - <ul> - <% unless @project.homepage.blank? %><li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)) %></li><% end %> - <% if @subprojects.any? %> - <li><%=l(:label_subproject_plural)%>: - <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li> - <% end %> - <% @project.visible_custom_field_values.each do |custom_value| %> - <% if !custom_value.value.blank? %> - <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> - <% end %> - <% end %> - </ul> - - <% if User.current.allowed_to?(:view_issues, @project) %> - <div class="issues box"> - <h3><%=l(:label_issue_tracking)%></h3> - <ul> - <% for tracker in @trackers %> - <li><%= link_to tracker.name, :controller => 'issues', :action => 'index', :project_id => @project, - :set_filter => 1, - "tracker_id" => tracker.id %>: - <%= l(:label_x_open_issues_abbr_on_total, :count => @open_issues_by_tracker[tracker].to_i, - :total => @total_issues_by_tracker[tracker].to_i) %> - </li> - <% end %> - </ul> - <p> - <%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %> - <% if User.current.allowed_to?(:view_calendar, @project, :global => true) %> - | <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %> - <% end %> - <% if User.current.allowed_to?(:view_gantt, @project, :global => true) %> - | <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %> - <% end %> - </p> - </div> - <% end %> - <%= call_hook(:view_projects_show_left, :project => @project) %> -</div> - -<div class="splitcontentright"> - - <%= render :partial => 'bibliography_box' %> - - <%= render :partial => 'members_box' %> - - <% if @news.any? && authorize_for('news', 'index') %> - <div class="news box"> - <h3><%=l(:label_news_latest)%></h3> - <%= render :partial => 'news/news', :collection => @news %> - <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p> - </div> - <% end %> - <%= call_hook(:view_projects_show_right, :project => @project) %> -</div> - -<% content_for :sidebar do %> - <%= call_hook(:view_projects_show_sidebar_top, :project => @project) %> - <% if @total_hours && User.current.allowed_to?(:view_time_entries, @project) %> - <h3><%= l(:label_spent_time) %></h3> - <p><span class="icon icon-time"><%= l_hours(@total_hours) %></span></p> - <p><%= link_to(l(:label_details), {:controller => 'timelog', :action => 'index', :project_id => @project}) %> | - <%= link_to(l(:label_report), {:controller => 'time_entry_reports', :action => 'report', :project_id => @project}) %></p> - <% end %> - <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %> -<% end %> - -<% end %> - -<% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, {:controller => 'activities', :action => 'index', :id => @project, :format => 'atom', :key => User.current.rss_key}) %> -<% end %> - -<% html_title(l(:label_overview)) -%>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_add_project_form.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -<% form_remote_for(:publication, - :url => {:controller => 'publications', :action => 'add_project', :id => @publication, :project_id => @project}, - :method => :post, - :html => { :id => 'add_project_form' }, - :loading => "$('project-add-submit').disable()", - :complete => "$('project-add-submit').enable()") do |f| %> - <fieldset><legend><%=l(:label_add_project_to_publication)%></legend> - <p> - <%= label_tag "project_search", l(:label_project_search) %><%= text_field_tag 'project_search', nil %> - </p> - - <%= observe_field(:project_search, - :frequency => 0.5, - :update => :projects, - :url => { :controller => 'publications', :action => 'autocomplete_for_project', :id => @publication }, - :with => 'q') - %> - - <div id="projects"> - <% if params[:q] && params[:q].length > 1 %> - <%= projects_check_box_tags 'project[project_ids][]', @projects %> - <% end %> - </div> - - <p><%= submit_tag l(:button_add), :id => 'project-add-submit' %></p> - - - </fieldset> - <% end %>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_authorship_fields.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> - - -<div id="authors" class="fields"> -<!-- <h4><%= l("label_author_1") %></h4> --> - - <div id="<%= form_tag_id( f.object_name, :search_author ) %>" style=<%= "display:none;" unless params[:action] == "new" %> > - <p> - <%= f.text_field :search_name, :size => 25 %> - <%= observe_field( form_tag_id(f.object_name, :search_name), :frequency => 0.5, :update => form_tag_id( f.object_name, :search_results), :url => { :controller => 'publications', :action => 'autocomplete_for_author', :object_name => form_object_id(f.object_name) }, :with => 'q' ) %> - </p> - <%# link_to_function l(:label_author_is_me), "update_author_info(this," + User.current.get_author_info.to_json + ")", :id => "add_me_as_author" %> - - <p> - <%= f.select :search_results, options_for_select(@author_options), {}, {:size => 5, - :onChange => remote_function( :url => { :controller => :publications, :action => :get_user_info, :object_id => form_object_id(f.object_name) }, :with => "'value=' + - value" )} %> - </p> - - <p style="margin-bottom: -2.5em; padding-bottom; 0"><label><%= l(:identify_author_question) %></label></p> - <p class="author_identify"> - <label class='inline'><%= radio_button_tag(:identify_author, "yes", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_yes ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_yes) %> </label><br /> - - <label class='inline'><%= radio_button_tag(:identify_author, "correct", false, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_corrections ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_correct) %> </label><br /> - - <label class='inline'><%= radio_button_tag(:identify_author, "no", true, :name => form_tag_name(f.object_name,:identify_author ), :id => form_tag_id( f.object_name, :identify_author_no ), :onchange => "identify_author_status($(this).value, #{form_object_id(f.object_name) });") %> <%= l(:identify_author_no) %> </label><br /> - </p> - </div> - - <div class='author_edit' id="<%= form_tag_id( f.object_name, :edit_author_info ) %>"> - <p> - <%= f.text_field :name_on_paper, {:class => ("readonly" unless params[:action] == "new") } %></p> - <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_name_on_paper") %></p> - <p><%= f.text_field :institution, {:class => ("readonly" unless params[:action] == "new") } %></p> - <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_institution") %></p> - <p><%= f.text_field :email, {:class => ("readonly" unless params[:action] == "new") } %></p> - <p class='description' style=<%= "display:none;" unless params[:action] == "new" %>><%= h l("text_author_email") %></p> - </p> - </div> - - - <div class="box" id="<%= form_tag_id( f.object_name, :show_author_info ) %>" style="display: none"> - - </div> - - <p> - - <%- if params[:action] == 'new' -%> - <%= button_to_function l(:label_save_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button )} %> - <%- else -%> - <%= button_to_function l(:label_edit_author), {}, { :onclick => "toggle_save_author(#{form_object_id(f.object_name)}); return false;", :id => form_tag_id( f.object_name, :edit_save_button )} %> - <%- end -%> - - - <%= link_to_remove_fields l("remove_author"), f %> - </p> -</div> -<br/>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_bibtex_fields.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -<p> - <label for="bibtex_entry_type"><%=l("field_entry_type")%> <span class="required">*</span></label> - <%= f.collection_select :entry_type, - BibtexEntryType.find(:all).reject { |x| x.redundant? }, - :id, - :label, - { :selected => @selected_bibtex_entry_type_id, :prompt => true }, - :onChange => remote_function( :url => { :controller => :publications, :action => :get_bibtex_required_fields}, :with => "'value=' + value" ) - %> -</p> - -<p class="bibtex hol"> - <%= f.text_field :year, :size => 4 %> -</p> -<p class="bibtex hol"> - <%= f.text_field :month, :size => 4%> -</p> -<p class="bibtex hol"> - <%= f.text_field :chapter, :size => 15%> -</p> -<p class="bibtex hol"> - <%= f.text_field :editor, :size => 33 %> -</p> -<p class="bibtex hol"> - <%= f.text_field :booktitle, :size => 33 %> -</p> -<p class="bibtex hol"> - <%= f.text_field :publisher,:size => 33 %> -</p> -<p class="bibtex hol"> - <%= f.text_field :pages, :size => 12 %> -</p> -<p class="bibtex hol"> - <%= f.text_field :address %> -</p> -<p class="bibtex hol"> - <%= f.text_field :annote %> -</p> -<p class="bibtex hol"> - <%= f.text_field :crossref %> -</p> -<p class="bibtex hol"> - <%= f.text_field :edition %> -</p> -<p class="bibtex hol"> - <%= f.text_field :eprint %> -</p> -<p class="bibtex hol"> - <%= f.text_field :howpublished %> -</p> -<p class="bibtex hol"> - <%= f.text_field :journal %> -</p> -<p class="bibtex hol"> - <%= f.text_field :key %> -</p> -<p class="bibtex hol"> - <%= f.text_field :note %> -</p> -<p class="bibtex hol"> - <%= f.text_field :number %> -</p> -<p class="bibtex hol"> - <%= f.text_field :organization %> -</p> -<p class="bibtex hol"> - <%= f.text_field :school %> -</p> -<p class="bibtex hol"> - <%= f.text_field :series %> -</p> -<p class="bibtex hol"> - <%= f.text_field :type %> -</p> -<p class="bibtex hol"> - <%= f.text_field :url %> -</p> -<p class="bibtex hol"> - <%= f.text_field :volume %> -</p> \ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_form.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -<%= f.error_messages %> - -<h3><%= f.text_field :title, :required => true, :size => 70 %></h3> - -<div class="splitcontentleft"> - <h3><%= l(:label_publication_other_details) %></h3> - <div class="box tabular"> - <% f.fields_for :bibtex_entry do |builder| -%> - <%= render :partial => 'bibtex_fields', :locals => { :f => builder} %> - <%- end -%> - - <p> - <%= f.text_field :external_url, :size => 70 %> - <br /> - <em><%= l(:text_external_url) %></em> - </p> - <p> - <%= f.text_field :doi, :size => 70 %> - <br /> - <em><%= l(:text_doi) %></em> - </p> - - </div> -</div> - -<div class="splitcontentright"> - <h3><%= l(:authors) %></h3> - <div class="box tabular"> - <% f.fields_for :authorships do |builder| -%> - <%= render "authorship_fields", :f => builder %> - <%- end -%> - <%= link_to_add_author_fields l(:label_add_an_author), f, :authorships, params[:action] %> - </div> -</div> - -
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_identify_author_form.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -<legend><%= "Identify Authors in the system…" %></legend> - -<%= link_to_remote "It's me!", - { :url => { :controller => 'publications', - :action => 'add_me_as_author', - :project_id => @project }, :method => 'post'}, - { :class => 'icon icon-add', :id => "add_me_as_author" } %> - -<p> - <%= label_tag "author_search", l(:label_project_search) %><%= text_field_tag 'author_search', nil %> -</p> - -<%= observe_field( form_tag_id(f.object_name, :name), - :frequency => 0.5, - :update => :identify_author, - :url => { :controller => 'publications', :action => 'autocomplete_for_author' }, - :with => 'q') -%> - -<div id="identify_author"> - <% if params[:q] && params[:q].length > 1 %> - <%= select_author_links 'author[author_ids][]', @authors %> - <% end %> -</div> -
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_list_projects.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -<%= render_projects_list(@publication, true) %>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_new_bibtex_step.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -<h3>New Bibtex</h3> - -<h4>Paste your Bibtex entries here</h4> -<p> - <%=label_tag :bibtex_entry %> - <%=text_area_tag :bibtex_entry%> -</p> - -
--- a/vendor/plugins/redmine_bibliography/app/views/publications/_review_bibtex_step.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -<h2>Review new entries</h2> -
--- a/vendor/plugins/redmine_bibliography/app/views/publications/add_project.rjs Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -page.replace_html :list_projects, :partial => 'list_projects' -page[:add_project_form].reset -
--- a/vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_author.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -<% if params[:q] && params[:q].length > 1 %> - <%= choose_author_link @object_name, @results %> -<% end %> -
--- a/vendor/plugins/redmine_bibliography/app/views/publications/autocomplete_for_project.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -<% if params[:q] && params[:q].length > 1 %> - <%= projects_check_box_tags 'publication[project_ids][]', @projects %> -<% end %>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/create.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -<h2>Publications#create</h2>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -<% content_for :header_tags do %> - <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %> - <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> - <%= javascript_tag 'Event.observe(window, "load", function(e){show_required_bibtex_fields(' + @bibtype_fields.to_json + ')});' %> -<% end %> - -<h2><%=l(:label_publication_show)%></h2> - -<% form_for @publication, :url => { :project_id => @project, :action => :update }, :builder => TabularFormBuilder do |f| -%> - <%= render :partial => 'form', :locals => { :f => f } %> - - <div style="clear:both"></div> - <%= f.submit %> -<% end %> -<p> - <%= link_to l(:label_publication_show), { :controller => "publications", :action => "show", :id => @publication, :project_id => @project_id } %> | - <%= link_to l(:label_publication_index), { :controller => "publications", :action => "index", :project_id => @project } %> -</p>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/import.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -<h1>New Publication</h1> - -<% form_for @publication, :url => { :action => "create" } do |f| %> - <% f.error_messages %> - - <%= render :partial => "#{@publication.current_step}_bibtex_step", :locals => { :f => f } %> - - <p><%= f.submit "Submit" %></p> - <p><%= f.submit "Back", :name => "back_button" unless @publication.first_step? %></p> - -<% end %> -
--- a/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -<div class="contextual"> - <% if User.current.allowed_to?(:add_publication, @project) %> - <%= link_to l(:label_publication_new), {:controller => 'publications', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %> - <% end %> -</div> - - <% if @project %> - <h3><%= l(:label_all_publications_for_project, :project => @project.name) %></h3> - <% else %> - <h3><%= l(:label_all_publications) %></h3> - <% end %> - - <div class="autoscroll"> - <table class="list publications"> - <thead><tr> - <th><%= l(:title) %></th> - <th><%= l(:authors) %></th> - <th><%= l(:year) %></th> - <th><%= l(:associated_projects) %></th> - </tr></thead> - - <%- @publications.each do |publication| -%> - <%- if publication.projects.visible.length > 0 -%> - <tr class="<%= cycle('odd', 'even') %>"> - <td class="firstcol title" align="top"><%= link_to publication.title, :controller => "publications", :action => "show", :id => publication, :project_id => @project %></td> - <td class="authors" align="top"> - <%= render_authorships_list(publication) %> - <td class="year"><%= publication.bibtex_entry.year %></td> - <td class="projects"> - <%= render_projects_list(publication, false) %> - </td> - </tr> - <%- end -%> - <%- end -%> - </table> - </div> - -<% content_for :sidebar do %> -<% end %> -
--- a/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -<% content_for :header_tags do %> - <%= javascript_include_tag 'authors', :plugin => 'redmine_bibliography' %> - <%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> -<% end %> - -<h2><%=l(:label_publication_new)%></h2> - -<% form_for @publication, :url => { :project_id => @project, :action => :create }, :builder => TabularFormBuilder do |f| -%> - <%= render :partial => 'form', :locals => { :f => f } %> - <div style="clear:both"></div> - <%= f.submit %> -<% end %>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -<h2><%=l(:label_publication_show)%></h2> - -<div class="box"> - <h3>Publication Info</h3> - <p><%= print_ieee_format(@publication)%></p> - - <h3>B<small>IB</small>T<sub>E</sub>X Format</h3> - <pre><%=h print_bibtex_format(@publication) %></pre> -</div> - -<div class="box"> - -<h4><%= l(:authors) %></h4> -<ul id="authorships"> - <% for authorship in @publication.authorships.find(:all, :order => :auth_order) %> - <% content_tag_for :li, authorship do %> - <%- if User.current.allowed_to?(:edit_publication, @project) && @publication.authorships.length > 1 -%> - <span class="handle">[drag to reorder]</span> - <%- end -%> - <%= link_to_authorship authorship %> <em><%= h authorship.institution %></em> <br /> - <%- end -%> - <%- end -%> -</ul> - -<%- if User.current.allowed_to?(:edit_publication, @project) && @publication.authorships.length > 1 -%> - <%= sortable_element("authorships", :url => { :controller => :publications, :action => :sort_author_order }, :handle => "handle") %> -<%- end -%> - -<%- if @publication.bibtex_entry != nil -%> - <%= show_bibtex_fields(@publication.bibtex_entry) %> -<%- end -%> - -<%- unless @publication.external_url.blank? -%> - <p> - <b><%= l(:field_external_url) %>:</b> <%= link_to h(@publication.external_url), @publication.external_url, {:target => "_blank"} -%> - </p> -<%- end -%> - - -<% unless @publication.doi.blank? %> - <p> - <b><%= l(:field_doi)-%>:</b> <%= link_to h(@publication.doi), "http://dx.doi.org/#{@publication.doi}", {:target => "_blank"} -%> - </p> -<% end %> - -<br / > - <% if User.current.allowed_to?(:add_publication, @project) %> - <%= link_to l(:label_publication_edit), { :controller => "publications", :action => "edit", :id => @publication, :project_id => @project } %> | - <%= link_to "Delete", {:controller => 'publications', :action => 'destroy', :id => @publication, :project_id => @project }, - :confirm => l(:text_are_you_sure), :method => :delete, :title => l(:button_delete) %> | - <% end %> - <%= link_to l(:view_all_publications), {:controller => 'publications', :action => 'index', :project_id => @project } %> -</div> - -<% projects = Project.active.find(:all, :limit => 100, :order => 'name ASC') - @publication.projects %> - -<% content_for :sidebar do %> - <h3><%=l(:label_publication_project_index)%></h3> - - <p id="list_projects"> - <%= render :partial => 'list_projects' %> - </p> - - <%- if User.current.allowed_to?(:edit_publication, @project) -%> - <%= render :partial => 'add_project_form' %> - <%- end -%> -<% end %>
--- a/vendor/plugins/redmine_bibliography/app/views/publications/update.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -<h2>Publications#update</h2>
--- a/vendor/plugins/redmine_bibliography/app/views/settings/_bibliography.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -<p><label>Menu caption</label> -<%= text_field_tag 'settings[menu]', @settings['menu'], :size => 30 %> -<br /><em>Clear this field if you don't want to add a tab to the project menu</em></p>
--- a/vendor/plugins/redmine_bibliography/app/views/users/show.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -<%= stylesheet_link_tag 'bibliography', :plugin => 'redmine_bibliography' %> - -<div class="contextual"> -<%= link_to(l(:button_edit), edit_user_path(@user), :class => 'icon icon-edit') if User.current.admin? %> -</div> - -<h2><%= avatar @user, :size => "50" %> <%=h @user.name %></h2> - -<div class="splitcontentleft"> -<ul> - <% unless @user.pref.hide_mail %> - <li><%=l(:field_mail)%>: <%= mail_to(h(@user.mail), nil, :encode => 'javascript') %></li> - <% end %> - <% @user.visible_custom_field_values.each do |custom_value| %> - <% if !custom_value.value.blank? %> - <li><%=h custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> - <% end %> - <% end %> - <li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li> - <% unless @user.last_login_on.nil? %> - <li><%=l(:field_last_login_on)%>: <%= format_date(@user.last_login_on) %></li> - <% end %> -</ul> - -<h3><%=l(:label_ssamr_description)%></h3> -<%= textilizable @description %> - -<h3><%=l(:label_ssamr_institution)%></h3> -<p><%= h @institution_name %></p> - - -<% unless @memberships.empty? %> -<h3><%=l(:label_project_plural)%></h3> -<ul> -<% for membership in @memberships %> - <li><%= link_to_project(membership.project) %> - (<%=h membership.roles.sort.collect(&:to_s).join(', ') %>, <%= format_date(membership.created_on) %>)</li> -<% end %> -</ul> -<% end %> -<%= call_hook :view_account_left_bottom, :user => @user %> -</div> - -<div class="splitcontentright"> - - <% if @user.author %> - <div id="bibliography"> - <% @publications = Publication.all(:include => :authors, :conditions => "authors.id = #{@user.author.id}") %> - - <h3><%=l(:publications) %> <%= "(" + @publications.count.to_s + ")" %> </h3> - - <% @publications.each do |publication|%> - <dt> - <span class="authors"> - <%= publication.authorships.map { |a| h a.name_on_paper }.join(', ') %><% if !publication.authorships.empty? %>.<% end %> - </span> - <span class="title"><%= link_to publication.title, :controller => 'publications', :action => 'show', :id => publication %></span> - <% if publication.bibtex_entry.year.to_s != "" %> - <span class="year"> - (<%= publication.bibtex_entry.year %>) - </span> - <% end %> - </dt> - <dd> - </dd> - <% end %> - </div> - <% end %> - - -<% unless @events_by_day.empty? %> -<h3><%= link_to l(:label_activity), :controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :from => @events_by_day.keys.first %></h3> - -<p> -<%=l(:label_reported_issues)%>: <%= Issue.count(:conditions => ["author_id=?", @user.id]) %> -</p> - -<div id="activity"> -<% @events_by_day.keys.sort.reverse.each do |day| %> -<h4><%= format_activity_day(day) %></h4> -<dl> -<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> - <dt class="<%= e.event_type %>"> - <span class="time"><%= format_time(e.event_datetime, false) %></span> - <%= content_tag('span', h(e.project), :class => 'project') %> - <%= link_to format_activity_title(e.event_title), e.event_url %></dt> - <dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd> -<% end -%> -</dl> -<% end -%> -</div> - -<% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => nil, :user_id => @user, :key => User.current.rss_key} %> -<% end %> - -<% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :user_id => @user, :format => :atom, :key => User.current.rss_key) %> -<% end %> -<% end %> -<%= call_hook :view_account_right_bottom, :user => @user %> -</div> - -<% html_title @user.name %>
--- a/vendor/plugins/redmine_bibliography/assets/javascripts/authors.js Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -function remove_fields(link) { - $(link).previous("input[type=hidden]").value = "1"; - $(link).up(".fields").hide(); -} - -function add_author_fields(link, association, content, action) { - var new_id = new Date().getTime(); - var regexp = new RegExp("new_" + association, "g"); - $(link).insert({ - before: content.replace(regexp, new_id) - }); - if(action != "new"){ - toggle_save_author(new_id, $(link)); - }; -} - -function identify_author_status(status, object_id) { - $('publication_authorships_attributes_' + object_id + '_edit_author_info').select('input').each(function(s) { - if(status == "no"){ - s.value = ""; - s.readOnly = false; - }; - - if(status == "correct"){s.readOnly = false;}; - if(status == "yes"){s.readOnly = true;}; - }); -} - -function toggle_div(div_id){ - Effect.toggle(div_id, "appear", {duration:0.3}); -} - -function toggle_input_field(field){ - if (field.classNames().inspect().include("readonly") == false){ - field.readOnly = true; - field.addClassName('readonly'); - } else { - field.readOnly = false; - field.removeClassName('readonly'); - }; -} - -function toggle_edit_save_button(object_id){ - $button = $('publication_authorships_attributes_' + object_id + '_edit_save_button'); - if ($button.value == "Edit author"){ - $button.value = "Save author"; - } else { - $button.value = "Edit author"; - }; -} - -function toggle_save_author(form_object_id, $this){ - $('publication_authorships_attributes_' + form_object_id + '_edit_author_info').select('input').each(function(s) { - toggle_input_field(s, $this); - }); - $('publication_authorships_attributes_' + form_object_id + '_edit_author_info').select('p.description').each(function(s) { - s.toggle(); - }); - toggle_edit_save_button(form_object_id); - toggle_div("publication_authorships_attributes_" + form_object_id +"_search_author"); -} - -function hide_all_bibtex_required_fields(){$$('p.bibtex').each(function(s){s.hide()})} - -// entrytype_fields is a jsno array with the fields requires by the selected bibtex entry -function show_required_bibtex_fields(entrytype_fields) { - $$('p.bibtex').each(function(s){ - if(entrytype_fields.indexOf(s.down('input').id.split('_').last()) != -1){ - s.show(); - } - else { - s.hide(); - } - }) -} - \ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/assets/javascripts/bibtex.js Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -function toggleBibtex(el) { - var dd = Element.up(el).next('dd') - - dd.toggleClassName('collapsed'); - Effect.toggle(dd, 'slide', {duration:0.2}); -} \ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/assets/stylesheets/bibliography.css Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -li .handle { - font-size: 12px; - cursor: move; - color: #777; -} - -input.readonly { - border: none; - padding: 0; - margin: 0; - background-color: transparent; -} - -.tabular .author_identify label { - font-weight: normal; -} - -.tabular .author_edit p { - padding-bottom: 0; -} - -.tabular .author_edit .description { - padding-top: 0; - font-style: italic; -} - -.publication_project { - margin-right: 18px; -} - -#authors select { - min-width: 150px; -} - - -div#bibliography dd { margin-bottom: 1em; font-size: 0.9em; } - -div#bibliography dd .authors { font-style: italic; } -div#bibliography dd span.authors { color: #808080; } -div#bibliography dd span.year { padding-left: 0.6em; } - -div#bibliography .box dt { - background: url(../../../images/document.png) no-repeat 0% 4px; - padding-left: 20px; - margin-left: 0; -} -div#bibliography .box dd { - padding-left: 20px; - margin-left: 0; -} - -div#bibliography h3 { - background: url(../../../images/table_multiple.png) no-repeat 0% 50%; - padding-left: 20px; -} - -div#bibliography textarea { - width: 90%; - height: 200px; - font: normal 8px; - padding: 2px 10px; - border: solid 1px #ddd; -}
--- a/vendor/plugins/redmine_bibliography/config/locales/en.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -# English strings go here for Rails i18n -en: - project_module_redmine_bibliography: "Publications (references to papers related to the project)" - - title: "Title" - authors: "Authors" - author: "Author" - name: "Name" - year: "Year" - associated_projects: "Associated Projects" - publications_box: "My Publications" - label_my_publications_box: "My Publications" - view_all_publications: "View All Project's Publications" - publications: Publications - - identify_author_question: Is the right person selected above? - identify_author_yes: "Yes" - identify_author_correct: "Yes, but I need to correct some details below" - identify_author_no: "No, the author was not found in the search" - - error_no_authors: "Please add at least one author to this publication." - - label_all_publications: All Publications - label_all_publications_for_project: Publications associated with %{project} - label_authors_show: "Authorships associated with this author" - label_authors_index: "List of authors" - - field_authorship_publication_title: "Publication" - field_authorship_name: "Name on Paper" - field_authorship_email: "Email" - field_authorship_institution: "Institution" - - field_external_url: "External URL" - field_doi: "DOI" - field_publication_title: Title - field_publication_authors: Authors - field_publication_projects: "Associated projects" - field_author_name: Author - field_author_user: User Name - field_author_username: "Associated user" - field_author_publications: "Publications by this Author" - field_identify_author_yes: "Yes" - field_identify_author_correct: "Corrections" - field_identify_author_no: "No" - - label_author_is_me: "(I am this author)" - label_add_me_as_author: "Add me as an author" - label_add_an_author: "Add an author" - label_add_another_author: "Add another author" - field_search_name: "Search by name" - field_search_results: "" - label_save_author: "Save author" - label_edit_author: "Edit author" - label_author_information: "Author Information" - - remove_author: "Remove this author" - - label_publication_plural: "Publications" - label_related_publication_plural: "Related publications" - label_publication_new: "Create New Publication" - label_publication_index: "List of Publication" - label_add_publication_to_project: "Add publication to this project" - label_publication_edit: "Edit Publication" - label_publication_show: "Publication Details" - label_add_project_to_publication: "Add this publication to a project" - label_project_search: "Find project by name: " - label_publication_project_index: "Projects associated with this publication" - label_publication_index: "View all publications" - label_publication_other_details: "Details" - - text_external_url: "Link to the publication or to an external page about it." - text_doi: "DOI (Digital Object Identifier)." - text_author_name_on_paper: "Author's name as it appears on the paper." - text_author_institution: "Author's institution as on the paper." - text_author_email: "Author's email address as on the paper." - - text_author_search: "Search existing authors" - - # authorships model - field_institution: "Institution" - field_name_on_paper: "Name" - field_email: "Email Address" - - # bibtex_entries model - field_entry_type: "Publication Type" - field_id: "id" - field_publication_id: "Publication_id" - field_address: "Address" - field_annote: "Annote" - field_booktitle: "Title of Book or Proceedings" - field_chapter: "Chapter" - field_crossref: "Cross Reference" - field_edition: "Edition" - field_editor: "Editor" - field_eprint: "eprint" - field_howpublished: "How was it Published" - field_journal: "Journal" - field_key: "Key" - field_month: "Month" - field_note: "Note" - field_number: "Number" - field_organization: "Organization" - field_pages: "Pages" - field_publisher: "Publisher" - field_school: "School" - field_series: "Series" - field_type: "Type" - field_url: "URL" - field_volume: "Volume" - field_year: "Year" - - field_bibtex_article: Journal article - field_bibtex_book: Book - field_bibtex_booklet: Booklet - field_bibtex_conference: Article in conference proceedings - field_bibtex_inbook: Book chapter or part - field_bibtex_incollection: Part of a collection - field_bibtex_inproceedings: Article in conference proceedings - field_bibtex_manual: Technical manual - field_bibtex_masterthesis: "Master's thesis" - field_bibtex_misc: Other - field_bibtex_phdthesis: "PhD thesis" - field_bibtex_proceedings: Conference proceedings - field_bibtex_techreport: Technical report - field_bibtex_unpublished: Unpublished - - label_author_1: First author - label_author_2: Second author - label_author_3: Third author - label_author_4: Fourth author - label_author_5: Fifth author - label_author_6: Sixth author - label_author_7: Seventh author - label_author_8: Eighth author - label_author_9: Ninth author - label_author_10: Tenth author - label_author_11: Eleventh author - label_author_12: Twelfth author - label_author_13: Thirteenth author - label_author_14: Fourteenth author - label_author_15: Fifteenth author - label_author_16: Sixteenth author - label_author_17: Seventeenth author - label_author_18: Eighteenth author - label_author_19: Nineteenth author - label_author_20: Twentieth author - - mail_subject_publication_added: "You have been added as an author to a new publication" - mail_body_publication_added: "A new publication (%{publication}) has been added to the project '%{project}.'" - - -
--- a/vendor/plugins/redmine_bibliography/config/routes.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -ActionController::Routing::Routes.draw do |map| - map.resources :publications, :collection => { :sort_author_order => :post } -end \ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/db/migrate/001_create_authors.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -class CreateAuthors < ActiveRecord::Migration - def self.up - create_table :authors do |t| - t.column :user_id, :integer - t.column :name, :string - end - end - - def self.down - drop_table :authors - end -end
--- a/vendor/plugins/redmine_bibliography/db/migrate/002_create_publications.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -class CreatePublications < ActiveRecord::Migration - def self.up - create_table :publications do |t| - t.column :title, :string - t.column :reviewed, :boolean, :default => false - end - end - - def self.down - drop_table :publications - end -end
--- a/vendor/plugins/redmine_bibliography/db/migrate/003_create_authorships.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -class CreateAuthorships < ActiveRecord::Migration - def self.up - create_table :authorships do |t| - t.column :author_id, :integer - t.column :publication_id, :integer - t.column :name_on_paper, :string - t.column :auth_order, :integer - t.column :institution, :string - t.column :email, :string - end - end - - def self.down - drop_table :authorships - end -end
--- a/vendor/plugins/redmine_bibliography/db/migrate/004_create_bibtex_entries.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -class CreateBibtexEntries < ActiveRecord::Migration - def self.up - create_table :bibtex_entries do |t| - t.column :publication_id, :integer - t.column :entry_type, :integer - t.column :address, :string - t.column :annote, :string - t.column :booktitle, :string - t.column :chapter, :string - t.column :crossref, :string - t.column :edition, :string - t.column :editor, :string - t.column :eprint, :string - t.column :howpublished, :string - t.column :journal, :string - t.column :key, :string - t.column :month, :string - t.column :note, :text - t.column :number, :string - t.column :organization, :string - t.column :pages, :string - t.column :publisher, :string - t.column :school, :string - t.column :series, :string - t.column :type, :string - t.column :url, :string - t.column :volume, :integer - t.column :year, :integer - end - end - - def self.down - drop_table :bibtex_entries - end -end
--- a/vendor/plugins/redmine_bibliography/db/migrate/005_create_projects_publications_join_table.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -class CreateProjectsPublicationsJoinTable < ActiveRecord::Migration - def self.up - create_table :projects_publications, :id => false do |t| - t.integer :project_id - t.integer :publication_id - end - end - - def self.down - drop_table :projects_publications - end -end \ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/db/migrate/006_create_bibtex_entry_types.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -class CreateBibtexEntryTypes < ActiveRecord::Migration - def self.up - create_table :bibtex_entry_types do |t| - t.string :name - - t.timestamps - end - end - - def self.down - drop_table :bibtex_entry_types - end -end
--- a/vendor/plugins/redmine_bibliography/db/migrate/007_add_external_url_column_to_publications.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -class AddExternalUrlColumnToPublications < ActiveRecord::Migration - def self.up - add_column :publications, :external_url, :string - end - - def self.down - remove_column :publications, :external_url - end -end
--- a/vendor/plugins/redmine_bibliography/db/migrate/008_add_doi_and_timestamp_columns_to_publications.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -class AddDoiAndTimestampColumnsToPublications < ActiveRecord::Migration - def self.up - add_column :publications, :doi, :string - add_timestamps :publications - - end - - def self.down - remove_column :publications, :doi - remove_timestamps :publications - end -end
--- a/vendor/plugins/redmine_bibliography/db/migrate/009_add_timestamp_columns_to_authors.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -class AddTimestampColumnsToAuthors < ActiveRecord::Migration - def self.up - add_timestamps :authors - end - - def self.down - remove_timestamps :authors - end -end
--- a/vendor/plugins/redmine_bibliography/db/seed_data/bibtex_entry_types_list.txt Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -inproceedings -conference -article -masterthesis -phdthesis -book -booklet -inbook -incollection -manual -techreport -proceedings -unpublished -misc
--- a/vendor/plugins/redmine_bibliography/init.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -require 'redmine' -require 'dispatcher' - -require 'bibtex' -require 'citeproc' - -# Patches to the Redmine core. -Dispatcher.to_prepare :redmine_model_dependencies do - require_dependency 'project' - require_dependency 'user' - require_dependency 'mailer' - - unless Project.included_modules.include? Bibliography::ProjectPublicationsPatch - Project.send(:include, Bibliography::ProjectPublicationsPatch) - end - - unless User.included_modules.include? Bibliography::UserAuthorPatch - User.send(:include, Bibliography::UserAuthorPatch) - end - - unless Mailer.included_modules.include? Bibliography::MailerPatch - Mailer.send(:include, Bibliography::MailerPatch) - end - - unless ProjectsHelper.included_modules.include?(Bibliography::ProjectsHelperPatch) - ProjectsHelper.send(:include, Bibliography::ProjectsHelperPatch) - end -end - - -# Plugin Info -Redmine::Plugin.register :redmine_bibliography do - name 'Redmine Bibliography plugin' - author 'Chris Cannam, Luis Figueira' - description 'This is a bibliography management plugin for Redmine' - version '0.0.1' - url 'http://example.com/path/to/plugin' - author_url 'http://example.com/about' - - settings :default => { 'menu' => 'Publications' }, :partial => 'settings/bibliography' - - project_module :redmine_bibliography do - permission :publications, { :publications => :index }, :public => true - permission :edit_publication, {:publications => [:edit, :update]} - permission :add_publication, {:publications => [:new, :create]} - permission :delete_publication, {:publications => :destroy} - - end - - # extending the Project Menu - menu :project_menu, :publications, { :controller => 'publications', :action => 'index', :path => nil }, :after => :activity, :param => :project_id, :caption => Proc.new { Setting.plugin_redmine_bibliography['menu'] }, - :if => Proc.new { !Setting.plugin_redmine_bibliography['menu'].blank? } - -end
--- a/vendor/plugins/redmine_bibliography/lang/en.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -# English strings go here -my_label: "My label"
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/mailer_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -require_dependency 'mailer' - -module Bibliography - module MailerPatch - def self.included(base) # :nodoc: - - # Builds a tmail object used to email the specified user that a publication was created and the user is - # an author of that publication - # - # Example: - # publication_added(user) => tmail object - # Mailer.deliver_add_to_project(user) => sends an email to the registered user - def publication_added(user, publication, project) - - @publication = publication - @project = project - - set_language_if_valid user.language - recipients user.mail - subject l(:mail_subject_publication_added, Setting.app_title) - body :publication_url => url_for( :controller => 'publications', :action => 'show', :id => publication.id ), - :publication_title => publication.title - - render_multipart('publication_added', body) - - end - - - end - end -end
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/project_publications_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -require_dependency 'project' - -module Bibliography - module ProjectPublicationsPatch - def self.included(base) - base.class_eval do - has_and_belongs_to_many :publications, :uniq => true - - named_scope :like, lambda {|q| - s = "%#{q.to_s.strip.downcase}%" - {:conditions => ["LOWER(name) LIKE :s OR LOWER(homepage) LIKE :s", {:s => s}], - :order => 'name' - } - } - end - end #self.included - - module ProjectMethods - - - - - end #ProjectMethods - end #ProjectPublicationsPatch -end #RedmineBibliography \ No newline at end of file
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/projects_helper_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -module Bibliography - module ProjectsHelperPatch - - def self.included(base) # :nodoc: - base.send(:include, InstanceMethods) - base.send(:include, PublicationsHelper) - - base.class_eval do - unloadable - end - end - - module InstanceMethods - end - end -end -
--- a/vendor/plugins/redmine_bibliography/lib/bibliography/user_author_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -require_dependency 'user' - -module Bibliography - module UserAuthorPatch - def self.included(base) - base.send(:include, InstanceMethods) - extend ClassMethods - - end #self.included - - module ClassMethods - end - - module InstanceMethods - - def institution - unless self.ssamr_user_detail.nil? - institution_name = self.ssamr_user_detail.institution_name - else - institution_name = "No Institution Set" - end - return institution_name - end - - def get_author_info - # TODO: DELETE THIS METHOD?? - info = { - :name_on_paper => self.name, - :email => self.mail, - :institution => "", - :author_user_id => self.id, - :is_user => "1" - } - - if not self.ssamr_user_detail.nil? - info[:institution] = self.ssamr_user_detail.institution_name - end - - return info - end - - end #InstanceMethods - - end #UserPublicationsPatch -end #RedmineBibliography
--- a/vendor/plugins/redmine_bibliography/lib/tasks/seed_bibtex_entry_types.rake Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -namespace :redmine do - namespace :plugins do - namespace :redmine_bibliography do - - task :seed_bibtex_entry_types => :environment do - desc "Seeds the Bibtex Entry Types Table" - - quoted = ActiveRecord::Base.connection.quote_table_name('bibtex_entry_types') - ActiveRecord::Base.connection.execute("TRUNCATE #{quoted}") - - open(File.dirname(__FILE__) + "/../../db/seed_data/bibtex_entry_types_list.txt") do |bibtex_entry_types| - bibtex_entry_types.read.each_line do |bibtex_entry_type| - BibtexEntryType.create(:name => bibtex_entry_type.chomp) - end - end - end - - end - end -end
--- a/vendor/plugins/redmine_bibliography/test/fixtures/authors.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - user_id: - name: MyString -two: - id: 2 - user_id: - name: MyString -one: - id: 3 - user_id: - name: MyString -two: - id: 4 - user_id: - name: MyString
--- a/vendor/plugins/redmine_bibliography/test/fixtures/authorships.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - author_id: 1 - publication_id: 1 - name_on_paper: Yih-Farn R. Chen - order: 1 - institution: - email: MyString -two: - id: 2 - author_id: 2 - publication_id: 1 - name_on_paper: Glenn S. Fowler - order: 2 - institution: - email: MyString -three: - id: 3 - author_id: 1 - publication_id: 1 - name_on_paper: Yih-Farn R. Chen - order: 1 - institution: - email: MyString -four: - id: 4 - author_id: 2 - publication_id: 1 - name_on_paper: Glenn S. Fowler - order: 2 - institution: - email: MyString
--- a/vendor/plugins/redmine_bibliography/test/fixtures/bibtex_entries.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - entry_type: InProceedings - booktitle: International Conference on Software Maintenance - year: 1995
--- a/vendor/plugins/redmine_bibliography/test/fixtures/publications.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - title: Test Fixture Title No1 - bibtex_entry_id: 1 -two: - id: 2 - title: MyString - bibtex_entry_id: MyString
--- a/vendor/plugins/redmine_bibliography/test/functional/authors_controller_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class AuthorsControllerTest < ActionController::TestCase - # Replace this with your real tests. - def test_truth - assert true - end -end
--- a/vendor/plugins/redmine_bibliography/test/functional/authorships_controller_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class AuthorshipsControllerTest < ActionController::TestCase - # Replace this with your real tests. - def test_truth - assert true - end -end
--- a/vendor/plugins/redmine_bibliography/test/functional/publications_controller_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class PublicationsControllerTest < ActionController::TestCase - # Replace this with your real tests. - def test_truth - assert true - end -end
--- a/vendor/plugins/redmine_bibliography/test/test_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# Load the normal Rails helper -require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper') -require 'publications_controller' - -# Ensure that we are using the temporary fixture path -Engines::Testing.set_fixture_path - -class BibliographyControllerTest < ActionController::TestCase - fixtures :all - - def setup - end - - def test_publication - - end - - - def test_routing - assert_routing( - {:method => :get, :path => '/requirements'}, - :controller => 'requirements', :action => 'index' - ) - end
--- a/vendor/plugins/redmine_bibliography/test/unit/author_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class AuthorTest < ActiveSupport::TestCase - fixtures :authors - - # Replace this with your real tests. - def test_truth - assert true - end -end
--- a/vendor/plugins/redmine_bibliography/test/unit/authorship_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class AuthorshipTest < ActiveSupport::TestCase - fixtures :authorships - - # Replace this with your real tests. - def test_truth - assert true - end -end
--- a/vendor/plugins/redmine_bibliography/test/unit/bibtex_entry_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class BibtexEntryTest < ActiveSupport::TestCase - fixtures :bibtex_entries - - # Replace this with your real tests. - def test_truth - assert true - end -end
--- a/vendor/plugins/redmine_bibliography/test/unit/publication_test.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class PublicationTest < ActiveSupport::TestCase - fixtures :publications - - # Replace this with your real tests. - def test_truth - assert true - end -end
--- a/vendor/plugins/redmine_checkout/README.rdoc Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -= Redmine Checkout plugin - -Author:: Holger Just -URL:: http://dev.holgerjust.de/projects/redmine-checkout - -This plugin to Redmine adds a link to the actual repository to the GUI. - -This plugin includes ZeroClipboard[http://code.google.com/p/zeroclipboard/] -by Joseph Huckaby. This software is licensed under the -{GNU Lesser General Public License}[http://www.gnu.org/licenses/lgpl.html]. - -Copyright (c) 2009, 2010 Holger Just - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -= Installation - -The installation follows the standard installation path from -http://www.redmine.org/projects/redmine/wiki/Plugins - -1. Copy the software to the vendor/plugins directory. Make sure that the name - of the directory is redmine_checkout. -2. Run rake db:migrate_plugins RAILS_ENV=production -3. Restart Redmine
--- a/vendor/plugins/redmine_checkout/Rakefile Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby -require 'redmine_plugin_support' - -Dir[File.expand_path(File.dirname(__FILE__)) + "/lib/tasks/**/*.rake"].sort.each { |ext| load ext } - -RedminePluginSupport::Base.setup do |plugin| - plugin.project_name = 'redmine_checkout' - plugin.default_task = [:spec] - plugin.tasks = [:doc, :release, :clean, :spec, :stats] -end \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/app/views/projects/settings/_repository_checkout.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -<p><%= form.select(:checkout_overwrite, [ - [l(:general_text_Yes), "1"], - [l(:general_text_No), "0"] - ], - {}, - :onchange => <<-EOF - Effect.toggle($('checkout_settings'), 'slide', {duration:0.2}); - EOF - )%></p> - -<div id="checkout_settings" <%= 'style="display:none;"' unless form.object.checkout_overwrite? %>><fieldset> - <legend><%=l :label_checkout %></legend> - - <p><%= form.text_area :checkout_description, :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p> - <%= wikitoolbar_for 'repository_checkout_description' %> - - <% if form.object.scm_name == 'Subversion' %> - <p><%= form.select :checkout_display_login,[ - [l(:label_display_login_none), ''], - [l(:label_display_login_username), 'username'], - [l(:label_display_login_password), 'password'] - ], - :label => :setting_checkout_display_login %></p> - <% end %> - - <p><%= form.check_box :checkout_display_command %></p> - - <% javascript_tag do %> - protocolForm = new Subform( - '<%= escape_javascript(render(:partial => "projects/settings/repository_checkout_protocol", :locals => {:protocol => Checkout::Protocol.new({:protocol => form.object.scm_name, :append_path => form.object.allow_subtree_checkout? ? 1: 0, :repository => form.object})})) %>', - <%= form.object.checkout_protocols.length %>, - 'checkout_protocol_table' - ); - <% end %> - <p><label><%=l :label_protocol_plural %></label><%=l :help_repository_checkout_protocols %></p> - <%= hidden_field_tag 'repository[checkout_protocols][-1][protocol]', 'empty' %> - <table class="list checkout_protocol_table"> - <thead><tr> - <th class="protocol_protocol" ><%= l(:setting_protocol)%></th> - <th class="protocol_command" ><%= l(:setting_checkout_command)%></th> - <th class="protocol_fixed_url" ><%= l(:setting_checkout_fixed_url) %></th> - <th class="protocol_access" ><%= l(:label_permissions) %></th> - <th class="protocol_append_path"><%= l(:label_append_path) %></th> - <th class="protocol_is_default" ><%= l(:label_default) %></th> - <th class="protocol_delete" ></th> - </tr></thead> - <tbody id="checkout_protocol_table"> - <% form.object.checkout_protocols.each_with_index do |protocol, index| %> - <%= render :partial => 'projects/settings/repository_checkout_protocol', :locals => {:protocol => protocol, :index => index, :classes => cycle('odd', 'even')} %> - <% end %> - </tbody> - </table> - <div style="text-align: right"><%= link_to_function l(:button_add_protocol), "protocolForm.add()", {:class => "icon icon-add"} %></div> -</fieldset></div>
--- a/vendor/plugins/redmine_checkout/app/views/projects/settings/_repository_checkout_protocol.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -<% - index ||= "--INDEX--" - classes ||= "" - - protocol = Checkout::Protocol.new(protocol) unless protocol.is_a? Checkout::Protocol -%> -<tr id="<%= "checkout_protocols_#{index}" %>" class="<%= classes %>" <%= 'style="display:none"' if index == '--INDEX--' %>> - <td class="protocol_protocol"><%= text_field_tag "repository[checkout_protocols][#{index}][protocol]", protocol.protocol, :size => 10 %></td> - <td class="protocol_command"><%= text_field_tag "repository[checkout_protocols][#{index}][command]", protocol.command, :size => 15 %></td> - <td class="protocol_fixed_url"><%= text_field_tag "repository[checkout_protocols][#{index}][fixed_url]", protocol.fixed_url, :size => 60 %></td> - <td class="protocol_access"><%= select_tag "repository[checkout_protocols][#{index}][access]", options_for_select([ - [l(:label_access_read_write), 'read+write'], - [l(:label_access_read_only), 'read-only'], - [l(:label_access_permission), 'permission']], protocol.access) %></td> - <td class="protocol_append_path"><%= check_box_tag "repository[checkout_protocols][#{index}][append_path]", 1, protocol.append_path? %></td> - <td class="protocol_is_default"><%= check_box_tag "repository[checkout_protocols][#{index}][is_default]", 1, protocol.default? %></td> - <td class="protocol_delete"><%= image_to_function 'delete.png', "var e=$('checkout_protocols_#{index}');var parent=e.up(\"tbody\");e.remove();recalculate_even_odd(parent);return false" %></td> -</tr>
--- a/vendor/plugins/redmine_checkout/app/views/redmine_checkout_hooks/_view_repositories_show_contextual.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -<div class="repository-info"> - <% if repository.checkout_description.present? %> - <div class="wiki<%= ' bottomline' if protocols.present? %>"><%= textilizable repository.checkout_description %></div> - <% end %> - <% if protocols.present? %> - <div id="checkout_box"> - <ul id="checkout_protocols"> - <% protocols.each do |p| -%> - <li> - <a <%= 'class="selected"' if p == default_protocol %> id="checkout_protocol_<%= p.protocol.to_s.underscore %>" data-permission="<%= p.access_rw(User.current) %>" href="<%= URI.escape p.url(checkout_path) %>"><%=h p.protocol %></a> - </li> - <% end -%> - </ul> - <%= text_field_tag :checkout_url, h(default_protocol.full_command(checkout_path)), :readonly => true %> - <%- if Setting.checkout_use_zero_clipboard? %> - <div id="clipboard_container" title="<%= l(:label_copy_to_clipboard) %>" style="display: none;"> - <div id="clipboard_button"><%= image_tag 'paste.png', :plugin => 'redmine_checkout' %></div> - </div> - <% end -%> - - <p> - <% if User.current.logged? %> - <% if repository.is_external? %> - <%=l :label_access_type_all, :type => l(:label_access_read_only) %> - <% else %> - <% if default_protocol %><%=l :label_access_type, :type => l(default_protocol.access_label(User.current)) %><% end %> - <% end %> - <% else %> - - <% end %> - </p> - - <% javascript_tag do %> - var checkout_access = $H({<%= protocols.inject([]){|r,p| r << "'checkout_protocol_#{p.protocol.to_s.underscore}': '#{l(p.access_label(User.current))}'"}.join(', ') %>}); - var checkout_commands = $H({<%= protocols.inject([]){|r,p| r << "'checkout_protocol_#{p.protocol.to_s.underscore}': '#{escape_javascript(p.full_command(checkout_path))}'"}.join(', ') %>}); - <%- if Setting.checkout_use_zero_clipboard? %>ZeroClipboard.setMoviePath( '<%= image_path('ZeroClipboard.swf', :plugin => 'redmine_checkout') %>' );<% end %> - <% end %> - </div> - <% end%> - <% if repository.is_external? %> - <div style="clear: left"> - </div> - <p class="topline" style="padding-top: 1em"><%= l(:text_repository_external, :location => repository.external_url) %></p> - <% end %> -</div> -<div style="clear: left"></div> - -<% content_for :header_tags do %> - <%= stylesheet_link_tag 'checkout', :plugin => 'redmine_checkout' %> - <%= javascript_include_tag 'checkout', :plugin => 'redmine_checkout' %> - <%= (javascript_include_tag 'ZeroClipboard', :plugin => 'redmine_checkout') if Setting.checkout_use_zero_clipboard? %> -<% end %>
--- a/vendor/plugins/redmine_checkout/app/views/settings/_checkout.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -<% form_tag({:action => 'edit', :tab => 'checkout'}) do %> - -<% javascript_tag do %> -protocolForms = $H(); - -document.observe("dom:loaded", function() { - $('tab-content-checkout').select('fieldset.collapsed').each(function(e){ - e.down('div').hide(); - }); - <% - CheckoutHelper.supported_scm.select{|scm| Setting.enabled_scm.include?(scm)}.each do |scm| - next if Setting.send("checkout_overwrite_description_#{scm}?") - -%> - $('settings_checkout_description_<%= scm %>').up('div').up('div').hide(); - <%- end %> -}); -<% end %> - - -<div class="box tabular settings"> -<p><%= setting_check_box :checkout_display_checkout_info %></p> - -<p><%= setting_text_area :checkout_description_Abstract, :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p> -<%= wikitoolbar_for 'settings_checkout_description_Abstract' %> - -<p><%= setting_check_box :checkout_use_zero_clipboard %></p> - -<% CheckoutHelper.supported_scm.select{|scm| Setting.enabled_scm.include?(scm)}.each do |scm| -%> -<fieldset class="collapsible collapsed"> - <legend onclick="toggleFieldset(this);"><%= "Repository::#{scm}".constantize.scm_name %></legend> - <div><%= render :partial => 'checkout_scm', :locals => {:scm => scm} %></div> -</fieldset> -<%- end %> - -</div> - -<%= submit_tag l(:button_save) %> -<%- end %> - -<% content_for :header_tags do %> - <%= javascript_include_tag 'subform', :plugin => 'redmine_checkout' %> - <%= stylesheet_link_tag 'checkout', :plugin => 'redmine_checkout' %> -<% end %>
--- a/vendor/plugins/redmine_checkout/app/views/settings/_checkout_protocol.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -<% - index ||= "--INDEX--" - classes ||= "" - - protocol = Checkout::Protocol.new(protocol) unless protocol.is_a? Checkout::Protocol -%> -<tr id="<%= "checkout_protocols_#{scm}_#{index}" %>" class="<%= classes %>" <%= 'style="display:none"' if index == '--INDEX--' %>> - <td class="protocol_protocol" ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][protocol]", protocol.protocol, :size => 10 %></td> - <td class="protocol_command" ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][command]", protocol.command, :size => 15 %></td> - <td class="protocol_regex" ><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][regex]", protocol.regex, :size => 30 %></td> - <td class="protocol_regex_replacement"><%= text_field_tag "settings[checkout_protocols_#{scm}][#{index}][regex_replacement]", protocol.regex_replacement, :size => 30 %></td> - <td class="protocol_access" ><%= select_tag "settings[checkout_protocols_#{scm}][#{index}][access]", options_for_select([ - [l(:label_access_read_write), 'read+write'], - [l(:label_access_read_only), 'read-only'], - [l(:label_access_permission), 'permission']], protocol.access) %></td> - <td class="protocol_append_path"><%= check_box_tag "settings[checkout_protocols_#{scm}][#{index}][append_path]", 1, protocol.append_path? %></td> - <td class="protocol_is_default"><%= check_box_tag "settings[checkout_protocols_#{scm}][#{index}][is_default]", 1, protocol.default? %></td> - <td class="protocol_delete"><%= image_to_function 'delete.png', "var e=$('checkout_protocols_#{scm}_#{index}');var parent=e.up(\"tbody\");e.remove();recalculate_even_odd(parent);return false" %></td> -</tr>
--- a/vendor/plugins/redmine_checkout/app/views/settings/_checkout_scm.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -<div> - <p><%= setting_check_box "checkout_overwrite_description_#{scm}", :label => :setting_checkout_overwrite_description, :onclick => <<-EOF - Effect.toggle($('settings_checkout_description_#{scm}').up("div").up("div"), 'slide', {duration:0.2}); - EOF - %></p> - - <div> - <p><%= setting_text_area "checkout_description_#{scm}", :cols => 60, :rows => 5, :class => 'wiki-edit', :label => :field_description %></p> - <%= wikitoolbar_for "settings_checkout_description_#{scm}" %> - </div> - - <% if scm == 'Subversion' %> - <p><%= setting_select "checkout_display_login",[ - [l(:label_display_login_username), 'username'], - [l(:label_display_login_password), 'password'] - ], - :blank => :label_display_login_none %></p> - <% end %> - - <p><%= setting_check_box "checkout_display_command_#{scm}", :label => :field_checkout_display_command %></p> - - <% javascript_tag do %> - <% repo = "Repository::#{scm}".constantize %> - var subform = new Subform('<%= escape_javascript(render(:partial => "checkout_protocol", :locals => {:protocol => Checkout::Protocol.new({:protocol => repo.scm_name, :append_path => (repo.allow_subtree_checkout? ? '1' : '0'), :command => repo.checkout_default_command}), :scm => scm})) %>',<%= Setting.send("checkout_protocols_#{scm}").length %>,'settings_checkout_protocols_<%= scm %>'); - protocolForms.set('<%= scm %>', subform); - <% end %> - <p><label><%=l :label_protocol_plural %></label><%=l :help_checkout_protocols %></p> - <table class="list checkout_protocol_table"> - <thead><tr> - <th class="protocol_protocol" ><%= l(:setting_protocol)%></th> - <th class="protocol_command" ><%= l(:setting_checkout_command)%></th> - <th class="protocol_regex" ><%= l(:setting_checkout_url_regex) %></th> - <th class="protocol_regex_replacement"><%= l(:setting_checkout_url_regex_replacement) %></th> - <th class="protocol_access" ><%= l(:label_permissions) %></th> - <th class="protocol_append_path" ><%= l(:label_append_path) %></th> - <th class="protocol_is_default" ><%= l(:label_default) %></th> - <th class="protocol_delete" ></th> - </tr></thead> - <tbody id="settings_checkout_protocols_<%= scm %>"> - <% Setting.send("checkout_protocols_#{scm}").each_with_index do |protocol, index| %> - <%= render :partial => 'checkout_protocol', :locals => {:protocol => Checkout::Protocol.new(protocol), :scm => scm, :index => index, :classes => cycle('odd', 'even')} %> - <% end %> - </tbody> - </table> - <div style="text-align: right"><%= link_to_function l(:button_add_protocol), "protocolForms.get('#{scm}').add()", {:class => "icon icon-add"} %></div> -</div>
--- a/vendor/plugins/redmine_checkout/app/views/settings/_redmine_checkout.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -<%=l(:help_moved_settings, :link => link_to(l(:label_settings_location), {:controller => 'settings', :action => 'index', :tab => 'checkout'})) %>
--- a/vendor/plugins/redmine_checkout/assets/images/ZeroClipboard.as Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -package { - // Simple Set Clipboard System - // Author: Joseph Huckaby - - import flash.display.Stage; - import flash.display.Sprite; - import flash.display.LoaderInfo; - import flash.display.StageScaleMode; - import flash.events.*; - import flash.display.StageAlign; - import flash.display.StageScaleMode; - import flash.external.ExternalInterface; - import flash.system.Security; - import flash.utils.*; - import flash.system.System; - - public class ZeroClipboard extends Sprite { - - private var id:String = ''; - private var button:Sprite; - private var clipText:String = ''; - - public function ZeroClipboard() { - // constructor, setup event listeners and external interfaces - stage.scaleMode = StageScaleMode.EXACT_FIT; - flash.system.Security.allowDomain("*"); - - // import flashvars - var flashvars:Object = LoaderInfo( this.root.loaderInfo ).parameters; - id = flashvars.id; - - // invisible button covers entire stage - button = new Sprite(); - button.buttonMode = true; - button.useHandCursor = true; - button.graphics.beginFill(0xCCFF00); - button.graphics.drawRect(0, 0, Math.floor(flashvars.width), Math.floor(flashvars.height)); - button.alpha = 0.0; - addChild(button); - button.addEventListener(MouseEvent.CLICK, clickHandler); - - button.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event) { - ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOver', null ); - } ); - button.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event) { - ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseOut', null ); - } ); - button.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event) { - ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseDown', null ); - } ); - button.addEventListener(MouseEvent.MOUSE_UP, function(event:Event) { - ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'mouseUp', null ); - } ); - - // external functions - ExternalInterface.addCallback("setHandCursor", setHandCursor); - ExternalInterface.addCallback("setText", setText); - - // signal to the browser that we are ready - ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'load', null ); - } - - public function setText(newText) { - // set the maximum number of files allowed - clipText = newText; - } - - public function setHandCursor(enabled:Boolean) { - // control whether the hand cursor is shown on rollover (true) - // or the default arrow cursor (false) - button.useHandCursor = enabled; - } - - private function clickHandler(event:Event):void { - // user click copies text to clipboard - // as of flash player 10, this MUST happen from an in-movie flash click event - System.setClipboard( clipText ); - ExternalInterface.call( 'ZeroClipboard.dispatch', id, 'complete', clipText ); - } - } -}
--- a/vendor/plugins/redmine_checkout/assets/images/button.svg Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> - <defs> - <linearGradient id="gradient" x1="100%" y1="100%"> - <stop offset="0%" style="stop-color:#ddd; stop-opacity:1" /> - <stop offset="100%" style="stop-color:#f8f8f8; stop-opacity:1" /> - </linearGradient> - </defs> - <rect width="100%" height="100%" style="fill:url(#gradient)"/> -</svg> \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/assets/images/button_focus.svg Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> - <defs> - <linearGradient id="gradient" x1="100%" y1="100%"> - <stop offset="0%" style="stop-color:#507AAA; stop-opacity:1" /> - <stop offset="100%" style="stop-color:#759fcf; stop-opacity:1" /> - </linearGradient> - </defs> - <rect width="100%" height="100%" style="fill:url(#gradient)"/> -</svg> \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/assets/images/button_selected.svg Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -<?xml version="1.0" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> - <defs> - <linearGradient id="gradient" x1="100%" y1="100%"> - <stop offset="0%" style="stop-color:#aaa; stop-opacity:1" /> - <stop offset="100%" style="stop-color:#ccc; stop-opacity:1" /> - </linearGradient> - </defs> - <rect width="100%" height="100%" style="fill:url(#gradient)"/> -</svg> \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/assets/javascripts/ZeroClipboard.js Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,311 +0,0 @@ -// Simple Set Clipboard System -// Author: Joseph Huckaby - -var ZeroClipboard = { - - version: "1.0.7", - clients: {}, // registered upload clients on page, indexed by id - moviePath: 'ZeroClipboard.swf', // URL to movie - nextId: 1, // ID of next movie - - $: function(thingy) { - // simple DOM lookup utility function - if (typeof(thingy) == 'string') thingy = document.getElementById(thingy); - if (!thingy.addClass) { - // extend element with a few useful methods - thingy.hide = function() { this.style.display = 'none'; }; - thingy.show = function() { this.style.display = ''; }; - thingy.addClass = function(name) { this.removeClass(name); this.className += ' ' + name; }; - thingy.removeClass = function(name) { - var classes = this.className.split(/\s+/); - var idx = -1; - for (var k = 0; k < classes.length; k++) { - if (classes[k] == name) { idx = k; k = classes.length; } - } - if (idx > -1) { - classes.splice( idx, 1 ); - this.className = classes.join(' '); - } - return this; - }; - thingy.hasClass = function(name) { - return !!this.className.match( new RegExp("\\s*" + name + "\\s*") ); - }; - } - return thingy; - }, - - setMoviePath: function(path) { - // set path to ZeroClipboard.swf - this.moviePath = path; - }, - - dispatch: function(id, eventName, args) { - // receive event from flash movie, send to client - var client = this.clients[id]; - if (client) { - client.receiveEvent(eventName, args); - } - }, - - register: function(id, client) { - // register new client to receive events - this.clients[id] = client; - }, - - getDOMObjectPosition: function(obj, stopObj) { - // get absolute coordinates for dom element - var info = { - left: 0, - top: 0, - width: obj.width ? obj.width : obj.offsetWidth, - height: obj.height ? obj.height : obj.offsetHeight - }; - - while (obj && (obj != stopObj)) { - info.left += obj.offsetLeft; - info.top += obj.offsetTop; - obj = obj.offsetParent; - } - - return info; - }, - - Client: function(elem) { - // constructor for new simple upload client - this.handlers = {}; - - // unique ID - this.id = ZeroClipboard.nextId++; - this.movieId = 'ZeroClipboardMovie_' + this.id; - - // register client with singleton to receive flash events - ZeroClipboard.register(this.id, this); - - // create movie - if (elem) this.glue(elem); - } -}; - -ZeroClipboard.Client.prototype = { - - id: 0, // unique ID for us - ready: false, // whether movie is ready to receive events or not - movie: null, // reference to movie object - clipText: '', // text to copy to clipboard - handCursorEnabled: true, // whether to show hand cursor, or default pointer cursor - cssEffects: true, // enable CSS mouse effects on dom container - handlers: null, // user event handlers - - glue: function(elem, appendElem, stylesToAdd) { - // glue to DOM element - // elem can be ID or actual DOM element object - this.domElement = ZeroClipboard.$(elem); - - // float just above object, or zIndex 99 if dom element isn't set - var zIndex = 99; - if (this.domElement.style.zIndex) { - zIndex = parseInt(this.domElement.style.zIndex, 10) + 1; - } - - if (typeof(appendElem) == 'string') { - appendElem = ZeroClipboard.$(appendElem); - } - else if (typeof(appendElem) == 'undefined') { - appendElem = document.getElementsByTagName('body')[0]; - } - - // find X/Y position of domElement - var box = ZeroClipboard.getDOMObjectPosition(this.domElement, appendElem); - - // create floating DIV above element - this.div = document.createElement('div'); - var style = this.div.style; - style.position = 'absolute'; - style.left = '' + box.left + 'px'; - style.top = '' + box.top + 'px'; - style.width = '' + box.width + 'px'; - style.height = '' + box.height + 'px'; - style.zIndex = zIndex; - - if (typeof(stylesToAdd) == 'object') { - for (addedStyle in stylesToAdd) { - style[addedStyle] = stylesToAdd[addedStyle]; - } - } - - // style.backgroundColor = '#f00'; // debug - - appendElem.appendChild(this.div); - - this.div.innerHTML = this.getHTML( box.width, box.height ); - }, - - getHTML: function(width, height) { - // return HTML for movie - var html = ''; - var flashvars = 'id=' + this.id + - '&width=' + width + - '&height=' + height; - - if (navigator.userAgent.match(/MSIE/)) { - // IE gets an OBJECT tag - var protocol = location.href.match(/^https/i) ? 'https://' : 'http://'; - html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+protocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+width+'" height="'+height+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+flashvars+'"/><param name="wmode" value="transparent"/></object>'; - } - else { - // all other browsers get an EMBED tag - html += '<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+flashvars+'" wmode="transparent" />'; - } - return html; - }, - - hide: function() { - // temporarily hide floater offscreen - if (this.div) { - this.div.style.left = '-2000px'; - } - }, - - show: function() { - // show ourselves after a call to hide() - this.reposition(); - }, - - destroy: function() { - // destroy control and floater - if (this.domElement && this.div) { - this.hide(); - this.div.innerHTML = ''; - - var body = document.getElementsByTagName('body')[0]; - try { body.removeChild( this.div ); } catch(e) {;} - - this.domElement = null; - this.div = null; - } - }, - - reposition: function(elem) { - // reposition our floating div, optionally to new container - // warning: container CANNOT change size, only position - if (elem) { - this.domElement = ZeroClipboard.$(elem); - if (!this.domElement) this.hide(); - } - - if (this.domElement && this.div) { - var box = ZeroClipboard.getDOMObjectPosition(this.domElement); - var style = this.div.style; - style.left = '' + box.left + 'px'; - style.top = '' + box.top + 'px'; - } - }, - - setText: function(newText) { - // set text to be copied to clipboard - this.clipText = newText; - if (this.ready) this.movie.setText(newText); - }, - - addEventListener: function(eventName, func) { - // add user event listener for event - // event types: load, queueStart, fileStart, fileComplete, queueComplete, progress, error, cancel - eventName = eventName.toString().toLowerCase().replace(/^on/, ''); - if (!this.handlers[eventName]) this.handlers[eventName] = []; - this.handlers[eventName].push(func); - }, - - setHandCursor: function(enabled) { - // enable hand cursor (true), or default arrow cursor (false) - this.handCursorEnabled = enabled; - if (this.ready) this.movie.setHandCursor(enabled); - }, - - setCSSEffects: function(enabled) { - // enable or disable CSS effects on DOM container - this.cssEffects = !!enabled; - }, - - receiveEvent: function(eventName, args) { - // receive event from flash - eventName = eventName.toString().toLowerCase().replace(/^on/, ''); - - // special behavior for certain events - switch (eventName) { - case 'load': - // movie claims it is ready, but in IE this isn't always the case... - // bug fix: Cannot extend EMBED DOM elements in Firefox, must use traditional function - this.movie = document.getElementById(this.movieId); - if (!this.movie) { - var self = this; - setTimeout( function() { self.receiveEvent('load', null); }, 1 ); - return; - } - - // firefox on pc needs a "kick" in order to set these in certain cases - if (!this.ready && navigator.userAgent.match(/Firefox/) && navigator.userAgent.match(/Windows/)) { - var self = this; - setTimeout( function() { self.receiveEvent('load', null); }, 100 ); - this.ready = true; - return; - } - - this.ready = true; - this.movie.setText( this.clipText ); - this.movie.setHandCursor( this.handCursorEnabled ); - break; - - case 'mouseover': - if (this.domElement && this.cssEffects) { - this.domElement.addClass('hover'); - if (this.recoverActive) this.domElement.addClass('active'); - } - break; - - case 'mouseout': - if (this.domElement && this.cssEffects) { - this.recoverActive = false; - if (this.domElement.hasClass('active')) { - this.domElement.removeClass('active'); - this.recoverActive = true; - } - this.domElement.removeClass('hover'); - } - break; - - case 'mousedown': - if (this.domElement && this.cssEffects) { - this.domElement.addClass('active'); - } - break; - - case 'mouseup': - if (this.domElement && this.cssEffects) { - this.domElement.removeClass('active'); - this.recoverActive = false; - } - break; - } // switch eventName - - if (this.handlers[eventName]) { - for (var idx = 0, len = this.handlers[eventName].length; idx < len; idx++) { - var func = this.handlers[eventName][idx]; - - if (typeof(func) == 'function') { - // actual function reference - func(this, args); - } - else if ((typeof(func) == 'object') && (func.length == 2)) { - // PHP style object + method, i.e. [myObject, 'myMethod'] - func[0][ func[1] ](this, args); - } - else if (typeof(func) == 'string') { - // name of function - window[func](this, args); - } - } // foreach event handler defined - } // user defined handler for event - } - -};
--- a/vendor/plugins/redmine_checkout/assets/javascripts/checkout.js Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -document.observe("dom:loaded", function() { - /* update the checkout URL if clicked on a protocol */ - $('checkout_protocols').select('a').each(function(e) { - e.observe('click', function(event) { - $('checkout_url').value = checkout_commands.get(this.id); - $('checkout_protocols').select('a').each(function(e) { - e.removeClassName("selected"); - }); - this.addClassName("selected") - - var value = checkout_access.get(this.id); - $('checkout_access').innerHTML = value; - - event.stop(); - }); - }); - /* select the text field contents if activated */ - Event.observe('checkout_url', 'click', function(event) { - this.activate(); - }); - - if (typeof('ZeroClipboard') != 'undefined') { - $('clipboard_container').show(); - clipboard = new ZeroClipboard.Client(); - clipboard.setHandCursor( true ); - clipboard.glue('clipboard_button', 'clipboard_container'); - - clipboard.addEventListener('mouseOver', function (client) { - clipboard.setText( $('checkout_url').value ); - }); - } -}); -
--- a/vendor/plugins/redmine_checkout/assets/javascripts/subform.js Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -var Subform = Class.create({ - lineIndex: 1, - parentElement: "", - initialize: function(rawHTML, lineIndex, parentElement) { - this.rawHTML = rawHTML; - this.lineIndex = lineIndex; - this.parentElement = parentElement; - }, - - parsedHTML: function() { - return this.rawHTML.replace(/--INDEX--/g, this.lineIndex++); - }, - - add: function() { - var e = $(this.parentElement); - Element.insert(e, { bottom: this.parsedHTML()}); - Effect.toggle(e.childElements().last(), 'slide', {duration:0.2}); - recalculate_even_odd(e); - }, - - add_after: function(e) { - Element.insert(e, { after: this.parsedHTML()}); - Effect.toggle(e.next(), 'slide', {duration:0.2}); - recalculate_even_odd($(this.parentElement)); - }, - - add_on_top: function() { - var e = $(this.parentElement); - Element.insert(e, { top: this.parsedHTML()}); - Effect.toggle(e.childElements().first(), 'slide', {duration:0.2}); - recalculate_even_odd(e); - } -}); - -function recalculate_even_odd(element) { - $A(element.childElements()).inject( - 0, - function(acc, e) - { - e.removeClassName("even"); - e.removeClassName("odd"); - e.addClassName( (acc%2==0) ? "odd" : "even"); return ++acc; - } - ) -}
--- a/vendor/plugins/redmine_checkout/assets/stylesheets/checkout.css Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* Uncomment the following line for nicer tables if you use the alternate theme (or derived). */ -/* @import url(checkout_alternate.css); */ - -table.checkout_protocol_table td { padding-right: 6px; vertical-align: middle; /* Double the border with of text input boxes */ } -table.checkout_protocol_table td.protocol_access { padding-right: 0; } -table.checkout_protocol_table td input[type=text], .checkout_protocol_table td select { width: 100%; } -table.checkout_protocol_table td.protocol_delete { width: 16px; } -table.checkout_protocol_table td.protocol_append_path, table.checkout_protocol_table td.protocol_is_default { text-align: center; } - -.icon-changeset { background-image: url(../../../images/changeset.png);} - -.repository-info { - background-color: #eee; - border: 1px solid #E4E4E4; - padding: 0 10px; - margin: 4px 0 10px; -} - -.bottomline { - border-bottom: 1px solid #ccc; -} - -.topline { - border-top: 1px solid #ccc; -} - -#checkout_box { - margin: 10px 0; -} - -#checkout_protocols { - height: 23px; - float: left; - margin: 0; - padding: 0; -} - -#checkout_protocols li { - float: left; - list-style-type: none; - margin: 0; - padding: 0; -} - -#checkout_protocols li:first-child a { - border-left-width: 1px; - - /* Standard, Opera 10, IE 9 */ - border-top-left-radius: 3px; - border-bottom-left-radius: 3px; - /* Konquerer */ - -khtml-border-top-left-radius: 3px; - -khtml-border-bottom-left-radius: 3px; - /* Gecko (Firefox, ...) */ - -moz-border-radius: 3px 0 0 3px; - /* Webkit (Chrome, Safari, ...) */ - -webkit-border-top-left-radius: 3px; - -webkit-border-bottom-left-radius: 3px; - /* IE <= 9 not supported */ -} - -#checkout_protocols li a, -#clipboard_button { - background-color: #eee; - background: url(../images/button.svg) 0 0 no-repeat; /* Opera needs an "image" :( - using svg for this so it will scale properly without looking too ugly */ - background: -khtml-gradient(linear, left top, left bottom, from(#f8f8f8), to(#ddd)); /* Konquerer */ - background: -moz-linear-gradient(top, #f8f8f8, #ddd); /* Gecko (Firefox, ...) */ - background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#ddd)); /* Webkit (Chrome, Safari, ...) */ - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f8f8f8', endColorstr='#dddddd'); /* IE 5.5 - 7 */ - -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f8f8f8', endColorstr='#dddddd'); /* IE 8 */ - - border-color: #bbb; - border-style: solid; - border-width: 1px 1px 1px 0; - - color: #333; - display: block; - font-size: 11px; - font-weight: bold; - line-height: 21px; - margin: 0; - padding: 0 10px 0 11px; - text-decoration: none; - text-shadow: 1px 1px 0 #fff; - position: relative; /* to please IE */ -} - -#checkout_protocols li a:hover, -#checkout_protocols li a:focus { - background-color: #507AAA; - background: url(../images/button_focus.svg) 0 0 no-repeat; /* Opera needs an "image" :( - using svg for this so it will scale properly without looking too ugly */ - background: -khtml-gradient(linear, left top, left bottom, from(#759fcf), to(#507AAA)); /* Konquerer */ - background: -moz-linear-gradient(top, #759fcf, #507AAA); /* Gecko (Firefox, ...) */ - background: -webkit-gradient(linear, left top, left bottom, from(#759fcf), to(#507AAA)); /* Webkit (Chrome, Safari, ...) */ - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#759fcf', endColorstr='#507AAA'); /* IE 5.5 - IE 7 */ - -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#759fcf', endColorstr='#507AAA'); /* IE 8 */ - - color: #fff; - text-shadow: -1px -1px 0 rgba(0,0,0,0.4); - border-top-color: #759fcf; - border-bottom-color: #507AAA; -} - -#checkout_protocols li a.selected, -#clipboard_button.active { - background-color: #bbb; - background: url(../images/button_selected.svg) 0 0 no-repeat; /* Opera needs an "image" :( - using svg for this so it will scale properly without looking too ugly */ - background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#aaa)); /* Konquerer */ - background: -moz-linear-gradient(top, #ccc, #aaa); /* Gecko (Firefox, ...) */ - background: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#aaa)); /* Webkit (Chrome, Safari, ...) */ - filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#aaaaaa'); /* IE 5.5 - IE 7 */ - -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#aaaaaa'); /* IE 8 */ - - color: #000; - text-shadow: 1px 1px 0 rgba(255,255,255,0.4); - border-color: #bbb; -} - -#checkout_url { - border: 1px solid #bbb; - border-width: 1px 1px 1px 0; - background-color: #fff; - color: #000; - font-size: 11px; - height: 16px; - padding: 3px 5px 2px; - width: 400px; - font-family: Monaco,"DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace; - margin: 0 5px 0 0; - float: left; -} - -#checkout_box p { - color: #666; - line-height: 23px; - font-size: 11px; - margin: 0 0 0 5px; -} - -span#checkout_access { - font-weight: bold; -} - -#clipboard_container { - position: relative; - float: left; - margin-right: 5px; -} - -#clipboard_button { - height: 21px; - width: 23px; - padding: 0; - border-width: 1px; - text-align: center; - - border-radius: 5px; /* Standard, Opera 10, IE 9 */ - -khtml-border-radius: 3px; /* Konquerer */ - -moz-border-radius: 3px ; /* Gecko (Firefox, ...) */ - -webkit-border-radius: 3px; /* Webkit (Chrome, Safari, ...) */ - /* IE <= 9 not supported */ -} - -#clipboard_button img { - padding-top: 2px; -}
--- a/vendor/plugins/redmine_checkout/assets/stylesheets/checkout_alternate.css Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -table.checkout_protocol_table td { padding-right: 10px !important; /* Double the border with of text input boxes */ } -table.checkout_protocol_table td.protocol_access { padding-right: 2px !important; }
--- a/vendor/plugins/redmine_checkout/config/locales/de.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -de: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Checkout-Informationen anzeigen" - setting_checkout_fixed_url: "Checkout-URL" - setting_checkout_url_regex: "Regulärer Ausdruck" - setting_checkout_url_regex_replacement: "Ersatztext" - setting_checkout_display_login: "Mitgliedsnamen anzeigen" - setting_checkout_command: "Checkout-Befehl" - setting_checkout_use_zero_clipboard: "Zwischenablagen-Helfer anzeigen" - - setting_checkout_overwrite_description: "Standard-Beschreibung überschreiben" - field_checkout_overwrite: "Überschreibe Standardeinstellung für Checkout-Protokolle" - field_checkout_display_command: "Checkout-Befehl anzeigen" - - label_protocol_plural: "Protokolle" - button_add_protocol: "Protokoll hinzufügen" - - label_access_type: 'Diese URL erlaubt Zugriff zum <span id="checkout_access">{{type}}</span>.' - label_access_read_only: 'Nur-Lesen' - label_access_read_write: "Lesen+Schreiben" - label_access_permission: "Abhängig von Benutzer-Rechten" - - label_append_path: "Pfad anhängen" - - label_display_login_none: "Mitgliedsnamen nicht anzeigen" - label_display_login_username: "Mitgliedsnamen anzeigen, aber kein Kennwort" - label_display_login_password: "Mitgliedsnamen und Kennwort anzeigen" - - label_copy_to_clipboard: "In die Zwischenablage kopieren" - - help_checkout_protocols: | - Die URLs in Protokollen werden aus der originalen URL erzeugt, auf die der - reguläre Ausdruck und der Ersatztext angewendet werden. Der Ersatztext - erlaubt Rückwärtsreferenzen zu geklammerten Audrücken mit der \1 Notation. - help_repository_checkout_protocols: | - Lassen Sie das Checkout-URL-Feld leer um die URL des Projektarchivs zu verwenden. - help_moved_settings: "Die Konfigurationsseite wurde nach {{link}} verschoben." - label_settings_location: "Administration -> Konfiguration -> Checkout" \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/config/locales/en-GB.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -en-GB: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Display checkout information" - setting_checkout_fixed_url: "Checkout URL" - setting_checkout_url_regex: "Regular expression" - setting_checkout_url_regex_replacement: "Replacement text" - setting_checkout_display_login: "Display Login" - setting_checkout_command: "Checkout command" - setting_checkout_use_zero_clipboard: "Display clipboard helper" - - setting_checkout_overwrite_description: "Overwrite default description" - field_checkout_overwrite: "Overwrite default settings for checkout protocols" - field_checkout_display_command: "Display checkout command" - - label_protocol_plural: "Protocols" - button_add_protocol: "Add Protocol" - - label_access_type: 'You have <span id="checkout_access">{{type}}</span> access to this URL.' - label_access_read_only: 'Read Only' - label_access_read_write: "Read and Write" - label_access_permission: "Depending on user's permissions" - - label_append_path: "Append path" - - label_display_login_none: "Do not show login or password" - label_display_login_username: "Show login but no password" - label_display_login_password: "Show login and password" - - label_copy_to_clipboard: "Copy to clipboard" - - help_checkout_protocols: | - The URLs in protocols are generated from applying the regular expression - and the replacement text to the original URL. The replacement text - supports back-references to braced expressions using the \1 notation. - help_repository_checkout_protocols: | - Leave the Checkout URL field empty to use the defined repository URL. - help_moved_settings: "The settings page has been moved to {{link}}." - label_settings_location: "Administration -> Settings -> Checkout" - - text_repository_external: "The primary repository for this project is hosted at <code>{{location}}</code> .<br>This repository is a read-only copy which is updated automatically."
--- a/vendor/plugins/redmine_checkout/config/locales/en.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -en: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Display checkout information" - setting_checkout_fixed_url: "Checkout URL" - setting_checkout_url_regex: "Regular expression" - setting_checkout_url_regex_replacement: "Replacement text" - setting_checkout_display_login: "Display Login" - setting_checkout_command: "Checkout command" - setting_checkout_use_zero_clipboard: "Display clipboard helper" - - setting_checkout_overwrite_description: "Overwrite default description" - field_checkout_overwrite: "Overwrite default settings for checkout protocols" - field_checkout_display_command: "Display checkout command" - - label_protocol_plural: "Protocols" - button_add_protocol: "Add Protocol" - - label_access_type: 'You have <span id="checkout_access">{{type}}</span> access to this URL.' - label_access_type_all: 'All access to this URL is <span id="checkout_access">{{type}}</span>.' - label_access_read_only: 'Read Only' - label_access_read_write: "Read and Write" - label_access_permission: "Depending on user's permissions" - - label_append_path: "Append path" - - label_display_login_none: "Do not show login or password" - label_display_login_username: "Show login but no password" - label_display_login_password: "Show login and password" - - label_copy_to_clipboard: "Copy to clipboard" - - help_checkout_protocols: | - The URLs in protocols are generated from applying the regular expression - and the replacement text to the original URL. The replacement text - supports back-references to braced expressions using the \1 notation. - help_repository_checkout_protocols: | - Leave the Checkout URL field empty to use the defined repository URL. - help_moved_settings: "The settings page has been moved to {{link}}." - label_settings_location: "Administration -> Settings -> Checkout" - - text_repository_external: "The primary repository for this project is hosted at <code>{{location}}</code> .<br>This repository is a read-only copy which is updated automatically every hour." -
--- a/vendor/plugins/redmine_checkout/config/locales/es.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -es: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Display checkout information" - setting_checkout_fixed_url: "URL de checkout" - setting_checkout_url_regex: "Expresion regular" - setting_checkout_url_regex_replacement: "Texto de remplazo" - setting_checkout_display_login: "Mostrar usuario" - setting_checkout_command: "Comando de checkout" - setting_checkout_use_zero_clipboard: "Display clipboard helper" - - setting_checkout_overwrite_description: "Overwrite default description" - field_checkout_overwrite: "Overwrite default settings for checkout protocols" - field_checkout_display_command: "Display checkout command" - - label_protocol_plural: "Protocolos" - button_add_protocol: "Crear Protocolo" - - label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' - label_access_read_only: 'Read-Only' - label_access_read_write: "Read+Write" - label_access_permission: "Depending on user's permissions" - - label_append_path: "Append path" - - label_display_login_none: "No mostrar usuario o contraseña" - label_display_login_username: "Mostrar usuario pero no contraseña" - label_display_login_password: "Mostrar usuario y contraseña" - - label_copy_to_clipboard: "Copy to clipboard" - - help_checkout_protocols: | - The URLs in protocols are generated from applying the regular expression - and the replacement text to the original URL. The replacement text - supports back-references to braced expressions using the \1 notation. - help_repository_checkout_protocols: | - Leave the Checkout URL field empty to use the defined repository URL. - help_moved_settings: "The settings page has been moved to {{link}}." - label_settings_location: "Administration -> Settings -> Checkout"
--- a/vendor/plugins/redmine_checkout/config/locales/fr.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -fr: - label_checkout: "Dépôt" - - setting_checkout_display_checkout_info: "Display checkout information" - setting_checkout_fixed_url: "URL du dépôt" - setting_checkout_url_regex: "Expression Régulière" - setting_checkout_url_regex_replacement: "Texte de substitution" - setting_checkout_display_login: "Affiche le login" - setting_checkout_command: "Checkout command" - setting_checkout_use_zero_clipboard: "Display clipboard helper" - - setting_checkout_overwrite_description: "Overwrite default description" - field_checkout_overwrite: "Overwrite default settings for checkout protocols" - field_checkout_display_command: "Affiche l'URL du dépôt" - - label_protocol_plural: "Protocoles" - button_add_protocol: "Créer un protocole" - - label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' - label_access_read_only: 'Read-Only' - label_access_read_write: "Read+Write" - label_access_permission: "Depending on user's permissions" - - label_append_path: "Append path" - - label_display_login_none: "Ne pas afficher le login ni le mot de passe" - label_display_login_username: "Afficher le login, pas le mot de passe" - label_display_login_password: "Afficher le login et le mot de passe" - - label_copy_to_clipboard: "Copy to clipboard" - - help_checkout_protocols: | - The URLs in protocols are generated from applying the regular expression - and the replacement text to the original URL. The replacement text - supports back-references to braced expressions using the \1 notation. - help_repository_checkout_protocols: | - Leave the Checkout URL field empty to use the defined repository URL. - help_moved_settings: "The settings page has been moved to {{link}}." - label_settings_location: "Administration -> Settings -> Checkout"
--- a/vendor/plugins/redmine_checkout/config/locales/it.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -it: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Visualizza le informazioni sul checkout" - setting_checkout_fixed_url: "URL di checkout" - setting_checkout_url_regex: "Espressione regolare" - setting_checkout_url_regex_replacement: "Testo sostituito" - setting_checkout_display_login: "Login visualizzato" - setting_checkout_command: "Comando per il checkout" - setting_checkout_use_zero_clipboard: "Visualizza l'utility per la copia negli appunti" - - setting_checkout_overwrite_description: "Sovrascrivi la descrizione predefinita" - field_checkout_overwrite: "Sovrascrivi le impostazioni di checkout predefinite" - field_checkout_display_command: "Visualizza il comando per il checkout" - - label_protocol_plural: "Protocolli" - button_add_protocol: "Aggiungi Protocollo" - - label_access_type: 'Questo URL ha accesso <span id="checkout_access">{{type}}</span>.' - label_access_read_only: 'Sola-Lettura' - label_access_read_write: "Lettura+Scrittura" - label_access_permission: "Dipende dai permessi dell'utente" - - label_append_path: "Aggiungi percorso" - - label_display_login_none: "Non mostrare il login e password" - label_display_login_username: "Mostra il login senza password" - label_display_login_password: "Mostra il login e la password" - - label_copy_to_clipboard: "Copia negli appunti" - - help_checkout_protocols: | - Gli URL dei protocolli sono generati applicando le espressioni regolari - ed effettuando la sostituzione dell'URL originale con il testo specificato. - Il testo per la sostituzione può contenere riferimenti a più match usando - la notazione \1 \2... - help_repository_checkout_protocols: | - Lascia il campo URL di checkout bianco per usare l'URL definito nel repository. - help_moved_settings: "La pagina delle impostazioni è stata spostata in {{link}}." - label_settings_location: "Amministrazione -> Impostazioni -> Checkout"
--- a/vendor/plugins/redmine_checkout/config/locales/ja.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -ja: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Display checkout information" - setting_checkout_fixed_url: "チェックアウト URL" - setting_checkout_url_regex: "Regular expression" - setting_checkout_url_regex_replacement: "Replacement text" - setting_checkout_display_login: "ログインの表示" - setting_checkout_command: "Checkout command" - setting_checkout_use_zero_clipboard: "Display clipboard helper" - - setting_checkout_overwrite_description: "Overwrite default description" - field_checkout_overwrite: "Overwrite default settings for checkout protocols" - field_checkout_display_command: "Display checkout command" - - label_protocol_plural: "Protocols" - button_add_protocol: "Add Protocol" - - label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' - label_access_read_only: 'Read-Only' - label_access_read_write: "Read+Write" - label_access_permission: "Depending on user's permissions" - - label_append_path: "Append path" - - label_display_login_none: "ログインとパスワードを非表示" - label_display_login_username: "ログインのみ表示" - label_display_login_password: "ログインとパスワードを表示" - - label_copy_to_clipboard: "Copy to clipboard" - - help_checkout_protocols: | - The URLs in protocols are generated from applying the regular expression - and the replacement text to the original URL. The replacement text - supports back-references to braced expressions using the \1 notation. - help_repository_checkout_protocols: | - Leave the Checkout URL field empty to use the defined repository URL. - help_moved_settings: "The settings page has been moved to {{link}}." - label_settings_location: "Administration -> Settings -> Checkout"
--- a/vendor/plugins/redmine_checkout/config/locales/ko.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -ko: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Display checkout information" - setting_checkout_fixed_url: "체크 아웃 URL" - setting_checkout_url_regex: "정규식" - setting_checkout_url_regex_replacement: "대체 문자열" - setting_checkout_display_login: "로그인 표시" - setting_checkout_command: "Checkout command" - setting_checkout_use_zero_clipboard: "Display clipboard helper" - - setting_checkout_overwrite_description: "Overwrite default description" - field_checkout_overwrite: "Overwrite default settings for checkout protocols" - field_checkout_display_command: "Display checkout command" - - label_protocol_plural: "Protocols" - button_add_protocol: "Add Protocol" - - label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' - label_access_read_only: 'Read-Only' - label_access_read_write: "Read+Write" - label_access_permission: "Depending on user's permissions" - - label_append_path: "Append path" - - label_display_login_none: "로그인과 비밀번호를 보여주지 않습니다." - label_display_login_username: "로그인은 보여주지만 비밀번호는 보여주지 않습니다." - label_display_login_password: "로그인과 비밀번호를 보여줍니다." - - label_copy_to_clipboard: "Copy to clipboard" - - help_checkout_protocols: | - The URLs in protocols are generated from applying the regular expression - and the replacement text to the original URL. The replacement text - supports back-references to braced expressions using the \1 notation. - help_repository_checkout_protocols: | - Leave the Checkout URL field empty to use the defined repository URL. - help_moved_settings: "The settings page has been moved to {{link}}." - label_settings_location: "Administration -> Settings -> Checkout" -
--- a/vendor/plugins/redmine_checkout/config/locales/nl.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -nl: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Checkout-informatie tonen" - setting_checkout_fixed_url: "Checkout-URL" - setting_checkout_url_regex: "Reguliere expressie" - setting_checkout_url_regex_replacement: "Vervangingstekst" - setting_checkout_display_login: "Geef login weer" - setting_checkout_command: "Checkout-opdracht" - setting_checkout_use_zero_clipboard: "Klembord-hulp tonen" - - setting_checkout_overwrite_description: "Standaard omschrijving overschrijven" - field_checkout_overwrite: "Overschrijf standaard instellingen voor checkout-protocollen" - field_checkout_display_command: "Checkout-opdracht tonen" - - label_protocol_plural: "Protocollen" - button_add_protocol: "Protocol toevoegen" - - label_access_type: 'Deze URL heeft <span id="checkout_access">{{type}}</span> toegang.' - label_access_read_only: 'Alleen lezen' - label_access_read_write: "Lezen en schrijven" - label_access_permission: "Afhankelijk van gebruikersrechten" - - label_append_path: "Pad toevoegen" - - label_display_login_none: "Geen logingegevens tonen" - label_display_login_username: "Toon login zonder wachtwoord" - label_display_login_password: "Toon login en wachtwoord" - - label_copy_to_clipboard: "Naar klembord kopiëren" - - help_checkout_protocols: | - De URLs in protocollen worden samengesteld vanuit de originele URL, na - toepassing van de reguliere expressie en vervangingstekst. De vervangingstekst - ondersteunt referenties vanuit tussen haakjes geplaatste expressies - door middel van de \1 notatie. - help_repository_checkout_protocols: | - Laat het veld Checkout-URL leeg om de projectrepository te gebruiken. - help_moved_settings: "De instellingspagina is verplaatst naar {{link}}." - label_settings_location: "Administratie -> Instellingen -> Checkout" \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/config/locales/pl.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -pl: - label_checkout: "Pobieranie repozytorium" - - setting_checkout_display_checkout_info: "Pokaż informację o możliwości pobrania repozytorium" - setting_checkout_fixed_url: "Adres URL pobierania repozytorium" - setting_checkout_url_regex: "Wyrażenie regularne" - setting_checkout_url_regex_replacement: "Wynikowy adres URL" - setting_checkout_display_login: "Pokaż dane logowania" - setting_checkout_command: "Komenda pobrania repozytorium" - setting_checkout_use_zero_clipboard: "Pokaż pomocnika schowka" - - setting_checkout_overwrite_description: "Nadpisz domyślny opis" - field_checkout_overwrite: "Nadpisz domyślne ustawienia dla protokołów" - field_checkout_display_command: "Pokaż komendę pobrania repozytorium" - - label_protocol_plural: "Protokoły" - button_add_protocol: "Dodaj protokół" - - label_access_type: 'Ten adres URL ma dostęp <span id="checkout_access">{{type}}</span>.' - label_access_read_only: 'Tylko do odczytu' - label_access_read_write: "Odczyt+Zapis" - label_access_permission: "Zależne od uprawnień użytkownika" - - label_append_path: "Dołącz ścieżkę" - - label_display_login_none: "Nie pokazuj loginu ani hasła" - label_display_login_username: "Pokaż tylko login" - label_display_login_password: "Pokaż login i hasło" - - label_copy_to_clipboard: "Kopiuj do schowka" - - help_checkout_protocols: | - Wynikowe adresy URL w protokołach są generowane przez zamianę oryginalnego - adresu URL repozytorium na podstawie wyrażenia regularnego. Wynikowy adres - URL wspiera referencje do grup (tzw. back-references) używając notacji \1. - help_repository_checkout_protocols: | - Pozostaw adres URL pobierania repozytorium pusty aby uzyć adresu zdefiniowanego w ustawieniach projektu. - help_moved_settings: "Ustawienia zostały przeniesione do {{link}}." - label_settings_location: "Administracja -> Ustawienia -> Pobieranie repozytorium"
--- a/vendor/plugins/redmine_checkout/config/locales/ro.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -ro: - label_checkout: "Checkout" - - setting_checkout_display_checkout_info: "Display checkout information" - setting_checkout_fixed_url: "URL-ul pentru checkout" - setting_checkout_url_regex: "Expresie regulata (regexp)" - setting_checkout_url_regex_replacement: "Text inlocuitor (regexp)" - setting_checkout_display_login: "Arata datele pentru autentificare" - setting_checkout_command: "Comanda de checkout" - setting_checkout_use_zero_clipboard: "Display clipboard helper" - - setting_checkout_overwrite_description: "Overwrite default description" - field_checkout_overwrite: "Overwrite default settings for checkout protocols" - field_checkout_display_command: "Display checkout command" - - label_protocol_plural: "Protocols" - button_add_protocol: "Add Protocol" - - label_access_type: 'This URL has <span id="checkout_access">{{type}}</span> access.' - label_access_read_only: 'Read-Only' - label_access_read_write: "Read+Write" - label_access_permission: "Depending on user's permissions" - - label_append_path: "Append path" - - label_display_login_none: "Nu afisa username sau parola" - label_display_login_username: "Afiseaza username-ul, dar nu si parola" - label_display_login_password: "Afiseaza atat username-ul, cat si parola" - - label_copy_to_clipboard: "Copy to clipboard" - - help_checkout_protocols: | - The URLs in protocols are generated from applying the regular expression - and the replacement text to the original URL. The replacement text - supports back-references to braced expressions using the \1 notation. - help_repository_checkout_protocols: | - Leave the Checkout URL field empty to use the defined repository URL. - help_moved_settings: "The settings page has been moved to {{link}}." - label_settings_location: "Administration -> Settings -> Checkout"
--- a/vendor/plugins/redmine_checkout/db/migrate/20091208210439_add_checkout_url_info.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -class AddCheckoutUrlInfo < ActiveRecord::Migration - def self.up - add_column :repositories, :checkout_url_type, :string, :default => 'none', :null => false - add_column :repositories, :checkout_url, :string, :default => '', :null => false - end - - def self.down - remove_column :repository, :checkout_url_type - remove_column :repository, :checkout_url - end -end
--- a/vendor/plugins/redmine_checkout/db/migrate/20091220173312_add_display_login.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -class AddDisplayLogin < ActiveRecord::Migration - def self.up - add_column :repositories, :display_login, :string, :default => 'none', :null => false - end - - def self.down - remove_column :repositories, :display_login - end -end
--- a/vendor/plugins/redmine_checkout/db/migrate/20100118174556_add_render_link.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -class AddRenderLink < ActiveRecord::Migration - def self.up - add_column :repositories, :render_link, :boolean, :null => true - end - - def self.down - remove_column :repositories, :render_link - end -end \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/db/migrate/20100118235845_remove_defaults.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -class RemoveDefaults < ActiveRecord::Migration - def self.up - change_column :repositories, :checkout_url_type, :string, :default => nil, :null => true - change_column :repositories, :checkout_url, :string, :default => nil, :null => true - change_column :repositories, :display_login, :string, :default => nil, :null => true - end - - def self.down - change_column :repositories, :checkout_url_type, :string, :default => 'none', :null => false - change_column :repositories, :checkout_url, :string, :default => '', :null => false - change_column :repositories, :display_login, :string, :default => 'none', :null => false - end -end -
--- a/vendor/plugins/redmine_checkout/db/migrate/20100118235909_add_overwrite_option.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -class AddOverwriteOption < ActiveRecord::Migration - def self.up - add_column :repositories, :checkout_url_overwrite, :boolean, :default => false, :null => false - - # existing repositories are set to overwrite the default settings - # This is to keep continuity of settings. - Repository.reset_column_information - Repository.update_all({:checkout_url_overwrite, true}) - end - - def self.down - remove_column :repositories, :checkout_url_overwrite - end -end -
--- a/vendor/plugins/redmine_checkout/db/migrate/20100203202320_update_settings.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -class UpdateSettings < ActiveRecord::Migration - def self.up - settings = Setting.plugin_redmine_checkout - if settings['checkout_url_type'] == "overwritten" - settings['checkout_url_type'] = "generated" - end - - if settings.has_key? "checkout_url_regex" - settings['checkout_url_regex_default'] = settings.delete("checkout_url_regex") - end - - if settings.has_key? "checkout_url_regex_replacement" - settings['checkout_url_regex_replacement_default'] = settings.delete("checkout_url_regex_replacement") - end - - Setting.plugin_redmine_checkout = settings - end - - def self.down - settings = Setting.plugin_redmine_checkout - if settings['checkout_url_type'] == "generated" - settings['checkout_url_type'] = "overwritten" - end - - if settings.has_key? "checkout_url_regex_default" - settings['checkout_url_regex'] = settings.delete("checkout_url_regex_default") - end - - if settings.has_key? "checkout_url_regex_replacement_default" - settings['checkout_url_regex_replacement'] = settings.delete("checkout_url_regex_replacement_default") - end - - Setting.plugin_redmine_checkout = settings - end -end -
--- a/vendor/plugins/redmine_checkout/db/migrate/20100426154202_rename_render_link_to_render_type.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -class RenameRenderLinkToRenderType < ActiveRecord::Migration - def self.up - render_link = Setting.plugin_redmine_checkout.delete 'render_link' - unless render_link.nil? - Setting.plugin_redmine_checkout['render_type'] = (render_link == 'true' ? 'link' : 'url') - Setting.plugin_redmine_checkout = Setting.plugin_redmine_checkout - end - - add_column :repositories, :render_type, :string, :default => 'url', :null => false - - Repository.update_all({:render_type => 'link'}, :render_link => true) - Repository.update_all({:render_type => 'url'}, ["render_link != ?", true]) - - remove_column :repositories, :render_link - end - - def self.down - render_type = Setting.plugin_redmine_checkout.delete 'render_type' - unless render_type.nil? - Setting.plugin_redmine_checkout['render_link'] = (render_type == 'link' ? 'true' : 'false') - Setting.plugin_redmine_checkout = Setting.plugin_redmine_checkout - end - - add_column :repositories, :render_link, :boolean, :null => true - - Repository.update_all({:render_link => true}, :render_type => 'link') - Repository.update_all({:render_link => false}, ["render_type != ?", 'link']) - - remove_column :repositories, :render_type - end -end
--- a/vendor/plugins/redmine_checkout/db/migrate/20100512135418_consolidate_repository_options.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -class ConsolidateRepositoryOptions < ActiveRecord::Migration - class Repository < ActiveRecord::Base - def self.inheritance_column - # disable single table inheritance - nil - end - - serialize :checkout_settings, Hash - end - - def self.up - add_column :repositories, :checkout_settings, :text - - Repository.all.each do |r| - r.checkout_settings = { - "checkout_url_type" => r.checkout_url_type, - "checkout_url" => r.checkout_url, - "display_login" => r.display_login, - "render_type" => r.render_type, - "checkout_url_overwrite" => r.checkout_url_overwrite - } - r.save! - end - remove_column :repositories, :checkout_url_type - remove_column :repositories, :checkout_url - remove_column :repositories, :display_login - remove_column :repositories, :render_type - remove_column :repositories, :checkout_url_overwrite - end - - def self.down - add_column :repositories, :checkout_url_type, :string, :default => nil, :null => true - add_column :repositories, :checkout_url, :string, :default => nil, :null => true - add_column :repositories, :display_login, :string, :default => nil, :null => true - add_column :repositories, :render_type, :string, :default => 'url', :null => false - add_column :repositories, :checkout_url_overwrite, :boolean, :default => false, :null => false - - Repository.all.each do |r| - r.checkout_url_type = r.checkout_settings["checkout_url_type"] - r.checkout_url = r.checkout_settings["checkout_url"] - r.display_login = r.checkout_settings["display_login"] - r.render_link = r.checkout_settings["render_link"] - r.checkout_url_overwrite = r.checkout_settings["checkout_url_overwrite"] - r.save! - end - - remove_column :repositories, :checkout_settings - end -end
--- a/vendor/plugins/redmine_checkout/db/migrate/20100609153630_apply_setting_changes.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -class ApplySettingChanges < ActiveRecord::Migration - class Repository < ActiveRecord::Base - def self.inheritance_column - # disable single table inheritance - nil - end - - def scm_name - self.type || 'Abstract' - end - - serialize :checkout_settings, Hash - end - - def self.up - default_commands = { - 'Bazaar' => 'bzr checkout', - 'Cvs' => 'cvs checkout', - 'Darcs' => 'darcs get', - 'Git' => 'git clone', - 'Mercurial' => 'hg clone', - 'Subversion' => 'svn checkout' - } - - ## First migrate the individual repositories - - Repository.all.each do |r| - allow_subtree_checkout = ['Cvs', 'Subversion'].include? r.scm_name - - protocol = case r.checkout_settings['checkout_url_type'] - when 'none', 'generated' - nil - when 'original', 'overwritten' - HashWithIndifferentAccess.new({ "0" => HashWithIndifferentAccess.new({ - :protocol => r.scm_name, - :command => Setting.plugin_redmine_checkout["checkout_cmd_#{r.scm_name}"] || default_commands[r.scm_name], - :regex => "", - :regex_replacement => "", - :fixed_url => (r.checkout_settings['checkout_url_type'] == 'original' ? (r.url || "") : r.checkout_settings["checkout_url"]), - :access => 'permission', - :append_path => (allow_subtree_checkout ? '1' : '0'), - :is_default => '1'}) - }) - end - - r.checkout_settings = Hash.new({ - 'checkout_protocols' => protocol, - 'checkout_description' => "The data contained in this repository can be downloaded to your computer using one of several clients. -Please see the documentation of your version control software client for more information. - -Please select the desired protocol below to get the URL.", - 'checkout_display_login' => (r.checkout_settings['display_login'] == 'none' ? '' : r.checkout_settings['display_login']), - 'checkout_overwrite' => (r.checkout_settings['checkout_url_overwrite'] == 'true') ? '1': '0', - 'checkout_display_command' => (r.checkout_settings["render_type"].to_s == 'cmd') ? '1' : '0' - }) - r.save! - end - - ## Then the global settings - - settings = HashWithIndifferentAccess.new({ - 'display_login' => Setting.plugin_redmine_checkout['display_login'], - 'use_zero_clipboard' => '1', - - 'display_checkout_info' => (Setting.plugin_redmine_checkout['checkout_url_type'] == 'none' ? '0' : '1'), - 'description_Abstract' => <<-EOF -The data contained in this repository can be downloaded to your computer using one of several clients. -Please see the documentation of your version control software client for more information. - -Please select the desired protocol below to get the URL. -EOF - }) - - default_commands.keys.each do |scm| - settings["description_#{scm}"] = '' - settings["overwrite_description_#{scm}"] = '0' - - display_command = (Setting.plugin_redmine_checkout["render_type"].to_s == 'cmd') ? '1' : '0' - settings["display_command_#{scm}"] = display_command - - case Setting.plugin_redmine_checkout['checkout_url_type'] - when 'generated', 'none': - regex = Setting.plugin_redmine_checkout["checkout_url_regex_#{scm}"] - replacement = Setting.plugin_redmine_checkout["checkout_url_regex_replacement_#{scm}"] - when 'original': - regex = '' - replacement = '' - end - - settings["protocols_#{scm}"] = HashWithIndifferentAccess.new({ - # access can be one of - # read+write => this protocol always allows read/write access - # read-only => this protocol always allows read access only - # permission => Access depends on redmine permissions - '0' => HashWithIndifferentAccess.new({ - :protocol => scm, - :command => Setting.plugin_redmine_checkout["checkout_cmd_#{scm}"] || default_commands[scm], - :regex => regex, - :regex_replacement => replacement, - :fixed_url => '', - :access => 'permission', - :append_path => (['Cvs', 'Subversion'].include?(scm) ? '1' : '0'), - :is_default => '1' - }) - }) - end - Setting.plugin_redmine_checkout = settings - end - - def self.down - raise ActiveRecord::IrreversibleMigration.new "Sorry, there is no down migration yet. If you really need one, please create an issue on http://dev.holgerjust.de/projects/redmine-checkout" - end -end \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/db/migrate/20100808185600_change_protocol_storage_from_hash_to_array.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -class ChangeProtocolStorageFromHashToArray < ActiveRecord::Migration - class Repository < ActiveRecord::Base - def self.inheritance_column - # disable single table inheritance - nil - end - - def scm_name - self.type || 'Abstract' - end - - serialize :checkout_settings, Hash - end - - def self.up - ## First migrate the individual repositories - Repository.all.each do |r| - next unless r.checkout_settings - next unless r.checkout_settings['checkout_protocols'].is_a? Hash - r.checkout_settings['checkout_protocols'] = r.checkout_settings['checkout_protocols'].sort{|(ak,av),(bk,bv)|ak<=>bk}.collect{|id,protocol| protocol} - r.save! - end - - ## Then the global settings - settings = Setting.plugin_redmine_checkout - settings.keys.grep(/^protocols_/).each do |protocols| - next unless settings[protocols].is_a? Hash - settings[protocols] = settings[protocols].sort{|(ak,av),(bk,bv)|ak<=>bk}.collect{|id,protocol| protocol} - end - Setting.plugin_redmine_checkout = settings - end - - def self.down - ## First migrate the individual repositories - Repository.all.each do |r| - next unless r.checkout_settings['checkout_protocols'].is_a? Hash - r.checkout_settings['checkout_protocols'] = r.checkout_settings['checkout_protocols'].inject(HashWithIndifferentAccess.new) do |result, p| - result[result.length.to_s] = p - end - r.save! - end - - ## Then the global settings - settings = Setting.plugin_redmine_checkout - settings.keys.grep(/^protocols_/).each do |protocols| - next unless r.checkout_settings['checkout_protocols'].is_a? Hash - settings[protocols] = settings[protocols].inject(HashWithIndifferentAccess.new) do |result, p| - result[result.length.to_s] = p - end - end - Setting.plugin_redmine_checkout = settings - - - - - raise ActiveRecord::IrreversibleMigration.new "Sorry, there is no down migration yet. If you really need one, please create an issue on http://dev.holgerjust.de/projects/redmine-checkout" - end -end
--- a/vendor/plugins/redmine_checkout/doc/COPYING Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -Copyright (c) 2009 Holger Just - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE.
--- a/vendor/plugins/redmine_checkout/init.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -require 'redmine' - -require 'dispatcher' -Dispatcher.to_prepare do - # Patches - require_dependency 'checkout/settings_controller_patch' - - require_dependency 'checkout/repositories_helper_patch' - require_dependency 'checkout/repository_patch' - - require_dependency 'checkout/settings_helper_patch' - require_dependency 'checkout/setting_patch' -end - -# Hooks -require 'checkout/repository_hooks' - -Redmine::Plugin.register :redmine_checkout do - name 'Redmine Checkout plugin' - url 'http://dev.holgerjust.de/projects/redmine-checkout' - author 'Holger Just' - author_url 'http://meine-er.de' - description 'Add links to the actual repository to the repository view.' - version '0.5' - - requires_redmine :version_or_higher => '0.9' - - settings_defaults = HashWithIndifferentAccess.new({ - 'display_login' => nil, - 'use_zero_clipboard' => '1', - - 'display_checkout_info' => '1', - 'description_Abstract' => <<-EOF -The data contained in this repository can be downloaded to your computer using one of several clients. -Please see the documentation of your version control software client for more information. - -Please select the desired protocol below to get the URL. -EOF - }) - - # this is needed for setting the defaults - require 'checkout/repository_patch' - - CheckoutHelper.supported_scm.each do |scm| - klazz = "Repository::#{scm}".constantize - - settings_defaults["description_#{scm}"] = '' - settings_defaults["overwrite_description_#{scm}"] = '0' - settings_defaults["display_command_#{scm}"] = '0' - - # access can be one of - # read+write => this protocol always allows read/write access - # read-only => this protocol always allows read access only - # permission => Access depends on redmine permissions - settings_defaults["protocols_#{scm}"] = [HashWithIndifferentAccess.new({ - :protocol => scm, - :command => klazz.checkout_default_command, - :regex => '', - :regex_replacement => '', - :fixed_url => '', - :access => 'permission', - :append_path => (klazz.allow_subtree_checkout? ? '1' : '0'), - :is_default => '1' - })] - end - - settings :default => settings_defaults, :partial => 'settings/redmine_checkout' - - Redmine::WikiFormatting::Macros.register do - desc <<-EOF -Creates a checkout link to the actual repository. Example: - - use the default checkout protocol !{{repository}} - or use a specific protocol !{{repository(SVN)}} - or use the checkout protocol of a specific specific project: !{{repository(projectname:SVN)}}" -EOF - - macro :repository do |obj, args| - proto = args.first - if proto.to_s =~ %r{^([^\:]+)\:(.*)$} - project_identifier, proto = $1, $2 - project = Project.find_by_identifier(project_identifier) || Project.find_by_name(project_identifier) - else - project = @project - end - - if project && project.repository - protocols = project.repository.checkout_protocols.select{|p| p.access_rw(User.current)} - - if proto.present? - proto_obj = protocols.find{|p| p.protocol.downcase == proto.downcase} - else - proto_obj = protocols.find(&:default?) || protocols.first - end - end - raise "Checkout protocol #{proto} not found" unless proto_obj - - cmd = (project.repository.checkout_display_command? && proto_obj.command.present?) ? proto_obj.command.strip + " " : "" - cmd + link_to(proto_obj.url, proto_obj.url) - end - end -end \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/lib/checkout/protocol.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -module Checkout - class <<self - def awesome? - # Yes, this plugin is awesome! - true - end - end - - class Protocol - attr_accessor :protocol, :regex, :regex_replacement, :access, :repository - attr_writer :default, :command, :fixed_url, :append_path - - - def initialize(args={}) - args = args.dup - - @protocol = args.delete :protocol - @command = args.delete :command # optional, if not set the default from the repo is used - - # either a fixed url - @fixed_url = args.delete :fixed_url - - # or a regex - @regex = args.delete :regex - @regex_replacement = args.delete :regex_replacement - - @access = args.delete :access - @append_path = args.delete :append_path - @default = args.delete :is_default - - @repository = args.delete :repository - end - - def full_command(path = "") - cmd = "" - if repository.checkout_display_command? - cmd = self.command.present? ? self.command.strip + " " : "" - end - cmd + URI.escape(self.url(path)) - end - - def default? - @default.to_i > 0 - end - - def command - @command || self.repository && self.repository.checkout_default_command || "" - end - - def append_path? - @append_path.to_i > 0 - end - - def access_rw(user) - # reduces the three available access levels 'read+write', 'read-only' and 'permission' - # to 'read+write' and 'read-only' and nil (not allowed) - - @access_rw ||= {} - return @access_rw[user] if @access_rw.key? user - @access_rw[user] = case access - when 'permission' - case - when user.allowed_to?(:commit_access, repository.project) && user.allowed_to?(:browse_repository, repository.project) - 'read+write' - when user.allowed_to?(:browse_repository, repository.project) - 'read-only' - else - nil - end - else - @access - end - end - - def access_label(user) - case access_rw(user) - when 'read+write': :label_access_read_write - when 'read-only': :label_access_read_only - end - end - - def fixed_url - @fixed_url.present? ? @fixed_url : begin - if (regex.blank? || regex_replacement.blank?) - repository.url - else - repository.url.gsub(Regexp.new(regex), regex_replacement) - end - end - rescue RegexpError - repository.url || "" - end - - def url(path = "") - return "" unless repository - - url = fixed_url.sub(/\/+$/, "") - if repository.allow_subtree_checkout? && self.append_path? && path.present? - url = "#{url}/#{path}" - end - - if repository.checkout_display_login? - begin - uri = URI.parse url - (uri.user = repository.login) if repository.login - (uri.password = repository.password) if (repository.checkout_display_login == 'password' && repository.login && repository.password) - url = uri.to_s - rescue URI::InvalidURIError - end - end - url - end - end -end \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/lib/checkout/repositories_helper_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -require_dependency 'repositories_helper' - -module Checkout - module RepositoriesHelperPatch - def self.included(base) # :nodoc: - base.send(:include, InstanceMethods) - - base.class_eval do - alias_method_chain :repository_field_tags, :checkout - alias_method_chain :scm_select_tag, :javascript - end - end - - module InstanceMethods - def repository_field_tags_with_checkout(form, repository) - tags = repository_field_tags_without_checkout(form, repository) || "" - return tags if repository.class.name == "Repository" - - tags + @controller.send(:render_to_string, :partial => 'projects/settings/repository_checkout', :locals => {:form => form, :repository => repository, :scm => repository.scm_name}) - end - - def scm_select_tag_with_javascript(*args) - content_for :header_tags do - javascript_include_tag('subform', :plugin => 'redmine_checkout') + - stylesheet_link_tag('checkout', :plugin => 'redmine_checkout') - end - scm_select_tag_without_javascript(*args) - end - end - end -end - -RepositoriesHelper.send(:include, Checkout::RepositoriesHelperPatch) -
--- a/vendor/plugins/redmine_checkout/lib/checkout/repository_hooks.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -module Checkout - class RepositoryHooks < Redmine::Hook::ViewListener - # Renders the checkout URL - # - # Context: - # * :project => Current project - # * :repository => Current Repository - # - def view_repositories_show_contextual(context={}) - if context[:repository].present? && Setting.checkout_display_checkout_info? - protocols = context[:repository].checkout_protocols.select do |p| - p.access_rw(User.current) - end - - path = context[:controller].instance_variable_get("@path") - if path && context[:controller].instance_variable_get("@entry") - # a single file is showing, so we return only the directory - path = File.dirname(path) - end - - default = protocols.find(&:default?) || protocols.first - - context.merge!({ - :protocols => protocols, - :default_protocol => default, - :checkout_path => path - }) - - options = {:partial => "redmine_checkout_hooks/view_repositories_show_contextual"} - context[:controller].send(:render_to_string, {:locals => context}.merge(options)) - end - end - end -end \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/lib/checkout/repository_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -require_dependency 'repository' -require_dependency 'checkout_helper' - -module Checkout - module RepositoryPatch - def self.included(base) # :nodoc: - base.extend(ClassMethods) - base.send(:include, InstanceMethods) - - base.class_eval do - unloadable - serialize :checkout_settings, Hash - end - end - - module ClassMethods - def allow_subtree_checkout? - # default implementation - false - end - - def checkout_default_command - # default implementation - "" - end - end - - module InstanceMethods - def after_initialize - self.checkout_settings ||= {} - end - - def checkout_overwrite=(value) - checkout_settings['checkout_overwrite'] = value - end - - def checkout_overwrite - (checkout_settings['checkout_overwrite'].to_i > 0) ? '1' : '0' - end - - def checkout_overwrite? - self.scm_name != 'Abstract' && checkout_overwrite.to_i > 0 - end - - def checkout_description=(value) - checkout_settings['checkout_description'] = value - end - - def checkout_description - if checkout_overwrite? - checkout_settings['checkout_description'] - else - if CheckoutHelper.supported_scm.include?(scm_name) && Setting.send("checkout_overwrite_description_#{scm_name}?") - Setting.send("checkout_description_#{scm_name}") - else - Setting.send("checkout_description_Abstract") - end - end - end - - def checkout_protocols - @checkout_protocols ||= begin - if CheckoutHelper.supported_scm.include? scm_name - if checkout_overwrite? - protocols = checkout_settings['checkout_protocols'] || [] - else - protocols = Setting.send("checkout_protocols_#{scm_name}") || [] - end - else - protocols = [] - end - - protocols.collect do |p| - Checkout::Protocol.new p.merge({:repository => self}) - end - end - end - - def checkout_protocols=(value) - # value is an Array or a Hash - if value.is_a? Hash - value = value.dup.delete_if {|id, protocol| id.to_i < 0 } - value = value.sort{|(ak,av),(bk,bv)|ak<=>bk}.collect{|id,protocol| protocol} - end - - checkout_settings['checkout_protocols'] = value - end - - def checkout_display_login - if checkout_overwrite? && self.scm_name == "Subversion" - result = checkout_settings['checkout_display_login'] - else - result = Setting.checkout_display_login - end - (result.to_i > 0) ? '1' : '0' - end - - def checkout_display_login? - checkout_display_login.to_i > 0 - end - - def checkout_display_login=(value) - value = nil unless self.scm_name == "Subversion" - checkout_settings['checkout_display_login'] = value - end - - def checkout_display_command? - checkout_display_command.to_i > 0 - end - - def checkout_display_command=(value) - checkout_settings['checkout_display_command'] = value - end - - def checkout_display_command - if checkout_overwrite? - checkout_settings['checkout_display_command'] - else - Setting.send("checkout_display_command_#{scm_name}") - end - end - - def allow_subtree_checkout? - self.class.allow_subtree_checkout? - end - - def checkout_default_command - self.class.checkout_default_command - end - end - end -end - -Repository.send(:include, Checkout::RepositoryPatch) - -subtree_checkout_repos = ["Subversion", "Cvs"] -commands = { - 'Bazaar' => 'bzr checkout', - 'Cvs' => 'cvs checkout', - 'Darcs' => 'darcs get', - 'Git' => 'git clone', - 'Mercurial' => 'hg clone', - 'Subversion' => 'svn checkout' -} - -CheckoutHelper.supported_scm.each do |scm| - require_dependency "repository/#{scm.underscore}" - cls = Repository.const_get(scm) - - allow_subtree_checkout = "" - if subtree_checkout_repos.include? scm - allow_subtree_checkout = <<-EOS - def allow_subtree_checkout? - true - end - EOS - end - - checkout_command = "" - if commands[scm] - checkout_command = <<-EOS - def checkout_default_command - '#{commands[scm]}' - end - EOS - end - - class_mod = Module.new - class_mod.module_eval(<<-EOF - def self.included(base) - base.extend ChildClassMethods - - base.class_eval do - unloadable - serialize :checkout_settings, Hash - end - end - - module ChildClassMethods - #{allow_subtree_checkout} - #{checkout_command} - end - EOF - ) - cls.send(:include, class_mod) -end
--- a/vendor/plugins/redmine_checkout/lib/checkout/setting_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -require_dependency 'setting' - -module Checkout - module SettingPatch - def self.included(base) # :nodoc: - base.extend(ClassMethods) - - base.class_eval do - unloadable - - # Defines getter and setter for each setting - # Then setting values can be read using: Setting.some_setting_name - # or set using Setting.some_setting_name = "some value" - Redmine::Plugin.find(:redmine_checkout).settings[:default].keys.each do |name| - if name.start_with?('protocols_') - default = "[]" - else - default = <<-END_SRC - begin - default = Setting.available_settings['plugin_redmine_checkout']['default']['#{name}'] - # perform a deep copy of the default - Marshal::load(Marshal::dump(default)) - end - END_SRC - end - - src = <<-END_SRC - def self.checkout_#{name} - self.plugin_redmine_checkout[:#{name}] || #{default} - end - - def self.checkout_#{name}? - self.checkout_#{name}.to_i > 0 - end - - def self.checkout_#{name}=(value) - setting = Setting.plugin_redmine_checkout - setting[:#{name}] = value - Setting.plugin_redmine_checkout = setting - end - END_SRC - class_eval src, __FILE__, __LINE__ - end - - class <<self - alias_method :store_without_checkout, :[]= - alias_method :[]=, :store_with_checkout - - alias_method :retrieve_without_checkout, :[] - alias_method :[], :retrieve_with_checkout - end - end - end - - module ClassMethods - def store_with_checkout(name, value) - if name.to_s.starts_with? "checkout_" - self.send("#{name}=", value) - else - store_without_checkout(name, value) - end - end - - def retrieve_with_checkout(name) - if name.to_s.starts_with? "checkout_" - self.send("#{name}") - else - retrieve_without_checkout(name) - end - end - end - end -end - -Setting.send(:include, Checkout::SettingPatch) \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/lib/checkout/settings_controller_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -require_dependency 'settings_controller' - -module Checkout - module SettingsControllerPatch - def self.included(base) # :nodoc: - base.send(:include, InstanceMethods) - - base.class_eval do - unloadable - - alias_method_chain :edit, :checkout - end - end - - module InstanceMethods - def edit_with_checkout - if request.post? && params['tab'] == 'checkout' - if params[:settings] && params[:settings].is_a?(Hash) - settings = HashWithIndifferentAccess.new - (params[:settings] || {}).each do |name, value| - if name = name.to_s.slice(/checkout_(.+)/, 1) - case value - when Array - # remove blank values in array settings - value.delete_if {|v| v.blank? } - when Hash - # change protocols hash to array. - value = value.sort{|(ak,av),(bk,bv)|ak<=>bk}.collect{|id,protocol| protocol} if name.start_with? "protocols_" - end - settings[name.to_sym] = value - end - end - - Setting.plugin_redmine_checkout = settings - params[:settings] = {} - end - end - edit_without_checkout - end - end - end -end - -SettingsController.send(:include, Checkout::SettingsControllerPatch)
--- a/vendor/plugins/redmine_checkout/lib/checkout/settings_helper_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -require_dependency 'settings_helper' - -module Checkout - module SettingsHelperPatch - def self.included(base) # :nodoc: - base.send(:include, InstanceMethods) - - base.class_eval do - alias_method_chain :administration_settings_tabs, :checkout - end - end - - module InstanceMethods - def administration_settings_tabs_with_checkout - tabs = administration_settings_tabs_without_checkout - tabs << {:name => 'checkout', :partial => 'settings/checkout', :label => :label_checkout} - end - end - end -end - -SettingsHelper.send(:include, Checkout::SettingsHelperPatch) -
--- a/vendor/plugins/redmine_checkout/lib/checkout_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -module CheckoutHelper - class <<self - def supported_scm - Object.const_defined?("REDMINE_SUPPORTED_SCM") ? REDMINE_SUPPORTED_SCM : Redmine::Scm::Base.all - end - end -end
--- a/vendor/plugins/redmine_checkout/lib/tasks/set_default.rake Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -namespace :redmine do - namespace :plugins do - namespace :redmine_checkout do - desc "Sets all repositories to inherit the default setting for the checkout URL." - task :set_default => :environment do - Repository.all.each{|r| r.update_attributes(:checkout_overwrite => "0")} - end - end - end -end
--- a/vendor/plugins/redmine_checkout/lib/tasks/spec.rake Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -begin - require "spec/rake/spectask" - namespace :spec do - namespace :plugins do - desc "Runs the examples for redmine_checkout" - Spec::Rake::SpecTask.new(:redmine_checkout) do |t| - t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""] - t.spec_files = FileList['vendor/plugins/redmine_checkout/spec/**/*_spec.rb'] - end - end - end - task :spec => "spec:plugins:redmine_checkout" -rescue LoadError -end \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/spec/controllers/repositories_controller_spec.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') - -describe RepositoriesController do - fixtures :settings, :repositories, :projects, :roles, :users, :enabled_modules - integrate_views - - before(:each) do - Setting.default_language = 'en' - User.current = nil - end - - def get_repo - get :show, :id => 1 - end - - it "should display the protocol selector" do - get_repo - response.should be_success - response.should render_template('show') - - response.should have_tag('ul#checkout_protocols') do - with_tag('a[id=?][href=?]', 'checkout_protocol_subversion', "file:///#{RAILS_ROOT.gsub(%r{config\/\.\.}, '')}/tmp/test/subversion_repository") - with_tag('a[id=?][href=?]', 'checkout_protocol_svn+ssh', 'svn+ssh://subversion_repository@svn.foo.bar/svn') - end - end - - it "should display the description" do - get_repo - response.should be_success - response.should render_template('show') - - response.should have_tag('div.repository-info', /Please select the desired protocol below to get the URL/) - end - - it 'should respect the use zero clipboard option' do - Setting.checkout_use_zero_clipboard = '1' - get_repo - response.should be_success - response.should render_template('show') - response.should have_tag('script[src*=?]', 'ZeroClipboard') - - Setting.checkout_use_zero_clipboard = '0' - get_repo - response.should be_success - response.should render_template('show') - response.should_not have_tag('script[src*=]', 'ZeroClipboard') - end -end
--- a/vendor/plugins/redmine_checkout/spec/fixtures/enabled_modules.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ ---- -enabled_modules_001: - name: repository - project_id: 1 - id: 1
--- a/vendor/plugins/redmine_checkout/spec/fixtures/projects.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ ---- -projects_001: - created_on: 2006-07-19 19:13:59 +02:00 - name: eCookbook - updated_on: 2006-07-19 22:53:01 +02:00 - id: 1 - description: Recipes management application - homepage: http://ecookbook.somenet.foo/ - is_public: true - identifier: ecookbook - parent_id: - lft: 1 - rgt: 10
--- a/vendor/plugins/redmine_checkout/spec/fixtures/repositories.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ ---- -svn: - project_id: 1 - url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository - id: 1 - root_url: file:///<%= RAILS_ROOT.gsub(%r{config\/\.\.}, '') %>/tmp/test/subversion_repository - password: "" - login: "" - type: Subversion
--- a/vendor/plugins/redmine_checkout/spec/fixtures/roles.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ ---- -roles_001: - name: Manager - id: 1 - builtin: 0 - permissions: | - --- - - :add_project - - :edit_project - - :manage_members - - :manage_versions - - :manage_categories - - :view_issues - - :add_issues - - :edit_issues - - :manage_issue_relations - - :manage_subtasks - - :add_issue_notes - - :move_issues - - :delete_issues - - :view_issue_watchers - - :add_issue_watchers - - :delete_issue_watchers - - :manage_public_queries - - :save_queries - - :view_gantt - - :view_calendar - - :log_time - - :view_time_entries - - :edit_time_entries - - :delete_time_entries - - :manage_news - - :comment_news - - :view_documents - - :manage_documents - - :view_wiki_pages - - :export_wiki_pages - - :view_wiki_edits - - :edit_wiki_pages - - :delete_wiki_pages_attachments - - :protect_wiki_pages - - :delete_wiki_pages - - :rename_wiki_pages - - :add_messages - - :edit_messages - - :delete_messages - - :manage_boards - - :view_files - - :manage_files - - :browse_repository - - :manage_repository - - :view_changesets - - :manage_project_activities - - position: 1 -roles_002: - name: Developer - id: 2 - builtin: 0 - permissions: | - --- - - :edit_project - - :manage_members - - :manage_versions - - :manage_categories - - :view_issues - - :add_issues - - :edit_issues - - :manage_issue_relations - - :manage_subtasks - - :add_issue_notes - - :move_issues - - :delete_issues - - :view_issue_watchers - - :save_queries - - :view_gantt - - :view_calendar - - :log_time - - :view_time_entries - - :edit_own_time_entries - - :manage_news - - :comment_news - - :view_documents - - :manage_documents - - :view_wiki_pages - - :view_wiki_edits - - :edit_wiki_pages - - :protect_wiki_pages - - :delete_wiki_pages - - :add_messages - - :edit_own_messages - - :delete_own_messages - - :manage_boards - - :view_files - - :manage_files - - :browse_repository - - :view_changesets - - position: 2 -roles_003: - name: Reporter - id: 3 - builtin: 0 - permissions: | - --- - - :edit_project - - :manage_members - - :manage_versions - - :manage_categories - - :view_issues - - :add_issues - - :edit_issues - - :manage_issue_relations - - :add_issue_notes - - :move_issues - - :view_issue_watchers - - :save_queries - - :view_gantt - - :view_calendar - - :log_time - - :view_time_entries - - :manage_news - - :comment_news - - :view_documents - - :manage_documents - - :view_wiki_pages - - :view_wiki_edits - - :edit_wiki_pages - - :delete_wiki_pages - - :add_messages - - :manage_boards - - :view_files - - :manage_files - - :browse_repository - - :view_changesets - - position: 3 -roles_004: - name: Non member - id: 4 - builtin: 1 - permissions: | - --- - - :view_issues - - :add_issues - - :edit_issues - - :manage_issue_relations - - :add_issue_notes - - :move_issues - - :save_queries - - :view_gantt - - :view_calendar - - :log_time - - :view_time_entries - - :comment_news - - :view_documents - - :manage_documents - - :view_wiki_pages - - :view_wiki_edits - - :edit_wiki_pages - - :add_messages - - :view_files - - :manage_files - - :browse_repository - - :view_changesets - - position: 4 -roles_005: - name: Anonymous - id: 5 - builtin: 2 - permissions: | - --- - - :view_issues - - :add_issue_notes - - :view_gantt - - :view_calendar - - :view_time_entries - - :view_documents - - :view_wiki_pages - - :view_wiki_edits - - :view_files - - :browse_repository - - :view_changesets - - position: 5 -
--- a/vendor/plugins/redmine_checkout/spec/fixtures/settings.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ ---- - settings: - name: plugin_redmine_checkout - value: | - --- !map:HashWithIndifferentAccess - display_checkout_info: "1" - description_Abstract: | - The data contained in this repository can be downloaded to your computer using one of several clients. - Please see the documentation of your version control software client for more information. - - Please select the desired protocol below to get the URL. - display_command_Bazaar: '1' - use_zero_clipboard: "1" - - overwrite_description_Bazaar: "0" - description_Bazaar: "" - display_command_Bazaar: '1' - protocols_Bazaar: - "0": !map:HashWithIndifferentAccess - command: "bzr checkout" - regex: "" - regex_replacement: "" - read_write: readwrite - append_path: "0" - is_default: "1" - protocol: Bazaar - overwrite_description_Cvs: "0" - description_Cvs: "" - display_command_Cvs: '1' - protocols_Cvs: - "0": !map:HashWithIndifferentAccess - command: "cvs checkout" - regex: "" - regex_replacement: "" - read_write: readwrite - append_path: "0" - is_default: "1" - protocol: Cvs - overwrite_description_Darcs: "0" - description_Darcs: "" - display_command_Darcs: '1' - protocols_Darcs: - "0": !map:HashWithIndifferentAccess - command: "darcs get" - regex: "" - regex_replacement: "" - read_write: readwrite - append_path: "0" - is_default: "1" - protocol: Darcs - overwrite_description_Filesystem: "0" - description_Filesystem: "" - display_command_Filesystem: '1' - protocols_Filesystem: !map:HashWithIndifferentAccess - "0": !map:HashWithIndifferentAccess - command: "" - regex: "" - append_path: "0" - is_default: "1" - protocol: Filesystem - access: read+write - regex_replacement: "" - overwrite_description_Git: "0" - description_Git: "" - display_command_Git: '1' - protocols_Git: !map:HashWithIndifferentAccess - "0": !map:HashWithIndifferentAccess - command: "git clone" - regex: "" - append_path: "0" - is_default: "1" - protocol: Git - access: read+write - regex_replacement: "" - overwrite_description_Mercurial: "0" - description_Mercurial: "" - display_command_Mercurial: '1' - protocols_Mercurial: !map:HashWithIndifferentAccess - "0": !map:HashWithIndifferentAccess - command: "hg clone" - regex: "" - append_path: "0" - is_default: "1" - protocol: Mercurial - access: read+write - regex_replacement: "" - display_login: username - overwrite_description_Subversion: "0" - description_Subversion: "" - display_command_Subversion: '1' - protocols_Subversion: !map:HashWithIndifferentAccess - "0": !map:HashWithIndifferentAccess - command: "svn checkout" - regex: foo - append_path: "1" - is_default: "1" - protocol: Subversion - access: permission - regex_replacement: bar - "1": !map:HashWithIndifferentAccess - command: "svn co" - regex: "^.*?([^/]+)/?$" - append_path: "1" - is_default: "0" - protocol: SVN+SSH - access: read-only - regex_replacement: svn+ssh://\1@svn.foo.bar/svn - "2": !map:HashWithIndifferentAccess - command: "svn checkout" - append_path: "0" - is_default: "0" - regex: "" - protocol: Root - access: read+write - regex_replacement: ""
--- a/vendor/plugins/redmine_checkout/spec/macros/macro_spec.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') - -describe "Macros" do - fixtures :settings, :repositories, :projects, :enabled_modules - - include ERB::Util - include ApplicationHelper - include ActionView::Helpers::TextHelper - include ActionView::Helpers::TagHelper - include ActionView::Helpers::UrlHelper - - before(:each) do - Setting.checkout_display_command_Subversion = '0' - - @project = projects :projects_001 - end - - - it "should display default checkout url" do - text = "{{repository}}" - - url = "file:///#{RAILS_ROOT.gsub(%r{config\/\.\.}, '')}/tmp/test/subversion_repository" - textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" - end - - it "should display forced checkout url" do - text = "{{repository(svn+ssh)}}" - - url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' - textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" - end - - it "should fail without set project" do - @project = nil - - text = "{{repository(svn+ssh)}}" - textilizable(text).should eql "<p><div class=\"flash error\">Error executing the <strong>repository</strong> macro (Checkout protocol svn+ssh not found)</div></p>" - end - - it "should display checkout url from stated project" do - @project = nil - text = "{{repository(ecookbook:svn+ssh)}}" - - url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' - textilizable(text).should eql "<p><a href=\"#{url}\">#{url}</a></p>" - end - - it "should display command" do - Setting.checkout_display_command_Subversion = '1' - - text = "{{repository(svn+ssh)}}" - url = 'svn+ssh://subversion_repository@svn.foo.bar/svn' - textilizable(text).should eql "<p>svn co <a href=\"#{url}\">#{url}</a></p>" - end -end
--- a/vendor/plugins/redmine_checkout/spec/models/protocol_spec.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') - -describe Checkout::Protocol do - fixtures :settings, :repositories, :projects, :enabled_modules - - before(:each) do - @admin = User.new - @admin.admin = true - @user = User.new - - @repo = repositories :svn - @repo.url = "http://example.com/svn/testrepo" - end - - it "should use regexes for generated URL" do - protocol = @repo.checkout_protocols.find{|r| r.protocol == "SVN+SSH"} - protocol.url.should eql "svn+ssh://testrepo@svn.foo.bar/svn" - end - - it "should resolve access properties" do - protocol = @repo.checkout_protocols.find{|r| r.protocol == "Subversion"} - protocol.access.should eql "permission" - protocol.access_rw(@admin).should eql "read+write" - - User.current = @user - protocol.access_rw(@user).should eql "read-only" - end - - it "should display the checkout command" do - subversion = @repo.checkout_protocols.find{|r| r.protocol == "Subversion"} - svn_ssh = @repo.checkout_protocols.find{|r| r.protocol == "SVN+SSH"} - - subversion.command.should eql "svn checkout" - svn_ssh.command.should eql "svn co" - end -end
--- a/vendor/plugins/redmine_checkout/spec/models/repository_spec.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') - -describe Repository do - fixtures :settings, :repositories - - describe "initialize" do - before(:each) do - @repo = Repository.new() - end - - it "should properly set default values" do - @repo.checkout_overwrite?.should be_false - @repo.checkout_description.should match /Please select the desired protocol below to get the URL/ - @repo.checkout_display_login?.should be_false # no subversion repo - @repo.allow_subtree_checkout?.should be_false - @repo.checkout_protocols.should eql [] - end - end - - describe "subtree checkout" do - before(:each) do - @svn = Repository::Subversion.new - @git = Repository::Git.new - end - it "should be allowed on subversion" do - @svn.allow_subtree_checkout?.should eql true - end - it "should only be possible if checked" do - - end - - it "should be forbidden on git" do - @git.allow_subtree_checkout?.should eql false - end - end - - describe "extensions" do - before(:each) do - @repo = Repository::Subversion.new - end - - it "should provide protocols" do - protocols = @repo.checkout_protocols - protocols[0].protocol.should eql "Subversion" - protocols[1].protocol.should eql "SVN+SSH" - protocols[2].protocol.should eql "Root" - end - end -end \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/spec/models/setting_spec.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') - -describe Setting do - fixtures :settings - - before(:each) do - Setting.default_language = 'en' - end - - it "should recognize checkout methods" do - Setting.checkout_display_checkout_info.should eql Setting.plugin_redmine_checkout['display_checkout_info'] - Setting.checkout_display_checkout_info.should eql Setting.plugin_redmine_checkout[:display_checkout_info] - end -end
--- a/vendor/plugins/redmine_checkout/spec/sanity_spec.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -require File.dirname(__FILE__) + '/spec_helper' - -describe Class do - it "should be a class of Class" do - Class.class.should eql(Class) - end - - it "should be awesome" do - Checkout.awesome?.should be_true - end -end
--- a/vendor/plugins/redmine_checkout/spec/spec.opts Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ ---colour ---format -progress ---loadby -mtime ---reverse ---backtrace \ No newline at end of file
--- a/vendor/plugins/redmine_checkout/spec/spec_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -ENV['RAILS_ENV'] ||= 'test' - -# prevent case where we are using rubygems and test-unit 2.x is installed -begin - require 'rubygems' - gem "test-unit", "~> 1.2.3" -rescue LoadError -end - -begin - require "config/environment" unless defined? RAILS_ROOT - require RAILS_ROOT + '/spec/spec_helper' -rescue LoadError => error - puts <<-EOS - - You need to install rspec in your Redmine project. - Please execute the following code: - - gem install rspec-rails - script/generate rspec - - EOS - raise error -end - -Fixtures.create_fixtures File.join(File.dirname(__FILE__), "fixtures"), ActiveRecord::Base.connection.tables -require File.join(File.dirname(__FILE__), "..", "init.rb") \ No newline at end of file
--- a/vendor/plugins/redmine_tags/COPYING Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -redmine_tags is a redMine plugin, that adds tagging support. - -Copyright (c) 2010 Eric Davis -Copyright (c) 2010 Aleksey V Zapparov AKA ixti - -redmine_tags is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -redmine_tags is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with redmine_tags. If not, see <http://www.gnu.org/licenses/>.
--- a/vendor/plugins/redmine_tags/LICENSE Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,619 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee.
--- a/vendor/plugins/redmine_tags/README.rdoc Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -= Redmine Tags - -Allows marking up different models in Redmine with tags. -Inspired by original redmine_tags of Eric Davis. But in -comparison extended with some code that was already wrote -as part of my own redmine taggable_issues branch. - -== Supported models - -* Issues - -== License - -This plugin is licensed under the GNU/GPL v3. -See COPYING and LICENSE for details.
--- a/vendor/plugins/redmine_tags/app/helpers/filters_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -module FiltersHelper - # returns link to the page with issues filtered by specified filters - # === parameters - # * <i>title</i> = link title text - # * <i>filters</i> = filters to be applied (see <tt>link_to_filter_options</tt> for details) - # * <i>options</i> = (optional) base options of the link - # === example - # link_to_filter 'foobar', [[ :tags, '~', 'foobar' ]] - # link_to_filter 'foobar', [[ :tags, '~', 'foobar' ]], :project_id => project - def link_to_filter(title, filters, options = {}) - options.merge! link_to_filter_options(filters) - link_to title, options - end - - - # returns hash suitable for passing it to the <tt>to_link</tt> - # === parameters - # * <i>filters</i> = array of arrays. each child array is an array of strings: - # name, operator and value - # === example - # link_to 'foobar', link_to_filter_options [[ :tags, '~', 'foobar' ]] - # - # filters = [[ :tags, '~', 'bazbaz' ], [:status_id, 'o']] - # link_to 'bazbaz', link_to_filter_options filters - def link_to_filter_options(filters) - options = { - :controller => 'issues', - :action => 'index', - :set_filter => 1, - :fields => [], - :values => {}, - :operators => {} - } - - filters.each do |f| - name, operator, value = f - options[:fields].push(name) - options[:operators][name] = operator - options[:values][name] = [value] - end - - options - end -end
--- a/vendor/plugins/redmine_tags/app/helpers/tags_helper.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -module TagsHelper - include ActsAsTaggableOn::TagsHelper - include FiltersHelper - - - # Returns tag link - # === Parameters - # * <i>tag</i> = Instance of Tag - # * <i>options</i> = (optional) Options (override system settings) - # * show_count - Boolean. Whenever show tag counts - # * open_only - Boolean. Whenever link to the filter with "open" issues - # only limit. - def render_tag_link(tag, options = {}) - filters = [[:tags, '=', tag.name]] - filters << [:status_id, 'o'] if options[:open_only] - - content = link_to_filter tag.name, filters, :project_id => @project - if options[:show_count] - content << content_tag('span', "(#{tag.count})", :class => 'tag-count') - end - - content_tag('span', content, :class => 'tag-label') - end - - def render_project_tag_link(tag, options = {}) - content = link_to tag.name, :controller => :projects, :action => :index, :project => { :tag_list => tag.name } - if options[:show_count] - content << content_tag('span', "(#{tag.count})", :class => 'tag-count') - end - content_tag('span', content, :class => 'tag-label') - end - - - # Renders list of tags - # Clouds are rendered as block <tt>div</tt> with internal <tt>span</t> per tag. - # Lists are rendered as unordered lists <tt>ul</tt>. Lists are ordered by - # <tt>tag.count</tt> descending. - # === Parameters - # * <i>tags</i> = Array of Tag instances - # * <i>options</i> = (optional) Options (override system settings) - # * show_count - Boolean. Whenever show tag counts - # * open_only - Boolean. Whenever link to the filter with "open" issues - # only limit. - # * style - list, cloud - def render_tags_list(tags, options = {}) - unless tags.nil? or tags.empty? - content, style = '', options.delete(:style) - - tags.sort! { |a,b| b.count <=> a.count } - - if :list == style - list_el, item_el = 'ul', 'li' - elsif :cloud == style - list_el, item_el = 'div', 'span' - tags = cloudify(tags) - else - raise "Unknown list style" - end - - tag_cloud tags, (1..8).to_a do |tag, weight| - content << " " + content_tag(item_el, render_project_tag_link(tag, options), :class => "tag-nube-#{weight}") + " " - end - - content_tag(list_el, content, :class => 'tags') - end - end - - private - # put most massive tags in the middle - def cloudify(tags) - temp, tags, trigger = tags, [], true - temp.each do |tag| - tags.send((trigger ? 'push' : 'unshift'), tag) - trigger = !trigger - end - tags - end - -end
--- a/vendor/plugins/redmine_tags/app/views/auto_completes/_search_tag_list.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -<ul> - <% @tags.each do |tag| -%> - <%= content_tag 'li', h('%s (%d)' % [tag.name, tag.count]), :name => tag.name %> - <% end -%> -</ul>
--- a/vendor/plugins/redmine_tags/app/views/auto_completes/_tag_list.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -<ul> -<% @tags.each do |tag| -%> - <%= content_tag 'li', h('%s (%d)' % [tag.name, tag.count]), :name => tag.name %> -<% end -%> - <%= content_tag 'li', l(:auto_complete_new_tag) % @name, :name => @name %> -</ul>
--- a/vendor/plugins/redmine_tags/app/views/issues/_tags.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -<% unless issue.tag_list.empty? %> - <tr> - <td><b><%=l(:tags)%>:</b></td> - <td><%= issue.tag_counts.collect{ |t| render_tag_link(t, :show_count => false, :open_only => false) }.join(', ') %></td> - </tr> -<% end %>
--- a/vendor/plugins/redmine_tags/app/views/issues/_tags_form.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -<% fields_for :issue, issue, :builder => TabularFormBuilder do |f| -%> -<div> - <p id="issue_tags"><%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %></p> - <div id="issue_tag_candidates" class="autocomplete"></div> - <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> - <%= javascript_tag "observeIssueTagsField('#{url_for(:controller => 'auto_completes', :action => 'issue_tags', :project_id => issue.project)}')" %> -</div> -<% end -%>
--- a/vendor/plugins/redmine_tags/app/views/issues/_tags_sidebar.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -<% unless sidebar_tags.empty? -%> - <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %> - <h3><%= l(:tags) %></h3> - <%= render_sidebar_tags %> -<% end -%>
--- a/vendor/plugins/redmine_tags/app/views/projects/_filter_search_tags.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -<p class='tag'> - <%- fields_for @project, :builder => TabularFormBuilder do |f| -%> - <div> - <p id="project_tags"> - <%= f.text_field :tag_list, :label => :label_tags_search, :size => 60, :class => 'hol' -%> - </p> - <div id="project_tag_candidates" class="autocomplete"></div> - <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' -%> - <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_search_tags')}', true)" -%> - </div> - <%- end -%> -</p>
--- a/vendor/plugins/redmine_tags/app/views/projects/_filter_tags.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -<p class='tag'> - <% fields_for @project, :builder => TabularFormBuilder do |f| -%> - <div> - <p id="project_tags"> - <%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %> - </p> - <div id="project_tag_candidates" class="autocomplete"></div> - <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> - - <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_tags')}')" %> - </div> - <% end -%> -</p>
--- a/vendor/plugins/redmine_tags/app/views/projects/_filtered_projects.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -<% if @projects.empty? %> -<p><b><%= l(:project_filter_no_results) %></b></p> -<% else %> -<%= render_project_table_with_filtering(@projects, @question) %> -<% end %> - -<p class="pagination"><%= pagination_links_full @project_pages, @project_count %></p>
--- a/vendor/plugins/redmine_tags/app/views/projects/_my_projects.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -<% if !@user_projects.empty? %> -<% if @myproj_status=="true" %> -<fieldset id="my_projects_fieldset" class="collapsible"> - <legend onclick="toggleFieldsetWithState(this);"><h2><%= l(:label_my_project_plural) %></h2></legend> -<% else %> -<fieldset id="my_projects_fieldset" class="collapsible collapsed"> - <legend onclick="toggleFieldsetWithState(this);"><h2><%= l(:label_my_project_plural) %></h2></legend> - <div style="display: none;"> -<% end %> - <div> - <%= render_my_project_hierarchy_with_tags(@user_projects)%> - </div> - <% unless @myproj_status=="true" %> - </div> - <%- end -%> -</fieldset> -<% end %>
--- a/vendor/plugins/redmine_tags/app/views/projects/_tagcloud.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - -<div id="tags"> -<%= render_tags_list(Project.available_tags, :style => :cloud) %> -</div> - -
--- a/vendor/plugins/redmine_tags/app/views/projects/_tags.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -<% unless @project.tag_list.empty? %> - <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %> - <dl class="tags"> - <dt class="tags-title"><%=l(:tags)%></dt> - <dd class="tags"><%= @project.tag_counts.collect{ |t| render_project_tag_link(t) }.join(', ') %></dd> - </dl> -<% end %>
--- a/vendor/plugins/redmine_tags/app/views/projects/_tags_form.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -<% fields_for :project, project, :builder => TabularFormBuilder do |f| -%> -<div> - <p id="project_tags"><%= f.text_field :tag_list, :label => :tags, :size => 60, :class => 'hol' %> - <br /> - <em><%= l(:text_tags_info) %></em> - </p> - <div id="project_tag_candidates" class="autocomplete"></div> - <%= javascript_include_tag 'tags_input', :plugin => 'redmine_tags' %> - <%= javascript_tag "observeProjectTagsField('#{url_for(:controller => 'auto_completes', :action => 'project_tags')}', false)" %> -</div> -<% end -%> \ No newline at end of file
--- a/vendor/plugins/redmine_tags/app/views/projects/index.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -<% content_for :header_tags do %> - <%= auto_discovery_link_tag(:atom, {:action => 'index', :format => 'atom', :key => User.current.rss_key}) %> - <%= stylesheet_link_tag 'redmine_tags', :plugin => 'redmine_tags' %> -<% end %> -<%= javascript_include_tag 'projects_index', :plugin => 'redmine_tags' %> - - -<div class="contextual"> - <%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%> - <%= '| ' + link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') if User.current.allowed_to?(:add_project, nil, :global => true) %> -</div> - - -<div style="clear:both;"></div> -<% if User.current.logged? %> - <%= render :partial => 'my_projects' %> -<% end %> - -<div style="clear:both;"></div> -<h2> - <%= l("label_project_all") %> -</h2> - -<div style="clear:both;"></div> - <%- form_remote_tag(:controller => :projects, :action => :index, :method => :get, :html => {:id => :project_filtering_form}) do -%> - - <% if @filter_status=="true" %> - <fieldset id="filters_fieldset" class="collapsible"> - <legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> - <%- else -%> - <fieldset id="filters_fieldset" class="collapsible collapsed"> - <legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> - <div style="display: none;"> - <%- end -%> - - <div> - <div id='filter_tags'> - <%= render :partial => 'filter_search_tags' -%> - </div> - - <p class='q'> - <%= label_tag 'q', l('project_filtering_q_label') %> - <%= text_field_tag 'q', @question, :size => 30, :id => 'search-input' %> - </p> - - <p style="display: none;"><%= submit_tag( l('button_filter'), :id => 'submitButton') -%></p> - <%= link_to l(:button_apply), {}, :onclick => "$('submitButton').click(); return false;", :class => 'icon icon-checked' -%> - <%= link_to l(:button_clear), {}, :class => 'icon icon-reload' %> - </div> - - <% unless @filter_status=="true" %> - </div> - <%- end -%> - - -<%- end -%> -</fieldset> - -<div id="projects"> - <%= render :partial => 'filtered_projects' %> -</div> - - - - -<% other_formats_links do |f| %> - <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> -<% end %> - -<% html_title(l(:label_project_plural)) -%>
--- a/vendor/plugins/redmine_tags/app/views/tags/_settings.html.erb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -<fieldset><legend><%= l(:setting_issue_tags) %></legend> - <p> - <label><%= l(:issues_sidebar) %></label> - <%= select_tag 'settings[issues_sidebar]', options_for_select(%w(none list cloud).collect{|v| [l("issue_tags_sidebar_#{v}"), v]}, @settings[:issues_sidebar]) %> - </p> - <p> - <label><%= l(:issues_show_count) %></label> - <%= check_box_tag 'settings[issues_show_count]', 1, 1 == @settings[:issues_show_count].to_i %> - </p> - <p> - <label><%= l(:issues_open_only) %></label> - <%= check_box_tag 'settings[issues_open_only]', 1, 1 == @settings[:issues_open_only].to_i %> - </p> -</fieldset>
--- a/vendor/plugins/redmine_tags/assets/javascripts/projects_index.js Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -function toggleFieldsetWithState(this_field){ - id = Element.up(this_field, 'fieldset').id; - // is the fieldset collapsed? - status = $(id).hasClassName("collapsed"); - change_session(id, status); - - toggleFieldset(this_field); - -}; - - function submitForm(){ - $('submitButton').click(); - }; - -function change_session(id, nstatus) { - var url = "projects/set_fieldset_status"; - var request = new Ajax.Request(url, { - method: 'post', - parameters: {field_id: id, status: nstatus}, - asynchronous: true - }); -} - -function keypressHandler (event){ - var key = event.which || event.keyCode; - switch (key) { - default: - break; - case Event.KEY_RETURN: - $('submitButton').click(); return false; - break; - }; -}; - -document.observe("dom:loaded", function() { - $('search-input').observe('keypress', keypressHandler); -}); \ No newline at end of file
--- a/vendor/plugins/redmine_tags/assets/javascripts/tags_input.js Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/** - * This file is a part of redmine_tags - * redMine plugin, that adds tagging support. - * - * Copyright (c) 2010 Aleksey V Zapparov AKA ixti - * - * redmine_tags is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * redmine_tags is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - */ - -var Redmine = Redmine || {}; - -Redmine.TagsInput = Class.create({ - initialize: function(element, update) { - this.element = $(element); - this.input = new Element('input', { 'type': 'text', 'autocomplete': 'off', 'size': 10 }); - this.button = new Element('span', { 'class': 'tag-add icon icon-add' }); - this.tags = new Hash(); - - this.update = update; - - var uri_params = window.location.href.toQueryParams(); - if (uri_params["project[tag_list]"] != undefined){ - this.addTag(uri_params["project[tag_list]"].stripTags(), true); - }; - - Event.observe(this.button, 'click', this.readTags.bind(this)); - Event.observe(this.input, 'keypress', this.onKeyPress.bindAsEventListener(this)); - - this.element.insert({ 'after': this.input }); - this.input.insert({ 'after': this.button }); - this.addTagsList(this.element.value); - }, - - readTags: function() { - this.addTagsList(this.input.value); - this.input.value = ''; - if(this.update){ - submitForm(); - }; - }, - - onKeyPress: function(event) { - if (Event.KEY_RETURN == event.keyCode) { - this.readTags(event); - Event.stop(event); - } - }, - - addTag: function(tag, noSubmit) { - if (tag.blank() || this.tags.get(tag)) return; - - if(noSubmit==undefined){noSubmit=false;} - - var button = new Element('span', { 'class': 'tag-delete icon icon-del' }); - var label = new Element('span', { 'class': 'tag-label' }).insert(tag).insert(button); - - this.tags.set(tag, 1); - this.element.value = this.getTagsList(); - this.element.insert({ 'before': label }); - - if(noSubmit==false){ - if(this.update){ - submitForm(); - }; - }; - - Event.observe(button, 'click', function(){ - this.tags.unset(tag); - this.element.value = this.getTagsList(); - label.remove(); - if(this.update){submitForm();}; - }.bind(this)); - }, - - addTagsList: function(tags_list) { - var tags = tags_list.split(','); - for (var i = 0; i < tags.length; i++) { - this.addTag(tags[i].strip().stripTags().toLowerCase()); - } - }, - - getTagsList: function() { - return this.tags.keys().join(','); - }, - - autocomplete: function(container, url) { - new Ajax.Autocompleter(this.input, container, url, { - 'minChars': 1, - 'frequency': 0.5, - 'paramName': 'q', - 'updateElement': function(el) { - this.input.value = el.getAttribute('name'); - this.readTags(); - }.bind(this) - }); - } -}); - - -function observeIssueTagsField(url) { - new Redmine.TagsInput('issue_tag_list', false).autocomplete('issue_tag_candidates', url); -} - -function observeProjectTagsField(url, update) { - if(!update) { - var update = false; - }; - - new Redmine.TagsInput('project_tag_list', update).autocomplete('project_tag_candidates', url); -} \ No newline at end of file
--- a/vendor/plugins/redmine_tags/assets/stylesheets/redmine_tags.css Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/** - * This file is a part of redmine_tags - * redMine plugin, that adds tagging support. - * - * Copyright (c) 2010 Aleksey V Zapparov AKA ixti - * - * redmine_tags is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * redmine_tags is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - */ - -ul.tags { list-style: none; padding: 0px; } -ul.tags li { margin: .25em 0px; } - -div.tags { text-align: center; } -div.tags h3 { text-align: left; } -div.tags .tag-label { margin: .25em; } -div.tags .tag-nube-1 { font-size: .8em; } -div.tags .tag-nube-2 { font-size: .9em; } -div.tags .tag-nube-3 { font-size: 1em; } -div.tags .tag-nube-4 { font-size: 1.1em; } -div.tags .tag-nube-5 { font-size: 1.2em; } -div.tags .tag-nube-6 { font-size: 1.3em; } -div.tags .tag-nube-7 { font-size: 1.4em; } -div.tags .tag-nube-8 { font-size: 1.5em; } - -.tag-count { font-size: .75em; margin-left: .5em; } - -ul.projects .tags, ul.projects .no-tags { padding-left: 0.5em; color: #3e442c; font-size: 0.95em } -table.projects th.tags { color: #3e442c; } - -dl.tags { margin-top: 1.5em; margin-left: 0; padding-bottom: 1em; overflow: hidden; margin-bottom: 1em; border-bottom: 1px dotted #bbbbbb; } -dt.tags-title { float: left; font-weight: bold; color: #3e442c; } -dd.tags { margin-left: .5em; float: left; color: #3e442c; } -
--- a/vendor/plugins/redmine_tags/config/locales/de.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# German translation for redmine_tags -# by Terence Miller aka cforce, <cforce(at)gmx.de> -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -de: - tags: Tags - field_tags: Tags - field_tag_list: Tags - setting_issue_tags: Ticket Tags - issues_sidebar: Zeige die Tags auf der Sidebar - issues_show_count: Zeige die Ticketanzahl an - issues_open_only: Zeige nur noch offene Tickets - - issue_tags_sidebar_none: Keine - issue_tags_sidebar_list: Liste - issue_tags_sidebar_cloud: Cloud - - auto_complete_new_tag: Hinzufügen...
--- a/vendor/plugins/redmine_tags/config/locales/en.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# English translation for redmine_tags -# by Aleksey V Zapparov AKA ixti -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -en: - tags: Tags - field_tags: Tags - field_tag_list: Tags - field_no_tags: "No tags" - label_tags_search: "Tags: " - setting_issue_tags: Issues Tags - issues_sidebar: Display tags on sidebar as - issues_show_count: Display amount of issues - issues_open_only: Display open issues only - - issue_tags_sidebar_none: None - issue_tags_sidebar_list: List - issue_tags_sidebar_cloud: Cloud - - auto_complete_new_tag: Add new... - - project_filtering_q_label: "Search for text:" - project_filter_no_results: "No matching projects found" - button_filter: "Filter" - - text_tags_info: "A tag can be any text you like, but they're most useful if you choose tags that are already being used for the same thing by other projects (where possible). <br />Some tag examples are: library, plugin, paper, c++, mir, alpha, stable, bsd, android, ...<br />Tags help others find your work: please don't forget to tag your projects!" - -
--- a/vendor/plugins/redmine_tags/config/locales/fr.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# French translation for redmine_tags -# by Stphane HANNEQUIN, <stephane.hannequin(at)aster-ingenierie.com> -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -fr: - tags: Tags - field_tags: Tags - field_tag_list: Tags - setting_issue_tags: Tags des demandes - issues_sidebar: Afficher les Tags comme - issues_show_count: Afficher le nombre de demande - issues_open_only: N'afficher que les demandes ouvertes - - issue_tags_sidebar_none: Ne pas afficher - issue_tags_sidebar_list: Liste - issue_tags_sidebar_cloud: Nuage - - auto_complete_new_tag: Nouveau...
--- a/vendor/plugins/redmine_tags/config/locales/ru.yml Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Russian translation for redmine_tags -# by Aleksey V Zapparov AKA ixti -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -ru: - tags: Метки - field_tags: Метки - field_tag_list: Метки - setting_issue_tags: Метки задач - issues_sidebar: Боковую панель как - issues_show_count: Показать кол-во задач - issues_open_only: Только открытые задачи - - issue_tags_sidebar_none: Не показывать - issue_tags_sidebar_list: Список - issue_tags_sidebar_cloud: Облако - - auto_complete_new_tag: Добавить...
--- a/vendor/plugins/redmine_tags/config/routes.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -ActionController::Routing::Routes.draw do |map| - map.connect 'projects/set_fieldset_status', :controller => 'projects', :action => 'set_fieldset_status', :conditions => {:method => :post} -end \ No newline at end of file
--- a/vendor/plugins/redmine_tags/db/migrate/001_acts_as_taggable_on_migration.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -class ActsAsTaggableOnMigration < ActiveRecord::Migration - def self.up - create_table :tags do |t| - t.column :name, :string - end - - create_table :taggings do |t| - t.column :tag_id, :integer - t.column :taggable_id, :integer - t.column :tagger_id, :integer - t.column :tagger_type, :string - - # You should make sure that the column created is - # long enough to store the required class names. - t.column :taggable_type, :string - t.column :context, :string - - t.column :created_at, :datetime - end - - add_index :taggings, :tag_id - add_index :taggings, [:taggable_id, :taggable_type, :context] - end - - def self.down - drop_table :taggings - drop_table :tags - end -end
--- a/vendor/plugins/redmine_tags/init.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -config.gem "acts-as-taggable-on", :version => '2.0.6' - -require 'redmine' - -Redmine::Plugin.register :redmine_tags do - name 'redmine_tags' - author 'Aleksey V Zapparov AKA "ixti"' - description 'redMine tagging support' - version '1.1.4' - url 'http://www.ixti.ru/' - author_url 'http://www.ixti.ru/' - - requires_redmine :version_or_higher => '1.0.0' - - settings :default => { - :issues_sidebar => 'none', - :issues_show_count => 0, - :issues_open_only => 0 - }, :partial => 'tags/settings' -end - - -require 'dispatcher' - -Dispatcher.to_prepare :redmine_tags do - - require_dependency 'redmine_project_filtering' - - unless Project.included_modules.include?(RedmineTags::Patches::ProjectPatch) - Project.send(:include, RedmineTags::Patches::ProjectPatch) - end - - unless ProjectsHelper.included_modules.include?(RedmineTags::Patches::ProjectsHelperPatch) - ProjectsHelper.send(:include, RedmineTags::Patches::ProjectsHelperPatch) - end - - unless Issue.included_modules.include?(RedmineTags::Patches::IssuePatch) - Issue.send(:include, RedmineTags::Patches::IssuePatch) - end - - unless IssuesHelper.included_modules.include?(RedmineTags::Patches::IssuesHelperPatch) - IssuesHelper.send(:include, RedmineTags::Patches::IssuesHelperPatch) - end - - unless ProjectsController.included_modules.include?(RedmineTags::Patches::ProjectsControllerPatch) - ProjectsController.send(:include, RedmineTags::Patches::ProjectsControllerPatch) - end - - unless AutoCompletesController.included_modules.include?(RedmineTags::Patches::AutoCompletesControllerPatch) - AutoCompletesController.send(:include, RedmineTags::Patches::AutoCompletesControllerPatch) - end - - unless Query.included_modules.include?(RedmineTags::Patches::QueryPatch) - Query.send(:include, RedmineTags::Patches::QueryPatch) - end - - unless QueriesHelper.included_modules.include?(RedmineTags::Patches::QueriesHelperPatch) - QueriesHelper.send(:include, RedmineTags::Patches::QueriesHelperPatch) - end -end - - -require 'redmine_tags/hooks/model_issue_hook' -require 'redmine_tags/hooks/views_issues_hook' -require 'redmine_tags/hooks/views_projects_hook' -
--- a/vendor/plugins/redmine_tags/lib/redmine_project_filtering.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -module RedmineProjectFiltering - - # transforms a question and a list of custom fields into something that Project.search can process - def self.calculate_tokens(question, custom_fields=nil) - list = [] - list << question if question.present? - - tokens = list.join(' ').scan(%r{((\s|^)"[\s\w]+"(\s|$)|\S+)}) - tokens = tokens.collect{ |m| m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '') } - - # tokens must be at least 2 characters long - tokens.select {|w| w.length > 1 } - end - -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/hooks/model_issue_hook.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Eric Davis -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -module RedmineTags - module Hooks - class ModelIssueHook < Redmine::Hook::ViewListener - def controller_issues_edit_before_save(context={}) - save_tags_to_issue(context, true) - end - - # Issue has an after_save method that calls reload (update_nested_set_attributes) - # This makes it impossible for a new record to get a tag_list, it's - # cleared on reload. So instead, hook in after the Issue#save to update - # this issue's tag_list and call #save ourselves. - def controller_issues_new_after_save(context={}) - save_tags_to_issue(context, false) - context[:issue].save - end - - def save_tags_to_issue(context, create_journal) - params = context[:params] - - if params && params[:issue] && !params[:issue][:tag_list].nil? - old_tags = context[:issue].tag_list.to_s - context[:issue].tag_list = params[:issue][:tag_list] - new_tags = context[:issue].tag_list.to_s - - if create_journal and not (old_tags == new_tags || context[:issue].current_journal.blank?) - context[:issue].current_journal.details << JournalDetail.new(:property => 'attr', - :prop_key => 'tag_list', - :old_value => old_tags, - :value => new_tags) - end - end - end - end - end -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/hooks/model_project_hook.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Eric Davis -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -module RedmineTags - module Hooks - class ModelProjectHook < Redmine::Hook::ViewListener - def controller_project_before_save(context={}) - debugger - save_tags_to_project(context, true) - end - - # Issue has an after_save method that calls reload (update_nested_set_attributes) - # This makes it impossible for a new record to get a tag_list, it's - # cleared on reload. So instead, hook in after the Issue#save to update - # this issue's tag_list and call #save ourselves. - def controller_projects_before_save(context={}) - debugger - save_tags_to_project(context, false) - context[:project].save - end - - def save_tags_to_project(context, create_journal) - params = context[:params] - debugger - logger.error { "WORKING" } - - # if params && params[:issue] && !params[:issue][:tag_list].nil? - # old_tags = context[:issue].tag_list.to_s - # context[:issue].tag_list = params[:issue][:tag_list] - # new_tags = context[:issue].tag_list.to_s - # - # if create_journal and not (old_tags == new_tags || context[:issue].current_journal.blank?) - # context[:issue].current_journal.details << JournalDetail.new(:property => 'attr', - # :prop_key => 'tag_list', - # :old_value => old_tags, - # :value => new_tags) - # end - # end - end - end - end -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/hooks/views_issues_hook.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -module RedmineTags - module Hooks - class ViewsIssuesHook < Redmine::Hook::ViewListener - render_on :view_issues_show_details_bottom, :partial => 'issues/tags' - render_on :view_issues_form_details_bottom, :partial => 'issues/tags_form' - render_on :view_issues_sidebar_planning_bottom, :partial => 'issues/tags_sidebar' - end - end -end -
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/hooks/views_projects_hook.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -module RedmineTags - module Hooks - class ViewsProjectsHook < Redmine::Hook::ViewListener - render_on :view_projects_form, :partial => 'projects/tags_form' - render_on :view_projects_show_sidebar_top, :partial => 'projects/tags' -# render_on :view_issues_sidebar_planning_bottom, :partial => 'issues/tags_sidebar' - end - end -end -
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/auto_completes_controller_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -require_dependency 'auto_completes_controller' - -module RedmineTags - module Patches - module AutoCompletesControllerPatch - def self.included(base) - base.send(:include, InstanceMethods) - end - - - module InstanceMethods - def issue_tags - @name = params[:q].to_s - @tags = Issue.available_tags :project_id => @project, :name_like => @name - render :layout => false, :partial => 'tag_list' - end - - def project_tags - @name = params[:q].to_s - @tags = Project.available_tags :name_like => @name - render :layout => false, :partial => 'tag_list' - end - - def project_search_tags - @name = params[:q].to_s - @tags = Project.available_tags :name_like => @name - render :layout => false, :partial => 'search_tag_list' - end - end - end - end -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/issue_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -require_dependency 'issue' - -module RedmineTags - module Patches - module IssuePatch - def self.included(base) - base.extend(ClassMethods) - - base.class_eval do - unloadable - acts_as_taggable - end - end - - module ClassMethods - # Returns available issue tags - # === Parameters - # * <i>options</i> = (optional) Options hash of - # * project - Project to search in. - # * open_only - Boolean. Whenever search within open issues only. - # * name_like - String. Substring to filter found tags. - def available_tags(options = {}) - project = options[:project] - open_only = options[:open_only] - name_like = options[:name_like] - options = {} - visible = ARCondition.new - - if project - project = project.id if project.is_a? Project - visible << ["#{Issue.table_name}.project_id = ?", project] - end - - if open_only - visible << ["#{Issue.table_name}.status_id IN " + - "( SELECT issue_status.id " + - " FROM #{IssueStatus.table_name} issue_status " + - " WHERE issue_status.is_closed = ? )", false] - end - - if name_like - visible << ["#{ActsAsTaggableOn::Tag.table_name}.name LIKE ?", "%#{name_like.downcase}%"] - end - - options[:conditions] = visible.conditions - self.all_tag_counts(options) - end - end - end - end -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/issues_helper_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -require_dependency 'issues_helper' - -module RedmineTags - module Patches - module IssuesHelperPatch - def self.included(base) - base.send(:include, InstanceMethods) - end - - module InstanceMethods - include TagsHelper - - def redmine_tags_settings - @redmine_tags_settings = Setting.plugin_redmine_tags unless @redmine_tags_settings - @redmine_tags_settings - end - - def sidebar_tags - unless @sidebar_tags - @sidebar_tags = [] - if :none != redmine_tags_settings[:issues_sidebar].to_sym - @sidebar_tags = Issue.available_tags(:project => @project, - :open_only => (redmine_tags_settings[:issues_open_only].to_i == 1)) - end - end - @sidebar_tags - end - - def render_sidebar_tags - render_tags_list(sidebar_tags, - :show_count => (redmine_tags_settings[:issues_show_count].to_i == 1), - :open_only => (redmine_tags_settings[:issues_open_only].to_i == 1), - :style => redmine_tags_settings[:issues_sidebar].to_sym) - end - end - end - end -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/project_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -# C4DM - -require_dependency 'project' - -module RedmineTags - module Patches - module ProjectPatch - def self.included(base) # :nodoc: - base.extend(ClassMethods) - base.send(:include, InstanceMethods) - - base.class_eval do - unloadable - - attr_accessor :tag_list - acts_as_taggable - - end - end - - module InstanceMethods - end - - module ClassMethods - def search_by_question(question) - if question.length > 1 - search(RedmineProjectFiltering.calculate_tokens(question), nil, :all_words => true).first.sort_by(&:lft) - else - all(:order => 'lft') - end - end - - - # Returns available project tags - # does not show tags from private projects - def available_tags( options = {} ) - - name_like = options[:name_like] - options = {} - visible = ARCondition.new - - visible << ["#{Project.table_name}.is_public = '1'"] - - if name_like - visible << ["#{ActsAsTaggableOn::Tag.table_name}.name LIKE ?", "%#{name_like.downcase}%"] - end - - options[:conditions] = visible.conditions - - self.all_tag_counts(options) - end - end - end - end -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -# -*- coding: utf-8 -*- -require_dependency 'projects_controller' - -module RedmineTags - module Patches - module ProjectsControllerPatch - def self.included(base) - base.send(:include, InstanceMethods) - base.class_eval do - unloadable - skip_before_filter :authorize, :only => [:set_fieldset_status] - skip_before_filter :find_project, :only => [:set_fieldset_status] - before_filter :add_tags_to_project, :only => [:save, :update] - - alias :index filtered_index - end - end - - module InstanceMethods - - def add_tags_to_project - - if params && params[:project] && !params[:project][:tag_list].nil? - old_tags = @project.tag_list.to_s.downcase - new_tags = params[:project][:tag_list].to_s.downcase - - unless (old_tags == new_tags) - @project.tag_list = ActionController::Base.helpers.strip_tags(new_tags) - end - end - end - - def paginate_projects - sort_init 'name' - sort_update %w(name lft created_on updated_on) - @limit = per_page_option - @project_count = Project.visible_roots.find(@projects).count - - @project_pages = ActionController::Pagination::Paginator.new self, @project_count, @limit, params['page'] - @offset ||= @project_pages.current.offset - end - - def set_fieldset_status - - # luisf. test for missing parameters……… - field = params[:field_id] - status = params[:status] - - session[(field + "_status").to_sym] = status - render :nothing => true - end - - # gets the status of the collabsible fieldsets - def get_fieldset_statuses - if session[:my_projects_fieldset_status].nil? - @myproj_status = "true" - else - @myproj_status = session[:my_projects_fieldset_status] - end - - if session[:filters_fieldset_status].nil? - @filter_status = "false" - else - @filter_status = session[:filters_fieldset_status] - end - - if params && params[:project] && !params[:project][:tag_list].nil? - @filter_status = "true" - end - - end - - # Lists visible projects. Paginator is for top-level projects only - # (subprojects belong to them) - def filtered_index - @project = Project.new - filter_projects - get_fieldset_statuses - - respond_to do |format| - format.html { - paginate_projects - - @projects = Project.visible_roots.find(@projects, :offset => @offset, :limit => @limit, :order => sort_clause) - - if User.current.logged? - # seems sort_by gives us case-sensitive ordering, which we don't want - # @user_projects = User.current.projects.sort_by(&:name) - @user_projects = User.current.projects.all(:order => :name) - end - - render :template => 'projects/index.html.erb', :layout => !request.xhr? - } - format.api { - @offset, @limit = api_offset_and_limit - @project_count = Project.visible.count - @projects = Project.visible.find(@projects, :offset => @offset, :limit => @limit, :order => 'lft') - } - format.atom { - projects = Project.visible.find(:all, :order => 'created_on DESC', :limit => Setting.feeds_limit.to_i) - render_feed(projects, :title => "#{Setting.app_title}: #{l(:label_project_latest)}") - } - format.js { - paginate_projects - @projects = Project.visible_roots.find(@projects, :offset => @offset, :limit => @limit, :order => sort_clause) - render :update do |page| - page.replace_html 'projects', :partial => 'filtered_projects' - end - } - end - end - - private - - def filter_projects - @question = (params[:q] || "").strip - - if params.has_key?(:project) - @tag_list = (params[:project][:tag_list] || "").strip.split(",") - else - @tag_list = [] - end - - if @question == "" - @projects = Project.visible_roots - else - @projects = Project.visible_roots.find(Project.visible.search_by_question(@question)) - end - - unless @tag_list.empty? - @tagged_projects_ids = Project.visible.tagged_with(@tag_list).collect{ |project| Project.find(project.id).root } - @projects = @projects & @tagged_projects_ids - @projects = @projects.uniq - end - end - end - end - end -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_helper_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -module RedmineTags - module Patches - module ProjectsHelperPatch - - def self.included(base) # :nodoc: - base.send(:include, InstanceMethods) - base.send(:include, TagsHelper) - - base.class_eval do - unloadable - end - end - - module InstanceMethods - # Renders a tree of projects that the current user does not belong - # to, or of all projects if the current user is not logged in. The - # given collection may be a subset of the whole project tree - # (eg. some intermediate nodes are private and can not be seen). We - # are potentially interested in various things: the project name, - # description, manager(s), creation date, last activity date, - # general activity level, whether there is anything actually hosted - # here for the project, etc. - def render_project_table_with_filtering(projects, question) - custom_fields = "" - s = "" - if projects.any? - tokens = RedmineProjectFiltering.calculate_tokens(question, custom_fields) - - s << "<div class='autoscroll'>" - s << "<table class='list projects'>" - s << "<thead><tr>" - - s << sort_header_tag('name', :caption => l("field_name")) - s << "<th class='tags'>" << l("tags") << "</th>" - s << "<th class='managers'>" << l("label_managers") << "</th>" - s << sort_header_tag('created_on', :default_order => 'desc') - s << sort_header_tag('updated_on', :default_order => 'desc') - - s << "</tr></thead><tbody>" - - original_project = @project - - projects.each do |project| - s << render_project_in_table_with_filtering(project, cycle('odd', 'even'), 0, tokens) - end - - s << "</table>" - else - s << "\n" - end - @project = original_project - - s - end - - def render_project_in_table_with_filtering(project, oddeven, level, tokens) - # set the project environment to please macros. - @project = project - - classes = (level == 0 ? 'root' : 'child') - - s = "" - - s << "<tr class='#{oddeven} #{classes} level#{level}'>" - s << "<td class='firstcol' align=top><div class='name hosted_here" - s << " no_description" if project.description.blank? - s << "'>" << link_to( highlight_tokens(project.name, tokens), {:controller => 'projects', :action => 'show', :id => project}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}") - s << "</div>" - s << highlight_tokens(render_project_short_description(project), tokens) - s << "</td>" - - # taglist - s << "<td class='tags' align=top>" << project.tag_counts.collect{ |t| render_project_tag_link(t) }.join(', ') << "</td>" - - s << "<td class='managers' align=top>" - - u = project.users_by_role - if u - u.keys.each do |r| - if r.allowed_to?(:edit_project) - mgrs = [] - u[r].sort.each do |m| - mgrs << link_to_user(m) - end - if mgrs.size < 3 - s << '<nobr>' << mgrs.join(', ') << '</nobr>' - else - s << mgrs.join(', ') - end - end - end - end - - s << "</td>" - - s << "<td class='created_on' align=top>" << format_date(project.created_on) << "</td>" - s << "<td class='updated_on' align=top>" << format_date(project.updated_on) << "</td>" - - s << "</tr>" - - project.children.each do |child| - if child.is_public? or User.current.member_of?(child) - s << render_project_in_table_with_filtering(child, oddeven, level + 1, tokens) - end - end - - s - end - - - - # Renders a tree of projects as a nested set of unordered lists - # The given collection may be a subset of the whole project tree - # (eg. some intermediate nodes are private and can not be seen) - def render_project_hierarchy_with_filtering(projects,custom_fields,question) - s = [] - if projects.any? - tokens = RedmineProjectFiltering.calculate_tokens(question, custom_fields) - debugger - - - ancestors = [] - original_project = @project - projects.each do |project| - # set the project environment to please macros. - @project = project - if (ancestors.empty? || project.is_descendant_of?(ancestors.last)) - s << "<ul class='projects #{ ancestors.empty? ? 'root' : nil}'>" - else - ancestors.pop - s << "</li>" - while (ancestors.any? && !project.is_descendant_of?(ancestors.last)) - ancestors.pop - s << "</ul></li>" - end - end - classes = (ancestors.empty? ? 'root' : 'child') - s << "<li class='#{classes}'><div class='#{classes}'>" + - link_to( highlight_tokens(project.name, tokens), - {:controller => 'projects', :action => 'show', :id => project}, - :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}" - ) - s << "<ul class='filter_fields'>" - - # CustomField.usable_for_project_filtering.each do |field| - # value_model = project.custom_value_for(field.id) - # value = value_model.present? ? value_model.value : nil - # s << "<li><b>#{field.name.humanize}:</b> #{highlight_tokens(value, tokens)}</li>" if value.present? - # end - - s << "</ul>" - s << "<div class='clear'></div>" - unless project.description.blank? - s << "<div class='wiki description'>" - s << "<b>#{ t(:field_description) }:</b>" - s << highlight_tokens(textilizable(project.short_description, :project => project), tokens) - s << "\n</div>" - end - s << "</div>" - ancestors << project - end - ancestors.size.times{ s << "</li></ul>" } - @project = original_project - end - s.join "\n" - end - - # Renders a tree of projects where the current user belongs - # as a nested set of unordered lists - # The given collection may be a subset of the whole project tree - # (eg. some intermediate nodes are private and can not be seen) - def render_my_project_hierarchy_with_tags(projects) - - s = '' - - original_project = @project - - projects.each do |project| - if project.root? || !projects.include?(project.parent) - s << render_my_project_in_hierarchy_with_tags(project) - end - end - - @project = original_project - - if s != '' - a = '' - a << "<ul class='projects root'>\n" - a << s - a << "</ul>\n" - s = a - end - - s - - end - - - - - def render_my_project_in_hierarchy_with_tags(project) - - s = '' - - if User.current.member_of?(project) - - # set the project environment to please macros. - @project = project - - classes = (project.root? ? 'root' : 'child') - - s << "<li class='#{classes}'><div class='#{classes}'>" + - link_to_project(project, {}, :class => "project my-project") - if project.is_public? - s << " <span class='public'>" << l(:field_is_public) << "</span>" - else - s << " <span class='private'>" << l(:field_is_private) << "</span>" - end - - tc = project.tag_counts - if tc.empty? - s << " <span class='no-tags'>" << l(:field_no_tags) << "</span>" - else - s << " <span class='tags'>" << tc.collect{ |t| render_project_tag_link(t) }.join(', ') << "</span>" - end - - s << render_project_short_description(project) - - s << "</div>\n" - - cs = '' - project.children.each do |child| - cs << render_my_project_in_hierarchy_with_tags(child) - end - - if cs != '' - s << "<ul class='projects'>\n" << cs << "</ul>\n"; - end - - end - - s - - end - - - - private - - # copied from search_helper. This one doesn't escape html or limit the text length - def highlight_tokens(text, tokens) - return text unless text && tokens && !tokens.empty? - re_tokens = tokens.collect {|t| Regexp.escape(t)} - regexp = Regexp.new "(#{re_tokens.join('|')})", Regexp::IGNORECASE - result = '' - text.split(regexp).each_with_index do |words, i| - words = words.mb_chars - if i.even? - result << words - else - t = (tokens.index(words.downcase) || 0) % 4 - result << content_tag('span', words, :class => "highlight token-#{t}") - end - end - result - end - - end - end - end -end -
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/queries_helper_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -require_dependency 'queries_helper' - -module RedmineTags - module Patches - module QueriesHelperPatch - def self.included(base) - base.send(:include, InstanceMethods) - - base.class_eval do - alias_method :column_content_original, :column_content - alias_method :column_content, :column_content_extended - end - end - - - module InstanceMethods - include TagsHelper - - - def column_content_extended(column, issue) - if column.name.eql? :tags - column.value(issue).collect{ |t| render_tag_link(t) }.join(', ') - else - column_content_original(column, issue) - end - end - end - end - end -end
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/query_patch.rb Mon Jan 07 14:41:20 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -# This file is a part of redmine_tags -# redMine plugin, that adds tagging support. -# -# Copyright (c) 2010 Aleksey V Zapparov AKA ixti -# -# redmine_tags is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_tags is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>. - -require_dependency 'query' - -module RedmineTags - module Patches - module QueryPatch - def self.included(base) - base.send(:include, InstanceMethods) - - base.class_eval do - unloadable - - alias_method :statement_original, :statement - alias_method :statement, :statement_extended - - alias_method :available_filters_original, :available_filters - alias_method :available_filters, :available_filters_extended - - base.add_available_column(QueryColumn.new(:tags)) - end - end - - - module InstanceMethods - def statement_extended - filter = filters.delete 'tags' - clauses = statement_original - - if filter - filters.merge!( 'tags' => filter ) - - values = values_for('tags').clone - compare = operator_for('tags').eql?('=') ? 'IN' : 'NOT IN' - ids_list = Issue.tagged_with(values).collect{ |issue| issue.id }.push(0).join(',') - - clauses << " AND ( #{Issue.table_name}.id #{compare} (#{ids_list}) ) " - end - - clauses - end - - - def available_filters_extended - unless @available_filters - available_filters_original.merge!({ 'tags' => { - :type => :list, - :order => 6, - :values => Issue.available_tags(:project => project).collect{ |t| [t.name, t.name] } - }}) - end - @available_filters - end - end - end - end -end -