Merge remote branch 'edavis/master' into master-journalized

Conflicts:
	app/controllers/application_controller.rb
	app/controllers/wiki_controller.rb
	app/helpers/issues_helper.rb
	app/models/time_entry.rb
	app/models/wiki_content.rb
	app/views/wiki/edit.rhtml
	config/locales/ja.yml
	test/functional/wiki_controller_test.rb
This commit is contained in:
Tim Felgentreff 2010-10-26 18:28:39 +02:00
commit 19c7dc0094
90 changed files with 548 additions and 282 deletions

View File

@ -154,7 +154,15 @@ class ApplicationController < ActionController::Base
# Authorize the user for the requested action
def authorize(ctrl = params[:controller], action = params[:action], global = false)
allowed = User.current.allowed_to?({:controller => ctrl, :action => action}, @project || @projects, :global => global)
allowed ? true : deny_access
if allowed
true
else
if @project && @project.archived?
render_403 :message => :notice_not_authorized_archived_project
else
deny_access
end
end
end
# Authorize the user for the requested action outside a project
@ -264,40 +272,34 @@ class ApplicationController < ActionController::Base
end
redirect_to default
end
def render_403
def render_403(options={})
@project = nil
respond_to do |format|
format.html { render :template => "common/403", :layout => use_layout, :status => 403 }
format.atom { head 403 }
format.xml { head 403 }
format.js { head 403 }
format.json { head 403 }
end
render_error({:message => :notice_not_authorized, :status => 403}.merge(options))
return false
end
def render_404
respond_to do |format|
format.html { render :template => "common/404", :layout => use_layout, :status => 404 }
format.atom { head 404 }
format.xml { head 404 }
format.js { head 404 }
format.json { head 404 }
end
def render_404(options={})
render_error({:message => :notice_file_not_found, :status => 404}.merge(options))
return false
end
def render_error(msg)
# Renders an error response
def render_error(arg)
arg = {:message => arg} unless arg.is_a?(Hash)
@message = arg[:message]
@message = l(@message) if @message.is_a?(Symbol)
@status = arg[:status] || 500
respond_to do |format|
format.html {
flash.now[:error] = msg
render :text => '', :layout => use_layout, :status => 500
render :template => 'common/error', :layout => use_layout, :status => @status
}
format.atom { head 500 }
format.xml { head 500 }
format.js { head 500 }
format.json { head 500 }
format.atom { head @status }
format.xml { head @status }
format.js { head @status }
format.json { head @status }
end
end

View File

@ -18,6 +18,7 @@ class IssueMovesController < ApplicationController
@issues.each do |issue|
issue.reload
issue.init_journal(User.current)
issue.current_journal.notes = @notes if @notes.present?
call_hook(:controller_issues_move_before_save, { :params => params, :issue => issue, :target_project => @target_project, :copy => !!@copy })
if r = issue.move_to_project(@target_project, new_tracker, {:copy => @copy, :attributes => extract_changed_attributes_for_move(params)})
moved_issues << r
@ -50,11 +51,13 @@ class IssueMovesController < ApplicationController
@target_project ||= @project
@trackers = @target_project.trackers
@available_statuses = Workflow.available_statuses(@project)
@notes = params[:notes]
@notes ||= ''
end
def extract_changed_attributes_for_move(params)
changed_attributes = {}
[:assigned_to_id, :status_id, :start_date, :due_date].each do |valid_attribute|
[:assigned_to_id, :status_id, :start_date, :due_date, :priority_id].each do |valid_attribute|
unless params[valid_attribute].blank?
changed_attributes[valid_attribute] = (params[valid_attribute] == 'none' ? nil : params[valid_attribute])
end

View File

@ -17,19 +17,38 @@
require 'diff'
# The WikiController follows the Rails REST controller pattern but with
# a few differences
#
# * index - shows a list of WikiPages grouped by page or date
# * new - not used
# * create - not used
# * show - will also show the form for creating a new wiki page
# * edit - used to edit an existing or new page
# * update - used to save a wiki page update to the database, including new pages
# * destroy - normal
#
# Other member and collection methods are also used
#
# TODO: still being worked on
class WikiController < ApplicationController
default_search_scope :wiki_pages
before_filter :find_wiki, :authorize
before_filter :find_existing_page, :only => [:rename, :protect, :history, :diff, :annotate, :add_attachment, :destroy]
verify :method => :post, :only => [:destroy, :protect], :redirect_to => { :action => :index }
verify :method => :post, :only => [:protect], :redirect_to => { :action => :show }
helper :attachments
include AttachmentsHelper
helper :watchers
# display a page (in editing mode if it doesn't exist)
# List of pages, sorted alphabetically and by parent (hierarchy)
def index
load_pages_grouped_by_date_without_content
end
# display a page (in editing mode if it doesn't exist)
def show
page_title = params[:page]
@page = @wiki.find_or_new_page(page_title)
if @page.new_record?
@ -95,11 +114,55 @@ class WikiController < ApplicationController
redirect_to :action => 'index', :project_id => @project, :page => @page.title
end
end
@content.attributes = params[:content]
@content.author = User.current
# if page is new @page.save will also save content, but not if page isn't a new record
if (@page.new_record? ? @page.save : @content.save)
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
redirect_to :action => 'show', :project_id => @project, :page => @page.title
end
rescue ActiveRecord::StaleObjectError
# Optimistic locking exception
flash[:error] = l(:notice_locking_conflict)
end
verify :method => :post, :only => :update, :render => {:nothing => true, :status => :method_not_allowed }
# Creates a new page or updates an existing one
def update
@page = @wiki.find_or_new_page(params[:page])
return render_403 unless editable?
@page.content = WikiContent.new(:page => @page) if @page.new_record?
@content = @page.content_for_version(params[:version])
@content.text = initial_page_content(@page) if @content.text.blank?
# don't keep previous comment
@content.comments = nil
if !@page.new_record? && params[:content].present? && @content.text == params[:content][:text]
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
# don't save if text wasn't changed
redirect_to :action => 'show', :project_id => @project, :page => @page.title
return
end
@content.attributes = params[:content]
@content.author = User.current
# if page is new @page.save will also save content, but not if page isn't a new record
if (@page.new_record? ? @page.save : @content.save)
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
call_hook(:controller_wiki_edit_after_save, { :params => params, :page => @page})
redirect_to :action => 'show', :project_id => @project, :page => @page.title
end
rescue ActiveRecord::StaleObjectError
# Optimistic locking exception
flash[:error] = l(:notice_locking_conflict)
end
# rename a page
def rename
return render_403 unless editable?
@ -108,13 +171,13 @@ class WikiController < ApplicationController
@original_title = @page.pretty_title
if request.post? && @page.update_attributes(params[:wiki_page])
flash[:notice] = l(:notice_successful_update)
redirect_to :action => 'index', :project_id => @project, :page => @page.title
redirect_to :action => 'show', :project_id => @project, :page => @page.title
end
end
def protect
@page.update_attribute :protected, params[:protected]
redirect_to :action => 'index', :project_id => @project, :page => @page.title
redirect_to :action => 'show', :project_id => @project, :page => @page.title
end
# show page history
@ -140,7 +203,8 @@ class WikiController < ApplicationController
@annotate = @page.annotate(params[:version])
render_404 unless @annotate
end
verify :method => :delete, :only => [:destroy], :redirect_to => { :action => :show }
# Removes a wiki page and its history
# Children can be either set as root pages, removed or reassigned to another parent page
def destroy
@ -167,7 +231,7 @@ class WikiController < ApplicationController
end
end
@page.destroy
redirect_to :action => 'page_index', :project_id => @project
redirect_to :action => 'index', :project_id => @project
end
# Export wiki to a single html file
@ -177,14 +241,10 @@ class WikiController < ApplicationController
export = render_to_string :action => 'export_multiple', :layout => false
send_data(export, :type => 'text/html', :filename => "wiki.html")
else
redirect_to :action => 'index', :project_id => @project, :page => nil
redirect_to :action => 'show', :project_id => @project, :page => nil
end
end
def page_index
load_pages_grouped_by_date_without_content
end
def date_index
load_pages_grouped_by_date_without_content
end
@ -205,7 +265,7 @@ class WikiController < ApplicationController
return render_403 unless editable?
attachments = Attachment.attach_files(@page, params[:attachments])
render_attachment_warning_if_needed(@page)
redirect_to :action => 'index', :page => @page.title
redirect_to :action => 'show', :page => @page.title
end
private

