]> source.dussan.org Git - redmine.git/commitdiff
Merged r15136 to r15138 (#21593).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 12 Mar 2016 10:36:10 +0000 (10:36 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 12 Mar 2016 10:36:10 +0000 (10:36 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15222 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/unit/helpers/application_helper_test.rb

index f152e217b201252101d62ae730d5492d0aecbedc..779b6b89fe01c6d3a52e38c193d2e20ed9a64208 100644 (file)
@@ -883,12 +883,12 @@ module ApplicationHelper
   def parse_sections(text, project, obj, attr, only_path, options)
     return unless options[:edit_section_links]
     text.gsub!(HEADING_RE) do
-      heading = $1
+      heading, level = $1, $2
       @current_section += 1
       if @current_section > 1
         content_tag('div',
           link_to(image_tag('edit.png'), options[:edit_section_links].merge(:section => @current_section)),
-          :class => 'contextual',
+          :class => "contextual heading-#{level}",
           :title => l(:button_edit_section),
           :id => "section-#{@current_section}") + heading.html_safe
       else
index 6b0d1c7d30742215c92087be48f22a7fac9e3e14..949b08b8bee4828e8bc733da0f4dc8e4d46f8165 100644 (file)
@@ -1242,14 +1242,14 @@ RAW
     result = textilizable(raw, :edit_section_links => {:controller => 'wiki', :action => 'edit', :project_id => '1', :id => 'Test'}).gsub("\n", "")
 
     # heading that contains inline code
-    assert_match Regexp.new('<div class="contextual" title="Edit this section" id="section-4">' +
+    assert_match Regexp.new('<div class="contextual heading-2" title="Edit this section" id="section-4">' +
       '<a href="/projects/1/wiki/Test/edit\?section=4"><img src="/images/edit.png(\?\d+)?" alt="Edit" /></a></div>' +
       '<a name="Subtitle-with-inline-code"></a>' +
       '<h2 >Subtitle with <code>inline code</code><a href="#Subtitle-with-inline-code" class="wiki-anchor">&para;</a></h2>'),
       result
 
     # last heading
-    assert_match Regexp.new('<div class="contextual" title="Edit this section" id="section-5">' +
+    assert_match Regexp.new('<div class="contextual heading-2" title="Edit this section" id="section-5">' +
       '<a href="/projects/1/wiki/Test/edit\?section=5"><img src="/images/edit.png(\?\d+)?" alt="Edit" /></a></div>' +
       '<a name="Subtitle-after-pre-tag"></a>' +
       '<h2 >Subtitle after pre tag<a href="#Subtitle-after-pre-tag" class="wiki-anchor">&para;</a></h2>'),