From 8686a16e0de058fef39ac1523c0d1e9de558b9a8 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 2 May 2011 12:18:31 +0200 Subject: [PATCH 1/8] Changing the way, links to the wiki_syntax help page are generated This fixes a comment, that was sitting there for more than 2 years. --- lib/redmine/wiki_formatting/textile/helper.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/redmine/wiki_formatting/textile/helper.rb b/lib/redmine/wiki_formatting/textile/helper.rb index 71996138..18efc1aa 100644 --- a/lib/redmine/wiki_formatting/textile/helper.rb +++ b/lib/redmine/wiki_formatting/textile/helper.rb @@ -20,9 +20,8 @@ module Redmine module Textile module Helper def wikitoolbar_for(field_id) - # Is there a simple way to link to a public resource? - url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html" - + url = url_for(:controller => 'help', :action => 'wiki_syntax') + help_link = l(:setting_text_formatting) + ': ' + link_to(l(:label_help), url, :onclick => "window.open(\"#{ url }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;", From 8fb5e8b211548499c634e65ba8f4c5cf54b13c77 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 2 May 2011 12:43:33 +0200 Subject: [PATCH 2/8] Introducing help controller, moving wiki syntax documentation to help controller --- app/controllers/help_controller.rb | 9 +++++++++ .../views/help/wiki_syntax.html.erb | 3 +-- .../views/help/wiki_syntax_detailed.html.erb | 0 test/functional/help_controller_test.rb | 8 ++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 app/controllers/help_controller.rb rename public/help/wiki_syntax.html => app/views/help/wiki_syntax.html.erb (96%) rename public/help/wiki_syntax_detailed.html => app/views/help/wiki_syntax_detailed.html.erb (100%) create mode 100644 test/functional/help_controller_test.rb diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb new file mode 100644 index 00000000..025057f5 --- /dev/null +++ b/app/controllers/help_controller.rb @@ -0,0 +1,9 @@ +class HelpController < ApplicationController + def wiki_syntax + render :layout => false + end + + def wiki_syntax_detailed + render :layout => false + end +end diff --git a/public/help/wiki_syntax.html b/app/views/help/wiki_syntax.html.erb similarity index 96% rename from public/help/wiki_syntax.html rename to app/views/help/wiki_syntax.html.erb index 6886f340..aeb7c4f0 100644 --- a/public/help/wiki_syntax.html +++ b/app/views/help/wiki_syntax.html.erb @@ -13,7 +13,6 @@ table td code { font-size: 1.2em; } table td h1 { font-size: 1.8em; text-align: left; } table td h2 { font-size: 1.4em; text-align: left; } table td h3 { font-size: 1.2em; text-align: left; } - @@ -60,7 +59,7 @@ table td h3 { font-size: 1.2em; text-align: left; } !attached_image! -

More Information

+

More Information

diff --git a/public/help/wiki_syntax_detailed.html b/app/views/help/wiki_syntax_detailed.html.erb similarity index 100% rename from public/help/wiki_syntax_detailed.html rename to app/views/help/wiki_syntax_detailed.html.erb diff --git a/test/functional/help_controller_test.rb b/test/functional/help_controller_test.rb new file mode 100644 index 00000000..6da7b843 --- /dev/null +++ b/test/functional/help_controller_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class HelpControllerTest < ActionController::TestCase + # Replace this with your real tests. + test "the truth" do + assert true + end +end From aeafbf3fa8c36d88d142356f1ddc04a9498de6a1 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 2 May 2011 13:12:35 +0200 Subject: [PATCH 3/8] Cleaning up title and html header in help views --- app/views/help/wiki_syntax.html.erb | 19 +++++++++---------- app/views/help/wiki_syntax_detailed.html.erb | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/views/help/wiki_syntax.html.erb b/app/views/help/wiki_syntax.html.erb index aeb7c4f0..68245f0c 100644 --- a/app/views/help/wiki_syntax.html.erb +++ b/app/views/help/wiki_syntax.html.erb @@ -2,17 +2,16 @@ - -Wiki formatting +Wiki Syntax Quick Reference diff --git a/app/views/help/wiki_syntax_detailed.html.erb b/app/views/help/wiki_syntax_detailed.html.erb index 0c9cea34..b1a22836 100644 --- a/app/views/help/wiki_syntax_detailed.html.erb +++ b/app/views/help/wiki_syntax_detailed.html.erb @@ -1,7 +1,7 @@ - + -RedmineWikiFormatting +Wiki Formatting - - +<% end %> -