View File

@ -107,11 +107,6 @@ module ApplicationHelper
link_to(text, {:controller => 'repositories', :action => 'revision', :id => project, :rev => revision}, :title => l(:label_revision_id, revision))
end
def link_to_project(project, options={})
options[:class] ||= 'project'
link_to(h(project), {:controller => 'projects', :action => 'show', :id => project}, :class => options[:class])
end
# Generates a link to a project if active
# Examples:
@ -199,7 +194,7 @@ module ApplicationHelper
content << "<ul class=\"pages-hierarchy\">\n"
pages[node].each do |page|
content << "<li>"
content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'index', :project_id => page.project, :page => page.title},
content << link_to(h(page.pretty_title), {:controller => 'wiki', :action => 'show', :project_id => page.project, :page => page.title},
:title => (page.respond_to?(:updated_on) ? l(:label_updated_time, distance_of_time_in_words(Time.now, page.updated_on)) : nil))
content << "\n" + render_page_hierarchy(pages, page.id) if pages[page.id]
content << "</li>\n"
@ -260,15 +255,10 @@ module ApplicationHelper
end
# Yields the given block for each project with its level in the tree
#
# Wrapper for Project#project_tree
def project_tree(projects, &block)
ancestors = []
projects.sort_by(&:lft).each do |project|
while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
ancestors.pop
end
yield project, ancestors.size
ancestors << project
end
Project.project_tree(projects, &block)
end
def project_nested_ul(projects, &block)
@ -568,7 +558,7 @@ module ApplicationHelper
when :local; "#{title}.html"
when :anchor; "##{title}" # used for single-file wiki export
else
url_for(:only_path => only_path, :controller => 'wiki', :action => 'index', :project_id => link_project, :page => Wiki.titleize(page), :anchor => anchor)
url_for(:only_path => only_path, :controller => 'wiki', :action => 'show', :project_id => link_project, :page => Wiki.titleize(page), :anchor => anchor)
end
link_to((title || page), url, :class => ('wiki-page' + (wiki_page ? '' : ' new')))
else

View File

@ -16,6 +16,31 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module GanttHelper
def gantt_zoom_link(gantt, in_or_out)
case in_or_out
when :in
if gantt.zoom < 4
link_to_remote(l(:text_zoom_in),
{:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :method => :get, :update => 'content'},
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1))),
:class => 'icon icon-zoom-in'})
else
content_tag('span', l(:text_zoom_in), :class => 'icon icon-zoom-in')
end
when :out
if gantt.zoom > 1
link_to_remote(l(:text_zoom_out),
{:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :method => :get, :update => 'content'},
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1))),
:class => 'icon icon-zoom-out'})
else
content_tag('span', l(:text_zoom_out), :class => 'icon icon-zoom-out')
end
end
end
def number_of_issues_on_versions(gantt)
versions = gantt.events.collect {|event| (event.is_a? Version) ? event : nil}.compact

View File

@ -170,34 +170,4 @@ module IssuesHelper
end
export
end
def show_detail(journal, detail, html = true)
journal.render_detail(detail, html)
end
def gantt_zoom_link(gantt, in_or_out)
img_attributes = {:style => 'height:1.4em; width:1.4em; margin-left: 3px;'} # em for accessibility
case in_or_out
when :in
if gantt.zoom < 4
link_to_remote(l(:text_zoom_in) + image_tag('zoom_in.png', img_attributes.merge(:alt => l(:text_zoom_in))),
{:url => gantt.params.merge(:zoom => (gantt.zoom+1)), :method => :get, :update => 'content'},
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom+1)))})
else
l(:text_zoom_in) +
image_tag('zoom_in_g.png', img_attributes.merge(:alt => l(:text_zoom_in)))
end
when :out
if gantt.zoom > 1
link_to_remote(l(:text_zoom_out) + image_tag('zoom_out.png', img_attributes.merge(:alt => l(:text_zoom_out))),
{:url => gantt.params.merge(:zoom => (gantt.zoom-1)), :method => :get, :update => 'content'},
{:href => url_for(gantt.params.merge(:zoom => (gantt.zoom-1)))})
else
l(:text_zoom_out) +
image_tag('zoom_out_g.png', img_attributes.merge(:alt => l(:text_zoom_out)))
end
end
end
end

View File

@ -220,6 +220,10 @@ class Project < ActiveRecord::Base
self.status == STATUS_ACTIVE
end
def archived?
self.status == STATUS_ARCHIVED
end
# Archives the project and its descendants
def archive
# Check that there is no issue of a non descendant project that is assigned
@ -565,6 +569,18 @@ class Project < ActiveRecord::Base
return nil
end
end
# Yields the given block for each project with its level in the tree
def self.project_tree(projects, &block)
ancestors = []
projects.sort_by(&:lft).each do |project|
while (ancestors.any? && !project.is_descendant_of?(ancestors.last))
ancestors.pop
end
yield project, ancestors.size
ancestors << project
end
end
private

View File

@ -27,7 +27,7 @@ class TimeEntry < ActiveRecord::Base
acts_as_customizable
acts_as_journalized :event_title => Proc.new {|o| "#{l_hours(o.hours)} (#{(o.issue || o.project).event_title})"},
:event_url => Proc.new {|o| {:controller => 'timelog', :action => 'details', :project_id => o.project, :issue_id => o.issue}},
:event_url => Proc.new {|o| {:controller => 'timelog', :action => 'index', :project_id => o.project, :issue_id => o.issue}},
:event_author => :user,
:event_description => :comments

View File

@ -28,7 +28,7 @@ class WikiPage < ActiveRecord::Base
acts_as_event :title => Proc.new {|o| "#{l(:label_wiki)}: #{o.title}"},
:description => :text,
:datetime => :created_on,
:url => Proc.new {|o| {:controller => 'wiki', :id => o.wiki.project, :page => o.title}}
:url => Proc.new {|o| {:controller => 'wiki', :action => 'show', :project_id => o.wiki.project, :page => o.title}}
acts_as_searchable :columns => ['title', 'text'],
:include => [{:wiki => :project}, :content],

View File

