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/email.yml
/config/initializers/session_store.rb
/config/initializers/secret_token.rb
/coverage
/db/*.db
/db/*.sqlite3

View File

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

14
Gemfile
View File

@ -1,10 +1,12 @@
source :rubygems
source 'http://rubygems.org'
gem "rails", "2.3.14"
gem "i18n", "~> 0.4.2"
gem 'rails', '3.2.3'
gem 'prototype-rails', '3.2.1'
gem "i18n", "~> 0.6.0"
gem "coderay", "~> 1.0.6"
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
gem "tzinfo", "~> 0.3.31"
gem "builder"
# Optional gem for LDAP authentication
group :ldap do
@ -14,6 +16,7 @@ end
# Optional gem for OpenID authentication
group :openid do
gem "ruby-openid", "~> 2.1.4", :require => "openid"
gem "rack-openid"
end
# 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
group :mysql do
gem "mysql2", "~> 0.2.7"
gem "mysql2", "~> 0.3.11"
end
end
@ -69,8 +72,9 @@ group :development do
gem "rdoc", ">= 2.4.2"
end
group :test do
gem "shoulda", "~> 2.10.3"
gem "shoulda"
gem "mocha"
end

View File

@ -1,15 +1,7 @@
#!/usr/bin/env 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'
require 'rake/testtask'
begin
require 'rdoc/task'
rescue LoadError
# RDoc is not available
end
require 'tasks/rails'
RedmineApp::Application.load_tasks

View File

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

View File

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

View File

@ -18,6 +18,7 @@
require 'SVG/Graph/Bar'
require 'SVG/Graph/BarHorizontal'
require 'digest/sha1'
require 'redmine/scm/adapters/abstract_adapter'
class ChangesetNotFound < Exception; end
class InvalidRevisionParam < Exception; end
@ -307,8 +308,7 @@ class RepositoriesController < ApplicationController
@repository = @project.repository
end
(render_404; return false) unless @repository
@path = params[:path].join('/') unless params[:path].nil?
@path ||= ''
@path = params[:path].is_a?(Array) ? params[:path].join('/') : params[:path].to_s
@rev = params[:rev].blank? ? @repository.default_branch : params[:rev].to_s.strip
@rev_to = params[:rev_to]
@ -343,15 +343,15 @@ class RepositoriesController < ApplicationController
@date_to = Date.today
@date_from = @date_to << 11
@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,
: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_day.each {|c| commits_by_month[c.first.to_date.months_ago] += c.last }
changes_by_day = repository.changes.count(
:all, :group => :commit_date,
:conditions => ["commit_date BETWEEN ? AND ?", @date_from, @date_to])
changes_by_day = Change.count(
:all, :group => :commit_date, :include => :changeset,
: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_day.each {|c| changes_by_month[c.first.to_date.months_ago] += c.last }
@ -384,10 +384,10 @@ class RepositoriesController < ApplicationController
end
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}
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}
fields = commits_by_author.collect {|r| r.first}

View File

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

View File

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

View File

@ -930,6 +930,9 @@ module ApplicationHelper
def labelled_form_for(*args, &proc)
args << {} unless args.last.is_a?(Hash)
options = args.last
if args.first.is_a?(Symbol)
options.merge!(:as => args.shift)
end
options.merge!({:builder => Redmine::Views::LabelledFormBuilder})
form_for(*args, &proc)
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>')
def avatar(user, options = { })
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
if user.respond_to?(:mail)
email = user.mail
@ -1079,7 +1082,7 @@ module ApplicationHelper
# Returns the javascript tags that are included in the html layout head
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'
tags << "\n".html_safe + javascript_tag("Event.observe(window, 'load', function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });")
end

View File

@ -21,14 +21,14 @@ module WikiHelper
def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0)
pages = pages.group_by(&:parent) unless pages.is_a?(Hash)
s = ''
s = ''.html_safe
if pages.has_key?(parent)
pages[parent].each do |page|
attrs = "value='#{page.id}'"
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)
end
end

View File

@ -80,7 +80,7 @@ class CustomField < ActiveRecord::Base
when 'bool'
[[l(:general_text_Yes), '1'], [l(:general_text_No), '0']]
else
read_possible_values_utf8_encoded || []
possible_values || []
end
end
@ -91,14 +91,20 @@ class CustomField < ActiveRecord::Base
when 'bool'
['1', '0']
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
# Makes possible_values accept a multiline string
def possible_values=(arg)
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
self.possible_values = arg.to_s.split(/[\n\r]+/)
end
@ -218,14 +224,4 @@ class CustomField < ActiveRecord::Base
end
errs
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

View File

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

View File

@ -15,7 +15,9 @@
# along with this program; if not, write to the Free Software
# 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 Redmine::I18n
@ -39,7 +41,14 @@ class MailHandler < ActionMailer::Base
@@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)
super email
mail = TMail::Mail.parse(email)
mail.base64_decode
new.receive(mail)
end
def logger
Rails.logger
end
cattr_accessor :ignored_emails_headers

View File

@ -21,13 +21,10 @@ class Mailer < ActionMailer::Base
helper :issues
helper :custom_fields
include ActionController::UrlWriter
include Redmine::I18n
def self.default_url_options
h = Setting.host_name
h = h.to_s.gsub(%r{\/.*$}, '') unless Redmine::Utils.relative_url_root.blank?
{ :host => h, :protocol => Setting.protocol }
{ :host => Setting.host_name, :protocol => Setting.protocol }
end
# 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
message_id issue
@author = issue.author
recipients issue.recipients
cc(issue.watcher_recipients - @recipients)
subject "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
body :issue => issue,
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)
render_multipart('issue_add', body)
@issue = issue
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)
recipients = issue.recipients
cc = issue.watcher_recipients - recipients
mail :to => recipients,
:cc => cc,
:subject => "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}"
end
# Builds a tmail object used to email recipients of the edited issue.
@ -64,30 +62,29 @@ class Mailer < ActionMailer::Base
message_id journal
references issue
@author = journal.user
recipients issue.recipients
recipients = issue.recipients
# Watchers in cc
cc(issue.watcher_recipients - @recipients)
cc = issue.watcher_recipients - recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject
subject s
body :issue => issue,
:journal => journal,
:issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
render_multipart('issue_edit', body)
@issue = issue
@journal = journal
@issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => "change-#{journal.id}")
mail :to => recipients,
:cc => cc,
:subject => s
end
def reminder(user, issues, days)
set_language_if_valid user.language
recipients user.mail
subject l(:mail_subject_reminder, :count => issues.size, :days => days)
body :issues => issues,
:days => days,
:issues_url => url_for(:controller => 'issues', :action => 'index',
@issues = issues
@days = days
@issues_url = url_for(:controller => 'issues', :action => 'index',
:set_filter => 1, :assigned_to_id => user.id,
:sort => 'due_date:asc')
render_multipart('reminder', body)
mail :to => user.mail,
:subject => l(:mail_subject_reminder, :count => issues.size, :days => days)
end
# 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
def document_added(document)
redmine_headers 'Project' => document.project.identifier
recipients document.recipients
@author = User.current
subject "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
body :document => document,
:document_url => url_for(:controller => 'documents', :action => 'show', :id => document)
render_multipart('document_added', body)
@document = document
@document_url = url_for(:controller => 'documents', :action => 'show', :id => document)
mail :to => document.recipients,
:subject => "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}"
end
# 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'
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => 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'
added_to_url = url_for(:controller => 'files', :action => 'index', :project_id => container.project)
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'
added_to_url = url_for(:controller => 'documents', :action => 'show', :id => container.id)
added_to = "#{l(:label_document)}: #{container.title}"
recipients container.recipients
recipients = container.recipients
end
redmine_headers 'Project' => container.project.identifier
subject "[#{container.project.name}] #{l(:label_attachment_new)}"
body :attachments => attachments,
:added_to => added_to,
:added_to_url => added_to_url
render_multipart('attachments_added', body)
@attachments = attachments
@added_to = added_to
@added_to_url = added_to_url
mail :to => recipients,
:subject => "[#{container.project.name}] #{l(:label_attachment_new)}"
end
# 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
@author = news.author
message_id news
recipients news.recipients
subject "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
body :news => news,
:news_url => url_for(:controller => 'news', :action => 'show', :id => news)
render_multipart('news_added', body)
@news = news
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
mail :to => news.recipients,
:subject => "[#{news.project.name}] #{l(:label_news)}: #{news.title}"
end
# 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
@author = comment.author
message_id comment
recipients news.recipients
cc news.watcher_recipients
subject "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}"
body :news => news,
:comment => comment,
:news_url => url_for(:controller => 'news', :action => 'show', :id => news)
render_multipart('news_comment_added', body)
@news = news
@comment = comment
@news_url = url_for(:controller => 'news', :action => 'show', :id => news)
mail :to => news.recipients,
:cc => news.watcher_recipients,
:subject => "Re: [#{news.project.name}] #{l(:label_news)}: #{news.title}"
end
# 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
message_id message
references message.parent unless message.parent.nil?
recipients(message.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}"
body :message => message,
:message_url => url_for(message.event_url)
render_multipart('message_posted', body)
recipients = message.recipients
cc = ((message.root.watcher_recipients + message.board.watcher_recipients).uniq - recipients)
@message = message
@message_url = url_for(message.event_url)
mail :to => recipients,
:cc => cc,
:subject => "[#{message.board.project.name} - #{message.board.name} - msg#{message.root.id}] #{message.subject}"
end
# 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
@author = wiki_content.author
message_id wiki_content
recipients wiki_content.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)}"
body :wiki_content => wiki_content,
:wiki_content_url => url_for(:controller => 'wiki', :action => 'show',
recipients = wiki_content.recipients
cc = wiki_content.page.wiki.watcher_recipients - recipients
@wiki_content = wiki_content
@wiki_content_url = url_for(:controller => 'wiki', :action => 'show',
:project_id => wiki_content.project,
: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
# 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
@author = wiki_content.author
message_id wiki_content
recipients wiki_content.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)}"
body :wiki_content => wiki_content,
:wiki_content_url => url_for(:controller => 'wiki', :action => 'show',
recipients = wiki_content.recipients
cc = wiki_content.page.wiki.watcher_recipients + wiki_content.page.watcher_recipients - recipients
@wiki_content = wiki_content
@wiki_content_url = url_for(:controller => 'wiki', :action => 'show',
:project_id => wiki_content.project,
:id => wiki_content.page.title),
:wiki_diff_url => url_for(:controller => 'wiki', :action => 'diff',
:id => wiki_content.page.title)
@wiki_diff_url = url_for(:controller => 'wiki', :action => 'diff',
:project_id => wiki_content.project, :id => wiki_content.page.title,
: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
# 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
def account_information(user, password)
set_language_if_valid user.language
recipients user.mail
subject l(:mail_subject_register, Setting.app_title)
body :user => user,
:password => password,
:login_url => url_for(:controller => 'account', :action => 'login')
render_multipart('account_information', body)
@user = user
@password = password
@login_url = url_for(:controller => 'account', :action => 'login')
mail :to => user.mail,
:subject => l(:mail_subject_register, Setting.app_title)
end
# 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
def account_activation_request(user)
# Send the email to all active administrators
recipients User.active.find(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact
subject l(:mail_subject_account_activation_request, Setting.app_title)
body :user => user,
:url => url_for(:controller => 'users', :action => 'index',
recipients = User.active.find(:all, :conditions => {:admin => true}).collect { |u| u.mail }.compact
@user = user
@url = url_for(:controller => 'users', :action => 'index',
:status => User::STATUS_REGISTERED,
: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
# 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
def account_activated(user)
set_language_if_valid user.language
recipients user.mail
subject l(:mail_subject_register, Setting.app_title)
body :user => user,
:login_url => url_for(:controller => 'account', :action => 'login')
render_multipart('account_activated', body)
@user = user
@login_url = url_for(:controller => 'account', :action => 'login')
mail :to => user.mail,
:subject => l(:mail_subject_register, Setting.app_title)
end
def lost_password(token)
set_language_if_valid(token.user.language)
recipients token.user.mail
subject l(:mail_subject_lost_password, Setting.app_title)
body :token => token,
:url => url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
render_multipart('lost_password', body)
@token = token
@url = url_for(:controller => 'account', :action => 'lost_password', :token => token.value)
mail :to => token.user.mail,
:subject => l(:mail_subject_lost_password, Setting.app_title)
end
def register(token)
set_language_if_valid(token.user.language)
recipients token.user.mail
subject l(:mail_subject_register, Setting.app_title)
body :token => token,
:url => url_for(:controller => 'account', :action => 'activate', :token => token.value)
render_multipart('register', body)
@token = token
@url = url_for(:controller => 'account', :action => 'activate', :token => token.value)
mail :to => token.user.mail,
:subject => l(:mail_subject_register, Setting.app_title)
end
def test_email(user)
set_language_if_valid(user.language)
recipients user.mail
subject 'Redmine test'
body :url => url_for(:controller => 'welcome')
render_multipart('test_email', body)
@url = url_for(:controller => 'welcome')
mail :to => user.mail,
:subject => 'Redmine test'
end
# Overrides default deliver! method to prevent from sending an email
@ -313,13 +305,6 @@ class Mailer < ActionMailer::Base
(cc.nil? || cc.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
raise_errors = self.class.raise_delivery_errors
@ -383,83 +368,72 @@ class Mailer < ActionMailer::Base
ActionMailer::Base.delivery_method = saved_method
end
private
def initialize_defaults(method_name)
super
@initial_language = current_language
set_language_if_valid Setting.default_language
from Setting.mail_from
# Common headers
headers 'X-Mailer' => 'Redmine',
def mail(headers={})
headers.merge! 'X-Mailer' => 'Redmine',
'X-Redmine-Host' => Setting.host_name,
'X-Redmine-Site' => Setting.app_title,
'X-Auto-Response-Suppress' => 'OOF',
'Auto-Submitted' => 'auto-generated'
end
'Auto-Submitted' => 'auto-generated',
'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
# if he doesn't want to receive notifications about what he does
if @author && @author.logged? && @author.pref[:no_self_notified]
if recipients
recipients((recipients.is_a?(Array) ? recipients : [recipients]) - [@author.mail])
end
if cc
cc((cc.is_a?(Array) ? cc : [cc]) - [@author.mail])
end
headers[:to].delete(@author.mail) if headers[:to].is_a?(Array)
headers[:cc].delete(@author.mail) if headers[:cc].is_a?(Array)
end
if @author && @author.logged?
redmine_headers 'Sender' => @author.login
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
if Setting.bcc_recipients?
bcc(notified_users)
recipients []
cc []
headers[:bcc] = [headers[:to], headers[:cc]].flatten.uniq.reject(&:blank?)
headers[:to] = nil
headers[:cc] = nil
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
end
# Rails 2.3 has problems rendering implicit multipart messages with
# layouts so this method will wrap an multipart messages with
# explicit parts.
#
# 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')
def self.method_missing(method, *args, &block)
if m = method.to_s.match(%r{^deliver_(.+)$})
send(m[1], *args).deliver
else
content_type "multipart/alternative"
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)
super
end
end
# Makes partial rendering work with Rails 1.2 (retro-compatibility)
def self.controller_path
''
end unless respond_to?('controller_path')
private
# 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
# Returns a predictable Message-Id for the given 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")}"
host = Setting.mail_from.to_s.gsub(%r{^.*@}, '')
host = "#{::Socket.gethostname}.redmine" if host.empty?
"<#{hash}@#{host}>"
"#{hash}@#{host}"
end
private
def message_id(object)
@message_id_object = object
end
@ -487,12 +459,3 @@ class Mailer < ActionMailer::Base
Rails.logger
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
def self.find_by_param(*args)
self.find(*args)
end
def reload(*args)
@shared_versions = nil
@rolled_up_versions = nil

View File

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

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<h2><%=l(:label_password_lost)%></h2>
<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>
<%= text_field_tag 'mail', nil, :size => 40 %>

View File

@ -2,7 +2,7 @@
<%= error_messages_for 'user' %>
<% form_tag({:token => @token.value}) do %>
<%= form_tag({:token => @token.value}) do %>
<div class="box tabular">
<p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label>
<%= 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>
<% labelled_form_for @user, :url => {:action => 'register'} do |f| %>
<%= labelled_form_for @user, :url => {:action => 'register'} do |f| %>
<%= error_messages_for 'user' %>
<div class="box tabular">

View File

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

View File

@ -1,5 +1,5 @@
<div class="nodata">
<% form_tag({:action => 'default_configuration'}) do %>
<%= form_tag({:action => 'default_configuration'}) do %>
<%= simple_format(l(:text_no_configuration_data)) %>
<p><%= l(:field_language) %>:
<%= 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>
<% form_tag({}, :method => :get) do %>
<%= form_tag({}, :method => :get) do %>
<fieldset><legend><%= l(:label_filter_plural) %></legend>
<label for='status'><%= l(:field_status) %> :</label>
<%= 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>
</div>
<p>
<% form_tag({}, :method => 'get') do %>
<%= form_tag({}, :method => 'get') do %>
<label><%= l(:label_view_diff) %></label>
<%= select_tag 'type',
options_for_select(

View File

@ -1,6 +1,6 @@
<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) %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<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 %>
<%= render :partial => auth_source_partial_name(@auth_source) %>
<%= submit_tag l(:button_create) %>

View File

@ -1,6 +1,6 @@
<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} %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<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} %>
<%= submit_tag l(:button_create) %>
<% end %>

View File

@ -11,7 +11,7 @@
<div id="add-message" style="display:none;">
<% 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>
<% 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} %>
<p><%= submit_tag l(:button_create) %>
<%= link_to_remote l(:label_preview),

View File

@ -1,6 +1,7 @@
<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' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>

View File

@ -1,8 +1,8 @@
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
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" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil, :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))
xml.id url_for(:controller => 'welcome', :only_path => false)
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
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; <%=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 } %>
<%= submit_tag l(:button_save) %>
<% 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; <%= 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 } %>
<%= hidden_field_tag 'type', @custom_field.type %>
<%= submit_tag l(:button_save) %>

View File

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

View File

@ -5,7 +5,7 @@
<div id="add-document" style="display:none;">
<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} %>
<p>
<%= submit_tag l(:button_create) %>

View File

@ -1,6 +1,6 @@
<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} %>
<p><%= submit_tag l(:button_create) %></p>
<% end %>

View File

@ -19,7 +19,7 @@
<% 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;",
: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">
<p><%= render :partial => 'attachments/form' %></p>
</div>

View File

@ -1,6 +1,6 @@
<h2><%= l(@enumeration.option_name) %>: <%=h @enumeration %></h2>
<% form_tag({}, :method => :delete) do %>
<%= form_tag({}, :method => :delete) do %>
<div class="box">
<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>

View File

@ -1,6 +1,6 @@
<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} %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<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 %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %>

View File

@ -1,7 +1,7 @@
<h2><%=l(:label_attachment_new)%></h2>
<%= 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">
<% if @versions.any? %>

View File

@ -1,7 +1,10 @@
<% @gantt.view = self %>
<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' %>
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<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 } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -16,8 +16,9 @@
<td class="project"><%=h membership.project %></td>
<td class="roles">
<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 },
:html => { :id => "member-#{membership.id}-roles-form", :style => 'display:none;'}) do %>
<%= form_for(:membership, :remote => true,
: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| %>
<label><%= check_box_tag 'membership[role_ids][]', role.id, membership.roles.include?(role) %> <%=h role %></label><br />
<% end %></p>
@ -55,7 +56,7 @@
<div class="splitcontentright">
<% if projects.any? %>
<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" %>
<%= select_tag 'membership[project_id]', options_for_membership_project_select(@group, projects) %>
<p><%= l(:label_role_plural) %>:

View File

@ -29,7 +29,8 @@
<div class="splitcontentright">
<% users = User.active.not_in_group(@group).all(:limit => 100) %>
<% 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>
<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>
<% labelled_form_for @group do |f| %>
<%= labelled_form_for @group do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<p>
<%= f.submit l(:button_create) %>

View File

@ -1,6 +1,6 @@
<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">
<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 />

View File

@ -1,6 +1,6 @@
<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} %>
<%= submit_tag l(:button_save) %>
<% 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>
<% labelled_form_for @issue_status do |f| %>
<%= labelled_form_for @issue_status do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %>
<% end %>

View File

@ -1,6 +1,6 @@
<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_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) %>
<%= 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) %>

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="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' %>
<%= render :partial => 'conflict' if @conflict %>
<div class="box">
@ -11,7 +11,7 @@
<% end %>
<% if User.current.allowed_to?(:log_time, @project) %>
<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">
<p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %></p>
</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 }) %>
<% if @issue.safe_attribute? 'is_private' %>
@ -28,7 +28,7 @@
<label><%= l(:field_description) %></label>
<%= link_to_function image_tag('edit.png'),
'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,
:cols => 60,
: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 %>
<div class="autoscroll">
<table class="list issues">
@ -27,8 +27,8 @@
<% end %>
<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="id"><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
<% query.columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.css_classes %><% end %>
<td class="id"><%= link_to issue.id, issue_path(issue) %></td>
<%= raw query.columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, issue)}</td>"}.join %>
</tr>
<% end -%>
</tbody>

View File

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

View File

@ -7,7 +7,7 @@
) + h(": #{i.subject}"))
}.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 %>
<div class="box tabular">
<fieldset class="attributes">

View File

@ -1,6 +1,6 @@
<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 %>
<div class="box">
<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>
<% 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 %>
<%= hidden_field_tag 'set_filter', '1' %>
<div id="query_form_content" class="hide-when-print">
@ -68,7 +68,7 @@
<div id="csv-export-options" style="display:none;">
<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>
<label><%= radio_button_tag 'columns', '', true %> <%= l(:description_selected_columns) %></label><br />
<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}) %>
<% 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| %>
<%= error_messages_for 'issue' %>
<%= 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" %>
<%= text_area_tag :notes, @journal.notes,
:id => "journal_#{@journal.id}_notes",

View File

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

View File

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

View File

@ -72,7 +72,7 @@
<% if !@topic.locked? && authorize_for('messages', 'reply') %>
<p><%= toggle_link l(:button_reply), "reply", :focus => 'message_content' %></p>
<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} %>
<%= submit_tag l(:button_submit) %>
<%= link_to_remote l(:label_preview),

View File

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

View File

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

View File

@ -35,7 +35,7 @@ function removeBlock(block) {
</script>
<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)) %>:
<%= select_tag 'block',
"<option></option>".html_safe + options_for_select(@block_options),

View File

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

View File

@ -1,6 +1,6 @@
<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 } %>
<%= submit_tag l(:button_save) %>
<%= link_to_remote l(:label_preview),

View File

@ -7,7 +7,7 @@
<div id="add-news" style="display:none;">
<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| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>

View File

@ -1,6 +1,6 @@
<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| %>
<%= render :partial => 'news/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>

View File

@ -16,7 +16,7 @@
<% if authorize_for('news', 'edit') %>
<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| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
@ -55,7 +55,7 @@
<% if @news.commentable? %>
<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">
<%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
<%= 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 } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<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 } %>
<fieldset class="box tabular"><legend><%= l(:button_copy) %></legend>

View File

@ -8,7 +8,7 @@
<% end %>
</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>
<%= submit_tag l(:button_delete) %>
<% end %>

View File

@ -4,7 +4,7 @@
<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_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_activity),
{ :controller => 'activities', :action => 'index',

View File

@ -1,6 +1,6 @@
<h2><%=l(:label_project_new)%></h2>
<% labelled_form_for @project do |f| %>
<%= labelled_form_for @project do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<%= 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">
<thead><tr>
@ -11,7 +11,7 @@
</tr></thead>
<% @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') %>">
<td>
<%= 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 },
:html => {:id => 'modules-form',
:method => :post} do |f| %>

View File

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

View File

@ -5,7 +5,7 @@
<% query.available_filters.sort{|a,b| a[1][:order]<=>b[1][:order]}.each do |filter| %>
<% field = filter[0]
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">
<%= 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>

View File

@ -1,6 +1,6 @@
<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} %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<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} %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<h2><%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %></h2>
<!-- 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_to', params[:rev_to]) if params[:rev_to] %>
<p>

View File

@ -1,5 +1,5 @@
<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} %>
<% end %>

View File

@ -1,5 +1,5 @@
<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} %>
<% end %>

View File

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

View File

@ -1,6 +1,6 @@
<div class="contextual">
<% form_tag(
{:action => 'revision', :id => @project,
<%= form_tag(
{:controller => 'repositories', :action => 'revision', :id => @project,
:repository_id => @repository.identifier_param}
) do %>
<%= 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>
<% labelled_form_for @role do |f| %>
<%= labelled_form_for @role do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>

View File

@ -1,6 +1,6 @@
<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 } %>
<%= submit_tag l(:button_create) %>
<% end %>

View File

@ -1,6 +1,6 @@
<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 %>
<div class="autoscroll">
<table class="list permissions">

View File

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