Merge branch 'f/362-introduce-help-controller'
This commit is contained in:
commit
7cd96b6a6f
|
@ -0,0 +1,7 @@
|
|||
class HelpController < ApplicationController
|
||||
def wiki_syntax
|
||||
end
|
||||
|
||||
def wiki_syntax_detailed
|
||||
end
|
||||
end
|
|
@ -1,10 +1,4 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||
<title>Wiki formatting</title>
|
||||
<style type="text/css">
|
||||
<% content_for :styles do %>
|
||||
h1 { font-family: Verdana, sans-serif; font-size: 14px; text-align: center; color: #444; }
|
||||
body { font-family: Verdana, sans-serif; font-size: 12px; color: #444; }
|
||||
table th { padding-top: 1em; }
|
||||
|
@ -13,12 +7,9 @@ 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; }
|
||||
<% end %>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>Wiki Syntax Quick Reference</h1>
|
||||
<h1><%= html_title "Wiki Syntax Quick Reference" %></h1>
|
||||
|
||||
<table width="100%">
|
||||
<tr><th colspan="3">Font Styles</th></tr>
|
||||
|
@ -48,7 +39,7 @@ table td h3 { font-size: 1.2em; text-align: left; }
|
|||
<tr><th></th><td>http://foo.bar</td><td><a href="#">http://foo.bar</a></td></tr>
|
||||
<tr><th></th><td>"Foo":http://foo.bar</td><td><a href="#">Foo</a></td></tr>
|
||||
|
||||
<tr><th colspan="3">Redmine links</th></tr>
|
||||
<tr><th colspan="3">ChiliProject links</th></tr>
|
||||
<tr><th><img src="../images/jstoolbar/bt_link.png" style="border: 1px solid #bbb;" alt="Link to a Wiki page" /></th><td>[[Wiki page]]</td><td><a href="#">Wiki page</a></td></tr>
|
||||
<tr><th></th><td>Issue #12</td><td>Issue <a href="#">#12</a></td></tr>
|
||||
<tr><th></th><td>Revision r43</td><td>Revision <a href="#">r43</a></td></tr>
|
||||
|
@ -60,7 +51,4 @@ table td h3 { font-size: 1.2em; text-align: left; }
|
|||
<tr><th></th><td>!<em>attached_image</em>!</td><td></td></tr>
|
||||
</table>
|
||||
|
||||
<p><a href="wiki_syntax_detailed.html" onclick="window.open('wiki_syntax_detailed.html', '', ''); return false;">More Information</a></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<p><a href="wiki_syntax_detailed" onclick="window.open('wiki_syntax_detailed', '', ''); return false;">More Information</a></p>
|
|
@ -1,9 +1,4 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title>RedmineWikiFormatting</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<style type="text/css">
|
||||
<% content_for :styles do %>
|
||||
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
|
||||
h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
|
||||
pre, code { font-size:120%; }
|
||||
|
@ -32,22 +27,20 @@
|
|||
|
||||
.CodeRay .s { background-color:#fff0f0 }
|
||||
.CodeRay .s .dl { color:#710 }
|
||||
</style>
|
||||
</head>
|
||||
<% end %>
|
||||
|
||||
<body>
|
||||
<h1><a name="1" class="wiki-page"></a>Wiki formatting</h1>
|
||||
<h1><a name="1" class="wiki-page"></a><%= html_title "Wiki Formatting" %></h1>
|
||||
|
||||
<h2><a name="2" class="wiki-page"></a>Links</h2>
|
||||
|
||||
<h3><a name="3" class="wiki-page"></a>Redmine links</h3>
|
||||
<h3><a name="3" class="wiki-page"></a>ChiliProject links</h3>
|
||||
|
||||
<p>Redmine allows hyperlinking between issues, changesets and wiki pages from anywhere wiki formatting is used.</p>
|
||||
<p>ChiliProject allows hyperlinking between issues, changesets and wiki pages from anywhere wiki formatting is used.</p>
|
||||
<ul>
|
||||
<li>Link to an issue: <strong>#124</strong> (displays <del><a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (Closed)">#124</a></del>, link is striked-through if the issue is closed)</li>
|
||||
<li>Link to a changeset: <strong>r758</strong> (displays <a href="#" class="changeset" title="Search engine now only searches objects the user is allowed to view.">r758</a>)</li>
|
||||
<li>Link to a changeset with a non-numeric hash: <strong>commit:c6f4d0fd</strong> (displays <a href="#" class="changeset">c6f4d0fd</a>).</li>
|
||||
<li>Link to a changeset of another project: <strong>sandbox:r758</strong> (displays <a href="#" class="changeset" title="Search engine now only searches objects the user is allowed to view.">sanbox:r758</a>)</li>
|
||||
<li>Link to a changeset of another project: <strong>sandbox:r758</strong> (displays <a href="#" class="changeset" title="Search engine now only searches objects the user is allowed to view.">sandbox:r758</a>)</li>
|
||||
<li>Link to a changeset with a non-numeric hash: <strong>sandbox:c6f4d0fd</strong> (displays <a href="#" class="changeset">sandbox:c6f4d0fd</a>).</li>
|
||||
</ul>
|
||||
|
||||
|
@ -131,7 +124,7 @@
|
|||
<p>Escaping:</p>
|
||||
|
||||
<ul>
|
||||
<li>You can prevent Redmine links from being parsed by preceding them with an exclamation mark: !</li>
|
||||
<li>You can prevent ChiliProject links from being parsed by preceding them with an exclamation mark: !</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
@ -140,24 +133,24 @@
|
|||
<p>HTTP URLs and email addresses are automatically turned into clickable links:</p>
|
||||
|
||||
<pre>
|
||||
http://www.redmine.org, someone@foo.bar
|
||||
https://www.chiliproject.org, someone@foo.bar
|
||||
</pre>
|
||||
|
||||
<p>displays: <a class="external" href="http://www.redmine.org">http://www.redmine.org</a>, <a href="mailto:someone@foo.bar" class="email">someone@foo.bar</a></p>
|
||||
<p>displays: <a class="external" href="https://www.chiliproject.org">https://www.chiliproject.org</a>, <a href="mailto:someone@foo.bar" class="email">someone@foo.bar</a></p>
|
||||
|
||||
<p>If you want to display a specific text instead of the URL, you can use the standard textile syntax:</p>
|
||||
|
||||
<pre>
|
||||
"Redmine web site":http://www.redmine.org
|
||||
"ChiliProject web site":https://www.chiliproject.org
|
||||
</pre>
|
||||
|
||||
<p>displays: <a href="http://www.redmine.org" class="external">Redmine web site</a></p>
|
||||
<p>displays: <a href="https://www.chiliproject.org" class="external">ChiliProject web site</a></p>
|
||||
|
||||
|
||||
<h2><a name="5" class="wiki-page"></a>Text formatting</h2>
|
||||
|
||||
|
||||
<p>For things such as headlines, bold, tables, lists, Redmine supports Textile syntax. See <a class="external" href="http://www.textism.com/tools/textile/">http://www.textism.com/tools/textile/</a> for information on using any of these features. A few samples are included below, but the engine is capable of much more of that.</p>
|
||||
<p>For things such as headlines, bold, tables, lists, ChiliProject supports Textile syntax. See <a class="external" href="http://www.textism.com/tools/textile/">http://www.textism.com/tools/textile/</a> for information on using any of these features. A few samples are included below, but the engine is capable of much more of that.</p>
|
||||
|
||||
<h3><a name="6" class="wiki-page"></a>Font style</h3>
|
||||
|
||||
|
@ -195,7 +188,7 @@ h2. Subheading
|
|||
h3. Subsubheading
|
||||
</pre>
|
||||
|
||||
<p>Redmine assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.</p>
|
||||
<p>ChiliProject assigns an anchor to each of those headings thus you can link to them with "#Heading", "#Subheading" and so forth.</p>
|
||||
|
||||
|
||||
<h3><a name="9" class="wiki-page"></a>Paragraphs</h3>
|
||||
|
@ -205,7 +198,7 @@ p>. right aligned
|
|||
p=. centered
|
||||
</pre>
|
||||
|
||||
<p style="text-align:center;">This is centered paragraph.</p>
|
||||
<p style="text-align:center;">This is a centered paragraph.</p>
|
||||
|
||||
|
||||
<h3><a name="10" class="wiki-page"></a>Blockquotes</h3>
|
||||
|
@ -233,7 +226,7 @@ To go live, all you need to add is a database and a web server.
|
|||
|
||||
<h2><a name="12" class="wiki-page"></a>Macros</h2>
|
||||
|
||||
<p>Redmine has the following builtin macros:</p>
|
||||
<p>ChiliProject has the following builtin macros:</p>
|
||||
|
||||
<p><dl><dt><code>hello_world</code></dt><dd><p>Sample macro.</p></dd><dt><code>include</code></dt><dd><p>Include a wiki page. Example:</p>
|
||||
|
||||
|
@ -266,5 +259,3 @@ To go live, all you need to add is a database and a web server.
|
|||
<span class="no"><strong>10</strong></span> <span class="r">end</span>
|
||||
</code>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
<title><%= h html_title %></title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<style type="text/css">
|
||||
<%= yield(:styles) %>
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
|
@ -20,8 +20,7 @@ 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,
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
require 'test_helper'
|
||||
|
||||
class HelpControllerTest < ActionController::TestCase
|
||||
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
|
Loading…
Reference in New Issue