Feature #26561 » frozen_string_literals.patch
| lib/plugins/acts_as_tree/Rakefile (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
require 'rake'
|
||
|
require 'rake/testtask'
|
||
|
require 'rake/rdoctask'
|
||
| lib/plugins/gravatar/Rakefile (working copy) | ||
|---|---|---|
|
require 'spec/rake/spectask'
|
||
|
require 'rake/rdoctask'
|
||
|
desc 'Default: run all specs'
|
||
|
task :default => :spec
|
||
|
desc 'Run all application-specific specs'
|
||
|
Spec::Rake::SpecTask.new(:spec) do |t|
|
||
|
# t.rcov = true
|
||
|
end
|
||
|
desc "Report code statistics (KLOCs, etc) from the application"
|
||
|
task :stats do
|
||
|
RAILS_ROOT = File.dirname(__FILE__)
|
||
|
STATS_DIRECTORIES = [
|
||
|
%w(Libraries lib/),
|
||
|
%w(Specs spec/),
|
||
|
].collect { |name, dir| [ name, "#{RAILS_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) }
|
||
|
require 'code_statistics'
|
||
|
CodeStatistics.new(*STATS_DIRECTORIES).to_s
|
||
|
end
|
||
|
namespace :doc do
|
||
|
desc 'Generate documentation for the assert_request plugin.'
|
||
|
Rake::RDocTask.new(:plugin) do |rdoc|
|
||
|
rdoc.rdoc_dir = 'rdoc'
|
||
|
rdoc.title = 'Gravatar Rails Plugin'
|
||
|
rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=rw'
|
||
|
rdoc.rdoc_files.include('README')
|
||
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
||
|
end
|
||
|
end
|
||
|
# frozen_string_literal: true
|
||
|
require 'spec/rake/spectask'
|
||
|
require 'rake/rdoctask'
|
||
|
|
||
|
desc 'Default: run all specs'
|
||
|
task :default => :spec
|
||
|
|
||
|
desc 'Run all application-specific specs'
|
||
|
Spec::Rake::SpecTask.new(:spec) do |t|
|
||
|
# t.rcov = true
|
||
|
end
|
||
|
|
||
|
desc "Report code statistics (KLOCs, etc) from the application"
|
||
|
task :stats do
|
||
|
RAILS_ROOT = File.dirname(__FILE__)
|
||
|
STATS_DIRECTORIES = [
|
||
|
%w(Libraries lib/),
|
||
|
%w(Specs spec/),
|
||
|
].collect { |name, dir| [ name, "#{RAILS_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) }
|
||
|
require 'code_statistics'
|
||
|
CodeStatistics.new(*STATS_DIRECTORIES).to_s
|
||
|
end
|
||
|
|
||
|
namespace :doc do
|
||
|
desc 'Generate documentation for the assert_request plugin.'
|
||
|
Rake::RDocTask.new(:plugin) do |rdoc|
|
||
|
rdoc.rdoc_dir = 'rdoc'
|
||
|
rdoc.title = 'Gravatar Rails Plugin'
|
||
|
rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=rw'
|
||
|
rdoc.rdoc_files.include('README')
|
||
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
||
|
end
|
||
|
end
|
||
| lib/plugins/open_id_authentication/Rakefile (working copy) | ||
|---|---|---|
|
require 'rake'
|
||
|
require 'rake/testtask'
|
||
|
require 'rake/rdoctask'
|
||
|
desc 'Default: run unit tests.'
|
||
|
task :default => :test
|
||
|
desc 'Test the open_id_authentication plugin.'
|
||
|
Rake::TestTask.new(:test) do |t|
|
||
|
t.libs << 'lib'
|
||
|
t.pattern = 'test/**/*_test.rb'
|
||
|
t.verbose = true
|
||
|
end
|
||
|
desc 'Generate documentation for the open_id_authentication plugin.'
|
||
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
||
|
rdoc.rdoc_dir = 'rdoc'
|
||
|
rdoc.title = 'OpenIdAuthentication'
|
||
|
rdoc.options << '--line-numbers' << '--inline-source'
|
||
|
rdoc.rdoc_files.include('README')
|
||
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
||
|
end
|
||
|
# frozen_string_literal: true
|
||
|
require 'rake'
|
||
|
require 'rake/testtask'
|
||
|
require 'rake/rdoctask'
|
||
|
|
||
|
desc 'Default: run unit tests.'
|
||
|
task :default => :test
|
||
|
|
||
|
desc 'Test the open_id_authentication plugin.'
|
||
|
Rake::TestTask.new(:test) do |t|
|
||
|
t.libs << 'lib'
|
||
|
t.pattern = 'test/**/*_test.rb'
|
||
|
t.verbose = true
|
||
|
end
|
||
|
|
||
|
desc 'Generate documentation for the open_id_authentication plugin.'
|
||
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
||
|
rdoc.rdoc_dir = 'rdoc'
|
||
|
rdoc.title = 'OpenIdAuthentication'
|
||
|
rdoc.options << '--line-numbers' << '--inline-source'
|
||
|
rdoc.rdoc_files.include('README')
|
||
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
||
|
end
|
||
| Rakefile (working copy) | ||
|---|---|---|
|
#!/usr/bin/env rake
|
||
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||
|
require File.expand_path('../config/application', __FILE__)
|
||
|
RedmineApp::Application.load_tasks
|
||
|
# frozen_string_literal: true
|
||
|
#!/usr/bin/env rake
|
||
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
||
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
||
|
|
||
|
require File.expand_path('../config/application', __FILE__)
|
||
|
|
||
|
RedmineApp::Application.load_tasks
|
||
| lib/plugins/open_id_authentication/lib/tasks/open_id_authentication_tasks.rake (working copy) | ||
|---|---|---|
|
namespace :open_id_authentication do
|
||
|
namespace :db do
|
||
|
desc "Creates authentication tables for use with OpenIdAuthentication"
|
||
|
task :create => :environment do
|
||
|
generate_migration(["open_id_authentication_tables", "add_open_id_authentication_tables"])
|
||
|
end
|
||
|
desc "Upgrade authentication tables from ruby-openid 1.x.x to 2.x.x"
|
||
|
task :upgrade => :environment do
|
||
|
generate_migration(["upgrade_open_id_authentication_tables", "upgrade_open_id_authentication_tables"])
|
||
|
end
|
||
|
def generate_migration(args)
|
||
|
require 'rails_generator'
|
||
|
require 'rails_generator/scripts/generate'
|
||
|
if ActiveRecord::Base.connection.supports_migrations?
|
||
|
Rails::Generator::Scripts::Generate.new.run(args)
|
||
|
else
|
||
|
raise "Task unavailable to this database (no migration support)"
|
||
|
end
|
||
|
end
|
||
|
desc "Clear the authentication tables"
|
||
|
task :clear => :environment do
|
||
|
OpenIdAuthentication::DbStore.cleanup_nonces
|
||
|
OpenIdAuthentication::DbStore.cleanup_associations
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
# frozen_string_literal: true
|
||
|
namespace :open_id_authentication do
|
||
|
namespace :db do
|
||
|
desc "Creates authentication tables for use with OpenIdAuthentication"
|
||
|
task :create => :environment do
|
||
|
generate_migration(["open_id_authentication_tables", "add_open_id_authentication_tables"])
|
||
|
end
|
||
|
|
||
|
desc "Upgrade authentication tables from ruby-openid 1.x.x to 2.x.x"
|
||
|
task :upgrade => :environment do
|
||
|
generate_migration(["upgrade_open_id_authentication_tables", "upgrade_open_id_authentication_tables"])
|
||
|
end
|
||
|
|
||
|
def generate_migration(args)
|
||
|
require 'rails_generator'
|
||
|
require 'rails_generator/scripts/generate'
|
||
|
|
||
|
if ActiveRecord::Base.connection.supports_migrations?
|
||
|
Rails::Generator::Scripts::Generate.new.run(args)
|
||
|
else
|
||
|
raise "Task unavailable to this database (no migration support)"
|
||
|
end
|
||
|
end
|
||
|
|
||
|
desc "Clear the authentication tables"
|
||
|
task :clear => :environment do
|
||
|
OpenIdAuthentication::DbStore.cleanup_nonces
|
||
|
OpenIdAuthentication::DbStore.cleanup_associations
|
||
|
end
|
||
|
end
|
||
|
end
|
||
| lib/tasks/ci.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
desc "Run the Continuous Integration tests for Redmine"
|
||
|
task :ci do
|
||
|
# RAILS_ENV and ENV[] can diverge so force them both to test
|
||
| lib/tasks/ciphering.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| lib/tasks/deprecated.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
def deprecated_task(name, new_name)
|
||
|
task name=>new_name do
|
||
|
$stderr.puts "\nNote: The rake task #{name} has been deprecated, please use the replacement version #{new_name}"
|
||
| lib/tasks/email.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| lib/tasks/extract_fixtures.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
desc 'Create YAML test fixtures from data in an existing database.
|
||
|
Defaults to development database. Set RAILS_ENV to override.'
|
||
| lib/tasks/initializers.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
desc 'Generates a secret token for the application.'
|
||
|
file 'config/initializers/secret_token.rb' do
|
||
| lib/tasks/load_default_data.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
desc 'Load Redmine default configuration data. Language is chosen interactively or by setting REDMINE_LANG environment variable.'
|
||
|
namespace :redmine do
|
||
| lib/tasks/locales.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
desc 'Updates and checks locales against en.yml'
|
||
|
task :locales do
|
||
|
%w(locales:update locales:check_interpolation).collect do |task|
|
||
| lib/tasks/metrics.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
begin
|
||
|
require 'metric_fu'
|
||
|
rescue LoadError
|
||
| lib/tasks/migrate_from_mantis.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| lib/tasks/migrate_from_trac.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| lib/tasks/permissions.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
namespace :redmine do
|
||
|
desc "List all permissions and the actions registered with them"
|
||
|
task :permissions => :environment do
|
||
| lib/tasks/redmine.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| lib/tasks/reminder.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| ... | ... | |
|
options[:project] = ENV['project'] if ENV['project']
|
||
|
options[:tracker] = ENV['tracker'].to_i if ENV['tracker']
|
||
|
options[:users] = (ENV['users'] || '').split(',').each(&:strip!)
|
||
|
options[:version] = ENV['version'] if ENV['version']
|
||
|
options[:version] = ENV['version'] if ENV['version']
|
||
|
Mailer.with_synched_deliveries do
|
||
|
Mailer.reminders(options)
|
||
| lib/tasks/testing.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
namespace :test do
|
||
|
desc 'Measures test coverage'
|
||
|
task :coverage do
|
||
| lib/tasks/yardoc.rake (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
begin
|
||
|
require 'yard'
|
||
| app/controllers/account_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/activities_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/admin_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/application_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/attachments_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/auth_sources_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/auto_completes_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/boards_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/calendars_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/comments_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/context_menus_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/custom_field_enumerations_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/custom_fields_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/documents_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/email_addresses_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/enumerations_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/files_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/gantts_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/groups_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/imports_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/issue_categories_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/issue_relations_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/issue_statuses_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/issues_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/journals_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| ... | ... | |
|
end
|
||
|
# Replaces pre blocks with [...]
|
||
|
text = text.to_s.strip.gsub(%r{<pre>(.*?)</pre>}m, '[...]')
|
||
|
@content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
|
||
|
@content = ''.dup
|
||
|
@content << "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
|
||
|
@content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
||
|
rescue ActiveRecord::RecordNotFound
|
||
|
render_404
|
||
| app/controllers/mail_handler_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/members_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/messages_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| ... | ... | |
|
@subject = @message.subject
|
||
|
@subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
|
||
|
@content = "#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
|
||
|
@content = ''.dup
|
||
|
@content << "#{ll(Setting.default_language, :text_user_wrote, @message.author)}\n> "
|
||
|
@content << @message.content.to_s.strip.gsub(%r{<pre>(.*?)</pre>}m, '[...]').gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
|
||
|
end
|
||
| app/controllers/my_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/news_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/previews_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/principal_memberships_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/project_enumerations_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/projects_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/queries_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/reports_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/repositories_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/roles_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/search_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| ... | ... | |
|
def index
|
||
|
@question = params[:q] || ""
|
||
|
@question.strip!
|
||
|
@question = @question.strip
|
||
|
@all_words = params[:all_words] ? params[:all_words].present? : true
|
||
|
@titles_only = params[:titles_only] ? params[:titles_only].present? : false
|
||
|
@search_attachments = params[:attachments].presence || '0'
|
||
| app/controllers/settings_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/sys_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/timelog_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/trackers_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/users_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/versions_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: trues
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/watchers_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/welcome_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/wiki_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/wikis_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/controllers/workflows_controller.rb (working copy) | ||
|---|---|---|
|
# frozen_string_literal: true
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
|
#
|
||
| app/helpers/account_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/activities_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/admin_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
# along with this program; if not, write to the Free Software
|
||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
# frozen_string_literal: true
|
||
|
module AdminHelper
|
||
|
def project_status_options_for_select(selected)
|
||
|
options_for_select([[l(:label_all), ''],
|
||
| app/helpers/application_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
end
|
||
|
def toggle_link(name, id, options={})
|
||
|
onclick = "$('##{id}').toggle(); "
|
||
|
onclick = ''.dup
|
||
|
onclick << "$('##{id}').toggle(); "
|
||
|
onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ")
|
||
|
onclick << "$(window).scrollTop($('##{options[:focus]}').position().top); " if options[:scroll]
|
||
|
onclick << "return false;"
|
||
| ... | ... | |
|
# 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_nested_lists(projects, &block)
|
||
|
s = ''
|
||
|
s = ''.dup
|
||
|
if projects.any?
|
||
|
ancestors = []
|
||
|
original_project = @project
|
||
| ... | ... | |
|
end
|
||
|
def render_page_hierarchy(pages, node=nil, options={})
|
||
|
content = ''
|
||
|
content = ''.dup
|
||
|
if pages[node]
|
||
|
content << "<ul class=\"pages-hierarchy\">\n"
|
||
|
pages[node].each do |page|
|
||
| ... | ... | |
|
# Renders flash messages
|
||
|
def render_flash_messages
|
||
|
s = ''
|
||
|
s = ''.dup
|
||
|
flash.each do |k,v|
|
||
|
s << content_tag('div', v.html_safe, :class => "flash #{k}", :id => "flash_#{k}")
|
||
|
end
|
||
| ... | ... | |
|
def render_projects_for_jump_box(projects, selected=nil)
|
||
|
jump = params[:jump].presence || current_menu_item
|
||
|
s = ''.html_safe
|
||
|
s = ''.dup.html_safe
|
||
|
project_tree(projects) do |project, level|
|
||
|
padding = level * 16
|
||
|
text = content_tag('span', project.name, :style => "padding-left:#{padding}px;")
|
||
| ... | ... | |
|
end
|
||
|
def project_tree_options_for_select(projects, options = {})
|
||
|
s = ''.html_safe
|
||
|
s = ''.dup.html_safe
|
||
|
if blank_text = options[:include_blank]
|
||
|
if blank_text == true
|
||
|
blank_text = ' '.html_safe
|
||
| ... | ... | |
|
end
|
||
|
def principals_check_box_tags(name, principals)
|
||
|
s = ''
|
||
|
s = ''.dup
|
||
|
principals.each do |principal|
|
||
|
s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal}</label>\n"
|
||
|
end
|
||
| ... | ... | |
|
# Returns a string for users/groups option tags
|
||
|
def principals_options_for_select(collection, selected=nil)
|
||
|
s = ''
|
||
|
s = ''.dup
|
||
|
if collection.include?(User.current)
|
||
|
s << content_tag('option', "<< #{l(:label_me)} >>", :value => User.current.id)
|
||
|
end
|
||
|
groups = ''
|
||
|
groups = ''.dup
|
||
|
collection.sort.each do |element|
|
||
|
selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id.to_s == selected
|
||
|
(element.is_a?(Group) ? groups : s) << %(<option value="#{element.id}"#{selected_attribute}>#{h element.name}</option>)
|
||
| ... | ... | |
|
else
|
||
|
raise ArgumentError, 'invalid arguments to textilizable'
|
||
|
end
|
||
|
return '' if text.blank?
|
||
|
return ''.dup if text.blank?
|
||
|
project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)
|
||
|
@only_path = only_path = options.delete(:only_path) == false ? false : true
|
||
| ... | ... | |
|
def parse_non_pre_blocks(text, obj, macros)
|
||
|
s = StringScanner.new(text)
|
||
|
tags = []
|
||
|
parsed = ''
|
||
|
parsed = ''.dup
|
||
|
while !s.eos?
|
||
|
s.scan(/(.*?)(<(\/)?(pre|code)(.*?)>|\z)/im)
|
||
|
text, full_tag, closing, tag = s[1], s[2], s[3], s[4]
|
||
| ... | ... | |
|
if headings.empty?
|
||
|
''
|
||
|
else
|
||
|
div_class = 'toc'
|
||
|
div_class = 'toc'.dup
|
||
|
div_class << ' right' if right_align
|
||
|
div_class << ' left' if left_align
|
||
|
out = "<ul class=\"#{div_class}\"><li><strong>#{l :label_table_of_contents}</strong></li><li>"
|
||
|
out = ''.dup
|
||
|
out << "<ul class=\"#{div_class}\"><li><strong>#{l :label_table_of_contents}</strong></li><li>"
|
||
|
root = headings.map(&:first).min
|
||
|
current = root
|
||
|
started = false
|
||
| ... | ... | |
|
# Renders a list of error messages
|
||
|
def render_error_messages(errors)
|
||
|
html = ""
|
||
|
html = "".dup
|
||
|
if errors.present?
|
||
|
html << "<div id='errorExplanation'><ul>\n"
|
||
|
errors.each do |error|
|
||
| ... | ... | |
|
def include_calendar_headers_tags
|
||
|
unless @calendar_headers_tags_included
|
||
|
tags = ''.html_safe
|
||
|
tags = ''.dup.html_safe
|
||
|
@calendar_headers_tags_included = true
|
||
|
content_for :header_tags do
|
||
|
start_of_week = Setting.start_of_week
|
||
| app/helpers/attachments_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/auth_sources_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/boards_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/calendars_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/context_menus_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
module ContextMenusHelper
|
||
|
def context_menu_link(name, url, options={})
|
||
|
options[:class] ||= ''
|
||
|
options[:class] = options[:class].dup if options[:class].frozen?
|
||
|
if options.delete(:selected)
|
||
|
options[:class] << ' icon-checked disabled'
|
||
|
options[:disabled] = true
|
||
| app/helpers/custom_fields_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
items = []
|
||
|
items << [l(:label_custom_field_plural), custom_fields_path]
|
||
|
items << [l(custom_field.type_name), custom_fields_path(:tab => custom_field.class.name)] if custom_field
|
||
|
items << (custom_field.nil? || custom_field.new_record? ? l(:label_custom_field_new) : custom_field.name)
|
||
|
items << (custom_field.nil? || custom_field.new_record? ? l(:label_custom_field_new) : custom_field.name)
|
||
|
title(*items)
|
||
|
end
|
||
| ... | ... | |
|
end
|
||
|
def custom_field_tag_name(prefix, custom_field)
|
||
|
name = "#{prefix}[custom_field_values][#{custom_field.id}]"
|
||
|
name = ''.dup
|
||
|
name << "#{prefix}[custom_field_values][#{custom_field.id}]"
|
||
|
name << "[]" if custom_field.multiple?
|
||
|
name
|
||
|
end
|
||
| ... | ... | |
|
css = title ? "field-description" : nil
|
||
|
content_tag 'span', custom_field.name, :title => title, :class => css
|
||
|
end
|
||
|
|
||
|
# Return custom field label tag
|
||
|
def custom_field_label_tag(name, custom_value, options={})
|
||
|
required = options[:required] || custom_value.custom_field.is_required?
|
||
| app/helpers/documents_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/email_addresses_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/enumerations_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/gantt_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/groups_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/imports_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/issue_categories_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/issue_relations_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/issue_statuses_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/issues_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
end
|
||
|
def render_issue_subject_with_tree(issue)
|
||
|
s = ''
|
||
|
s = ''.dup
|
||
|
ancestors = issue.root? ? [] : issue.ancestors.visible.to_a
|
||
|
ancestors.each do |ancestor|
|
||
|
s << '<div>' + content_tag('p', link_to_issue(ancestor, :project => (issue.project_id != ancestor.project_id)))
|
||
| ... | ... | |
|
end
|
||
|
def render_descendants_tree(issue)
|
||
|
s = '<table class="list issues odd-even">'
|
||
|
s = '<table class="list issues odd-even">'.dup
|
||
|
issue_list(issue.descendants.visible.preload(:status, :priority, :tracker, :assigned_to).sort_by(&:lft)) do |child, level|
|
||
|
css = "issue issue-#{child.id} hascontextmenu #{child.css_classes}"
|
||
|
css = ''.dup
|
||
|
css << "issue issue-#{child.id} hascontextmenu #{child.css_classes}"
|
||
|
css << " idnt idnt-#{level}" if level > 0
|
||
|
s << content_tag('tr',
|
||
|
content_tag('td', check_box_tag("ids[]", child.id, false, :id => nil), :class => 'checkbox') +
|
||
| ... | ... | |
|
def render_issue_relations(issue, relations)
|
||
|
manage_relations = User.current.allowed_to?(:manage_issue_relations, issue.project)
|
||
|
s = ''.html_safe
|
||
|
s = ''.dup.html_safe
|
||
|
relations.each do |relation|
|
||
|
other_issue = relation.other_issue(issue)
|
||
|
css = "issue hascontextmenu #{other_issue.css_classes}"
|
||
| ... | ... | |
|
if issue.total_estimated_hours == issue.estimated_hours
|
||
|
l_hours_short(issue.estimated_hours)
|
||
|
else
|
||
|
s = issue.estimated_hours.present? ? l_hours_short(issue.estimated_hours) : ""
|
||
|
s = ''.dup
|
||
|
s << l_hours_short(issue.estimated_hours) if issue.estimated_hours.present?
|
||
|
s << " (#{l(:label_total)}: #{l_hours_short(issue.total_estimated_hours)})"
|
||
|
s.html_safe
|
||
|
end
|
||
| ... | ... | |
|
values = issue.visible_custom_field_values.select {|value| value.custom_field.full_width_layout?}
|
||
|
return if values.empty?
|
||
|
s = ''.html_safe
|
||
|
s = ''.dup.html_safe
|
||
|
values.each_with_index do |value, i|
|
||
|
attr_value = show_value(value)
|
||
|
next if attr_value.blank?
|
||
| app/helpers/journals_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
links << link_to(l(:button_delete),
|
||
|
journal_path(journal, :journal => {:notes => ""}),
|
||
|
:remote => true,
|
||
|
:method => 'put', :data => {:confirm => l(:text_are_you_sure)},
|
||
|
:method => 'put', :data => {:confirm => l(:text_are_you_sure)},
|
||
|
:title => l(:button_delete),
|
||
|
:class => 'icon-only icon-del'
|
||
|
)
|
||
| app/helpers/mail_handler_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/members_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/messages_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/my_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
module MyHelper
|
||
|
# Renders the blocks
|
||
|
def render_blocks(blocks, user, options={})
|
||
|
s = ''.html_safe
|
||
|
s = ''.dup.html_safe
|
||
|
if blocks.present?
|
||
|
blocks.each do |block|
|
||
| app/helpers/news_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/principal_memberships_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/projects_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
selected = (parent_id.blank? ? nil : Project.find(parent_id))
|
||
|
end
|
||
|
options = ''
|
||
|
options = ''.dup
|
||
|
options << "<option value=''> </option>" if project.allowed_parents.include?(nil)
|
||
|
options << project_tree_options_for_select(project.allowed_parents.compact, :selected => selected)
|
||
|
content_tag('select', options.html_safe, :name => 'project[parent_id]', :id => 'project_parent_id')
|
||
|
end
|
||
|
def render_project_action_links
|
||
|
links = "".html_safe
|
||
|
links = ''.dup.html_safe
|
||
|
if User.current.allowed_to?(:add_project, nil, :global => true)
|
||
|
links << link_to(l(:label_project_new), new_project_path, :class => 'icon icon-add')
|
||
|
end
|
||
| ... | ... | |
|
selection = boards.select {|b| b.parent == parent}
|
||
|
return '' if selection.empty?
|
||
|
s = ''.html_safe
|
||
|
s = ''.dup.html_safe
|
||
|
selection.each do |board|
|
||
|
node = capture(board, level, &block)
|
||
|
node << render_boards_tree(boards, board, level+1, &block)
|
||
| app/helpers/queries_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
end
|
||
|
def query_filters_hidden_tags(query)
|
||
|
tags = ''.html_safe
|
||
|
tags = ''.dup.html_safe
|
||
|
query.filters.each do |field, options|
|
||
|
tags << hidden_field_tag("f[]", field, :id => nil)
|
||
|
tags << hidden_field_tag("op[#{field}]", options[:operator], :id => nil)
|
||
| ... | ... | |
|
end
|
||
|
def query_columns_hidden_tags(query)
|
||
|
tags = ''.html_safe
|
||
|
tags = ''.dup.html_safe
|
||
|
query.columns.each do |column|
|
||
|
tags << hidden_field_tag("c[]", column.name, :id => nil)
|
||
|
end
|
||
| ... | ... | |
|
end
|
||
|
def available_block_columns_tags(query)
|
||
|
tags = ''.html_safe
|
||
|
tags = ''.dup.html_safe
|
||
|
query.available_block_columns.each do |column|
|
||
|
tags << content_tag('label', check_box_tag('c[]', column.name.to_s, query.has_column?(column), :id => nil) + " #{column.caption}", :class => 'inline')
|
||
|
end
|
||
| ... | ... | |
|
def available_totalable_columns_tags(query, options={})
|
||
|
tag_name = (options[:name] || 't') + '[]'
|
||
|
tags = ''.html_safe
|
||
|
tags = ''.dup.html_safe
|
||
|
query.available_totalable_columns.each do |column|
|
||
|
tags << content_tag('label', check_box_tag(tag_name, column.name.to_s, query.totalable_columns.include?(column), :id => nil) + " #{column.caption}", :class => 'inline')
|
||
|
end
|
||
| ... | ... | |
|
session_key = klass.name.underscore.to_sym
|
||
|
if params[:query_id].present?
|
||
|
cond = "project_id IS NULL"
|
||
|
cond = 'project_id IS NULL'.dup
|
||
|
cond << " OR project_id = #{@project.id}" if @project
|
||
|
@query = klass.where(cond).find(params[:query_id])
|
||
|
raise ::Unauthorized unless @query.visible?
|
||
| ... | ... | |
|
tags
|
||
|
end
|
||
|
|
||
|
def query_hidden_sort_tag(query)
|
||
|
hidden_field_tag("sort", query.sort_criteria.to_param, :id => nil)
|
||
|
end
|
||
| ... | ... | |
|
content_tag('h3', title) + "\n" +
|
||
|
content_tag('ul',
|
||
|
queries.collect {|query|
|
||
|
css = 'query'
|
||
|
css = 'query'.dup
|
||
|
css << ' selected' if query == @query
|
||
|
content_tag('li', link_to(query.name, url_params.merge(:query_id => query), :class => css))
|
||
|
}.join("\n").html_safe,
|
||
| ... | ... | |
|
def render_sidebar_queries(klass, project)
|
||
|
queries = sidebar_queries(klass, project)
|
||
|
out = ''.html_safe
|
||
|
out = ''.dup.html_safe
|
||
|
out << query_links(l(:label_my_queries), queries.select(&:is_private?))
|
||
|
out << query_links(l(:label_query_plural), queries.reject(&:is_private?))
|
||
|
out
|
||
| app/helpers/reports_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| app/helpers/repositories_helper.rb (working copy) | ||
|---|---|---|
|
# encoding: utf-8
|
||
|
# frozen_string_literal: true
|
||
|
#
|
||
|
# Redmine - project management software
|
||
|
# Copyright (C) 2006-2017 Jean-Philippe Lang
|
||
| ... | ... | |
|
def render_changes_tree(tree)
|
||
|
return '' if tree.nil?
|
||