Wiki Syntax Quick Reference

+

<%= html_title "Wiki Syntax Quick Reference" %>

@@ -59,6 +52,3 @@
Font Styles

More Information

- - - diff --git a/app/views/help/wiki_syntax_detailed.html.erb b/app/views/help/wiki_syntax_detailed.html.erb index b1a22836..679ffe50 100644 --- a/app/views/help/wiki_syntax_detailed.html.erb +++ b/app/views/help/wiki_syntax_detailed.html.erb @@ -1,9 +1,4 @@ - - - -Wiki Formatting - - - +<% end %> - -

Wiki formatting

+

<%= html_title "Wiki Formatting" %>

Links

@@ -266,5 +259,3 @@ To go live, all you need to add is a database and a web server. 10 end - - diff --git a/app/views/layouts/help.html.erb b/app/views/layouts/help.html.erb new file mode 100644 index 00000000..1a64c478 --- /dev/null +++ b/app/views/layouts/help.html.erb @@ -0,0 +1,13 @@ + + + + <%= h html_title %> + + + + + <%= yield %> + + From c0d7d45870cf231d537a6c1731c543a5252aab19 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 2 May 2011 14:43:31 +0200 Subject: [PATCH 5/8] Fixing typo in detailed wiki syntax help --- app/views/help/wiki_syntax_detailed.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/help/wiki_syntax_detailed.html.erb b/app/views/help/wiki_syntax_detailed.html.erb index 679ffe50..444ac95d 100644 --- a/app/views/help/wiki_syntax_detailed.html.erb +++ b/app/views/help/wiki_syntax_detailed.html.erb @@ -40,7 +40,7 @@
  • Link to an issue: #124 (displays #124, link is striked-through if the issue is closed)
  • Link to a changeset: r758 (displays r758)
  • Link to a changeset with a non-numeric hash: commit:c6f4d0fd (displays c6f4d0fd).
  • -
  • Link to a changeset of another project: sandbox:r758 (displays sanbox:r758)
  • +
  • Link to a changeset of another project: sandbox:r758 (displays sandbox:r758)
  • Link to a changeset with a non-numeric hash: sandbox:c6f4d0fd (displays sandbox:c6f4d0fd).
  • From 5cbcd702a4d1fb18140eb794bc821ba343d1da49 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 2 May 2011 14:49:10 +0200 Subject: [PATCH 6/8] Replacing Redmine w/ ChiliProject in wiki help texts --- app/views/help/wiki_syntax.html.erb | 2 +- app/views/help/wiki_syntax_detailed.html.erb | 22 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/views/help/wiki_syntax.html.erb b/app/views/help/wiki_syntax.html.erb index b8e2f705..6b3b95d8 100644 --- a/app/views/help/wiki_syntax.html.erb +++ b/app/views/help/wiki_syntax.html.erb @@ -39,7 +39,7 @@ http://foo.barhttp://foo.bar "Foo":http://foo.barFoo -Redmine links +ChiliProject links Link to a Wiki page[[Wiki page]]Wiki page Issue #12Issue #12 Revision r43Revision r43 diff --git a/app/views/help/wiki_syntax_detailed.html.erb b/app/views/help/wiki_syntax_detailed.html.erb index 444ac95d..f023d4d4 100644 --- a/app/views/help/wiki_syntax_detailed.html.erb +++ b/app/views/help/wiki_syntax_detailed.html.erb @@ -33,9 +33,9 @@

    Links

    -

    Redmine links

    +

    ChiliProject links

    -

    Redmine allows hyperlinking between issues, changesets and wiki pages from anywhere wiki formatting is used.

    +

    ChiliProject allows hyperlinking between issues, changesets and wiki pages from anywhere wiki formatting is used.

    • Link to an issue: #124 (displays #124, link is striked-through if the issue is closed)
    • Link to a changeset: r758 (displays r758)
    • @@ -123,8 +123,8 @@

      Escaping:

      -
        -
      • You can prevent Redmine links from being parsed by preceding them with an exclamation mark: !
      • +
          +
        • You can prevent ChiliProject links from being parsed by preceding them with an exclamation mark: !
        @@ -133,24 +133,24 @@

        HTTP URLs and email addresses are automatically turned into clickable links:

        -http://www.redmine.org, someone@foo.bar
        +https://www.chiliproject.org, someone@foo.bar
         
        -

        displays: http://www.redmine.org,

        +

        displays: https://www.chiliproject.org,

        If you want to display a specific text instead of the URL, you can use the standard textile syntax:

        -"Redmine web site":http://www.redmine.org
        +"ChiliProject web site":https://www.chiliproject.org
         
        -

        displays: Redmine web site

        +

        displays: ChiliProject web site

        Text formatting

        -

        For things such as headlines, bold, tables, lists, Redmine supports Textile syntax. See http://www.textism.com/tools/textile/ for information on using any of these features. A few samples are included below, but the engine is capable of much more of that.

        +

        For things such as headlines, bold, tables, lists, ChiliProject supports Textile syntax. See http://www.textism.com/tools/textile/ for information on using any of these features. A few samples are included below, but the engine is capable of much more of that.

        Font style

        @@ -188,7 +188,7 @@ h2. Subheading h3. Subsubheading -

        Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.

        +

        ChiliProject assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.

        Paragraphs

        @@ -226,7 +226,7 @@ To go live, all you need to add is a database and a web server.

        Macros

        -

        Redmine has the following builtin macros:

        +

        ChiliProject has the following builtin macros:

        hello_world

        Sample macro.

        include

        Include a wiki page. Example:

        From 913c60f71c709317223fd246ff64f20cb3a3e8a1 Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 2 May 2011 15:06:41 +0200 Subject: [PATCH 7/8] Fixing typo --- app/views/help/wiki_syntax_detailed.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/help/wiki_syntax_detailed.html.erb b/app/views/help/wiki_syntax_detailed.html.erb index f023d4d4..28a6bc77 100644 --- a/app/views/help/wiki_syntax_detailed.html.erb +++ b/app/views/help/wiki_syntax_detailed.html.erb @@ -198,7 +198,7 @@ p>. right aligned p=. centered -

        This is centered paragraph.

        +

        This is a centered paragraph.

        Blockquotes

        From 0b7b564a34c84c3046b27fcf215cf63771dd8ece Mon Sep 17 00:00:00 2001 From: Gregor Schmidt Date: Mon, 2 May 2011 15:24:11 +0200 Subject: [PATCH 8/8] adding basic test, to make sure, nothing breaks --- test/functional/help_controller_test.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/functional/help_controller_test.rb b/test/functional/help_controller_test.rb index 6da7b843..f37c7ab6 100644 --- a/test/functional/help_controller_test.rb +++ b/test/functional/help_controller_test.rb @@ -1,8 +1,15 @@ require 'test_helper' class HelpControllerTest < ActionController::TestCase - # Replace this with your real tests. - test "the truth" do - assert true + test "renders wiki_syntax properly" do + get "wiki_syntax" + + assert_select "h1", "Wiki Syntax Quick Reference" + end + + test "renders wiki_syntax_detailed properly" do + get "wiki_syntax_detailed" + + assert_select "h1", "Wiki Formatting" end end