@ -19,7 +19,6 @@
<table class="list">
<thead><tr>
<th><%=l(:label_project)%></th>
<th><%=l(:field_description)%></th>
<th><%=l(:field_is_public)%></th>
<th><%=l(:field_created_on)%></th>
<th></th>
@ -27,8 +26,7 @@
<tbody>
<% project_tree(@projects) do |project, level| %>
<tr class="<%= cycle("odd", "even") %> <%= project.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<td class="name"><%= link_to_project(project, :action => 'settings') %></td>
<td><%= textilizable project.short_description, :project => project %></td>
<td class="name"><span><%= link_to_project(project, {:action => 'settings'}, :title => project.short_description) %></span></td>
<td align="center"><%= checked_image project.is_public? %></td>
<td align="center"><%= format_date(project.created_on) %></td>
<td class="buttons">

View File

@ -1,6 +0,0 @@
<h2>403</h2>
<p><%= l(:notice_not_authorized) %></p>
<p><a href="javascript:history.back()">Back</a></p>
<% html_title '403' %>

View File

@ -1,6 +0,0 @@
<h2>404</h2>
<p><%= l(:notice_file_not_found) %></p>
<p><a href="javascript:history.back()">Back</a></p>
<% html_title '404' %>

View File

@ -0,0 +1,6 @@
<h2><%=h @status %></h2>
<p id="errorExplanation"><%=h @message %></p>
<p><a href="javascript:history.back()">Back</a></p>
<% html_title @status %>

View File

@ -1,5 +1,5 @@
<div class="contextual">
<%= link_to_if_authorized l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add' %>
<%= link_to(l(:label_attachment_new), new_project_file_path(@project), :class => 'icon icon-add') if User.current.allowed_to?(:manage_files, @project) %>
</div>
<h2><%=l(:label_attachment_plural)%></h2>

View File

@ -10,7 +10,7 @@
</div>
</fieldset>
<p style="float:right;">
<p class="contextual">
<%= gantt_zoom_link(@gantt, :in) %>
<%= gantt_zoom_link(@gantt, :out) %>
</p>

View File

