Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Add some info and link to wiki in formatting help
Browse files Browse the repository at this point in the history
  • Loading branch information
Deimos committed Mar 29, 2013
1 parent 40caa66 commit 5e186ee
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 73 deletions.
1 change: 1 addition & 0 deletions r2/r2/lib/strings.py
Expand Up @@ -130,6 +130,7 @@
invalid_search_query = _("I couldn't understand your query, so I simplified it and searched for \"%(clean_query)s\" instead."),
completely_invalid_search_query = _("I couldn't understand your search query. Please try again."),
search_help = _("You may also want to check the [search help page](%(search_help)s) for more information."),
formatting_help_info = _('reddit uses a slightly-customized version of [Markdown](http://daringfireball.net/projects/markdown/syntax) for formatting. See below for some basics, or check [the commenting wiki page](/wiki/commenting) for more detailed help and solutions to common issues.'),
generic_quota_msg = _("You've submitted too many links recently. Please try again in an hour."),
verified_quota_msg = _("Looks like you're either a brand new user or your posts have not been doing well recently. You may have to wait a bit to post again. In the meantime feel free to [check out the reddiquette](%(reddiquette)s) or join the conversation in a different thread."),
unverified_quota_msg = _("Looks like you're either a brand new user or your posts have not been doing well recently. You may have to wait a bit to post again. In the meantime feel free to [check out the reddiquette](%(reddiquette)s), join the conversation in a different thread, or [verify your email address](%(verify)s)."),
Expand Down
24 changes: 13 additions & 11 deletions r2/r2/public/static/css/reddit.less
Expand Up @@ -3741,18 +3741,20 @@ ul.tabmenu.formtab {
width: 100%;
}

.usertext table.markhelp {
background-color: white;
margin: 5px 0px;
width: 100%;
}

.usertext .markhelp,
.usertext .markhelp td,
.usertext .markhelp tr {
border: 1px solid #C0C0C0;
.usertext .markhelp {
padding: 4px;
margin: 0px;
margin: 5px 0px;
border-top: 1px dotted #c0c0c0;

table {
width: 100%;
margin: 5px 0px;
}

tr, td {
width: 50%;
border: 1px solid #c0c0c0;
}
}

.usertext .markhelp .spaces {background-color: #c0c0c0}
Expand Down
4 changes: 3 additions & 1 deletion r2/r2/templates/usertext.compact
Expand Up @@ -22,11 +22,12 @@

<%!
from r2.lib.filters import unsafe, safemarkdown, keep_space
from r2.lib.strings import strings
from r2.lib.utils import randstr
%>

<%namespace file="printablebuttons.html" import="toggle_button" />
<%namespace file="utils.html" import="error_field"/>
<%namespace file="utils.html" import="error_field, md"/>

<%def name="action_button(name, btn_type, onclick, display)">
<button type="${btn_type}" onclick="${onclick}" class="${name}"
Expand Down Expand Up @@ -89,6 +90,7 @@
${error_field("USER_BLOCKED", "parent", "span")}
</div>
<div class="markhelp-parent">
<p>${md(strings.formatting_help_info)}</p>
<table class="markhelp">
<tr style="background-color: #ffff99; text-align: center">
<td><em>${_( "you type:")}</em></td>
Expand Down
126 changes: 65 additions & 61 deletions r2/r2/templates/usertext.html
Expand Up @@ -22,11 +22,12 @@

<%!
from r2.lib.filters import unsafe, safemarkdown, keep_space
from r2.lib.strings import strings
from r2.lib.utils import randstr
%>

<%namespace file="printablebuttons.html" import="toggle_button" />
<%namespace file="utils.html" import="error_field"/>
<%namespace file="utils.html" import="error_field, md"/>

<%def name="action_button(name, btn_type, onclick, display)">
<button type="${btn_type}" onclick="${onclick}" class="${name}"
Expand Down Expand Up @@ -91,69 +92,72 @@
</div>
</div>

<table class="markhelp md" style="display: none">
<tr style="background-color: #ffff99; text-align: center">
<td><em>${_( "you type:")}</em></td>
<td><em>${_( "you see:")}</em></td>
</tr>
<tr>
<td>*${_( "italics")}*</td>
<td><em>${_( "italics")}</em></td>
</tr>
<tr>
<td>**${_( "bold")}**</td>
<td><b>${_( "bold")}</b></td>
</tr>
<tr>
<td>[reddit!](http://reddit.com)</td>
<td><a href="http://reddit.com">reddit!</a></td>
</tr>
<tr>
<td>
* ${_( "item")} 1<br/>
* ${_( "item")} 2<br/>
* ${_( "item")} 3
</td>
<td>
<ul>
<li>${_( "item")} 1</li>
<li>${_( "item")} 2</li>
<li>${_( "item")} 3</li>
</ul>
</td>
</tr>
<tr>
<td>&gt; ${_( "quoted text")}</td>
<td><blockquote>${_( "quoted text" )}</blockquote></td>
</tr>
<tr>
<div class="markhelp" style="display:none">
<p>${md(strings.formatting_help_info)}</p>
<table class="md">
<tr style="background-color: #ffff99; text-align: center">
<td><em>${_( "you type:")}</em></td>
<td><em>${_( "you see:")}</em></td>
</tr>
<tr>
<td>*${_( "italics")}*</td>
<td><em>${_( "italics")}</em></td>
</tr>
<tr>
<td>**${_( "bold")}**</td>
<td><b>${_( "bold")}</b></td>
</tr>
<tr>
<td>[reddit!](http://reddit.com)</td>
<td><a href="http://reddit.com">reddit!</a></td>
</tr>
<tr>
<td>
Lines starting with four spaces <br/>
are treated like code:<br/><br/>
<span class="spaces">
&nbsp;&nbsp;&nbsp;&nbsp;
</span>
if 1 * 2 &lt; 3:<br/>
<span class="spaces">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>
print "hello, world!"<br/>
* ${_( "item")} 1<br/>
* ${_( "item")} 2<br/>
* ${_( "item")} 3
</td>
<td>Lines starting with four spaces <br/>
are treated like code:<br/>
<pre>if 1 * 2 &lt; 3:<br/>&nbsp;&nbsp;&nbsp;&nbsp;print "hello,
world!"</pre>
<td>
<ul>
<li>${_( "item")} 1</li>
<li>${_( "item")} 2</li>
<li>${_( "item")} 3</li>
</ul>
</td>
</tr>
<tr>
<td>~~strikethrough~~</td>
<td><strike>strikethrough</strike></td>
</tr>
<tr>
<td>super^script</td>
<td>super<sup>script</sup></td>
</tr>
</table>
</tr>
<tr>
<td>&gt; ${_( "quoted text")}</td>
<td><blockquote>${_( "quoted text" )}</blockquote></td>
</tr>
<tr>
<td>
Lines starting with four spaces <br/>
are treated like code:<br/><br/>
<span class="spaces">
&nbsp;&nbsp;&nbsp;&nbsp;
</span>
if 1 * 2 &lt; 3:<br/>
<span class="spaces">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>
print "hello, world!"<br/>
</td>
<td>Lines starting with four spaces <br/>
are treated like code:<br/>
<pre>if 1 * 2 &lt; 3:<br/>&nbsp;&nbsp;&nbsp;&nbsp;print "hello,
world!"</pre>
</td>
</tr>
<tr>
<td>~~strikethrough~~</td>
<td><strike>strikethrough</strike></td>
</tr>
<tr>
<td>super^script</td>
<td>super<sup>script</sup></td>
</tr>
</table>
</div>
</div>
%endif

Expand Down

0 comments on commit 5e186ee

Please sign in to comment.