diff --git a/app/helpers/permission_helper.rb b/app/helpers/permission_helper.rb index ef64d16bf..6936d81b9 100644 --- a/app/helpers/permission_helper.rb +++ b/app/helpers/permission_helper.rb @@ -6,7 +6,7 @@ module PermissionHelper # SOME REFLECTION MAGIC ####################################################### aspector do - # ---- ORGANIZATION ROLES DEFINITIONS ---- + # ---- TEAM ROLES DEFINITIONS ---- around [ :is_member_of_team, :is_admin_of_team, @@ -177,7 +177,7 @@ module PermissionHelper # public method should be made. That way, we can have # all permissions gathered here in one place. - # ---- ORGANIZATION ROLES ---- + # ---- TEAM ROLES ---- def is_member_of_team(team) # This is already checked by aspector, so just return true true diff --git a/app/models/team.rb b/app/models/team.rb index afd9551de..40f245186 100644 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -296,7 +296,7 @@ class Team < ActiveRecord::Base end end # project.experiments.each |experiment| - self.space_taken = [st, Constants::MINIMAL_ORGANIZATION_SPACE_TAKEN].max + self.space_taken = [st, Constants::MINIMAL_TEAM_SPACE_TAKEN].max Rails::logger.info "Team #{self.id}: " + "space (re)calculated to: " + "#{self.space_taken}B (#{number_to_human_size(self.space_taken)})" @@ -316,7 +316,7 @@ class Team < ActiveRecord::Base def release_space(space) orig_space = self.space_taken self.space_taken = [space_taken - space, - Constants::MINIMAL_ORGANIZATION_SPACE_TAKEN].max + Constants::MINIMAL_TEAM_SPACE_TAKEN].max Rails::logger.info "Team #{self.id}: " + "space released: " + "#{orig_space}B - #{space}B = " + diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index e8a271272..0d330f98f 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -13,9 +13,9 @@ Rails.application.config.assets.precompile += %w(jsPlumb-2.0.4-min.js) Rails.application.config.assets.precompile += %w(jsnetworkx.js) Rails.application.config.assets.precompile += %w(handsontable.full.min.js) Rails.application.config.assets.precompile += %w(users/settings/preferences.js) -Rails.application.config.assets.precompile += %w(users/settings/organizations.js) -Rails.application.config.assets.precompile += %w(users/settings/organizations/add_user_modal.js) -Rails.application.config.assets.precompile += %w(users/settings/organization.js) +Rails.application.config.assets.precompile += %w(users/settings/teams.js) +Rails.application.config.assets.precompile += %w(users/settings/teams/add_user_modal.js) +Rails.application.config.assets.precompile += %w(users/settings/team.js) Rails.application.config.assets.precompile += %w(my_modules/activities.js) Rails.application.config.assets.precompile += %w(my_modules/protocols.js) Rails.application.config.assets.precompile += %w(my_modules/protocols/protocol_status_bar.js) diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb index eb07e9677..e3c4cb801 100644 --- a/config/initializers/constants.rb +++ b/config/initializers/constants.rb @@ -66,8 +66,8 @@ class Constants # Application space #============================================================================= - # Minimal space needed for organization (in B) - MINIMAL_ORGANIZATION_SPACE_TAKEN = 1.megabyte + # Minimal space needed for team (in B) + MINIMAL_TEAM_SPACE_TAKEN = 1.megabyte # Additional space of each file is added to its estimated size to account for # DB indexes size etc. ASSET_ESTIMATED_SIZE_FACTOR = 1.1 @@ -223,8 +223,8 @@ class Constants # Very basic regex to check for validity of emails BASIC_EMAIL_REGEX = URI::MailTo::EMAIL_REGEXP - # Organization name for default admin user - DEFAULT_PRIVATE_ORG_NAME = 'My projects'.freeze + # Team name for default admin user + DEFAULT_PRIVATE_TEAM_NAME = 'My projects'.freeze # ) \ / ( # /|\ )\_/( /|\ diff --git a/config/locales/en.yml b/config/locales/en.yml index 16acfda45..09609fd97 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,7 +30,7 @@ en: password_placeholder: "pass****" submit: "Log in" create: - org_name: "%{user}'s projects" + team_name: "%{user}'s projects" auth_token_create: wrong_credentials: "Failed to automatically sign in (wrong credentials)." unlocks: @@ -48,7 +48,7 @@ en: helpers: label: - organization: + team: name: "Team name" user: full_name: "Full name" @@ -117,7 +117,7 @@ en: authors: "Authors: " description: "Description: " no_description: "No description" - organization: "Team: " + team: "Team: " project: "Project: " experiment: "Experiment: " protocol: "Protocol: " @@ -176,7 +176,7 @@ en: edit_user: "Edit role" delete_user: "Remove user from project" delete_user_confirm: "Are you sure you wish to remove user %{user} from project %{project}?" - organization_filter: "Show projects from" + team_filter: "Show projects from" all_filter: "All" sort: "Sort by" sort_new: "Newest first" @@ -204,7 +204,7 @@ en: create: "Create project" name: "Project name" name_placeholder: "My project" - organization: "Team" + team: "Team" visibility: "Visibility" visibility_hidden: "Private" visibility_visible: "Public" @@ -217,9 +217,9 @@ en: create: "Add" select_user_role: "Select Role" invite_users_link: "Invite users" - invite_users_details: "to team %{organization}." - contact_admins: "To invite additional users to team %{organization}, contact its administrator/s." - no_orgs: + invite_users_details: "to team %{team}." + contact_admins: "To invite additional users to team %{team}, contact its administrator/s." + no_teams: title: "It's empty here!" text: "It seems you're not a member of any team. See team management to sort it out." btn: "Manage teams" @@ -409,7 +409,7 @@ en: created_on_title: "Experiment created on %{date} at %{time}." last_modified_on_title: "Experiment last modified on %{date} at %{time}." - user_organizations: + user_teams: enums: role: guest: "Guest" @@ -716,8 +716,8 @@ en: user_join_full: "%{user} joined on %{date} at %{time}." create: "Add" invite_users_link: "Invite users" - invite_users_details: "to team %{organization}." - contact_admins: "To invite additional users to team %{organization}, contact its administrator/s." + invite_users_details: "to team %{team}." + contact_admins: "To invite additional users to team %{team}, contact its administrator/s." update: success_flash: "Project successfully updated." module_archive: @@ -838,7 +838,7 @@ en: other_samples: "Only samples created by you will be deleted." delete: "Delete samples" modal_add_custom_field: - title_html: "Add new column to team %{organization}" + title_html: "Add new column to team %{team}" create: "Add new column" modal_delete_custom_field: title: "Delete a column" @@ -848,10 +848,10 @@ en: alert_line_2: "the column will be deleted for all team members." delete: "Delete column" modal_add_new_sample_group: - title_html: "Add new sample group to team %{organization}" + title_html: "Add new sample group to team %{team}" create: "Add new sample group" modal_add_new_sample_type: - title_html: "Add new sample type to team %{organization}" + title_html: "Add new sample type to team %{team}" create: "Add new sample type" table: assigned: "Assigned" @@ -865,8 +865,8 @@ en: add_sample_type: "Add new sample type" add_sample_group: "Add new sample group" new: - head_title: "%{organization} | Add new sample" - title: "Add new sample to team %{organization}" + head_title: "%{team} | Add new sample" + title: "Add new sample to team %{team}" create: "Add new sample" sample_type: "Sample type" sample_group: "Sample group" @@ -875,14 +875,14 @@ en: edit_sample_type: "Edit sample type" edit_sample_group: "Edit sample group" edit: - head_title: "%{organization} | Edit sample" - title: "Edit sample %{sample} from team %{organization}" + head_title: "%{team} | Edit sample" + title: "Edit sample %{sample} from team %{team}" create: "Edit sample" scf_does_not_exist: "This field does not exists." create: - success_flash: "Successfully added sample %{sample} to team %{organization}" + success_flash: "Successfully added sample %{sample} to team %{team}" update: - success_flash: "Successfully updated sample %{sample} to team %{organization}" + success_flash: "Successfully updated sample %{sample} to team %{team}" destroy: success_flash: "%{sample_number} samples successfully deleted." contains_other_samples_flash: "%{sample_number} samples successfully deleted. %{other_samples_number} of the selected samples were created by other users and were not deleted." @@ -906,15 +906,15 @@ en: custom_fields: new: - title_html: "Add new column to team %{organization}" + title_html: "Add new column to team %{team}" create: "Add new column" create: - success_flash: "Successfully added column %{custom_field} to team %{organization}." + success_flash: "Successfully added column %{custom_field} to team %{team}." - organizations: + teams: parse_sheet: - head_title: "%{organization} | Import samples" - title: "Import samples to team %{organization}" + head_title: "%{team} | Import samples" + title: "Import samples to team %{team}" help_text: "Match the columns of your uploaded file with already existing columns in database." scinote_columns_html: "sciNote columns:" file_columns: "Imported columns:" @@ -931,8 +931,8 @@ en: list_row: "Row %{row}" list_error: "%{key}: %{val}" import_samples: - head_title: "%{organization} | Import samples" - title: "Import samples to team %{organization}" + head_title: "%{team} | Import samples" + title: "Import samples to team %{team}" sample: one: "1 sample" other: "%{count} samples" @@ -955,7 +955,7 @@ en: destroy_flash: "\"%{name}\" sample group was successfully deleted!" color_label: "Sample group color" create: - success_flash: "Successfully added sample group %{sample_group} to team %{organization}." + success_flash: "Successfully added sample group %{sample_group} to team %{team}." activities: index: @@ -1063,12 +1063,12 @@ en: experiment: "Experiment" protocol: "Protocol" settings: - changed_org_flash: "You are working on %{team} now!" - changed_org_error_flash: "Something went wrong! Try again later." - changed_org_in_search: "The searched item is not in your current team. You will be redirected to %{team} team!" + changed_team_flash: "You are working on %{team} now!" + changed_team_error_flash: "Something went wrong! Try again later." + changed_team_in_search: "The searched item is not in your current team. You will be redirected to %{team} team!" navigation: preferences: "My preferences" - organizations: "My teams" + teams: "My teams" preferences: head_title: "Settings | My preferences" edit: @@ -1078,23 +1078,23 @@ en: update_flash: "Preferences successfully updated." tutorial: modal_title: "Repeat tutorial" - no_organizations: "Seems like you are not a member of any team. Tutorials can be run only by team members." + no_teams: "Seems like you are not a member of any team. Tutorials can be run only by team members." repeat_tutorial: "Repeat tutorial" - select_organization_instruction: "Select the team where you wish to create the demo project." - select_organization: "Select team" + select_team_instruction: "Select the team where you wish to create the demo project." + select_team: "Select team" tutorial_reset_flash: "Tutorial can now be repeated." tutorial_reset_error: "Tutorial could not be repeated." - organizations: + teams: head_title: "Settings | My teams" breadcrumbs: all: "All teams" - new_organization: "New team" + new_team: "New team" index: member_of: one: "You are member of %{count} team." other: "You are member of %{count} teams." - no_organizations: "You are not a member of any team." - new_organization: "New team" + no_teams: "You are not a member of any team." + new_team: "New team" thead_name: "Team" thead_role: "Role" thead_created_at: "Created at" @@ -1102,14 +1102,14 @@ en: thead_members: "Members" na: "n/a" leave: "Leave team" - leave_uo_heading: "Leave team %{org}" - leave_uo_message: "Are you sure you wish to leave team %{org}? This action is irreversible." + leave_uo_heading: "Leave team %{team}" + leave_uo_message: "Are you sure you wish to leave team %{team}? This action is irreversible." leave_uo_alert_heading: "Leaving team has following consequences:" leave_uo_alert_line_1: "you will lose access to all content belonging to the team (including projects, tasks, protocols and activities);" leave_uo_alert_line_2: "all projects in the team where you were the sole Owner will receive a new owner from the team administrators;" leave_uo_alert_line_3: "all repository protocols in the team belonging to you will be reassigned onto a new owner from team administrators." leave_uo_confirm: "Leave" - leave_flash: "Successfuly left team %{org}." + leave_flash: "Successfuly left team %{team}." new: name_label: "Team name" name_placeholder: "My team" @@ -1137,22 +1137,22 @@ en: btn_label: "Edit" role_label: "User role" remove_label: "Remove" - destroy_uo_heading: "Remove user %{user} from team %{org}" - destroy_uo_message: "Are you sure you wish to remove user %{user} from team %{org}?" + destroy_uo_heading: "Remove user %{user} from team %{team}" + destroy_uo_message: "Are you sure you wish to remove user %{user} from team %{team}?" destroy_uo_alert_heading: "Removing user from team has following consequences:" destroy_uo_alert_line_1: "user will lose access to all content belonging to the team (including projects, tasks, protocols and activities);" destroy_uo_alert_line_2: "all projects in the team where user was the sole Owner will be reassigned onto you as a new owner;" destroy_uo_alert_line_3: "all repository protocols in the team belonging to user will be reassigned onto you." destroy_uo_confirm: "Remove user" - delete_organization_heading: "Delete team" + delete_team_heading: "Delete team" can_delete_message: "This team can be deleted because it doesn't have any projects." delete_text: "Delete team." cannot_delete_message_projects: "Cannot delete this team. Only empty teams (without any projects) can be deleted." - modal_destroy_organization: + modal_destroy_team: title: "Delete team" - message: "Are you sure you wish to delete team %{org}? All of the users will be removed from the team as well. This action is irreversible." + message: "Are you sure you wish to delete team %{team}? All of the users will be removed from the team as well. This action is irreversible." confirm: "Delete team" - flash_success: "Team %{org} was successfully deleted." + flash_success: "Team %{team} was successfully deleted." protocols: nav: @@ -1240,7 +1240,7 @@ en: archive: description: "Archived protocols can only be seen by you. Restoring protocols will return them to their previous location (public/private)." restore: "Restore" - no_orgs: + no_teams: title: "It's empty here!" text: "It seems you're not a member of any team. See team management to sort it out." btn: "Manage teams" @@ -1365,14 +1365,14 @@ en: no_keywords: "No keywords" invite_users: - to_org: - title: "Invite users to team %{organization}" - heading: "Invite more people to team %{organization} and start using sciNote." - no_org: + to_team: + title: "Invite users to team %{team}" + heading: "Invite more people to team %{team} and start using sciNote." + no_team: title: "Invite users to sciNote" heading: "Invite more people to start using sciNote." input_subtitle: "Input one or multiple emails, confirm each email with ENTER key." - invite_to_org_heading: "Invite users to my team:" + invite_to_team_heading: "Invite users to my team:" invite_btn: "Invite user/s" invite_guest: "as Guest/s" invite_user: "as Normal user/s" @@ -1380,11 +1380,11 @@ en: results: heading: "Invitation results:" user_exists: "User is already a member of sciNote." - user_exists_unconfirmed_invited_to_org: "User is already a member of sciNote but is not confirmed yet - successfully invited to team %{organization} as %{role}." - user_exists_and_in_org: "User is already a member of sciNote and team %{organization} as %{role}." - user_exists_invited_to_org: "User was already a member of sciNote - successfully invited to team %{organization} as %{role}." + user_exists_unconfirmed_invited_to_team: "User is already a member of sciNote but is not confirmed yet - successfully invited to team %{team} as %{role}." + user_exists_and_in_team: "User is already a member of sciNote and team %{team} as %{role}." + user_exists_invited_to_team: "User was already a member of sciNote - successfully invited to team %{team} as %{role}." user_created: "User succesfully invited to sciNote." - user_created_invited_to_org: "User successfully invited to sciNote and team %{organization} as %{role}." + user_created_invited_to_team: "User successfully invited to sciNote and team %{team} as %{role}." user_invalid: "Invalid email." too_many_emails: "Only invited first %{nr} emails. To invite more users, " @@ -1429,7 +1429,7 @@ en: breadcrumbs_html: "You can always use these Breadcrumbs to navigate all the way back to the Dashboard. Click on the Reports tab to generate a report of your work. (Step 18/26)" reports_index_click_new_report_html: "Click the New report button to create a new report. (Step 19/26)" new_report_html: "To add report elements to the report, click on the —+— sign on the sheet. Select the report contents in the tabs and click Add to report. You can save the report as a PDF on your computer or save it within sciNote for later viewing and modification. (Step 20/26)" - new_report_click_org_html: "Click on %{private_org} in breadcrumbs to return to the Dashboard. (Step 21/26)" + new_report_click_team_html: "Click on %{private_team} in breadcrumbs to return to the Dashboard. (Step 21/26)" protocols_link_html: "Click on to go to the Protocols repository page. (Step 22/26)" protocols_index_html: "View your Public and Private Protocols, which you can Edit, Create new ones or Clone them. Protocols can be archived and restored from the Archive. (Step 23/26)" protocols_import_export_html: "You can also Import or Export protocols to your hard drive. Return to the Dashboard. (Step 24/26)" @@ -1452,8 +1452,8 @@ en: recent_changes: "Recent changes" system_message: "sciNote system message" email_title: "You've received a sciNote notification!" - assign_user_to_organization: "%{assigned_user} was added as %{role} to team %{organization} by %{assigned_by_user}." - unassign_user_from_organization: "%{unassigned_user} was removed from team %{organization} by %{unassigned_by_user}." + assign_user_to_team: "%{assigned_user} was added as %{role} to team %{team} by %{assigned_by_user}." + unassign_user_from_team: "%{unassigned_user} was removed from team %{team} by %{unassigned_by_user}." atwho: no_results: "No results found" @@ -1468,7 +1468,7 @@ en: res: archived: "(archived)" deleted: "(deleted)" - popover_html: "Team: %{organization}
Role: %{role}
Joined: %{time}" + popover_html: "Team: %{team}
Role: %{role}
Joined: %{time}" # This section contains general words that can be used in any parts of # application. diff --git a/config/routes.rb b/config/routes.rb index 088b0e2ac..b3687531b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,51 +1,86 @@ Rails.application.routes.draw do - devise_for :users, controllers: { registrations: "users/registrations", - sessions: "users/sessions", invitations: "users/invitations", - confirmations: "users/confirmations" } + devise_for :users, controllers: { registrations: 'users/registrations', + sessions: 'users/sessions', + invitations: 'users/invitations', + confirmations: 'users/confirmations' } root 'projects#index' # Save sample table state - post '/state_save/:organization_id/:user_id', + post '/state_save/:team_id/:user_id', to: 'user_samples#save_samples_table_status', as: 'save_samples_table_status', defaults: { format: 'json' } - post '/state_load/:organization_id/:user_id', + post '/state_load/:team_id/:user_id', to: 'user_samples#load_samples_table_status', as: 'load_samples_table_status', defaults: { format: 'json' } resources :activities, only: [:index] - get "forbidden", :to => "application#forbidden", as: "forbidden" - get "not_found", :to => "application#not_found", as: "not_found" + get 'forbidden', to: 'application#forbidden', as: 'forbidden' + get 'not_found', to: 'application#not_found', as: 'not_found' # Settings - get "users/settings/preferences", to: "users/settings#preferences", as: "preferences" - put "users/settings/preferences", to: "users/settings#update_preferences", as: "update_preferences" - get "users/settings/preferences/tutorial", to: "users/settings#tutorial", as: "tutorial" - post "users/settings/preferences/reset_tutorial/", to: "users/settings#reset_tutorial", as: "reset_tutorial" + get 'users/settings/preferences', + to: 'users/settings#preferences', + as: 'preferences' + put 'users/settings/preferences', + to: 'users/settings#update_preferences', + as: 'update_preferences' + get 'users/settings/preferences/tutorial', + to: 'users/settings#tutorial', + as: 'tutorial' + post 'users/settings/preferences/reset_tutorial/', + to: 'users/settings#reset_tutorial', + as: 'reset_tutorial' post 'users/settings/preferences/notifications_settings', to: 'users/settings#notifications_settings', as: 'notifications_settings', defaults: { format: 'json' } - post 'users/settings/user_current_organization', - to: 'users/settings#user_current_organization', - as: 'user_current_organization' - get "users/settings/organizations", to: "users/settings#organizations", as: "organizations" - get "users/settings/organizations/new", to: "users/settings#new_organization", as: "new_organization" - post "users/settings/organizations/new", to: "users/settings#create_organization", as: "create_organization" - get "users/settings/organizations/:organization_id", to: "users/settings#organization", as: "organization" - put "users/settings/organizations/:organization_id", to: "users/settings#update_organization", as: "update_organization" - get "users/settings/organizations/:organization_id/name", to: "users/settings#organization_name", as: "organization_name" - get "users/settings/organizations/:organization_id/description", to: "users/settings#organization_description", as: "organization_description" - post "users/settings/organizations/:organization_id/users_datatable", to: "users/settings#organization_users_datatable", as: "organization_users_datatable" - delete "users/settings/organizations/:organization_id", to: "users/settings#destroy_organization", as: "destroy_organization" - put "users/settings/user_organizations/:user_organization_id", to: "users/settings#update_user_organization", as: "update_user_organization" - get "users/settings/user_organizations/:user_organization_id/leave_html", to: "users/settings#leave_user_organization_html", as: "leave_user_organization_html" - get "users/settings/user_organizations/:user_organization_id/destroy_html", to: "users/settings#destroy_user_organization_html", as: "destroy_user_organization_html" - delete "users/settings/user_organizations/:user_organization_id", to: "users/settings#destroy_user_organization", as: "destroy_user_organization" + post 'users/settings/user_current_team', + to: 'users/settings#user_current_team', + as: 'user_current_team' + get 'users/settings/teams', + to: 'users/settings#teams', + as: 'teams' + get 'users/settings/teams/new', + to: 'users/settings#new_team', + as: 'new_team' + post 'users/settings/teams/new', + to: 'users/settings#create_team', + as: 'create_team' + get 'users/settings/teams/:team_id', + to: 'users/settings#team', + as: 'team' + put 'users/settings/teams/:team_id', + to: 'users/settings#update_team', + as: 'update_team' + get 'users/settings/teams/:team_id/name', + to: 'users/settings#team_name', + as: 'team_name' + get 'users/settings/teams/:team_id/description', + to: 'users/settings#team_description', + as: 'team_description' + post 'users/settings/teams/:team_id/users_datatable', + to: 'users/settings#team_users_datatable', + as: 'team_users_datatable' + delete 'users/settings/teams/:team_id', + to: 'users/settings#destroy_team', + as: 'destroy_team' + put 'users/settings/user_teams/:user_team_id', + to: 'users/settings#update_user_team', + as: 'update_user_team' + get 'users/settings/user_teams/:user_team_id/leave_html', + to: 'users/settings#leave_user_team_html', + as: 'leave_user_team_html' + get 'users/settings/user_teams/:user_team_id/destroy_html', + to: 'users/settings#destroy_user_team_html', + as: 'destroy_user_team_html' + delete 'users/settings/user_teams/:user_team_id', + to: 'users/settings#destroy_user_team', + as: 'destroy_user_team' # Invite users devise_scope :user do @@ -69,7 +104,7 @@ Rails.application.routes.draw do to: 'user_notifications#index', as: 'notifications' - resources :organizations, only: [] do + resources :teams, only: [] do resources :samples, only: [:new, :create] resources :sample_types, except: [:show, :new] do get 'sample_type_element', to: 'sample_types#sample_type_element' @@ -94,7 +129,9 @@ Rails.application.routes.draw do get 'atwho_my_modules', to: 'at_who#my_modules' get 'atwho_menu_items', to: 'at_who#menu_items' end - match '*path', :to => 'organizations#routing_error', via: [:get, :post, :put, :patch] + match '*path', + to: 'teams#routing_error', + via: [:get, :post, :put, :patch] end get 'projects/archive', to: 'projects#archive', as: 'projects_archive' @@ -107,9 +144,11 @@ Rails.application.routes.draw do only: [:create, :index, :edit, :update, :destroy] # Activities popup (JSON) for individual project in projects index, # as well as all activities page for single project (HTML) - resources :project_activities, path: "/activities", only: [:index] + resources :project_activities, path: '/activities', only: [:index] resources :tags, only: [:create, :update, :destroy] - resources :reports, path: "/reports", only: [:index, :new, :create, :edit, :update] do + resources :reports, + path: '/reports', + only: [:index, :new, :create, :edit, :update] do collection do # The posts following here should in theory be gets, # but are posts because of parameters payload @@ -155,9 +194,11 @@ Rails.application.routes.draw do only: [:new, :create, :edit, :update], defaults: { format: 'json' } member do - get 'notifications' # Notifications popup for individual project in projects index + # Notifications popup for individual project in projects index + get 'notifications' get 'samples' # Samples for single project - post 'samples_index' # Renders sample datatable for single project (ajax action) + # Renders sample datatable for single project (ajax action) + post 'samples_index' get 'experiment_archive' # Experiment archive for single project post :delete_samples, constraints: CommitParamRouting.new( @@ -166,7 +207,8 @@ Rails.application.routes.draw do action: :delete_samples end - # This route is defined outside of member block to preserve original :project_id parameter in URL. + # This route is defined outside of member block + # to preserve original :project_id parameter in URL. get 'users/edit', to: 'user_projects#index_edit' end @@ -200,7 +242,7 @@ Rails.application.routes.draw do end # Show action is a popup (JSON) for individual module in full-zoom canvas, - # as well as "module info" page for single module (HTML) + # as well as 'module info' page for single module (HTML) resources :my_modules, path: '/modules', only: [:show, :update] do resources :my_module_tags, path: '/tags', only: [:index, :create, :destroy] resources :user_my_modules, path: '/users', @@ -208,7 +250,7 @@ Rails.application.routes.draw do resources :my_module_comments, path: '/comments', only: [:index, :create, :edit, :update, :destroy] - resources :sample_my_modules, path: "/samples_index", only: [:index] + resources :sample_my_modules, path: '/samples_index', only: [:index] resources :result_texts, only: [:new, :create] resources :result_assets, only: [:new, :create] resources :result_tables, only: [:new, :create] @@ -223,7 +265,8 @@ Rails.application.routes.draw do get 'results' # Results view for single module get 'samples' # Samples view for single module get 'archive' # Archive view for single module - post 'samples_index' # Renders sample datatable for single module (ajax action) + # Renders sample datatable for single module (ajax action) + post 'samples_index' post :assign_samples, constraints: CommitParamRouting.new( MyModulesController::ASSIGN_SAMPLES @@ -241,7 +284,8 @@ Rails.application.routes.draw do action: :delete_samples end - # Those routes are defined outside of member block to preserve original id parameters in URL. + # Those routes are defined outside of member block + # to preserve original id parameters in URL. get 'tags/edit', to: 'my_module_tags#index_edit' get 'users/edit', to: 'user_my_modules#index_edit' end @@ -280,42 +324,45 @@ Rails.application.routes.draw do resources :protocols, only: [:index, :edit, :create] do resources :steps, only: [:new, :create] member do - get "linked_children", to: "protocols#linked_children" - post "linked_children_datatable", to: "protocols#linked_children_datatable" + get 'linked_children', to: 'protocols#linked_children' + post 'linked_children_datatable', + to: 'protocols#linked_children_datatable' get 'preview', to: 'protocols#preview' - patch "metadata", to: "protocols#update_metadata" - patch "keywords", to: "protocols#update_keywords" - post "clone", to: "protocols#clone" - get "unlink_modal", to: "protocols#unlink_modal" - post "unlink", to: "protocols#unlink" - get "revert_modal", to: "protocols#revert_modal" - post "revert", to: "protocols#revert" - get "update_parent_modal", to: "protocols#update_parent_modal" - post "update_parent", to: "protocols#update_parent" - get "update_from_parent_modal", to: "protocols#update_from_parent_modal" - post "update_from_parent", to: "protocols#update_from_parent" - post "load_from_repository_datatable", to: "protocols#load_from_repository_datatable" - get "load_from_repository_modal", to: "protocols#load_from_repository_modal" - post "load_from_repository", to: "protocols#load_from_repository" - post "load_from_file", to: "protocols#load_from_file" - get "copy_to_repository_modal", to: "protocols#copy_to_repository_modal" - post "copy_to_repository", to: "protocols#copy_to_repository" - get "protocol_status_bar", to: "protocols#protocol_status_bar" - get "updated_at_label", to: "protocols#updated_at_label" - get "edit_name_modal", to: "protocols#edit_name_modal" - get "edit_keywords_modal", to: "protocols#edit_keywords_modal" - get "edit_authors_modal", to: "protocols#edit_authors_modal" - get "edit_description_modal", to: "protocols#edit_description_modal" + patch 'metadata', to: 'protocols#update_metadata' + patch 'keywords', to: 'protocols#update_keywords' + post 'clone', to: 'protocols#clone' + get 'unlink_modal', to: 'protocols#unlink_modal' + post 'unlink', to: 'protocols#unlink' + get 'revert_modal', to: 'protocols#revert_modal' + post 'revert', to: 'protocols#revert' + get 'update_parent_modal', to: 'protocols#update_parent_modal' + post 'update_parent', to: 'protocols#update_parent' + get 'update_from_parent_modal', to: 'protocols#update_from_parent_modal' + post 'update_from_parent', to: 'protocols#update_from_parent' + post 'load_from_repository_datatable', + to: 'protocols#load_from_repository_datatable' + get 'load_from_repository_modal', + to: 'protocols#load_from_repository_modal' + post 'load_from_repository', to: 'protocols#load_from_repository' + post 'load_from_file', to: 'protocols#load_from_file' + get 'copy_to_repository_modal', to: 'protocols#copy_to_repository_modal' + post 'copy_to_repository', to: 'protocols#copy_to_repository' + get 'protocol_status_bar', to: 'protocols#protocol_status_bar' + get 'updated_at_label', to: 'protocols#updated_at_label' + get 'edit_name_modal', to: 'protocols#edit_name_modal' + get 'edit_keywords_modal', to: 'protocols#edit_keywords_modal' + get 'edit_authors_modal', to: 'protocols#edit_authors_modal' + get 'edit_description_modal', to: 'protocols#edit_description_modal' end collection do - get "create_new_modal", to: "protocols#create_new_modal" - post "datatable", to: "protocols#datatable" - post "make_private", to: "protocols#make_private" - post "publish", to: "protocols#publish" - post "archive", to: "protocols#archive" - post "restore", to: "protocols#restore" - post "import", to: "protocols#import" - get "export", to: "protocols#export" + get 'create_new_modal', to: 'protocols#create_new_modal' + post 'datatable', to: 'protocols#datatable' + post 'make_private', to: 'protocols#make_private' + post 'publish', to: 'protocols#publish' + post 'archive', to: 'protocols#archive' + post 'restore', to: 'protocols#restore' + post 'import', to: 'protocols#import' + get 'export', to: 'protocols#export' end end @@ -324,11 +371,11 @@ Rails.application.routes.draw do # We cannot use 'resources :assets' because assets is a reserved route # in Rails (assets pipeline) and causes funky behavior - get "files/:id/present", to: "assets#file_present", as: "file_present_asset" + get 'files/:id/present', to: 'assets#file_present', as: 'file_present_asset' get 'files/:id/large_url', to: 'assets#large_image_url', as: 'large_image_url_asset' - get "files/:id/download", to: "assets#download", as: "download_asset" + get 'files/:id/download', to: 'assets#download', as: 'download_asset' post 'asset_signature' => 'assets#signature' devise_scope :user do