@ -33,6 +33,11 @@
<%= select_tag('status_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(@available_statuses, :id, :name)) %>
</p>
<p>
<label><%= l(:field_priority) %></label>
<%= select_tag('priority_id', "<option value=\"\">#{l(:label_no_change_option)}</option>" + options_from_collection_for_select(IssuePriority.all, :id, :name)) %>
</p>
<p>
<label><%= l(:field_start_date) %></label>
<%= text_field_tag 'start_date', '', :size => 10 %><%= calendar_for('start_date') %>
@ -43,6 +48,11 @@
<%= text_field_tag 'due_date', '', :size => 10 %><%= calendar_for('due_date') %>
</p>
<fieldset><legend><%= l(:field_notes) %></legend>
<%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
<%= wikitoolbar_for 'notes' %>
</fieldset>
<%= call_hook(:view_issues_move_bottom, :issues => @issues, :target_project => @target_project, :copy => !!@copy) %>
</div>

View File

@ -26,11 +26,11 @@
</div>
<% if @issue.new_record? %>
<p><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form' %></p>
<p id="attachments_form"><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form' %></p>
<% end %>
<% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%>
<p><label><%= l(:label_issue_watchers) %></label>
<p id="watchers_form"><label><%= l(:label_issue_watchers) %></label>
<% @issue.project.users.sort.each do |user| -%>
<label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watched_by?(user) %> <%=h user %></label>
<% end -%>

View File

@ -1,8 +1,8 @@
<div class="contextual">
<%= link_to_if_authorized(l(:label_news_new),
new_project_news_path(@project),
:class => 'icon icon-add',
:onclick => 'Element.show("add-news"); Form.Element.focus("news_title"); return false;') if @project %>
<%= link_to(l(:label_news_new),
new_project_news_path(@project),
:class => 'icon icon-add',
:onclick => 'Element.show("add-news"); Form.Element.focus("news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
</div>
<div id="add-news" style="display:none;">

View File

@ -4,6 +4,6 @@
<h3><%= l(:label_wiki) %></h3>
<%= link_to l(:field_start_page), {:action => 'index', :page => nil} %><br />
<%= link_to l(:label_index_by_title), {:action => 'page_index'} %><br />
<%= link_to l(:field_start_page), {:action => 'show', :page => nil} %><br />
<%= link_to l(:label_index_by_title), {:action => 'index'} %><br />
<%= link_to l(:label_index_by_date), {:action => 'date_index'} %><br />

View File

@ -6,7 +6,7 @@
<h2><%= @page.pretty_title %></h2>
<p>
<%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'index', :page => @page.title, :version => @annotate.content.version %>
<%= l(:label_version) %> <%= link_to @annotate.content.version, :action => 'show', :page => @page.title, :version => @annotate.content.version %>
<em>(<%= @annotate.content.author ? @annotate.content.author.name : "anonyme" %>, <%= format_time(@annotate.content.updated_on) %>)</em>
</p>
@ -18,7 +18,7 @@
<% @annotate.lines.each do |line| -%>
<tr class="bloc-<%= colors[line[0]] %>">
<th class="line-num"><%= line_num %></th>
<td class="revision"><%= link_to line[0], :controller => 'wiki', :action => 'index', :project_id => @project, :page => @page.title, :version => line[0] %></td>
<td class="revision"><%= link_to line[0], :controller => 'wiki', :action => 'show', :project_id => @project, :page => @page.title, :version => line[0] %></td>
<td class="author"><%= h(line[1]) %></td>
<td class="line-code"><pre><%=h line[2] %></pre></td>
</tr>

View File

@ -12,7 +12,7 @@
<h3><%= format_date(date) %></h3>
<ul>
<% @pages_by_date[date].each do |page| %>
<li><%= link_to page.pretty_title, :action => 'index', :page => page.title %></li>
<li><%= link_to page.pretty_title, :action => 'show', :page => page.title %></li>
<% end %>
</ul>
<% end %>
@ -23,11 +23,11 @@
<% unless @pages.empty? %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% end %>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<% end %>

View File

@ -1,6 +1,6 @@
<h2><%=h @page.pretty_title %></h2>
<% form_tag({}) do %>
<% form_tag({}, :method => :delete) do %>
<div class="box">
<p><strong><%= l(:text_wiki_page_destroy_question, :descendants => @descendants_count) %></strong></p>
<p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_wiki_page_nullify_children) %></label><br />
@ -15,5 +15,5 @@
</div>
<%= submit_tag l(:button_apply) %>
<%= link_to l(:button_cancel), :controller => 'wiki', :action => 'index', :project_id => @project, :page => @page.title %>
<%= link_to l(:button_cancel), :controller => 'wiki', :action => 'show', :project_id => @project, :page => @page.title %>
<% end %>

View File

@ -5,10 +5,10 @@
<h2><%= @page.pretty_title %></h2>
<p>
<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'index', :page => @page.title, :version => @diff.content_from.version %>
<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :page => @page.title, :version => @diff.content_from.version %>
<em>(<%= @diff.content_from.author ? @diff.content_from.author.name : "anonyme" %>, <%= format_time(@diff.content_from.updated_on) %>)</em>
&#8594;
<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'index', :page => @page.title, :version => @diff.content_to.version %>/<%= @page.content.version %>
<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show', :page => @page.title, :version => @diff.content_to.version %>/<%= @page.content.version %>
<em>(<%= @diff.content_to.author ? @diff.content_to.author.name : "anonyme" %>, <%= format_time(@diff.content_to.updated_on) %>)</em>
</p>

View File

@ -1,7 +1,7 @@
<h2><%=h @page.pretty_title %></h2>
<% form_for :content, @content, :url => {:action => 'edit', :page => @page.title}, :html => {:multipart => true, :id => 'wiki_form'} do |f| %>
<%= f.hidden_field :lock_version %>
<% form_for :content, @content, :url => {:action => 'update', :page => @page.title}, :html => {:multipart => true, :id => 'wiki_form'} do |f| %>
<%= f.hidden_field :version %>
<%= error_messages_for 'content' %>
<p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p>

View File

@ -19,7 +19,7 @@
<% line_num = 1 %>
<% @versions.each do |ver| %>
<tr class="<%= cycle("odd", "even") %>">
<td class="id"><%= link_to ver.version, :action => 'index', :page => @page.title, :version => ver.version %></td>
<td class="id"><%= link_to ver.version, :action => 'show', :page => @page.title, :version => ver.version %></td>
<td class="checkbox"><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('cbto-#{line_num+1}').checked=true;") if show_diff && (line_num < @versions.size) %></td>
<td class="checkbox"><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %></td>
<td align="center"><%= format_time(ver.created_at) %></td>

View File

@ -16,11 +16,11 @@
<% unless @pages.empty? %>
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to('HTML', :url => {:action => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
<% end %>
<% end %>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'show', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
<% end %>

View File

@ -5,7 +5,7 @@
<%= link_to_if_authorized(l(:button_lock), {:action => 'protect', :page => @page.title, :protected => 1}, :method => :post, :class => 'icon icon-lock') if !@page.protected? %>
<%= link_to_if_authorized(l(:button_unlock), {:action => 'protect', :page => @page.title, :protected => 0}, :method => :post, :class => 'icon icon-unlock') if @page.protected? %>
<%= link_to_if_authorized(l(:button_rename), {:action => 'rename', :page => @page.title}, :class => 'icon icon-move') if @content.version == @page.content.version %>
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :page => @page.title}, :method => :post, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
<%= link_to_if_authorized(l(:button_delete), {:action => 'destroy', :page => @page.title}, :method => :delete, :confirm => l(:text_are_you_sure), :class => 'icon icon-del') %>
<%= link_to_if_authorized(l(:button_rollback), {:action => 'edit', :page => @page.title, :version => @content.version }, :class => 'icon icon-cancel') if @content.version < @page.content.version %>
<% end %>
<%= link_to_if_authorized(l(:label_history), {:action => 'history', :page => @page.title}, :class => 'icon icon-history') %>
@ -15,11 +15,11 @@
<% if @content.version != @page.content.version %>
<p>
<%= link_to(('&#171; ' + l(:label_previous)), :action => 'index', :page => @page.title, :version => (@content.version - 1)) + " - " if @content.version > 1 %>
<%= link_to(('&#171; ' + l(:label_previous)), :action => 'show', :page => @page.title, :version => (@content.version - 1)) + " - " if @content.version > 1 %>
<%= "#{l(:label_version)} #{@content.version}/#{@page.content.version}" %>
<%= '(' + link_to('diff', :controller => 'wiki', :action => 'diff', :page => @page.title, :version => @content.version) + ')' if @content.version > 1 %> -
<%= link_to((l(:label_next) + ' &#187;'), :action => 'index', :page => @page.title, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %>
<%= link_to(l(:label_current_version), :action => 'index', :page => @page.title) %>
<%= link_to((l(:label_next) + ' &#187;'), :action => 'show', :page => @page.title, :version => (@content.version + 1)) + " - " if @content.version < @page.content.version %>
<%= link_to(l(:label_current_version), :action => 'show', :page => @page.title) %>
<br />
<em><%= @content.author ? @content.author.name : "anonyme" %>, <%= format_time(@content.updated_on) %> </em><br />
<%=h @content.comments %>
@ -35,7 +35,7 @@
<div id="wiki_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 => 'wiki', :action => 'add_attachment', :page => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %>
<% form_tag({ :controller => 'wiki', :action => 'add_attachment', :project_id => @project, :page => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %>
<div class="box">
<p><%= render :partial => 'attachments/form' %></p>
</div>

View File

@ -906,8 +906,6 @@ bg:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -915,3 +913,7 @@ bg:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -926,8 +926,6 @@ bs:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -935,3 +933,7 @@ bs:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -915,8 +915,6 @@ ca:
enumeration_activities: Activitats (seguidor de temps)
enumeration_system_activity: Activitat del sistema
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -924,3 +922,7 @@ ca:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -912,8 +912,6 @@ cs:
field_time_entries: Zaznamenaný čas
project_module_gantt: Gantt
project_module_calendar: Kalendář
field_member_of_group: Člen skupiny
field_assigned_to_role: Člen role
button_edit_associated_wikipage: "Upravit přiřazenou Wiki stránku: {{page_title}}"
text_are_you_sure_with_children: Smazat úkol včetně všech podúkolů?
field_text: Textové pole
@ -921,3 +919,7 @@ cs:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -928,8 +928,6 @@ da:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -937,3 +935,7 @@ da:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -931,11 +931,13 @@ de:
enumeration_activities: Aktivitäten (Zeiterfassung)
enumeration_system_activity: System-Aktivität
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
label_user_mail_option_only_owner: Only for things I am the owner of
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -912,8 +912,6 @@ el:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -921,3 +919,7 @@ el:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -926,3 +926,4 @@ en-GB:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -150,6 +150,7 @@ en:
notice_file_not_found: The page you were trying to access doesn't exist or has been removed.
notice_locking_conflict: Data has been updated by another user.
notice_not_authorized: You are not authorized to access this page.
notice_not_authorized_archived_project: The project you're trying to access has been archived.
notice_email_sent: "An email was sent to {{value}}"
notice_email_error: "An error occurred while sending mail ({{value}})"
notice_feeds_access_key_reseted: Your RSS access key was reset.
@ -293,8 +294,8 @@ en:
field_group_by: Group results by
field_sharing: Sharing
field_parent_issue: Parent task
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
field_member_of_group: "Assignee's group"
field_assigned_to_role: "Assignee's role"
field_text: Text field
setting_app_title: Application title

View File

@ -952,8 +952,6 @@ es:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -961,3 +959,7 @@ es:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -916,8 +916,6 @@ eu:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -925,3 +923,7 @@ eu:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -937,8 +937,6 @@ fi:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -946,3 +944,7 @@ fi:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -169,6 +169,7 @@ fr:
notice_file_not_found: "La page à laquelle vous souhaitez accéder n'existe pas ou a été supprimée."
notice_locking_conflict: Les données ont été mises à jour par un autre utilisateur. Mise à jour impossible.
notice_not_authorized: "Vous n'êtes pas autorisés à accéder à cette page."
notice_not_authorized_archived_project: Le projet auquel vous tentez d'accéder a été archivé.
notice_email_sent: "Un email a été envoyé à {{value}}"
notice_email_error: "Erreur lors de l'envoi de l'email ({{value}})"
notice_feeds_access_key_reseted: "Votre clé d'accès aux flux RSS a été réinitialisée."
@ -929,13 +930,14 @@ fr:
label_overall_spent_time: Temps passé global
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Modifier la page de Wiki associée: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
label_user_mail_option_only_owner: Only for things I am the owner of
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
project_module_calendar: Calendrier
button_edit_associated_wikipage: "Modifier la page wiki associée: {{page_title}}"
text_are_you_sure_with_children: Supprimer la demande et toutes ses sous-demandes ?
field_text: Champ texte
label_user_mail_option_only_owner: Seulement pour ce que j'ai créé
setting_default_notification_option: Option de notification par défaut
label_user_mail_option_only_my_events: Seulement pour ce que je surveille
label_user_mail_option_only_assigned: Seulement pour ce qui m'est assigné
label_user_mail_option_none: Aucune notification
field_member_of_group: Groupe de l'assigné
field_assigned_to_role: Rôle de l'assigné

View File

@ -928,8 +928,6 @@ gl:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -937,3 +935,7 @@ gl:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -297,8 +297,6 @@ he:
field_group_by: קבץ את התוצאות לפי
field_sharing: שיתוף
field_parent_issue: משימת אב
field_member_of_group: חבר בקבוצה
field_assigned_to_role: בעל תפקיד
field_text: שדה טקסט
setting_app_title: כותרת ישום
@ -926,3 +924,7 @@ he:
enumeration_doc_categories: קטגוריות מסמכים
enumeration_activities: פעילויות (מעקב אחר זמנים)
enumeration_system_activity: פעילות מערכת
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -919,8 +919,6 @@ hr:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -928,3 +926,7 @@ hr:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -935,8 +935,6 @@
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -944,3 +942,7 @@
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -920,8 +920,6 @@ id:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -929,3 +927,7 @@ id:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -916,8 +916,6 @@ it:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -925,3 +923,7 @@ it:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -319,8 +319,6 @@ ja:
field_group_by: グループ条件
field_sharing: 共有
field_parent_issue: 親チケット
field_member_of_group: 担当者のグループ
field_assigned_to_role: 担当者のロール
field_text: テキスト
setting_app_title: アプリケーションのタイトル
@ -946,4 +944,7 @@ ja:
enumeration_doc_categories: 文書カテゴリ
enumeration_activities: 作業分類 (時間トラッキング)
enumeration_system_activity: システム作業分類
field_time_entries: Log time
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -968,8 +968,6 @@ ko:
field_time_entries: 기록된 시간
project_module_gantt: Gantt 챠트
project_module_calendar: 달력
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -977,3 +975,7 @@ ko:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -976,8 +976,6 @@ lt:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -985,3 +983,7 @@ lt:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -907,8 +907,6 @@ lv:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -916,3 +914,7 @@ lv:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -912,8 +912,6 @@ mk:
enumeration_activities: Активности (следење на време)
enumeration_system_activity: Системска активност
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -921,3 +919,7 @@ mk:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -913,8 +913,6 @@ mn:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -922,3 +920,7 @@ mn:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -894,8 +894,6 @@ nl:
field_time_entries: Log tijd
project_module_gantt: Gantt
project_module_calendar: Kalender
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -903,3 +901,7 @@ nl:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -903,8 +903,6 @@
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -912,3 +910,7 @@
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -933,8 +933,6 @@ pl:
field_time_entries: Dziennik
project_module_gantt: Diagram Gantta
project_module_calendar: Kalendarz
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -942,3 +940,7 @@ pl:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -936,8 +936,6 @@ pt-BR:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendário
field_member_of_group: Membro do grupo
field_assigned_to_role: Membro com o papel
button_edit_associated_wikipage: "Editar página wiki relacionada: {{page_title}}"
text_are_you_sure_with_children: Excluir a tarefa e suas subtarefas?
field_text: Campo de texto
@ -945,3 +943,7 @@ pt-BR:
setting_default_notification_option: Opção padrão de notificação
label_user_mail_option_only_my_events: Somente para as coisas que eu esteja observando ou esteja envolvido
label_user_mail_option_only_assigned: Somente para as coisas que estejam atribuídas a mim
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -920,8 +920,6 @@ pt:
field_time_entries: Tempo registado
project_module_gantt: Gantt
project_module_calendar: Calendário
field_member_of_group: Membro do Grupo
field_assigned_to_role: Membro do Perfil
button_edit_associated_wikipage: "Editar página Wiki associada: {{page_title}}"
text_are_you_sure_with_children: Apagar tarefa e todas as sub-tarefas?
field_text: Text field
@ -929,3 +927,7 @@ pt:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -905,8 +905,6 @@ ro:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -914,3 +912,7 @@ ro:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -295,7 +295,6 @@ ru:
field_admin: Администратор
field_assignable: Задача может быть назначена этой роли
field_assigned_to: Назначена
field_assigned_to_role: Роль участника
field_attr_firstname: Имя
field_attr_lastname: Фамилия
field_attr_login: Атрибут Регистрация
@ -345,7 +344,6 @@ ru:
field_mail: Email
field_mail_notification: Уведомления по email
field_max_length: Максимальная длина
field_member_of_group: Группа участника
field_min_length: Минимальная длина
field_name: Имя
field_new_password: Новый пароль
@ -1038,3 +1036,7 @@ ru:
notice_unable_delete_time_entry: Невозможно удалить запись журнала.
label_overall_spent_time: Всего затрачено времени
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -907,8 +907,6 @@ sk:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -916,3 +914,7 @@ sk:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -908,8 +908,6 @@ sl:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -917,3 +915,7 @@ sl:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -912,8 +912,6 @@ sr-YU:
field_time_entries: Vreme evidencije
project_module_gantt: Gantov dijagram
project_module_calendar: Kalendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -921,3 +919,7 @@ sr-YU:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -912,8 +912,6 @@ sr:
field_time_entries: Време евиденције
project_module_gantt: Гантов дијаграм
project_module_calendar: Календар
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
@ -922,3 +920,7 @@ sr:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -957,8 +957,6 @@ sv:
enumeration_doc_categories: Dokumentkategorier
enumeration_activities: Aktiviteter (tidsuppföljning)
enumeration_system_activity: Systemaktivitet
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -966,3 +964,7 @@ sv:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -909,8 +909,6 @@ th:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -918,3 +916,7 @@ th:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -935,8 +935,6 @@ tr:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -944,3 +942,7 @@ tr:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -908,8 +908,6 @@ uk:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -917,3 +915,7 @@ uk:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -967,8 +967,6 @@ vi:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -976,3 +974,7 @@ vi:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -379,8 +379,6 @@
field_group_by: 結果分組方式
field_sharing: 共用
field_parent_issue: 父工作項目
field_member_of_group: 所屬群組
field_assigned_to_role: 所屬角色
field_text: 內容文字
setting_app_title: 標題
@ -1007,3 +1005,7 @@
enumeration_activities: 活動 (時間追蹤)
enumeration_system_activity: 系統活動
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -930,8 +930,6 @@ zh:
field_time_entries: Log time
project_module_gantt: Gantt
project_module_calendar: Calendar
field_member_of_group: Member of Group
field_assigned_to_role: Member of Role
button_edit_associated_wikipage: "Edit associated Wiki page: {{page_title}}"
text_are_you_sure_with_children: Delete issue and all child issues?
field_text: Text field
@ -939,3 +937,7 @@ zh:
setting_default_notification_option: Default notification option
label_user_mail_option_only_my_events: Only for things I watch or I'm involved in
label_user_mail_option_only_assigned: Only for things I am assigned to
label_user_mail_option_none: No events
field_member_of_group: Assignee's group
field_assigned_to_role: Assignee's role
notice_not_authorized_archived_project: The project you're trying to access has been archived.

View File

@ -30,9 +30,9 @@ ActionController::Routing::Routes.draw do |map|
map.with_options :controller => 'wiki' do |wiki_routes|
wiki_routes.with_options :conditions => {:method => :get} do |wiki_views|
wiki_views.connect 'projects/:project_id/wiki/export', :action => 'export'
wiki_views.connect 'projects/:project_id/wiki/page_index', :action => 'page_index'
wiki_views.connect 'projects/:project_id/wiki/index', :action => 'index'
wiki_views.connect 'projects/:project_id/wiki/date_index', :action => 'date_index'
wiki_views.connect 'projects/:project_id/wiki/:page', :action => 'index', :page => nil
wiki_views.connect 'projects/:project_id/wiki/:page', :action => 'show', :page => nil
wiki_views.connect 'projects/:project_id/wiki/:page/edit', :action => 'edit'
wiki_views.connect 'projects/:project_id/wiki/:page/rename', :action => 'rename'
wiki_views.connect 'projects/:project_id/wiki/:page/history', :action => 'history'
@ -41,8 +41,12 @@ ActionController::Routing::Routes.draw do |map|
end
wiki_routes.connect 'projects/:project_id/wiki/:page/:action',
:action => /edit|rename|destroy|preview|protect/,
:action => /rename|preview|protect|add_attachment/,
:conditions => {:method => :post}
wiki_routes.connect 'projects/:project_id/wiki/:page/edit', :action => 'update', :conditions => {:method => :post}
wiki_routes.connect 'projects/:project_id/wiki/:page', :action => 'destroy', :conditions => {:method => :delete}
end
map.with_options :controller => 'messages' do |messages_routes|

40
doc/git.rdoc Normal file
View File

@ -0,0 +1,40 @@
= Contributing to Redmine with git and github
(This is a beta document. If you can improve it, fork it and send a patch/pull request.)
The official repository is at http://github.com/edavis10/redmine
Official branches:
* master - is automatically mirrored to svn trunk. DO NOT COMMIT OR MERGE INTO THIS BRANCH
* [0.6, 0.7, 0.8, 0.9, 1.0,...]-stable - is automatically mirrored to svn release branches. DO NOT COMMIT OR MERGE INTO THIS BRANCH
* integration-to-svn-trunk - this branch is a git-only branch that will track master (trunk). Any code in here will be eventually merged into master but it may be rebased as any time (git-svn needs to rebase to commit to svn)
* integration-to-svn-stable-1.0 - this branch is a git-only branch that will track the 1.0-stable branch in svn. Any code in here will be eventually merged into master and 1.0-stable but it may be rebased as any time (git-svn needs to rebase to commit to svn)
I (edavis10) might have some other branches on the repository for work in progress.
== Branch naming standards
Redmine has two kinds of development:
* bug fixes
* new feature development
Both bug fixes and new feature development should be done in a branch named after the issue number on Redmine.org. So if you are fixing Issue #6244 your branch should be named:
* 6244
* 6244-sort-people-by-display-name (optional description)
* issue/6244 (optional "issue" prefix)
* issue/6244-sort-people-by-display-name (optional prefix and description)
That way when the branch is merged into the Redmine core, the correct issue can be updated.
Longer term feature development might require multiple branches. Just your best judgment and try to keep the issue id in the name.
If you don't have an issue for your patch, create an issue on redmine.org and say it's a placeholder issue for your work. Better yet, add a brief overview of what you are working on to the issue and you might get some help with it.
== Coding Standards
Follow the coding standards on the Redmine wiki: http://www.redmine.org/wiki/redmine/Coding_Standards#Commits. Make sure you commit logs conform to the standards, otherwise someone else will have to rewrite them for you and you might lose attribution during the conversion to svn.

View File

@ -180,7 +180,9 @@ rescue LoadError
log("This script requires activeresource.\nRun 'gem install activeresource' to install it.", :exit => true)
end
class Project < ActiveResource::Base; end
class Project < ActiveResource::Base
self.headers["User-agent"] = "Redmine repository manager/#{Version}"
end
log("querying Redmine for projects...", :level => 1);

View File

@ -111,10 +111,10 @@ Redmine::AccessControl.map do |map|
map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member
map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member
map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member
map.permission :view_wiki_pages, :wiki => [:index, :special, :page_index, :date_index]
map.permission :view_wiki_pages, :wiki => [:index, :show, :special, :date_index]
map.permission :export_wiki_pages, :wiki => [:export]
map.permission :view_wiki_edits, :wiki => [:history, :diff, :annotate]
map.permission :edit_wiki_pages, :wiki => [:edit, :preview, :add_attachment]
map.permission :edit_wiki_pages, :wiki => [:edit, :update, :preview, :add_attachment]
map.permission :delete_wiki_pages_attachments, {}
map.permission :protect_wiki_pages, {:wiki => :protect}, :require => :member
end
@ -195,7 +195,7 @@ Redmine::MenuManager.map :project_menu do |menu|
menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar
menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural
menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural
menu.push :wiki, { :controller => 'wiki', :action => 'index', :page => nil }, :param => :project_id,
menu.push :wiki, { :controller => 'wiki', :action => 'show', :page => nil }, :param => :project_id,
:if => Proc.new { |p| p.wiki && !p.wiki.new_record? }
menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id,
:if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural

View File

@ -283,8 +283,8 @@ module Redmine
end
def line_for_project(project, options)
# Skip versions that don't have a start_date
if project.is_a?(Project) && project.start_date
# Skip versions that don't have a start_date or due date
if project.is_a?(Project) && project.start_date && project.due_date
options[:zoom] ||= 1
options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]
@ -419,7 +419,7 @@ module Redmine
def line_for_version(version, options)
# Skip versions that don't have a start_date
if version.is_a?(Version) && version.start_date
if version.is_a?(Version) && version.start_date && version.due_date
options[:zoom] ||= 1
options[:g_width] ||= (self.date_to - self.date_from + 1) * options[:zoom]

View File

@ -89,6 +89,13 @@ module Redmine #:nodoc:
def self.clear
@registered_plugins = {}
end
# Checks if a plugin is installed
#
# @param [String] id name of the plugin
def self.installed?(id)
registered_plugins[id.to_sym].present?
end
def initialize(id)
@id = id.to_sym

View File

@ -121,7 +121,7 @@ module Redmine
(\S+?) # url
(\/)? # slash
)
([^\w\=\/;\(\)]*?) # post
((?:&gt;)?|[^\w\=\/;\(\)]*?) # post
(?=<|\s|$)
}x unless const_defined?(:AUTO_LINK_RE)

View File

@ -113,7 +113,7 @@ table.list caption { text-align: left; padding: 0.5em 0.5em 0.5em 0; }
tr.project td.name a { white-space:nowrap; }
tr.project.idnt td.name a {background: url(../images/bullet_arrow_right.png) no-repeat 0 50%; padding-left: 16px;}
tr.project.idnt td.name span {background: url(../images/bullet_arrow_right.png) no-repeat 0 50%; padding-left: 16px;}
tr.project.idnt-1 td.name {padding-left: 0.5em;}
tr.project.idnt-2 td.name {padding-left: 2em;}
tr.project.idnt-3 td.name {padding-left: 3.5em;}
@ -854,6 +854,8 @@ padding-bottom: 3px;
.icon-summary { background-image: url(../images/lightning.png); }
.icon-server-authentication { background-image: url(../images/server_key.png); }
.icon-issue { background-image: url(../images/ticket.png); }
.icon-zoom-in { background-image: url(../images/zoom_in.png); }
.icon-zoom-out { background-image: url(../images/zoom_out.png); }
.icon-file { background-image: url(../images/files/default.png); }
.icon-file.text-plain { background-image: url(../images/files/text.png); }

View File

@ -20,6 +20,25 @@ class GanttsControllerTest < ActionController::TestCase
i = Issue.find(2)
assert_select "div a.issue", /##{i.id}/
end
should "work without issue due dates" do
Issue.update_all("due_date = NULL")
get :show, :project_id => 1
assert_response :success
assert_template 'show.html.erb'
assert_not_nil assigns(:gantt)
end
should "work without issue and version due dates" do
Issue.update_all("due_date = NULL")
Version.update_all("effective_date = NULL")
get :show, :project_id => 1
assert_response :success
assert_template 'show.html.erb'
assert_not_nil assigns(:gantt)
end
should "work cross project" do
get :show

View File

@ -40,6 +40,31 @@ class IssueMovesControllerTest < ActionController::TestCase
assert_equal 2, Issue.find(2).tracker_id
end
context "#create via bulk move" do
setup do
@request.session[:user_id] = 2
end
should "allow changing the issue priority" do
post :create, :ids => [1, 2], :priority_id => 6
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
assert_equal 6, Issue.find(1).priority_id
assert_equal 6, Issue.find(2).priority_id
end
should "allow adding a note when moving" do
post :create, :ids => [1, 2], :notes => 'Moving two issues'
assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
assert_equal 'Moving two issues', Issue.find(1).journals.last.notes
assert_equal 'Moving two issues', Issue.find(2).journals.last.notes
end
end
def test_bulk_copy_to_another_project
@request.session[:user_id] = 2
assert_difference 'Issue.count', 2 do

View File

@ -339,9 +339,7 @@ class IssuesControllerTest < ActionController::TestCase
get :new, :project_id => 1
assert_response 500
assert_not_nil flash[:error]
assert_tag :tag => 'div', :attributes => { :class => /error/ },
:content => /No default issue/
assert_error_tag :content => /No default issue/
end
def test_get_new_with_no_tracker_should_display_an_error
@ -350,9 +348,7 @@ class IssuesControllerTest < ActionController::TestCase
get :new, :project_id => 1
assert_response 500
assert_not_nil flash[:error]
assert_tag :tag => 'div', :attributes => { :class => /error/ },
:content => /No tracker/
assert_error_tag :content => /No tracker/
end
def test_update_new_form

View File

@ -296,6 +296,16 @@ class ProjectsControllerTest < ActionController::TestCase
assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
end
def show_archived_project_should_be_denied
project = Project.find_by_identifier('ecookbook')
project.archive!
get :show, :id => 'ecookbook'
assert_response 403
assert_nil assigns(:project)
assert_tag :tag => 'p', :content => /archived/
end
def test_private_subprojects_hidden
get :show, :id => 'ecookbook'
assert_response :success

View File

@ -106,7 +106,7 @@ class RepositoriesCvsControllerTest < ActionController::TestCase
def test_entry_not_found
get :entry, :id => 1, :path => ['sources', 'zzz.c']
assert_tag :tag => 'div', :attributes => { :class => /error/ },
assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/
end

View File

@ -154,7 +154,7 @@ class RepositoriesGitControllerTest < ActionController::TestCase
def test_annotate_binary_file
get :annotate, :id => 3, :path => ['images', 'edit.png']
assert_response 500
assert_tag :tag => 'div', :attributes => { :class => /error/ },
assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /can not be annotated/
end
else

View File

@ -129,7 +129,7 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
def test_entry_not_found
get :entry, :id => 1, :path => ['subversion_test', 'zzz.c']
assert_tag :tag => 'div', :attributes => { :class => /error/ },
assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/
end

View File

@ -32,7 +32,7 @@ class WikiControllerTest < ActionController::TestCase
end
def test_show_start_page
get :index, :project_id => 'ecookbook'
get :show, :project_id => 'ecookbook'
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /CookBook documentation/
@ -45,7 +45,7 @@ class WikiControllerTest < ActionController::TestCase
end
def test_show_page_with_name
get :index, :project_id => 1, :page => 'Another_page'
get :show, :project_id => 1, :page => 'Another_page'
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /Another page/
@ -60,32 +60,32 @@ class WikiControllerTest < ActionController::TestCase
page.content = WikiContent.new(:text => 'Side bar content for test_show_with_sidebar')
page.save!
get :index, :project_id => 1, :page => 'Another_page'
get :show, :project_id => 1, :page => 'Another_page'
assert_response :success
assert_tag :tag => 'div', :attributes => {:id => 'sidebar'},
:content => /Side bar content for test_show_with_sidebar/
end
def test_show_unexistent_page_without_edit_right
get :index, :project_id => 1, :page => 'Unexistent page'
get :show, :project_id => 1, :page => 'Unexistent page'
assert_response 404
end
def test_show_unexistent_page_with_edit_right
@request.session[:user_id] = 2
get :index, :project_id => 1, :page => 'Unexistent page'
get :show, :project_id => 1, :page => 'Unexistent page'
assert_response :success
assert_template 'edit'
end
def test_create_page
@request.session[:user_id] = 2
post :edit, :project_id => 1,
post :update, :project_id => 1,
:page => 'New page',
:content => {:comments => 'Created the page',
:text => "h1. New page\n\nThis is a new page",
:version => 0}
assert_redirected_to :action => 'index', :project_id => 'ecookbook', :page => 'New_page'
assert_redirected_to :action => 'show', :project_id => 'ecookbook', :page => 'New_page'
page = Project.find(1).wiki.find_page('New page')
assert !page.new_record?
assert_not_nil page.content
@ -96,7 +96,7 @@ class WikiControllerTest < ActionController::TestCase
@request.session[:user_id] = 2
assert_difference 'WikiPage.count' do
assert_difference 'Attachment.count' do
post :edit, :project_id => 1,
post :update, :project_id => 1,
:page => 'New page',
:content => {:comments => 'Created the page',
:text => "h1. New page\n\nThis is a new page",
@ -176,7 +176,7 @@ class WikiControllerTest < ActionController::TestCase
post :rename, :project_id => 1, :page => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => 1 }
assert_redirected_to :action => 'index', :project_id => 'ecookbook', :page => 'Another_renamed_page'
assert_redirected_to :action => 'show', :project_id => 'ecookbook', :page => 'Another_renamed_page'
wiki = Project.find(1).wiki
# Check redirects
assert_not_nil wiki.find_page('Another page')
@ -188,7 +188,7 @@ class WikiControllerTest < ActionController::TestCase
post :rename, :project_id => 1, :page => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => "0" }
assert_redirected_to :action => 'index', :project_id => 'ecookbook', :page => 'Another_renamed_page'
assert_redirected_to :action => 'show', :project_id => 'ecookbook', :page => 'Another_renamed_page'
wiki = Project.find(1).wiki
# Check that there's no redirects
assert_nil wiki.find_page('Another page')
@ -196,14 +196,14 @@ class WikiControllerTest < ActionController::TestCase
def test_destroy_child
@request.session[:user_id] = 2
post :destroy, :project_id => 1, :page => 'Child_1'
assert_redirected_to :action => 'page_index', :project_id => 'ecookbook'
delete :destroy, :project_id => 1, :page => 'Child_1'
assert_redirected_to :action => 'index', :project_id => 'ecookbook'
end
def test_destroy_parent
@request.session[:user_id] = 2
assert_no_difference('WikiPage.count') do
post :destroy, :project_id => 1, :page => 'Another_page'
delete :destroy, :project_id => 1, :page => 'Another_page'
end
assert_response :success
assert_template 'destroy'
@ -212,18 +212,18 @@ class WikiControllerTest < ActionController::TestCase
def test_destroy_parent_with_nullify
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -1) do
post :destroy, :project_id => 1, :page => 'Another_page', :todo => 'nullify'
delete :destroy, :project_id => 1, :page => 'Another_page', :todo => 'nullify'
end
assert_redirected_to :action => 'page_index', :project_id => 'ecookbook'
assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
end
def test_destroy_parent_with_cascade
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -3) do
post :destroy, :project_id => 1, :page => 'Another_page', :todo => 'destroy'
delete :destroy, :project_id => 1, :page => 'Another_page', :todo => 'destroy'
end
assert_redirected_to :action => 'page_index', :project_id => 'ecookbook'
assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
assert_nil WikiPage.find_by_id(5)
end
@ -231,17 +231,17 @@ class WikiControllerTest < ActionController::TestCase
def test_destroy_parent_with_reassign
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -1) do
post :destroy, :project_id => 1, :page => 'Another_page', :todo => 'reassign', :reassign_to_id => 1
delete :destroy, :project_id => 1, :page => 'Another_page', :todo => 'reassign', :reassign_to_id => 1
end
assert_redirected_to :action => 'page_index', :project_id => 'ecookbook'
assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
assert_equal WikiPage.find(1), WikiPage.find_by_id(5).parent
end
def test_page_index
get :page_index, :project_id => 'ecookbook'
def test_index
get :index, :project_id => 'ecookbook'
assert_response :success
assert_template 'page_index'
assert_template 'index'
pages = assigns(:pages)
assert_not_nil pages
assert_equal Project.find(1).wiki.pages.size, pages.size
@ -280,7 +280,7 @@ class WikiControllerTest < ActionController::TestCase
get :export, :project_id => 'ecookbook'
should_respond_with :redirect
should_redirect_to('wiki index') { {:action => 'index', :project_id => @project, :page => nil} }
should_redirect_to('wiki index') { {:action => 'show', :project_id => @project, :page => nil} }
end
end
end
@ -298,7 +298,7 @@ class WikiControllerTest < ActionController::TestCase
end
def test_not_found
get :index, :project_id => 999
get :show, :project_id => 999
assert_response 404
end
@ -307,7 +307,7 @@ class WikiControllerTest < ActionController::TestCase
assert !page.protected?
@request.session[:user_id] = 2
post :protect, :project_id => 1, :page => page.title, :protected => '1'
assert_redirected_to :action => 'index', :project_id => 'ecookbook', :page => 'Another_page'
assert_redirected_to :action => 'show', :project_id => 'ecookbook', :page => 'Another_page'
assert page.reload.protected?
end
@ -316,13 +316,13 @@ class WikiControllerTest < ActionController::TestCase
assert page.protected?
@request.session[:user_id] = 2
post :protect, :project_id => 1, :page => page.title, :protected => '0'
assert_redirected_to :action => 'index', :project_id => 'ecookbook', :page => 'CookBook_documentation'
assert_redirected_to :action => 'show', :project_id => 'ecookbook', :page => 'CookBook_documentation'
assert !page.reload.protected?
end
def test_show_page_with_edit_link
@request.session[:user_id] = 2
get :index, :project_id => 1
get :show, :project_id => 1
assert_response :success
assert_template 'show'
assert_tag :tag => 'a', :attributes => { :href => '/projects/1/wiki/CookBook_documentation/edit' }
@ -330,7 +330,7 @@ class WikiControllerTest < ActionController::TestCase
def test_show_page_without_edit_link
@request.session[:user_id] = 4
get :index, :project_id => 1
get :show, :project_id => 1
assert_response :success
assert_template 'show'
assert_no_tag :tag => 'a', :attributes => { :href => '/projects/1/wiki/CookBook_documentation/edit' }

