summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/repositories/entry.html.erb4
-rw-r--r--public/stylesheets/application.css4
-rw-r--r--test/fixtures/repositories/subversion_repository.dump.gzbin114931 -> 115356 bytes
-rw-r--r--test/functional/repositories_subversion_controller_test.rb31
-rw-r--r--test/unit/repository_subversion_test.rb6
5 files changed, 38 insertions, 7 deletions
diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb
index 2cc1a0859..4f8678bea 100644
--- a/app/views/repositories/entry.html.erb
+++ b/app/views/repositories/entry.html.erb
@@ -10,6 +10,10 @@
<% if Redmine::MimeType.is_type?('image', @path) %>
<%= render :partial => 'common/image', :locals => {:path => @raw_url, :alt => @path} %>
+<% elsif Redmine::MimeType.of(@path) == 'text/x-textile' %>
+ <%= render :partial => 'common/markup', :locals => {:markup_text_formatting => 'textile', :markup_text => @content} %>
+<% elsif Redmine::MimeType.of(@path) == 'text/markdown' %>
+ <%= render :partial => 'common/markup', :locals => {:markup_text_formatting => 'markdown', :markup_text => @content} %>
<% elsif @content %>
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
<% else %>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index fca5f5647..91acad5ef 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -789,7 +789,7 @@ span.pagination {margin-left:3px; color:#888; display:block;}
font-weight: bold;
}
span.pagination>span {white-space:nowrap;}
-.controller-attachments.action-show span.pagination{
+.controller-attachments.action-show span.pagination, .controller-repositories.action-entry span.pagination {
display: block;
margin-top: 1.2em;
}
@@ -1804,7 +1804,7 @@ img {
max-width: 100%;
}
-.filecontent-container > .filecontent.wiki {
+.filecontent.wiki {
position: relative;
padding: 1em;
border: 1px solid #e4e4e4;
diff --git a/test/fixtures/repositories/subversion_repository.dump.gz b/test/fixtures/repositories/subversion_repository.dump.gz
index f08858eed..0151f83e1 100644
--- a/test/fixtures/repositories/subversion_repository.dump.gz
+++ b/test/fixtures/repositories/subversion_repository.dump.gz
Binary files differ
diff --git a/test/functional/repositories_subversion_controller_test.rb b/test/functional/repositories_subversion_controller_test.rb
index 6988d2a5d..f6db7c002 100644
--- a/test/functional/repositories_subversion_controller_test.rb
+++ b/test/functional/repositories_subversion_controller_test.rb
@@ -27,7 +27,7 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest
:issue_categories, :enumerations, :custom_fields, :custom_values, :trackers
PRJ_ID = 3
- NUM_REV = 12
+ NUM_REV = 13
def setup
super
@@ -204,7 +204,8 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest
)
assert_response :success
assert_select 'table.changesets tbody' do
- assert_select 'tr', 7
+ assert_select 'tr', 8
+ assert_select 'tr td.id a', :text => '13'
assert_select 'tr td.id a', :text => '12'
assert_select 'tr td.id a', :text => '10'
assert_select 'tr td.id a', :text => '9'
@@ -280,6 +281,32 @@ class RepositoriesSubversionControllerTest < Redmine::RepositoryControllerTest
assert_select 'audio[src=?]', "/projects/subproject1/repository/#{@repository.id}/raw/subversion_test/folder/subfolder/chords.mp3"
end
+ def text_entry_should_preview_markdown
+ get(
+ :entry,
+ :params => {
+ :id => PRJ_ID,
+ :repository_id => @repository.id,
+ :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'testfile.md'])[:param]
+ }
+ )
+ assert_response :success
+ assert_select 'div.wiki', :html => "<h1>Header 1</h1>\n\n<h2>Header 2</h2>\n\n<h3>Header 3</h3>"
+ end
+
+ def text_entry_should_preview_textile
+ get(
+ :entry,
+ :params => {
+ :id => PRJ_ID,
+ :repository_id => @repository.id,
+ :path => repository_path_hash(['subversion_test', 'folder', 'subfolder', 'testfile.textile'])[:param]
+ }
+ )
+ assert_response :success
+ assert_select 'div.wiki', :html => "<h1>Header 1</h1>\n\n\n\t<h2>Header 2</h2>\n\n\n\t<h3>Header 3</h3>"
+ end
+
def test_entry_at_given_revision
assert_equal 0, @repository.changesets.count
@repository.fetch_changesets
diff --git a/test/unit/repository_subversion_test.rb b/test/unit/repository_subversion_test.rb
index 37364aa9c..1b4586dec 100644
--- a/test/unit/repository_subversion_test.rb
+++ b/test/unit/repository_subversion_test.rb
@@ -24,7 +24,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase
include Redmine::I18n
- NUM_REV = 12
+ NUM_REV = 13
def setup
User.current = nil
@@ -100,7 +100,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase
@project.reload
assert_equal NUM_REV, @repository.changesets.count
- assert_equal 21, @repository.filechanges.count
+ assert_equal 23, @repository.filechanges.count
assert_equal 'Initial import.', @repository.changesets.find_by_revision('1').comments
end
@@ -144,7 +144,7 @@ class RepositorySubversionTest < ActiveSupport::TestCase
# with path
changesets = @repository.latest_changesets('subversion_test/folder', nil)
- assert_equal ["12", "10", "9", "7", "6", "5", "2"], changesets.collect(&:revision)
+ assert_equal ["13", "12", "10", "9", "7", "6", "5", "2"], changesets.collect(&:revision)
# with path and revision
changesets = @repository.latest_changesets('subversion_test/folder', 8)