## The contents of this file are subject to the Common Public Attribution
## License Version 1.0. (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License at
## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
## License Version 1.1, but Sections 14 and 15 have been added to cover use of
## software over a computer network and provide for limited attribution for the
## Original Developer. In addition, Exhibit A has been modified to be consistent
## with Exhibit B.
##
## Software distributed under the License is distributed on an "AS IS" basis,
## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
## the specific language governing rights and limitations under the License.
##
## The Original Code is Reddit.
##
## The Original Developer is the Initial Developer.  The Initial Developer of
## the Original Code is CondeNet, Inc.
##
## All portions of the code written by CondeNet are Copyright (c) 2006-2010
## CondeNet, Inc. All Rights Reserved.
################################################################################
<%!
from r2.lib.template_helpers import static
%>

<%def name="expando_start(phrase)">
  <div class="examples">
    <p class="expander" onClick="return toggle_expando(this);"><em class="toggle">[+]</em>&nbsp;${phrase}</p>
    <div class="rule-examples" style="display:none;">
      <ul>
</%def>

<%def name="expando_end()">
      </ul>
    </div>
  </div>
</%def>

<%def name="good_example(phrase, leadin='OK:')">
<li class="example good-example"><em>${leadin}</em>&nbsp;${unsafe(phrase)}</li>
</%def>

<%def name="bad_example(phrase, leadin='NOT OK:')">
<li class="example bad-example"><em>${leadin}</em>&nbsp;${unsafe(phrase)}</li>
</%def>

<script type="text/javascript">
function toggle_expando(elem){
  var examples = $(elem).siblings(".rule-examples");
  var toggle = $(elem).find(".toggle");
  if (examples.is(":visible")){
    toggle.text("[+]");
    examples.slideUp();
  } else {
    toggle.text("[\u2013]");
    examples.slideDown();
  }
}
</script>

<div class="rulespage">
  <h1>rules of reddit</h1>
  <div>
    <p class="info">reddit is a pretty open platform and free speech place, but there are a few rules:</p>
    <ol class="rule-list">
      <li id="spam" class="first-rule">
        <p>Don't&#32;<a href="http://www.reddit.com/help/faq#Whatconstitutesspam">spam</a>.</p>
        ${expando_start("What is spam?")}
          ${bad_example('Submitting only links to your blog or personal website.')}
          ${good_example('Submitting links from a variety of sites and sources.')}
          ${good_example('Submitting links from your own site, talking with redditors in the comments, and also submitting cool stuff from other sites.')}
          ${bad_example('Posting the same comment repeatedly in multiple subreddits.')}
        ${expando_end()}
      </li>
      <li id="votecheating">
        <p>Don't engage in vote&#32;<a href="http://www.reddit.com/help/faq#Whatconstitutescheating">cheating or manipulation</a>.</p>
        ${expando_start("What does vote cheating look like?")}
          ${bad_example('Buying upvotes from other people.')}
          ${good_example('Sharing reddit links with your friends.')}
          ${bad_example('Sharing only <b>&nbsp;your&nbsp;</b> reddit links with your friends &mdash; then asking them to register and upvote them.')}
          ${bad_example('Creating submissions that start with "For every upvote I will ______," regardless of cause.')}
        ${expando_end()}
      </li>
      <li id="personalinfo">
        <p>Don't post&#32;<a href="http://www.reddit.com/help/faq#Ispostingpersonalinformationok">personal information</a>.</p>
        ${expando_start("What might be personal information?")}
          ${bad_example("Posting a link to your friend's facebook profile.")}
          ${good_example("Posting your senator's publicly available contact information")}
          ${bad_example("Posting the full name, employer, or other real-life details of another redditor")}
          ${good_example("Posting a link to a public page maintained by a celebrity.")}
        ${expando_end()}
      </li>
      <li id="minors">
        <p>No&#32;<a href="http://www.missingkids.com/missingkids/servlet/PageServlet?PageId=1504" rel="nofollow">child pornography</a>&#32;or&#32;<a href="http://www.reddit.com/r/blog/comments/pmj7f/a_necessary_change_in_policy/" rel="nofollow">sexually suggestive content featuring minors</a>.</p>
      </li>
      <li id="breakthesite">
        <p>Don't break the site or do anything that interferes with normal use of the site.</p>
        ${expando_start("Tell me more.")}
          ${bad_example('Creating programs that request information more than once every 2 seconds or violate any of our other <a href="https://github.com/reddit/reddit/wiki/API">&nbsp;API rules</a>.')}
          ${good_example('Responsibly <a href="/help/whitehat">&nbsp;reporting security&nbsp;</a> issues to us.', leadin="AWESOME:")}
        ${expando_end()}
      </li>
      <!--  Also, 'reddit' is STRICTLY lowercase -->
    </ol>
  </div>
  <div id="followreddiquette" class="info">
    <p>This last bit isn't a rule, but you should also be mindful of <a href="/help/reddiquette">&nbsp;reddiquette</a>, an&nbsp;<em>informal</em>&nbsp;expression of reddit's community values as written by the community itself. Please abide by it the best you can.</p>
  </div>
  <div class="info">
  <img id="brick" class="bottom" alt="" src="${static('brick.png')}">
  </div>
</div>
