Merged rails-3.2 branch.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9528 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-04-25 17:17:49 +00:00
parent 34e20c4373
commit 5e57a1a9d9
457 changed files with 20215 additions and 5352 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
/config/database.yml /config/database.yml
/config/email.yml /config/email.yml
/config/initializers/session_store.rb /config/initializers/session_store.rb
/config/initializers/secret_token.rb
/coverage /coverage
/db/*.db /db/*.db
/db/*.sqlite3 /db/*.sqlite3

View File

@ -7,6 +7,7 @@ config/configuration.yml
config/database.yml config/database.yml
config/email.yml config/email.yml
config/initializers/session_store.rb config/initializers/session_store.rb
config/initializers/secret_token.rb
coverage coverage
db/*.db db/*.db
db/*.sqlite3 db/*.sqlite3

14
Gemfile
View File

@ -1,10 +1,12 @@
source :rubygems source 'http://rubygems.org'
gem "rails", "2.3.14" gem 'rails', '3.2.3'
gem "i18n", "~> 0.4.2" gem 'prototype-rails', '3.2.1'
gem "i18n", "~> 0.6.0"
gem "coderay", "~> 1.0.6" gem "coderay", "~> 1.0.6"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "tzinfo", "~> 0.3.31" gem "tzinfo", "~> 0.3.31"
gem "builder"
# Optional gem for LDAP authentication # Optional gem for LDAP authentication
group :ldap do group :ldap do
@ -14,6 +16,7 @@ end
# Optional gem for OpenID authentication # Optional gem for OpenID authentication
group :openid do group :openid do
gem "ruby-openid", "~> 2.1.4", :require => "openid" gem "ruby-openid", "~> 2.1.4", :require => "openid"
gem "rack-openid"
end end
# Optional gem for exporting the gantt to a PNG file, not supported with jruby # Optional gem for exporting the gantt to a PNG file, not supported with jruby
@ -45,7 +48,7 @@ end
platforms :mri_19, :mingw_19 do platforms :mri_19, :mingw_19 do
group :mysql do group :mysql do
gem "mysql2", "~> 0.2.7" gem "mysql2", "~> 0.3.11"
end end
end end
@ -69,8 +72,9 @@ group :development do
gem "rdoc", ">= 2.4.2" gem "rdoc", ">= 2.4.2"
end end
group :test do group :test do
gem "shoulda", "~> 2.10.3" gem "shoulda"
gem "mocha" gem "mocha"
end end

View File

@ -1,15 +1,7 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake, # Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake. # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot')) require File.expand_path('../config/application', __FILE__)
require 'rake' RedmineApp::Application.load_tasks
require 'rake/testtask'
begin
require 'rdoc/task'
rescue LoadError
# RDoc is not available
end
require 'tasks/rails'

View File

@ -22,9 +22,12 @@ class Unauthorized < Exception; end
class ApplicationController < ActionController::Base class ApplicationController < ActionController::Base
include Redmine::I18n include Redmine::I18n
class_attribute :accept_api_auth_actions
class_attribute :accept_rss_auth_actions
class_attribute :model_object
layout 'base' layout 'base'
exempt_from_layout 'builder', 'rsb'
protect_from_forgery protect_from_forgery
def handle_unverified_request def handle_unverified_request
@ -68,7 +71,6 @@ class ApplicationController < ActionController::Base
end end
before_filter :user_setup, :check_if_login_required, :set_localization before_filter :user_setup, :check_if_login_required, :set_localization
filter_parameter_logging :password
rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token rescue_from ActionController::InvalidAuthenticityToken, :with => :invalid_authenticity_token
rescue_from ::Unauthorized, :with => :deny_access rescue_from ::Unauthorized, :with => :deny_access
@ -77,10 +79,6 @@ class ApplicationController < ActionController::Base
include Redmine::MenuManager::MenuController include Redmine::MenuManager::MenuController
helper Redmine::MenuManager::MenuHelper helper Redmine::MenuManager::MenuHelper
Redmine::Scm::Base.all.each do |scm|
require_dependency "repository/#{scm.underscore}"
end
def user_setup def user_setup
# Check the settings cache for each request # Check the settings cache for each request
Setting.check_cache Setting.check_cache
@ -242,7 +240,7 @@ class ApplicationController < ActionController::Base
end end
def find_model_object def find_model_object
model = self.class.read_inheritable_attribute('model_object') model = self.class.model_object
if model if model
@object = model.find(params[:id]) @object = model.find(params[:id])
self.instance_variable_set('@' + controller_name.singularize, @object) if @object self.instance_variable_set('@' + controller_name.singularize, @object) if @object
@ -252,7 +250,7 @@ class ApplicationController < ActionController::Base
end end
def self.model_object(model) def self.model_object(model)
write_inheritable_attribute('model_object', model) self.model_object = model
end end
# Filter for bulk issue operations # Filter for bulk issue operations
@ -388,9 +386,9 @@ class ApplicationController < ActionController::Base
def self.accept_rss_auth(*actions) def self.accept_rss_auth(*actions)
if actions.any? if actions.any?
write_inheritable_attribute('accept_rss_auth_actions', actions) self.accept_rss_auth_actions = actions
else else
read_inheritable_attribute('accept_rss_auth_actions') || [] self.accept_rss_auth_actions || []
end end
end end
@ -400,9 +398,9 @@ class ApplicationController < ActionController::Base
def self.accept_api_auth(*actions) def self.accept_api_auth(*actions)
if actions.any? if actions.any?
write_inheritable_attribute('accept_api_auth_actions', actions) self.accept_api_auth_actions = actions
else else
read_inheritable_attribute('accept_api_auth_actions') || [] self.accept_api_auth_actions || []
end end
end end
@ -523,26 +521,12 @@ class ApplicationController < ActionController::Base
else else
@error_messages = objects.errors.full_messages @error_messages = objects.errors.full_messages
end end
render :template => 'common/error_messages.api', :status => :unprocessable_entity, :layout => false render :template => 'common/error_messages.api', :status => :unprocessable_entity, :layout => nil
end end
# Overrides #default_template so that the api template # Overrides #_include_layout? so that #render with no arguments
# is used automatically if it exists
def default_template(action_name = self.action_name)
if api_request?
begin
return self.view_paths.find_template(default_template_name(action_name), 'api')
rescue ::ActionView::MissingTemplate
# the api template was not found
# fallback to the default behaviour
end
end
super
end
# Overrides #pick_layout so that #render with no arguments
# doesn't use the layout for api requests # doesn't use the layout for api requests
def pick_layout(*args) def _include_layout?(*args)
api_request? ? nil : super api_request? ? false : super
end end
end end

View File

@ -95,10 +95,11 @@ class MessagesController < ApplicationController
# Delete a messages # Delete a messages
def destroy def destroy
(render_403; return false) unless @message.destroyable_by?(User.current) (render_403; return false) unless @message.destroyable_by?(User.current)
r = @message.to_param
@message.destroy @message.destroy
redirect_to @message.parent.nil? ? redirect_to @message.parent.nil? ?
{ :controller => 'boards', :action => 'show', :project_id => @project, :id => @board } : { :controller => 'boards', :action => 'show', :project_id => @project, :id => @board } :
{ :action => 'show', :id => @message.parent, :r => @message } { :action => 'show', :id => @message.parent, :r => r }
end end
def quote def quote

View File

@ -18,6 +18,7 @@
require 'SVG/Graph/Bar' require 'SVG/Graph/Bar'
require 'SVG/Graph/BarHorizontal' require 'SVG/Graph/BarHorizontal'
require 'digest/sha1' require 'digest/sha1'
require 'redmine/scm/adapters/abstract_adapter'
class ChangesetNotFound < Exception; end class ChangesetNotFound < Exception; end
class InvalidRevisionParam < Exception; end class InvalidRevisionParam < Exception; end
@ -307,8 +308,7 @@ class RepositoriesController < ApplicationController
@repository = @project.repository @repository = @project.repository
end end
(render_404; return false) unless @repository (render_404; return false) unless @repository
@path = params[:path].join('/') unless params[:path].nil? @path = params[:path].is_a?(Array) ? params[:path].join('/') : params[:path].to_s
@path ||= ''
@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].to_s.strip @rev = params[:rev].blank? ? @repository.default_branch : params[:rev].to_s.strip
@rev_to = params[:rev_to] @rev_to = params[:rev_to]
@ -343,15 +343,15 @@ class RepositoriesController < ApplicationController
@date_to = Date.today @date_to = Date.today
@date_from = @date_to << 11 @date_from = @date_to << 11
@date_from = Date.civil(@date_from.year, @date_from.month, 1) @date_from = Date.civil(@date_from.year, @date_from.month, 1)
commits_by_day = repository.changesets.count( commits_by_day = Changeset.count(
:all, :group => :commit_date, :all, :group => :commit_date,
:conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to]) :conditions => ["repository_id = ? AND commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
commits_by_month = [0] * 12 commits_by_month = [0] * 12
commits_by_day.each {|c| commits_by_month[c.first.to_date.months_ago] += c.last } commits_by_day.each {|c| commits_by_month[c.first.to_date.months_ago] += c.last }
changes_by_day = repository.changes.count( changes_by_day = Change.count(
:all, :group => :commit_date, :all, :group => :commit_date, :include => :changeset,
:conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to]) :conditions => ["#{Changeset.table_name}.repository_id = ? AND #{Changeset.table_name}.commit_date BETWEEN ? AND ?", repository.id, @date_from, @date_to])
changes_by_month = [0] * 12 changes_by_month = [0] * 12
changes_by_day.each {|c| changes_by_month[c.first.to_date.months_ago] += c.last } changes_by_day.each {|c| changes_by_month[c.first.to_date.months_ago] += c.last }
@ -384,10 +384,10 @@ class RepositoriesController < ApplicationController
end end
def graph_commits_per_author(repository) def graph_commits_per_author(repository)
commits_by_author = repository.changesets.count(:all, :group => :committer) commits_by_author = Changeset.count(:all, :group => :committer, :conditions => ["repository_id = ?", repository.id])
commits_by_author.to_a.sort! {|x, y| x.last <=> y.last} commits_by_author.to_a.sort! {|x, y| x.last <=> y.last}
changes_by_author = repository.changes.count(:all, :group => :committer) changes_by_author = Change.count(:all, :group => :committer, :include => :changeset, :conditions => ["#{Changeset.table_name}.repository_id = ?", repository.id])
h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o} h = changes_by_author.inject({}) {|o, i| o[i.first] = i.last; o}
fields = commits_by_author.collect {|r| r.first} fields = commits_by_author.collect {|r| r.first}

View File

@ -109,7 +109,7 @@ private
@watched = klass.find(params[:object_id]) @watched = klass.find(params[:object_id])
@project = @watched.project @project = @watched.project
elsif params[:project_id] elsif params[:project_id]
@project = Project.visible.find(params[:project_id]) @project = Project.visible.find_by_param(params[:project_id])
end end
rescue rescue
render_404 render_404

View File

@ -163,6 +163,8 @@ class WikiController < ApplicationController
# Optimistic locking exception # Optimistic locking exception
flash.now[:error] = l(:notice_locking_conflict) flash.now[:error] = l(:notice_locking_conflict)
render :action => 'edit' render :action => 'edit'
rescue ActiveRecord::RecordNotSaved
render :action => 'edit'
end end
# rename a page # rename a page

View File

@ -930,6 +930,9 @@ module ApplicationHelper
def labelled_form_for(*args, &proc) def labelled_form_for(*args, &proc)
args << {} unless args.last.is_a?(Hash) args << {} unless args.last.is_a?(Hash)
options = args.last options = args.last
if args.first.is_a?(Symbol)
options.merge!(:as => args.shift)
end
options.merge!({:builder => Redmine::Views::LabelledFormBuilder}) options.merge!({:builder => Redmine::Views::LabelledFormBuilder})
form_for(*args, &proc) form_for(*args, &proc)
end end
@ -1060,7 +1063,7 @@ module ApplicationHelper
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>') # +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <joe@foo.bar>')
def avatar(user, options = { }) def avatar(user, options = { })
if Setting.gravatar_enabled? if Setting.gravatar_enabled?
options.merge!({:ssl => (defined?(request) && request.ssl?), :default => Setting.gravatar_default}) options.merge!({:ssl => (request && request.ssl?), :default => Setting.gravatar_default})
email = nil email = nil
if user.respond_to?(:mail) if user.respond_to?(:mail)
email = user.mail email = user.mail
@ -1079,7 +1082,7 @@ module ApplicationHelper
# Returns the javascript tags that are included in the html layout head # Returns the javascript tags that are included in the html layout head
def javascript_heads def javascript_heads
tags = javascript_include_tag(:defaults) tags = javascript_include_tag('prototype', 'effects', 'dragdrop', 'controls', 'rails', 'application')
unless User.current.pref.warn_on_leaving_unsaved == '0' unless User.current.pref.warn_on_leaving_unsaved == '0'
tags << "\n".html_safe + javascript_tag("Event.observe(window, 'load', function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });") tags << "\n".html_safe + javascript_tag("Event.observe(window, 'load', function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });")
end end

View File

@ -21,14 +21,14 @@ module WikiHelper
def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0) def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0)
pages = pages.group_by(&:parent) unless pages.is_a?(Hash) pages = pages.group_by(&:parent) unless pages.is_a?(Hash)
s = '' s = ''.html_safe
if pages.has_key?(parent) if pages.has_key?(parent)
pages[parent].each do |page| pages[parent].each do |page|
attrs = "value='#{page.id}'" attrs = "value='#{page.id}'"
attrs << " selected='selected'" if selected == page attrs << " selected='selected'" if selected == page
indent = (level > 0) ? ('&nbsp;' * level * 2 + '&#187; ') : nil indent = (level > 0) ? ('&nbsp;' * level * 2 + '&#187; ') : ''
s << "<option #{attrs}>#{indent}#{h page.pretty_title}</option>\n" + s << content_tag('option', (indent + h(page.pretty_title)).html_safe, :value => page.id.to_s, :selected => selected == page) +
wiki_page_options_for_select(pages, selected, page, level + 1) wiki_page_options_for_select(pages, selected, page, level + 1)
end end
end end

View File

@ -80,7 +80,7 @@ class CustomField < ActiveRecord::Base
when 'bool' when 'bool'
[[l(:general_text_Yes), '1'], [l(:general_text_No), '0']] [[l(:general_text_Yes), '1'], [l(:general_text_No), '0']]
else else
read_possible_values_utf8_encoded || [] possible_values || []
end end
end end
@ -91,14 +91,20 @@ class CustomField < ActiveRecord::Base
when 'bool' when 'bool'
['1', '0'] ['1', '0']
else else
read_possible_values_utf8_encoded values = super()
if values.is_a?(Array)
values.each do |value|
value.force_encoding('UTF-8') if value.respond_to?(:force_encoding)
end
end
values
end end
end end
# Makes possible_values accept a multiline string # Makes possible_values accept a multiline string
def possible_values=(arg) def possible_values=(arg)
if arg.is_a?(Array) if arg.is_a?(Array)
write_attribute(:possible_values, arg.compact.collect(&:strip).select {|v| !v.blank?}) super(arg.compact.collect(&:strip).select {|v| !v.blank?})
else else
self.possible_values = arg.to_s.split(/[\n\r]+/) self.possible_values = arg.to_s.split(/[\n\r]+/)
end end
@ -218,14 +224,4 @@ class CustomField < ActiveRecord::Base
end end
errs errs
end end
def read_possible_values_utf8_encoded
values = read_attribute(:possible_values)
if values.is_a?(Array)
values.each do |value|
value.force_encoding('UTF-8') if value.respond_to?(:force_encoding)
end
end
values
end
end end

View File

@ -246,8 +246,8 @@ class Issue < ActiveRecord::Base
write_attribute(:description, arg) write_attribute(:description, arg)
end end
# Overrides attributes= so that project and tracker get assigned first # Overrides assign_attributes so that project and tracker get assigned first
def attributes_with_project_and_tracker_first=(new_attributes, *args) def assign_attributes_with_project_and_tracker_first(new_attributes, *args)
return if new_attributes.nil? return if new_attributes.nil?
attrs = new_attributes.dup attrs = new_attributes.dup
attrs.stringify_keys! attrs.stringify_keys!
@ -257,10 +257,10 @@ class Issue < ActiveRecord::Base
send "#{attr}=", attrs.delete(attr) send "#{attr}=", attrs.delete(attr)
end end
end end
send :attributes_without_project_and_tracker_first=, attrs, *args send :assign_attributes_without_project_and_tracker_first, attrs, *args
end end
# Do not redefine alias chain on reload (see #4838) # Do not redefine alias chain on reload (see #4838)
alias_method_chain(:attributes=, :project_and_tracker_first) unless method_defined?(:attributes_without_project_and_tracker_first=) alias_method_chain(:assign_attributes, :project_and_tracker_first) unless method_defined?(:assign_attributes_without_project_and_tracker_first)
def estimated_hours=(h) def estimated_hours=(h)
write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h) write_attribute :estimated_hours, (h.is_a?(String) ? h.to_hours : h)
@ -350,7 +350,7 @@ class Issue < ActiveRecord::Base
end end
# mass-assignment security bypass # mass-assignment security bypass
self.send :attributes=, attrs, false assign_attributes attrs, :without_protection => true
end end
def done_ratio def done_ratio
@ -921,7 +921,7 @@ class Issue < ActiveRecord::Base
p.estimated_hours = nil if p.estimated_hours == 0.0 p.estimated_hours = nil if p.estimated_hours == 0.0
# ancestors will be recursively updated # ancestors will be recursively updated
p.save(false) p.save(:validate => false)
end end
end end

View File

@ -15,7 +15,9 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class MailHandler < ActionMailer::Base require 'vendor/tmail'
class MailHandler
include ActionView::Helpers::SanitizeHelper include ActionView::Helpers::SanitizeHelper
include Redmine::I18n include Redmine::I18n
@ -39,7 +41,14 @@ class MailHandler < ActionMailer::Base
@@handler_options[:allow_override] << 'status' unless @@handler_options[:issue].has_key?(:status) @@handler_options[:allow_override] << 'status' unless @@handler_options[:issue].has_key?(:status)
@@handler_options[:no_permission_check] = (@@handler_options[:no_permission_check].to_s == '1' ? true : false) @@handler_options[:no_permission_check] = (@@handler_options[:no_permission_check].to_s == '1' ? true : false)
super email
mail = TMail::Mail.parse(email)
mail.base64_decode
new.receive(mail)
end
def logger
Rails.logger
end end
cattr_accessor :ignored_emails_headers cattr_accessor :ignored_emails_headers

View File

@ -21,13 +21,10 @@ class Mailer < ActionMailer::Base
helper :issues helper :issues
helper :custom_fields helper :custom_fields
include ActionController::UrlWriter
include Redmine::I18n include Redmine::I18n
def self.default_url_options def self.default_url_options
h = Setting.host_name { :host => Setting.host_name, :protocol => Setting.protocol }
h = h.to_s.gsub(%r{\/.*$}, '') unless Redmine::Utils.relative_url_root.blank?
{ :host => h, :protocol => Setting.protocol }
end end
# Builds a tmail object used to email recipients of the added issue. # Builds a tmail object used to email recipients of the added issue.
@ -42,12 +39,13 @@ class Mailer < ActionMailer::Base
redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
message_id issue message_id issue
@author = issue.author @author = issue.author
recipients issue.recipients @issue = issue
cc(issue.watcher_recipients - @recipients) @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}" recipients = issue.recipients
body :issue => issue, cc = issue.watcher_recipients - recipients
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue) mail :to => recipients,
render_multipart('issue_add', body) :cc => cc,
:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
end end
# Builds a tmail object used to email recipients of the edited issue. # Builds a tmail object used to email recipients of the edited issue.
@ -64,30 +62,29 @@ class Mailer < ActionMailer::Base
message_id journal message_id journal
references issue references issue
@author = journal.user @author = journal.user
recipients issue.recipients recipients = issue.recipients
# Watchers in cc # Watchers in cc
cc(issue.watcher_recipients - @recipients) cc = issue.watcher_recipients - recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] " s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id') s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject s << issue.subject
subject s @issue = issue
body :issue => issue, @journal = journal
:journal => journal, @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}") mail :to => recipients,
:cc => cc,
render_multipart('issue_edit', body) :subject => s
end end
def reminder(user, issues, days) def reminder(user, issues, days)
set_language_if_valid user.language set_language_if_valid user.language
recipients user.mail @issues = issues
subject l(:mail_subject_reminder, :count => issues.size, :days => days) @days = days
body :issues => issues, @issues_url = url_for(:controller => 'issues', :action => 'index',
:days => days,
:issues_url => url_for(:controller => 'issues', :action => 'index',
:set_filter => 1, :assigned_to_id => user.id, :set_filter => 1, :assigned_to_id => user.id,
:sort => 'due_date:asc') :sort => 'due_date:asc')
render_multipart('reminder', body) mail :to => user.mail,
:subject => l(:mail_subject_reminder, :count => issues.size, :days => days)
end end
# Builds a tmail object used to email users belonging to the added document's project. # Builds a tmail object used to email users belonging to the added document's project.
@ -97,12 +94,11 @@ class Mailer < ActionMailer::Base
# Mailer.deliver_document_added(document) => sends an email to the document's project recipients # Mailer.deliver_document_added(document) => sends an email to the document's project recipients
def document_added(document) def document_added(document)
redmine_headers 'Project' => document.project.identifier redmine_headers 'Project' => document.project.identifier
recipients document.recipients
@author = User.current @author = User.current
subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}" @document = document
body :document => document, @document_url = url_for(:controller => 'documents', :action => 'show', :id => document)
:document_url => url_for(:controller => 'documents', :action => 'show', :id => document) mail :to => document.recipients,
render_multipart('document_added', body) :subject => "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
end end
# Builds a tmail object used to email recipients of a project when an attachements are added. # Builds a tmail object used to email recipients of a project when an attachements are added.
@ -119,22 +115,22 @@ class Mailer < ActionMailer::Base
when 'Project' when 'Project'
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container) added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container)
added_to = "#{l(:label_project)}: #{container}" added_to = "#{l(:label_project)}: #{container}"
recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail} recipients = container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
when 'Version' when 'Version'
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project) added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
added_to = "#{l(:label_version)}: #{container.name}" added_to = "#{l(:label_version)}: #{container.name}"
recipients container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail} recipients = container.project.notified_users.select {|user| user.allowed_to?(:view_files, container.project)}.collect {|u| u.mail}
when 'Document' when 'Document'
added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id) added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
added_to = "#{l(:label_document)}: #{container.title}" added_to = "#{l(:label_document)}: #{container.title}"
recipients container.recipients recipients = container.recipients
end end
redmine_headers 'Project' => container.project.identifier redmine_headers 'Project' => container.project.identifier
subject "[#{container.project.name}] #{l(:label_attachment_new)}" @attachments = attachments
body :attachments => attachments, @added_to = added_to
:added_to => added_to, @added_to_url = added_to_url
:added_to_url => added_to_url mail :to => recipients,
render_multipart('attachments_added', body) :subject => "[#{container.project.name}] #{l(:label_attachment_new)}"
end end
# Builds a tmail object used to email recipients of a news' project when a news item is added. # Builds a tmail object used to email recipients of a news' project when a news item is added.
@ -146,11 +142,10 @@ class Mailer < ActionMailer::Base
redmine_headers 'Project' => news.project.identifier redmine_headers 'Project' => news.project.identifier
@author = news.author @author = news.author
message_id news message_id news
recipients news.recipients @news = news
subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}" @news_url = url_for(:controller => 'news', :action => 'show', :id => news)
body :news => news, mail :to => news.recipients,
:news_url => url_for(:controller => 'news', :action => 'show', :id => news) :subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
render_multipart('news_added', body)
end end
# Builds a tmail object used to email recipients of a news' project when a news comment is added. # Builds a tmail object used to email recipients of a news' project when a news comment is added.
@ -163,13 +158,12 @@ class Mailer < ActionMailer::Base
redmine_headers 'Project' => news.project.identifier redmine_headers 'Project' => news.project.identifier
@author = comment.author @author = comment.author
message_id comment message_id comment
recipients news.recipients @news = news
cc news.watcher_recipients @comment = comment
subject "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}" @news_url = url_for(:controller => 'news', :action => 'show', :id => news)
body :news => news, mail :to => news.recipients,
:comment => comment, :cc => news.watcher_recipients,
:news_url => url_for(:controller => 'news', :action => 'show', :id => news) :subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}"
render_multipart('news_comment_added', body)
end end
# Builds a tmail object used to email the recipients of the specified message that was posted. # Builds a tmail object used to email the recipients of the specified message that was posted.
@ -183,12 +177,13 @@ class Mailer < ActionMailer::Base
@author = message.author @author = message.author
message_id message message_id message
references message.parent unless message.parent.nil? references message.parent unless message.parent.nil?
recipients(message.recipients) recipients = message.recipients
cc((message.root.watcher_recipients + message.board.watcher_recipients).uniq - @recipients) cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients)
subject "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}" @message = message
body :message => message, @message_url = url_for(message.event_url)
:message_url => url_for(message.event_url) mail :to => recipients,
render_multipart('message_posted', body) :cc => cc,
:subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
end end
# Builds a tmail object used to email the recipients of a project of the specified wiki content was added. # Builds a tmail object used to email the recipients of a project of the specified wiki content was added.
@ -201,14 +196,15 @@ class Mailer < ActionMailer::Base
'Wiki-Page-Id' => wiki_content.page.id 'Wiki-Page-Id' => wiki_content.page.id
@author = wiki_content.author @author = wiki_content.author
message_id wiki_content message_id wiki_content
recipients wiki_content.recipients recipients = wiki_content.recipients
cc(wiki_content.page.wiki.watcher_recipients - recipients) cc = wiki_content.page.wiki.watcher_recipients - recipients
subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}" @wiki_content = wiki_content
body :wiki_content => wiki_content, @wiki_content_url = url_for(:controller => 'wiki', :action => 'show',
:wiki_content_url => url_for(:controller => 'wiki', :action => 'show',
:project_id => wiki_content.project, :project_id => wiki_content.project,
:id => wiki_content.page.title) :id => wiki_content.page.title)
render_multipart('wiki_content_added', body) mail :to => recipients,
:cc => cc,
:subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_added, :id => wiki_content.page.pretty_title)}"
end end
# Builds a tmail object used to email the recipients of a project of the specified wiki content was updated. # Builds a tmail object used to email the recipients of a project of the specified wiki content was updated.
@ -221,17 +217,18 @@ class Mailer < ActionMailer::Base
'Wiki-Page-Id' => wiki_content.page.id 'Wiki-Page-Id' => wiki_content.page.id
@author = wiki_content.author @author = wiki_content.author
message_id wiki_content message_id wiki_content
recipients wiki_content.recipients recipients = wiki_content.recipients
cc(wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients) cc = wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients
subject "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}" @wiki_content = wiki_content
body :wiki_content => wiki_content, @wiki_content_url = url_for(:controller => 'wiki', :action => 'show',
:wiki_content_url => url_for(:controller => 'wiki', :action => 'show',
:project_id => wiki_content.project, :project_id => wiki_content.project,
:id => wiki_content.page.title), :id => wiki_content.page.title)
:wiki_diff_url => url_for(:controller => 'wiki', :action => 'diff', @wiki_diff_url = url_for(:controller => 'wiki', :action => 'diff',
:project_id => wiki_content.project, :id => wiki_content.page.title, :project_id => wiki_content.project, :id => wiki_content.page.title,
:version => wiki_content.version) :version => wiki_content.version)
render_multipart('wiki_content_updated', body) mail :to => recipients,
:cc => cc,
:subject => "[#{wiki_content.project.name}] #{l(:mail_subject_wiki_content_updated, :id => wiki_content.page.pretty_title)}"
end end
# Builds a tmail object used to email the specified user their account information. # Builds a tmail object used to email the specified user their account information.
@ -241,12 +238,11 @@ class Mailer < ActionMailer::Base
# Mailer.deliver_account_information(user, password) => sends account information to the user # Mailer.deliver_account_information(user, password) => sends account information to the user
def account_information(user, password) def account_information(user, password)
set_language_if_valid user.language set_language_if_valid user.language
recipients user.mail @user = user
subject l(:mail_subject_register, Setting.app_title) @password = password
body :user => user, @login_url = url_for(:controller => 'account', :action => 'login')
:password => password, mail :to => user.mail,
:login_url => url_for(:controller => 'account', :action => 'login') :subject => l(:mail_subject_register, Setting.app_title)
render_multipart('account_information', body)
end end
# Builds a tmail object used to email all active administrators of an account activation request. # Builds a tmail object used to email all active administrators of an account activation request.
@ -256,13 +252,13 @@ class Mailer < ActionMailer::Base
# Mailer.deliver_account_activation_request(user)=> sends an email to all active administrators # Mailer.deliver_account_activation_request(user)=> sends an email to all active administrators
def account_activation_request(user) def account_activation_request(user)
# Send the email to all active administrators # Send the email to all active administrators
recipients User.active.find(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact recipients = User.active.find(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact
subject l(:mail_subject_account_activation_request, Setting.app_title) @user = user
body :user => user, @url = url_for(:controller => 'users', :action => 'index',
:url => url_for(:controller => 'users', :action => 'index',
:status => User::STATUS_REGISTERED, :status => User::STATUS_REGISTERED,
:sort_key => 'created_on', :sort_order => 'desc') :sort_key => 'created_on', :sort_order => 'desc')
render_multipart('account_activation_request', body) mail :to => recipients,
:subject => l(:mail_subject_account_activation_request, Setting.app_title)
end end
# Builds a tmail object used to email the specified user that their account was activated by an administrator. # Builds a tmail object used to email the specified user that their account was activated by an administrator.
@ -272,37 +268,33 @@ class Mailer < ActionMailer::Base
# Mailer.deliver_account_activated(user) => sends an email to the registered user # Mailer.deliver_account_activated(user) => sends an email to the registered user
def account_activated(user) def account_activated(user)
set_language_if_valid user.language set_language_if_valid user.language
recipients user.mail @user = user
subject l(:mail_subject_register, Setting.app_title) @login_url = url_for(:controller => 'account', :action => 'login')
body :user => user, mail :to => user.mail,
:login_url => url_for(:controller => 'account', :action => 'login') :subject => l(:mail_subject_register, Setting.app_title)
render_multipart('account_activated', body)
end end
def lost_password(token) def lost_password(token)
set_language_if_valid(token.user.language) set_language_if_valid(token.user.language)
recipients token.user.mail @token = token
subject l(:mail_subject_lost_password, Setting.app_title) @url = url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
body :token => token, mail :to => token.user.mail,
:url => url_for(:controller => 'account', :action => 'lost_password', :token => token.value) :subject => l(:mail_subject_lost_password, Setting.app_title)
render_multipart('lost_password', body)
end end
def register(token) def register(token)
set_language_if_valid(token.user.language) set_language_if_valid(token.user.language)
recipients token.user.mail @token = token
subject l(:mail_subject_register, Setting.app_title) @url = url_for(:controller => 'account', :action => 'activate', :token => token.value)
body :token => token, mail :to => token.user.mail,
:url => url_for(:controller => 'account', :action => 'activate', :token => token.value) :subject => l(:mail_subject_register, Setting.app_title)
render_multipart('register', body)
end end
def test_email(user) def test_email(user)
set_language_if_valid(user.language) set_language_if_valid(user.language)
recipients user.mail @url = url_for(:controller => 'welcome')
subject 'Redmine test' mail :to => user.mail,
body :url => url_for(:controller => 'welcome') :subject => 'Redmine test'
render_multipart('test_email', body)
end end
# Overrides default deliver! method to prevent from sending an email # Overrides default deliver! method to prevent from sending an email
@ -313,13 +305,6 @@ class Mailer < ActionMailer::Base
(cc.nil? || cc.empty?) && (cc.nil? || cc.empty?) &&
(bcc.nil? || bcc.empty?) (bcc.nil? || bcc.empty?)
# Set Message-Id and References
if @message_id_object
mail.message_id = self.class.message_id_for(@message_id_object)
end
if @references_objects
mail.references = @references_objects.collect {|o| self.class.message_id_for(o)}
end
# Log errors when raise_delivery_errors is set to false, Rails does not # Log errors when raise_delivery_errors is set to false, Rails does not
raise_errors = self.class.raise_delivery_errors raise_errors = self.class.raise_delivery_errors
@ -383,83 +368,72 @@ class Mailer < ActionMailer::Base
ActionMailer::Base.delivery_method = saved_method ActionMailer::Base.delivery_method = saved_method
end end
private def mail(headers={})
def initialize_defaults(method_name) headers.merge! 'X-Mailer' => 'Redmine',
super
@initial_language = current_language
set_language_if_valid Setting.default_language
from Setting.mail_from
# Common headers
headers 'X-Mailer' => 'Redmine',
'X-Redmine-Host' => Setting.host_name, 'X-Redmine-Host' => Setting.host_name,
'X-Redmine-Site' => Setting.app_title, 'X-Redmine-Site' => Setting.app_title,
'X-Auto-Response-Suppress' => 'OOF', 'X-Auto-Response-Suppress' => 'OOF',
'Auto-Submitted' => 'auto-generated' 'Auto-Submitted' => 'auto-generated',
end 'From' => Setting.mail_from
# Appends a Redmine header field (name is prepended with 'X-Redmine-')
def redmine_headers(h)
h.each { |k,v| headers["X-Redmine-#{k}"] = v.to_s }
end
# Overrides the create_mail method
def create_mail
# Removes the author from the recipients and cc # Removes the author from the recipients and cc
# if he doesn't want to receive notifications about what he does # if he doesn't want to receive notifications about what he does
if @author && @author.logged? && @author.pref[:no_self_notified] if @author && @author.logged? && @author.pref[:no_self_notified]
if recipients headers[:to].delete(@author.mail) if headers[:to].is_a?(Array)
recipients((recipients.is_a?(Array) ? recipients : [recipients]) - [@author.mail]) headers[:cc].delete(@author.mail) if headers[:cc].is_a?(Array)
end
if cc
cc((cc.is_a?(Array) ? cc : [cc]) - [@author.mail])
end
end end
if @author && @author.logged? if @author && @author.logged?
redmine_headers 'Sender' => @author.login redmine_headers 'Sender' => @author.login
end end
notified_users = [recipients, cc].flatten.compact.uniq
# Rails would log recipients only, not cc and bcc
mylogger.info "Sending email notification to: #{notified_users.join(', ')}" if mylogger
# Blind carbon copy recipients # Blind carbon copy recipients
if Setting.bcc_recipients? if Setting.bcc_recipients?
bcc(notified_users) headers[:bcc] = [headers[:to], headers[:cc]].flatten.uniq.reject(&:blank?)
recipients [] headers[:to] = nil
cc [] headers[:cc] = nil
end end
if @message_id_object
headers[:message_id] = "<#{self.class.message_id_for(@message_id_object)}>"
end
if @references_objects
headers[:references] = @references_objects.collect {|o| "<#{self.class.message_id_for(o)}>"}.join(' ')
end
super headers do |format|
format.text
format.html unless Setting.plain_text_mail?
end
set_language_if_valid @initial_language
end
def initialize(*args)
@initial_language = current_language
set_language_if_valid Setting.default_language
super
end
def self.deliver_mail(mail)
return false if mail.to.blank? && mail.cc.blank? && mail.bcc.blank?
super super
end end
# Rails 2.3 has problems rendering implicit multipart messages with def self.method_missing(method, *args, &block)
# layouts so this method will wrap an multipart messages with if m = method.to_s.match(%r{^deliver_(.+)$})
# explicit parts. send(m[1], *args).deliver
#
# https://rails.lighthouseapp.com/projects/8994/tickets/2338-actionmailer-mailer-views-and-content-type
# https://rails.lighthouseapp.com/projects/8994/tickets/1799-actionmailer-doesnt-set-template_format-when-rendering-layouts
def render_multipart(method_name, body)
if Setting.plain_text_mail?
content_type "text/plain"
body render(:file => "#{method_name}.text.erb",
:body => body,
:layout => 'mailer.text.erb')
else else
content_type "multipart/alternative" super
part :content_type => "text/plain",
:body => render(:file => "#{method_name}.text.erb",
:body => body, :layout => 'mailer.text.erb')
part :content_type => "text/html",
:body => render_message("#{method_name}.html.erb", body)
end end
end end
# Makes partial rendering work with Rails 1.2 (retro-compatibility) private
def self.controller_path
'' # Appends a Redmine header field (name is prepended with 'X-Redmine-')
end unless respond_to?('controller_path') def redmine_headers(h)
h.each { |k,v| headers["X-Redmine-#{k}"] = v.to_s }
end
# Returns a predictable Message-Id for the given object # Returns a predictable Message-Id for the given object
def self.message_id_for(object) def self.message_id_for(object)
@ -469,11 +443,9 @@ class Mailer < ActionMailer::Base
hash = "redmine.#{object.class.name.demodulize.underscore}-#{object.id}.#{timestamp.strftime("%Y%m%d%H%M%S")}" hash = "redmine.#{object.class.name.demodulize.underscore}-#{object.id}.#{timestamp.strftime("%Y%m%d%H%M%S")}"
host = Setting.mail_from.to_s.gsub(%r{^.*@}, '') host = Setting.mail_from.to_s.gsub(%r{^.*@}, '')
host = "#{::Socket.gethostname}.redmine" if host.empty? host = "#{::Socket.gethostname}.redmine" if host.empty?
"<#{hash}@#{host}>" "#{hash}@#{host}"
end end
private
def message_id(object) def message_id(object)
@message_id_object = object @message_id_object = object
end end
@ -487,12 +459,3 @@ class Mailer < ActionMailer::Base
Rails.logger Rails.logger
end end
end end
# Patch TMail so that message_id is not overwritten
module TMail
class Mail
def add_message_id( fqdn = nil )
self.message_id ||= ::TMail::new_message_id(fqdn)
end
end
end

View File

@ -272,6 +272,10 @@ class Project < ActiveRecord::Base
end end
end end
def self.find_by_param(*args)
self.find(*args)
end
def reload(*args) def reload(*args)
@shared_versions = nil @shared_versions = nil
@rolled_up_versions = nil @rolled_up_versions = nil

View File

@ -57,7 +57,7 @@ class Repository < ActiveRecord::Base
end end
alias :attributes_without_extra_info= :attributes= alias :attributes_without_extra_info= :attributes=
def attributes=(new_attributes, guard_protected_attributes = true) def attributes=(new_attributes)
return if new_attributes.nil? return if new_attributes.nil?
attributes = new_attributes.dup attributes = new_attributes.dup
attributes.stringify_keys! attributes.stringify_keys!
@ -72,7 +72,7 @@ class Repository < ActiveRecord::Base
end end
end end
send :attributes_without_extra_info=, p, guard_protected_attributes send :attributes_without_extra_info=, p
if p_extra.keys.any? if p_extra.keys.any?
merge_extra_info(p_extra) merge_extra_info(p_extra)
end end

View File

@ -36,7 +36,7 @@ class Role < ActiveRecord::Base
before_destroy :check_deletable before_destroy :check_deletable
has_many :workflows, :dependent => :delete_all do has_many :workflows, :dependent => :delete_all do
def copy(source_role) def copy(source_role)
Workflow.copy(nil, source_role, nil, proxy_owner) Workflow.copy(nil, source_role, nil, proxy_association.owner)
end end
end end

View File

@ -20,7 +20,7 @@ class Tracker < ActiveRecord::Base
has_many :issues has_many :issues
has_many :workflows, :dependent => :delete_all do has_many :workflows, :dependent => :delete_all do
def copy(source_tracker) def copy(source_tracker)
Workflow.copy(source_tracker, nil, proxy_owner, nil) Workflow.copy(source_tracker, nil, proxy_association.owner, nil)
end end
end end

View File

@ -1,6 +1,6 @@
<%= call_hook :view_account_login_top %> <%= call_hook :view_account_login_top %>
<div id="login-form"> <div id="login-form">
<% form_tag({:action=> "login"}) do %> <%= form_tag({:action=> "login"}) do %>
<%= back_url_hidden_field_tag %> <%= back_url_hidden_field_tag %>
<table> <table>
<tr> <tr>

View File

@ -1,7 +1,7 @@
<h2><%=l(:label_password_lost)%></h2> <h2><%=l(:label_password_lost)%></h2>
<div class="box"> <div class="box">
<% form_tag({:action=> "lost_password"}, :class => "tabular") do %> <%= form_tag({:action=> "lost_password"}, :class => "tabular") do %>
<p><label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label> <p><label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
<%= text_field_tag 'mail', nil, :size => 40 %> <%= text_field_tag 'mail', nil, :size => 40 %>

View File

@ -2,7 +2,7 @@
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
<% form_tag({:token => @token.value}) do %> <%= form_tag({:token => @token.value}) do %>
<div class="box tabular"> <div class="box tabular">
<p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label>
<%= password_field_tag 'new_password', nil, :size => 25 %> <%= password_field_tag 'new_password', nil, :size => 25 %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2> <h2><%=l(:label_register)%> <%=link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></h2>
<% labelled_form_for @user, :url => {:action => 'register'} do |f| %> <%= labelled_form_for @user, :url => {:action => 'register'} do |f| %>
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
<div class="box tabular"> <div class="box tabular">

View File

@ -40,7 +40,7 @@
<% end %> <% end %>
<% content_for :sidebar do %> <% content_for :sidebar do %>
<% form_tag({}, :method => :get) do %> <%= form_tag({}, :method => :get) do %>
<h3><%= l(:label_activity) %></h3> <h3><%= l(:label_activity) %></h3>
<p><% @activity.event_types.each do |t| %> <p><% @activity.event_types.each do |t| %>
<%= check_box_tag "show_#{t}", 1, @activity.scope.include?(t) %> <%= check_box_tag "show_#{t}", 1, @activity.scope.include?(t) %>

View File

@ -1,5 +1,5 @@
<div class="nodata"> <div class="nodata">
<% form_tag({:action => 'default_configuration'}) do %> <%= form_tag({:action => 'default_configuration'}) do %>
<%= simple_format(l(:text_no_configuration_data)) %> <%= simple_format(l(:text_no_configuration_data)) %>
<p><%= l(:field_language) %>: <p><%= l(:field_language) %>:
<%= select_tag 'lang', options_for_select(lang_options_for_select(false), current_language.to_s) %> <%= select_tag 'lang', options_for_select(lang_options_for_select(false), current_language.to_s) %>

View File

@ -4,7 +4,7 @@
<h2><%=l(:label_project_plural)%></h2> <h2><%=l(:label_project_plural)%></h2>
<% form_tag({}, :method => :get) do %> <%= form_tag({}, :method => :get) do %>
<fieldset><legend><%= l(:label_filter_plural) %></legend> <fieldset><legend><%= l(:label_filter_plural) %></legend>
<label for='status'><%= l(:field_status) %> :</label> <label for='status'><%= l(:field_status) %> :</label>
<%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %> <%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>

View File

@ -7,7 +7,7 @@
<span class="size">(<%= number_to_human_size @attachment.filesize %>)</span></p> <span class="size">(<%= number_to_human_size @attachment.filesize %>)</span></p>
</div> </div>
<p> <p>
<% form_tag({}, :method => 'get') do %> <%= form_tag({}, :method => 'get') do %>
<label><%= l(:label_view_diff) %></label> <label><%= l(:label_view_diff) %></label>
<%= select_tag 'type', <%= select_tag 'type',
options_for_select( options_for_select(

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_auth_source)%> (<%= h(@auth_source.auth_method_name) %>)</h2> <h2><%=l(:label_auth_source)%> (<%= h(@auth_source.auth_method_name) %>)</h2>
<% form_tag({:action => 'update', :id => @auth_source}, :method => :put, :class => "tabular") do %> <%= form_tag({:action => 'update', :id => @auth_source}, :method => :put, :class => "tabular") do %>
<%= render :partial => auth_source_partial_name(@auth_source) %> <%= render :partial => auth_source_partial_name(@auth_source) %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_auth_source_new)%> (<%= h(@auth_source.auth_method_name) %>)</h2> <h2><%=l(:label_auth_source_new)%> (<%= h(@auth_source.auth_method_name) %>)</h2>
<% form_tag({:action => 'create'}, :class => "tabular") do %> <%= form_tag({:action => 'create'}, :class => "tabular") do %>
<%= hidden_field_tag 'type', @auth_source.type %> <%= hidden_field_tag 'type', @auth_source.type %>
<%= render :partial => auth_source_partial_name(@auth_source) %> <%= render :partial => auth_source_partial_name(@auth_source) %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>

View File

@ -1,6 +1,6 @@
<h2><%= l(:label_board) %></h2> <h2><%= l(:label_board) %></h2>
<% labelled_form_for @board, :url => project_board_path(@project, @board) do |f| %> <%= labelled_form_for @board, :url => project_board_path(@project, @board) do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<h2><%= l(:label_board_new) %></h2> <h2><%= l(:label_board_new) %></h2>
<% labelled_form_for @board, :url => project_boards_path(@project) do |f| %> <%= labelled_form_for @board, :url => project_boards_path(@project) do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<% end %> <% end %>

View File

@ -11,7 +11,7 @@
<div id="add-message" style="display:none;"> <div id="add-message" style="display:none;">
<% if authorize_for('messages', 'new') %> <% if authorize_for('messages', 'new') %>
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2> <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
<% form_for :message, @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %> <%= render :partial => 'messages/form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create) %> <p><%= submit_tag l(:button_create) %>
<%= link_to_remote l(:label_preview), <%= link_to_remote l(:label_preview),

View File

@ -1,6 +1,7 @@
<h2><%= @query.new_record? ? l(:label_calendar) : h(@query.name) %></h2> <h2><%= @query.new_record? ? l(:label_calendar) : h(@query.name) %></h2>
<% form_tag({:controller => 'calendars', :action => 'show', :project_id => @project}, :method => :get, :id => 'query_form') do %> <%= form_tag({:controller => 'calendars', :action => 'show', :project_id => @project},
:method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %> <%= hidden_field_tag 'set_filter', '1' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>

View File

@ -1,8 +1,8 @@
xml.instruct! xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title truncate_single_line(@title, :length => 100) xml.title truncate_single_line(@title, :length => 100)
xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false, :escape => false)) xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false))
xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil, :escape => false)) xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil))
xml.id url_for(:controller => 'welcome', :only_path => false) xml.id url_for(:controller => 'welcome', :only_path => false)
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema) xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
xml.author { xml.name "#{Setting.app_title}" } xml.author { xml.name "#{Setting.app_title}" }

View File

@ -2,7 +2,7 @@
&#187; <%= link_to l(@custom_field.type_name), :controller => 'custom_fields', :action => 'index', :tab => @custom_field.class.name %> &#187; <%= link_to l(@custom_field.type_name), :controller => 'custom_fields', :action => 'index', :tab => @custom_field.class.name %>
&#187; <%=h @custom_field.name %></h2> &#187; <%=h @custom_field.name %></h2>
<% labelled_form_for :custom_field, @custom_field, :url => custom_field_path(@custom_field), :html => {:method => :put} do |f| %> <%= labelled_form_for :custom_field, @custom_field, :url => custom_field_path(@custom_field), :html => {:method => :put} do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -2,7 +2,7 @@
&#187; <%= link_to l(@custom_field.type_name), :controller => 'custom_fields', :action => 'index', :tab => @custom_field.class.name %> &#187; <%= link_to l(@custom_field.type_name), :controller => 'custom_fields', :action => 'index', :tab => @custom_field.class.name %>
&#187; <%= l(:label_custom_field_new) %></h2> &#187; <%= l(:label_custom_field_new) %></h2>
<% labelled_form_for :custom_field, @custom_field, :url => custom_fields_path do |f| %> <%= labelled_form_for :custom_field, @custom_field, :url => custom_fields_path do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= hidden_field_tag 'type', @custom_field.type %> <%= hidden_field_tag 'type', @custom_field.type %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_document)%></h2> <h2><%=l(:label_document)%></h2>
<% labelled_form_for @document do |f| %> <%= labelled_form_for @document do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_save) %></p> <p><%= submit_tag l(:button_save) %></p>
<% end %> <% end %>

View File

@ -5,7 +5,7 @@
<div id="add-document" style="display:none;"> <div id="add-document" style="display:none;">
<h2><%=l(:label_document_new)%></h2> <h2><%=l(:label_document_new)%></h2>
<% labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %> <%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<p> <p>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_document_new)%></h2> <h2><%=l(:label_document_new)%></h2>
<% labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %> <%= labelled_form_for @document, :url => project_documents_path(@project), :html => {:multipart => true} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<p><%= submit_tag l(:button_create) %></p> <p><%= submit_tag l(:button_create) %></p>
<% end %> <% end %>

View File

@ -19,7 +19,7 @@
<% if authorize_for('documents', 'add_attachment') %> <% if authorize_for('documents', 'add_attachment') %>
<p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;", <p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;",
:id => 'attach_files_link' %></p> :id => 'attach_files_link' %></p>
<% form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %> <%= form_tag({ :controller => 'documents', :action => 'add_attachment', :id => @document }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %>
<div class="box"> <div class="box">
<p><%= render :partial => 'attachments/form' %></p> <p><%= render :partial => 'attachments/form' %></p>
</div> </div>

View File

@ -1,6 +1,6 @@
<h2><%= l(@enumeration.option_name) %>: <%=h @enumeration %></h2> <h2><%= l(@enumeration.option_name) %>: <%=h @enumeration %></h2>
<% form_tag({}, :method => :delete) do %> <%= form_tag({}, :method => :delete) do %>
<div class="box"> <div class="box">
<p><strong><%= l(:text_enumeration_destroy_question, @enumeration.objects_count) %></strong></p> <p><strong><%= l(:text_enumeration_destroy_question, @enumeration.objects_count) %></strong></p>
<p><label for='reassign_to_id'><%= l(:text_enumeration_category_reassign_to) %></label> <p><label for='reassign_to_id'><%= l(:text_enumeration_category_reassign_to) %></label>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(@enumeration.option_name), enumerations_path %> &#187; <%=h @enumeration %></h2> <h2><%= link_to l(@enumeration.option_name), enumerations_path %> &#187; <%=h @enumeration %></h2>
<% labelled_form_for :enumeration, @enumeration, :url => enumeration_path(@enumeration), :html => {:method => :put} do |f| %> <%= labelled_form_for :enumeration, @enumeration, :url => enumeration_path(@enumeration), :html => {:method => :put} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(@enumeration.option_name), enumerations_path %> &#187; <%=l(:label_enumeration_new)%></h2> <h2><%= link_to l(@enumeration.option_name), enumerations_path %> &#187; <%=l(:label_enumeration_new)%></h2>
<% labelled_form_for :enumeration, @enumeration, :url => enumerations_path do |f| %> <%= labelled_form_for :enumeration, @enumeration, :url => enumerations_path do |f| %>
<%= f.hidden_field :type %> <%= f.hidden_field :type %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>

View File

@ -1,7 +1,7 @@
<h2><%=l(:label_attachment_new)%></h2> <h2><%=l(:label_attachment_new)%></h2>
<%= error_messages_for 'attachment' %> <%= error_messages_for 'attachment' %>
<% form_tag(project_files_path(@project), :multipart => true, :class => "tabular") do %> <%= form_tag(project_files_path(@project), :multipart => true, :class => "tabular") do %>
<div class="box"> <div class="box">
<% if @versions.any? %> <% if @versions.any? %>

View File

@ -1,7 +1,10 @@
<% @gantt.view = self %> <% @gantt.view = self %>
<h2><%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2> <h2><%= @query.new_record? ? l(:label_gantt) : h(@query.name) %></h2>
<% form_tag({:controller => 'gantts', :action => 'show', :project_id => @project, :month => params[:month], :year => params[:year], :months => params[:months]}, :method => :get, :id => 'query_form') do %> <%= form_tag({:controller => 'gantts', :action => 'show',
:project_id => @project, :month => params[:month],
:year => params[:year], :months => params[:months]},
:method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %> <%= hidden_field_tag 'set_filter', '1' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>

View File

@ -1,4 +1,4 @@
<% labelled_form_for @group do |f| %> <%= labelled_form_for @group do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -16,8 +16,9 @@
<td class="project"><%=h membership.project %></td> <td class="project"><%=h membership.project %></td>
<td class="roles"> <td class="roles">
<span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span> <span id="member-<%= membership.id %>-roles"><%=h membership.roles.sort.collect(&:to_s).join(', ') %></span>
<% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @group, :membership_id => membership }, <%= form_for(:membership, :remote => true,
:html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %> :url => { :action => 'edit_membership', :id => @group, :membership_id => membership },
:html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %>
<p><% roles.each do |role| %> <p><% roles.each do |role| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role) %> <%=h role %></label><br /> <label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role) %> <%=h role %></label><br />
<% end %></p> <% end %></p>
@ -55,7 +56,7 @@
<div class="splitcontentright"> <div class="splitcontentright">
<% if projects.any? %> <% if projects.any? %>
<fieldset><legend><%=l(:label_project_new)%></legend> <fieldset><legend><%=l(:label_project_new)%></legend>
<% remote_form_for(:membership, :url => { :action => 'edit_membership', :id => @group }) do %> <%= form_for(:membership, :remote => true, :url => { :action => 'edit_membership', :id => @group }) do %>
<%= label_tag "membership_project_id", l(:description_choose_project), :class => "hidden-for-sighted" %> <%= label_tag "membership_project_id", l(:description_choose_project), :class => "hidden-for-sighted" %>
<%= select_tag 'membership[project_id]', options_for_membership_project_select(@group, projects) %> <%= select_tag 'membership[project_id]', options_for_membership_project_select(@group, projects) %>
<p><%= l(:label_role_plural) %>: <p><%= l(:label_role_plural) %>:

View File

@ -29,7 +29,8 @@
<div class="splitcontentright"> <div class="splitcontentright">
<% users = User.active.not_in_group(@group).all(:limit => 100) %> <% users = User.active.not_in_group(@group).all(:limit => 100) %>
<% if users.any? %> <% if users.any? %>
<% remote_form_for(@group, :url => group_users_path(@group), :html => {:method => :post}) do |f| %> <%= form_for(@group, :remote => true, :url => group_users_path(@group),
:html => {:method => :post}) do |f| %>
<fieldset><legend><%=l(:label_user_new)%></legend> <fieldset><legend><%=l(:label_user_new)%></legend>
<p><%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p> <p><%= label_tag "user_search", l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_group_plural), groups_path %> &#187; <%= l(:label_group_new) %></h2> <h2><%= link_to l(:label_group_plural), groups_path %> &#187; <%= l(:label_group_new) %></h2>
<% labelled_form_for @group do |f| %> <%= labelled_form_for @group do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<p> <p>
<%= f.submit l(:button_create) %> <%= f.submit l(:button_create) %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_issue_category)%>: <%=h @category.name %></h2> <h2><%=l(:label_issue_category)%>: <%=h @category.name %></h2>
<% form_tag(issue_category_path(@category), :method => :delete) do %> <%= form_tag(issue_category_path(@category), :method => :delete) do %>
<div class="box"> <div class="box">
<p><strong><%= l(:text_issue_category_destroy_question, @issue_count) %></strong></p> <p><strong><%= l(:text_issue_category_destroy_question, @issue_count) %></strong></p>
<p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_issue_category_destroy_assignments) %></label><br /> <p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_issue_category_destroy_assignments) %></label><br />

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> &#187; <%=h @issue_status %></h2> <h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> &#187; <%=h @issue_status %></h2>
<% labelled_form_for @issue_status do |f| %> <%= labelled_form_for @issue_status do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> &#187; <%=l(:label_issue_status_new)%></h2> <h2><%= link_to l(:label_issue_status_plural), issue_statuses_path %> &#187; <%=l(:label_issue_status_new)%></h2>
<% labelled_form_for @issue_status do |f| %> <%= labelled_form_for @issue_status do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<div class="contextual"> <div class="contextual">
<%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %> <%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'new', :issue_id => @issue}, :class => 'icon icon-time-add' %> <%= link_to l(:button_log_time), new_issue_time_entry_path(@issue), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %>
<%= watcher_tag(@issue, User.current) %> <%= watcher_tag(@issue, User.current) %>
<%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue}, :class => 'icon icon-copy' %> <%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue}, :class => 'icon icon-copy' %>
<%= link_to l(:button_delete), issue_path(@issue), :confirm => issues_destroy_confirmation_message(@issue), :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue), :confirm => issues_destroy_confirmation_message(@issue), :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %>

View File

@ -1,4 +1,4 @@
<% labelled_fields_for :issue, @issue do |f| %> <%= labelled_fields_for :issue, @issue do |f| %>
<div class="splitcontent"> <div class="splitcontent">
<div class="splitcontentleft"> <div class="splitcontentleft">

View File

@ -1,4 +1,4 @@
<% labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %> <%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %> <%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %> <%= render :partial => 'conflict' if @conflict %>
<div class="box"> <div class="box">
@ -11,7 +11,7 @@
<% end %> <% end %>
<% if User.current.allowed_to?(:log_time, @project) %> <% if User.current.allowed_to?(:log_time, @project) %>
<fieldset class="tabular"><legend><%= l(:button_log_time) %></legend> <fieldset class="tabular"><legend><%= l(:button_log_time) %></legend>
<% labelled_fields_for :time_entry, @time_entry do |time_entry| %> <%= labelled_fields_for :time_entry, @time_entry do |time_entry| %>
<div class="splitcontentleft"> <div class="splitcontentleft">
<p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %></p> <p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %></p>
</div> </div>

View File

@ -1,4 +1,4 @@
<% labelled_fields_for :issue, @issue do |f| %> <%= labelled_fields_for :issue, @issue do |f| %>
<%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %> <%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %>
<% if @issue.safe_attribute? 'is_private' %> <% if @issue.safe_attribute? 'is_private' %>
@ -28,7 +28,7 @@
<label><%= l(:field_description) %></label> <label><%= l(:field_description) %></label>
<%= link_to_function image_tag('edit.png'), <%= link_to_function image_tag('edit.png'),
'Element.hide(this); Effect.toggle("issue_description_and_toolbar", "appear", {duration:0.3})' unless @issue.new_record? %> 'Element.hide(this); Effect.toggle("issue_description_and_toolbar", "appear", {duration:0.3})' unless @issue.new_record? %>
<% content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %> <%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %>
<%= f.text_area :description, <%= f.text_area :description,
:cols => 60, :cols => 60,
:rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min),

View File

@ -1,4 +1,4 @@
<% form_tag({}) do -%> <%= form_tag({}) do -%>
<%= hidden_field_tag 'back_url', url_for(params), :id => nil %> <%= hidden_field_tag 'back_url', url_for(params), :id => nil %>
<div class="autoscroll"> <div class="autoscroll">
<table class="list issues"> <table class="list issues">
@ -27,8 +27,8 @@
<% end %> <% end %>
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>"> <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td> <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
<td class="id"><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td> <td class="id"><%= link_to issue.id, issue_path(issue) %></td>
<% query.columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.css_classes %><% end %> <%= raw query.columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, issue)}</td>"}.join %>
</tr> </tr>
<% end -%> <% end -%>
</tbody> </tbody>

View File

@ -1,5 +1,5 @@
<% if issues && issues.any? %> <% if issues && issues.any? %>
<% form_tag({}) do %> <%= form_tag({}) do %>
<table class="list issues"> <table class="list issues">
<thead><tr> <thead><tr>
<th>#</th> <th>#</th>

View File

@ -7,7 +7,7 @@
) + h(": #{i.subject}")) ) + h(": #{i.subject}"))
}.join("\n").html_safe %></ul> }.join("\n").html_safe %></ul>
<% form_tag({:action => 'bulk_update'}, :id => 'bulk_edit_form') do %> <%= form_tag({:action => 'bulk_update'}, :id => 'bulk_edit_form') do %>
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %> <%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
<div class="box tabular"> <div class="box tabular">
<fieldset class="attributes"> <fieldset class="attributes">

View File

@ -1,6 +1,6 @@
<h2><%= l(:label_confirmation) %></h2> <h2><%= l(:label_confirmation) %></h2>
<% form_tag({}, :method => :delete) do %> <%= form_tag({}, :method => :delete) do %>
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %> <%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
<div class="box"> <div class="box">
<p><strong><%= l(:text_destroy_time_entries_question, :hours => number_with_precision(@hours, :precision => 2)) %></strong></p> <p><strong><%= l(:text_destroy_time_entries_question, :hours => number_with_precision(@hours, :precision => 2)) %></strong></p>

View File

@ -9,7 +9,7 @@
<h2><%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %></h2> <h2><%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %></h2>
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
<% form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, <%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project },
:method => :get, :id => 'query_form') do %> :method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %> <%= hidden_field_tag 'set_filter', '1' %>
<div id="query_form_content" class="hide-when-print"> <div id="query_form_content" class="hide-when-print">
@ -68,7 +68,7 @@
<div id="csv-export-options" style="display:none;"> <div id="csv-export-options" style="display:none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3> <h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<% form_tag(params.merge({:format => 'csv',:page=>nil}), :method => :get, :id => 'csv-export-form') do %> <%= form_tag(params.merge({:format => 'csv',:page=>nil}), :method => :get, :id => 'csv-export-form') do %>
<p> <p>
<label><%= radio_button_tag 'columns', '', true %> <%= l(:description_selected_columns) %></label><br /> <label><%= radio_button_tag 'columns', '', true %> <%= l(:description_selected_columns) %></label><br />
<label><%= radio_button_tag 'columns', 'all' %> <%= l(:description_all_columns) %></label> <label><%= radio_button_tag 'columns', 'all' %> <%= l(:description_all_columns) %></label>

View File

@ -2,7 +2,7 @@
<%= call_hook(:view_issues_new_top, {:issue => @issue}) %> <%= call_hook(:view_issues_new_top, {:issue => @issue}) %>
<% labelled_form_for @issue, :url => project_issues_path(@project), <%= labelled_form_for @issue, :url => project_issues_path(@project),
:html => {:id => 'issue-form', :multipart => true} do |f| %> :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue' %> <%= error_messages_for 'issue' %>
<%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %> <%= hidden_field_tag 'copy_from', params[:copy_from] if params[:copy_from] %>

View File

@ -1,4 +1,4 @@
<% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %> <%= form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %>
<%= label_tag "notes", l(:description_notes), :class => "hidden-for-sighted" %> <%= label_tag "notes", l(:description_notes), :class => "hidden-for-sighted" %>
<%= text_area_tag :notes, @journal.notes, <%= text_area_tag :notes, @journal.notes,
:id => "journal_#{@journal.id}_notes", :id => "journal_#{@journal.id}_notes",

View File

@ -29,17 +29,14 @@
<div id="account"> <div id="account">
<%= render_menu :account_menu -%> <%= render_menu :account_menu -%>
</div> </div>
<%= content_tag( <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
'div',
"#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe,
:id => 'loggedas') if User.current.logged? %>
<%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%> <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
</div> </div>
<div id="header"> <div id="header">
<% if User.current.logged? || !Setting.login_required? %> <% if User.current.logged? || !Setting.login_required? %>
<div id="quick-search"> <div id="quick-search">
<% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %> <%= form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
<%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %> <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
<label for='q'> <label for='q'>
<%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>: <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
@ -59,10 +56,13 @@
<% end %> <% end %>
</div> </div>
<% content_for :sidebar do %>
<%= call_hook :view_layouts_base_sidebar %>
<% end %>
<%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? '' : 'nosidebar')}, true) %> <%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? '' : 'nosidebar')}, true) %>
<div id="sidebar"> <div id="sidebar">
<%= yield :sidebar %> <%= yield :sidebar %>
<%= call_hook :view_layouts_base_sidebar %>
</div> </div>
<div id="content"> <div id="content">

View File

@ -2,11 +2,13 @@
:action => 'show', :project_id => @project, :action => 'show', :project_id => @project,
:id => @board %> &#187; <%= h @message.subject %></h2> :id => @board %> &#187; <%= h @message.subject %></h2>
<% form_for :message, @message, <%= form_for @message, {
:url => {:action => 'edit'}, :as => :message,
:html => {:multipart => true, :url => {:action => 'edit'},
:id => 'message-form', :html => {:multipart => true,
:method => :post} do |f| %> :id => 'message-form',
:method => :post}
} do |f| %>
<%= render :partial => 'form', <%= render :partial => 'form',
:locals => {:f => f, :replying => !@message.parent.nil?} %> :locals => {:f => f, :replying => !@message.parent.nil?} %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>

View File

@ -1,6 +1,6 @@
<h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2> <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
<% form_for :message, @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<%= link_to_remote l(:label_preview), <%= link_to_remote l(:label_preview),

View File

@ -72,7 +72,7 @@
<% if !@topic.locked? && authorize_for('messages', 'reply') %> <% if !@topic.locked? && authorize_for('messages', 'reply') %>
<p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p> <p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
<div id="reply" style="display:none;"> <div id="reply" style="display:none;">
<% form_for :reply, @reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %> <%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %> <%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
<%= submit_tag l(:button_submit) %> <%= submit_tag l(:button_submit) %>
<%= link_to_remote l(:label_preview), <%= link_to_remote l(:label_preview),

View File

@ -6,7 +6,7 @@
<h2><%=l(:label_my_account)%></h2> <h2><%=l(:label_my_account)%></h2>
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
<% labelled_form_for :user, @user, <%= labelled_form_for :user, @user,
:url => { :action => "account" }, :url => { :action => "account" },
:html => { :id => 'my_account_form', :html => { :id => 'my_account_form',
:method => :post } do |f| %> :method => :post } do |f| %>

View File

@ -2,7 +2,7 @@
<div class="warning"> <div class="warning">
<p><%= simple_format l(:text_account_destroy_confirmation)%></p> <p><%= simple_format l(:text_account_destroy_confirmation)%></p>
<p> <p>
<% form_tag({}) do %> <%= form_tag({}) do %>
<label><%= check_box_tag 'confirm', 1 %> <%= l(:general_text_Yes) %></label> <label><%= check_box_tag 'confirm', 1 %> <%= l(:general_text_Yes) %></label>
<%= submit_tag l(:button_delete_my_account) %> | <%= submit_tag l(:button_delete_my_account) %> |
<%= link_to l(:button_cancel), :action => 'account' %> <%= link_to l(:button_cancel), :action => 'account' %>

View File

@ -35,7 +35,7 @@ function removeBlock(block) {
</script> </script>
<div class="contextual"> <div class="contextual">
<% form_tag({:action => "add_block"}, :id => "block-form") do %> <%= form_tag({:action => "add_block"}, :id => "block-form") do %>
<%= label_tag('block-select', l(:label_my_page_block)) %>: <%= label_tag('block-select', l(:label_my_page_block)) %>:
<%= select_tag 'block', <%= select_tag 'block',
"<option></option>".html_safe + options_for_select(@block_options), "<option></option>".html_safe + options_for_select(@block_options),

View File

@ -2,7 +2,7 @@
<%= error_messages_for 'user' %> <%= error_messages_for 'user' %>
<% form_tag({}, :class => "tabular") do %> <%= form_tag({}, :class => "tabular") do %>
<div class="box"> <div class="box">
<p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label> <p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label>
<%= password_field_tag 'password', nil, :size => 25 %></p> <%= password_field_tag 'password', nil, :size => 25 %></p>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_news)%></h2> <h2><%=l(:label_news)%></h2>
<% labelled_form_for @news, :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> <%= labelled_form_for @news, :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<%= link_to_remote l(:label_preview), <%= link_to_remote l(:label_preview),

View File

@ -7,7 +7,7 @@
<div id="add-news" style="display:none;"> <div id="add-news" style="display:none;">
<h2><%=l(:label_news_new)%></h2> <h2><%=l(:label_news_new)%></h2>
<% labelled_form_for @news, :url => project_news_index_path(@project), <%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form', :multipart => true } do |f| %> :html => { :id => 'news-form', :multipart => true } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %> <%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_news_new)%></h2> <h2><%=l(:label_news_new)%></h2>
<% labelled_form_for @news, :url => project_news_index_path(@project), <%= labelled_form_for @news, :url => project_news_index_path(@project),
:html => { :id => 'news-form', :multipart => true } do |f| %> :html => { :id => 'news-form', :multipart => true } do |f| %>
<%= render :partial => 'news/form', :locals => { :f => f } %> <%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>

View File

@ -16,7 +16,7 @@
<% if authorize_for('news', 'edit') %> <% if authorize_for('news', 'edit') %>
<div id="edit-news" style="display:none;"> <div id="edit-news" style="display:none;">
<% labelled_form_for :news, @news, :url => news_path(@news), <%= labelled_form_for :news, @news, :url => news_path(@news),
:html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
@ -55,7 +55,7 @@
<% if @news.commentable? %> <% if @news.commentable? %>
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p> <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
<% form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %> <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
<div class="box"> <div class="box">
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %> <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'comment_comments' %> <%= wikitoolbar_for 'comment_comments' %>

View File

@ -1,4 +1,4 @@
<% labelled_form_for @project do |f| %> <%= labelled_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_project_new)%></h2> <h2><%=l(:label_project_new)%></h2>
<% labelled_form_for @project, :url => { :action => "copy" } do |f| %> <%= labelled_form_for @project, :url => { :action => "copy" } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<fieldset class="box tabular"><legend><%= l(:button_copy) %></legend> <fieldset class="box tabular"><legend><%= l(:button_copy) %></legend>

View File

@ -8,7 +8,7 @@
<% end %> <% end %>
</p> </p>
<p> <p>
<% form_tag(project_path(@project_to_destroy), :method => :delete) do %> <%= form_tag(project_path(@project_to_destroy), :method => :delete) do %>
<label><%= check_box_tag 'confirm', 1 %> <%= l(:general_text_Yes) %></label> <label><%= check_box_tag 'confirm', 1 %> <%= l(:general_text_Yes) %></label>
<%= submit_tag l(:button_delete) %> <%= submit_tag l(:button_delete) %>
<% end %> <% end %>

View File

@ -4,7 +4,7 @@
<div class="contextual"> <div class="contextual">
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %> <%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
<%= link_to(l(:label_issue_view_all), { :controller => 'issues' }) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %> <%= link_to(l(:label_issue_view_all), issues_path) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %>
<%= link_to(l(:label_overall_spent_time), time_entries_path) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %> <%= link_to(l(:label_overall_spent_time), time_entries_path) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
<%= link_to l(:label_overall_activity), <%= link_to l(:label_overall_activity),
{ :controller => 'activities', :action => 'index', { :controller => 'activities', :action => 'index',

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_project_new)%></h2> <h2><%=l(:label_project_new)%></h2>
<% labelled_form_for @project do |f| %> <%= labelled_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %> <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>

View File

@ -1,4 +1,4 @@
<% form_tag(project_enumerations_path(@project), :method => :put, :class => "tabular") do %> <%= form_tag(project_enumerations_path(@project), :method => :put, :class => "tabular") do %>
<table class="list"> <table class="list">
<thead><tr> <thead><tr>
@ -11,7 +11,7 @@
</tr></thead> </tr></thead>
<% @project.activities(true).each do |enumeration| %> <% @project.activities(true).each do |enumeration| %>
<% fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %> <%= fields_for "enumerations[#{enumeration.id}]", enumeration do |ff| %>
<tr class="<%= cycle('odd', 'even') %>"> <tr class="<%= cycle('odd', 'even') %>">
<td> <td>
<%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %> <%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %>

View File

@ -1,4 +1,4 @@
<% form_for :project, @project, <%= form_for @project,
:url => { :action => 'modules', :id => @project }, :url => { :action => 'modules', :id => @project },
:html => {:id => 'modules-form', :html => {:id => 'modules-form',
:method => :post} do |f| %> :method => :post} do |f| %>

View File

@ -12,7 +12,7 @@
</div> </div>
<ul> <ul>
<% unless @project.homepage.blank? %> <% unless @project.homepage.blank? %>
<li><%=l(:field_homepage)%>: <%= auto_link(h(@project.homepage)).html_safe %></li> <li><%=l(:field_homepage)%>: <%= link_to h(@project.homepage), @project.homepage %></li>
<% end %> <% end %>
<% if @subprojects.any? %> <% if @subprojects.any? %>
<li><%=l(:label_subproject_plural)%>: <li><%=l(:label_subproject_plural)%>:
@ -69,8 +69,8 @@
<% if @total_hours.present? %> <% if @total_hours.present? %>
<h3><%= l(:label_spent_time) %></h3> <h3><%= l(:label_spent_time) %></h3>
<p><span class="icon icon-time"><%= l_hours(@total_hours) %></span></p> <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}) %> | <p><%= link_to(l(:label_details), project_time_entries_path(@project)) %> |
<%= link_to(l(:label_report), {:controller => 'timelog', :action => 'report', :project_id => @project}) %></p> <%= link_to(l(:label_report), report_project_time_entries_path(@project)) %></p>
<% end %> <% end %>
<%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %> <%= call_hook(:view_projects_show_sidebar_bottom, :project => @project) %>
<% end %> <% end %>

View File

@ -5,7 +5,7 @@
<% query.available_filters.sort{|a,b| a[1][:order]<=>b[1][:order]}.each do |filter| %> <% query.available_filters.sort{|a,b| a[1][:order]<=>b[1][:order]}.each do |filter| %>
<% field = filter[0] <% field = filter[0]
options = filter[1] %> options = filter[1] %>
<tr <%= 'style="display:none;"' unless query.has_filter?(field) %> id="tr_<%= field %>" class="filter"> <tr <%= 'style="display:none;"'.html_safe unless query.has_filter?(field) %> id="tr_<%= field %>" class="filter">
<td class="field"> <td class="field">
<%= check_box_tag 'f[]', field, query.has_filter?(field), :onclick => "toggle_filter('#{field}');", :id => "cb_#{field}" %> <%= check_box_tag 'f[]', field, query.has_filter?(field), :onclick => "toggle_filter('#{field}');", :id => "cb_#{field}" %>
<label for="cb_<%= field %>"><%= filter[1][:name] || l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) %></label> <label for="cb_<%= field %>"><%= filter[1][:name] || l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) %></label>

View File

@ -1,6 +1,6 @@
<h2><%= l(:label_query) %></h2> <h2><%= l(:label_query) %></h2>
<% form_tag(query_path(@query), :onsubmit => 'selectAllOptions("selected_columns");', :method => :put) do %> <%= form_tag(query_path(@query), :onsubmit => 'selectAllOptions("selected_columns");', :method => :put) do %>
<%= render :partial => 'form', :locals => {:query => @query} %> <%= render :partial => 'form', :locals => {:query => @query} %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<h2><%= l(:label_query_new) %></h2> <h2><%= l(:label_query_new) %></h2>
<% form_tag(@project ? project_queries_path : queries_path, :onsubmit => 'selectAllOptions("selected_columns");') do %> <%= form_tag(@project ? project_queries_path(@project) : queries_path, :onsubmit => 'selectAllOptions("selected_columns");') do %>
<%= render :partial => 'form', :locals => {:query => @query} %> <%= render :partial => 'form', :locals => {:query => @query} %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -6,7 +6,7 @@
{:action => 'stats', :id => @project, :repository_id => @repository.identifier_param}, {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
:class => 'icon icon-stats' if @repository.supports_all_revisions? %> :class => 'icon icon-stats' if @repository.supports_all_revisions? %>
<% form_tag({:action => controller.action_name, <%= form_tag({:action => controller.action_name,
:id => @project, :id => @project,
:repository_id => @repository.identifier_param, :repository_id => @repository.identifier_param,
:path => to_path_param(@path), :path => to_path_param(@path),

View File

@ -14,7 +14,7 @@
:space => graph_space :space => graph_space
} }
end %> end %>
<% form_tag( <%= form_tag(
{:controller => 'repositories', :action => 'diff', :id => project, {:controller => 'repositories', :action => 'diff', :id => project,
:repository_id => @repository.identifier_param, :path => to_path_param(path)}, :repository_id => @repository.identifier_param, :path => to_path_param(path)},
:method => :get :method => :get

View File

@ -6,7 +6,7 @@
<p class="nodata"><%= l(:label_no_data) %></p> <p class="nodata"><%= l(:label_no_data) %></p>
<% else %> <% else %>
<% form_tag({}) do %> <%= form_tag({}) do %>
<table class="list"> <table class="list">
<thead> <thead>
<tr> <tr>

View File

@ -1,7 +1,7 @@
<h2><%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %></h2> <h2><%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %></h2>
<!-- Choose view type --> <!-- Choose view type -->
<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %> <%= form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
<%= hidden_field_tag('rev', params[:rev]) if params[:rev] %> <%= hidden_field_tag('rev', params[:rev]) if params[:rev] %>
<%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %> <%= hidden_field_tag('rev_to', params[:rev_to]) if params[:rev_to] %>
<p> <p>

View File

@ -1,5 +1,5 @@
<h2><%= l(:label_repository) %></h2> <h2><%= l(:label_repository) %></h2>
<% labelled_form_for :repository, @repository, :url => repository_path(@path), :html => {:method => :put} do |f| %> <%= labelled_form_for :repository, @repository, :url => repository_path(@path), :html => {:method => :put} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<% end %> <% end %>

View File

@ -1,5 +1,5 @@
<h2><%= l(:label_repository_new) %></h2> <h2><%= l(:label_repository_new) %></h2>
<% labelled_form_for :repository, @repository, :url => project_repositories_path(@project) do |f| %> <%= labelled_form_for :repository, @repository, :url => project_repositories_path(@project) do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %> <%= render :partial => 'form', :locals => {:f => f} %>
<% end %> <% end %>

View File

@ -13,7 +13,7 @@
<% end -%> <% end -%>
&#187;&nbsp; &#187;&nbsp;
<% form_tag({:controller => 'repositories', <%= form_tag({:controller => 'repositories',
:action => 'revision', :action => 'revision',
:id => @project, :id => @project,
:repository_id => @repository.identifier_param, :repository_id => @repository.identifier_param,

View File

@ -1,6 +1,6 @@
<div class="contextual"> <div class="contextual">
<% form_tag( <%= form_tag(
{:action => 'revision', :id => @project, {:controller => 'repositories', :action => 'revision', :id => @project,
:repository_id => @repository.identifier_param} :repository_id => @repository.identifier_param}
) do %> ) do %>
<%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 8 %> <%= l(:label_revision) %>: <%= text_field_tag 'rev', @rev, :size => 8 %>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_role_plural), roles_path %> &#187; <%=h @role.name %></h2> <h2><%= link_to l(:label_role_plural), roles_path %> &#187; <%=h @role.name %></h2>
<% labelled_form_for @role do |f| %> <%= labelled_form_for @role do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_role_plural), roles_path %> &#187; <%=l(:label_role_new)%></h2> <h2><%= link_to l(:label_role_plural), roles_path %> &#187; <%=l(:label_role_new)%></h2>
<% labelled_form_for @role do |f| %> <%= labelled_form_for @role do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %> <%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<% end %> <% end %>

View File

@ -1,6 +1,6 @@
<h2><%= link_to l(:label_role_plural), roles_path %> &#187; <%=l(:label_permissions_report)%></h2> <h2><%= link_to l(:label_role_plural), roles_path %> &#187; <%=l(:label_permissions_report)%></h2>
<% form_tag(permissions_roles_path, :id => 'permissions_form') do %> <%= form_tag(permissions_roles_path, :id => 'permissions_form') do %>
<%= hidden_field_tag 'permissions[0]', '', :id => nil %> <%= hidden_field_tag 'permissions[0]', '', :id => nil %>
<div class="autoscroll"> <div class="autoscroll">
<table class="list permissions"> <table class="list permissions">

View File

@ -1,7 +1,7 @@
<h2><%= l(:label_search) %></h2> <h2><%= l(:label_search) %></h2>
<div class="box"> <div class="box">
<% form_tag({}, :method => :get) do %> <%= form_tag({}, :method => :get) do %>
<%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %> <%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %>
<p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %> <p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
<%= javascript_tag "Field.focus('search-input')" %> <%= javascript_tag "Field.focus('search-input')" %>

View File

@ -1,4 +1,4 @@
<% form_tag({:action => 'edit', :tab => 'authentication'}) do %> <%= form_tag({:action => 'edit', :tab => 'authentication'}) do %>
<div class="box tabular settings"> <div class="box tabular settings">
<p><%= setting_check_box :login_required %></p> <p><%= setting_check_box :login_required %></p>

View File

@ -1,4 +1,4 @@
<% form_tag({:action => 'edit', :tab => 'display'}) do %> <%= form_tag({:action => 'edit', :tab => 'display'}) do %>
<div class="box tabular settings"> <div class="box tabular settings">
<p><%= setting_select :ui_theme, Redmine::Themes.themes.collect {|t| [t.name, t.id]}, :blank => :label_default, :label => :label_theme %></p> <p><%= setting_select :ui_theme, Redmine::Themes.themes.collect {|t| [t.name, t.id]}, :blank => :label_default, :label => :label_theme %></p>

Some files were not shown because too many files have changed in this diff Show More