View File

@ -311,22 +311,24 @@ class RoutingTest < ActionController::IntegrationTest
end
context "wiki (singular, project's pages)" do
should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'index', :project_id => '567'
should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'index', :project_id => '567', :page => 'lalala'
should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :page => 'lalala'
should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :page => 'my_page'
should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :page => 'CookBook_documentation'
should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :page => 'CookBook_documentation', :version => '2', :version_from => '1'
should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :page => 'CookBook_documentation', :version => '2'
should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :page => 'ladida'
should_route :get, "/projects/567/wiki/page_index", :controller => 'wiki', :action => 'page_index', :project_id => '567'
should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :page => 'my_page'
should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'update', :project_id => '567', :page => 'my_page'
should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :page => 'CookBook_documentation'
should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :page => 'ladida'
should_route :post, "/projects/22/wiki/ladida/destroy", :controller => 'wiki', :action => 'destroy', :project_id => '22', :page => 'ladida'
should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :page => 'ladida'
should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :page => 'ladida'
should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :page => 'ladida'
end
context "wikis (plural, admin setup)" do

View File

@ -113,11 +113,15 @@ class ActiveSupport::TestCase
def self.repository_configured?(vendor)
File.directory?(repository_path(vendor))
end
def assert_error_tag(options={})
assert_tag({:tag => 'p', :attributes => { :id => 'errorExplanation' }}.merge(options))
end
# Shoulda macros
def self.should_render_404
should_respond_with :not_found
should_render_template 'common/404'
should_render_template 'common/error'
end
def self.should_have_before_filter(expected_method, options = {})

View File

@ -79,6 +79,8 @@ class ApplicationHelperTest < ActionView::TestCase
'http://example.net/path!602815048C7B5C20!302.html' => '<a class="external" href="http://example.net/path!602815048C7B5C20!302.html">http://example.net/path!602815048C7B5C20!302.html</a>',
# escaping
'http://foo"bar' => '<a class="external" href="http://foo&quot;bar">http://foo"bar</a>',
# wrap in angle brackets
'<http://foo.bar>' => '&lt;<a class="external" href="http://foo.bar">http://foo.bar</a>&gt;'
}
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end

View File

@ -102,6 +102,7 @@ class ProjectTest < ActiveSupport::TestCase
@ecookbook.reload
assert !@ecookbook.active?
assert @ecookbook.archived?
assert !user.projects.include?(@ecookbook)
# Subproject are also archived
assert !@ecookbook.children.empty?
@ -129,6 +130,7 @@ class ProjectTest < ActiveSupport::TestCase
assert @ecookbook.unarchive
@ecookbook.reload
assert @ecookbook.active?
assert !@ecookbook.archived?
assert user.projects.include?(@ecookbook)
# Subproject can now be unarchived
@ecookbook_sub1.reload