Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into develop
Conflicts: app/controllers/account_controller.rbpresident
commit
9c5066b81c
@ -0,0 +1,4 @@
|
||||
class UserScoreDetails < ActiveRecord::Base
|
||||
attr_accessible :current_user_id, :current_user_level, :new_score, :old_score, :score_action, :score_changeable_obj_id, :score_changeable_obj_type, :score_type, :target_user_id, :target_user_level, :user_id
|
||||
belongs_to :score_changeable_obj,:polymorphic => true
|
||||
end
|
@ -0,0 +1,24 @@
|
||||
<table style="width: 200px;table-layout: fixed" >
|
||||
<tr>
|
||||
<% count = 0 %>
|
||||
<% for attachment in attachments %>
|
||||
<% if attachments.count == 1 %>
|
||||
<td title="<%= attachment.filename%>" style="width: 200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
|
||||
</td>
|
||||
<% elsif attachments.count == 2 %>
|
||||
<td title="<%= attachment.filename%>" style="width: 100px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
|
||||
</td>
|
||||
<% else %>
|
||||
<td title="<%= attachment.filename%>" style="width: 66px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
|
||||
<% if count == 3 %>
|
||||
<% break %>
|
||||
<% end %>
|
||||
<%= render :partial => 'attachment', :locals => {:attachment => attachment} %>
|
||||
<% count = count +1 %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tr>
|
||||
</table>
|
@ -0,0 +1,6 @@
|
||||
<%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
|
||||
<% if attachment.is_text? %>
|
||||
<%= link_to image_tag('magnifier.png'),
|
||||
:controller => 'attachments', :action => 'show',
|
||||
:id => attachment, :filename => attachment.filename,:style => "width:50px"%>
|
||||
<% end %>
|
@ -0,0 +1,14 @@
|
||||
<span class="user" style="font-size: 15px">
|
||||
<div data-kls="HomeworkAttach" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled"
|
||||
style="height: 15px; width: 100px; overflow: hidden; z-index: 1; position: relative;">
|
||||
<% if stars != nil %>
|
||||
<div class="jRatingColor" style="width: <%=stars.to_f * 20 %>%;"></div>
|
||||
<% else %>
|
||||
<div class="jRatingColor" style="width: 0px;"></div>
|
||||
<% end %>
|
||||
<div class="jRatingAverage" style="width: 0px; top: -20px;"></div>
|
||||
<div class="jStar" style="width: 115px; height: 20px; top: -40px;
|
||||
background: url('/images/seems_rateable/stars.png') repeat-x scroll 0% 0% transparent;">
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
@ -0,0 +1,34 @@
|
||||
<!-- added by bai -->
|
||||
<% messages_count = @user.messages.count %>
|
||||
<% messages_score = messages_count * 0.05%>
|
||||
<% finall_messages_score = messages_score %>
|
||||
|
||||
<% journals_count = @user.journals.count %>
|
||||
<% journals_score = journals_count * 0.1 %>
|
||||
<% user_changesets_count = @user.changesets.count %>
|
||||
<% user_changesets_score = user_changesets_count * 0.3 %>
|
||||
<% finall_user_project_score = journals_score + user_changesets_score %>
|
||||
|
||||
<% journals_for_messages_count = @user.journals_messages.count %>
|
||||
<% activities_count = @user.activities.count %>
|
||||
<% journals_for_messages_score = journals_for_messages_count * 0.05 %>
|
||||
<% activities_score = activities_count * 0.2 %>
|
||||
<% finall_activity_score = journals_for_messages_score + activities_score %>
|
||||
|
||||
<% news_count = @user.news.count %>
|
||||
<% news_score = news_count * 0.1 %>
|
||||
<% wiki_contents_count = @user.wiki_contents.count %>
|
||||
<% wiki_contents_score = wiki_contents_count * 0.1 %>
|
||||
<% comments_count = @user.comments.count %>
|
||||
<% comments_score = comments_count * 0.1 %>
|
||||
<% finall_influence_score = news_score + wiki_contents_score + comments_score %>
|
||||
<% finall_user_score = finall_messages_score + finall_user_project_score + finall_activity_score + finall_influence_score %>
|
||||
|
||||
<div><%= l(:label_user_score) %></div>
|
||||
<div> = <%= l(:label_user_score_of_collaboration) %> + <%= l(:label_user_score_of_influence) %> +
|
||||
<%= l(:label_user_score_of_skill)%> + <%= l(:label_user_score_of_active) %></div>
|
||||
<!-- <div> + <%= l(:label_user_score_of_influence) %></div> -->
|
||||
<div> = <%= format("%.2f" ,@user.user_score_attr.collaboration.nil? ? 0:@user.user_score_attr.collaboration).to_f %> + <%= format("%.2f" , @user.user_score_attr.influence.nil? ? 0:@user.user_score_attr.influence ).to_f %>
|
||||
+ <%= format("%.2f" , @user.user_score_attr.skill.nil? ? 0:@user.user_score_attr.skill).to_f %> + <%= format("%.2f" , @user.user_score_attr.active.nil? ? 0:@user.user_score_attr.active).to_f %></div>
|
||||
<div> = <%= format("%.2f" ,@user.user_score_attr.total_score.nil? ? 0:@user.user_score_attr.total_score).to_f %></div>
|
||||
<!-- end -->
|
@ -0,0 +1,6 @@
|
||||
<div>协同得分:</div>
|
||||
<div> 发帖 +2</div>
|
||||
<div> 对缺陷留言 +1</div>
|
||||
<div> 更改一次缺陷状态 +1</div>
|
||||
<div> 对留言的回复 +1</div>
|
||||
<div> 对帖子的回复 +1</div>
|
@ -0,0 +1,6 @@
|
||||
<%= l(:label_user_grade)%>:
|
||||
<%= link_to(format("%.2f" , @user.user_score_attr.total_score).to_f, {:controller => 'users',
|
||||
:action => 'show_new_score',
|
||||
:remote => true,
|
||||
:id => user.id
|
||||
}, :style => 'color :#E8770D;',:id => 'user_score') %>
|
@ -0,0 +1,3 @@
|
||||
<!-- added by bai -->
|
||||
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'users/score_new_index', :locals => {:index =>0 }) %>');
|
||||
<!-- end -->
|
@ -0,0 +1,3 @@
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'users/show_new_score') %>');
|
||||
showModal('ajax-modal', '400px');
|
||||
$('#ajax-modal').addClass('new-watcher');
|
@ -0,0 +1,3 @@
|
||||
<!-- added by bai -->
|
||||
$('#show_score_detail').html('<%= escape_javascript(render :partial => 'users/topic_new_score_index', :locals => {:index =>0 }) %>');
|
||||
<!-- end -->
|
@ -0,0 +1,2 @@
|
||||
$('#score_div').html('<%= escape_javascript(render(:partial => 'users/user_score',
|
||||
:locals => {:user => @user} )) %>');
|
@ -0,0 +1,19 @@
|
||||
class CreateUserScoreDetails < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :user_score_details do |t|
|
||||
t.integer :current_user_id
|
||||
t.integer :target_user_id
|
||||
t.string :score_type
|
||||
t.string :score_action
|
||||
t.integer :user_id
|
||||
t.integer :old_score
|
||||
t.integer :new_score
|
||||
t.integer :current_user_level
|
||||
t.integer :target_user_level
|
||||
t.integer :score_changeable_obj_id
|
||||
t.string :score_changeable_obj_type
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddProjectIdToHomeworkAttach < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :homework_attaches, :project_id, :integer, default: 0
|
||||
end
|
||||
end
|
@ -0,0 +1,25 @@
|
||||
class RemoveDataToHomeworkAttach < ActiveRecord::Migration
|
||||
def up
|
||||
bidding_projects = BidingProject.joins(:bid).where("bids.reward_type = 3")
|
||||
bidding_projects.each do |biding|
|
||||
homework = HomeworkAttach.new
|
||||
homework.project_id = biding.project_id
|
||||
homework.bid_id = biding.bid_id
|
||||
homework.created_at = biding.created_at
|
||||
homework.updated_at = biding.updated_at
|
||||
homework.reward = biding.reward
|
||||
homework.description = biding.description
|
||||
homework.user_id = biding.user_id
|
||||
homework.state = 0
|
||||
homework.save
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
bidding_projects = BidingProject.joins(:bid).where("bids.reward_type = 3")
|
||||
bidding_projects.each do |biding|
|
||||
homework = HomeworkAttach.where("bid_id = #{biding.bid_id} and user_id = #{biding.user_id}")
|
||||
homework.first.destroy
|
||||
end
|
||||
end
|
||||
end
|
Binary file not shown.
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<title>文件未找到</title>
|
||||
<style>
|
||||
body{
|
||||
font-family: Trebuchet MS,Georgia,"Times New Roman",serif;
|
||||
color:#303030;
|
||||
margin:10px;
|
||||
}
|
||||
h1{
|
||||
font-size:1.5em;
|
||||
}
|
||||
p{
|
||||
font-size:0.8em;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<h1>文件已经损坏</h1>
|
||||
<p>抱歉,因文件已经损坏,请重新上传此文件.</p>
|
||||
<p><a href="javascript:history.back()">Back</a></p>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,97 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.expand_path('../test_case', __FILE__)
|
||||
require 'tmpdir'
|
||||
|
||||
class RedminePmTest::RepositoryGitTest < RedminePmTest::TestCase
|
||||
fixtures :projects, :users, :members, :roles, :member_roles
|
||||
|
||||
GIT_BIN = Redmine::Configuration['scm_git_command'] || "git"
|
||||
|
||||
def test_anonymous_read_on_public_repo_with_permission_should_succeed
|
||||
assert_success "ls-remote", git_url
|
||||
end
|
||||
|
||||
def test_anonymous_read_on_public_repo_without_permission_should_fail
|
||||
Role.anonymous.remove_permission! :browse_repository
|
||||
assert_failure "ls-remote", git_url
|
||||
end
|
||||
|
||||
def test_invalid_credentials_should_fail
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "ls-remote", git_url
|
||||
end
|
||||
with_credentials "dlopper", "wrong" do
|
||||
assert_failure "ls-remote", git_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_clone
|
||||
Dir.mktmpdir do |dir|
|
||||
Dir.chdir(dir) do
|
||||
assert_success "clone", git_url
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_write_commands
|
||||
Role.find(2).add_permission! :commit_access
|
||||
filename = random_filename
|
||||
|
||||
Dir.mktmpdir do |dir|
|
||||
assert_success "clone", git_url, dir
|
||||
Dir.chdir(dir) do
|
||||
f = File.new(File.join(dir, filename), "w")
|
||||
f.write "test file content"
|
||||
f.close
|
||||
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "add", filename
|
||||
assert_success "commit -a --message Committing_a_file"
|
||||
assert_success "push", git_url, "--all"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Dir.mktmpdir do |dir|
|
||||
assert_success "clone", git_url, dir
|
||||
Dir.chdir(dir) do
|
||||
assert File.exists?(File.join(dir, "#{filename}"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def execute(*args)
|
||||
a = [GIT_BIN]
|
||||
super a, *args
|
||||
end
|
||||
|
||||
def git_url(path=nil)
|
||||
host = ENV['REDMINE_TEST_DAV_SERVER'] || '127.0.0.1'
|
||||
credentials = nil
|
||||
if username && password
|
||||
credentials = "#{username}:#{password}"
|
||||
end
|
||||
url = "http://#{credentials}@#{host}/git/ecookbook"
|
||||
url << "/#{path}" if path
|
||||
url
|
||||
end
|
||||
end
|
@ -0,0 +1,294 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.expand_path('../test_case', __FILE__)
|
||||
require 'tmpdir'
|
||||
|
||||
class RedminePmTest::RepositorySubversionTest < RedminePmTest::TestCase
|
||||
fixtures :projects, :users, :members, :roles, :member_roles, :auth_sources
|
||||
|
||||
SVN_BIN = Redmine::Configuration['scm_subversion_command'] || "svn"
|
||||
|
||||
def test_anonymous_read_on_public_repo_with_permission_should_succeed
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
|
||||
def test_anonymous_read_on_public_repo_without_permission_should_fail
|
||||
Role.anonymous.remove_permission! :browse_repository
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
|
||||
def test_anonymous_read_on_private_repo_should_fail
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
|
||||
def test_anonymous_commit_on_public_repo_should_fail
|
||||
Role.anonymous.add_permission! :commit_access
|
||||
assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
|
||||
def test_anonymous_commit_on_private_repo_should_fail
|
||||
Role.anonymous.add_permission! :commit_access
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
|
||||
def test_non_member_read_on_public_repo_with_permission_should_succeed
|
||||
Role.anonymous.remove_permission! :browse_repository
|
||||
with_credentials "miscuser8", "foo" do
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_non_member_read_on_public_repo_without_permission_should_fail
|
||||
Role.anonymous.remove_permission! :browse_repository
|
||||
Role.non_member.remove_permission! :browse_repository
|
||||
with_credentials "miscuser8", "foo" do
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_non_member_read_on_private_repo_should_fail
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "miscuser8", "foo" do
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_non_member_commit_on_public_repo_should_fail
|
||||
Role.non_member.add_permission! :commit_access
|
||||
assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
|
||||
def test_non_member_commit_on_private_repo_should_fail
|
||||
Role.non_member.add_permission! :commit_access
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
|
||||
def test_member_read_on_public_repo_with_permission_should_succeed
|
||||
Role.anonymous.remove_permission! :browse_repository
|
||||
Role.non_member.remove_permission! :browse_repository
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_member_read_on_public_repo_without_permission_should_fail
|
||||
Role.anonymous.remove_permission! :browse_repository
|
||||
Role.non_member.remove_permission! :browse_repository
|
||||
Role.find(2).remove_permission! :browse_repository
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_member_read_on_private_repo_with_permission_should_succeed
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_member_read_on_private_repo_without_permission_should_fail
|
||||
Role.find(2).remove_permission! :browse_repository
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_member_commit_on_public_repo_with_permission_should_succeed
|
||||
Role.find(2).add_permission! :commit_access
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
end
|
||||
|
||||
def test_member_commit_on_public_repo_without_permission_should_fail
|
||||
Role.find(2).remove_permission! :commit_access
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
end
|
||||
|
||||
def test_member_commit_on_private_repo_with_permission_should_succeed
|
||||
Role.find(2).add_permission! :commit_access
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
end
|
||||
|
||||
def test_member_commit_on_private_repo_without_permission_should_fail
|
||||
Role.find(2).remove_permission! :commit_access
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
end
|
||||
|
||||
def test_invalid_credentials_should_fail
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
with_credentials "dlopper", "wrong" do
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_anonymous_read_should_fail_with_login_required
|
||||
assert_success "ls", svn_url
|
||||
with_settings :login_required => '1' do
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_authenticated_read_should_succeed_with_login_required
|
||||
with_settings :login_required => '1' do
|
||||
with_credentials "miscuser8", "foo" do
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_read_on_archived_projects_should_fail
|
||||
Project.find(1).update_attribute :status, Project::STATUS_ARCHIVED
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
|
||||
def test_read_on_archived_private_projects_should_fail
|
||||
Project.find(1).update_attribute :status, Project::STATUS_ARCHIVED
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_read_on_closed_projects_should_succeed
|
||||
Project.find(1).update_attribute :status, Project::STATUS_CLOSED
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
|
||||
def test_read_on_closed_private_projects_should_succeed
|
||||
Project.find(1).update_attribute :status, Project::STATUS_CLOSED
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
def test_commit_on_closed_projects_should_fail
|
||||
Project.find(1).update_attribute :status, Project::STATUS_CLOSED
|
||||
Role.find(2).add_permission! :commit_access
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
end
|
||||
|
||||
def test_commit_on_closed_private_projects_should_fail
|
||||
Project.find(1).update_attribute :status, Project::STATUS_CLOSED
|
||||
Project.find(1).update_attribute :is_public, false
|
||||
Role.find(2).add_permission! :commit_access
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_failure "mkdir --message Creating_a_directory", svn_url(random_filename)
|
||||
end
|
||||
end
|
||||
|
||||
if ldap_configured?
|
||||
def test_user_with_ldap_auth_source_should_authenticate_with_ldap_credentials
|
||||
ldap_user = User.new(:mail => 'example1@redmine.org', :firstname => 'LDAP', :lastname => 'user', :auth_source_id => 1)
|
||||
ldap_user.login = 'example1'
|
||||
ldap_user.save!
|
||||
|
||||
with_settings :login_required => '1' do
|
||||
with_credentials "example1", "123456" do
|
||||
assert_success "ls", svn_url
|
||||
end
|
||||
end
|
||||
|
||||
with_settings :login_required => '1' do
|
||||
with_credentials "example1", "wrong" do
|
||||
assert_failure "ls", svn_url
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_checkout
|
||||
Dir.mktmpdir do |dir|
|
||||
assert_success "checkout", svn_url, dir
|
||||
end
|
||||
end
|
||||
|
||||
def test_read_commands
|
||||
assert_success "info", svn_url
|
||||
assert_success "ls", svn_url
|
||||
assert_success "log", svn_url
|
||||
end
|
||||
|
||||
def test_write_commands
|
||||
Role.find(2).add_permission! :commit_access
|
||||
filename = random_filename
|
||||
|
||||
Dir.mktmpdir do |dir|
|
||||
assert_success "checkout", svn_url, dir
|
||||
Dir.chdir(dir) do
|
||||
# creates a file in the working copy
|
||||
f = File.new(File.join(dir, filename), "w")
|
||||
f.write "test file content"
|
||||
f.close
|
||||
|
||||
assert_success "add", filename
|
||||
with_credentials "dlopper", "foo" do
|
||||
assert_success "commit --message Committing_a_file"
|
||||
assert_success "copy --message Copying_a_file", svn_url(filename), svn_url("#{filename}_copy")
|
||||
assert_success "delete --message Deleting_a_file", svn_url(filename)
|
||||
assert_success "mkdir --message Creating_a_directory", svn_url("#{filename}_dir")
|
||||
end
|
||||
assert_success "update"
|
||||
|
||||
# checks that the working copy was updated
|
||||
assert File.exists?(File.join(dir, "#{filename}_copy"))
|
||||
assert File.directory?(File.join(dir, "#{filename}_dir"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_read_invalid_repo_should_fail
|
||||
assert_failure "ls", svn_url("invalid")
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def execute(*args)
|
||||
a = [SVN_BIN, "--no-auth-cache --non-interactive"]
|
||||
a << "--username #{username}" if username
|
||||
a << "--password #{password}" if password
|
||||
|
||||
super a, *args
|
||||
end
|
||||
|
||||
def svn_url(path=nil)
|
||||
host = ENV['REDMINE_TEST_DAV_SERVER'] || '127.0.0.1'
|
||||
url = "http://#{host}/svn/ecookbook"
|
||||
url << "/#{path}" if path
|
||||
url
|
||||
end
|
||||
end
|
@ -0,0 +1,81 @@
|
||||
# Redmine - project management software
|
||||
# Copyright (C) 2006-2013 Jean-Philippe Lang
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
require File.expand_path('../../../test_helper', __FILE__)
|
||||
|
||||
module RedminePmTest
|
||||
class TestCase < ActiveSupport::TestCase
|
||||
attr_reader :command, :response, :status, :username, :password
|
||||
|
||||
# Cannot use transactional fixtures here: database
|
||||
# will be accessed from Redmine.pm with its own connection
|
||||
self.use_transactional_fixtures = false
|
||||
|
||||
def test_dummy
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def assert_response(expected, msg=nil)
|
||||
case expected
|
||||
when :success
|
||||
assert_equal 0, status,
|
||||
(msg || "The command failed (exit: #{status}):\n #{command}\nOutput was:\n#{formatted_response}")
|
||||
when :failure
|
||||
assert_not_equal 0, status,
|
||||
(msg || "The command succeed (exit: #{status}):\n #{command}\nOutput was:\n#{formatted_response}")
|
||||
else
|
||||
assert_equal expected, status, msg
|
||||
end
|
||||
end
|
||||
|
||||
def assert_success(*args)
|
||||
execute *args
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
def assert_failure(*args)
|
||||
execute *args
|
||||
assert_response :failure
|
||||
end
|
||||
|
||||
def with_credentials(username, password)
|
||||
old_username, old_password = @username, @password
|
||||
@username, @password = username, password
|
||||
yield if block_given?
|
||||
ensure
|
||||
@username, @password = old_username, old_password
|
||||
end
|
||||
|
||||
def execute(*args)
|
||||
@command = args.join(' ')
|
||||
@status = nil
|
||||
IO.popen("#{command} 2>&1") do |io|
|
||||
@response = io.read
|
||||
end
|
||||
@status = $?.exitstatus
|
||||
end
|
||||
|
||||
def formatted_response
|
||||
"#{'='*40}\n#{response}#{'='*40}"
|
||||
end
|
||||
|
||||
def random_filename
|
||||
Redmine::Utils.random_hex(16)
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
auth_sources_001:
|
||||
id: 1
|
||||
type: AuthSourceLdap
|
||||
name: 'LDAP test server'
|
||||
host: '127.0.0.1'
|
||||
port: 389
|
||||
base_dn: 'OU=Person,DC=redmine,DC=org'
|
||||
attr_login: uid
|
||||
attr_firstname: givenName
|
||||
attr_lastname: sn
|
||||
attr_mail: mail
|
||||
onthefly_register: false
|
@ -0,0 +1,22 @@
|
||||
---
|
||||
changes_001:
|
||||
id: 1
|
||||
changeset_id: 100
|
||||
action: A
|
||||
path: /test/some/path/in/the/repo
|
||||
from_path:
|
||||
from_revision:
|
||||
changes_002:
|
||||
id: 2
|
||||
changeset_id: 100
|
||||
action: A
|
||||
path: /test/some/path/elsewhere/in/the/repo
|
||||
from_path:
|
||||
from_revision:
|
||||
changes_003:
|
||||
id: 3
|
||||
changeset_id: 101
|
||||
action: M
|
||||
path: /test/some/path/in/the/repo
|
||||
from_path:
|
||||
from_revision:
|
@ -0,0 +1,104 @@
|
||||
---
|
||||
changesets_001:
|
||||
commit_date: 2007-04-11
|
||||
committed_on: 2007-04-11 15:14:44 +02:00
|
||||
revision: 1
|
||||
scmid: 691322a8eb01e11fd7
|
||||
id: 100
|
||||
comments: 'My very first commit do not escaping #<>&'
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
user_id: 3
|
||||
changesets_002:
|
||||
commit_date: 2007-04-12
|
||||
committed_on: 2007-04-12 15:14:44 +02:00
|
||||
revision: 2
|
||||
id: 101
|
||||
comments: 'This commit fixes #1, #2 and references #1 & #3'
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
user_id: 3
|
||||
changesets_003:
|
||||
commit_date: 2007-04-12
|
||||
committed_on: 2007-04-12 15:14:44 +02:00
|
||||
revision: 3
|
||||
id: 102
|
||||
comments: |-
|
||||
A commit with wrong issue ids
|
||||
IssueID #666 #3
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
user_id: 3
|
||||
changesets_004:
|
||||
commit_date: 2007-04-12
|
||||
committed_on: 2007-04-12 15:14:44 +02:00
|
||||
revision: 4
|
||||
id: 103
|
||||
comments: |-
|
||||
A commit with an issue id of an other project
|
||||
IssueID 4 2
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
user_id: 3
|
||||
changesets_005:
|
||||
commit_date: "2007-09-10"
|
||||
comments: Modified one file in the folder.
|
||||
committed_on: 2007-09-10 19:01:08
|
||||
revision: "5"
|
||||
id: 104
|
||||
scmid:
|
||||
user_id: 3
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
changesets_006:
|
||||
commit_date: "2007-09-10"
|
||||
comments: Moved helloworld.rb from / to /folder.
|
||||
committed_on: 2007-09-10 19:01:47
|
||||
revision: "6"
|
||||
id: 105
|
||||
scmid:
|
||||
user_id: 3
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
changesets_007:
|
||||
commit_date: "2007-09-10"
|
||||
comments: Removed one file.
|
||||
committed_on: 2007-09-10 19:02:16
|
||||
revision: "7"
|
||||
id: 106
|
||||
scmid:
|
||||
user_id: 3
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
changesets_008:
|
||||
commit_date: "2007-09-10"
|
||||
comments: |-
|
||||
This commits references an issue.
|
||||
Refs #2
|
||||
committed_on: 2007-09-10 19:04:35
|
||||
revision: "8"
|
||||
id: 107
|
||||
scmid:
|
||||
user_id: 3
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
changesets_009:
|
||||
commit_date: "2009-09-10"
|
||||
comments: One file added.
|
||||
committed_on: 2009-09-10 19:04:35
|
||||
revision: "9"
|
||||
id: 108
|
||||
scmid:
|
||||
user_id: 3
|
||||
repository_id: 10
|
||||
committer: dlopper
|
||||
changesets_010:
|
||||
commit_date: "2009-09-10"
|
||||
comments: Same file modified.
|
||||
committed_on: 2009-09-10 19:04:35
|
||||
revision: "10"
|
||||
id: 109
|
||||
scmid:
|
||||
user_id: 3
|
||||
repository_id: 10
|
||||
committer: dlopper
|
@ -0,0 +1,17 @@
|
||||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
||||
comments_001:
|
||||
commented_type: News
|
||||
commented_id: 1
|
||||
id: 1
|
||||
author_id: 1
|
||||
comments: my first comment
|
||||
created_on: 2006-12-10 18:10:10 +01:00
|
||||
updated_on: 2006-12-10 18:10:10 +01:00
|
||||
comments_002:
|
||||
commented_type: News
|
||||
commented_id: 1
|
||||
id: 2
|
||||
author_id: 2
|
||||
comments: This is an other comment
|
||||
created_on: 2006-12-10 18:12:10 +01:00
|
||||
updated_on: 2006-12-10 18:12:10 +01:00
|
@ -0,0 +1,8 @@
|
||||
default:
|
||||
somesetting: foo
|
||||
|
||||
production:
|
||||
|
||||
development:
|
||||
|
||||
test:
|
@ -0,0 +1,7 @@
|
||||
default:
|
||||
|
||||
production:
|
||||
|
||||
development:
|
||||
|
||||
test:
|
@ -0,0 +1,8 @@
|
||||
default:
|
||||
|
||||
production:
|
||||
|
||||
development:
|
||||
|
||||
test:
|
||||
somesetting: foo
|
@ -0,0 +1,9 @@
|
||||
default:
|
||||
somesetting: foo
|
||||
|
||||
production:
|
||||
|
||||
development:
|
||||
|
||||
test:
|
||||
somesetting: bar
|
@ -0,0 +1,165 @@
|
||||
---
|
||||
custom_fields_001:
|
||||
name: Database
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: true
|
||||
is_filter: true
|
||||
type: IssueCustomField
|
||||
max_length: 0
|
||||
possible_values:
|
||||
- MySQL
|
||||
- PostgreSQL
|
||||
- Oracle
|
||||
id: 1
|
||||
is_required: false
|
||||
field_format: list
|
||||
default_value: ""
|
||||
editable: true
|
||||
position: 2
|
||||
custom_fields_002:
|
||||
name: Searchable field
|
||||
min_length: 1
|
||||
regexp: ""
|
||||
is_for_all: true
|
||||
is_filter: true
|
||||
type: IssueCustomField
|
||||
max_length: 100
|
||||
possible_values: ""
|
||||
id: 2
|
||||
is_required: false
|
||||
field_format: string
|
||||
searchable: true
|
||||
default_value: "Default string"
|
||||
editable: true
|
||||
position: 1
|
||||
custom_fields_003:
|
||||
name: Development status
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: false
|
||||
is_filter: true
|
||||
type: ProjectCustomField
|
||||
max_length: 0
|
||||
possible_values:
|
||||
- Stable
|
||||
- Beta
|
||||
- Alpha
|
||||
- Planning
|
||||
id: 3
|
||||
is_required: false
|
||||
field_format: list
|
||||
default_value: ""
|
||||
editable: true
|
||||
position: 1
|
||||
custom_fields_004:
|
||||
name: Phone number
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: false
|
||||
type: UserCustomField
|
||||
max_length: 0
|
||||
possible_values: ""
|
||||
id: 4
|
||||
is_required: false
|
||||
field_format: string
|
||||
default_value: ""
|
||||
editable: true
|
||||
position: 1
|
||||
custom_fields_005:
|
||||
name: Money
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: false
|
||||
type: UserCustomField
|
||||
max_length: 0
|
||||
possible_values: ""
|
||||
id: 5
|
||||
is_required: false
|
||||
field_format: float
|
||||
default_value: ""
|
||||
editable: true
|
||||
position: 2
|
||||
custom_fields_006:
|
||||
name: Float field
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: true
|
||||
type: IssueCustomField
|
||||
max_length: 0
|
||||
possible_values: ""
|
||||
id: 6
|
||||
is_required: false
|
||||
field_format: float
|
||||
default_value: ""
|
||||
editable: true
|
||||
position: 3
|
||||
custom_fields_007:
|
||||
name: Billable
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: false
|
||||
is_filter: true
|
||||
type: TimeEntryActivityCustomField
|
||||
max_length: 0
|
||||
possible_values: ""
|
||||
id: 7
|
||||
is_required: false
|
||||
field_format: bool
|
||||
default_value: ""
|
||||
editable: true
|
||||
position: 1
|
||||
custom_fields_008:
|
||||
name: Custom date
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: true
|
||||
is_filter: false
|
||||
type: IssueCustomField
|
||||
max_length: 0
|
||||
possible_values: ""
|
||||
id: 8
|
||||
is_required: false
|
||||
field_format: date
|
||||
default_value: ""
|
||||
editable: true
|
||||
position: 4
|
||||
custom_fields_009:
|
||||
name: Project 1 cf
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: false
|
||||
is_filter: true
|
||||
type: IssueCustomField
|
||||
max_length: 0
|
||||
possible_values: ""
|
||||
id: 9
|
||||
is_required: false
|
||||
field_format: date
|
||||
default_value: ""
|
||||
editable: true
|
||||
position: 5
|
||||
custom_fields_010:
|
||||
name: Overtime
|
||||
min_length: 0
|
||||
regexp: ""
|
||||
is_for_all: false
|
||||
is_filter: false
|
||||
type: TimeEntryCustomField
|
||||
max_length: 0
|
||||
possible_values: ""
|
||||
id: 10
|
||||
is_required: false
|
||||
field_format: bool
|
||||
default_value: 0
|
||||
editable: true
|
||||
position: 1
|
||||
custom_fields_011:
|
||||
id: 11
|
||||
name: Binary
|
||||
type: CustomField
|
||||
possible_values:
|
||||
- !binary |
|
||||
SGXDqWzDp2prc2Tigqw2NTTDuQ==
|
||||
- Other value
|
||||
field_format: list
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
custom_fields_projects_001:
|
||||
custom_field_id: 9
|
||||
project_id: 1
|
@ -0,0 +1,19 @@
|
||||
---
|
||||
custom_fields_trackers_001:
|
||||
custom_field_id: 1
|
||||
tracker_id: 1
|
||||
custom_fields_trackers_002:
|
||||
custom_field_id: 2
|
||||
tracker_id: 1
|
||||
custom_fields_trackers_003:
|
||||
custom_field_id: 2
|
||||
tracker_id: 3
|
||||
custom_fields_trackers_004:
|
||||
custom_field_id: 6
|
||||
tracker_id: 1
|
||||
custom_fields_trackers_005:
|
||||
custom_field_id: 6
|
||||
tracker_id: 2
|
||||
custom_fields_trackers_006:
|
||||
custom_field_id: 6
|
||||
tracker_id: 3
|
@ -0,0 +1,103 @@
|
||||
---
|
||||
custom_values_006:
|
||||
customized_type: Issue
|
||||
custom_field_id: 2
|
||||
customized_id: 3
|
||||
id: 6
|
||||
value: "125"
|
||||
custom_values_007:
|
||||
customized_type: Project
|
||||
custom_field_id: 3
|
||||
customized_id: 1
|
||||
id: 7
|
||||
value: Stable
|
||||
custom_values_001:
|
||||
customized_type: Principal
|
||||
custom_field_id: 4
|
||||
customized_id: 3
|
||||
id: 1
|
||||
value: ""
|
||||
custom_values_002:
|
||||
customized_type: Principal
|
||||
custom_field_id: 4
|
||||
customized_id: 4
|
||||
id: 2
|
||||
value: 01 23 45 67 89
|
||||
custom_values_003:
|
||||
customized_type: Principal
|
||||
custom_field_id: 4
|
||||
customized_id: 2
|
||||
id: 3
|
||||
value: "01 42 50 00 00"
|
||||
custom_values_004:
|
||||
customized_type: Issue
|
||||
custom_field_id: 2
|
||||
customized_id: 1
|
||||
id: 4
|
||||
value: "125"
|
||||
custom_values_005:
|
||||
customized_type: Issue
|
||||
custom_field_id: 2
|
||||
customized_id: 2
|
||||
id: 5
|
||||
value: ""
|
||||
custom_values_008:
|
||||
customized_type: Issue
|
||||
custom_field_id: 1
|
||||
customized_id: 3
|
||||
id: 8
|
||||
value: "MySQL"
|
||||
custom_values_009:
|
||||
customized_type: Issue
|
||||
custom_field_id: 2
|
||||
customized_id: 7
|
||||
id: 9
|
||||
value: "this is a stringforcustomfield search"
|
||||
custom_values_010:
|
||||
customized_type: Issue
|
||||
custom_field_id: 6
|
||||
customized_id: 1
|
||||
id: 10
|
||||
value: "2.1"
|
||||
custom_values_011:
|
||||
customized_type: Issue
|
||||
custom_field_id: 6
|
||||
customized_id: 2
|
||||
id: 11
|
||||
value: "2.05"
|
||||
custom_values_012:
|
||||
customized_type: Issue
|
||||
custom_field_id: 6
|
||||
customized_id: 3
|
||||
id: 12
|
||||
value: "11.65"
|
||||
custom_values_013:
|
||||
customized_type: Issue
|
||||
custom_field_id: 6
|
||||
customized_id: 7
|
||||
id: 13
|
||||
value: ""
|
||||
custom_values_014:
|
||||
customized_type: Issue
|
||||
custom_field_id: 6
|
||||
customized_id: 5
|
||||
id: 14
|
||||
value: "-7.6"
|
||||
custom_values_015:
|
||||
customized_type: Enumeration
|
||||
custom_field_id: 7
|
||||
customized_id: 10
|
||||
id: 15
|
||||
value: true
|
||||
custom_values_016:
|
||||
customized_type: Enumeration
|
||||
custom_field_id: 7
|
||||
customized_id: 11
|
||||
id: 16
|
||||
value: '1'
|
||||
custom_values_017:
|
||||
customized_type: Issue
|
||||
custom_field_id: 8
|
||||
customized_id: 1
|
||||
id: 17
|
||||
value: '2009-12-01'
|
@ -0,0 +1,25 @@
|
||||
# HG changeset patch
|
||||
# User tmaruyama
|
||||
# Date 1362559296 0
|
||||
# Node ID ee54942e0289c30bea1b1973750b698b1ee7c466
|
||||
# Parent 738777832f379f6f099c25251593fc57bc17f586
|
||||
fix some Japanese "issue" translations (#13350)
|
||||
|
||||
Contributed by Go MAEDA.
|
||||
|
||||
diff --git a/config/locales/ja.yml b/config/locales/ja.yml
|
||||
--- a/config/locales/ja.yml
|
||||
+++ b/config/locales/ja.yml
|
||||
@@ -904,9 +904,9 @@ ja:
|
||||
text_journal_set_to: "%{label} を %{value} にセット"
|
||||
text_journal_deleted: "%{label} を削除 (%{old})"
|
||||
text_journal_added: "%{label} %{value} を追加"
|
||||
- text_tip_issue_begin_day: この日に開始するタスク
|
||||
- text_tip_issue_end_day: この日に終了するタスク
|
||||
- text_tip_issue_begin_end_day: この日のうちに開始して終了するタスク
|
||||
+ text_tip_issue_begin_day: この日に開始するチケット
|
||||
+ text_tip_issue_end_day: この日に終了するチケット
|
||||
+ text_tip_issue_begin_end_day: この日に開始・終了するチケット
|
||||
text_caracters_maximum: "最大%{count}文字です。"
|
||||
text_caracters_minimum: "最低%{count}文字の長さが必要です"
|
||||
text_length_between: "長さは%{min}から%{max}文字までです。"
|
@ -0,0 +1,19 @@
|
||||
# HG changeset patch
|
||||
# User tmaruyama
|
||||
# Date 1355872765 0
|
||||
# Node ID 8a13ebed1779c2e85fa644ecdd0de81996c969c4
|
||||
# Parent 5c3c5f917ae92f278fe42c6978366996595b0796
|
||||
Russian "about_x_hours" translation changed by Mikhail Velkin (#12640)
|
||||
|
||||
diff --git a/config/locales/ru.yml b/config/locales/ru.yml
|
||||
--- a/config/locales/ru.yml
|
||||
+++ b/config/locales/ru.yml
|
||||
@@ -115,7 +115,7 @@ ru:
|
||||
one: "около %{count} часа"
|
||||
few: "около %{count} часов"
|
||||
many: "около %{count} часов"
|
||||
- other: "около %{count} часа"
|
||||
+ other: "около %{count} часов"
|
||||
x_hours:
|
||||
one: "1 час"
|
||||
other: "%{count} часов"
|
@ -0,0 +1,7 @@
|
||||
--- a.txt 2013-04-05 14:19:39.000000000 +0900
|
||||
+++ b.txt 2013-04-05 14:19:51.000000000 +0900
|
||||
@@ -1,3 +1,3 @@
|
||||
aaaa
|
||||
-日本
|
||||
+日本語
|
||||
bbbb
|
@ -0,0 +1,7 @@
|
||||
--- a.txt 2013-04-05 14:19:39.000000000 +0900
|
||||
+++ b.txt 2013-04-05 14:19:51.000000000 +0900
|
||||
@@ -1,3 +1,3 @@
|
||||
aaaa
|
||||
-日本
|
||||
+にっぽん日本
|
||||
bbbb
|
@ -0,0 +1,46 @@
|
||||
--- partials.txt Wed Jan 19 12:06:17 2011
|
||||
+++ partials.1.txt Wed Jan 19 12:06:10 2011
|
||||
@@ -1,31 +1,31 @@
|
||||
-Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||
+Lorem ipsum dolor sit amet, consectetur adipiscing xx
|
||||
Praesent et sagittis dui. Vivamus ac diam diam
|
||||
-Ut sed auctor justo
|
||||
+xxx auctor justo
|
||||
Suspendisse venenatis sollicitudin magna quis suscipit
|
||||
-Sed blandit gravida odio ac ultrices
|
||||
+Sed blandit gxxxxa odio ac ultrices
|
||||
Morbi rhoncus est ut est aliquam tempus
|
||||
-Morbi id nisi vel felis tincidunt tempus
|
||||
+Morbi id nisi vel felis xx tempus
|
||||
Mauris auctor sagittis ante eu luctus
|
||||
-Fusce commodo felis sed ligula congue molestie
|
||||
+Fusce commodo felis sed ligula congue
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||
-Praesent et sagittis dui. Vivamus ac diam diam
|
||||
+et sagittis dui. Vivamus ac diam diam
|
||||
Ut sed auctor justo
|
||||
Suspendisse venenatis sollicitudin magna quis suscipit
|
||||
Sed blandit gravida odio ac ultrices
|
||||
|
||||
-Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||
-Praesent et sagittis dui. Vivamus ac diam diam
|
||||
+Lorem ipsum dolor sit amet, xxxx adipiscing elit
|
||||
Ut sed auctor justo
|
||||
Suspendisse venenatis sollicitudin magna quis suscipit
|
||||
Sed blandit gravida odio ac ultrices
|
||||
-Morbi rhoncus est ut est aliquam tempus
|
||||
+Morbi rhoncus est ut est xxxx tempus
|
||||
+New line
|
||||
Morbi id nisi vel felis tincidunt tempus
|
||||
Mauris auctor sagittis ante eu luctus
|
||||
Fusce commodo felis sed ligula congue molestie
|
||||
|
||||
-Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||
-Praesent et sagittis dui. Vivamus ac diam diam
|
||||
-Ut sed auctor justo
|
||||
+Lorem ipsum dolor sit amet, xxxxtetur adipiscing elit
|
||||
+Praesent et xxxxx. Vivamus ac diam diam
|
||||
+Ut sed auctor
|
||||
Suspendisse venenatis sollicitudin magna quis suscipit
|
||||
Sed blandit gravida odio ac ultrices
|
||||
Morbi rhoncus est ut est aliquam tempus
|
@ -0,0 +1,79 @@
|
||||
Index: app/views/settings/_general.rhtml
|
||||
===================================================================
|
||||
--- app/views/settings/_general.rhtml (revision 2094)
|
||||
+++ app/views/settings/_general.rhtml (working copy)
|
||||
@@ -48,6 +48,9 @@
|
||||
<p><label><%= l(:setting_feeds_limit) %></label>
|
||||
<%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p>
|
||||
|
||||
+<p><label><%= l(:setting_diff_max_lines_displayed) %></label>
|
||||
+<%= text_field_tag 'settings[diff_max_lines_displayed]', Setting.diff_max_lines_displayed, :size => 6 %></p>
|
||||
+
|
||||
<p><label><%= l(:setting_gravatar_enabled) %></label>
|
||||
<%= check_box_tag 'settings[gravatar_enabled]', 1, Setting.gravatar_enabled? %><%= hidden_field_tag 'settings[gravatar_enabled]', 0 %></p>
|
||||
</div>
|
||||
Index: app/views/common/_diff.rhtml
|
||||
===================================================================
|
||||
--- app/views/common/_diff.rhtml (revision 2111)
|
||||
+++ app/views/common/_diff.rhtml (working copy)
|
||||
@@ -1,4 +1,5 @@
|
||||
-<% Redmine::UnifiedDiff.new(diff, :type => diff_type).each do |table_file| -%>
|
||||
+<% diff = Redmine::UnifiedDiff.new(diff, :type => diff_type, :max_lines => Setting.diff_max_lines_displayed.to_i) -%>
|
||||
+<% diff.each do |table_file| -%>
|
||||
<div class="autoscroll">
|
||||
<% if diff_type == 'sbs' -%>
|
||||
<table class="filecontent syntaxhl">
|
||||
@@ -62,3 +63,5 @@
|
||||
|
||||
</div>
|
||||
<% end -%>
|
||||
+
|
||||
+<%= l(:text_diff_truncated) if diff.truncated? %>
|
||||
Index: lang/lt.yml
|
||||
===================================================================
|
||||
--- config/settings.yml (revision 2094)
|
||||
+++ config/settings.yml (working copy)
|
||||
@@ -61,6 +61,9 @@
|
||||
feeds_limit:
|
||||
format: int
|
||||
default: 15
|
||||
+diff_max_lines_displayed:
|
||||
+ format: int
|
||||
+ default: 1500
|
||||
enabled_scm:
|
||||
serialized: true
|
||||
default:
|
||||
Index: lib/redmine/unified_diff.rb
|
||||
===================================================================
|
||||
--- lib/redmine/unified_diff.rb (revision 2110)
|
||||
+++ lib/redmine/unified_diff.rb (working copy)
|
||||
@@ -19,8 +19,11 @@
|
||||
# Class used to parse unified diffs
|
||||
class UnifiedDiff < Array
|
||||
def initialize(diff, options={})
|
||||
+ options.assert_valid_keys(:type, :max_lines)
|
||||
diff_type = options[:type] || 'inline'
|
||||
|
||||
+ lines = 0
|
||||
+ @truncated = false
|
||||
diff_table = DiffTable.new(diff_type)
|
||||
diff.each do |line|
|
||||
if line =~ /^(---|\+\+\+) (.*)$/
|
||||
@@ -28,10 +31,17 @@
|
||||
diff_table = DiffTable.new(diff_type)
|
||||
end
|
||||
diff_table.add_line line
|
||||
+ lines += 1
|
||||
+ if options[:max_lines] && lines > options[:max_lines]
|
||||
+ @truncated = true
|
||||
+ break
|
||||
+ end
|
||||
end
|
||||
self << diff_table unless diff_table.empty?
|
||||
self
|
||||
end
|
||||
+
|
||||
+ def truncated?; @truncated; end
|
||||
end
|
||||
|
||||
# Class that represents a file diff
|
@ -0,0 +1,14 @@
|
||||
documents_001:
|
||||
created_on: 2007-01-27 15:08:27 +01:00
|
||||
project_id: 1
|
||||
title: "Test document"
|
||||
id: 1
|
||||
description: "Document description"
|
||||
category_id: 1
|
||||
documents_002:
|
||||
created_on: 2007-02-12 15:08:27 +01:00
|
||||
project_id: 1
|
||||
title: "An other document"
|
||||
id: 2
|
||||
description: ""
|
||||
category_id: 1
|
@ -0,0 +1,105 @@
|
||||
---
|
||||
enabled_modules_001:
|
||||
name: issue_tracking
|
||||
project_id: 1
|
||||
id: 1
|
||||
enabled_modules_002:
|
||||
name: time_tracking
|
||||
project_id: 1
|
||||
id: 2
|
||||
enabled_modules_003:
|
||||
name: news
|
||||
project_id: 1
|
||||
id: 3
|
||||
enabled_modules_004:
|
||||
name: documents
|
||||
project_id: 1
|
||||
id: 4
|
||||
enabled_modules_005:
|
||||
name: files
|
||||
project_id: 1
|
||||
id: 5
|
||||
enabled_modules_006:
|
||||
name: wiki
|
||||
project_id: 1
|
||||
id: 6
|
||||
enabled_modules_007:
|
||||
name: repository
|
||||
project_id: 1
|
||||
id: 7
|
||||
enabled_modules_008:
|
||||
name: boards
|
||||
project_id: 1
|
||||
id: 8
|
||||
enabled_modules_009:
|
||||
name: repository
|
||||
project_id: 3
|
||||
id: 9
|
||||
enabled_modules_010:
|
||||
name: wiki
|
||||
project_id: 3
|
||||
id: 10
|
||||
enabled_modules_011:
|
||||
name: issue_tracking
|
||||
project_id: 2
|
||||
id: 11
|
||||
enabled_modules_012:
|
||||
name: time_tracking
|
||||
project_id: 3
|
||||
id: 12
|
||||
enabled_modules_013:
|
||||
name: issue_tracking
|
||||
project_id: 3
|
||||
id: 13
|
||||
enabled_modules_014:
|
||||
name: issue_tracking
|
||||
project_id: 5
|
||||
id: 14
|
||||
enabled_modules_015:
|
||||
name: wiki
|
||||
project_id: 2
|
||||
id: 15
|
||||
enabled_modules_016:
|
||||
name: boards
|
||||
project_id: 2
|
||||
id: 16
|
||||
enabled_modules_017:
|
||||
name: calendar
|
||||
project_id: 1
|
||||
id: 17
|
||||
enabled_modules_018:
|
||||
name: gantt
|
||||
project_id: 1
|
||||
id: 18
|
||||
enabled_modules_019:
|
||||
name: calendar
|
||||
project_id: 2
|
||||
id: 19
|
||||
enabled_modules_020:
|
||||
name: gantt
|
||||
project_id: 2
|
||||
id: 20
|
||||
enabled_modules_021:
|
||||
name: calendar
|
||||
project_id: 3
|
||||
id: 21
|
||||
enabled_modules_022:
|
||||
name: gantt
|
||||
project_id: 3
|
||||
id: 22
|
||||
enabled_modules_023:
|
||||
name: calendar
|
||||
project_id: 5
|
||||
id: 23
|
||||
enabled_modules_024:
|
||||
name: gantt
|
||||
project_id: 5
|
||||
id: 24
|
||||
enabled_modules_025:
|
||||
name: news
|
||||
project_id: 2
|
||||
id: 25
|
||||
enabled_modules_026:
|
||||
name: repository
|
||||
project_id: 2
|
||||
id: 26
|
@ -0,0 +1 @@
|
||||
Texte encodé en ISO-8859-1.
|
@ -0,0 +1,103 @@
|
||||
---
|
||||
enumerations_001:
|
||||
name: Uncategorized
|
||||
id: 1
|
||||
type: DocumentCategory
|
||||
active: true
|
||||
position: 1
|
||||
enumerations_002:
|
||||
name: User documentation
|
||||
id: 2
|
||||
type: DocumentCategory
|
||||
active: true
|
||||
position: 2
|
||||
enumerations_003:
|
||||
name: Technical documentation
|
||||
id: 3
|
||||
type: DocumentCategory
|
||||
active: true
|
||||
position: 3
|
||||
enumerations_004:
|
||||
name: Low
|
||||
id: 4
|
||||
type: IssuePriority
|
||||
active: true
|
||||
position: 1
|
||||
position_name: lowest
|
||||
enumerations_005:
|
||||
name: Normal
|
||||
id: 5
|
||||
type: IssuePriority
|
||||
is_default: true
|
||||
active: true
|
||||
position: 2
|
||||
position_name: default
|
||||
enumerations_006:
|
||||
name: High
|
||||
id: 6
|
||||
type: IssuePriority
|
||||
active: true
|
||||
position: 3
|
||||
position_name: high3
|
||||
enumerations_007:
|
||||
name: Urgent
|
||||
id: 7
|
||||
type: IssuePriority
|
||||
active: true
|
||||
position: 4
|
||||
position_name: high2
|
||||
enumerations_008:
|
||||
name: Immediate
|
||||
id: 8
|
||||
type: IssuePriority
|
||||
active: true
|
||||
position: 5
|
||||
position_name: highest
|
||||
enumerations_009:
|
||||
name: Design
|
||||
id: 9
|
||||
type: TimeEntryActivity
|
||||
position: 1
|
||||
active: true
|
||||
enumerations_010:
|
||||
name: Development
|
||||
id: 10
|
||||
type: TimeEntryActivity
|
||||
position: 2
|
||||
is_default: true
|
||||
active: true
|
||||
enumerations_011:
|
||||
name: QA
|
||||
id: 11
|
||||
type: TimeEntryActivity
|
||||
position: 3
|
||||
active: true
|
||||
enumerations_012:
|
||||
name: Default Enumeration
|
||||
id: 12
|
||||
type: Enumeration
|
||||
is_default: true
|
||||
active: true
|
||||
enumerations_013:
|
||||
name: Another Enumeration
|
||||
id: 13
|
||||
type: Enumeration
|
||||
active: true
|
||||
enumerations_014:
|
||||
name: Inactive Activity
|
||||
id: 14
|
||||
type: TimeEntryActivity
|
||||
position: 4
|
||||
active: false
|
||||
enumerations_015:
|
||||
name: Inactive Priority
|
||||
id: 15
|
||||
type: IssuePriority
|
||||
position: 6
|
||||
active: false
|
||||
enumerations_016:
|
||||
name: Inactive Document Category
|
||||
id: 16
|
||||
type: DocumentCategory
|
||||
active: false
|
||||
position: 4
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue