Revision 912:5e80956cc792 .svn/pristine/14
| .svn/pristine/14/1416b352c6fb64d06513cc44f62b6e1f359f63c7.svn-base | ||
|---|---|---|
| 1 |
<%= error_messages_for 'board' %> |
|
| 2 |
|
|
| 3 |
<!--[form:board]--> |
|
| 4 |
<div class="box"> |
|
| 5 |
<p><%= f.text_field :name, :required => true %></p> |
|
| 6 |
<p><%= f.text_field :description, :required => true, :size => 80 %></p> |
|
| 7 |
</div> |
|
| 8 |
<!--[eoform:board]--> |
|
| .svn/pristine/14/142eda77e7e23817ff1c9eecae08c12f33882ae4.svn-base | ||
|---|---|---|
| 1 |
en: |
|
| 2 |
hello: "Hello from beta" |
|
| 3 |
plugin: "beta" |
|
| .svn/pristine/14/144ab265c109ceacc45d40d62097ae53d47da1fc.svn-base | ||
|---|---|---|
| 1 |
require 'acts_as_versioned' |
|
| .svn/pristine/14/144d87a484de2d989cccbe9e992e92ab12eacca5.svn-base | ||
|---|---|---|
| 1 |
class PopulateChangesetsUserId < ActiveRecord::Migration |
|
| 2 |
def self.up |
|
| 3 |
committers = Changeset.connection.select_values("SELECT DISTINCT committer FROM #{Changeset.table_name}")
|
|
| 4 |
committers.each do |committer| |
|
| 5 |
next if committer.blank? |
|
| 6 |
if committer.strip =~ /^([^<]+)(<(.*)>)?$/ |
|
| 7 |
username, email = $1.strip, $3 |
|
| 8 |
u = User.find_by_login(username) |
|
| 9 |
u ||= User.find_by_mail(email) unless email.blank? |
|
| 10 |
Changeset.update_all("user_id = #{u.id}", ["committer = ?", committer]) unless u.nil?
|
|
| 11 |
end |
|
| 12 |
end |
|
| 13 |
end |
|
| 14 |
|
|
| 15 |
def self.down |
|
| 16 |
Changeset.update_all('user_id = NULL')
|
|
| 17 |
end |
|
| 18 |
end |
|
| .svn/pristine/14/147267197c59e4171e424ec83498747a79bcc270.svn-base | ||
|---|---|---|
| 1 |
# Redmine - project management software |
|
| 2 |
# Copyright (C) 2006-2011 Jean-Philippe Lang |
|
| 3 |
# |
|
| 4 |
# This program is free software; you can redistribute it and/or |
|
| 5 |
# modify it under the terms of the GNU General Public License |
|
| 6 |
# as published by the Free Software Foundation; either version 2 |
|
| 7 |
# of the License, or (at your option) any later version. |
|
| 8 |
# |
|
| 9 |
# This program is distributed in the hope that it will be useful, |
|
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 12 |
# GNU General Public License for more details. |
|
| 13 |
# |
|
| 14 |
# You should have received a copy of the GNU General Public License |
|
| 15 |
# along with this program; if not, write to the Free Software |
|
| 16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 17 |
|
|
| 18 |
require File.expand_path('../../test_helper', __FILE__)
|
|
| 19 |
|
|
| 20 |
class WikiRedirectTest < ActiveSupport::TestCase |
|
| 21 |
fixtures :projects, :wikis, :wiki_pages |
|
| 22 |
|
|
| 23 |
def setup |
|
| 24 |
@wiki = Wiki.find(1) |
|
| 25 |
@original = WikiPage.create(:wiki => @wiki, :title => 'Original title') |
|
| 26 |
end |
|
| 27 |
|
|
| 28 |
def test_create_redirect |
|
| 29 |
@original.title = 'New title' |
|
| 30 |
assert @original.save |
|
| 31 |
@original.reload |
|
| 32 |
|
|
| 33 |
assert_equal 'New_title', @original.title |
|
| 34 |
assert @wiki.redirects.find_by_title('Original_title')
|
|
| 35 |
assert @wiki.find_page('Original title')
|
|
| 36 |
assert @wiki.find_page('ORIGINAL title')
|
|
| 37 |
end |
|
| 38 |
|
|
| 39 |
def test_update_redirect |
|
| 40 |
# create a redirect that point to this page |
|
| 41 |
assert WikiRedirect.create(:wiki => @wiki, :title => 'An_old_page', :redirects_to => 'Original_title') |
|
| 42 |
|
|
| 43 |
@original.title = 'New title' |
|
| 44 |
@original.save |
|
| 45 |
# make sure the old page now points to the new page |
|
| 46 |
assert_equal 'New_title', @wiki.find_page('An old page').title
|
|
| 47 |
end |
|
| 48 |
|
|
| 49 |
def test_reverse_rename |
|
| 50 |
# create a redirect that point to this page |
|
| 51 |
assert WikiRedirect.create(:wiki => @wiki, :title => 'An_old_page', :redirects_to => 'Original_title') |
|
| 52 |
|
|
| 53 |
@original.title = 'An old page' |
|
| 54 |
@original.save |
|
| 55 |
assert !@wiki.redirects.find_by_title_and_redirects_to('An_old_page', 'An_old_page')
|
|
| 56 |
assert @wiki.redirects.find_by_title_and_redirects_to('Original_title', 'An_old_page')
|
|
| 57 |
end |
|
| 58 |
|
|
| 59 |
def test_rename_to_already_redirected |
|
| 60 |
assert WikiRedirect.create(:wiki => @wiki, :title => 'An_old_page', :redirects_to => 'Other_page') |
|
| 61 |
|
|
| 62 |
@original.title = 'An old page' |
|
| 63 |
@original.save |
|
| 64 |
# this redirect have to be removed since 'An old page' page now exists |
|
| 65 |
assert !@wiki.redirects.find_by_title_and_redirects_to('An_old_page', 'Other_page')
|
|
| 66 |
end |
|
| 67 |
|
|
| 68 |
def test_redirects_removed_when_deleting_page |
|
| 69 |
assert WikiRedirect.create(:wiki => @wiki, :title => 'An_old_page', :redirects_to => 'Original_title') |
|
| 70 |
|
|
| 71 |
@original.destroy |
|
| 72 |
assert !@wiki.redirects.find(:first) |
|
| 73 |
end |
|
| 74 |
end |
|
| .svn/pristine/14/148dc94f440c0c6c1fdf948749c8c6f100698d2e.svn-base | ||
|---|---|---|
| 1 |
module OpenIdAuthentication |
|
| 2 |
class Nonce < ActiveRecord::Base |
|
| 3 |
set_table_name :open_id_authentication_nonces |
|
| 4 |
end |
|
| 5 |
end |
|
| .svn/pristine/14/149151b89e5659b8d56fd85ed72924a5e1708683.svn-base | ||
|---|---|---|
| 1 |
<% changesets.each do |changeset| %> |
|
| 2 |
<div class="changeset <%= cycle('odd', 'even') %>">
|
|
| 3 |
<p><%= link_to_revision(changeset, changeset.project, |
|
| 4 |
:text => "#{l(:label_revision)} #{changeset.format_identifier}") %><br />
|
|
| 5 |
<span class="author"><%= authoring(changeset.committed_on, changeset.author) %></span></p> |
|
| 6 |
<div class="wiki"> |
|
| 7 |
<%= textilizable(changeset, :comments) %> |
|
| 8 |
</div> |
|
| 9 |
</div> |
|
| 10 |
<% end %> |
|
| .svn/pristine/14/14d47feeb8d09d5c60a469b92e31b17db8244cde.svn-base | ||
|---|---|---|
| 1 |
# encoding: utf-8 |
|
| 2 |
# |
|
| 3 |
# Redmine - project management software |
|
| 4 |
# Copyright (C) 2006-2011 Jean-Philippe Lang |
|
| 5 |
# |
|
| 6 |
# This program is free software; you can redistribute it and/or |
|
| 7 |
# modify it under the terms of the GNU General Public License |
|
| 8 |
# as published by the Free Software Foundation; either version 2 |
|
| 9 |
# of the License, or (at your option) any later version. |
|
| 10 |
# |
|
| 11 |
# This program is distributed in the hope that it will be useful, |
|
| 12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
| 14 |
# GNU General Public License for more details. |
|
| 15 |
# |
|
| 16 |
# You should have received a copy of the GNU General Public License |
|
| 17 |
# along with this program; if not, write to the Free Software |
|
| 18 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
| 19 |
|
|
| 20 |
module WikiHelper |
|
| 21 |
|
|
| 22 |
def wiki_page_options_for_select(pages, selected = nil, parent = nil, level = 0) |
|
| 23 |
pages = pages.group_by(&:parent) unless pages.is_a?(Hash) |
|
| 24 |
s = '' |
|
| 25 |
if pages.has_key?(parent) |
|
| 26 |
pages[parent].each do |page| |
|
| 27 |
attrs = "value='#{page.id}'"
|
|
| 28 |
attrs << " selected='selected'" if selected == page |
|
| 29 |
indent = (level > 0) ? (' ' * level * 2 + '» ') : nil
|
|
| 30 |
|
|
| 31 |
s << "<option #{attrs}>#{indent}#{h page.pretty_title}</option>\n" +
|
|
| 32 |
wiki_page_options_for_select(pages, selected, page, level + 1) |
|
| 33 |
end |
|
| 34 |
end |
|
| 35 |
s |
|
| 36 |
end |
|
| 37 |
|
|
| 38 |
def wiki_page_breadcrumb(page) |
|
| 39 |
breadcrumb(page.ancestors.reverse.collect {|parent|
|
|
| 40 |
link_to(h(parent.pretty_title), {:controller => 'wiki', :action => 'show', :id => parent.title, :project_id => parent.project})
|
|
| 41 |
}) |
|
| 42 |
end |
|
| 43 |
end |
|
| .svn/pristine/14/14ee5b2fb5a9f9c39e2c17ac2573da976e834e55.svn-base | ||
|---|---|---|
| 1 |
<% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %> |
|
| 2 |
<p><%= pref_fields.check_box :hide_mail %></p> |
|
| 3 |
<p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p>
|
|
| 4 |
<p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p> |
|
| 5 |
<p><%= pref_fields.check_box :warn_on_leaving_unsaved %></p> |
|
| 6 |
<% end %> |
|
| 7 |
|
|
| .svn/pristine/14/14f249183ef33935d6a7aa11b5f44b945eb0da01.svn-base | ||
|---|---|---|
| 1 |
<%= error_messages_for 'document' %> |
|
| 2 |
<div class="box"> |
|
| 3 |
<!--[form:document]--> |
|
| 4 |
<p><label for="document_category_id"><%=l(:field_category)%></label> |
|
| 5 |
<%= select('document', 'category_id', DocumentCategory.active.collect {|c| [c.name, c.id]}) %></p>
|
|
| 6 |
|
|
| 7 |
<p><label for="document_title"><%=l(:field_title)%> <span class="required">*</span></label> |
|
| 8 |
<%= text_field 'document', 'title', :size => 60 %></p> |
|
| 9 |
|
|
| 10 |
<p><label for="document_description"><%=l(:field_description)%></label> |
|
| 11 |
<%= text_area 'document', 'description', :cols => 60, :rows => 15, :class => 'wiki-edit' %></p> |
|
| 12 |
<!--[eoform:document]--> |
|
| 13 |
</div> |
|
| 14 |
|
|
| 15 |
<%= wikitoolbar_for 'document_description' %> |
|
Also available in: Unified diff