## 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 reddit Inc.
##
## All portions of the code written by reddit are Copyright (c) 2006-2013
## reddit Inc. All Rights Reserved.
###############################################################################

<%!
   from r2.lib.template_helpers import add_sr
 %>
<%namespace file="printable.compact" import="delete_report_buttons"/>
<%namespace file="subreddit.html" import="tagline, permission_icons"/>
<%namespace file="utils.html" import="plain_link" />
<%namespace file="printablebuttons.html" import="toggle_button"/>

  <% 
     like_cls = ""
     if getattr(thing, "likes", None):
         like_cls = "likes"
     elif getattr(thing, "likes", None) is False:
         like_cls = "dislikes"
   %>
<div class="thing subreddit id-${thing._fullname}">
  <div class="midcol"
  ${toggle_button("fancy-toggle-button", "+", "-",
                  "subscribe('%s')" % thing._fullname, 
                  "unsubscribe('%s')" % thing._fullname, 
                  css_class = "add button", alt_css_class = "remove button",
                  reverse = thing.subscriber)}
  </div>
  <div class="entry ${like_cls}">
    %if thing.public_description or thing.description:
      <a href="javascript:void(0)" class="expando-button collapsed button">
          Aa
      </a>
    %endif
    <p class="title">
      ${plain_link(thing.name, thing.path, _class="title")}
      ${plain_link(thing.title, thing.path, _class="domain")}
    </p>
    <p class="tagline">
      ${tagline()}
    </p>
  %if thing.public_description_usertext:
    <div class="expando" style="display:none">
      <div class="description">
        ${thing.public_description_usertext}
      </div>
    </div>
  %endif
  </div>
  <div class="clear"></div>
</div>
