reddish / reddish / templates / community / comments.mako

<%inherit file="post.mako"/>
<%block name="title">\
% if c.hilight_comment is None or c.hilight_comment.get_author() is None:
${post.title} - ${c.cmty.title}\
% else:
${c.hilight_comment.get_author().name} comments on ${post.title}\
% endif
</%block>
<%page args="post, comments"/>

${self.show_post(post, full = c.hilight_comment is None)}

<% can_reply = c.cmty.can_comment(c.user) %>
% if c.hilight_comment is None:
<div class="comment-section">
    ${post.num_comments} comments
</div>

%   if can_reply:
<div id="post-reply" class="reply-form">
    <form method="post" action="/api/comment">
        <input type="hidden" name="post" value="${post._id}"/>
        <input type="hidden" name="render" value="html"/>

        <textarea name="text"></textarea><br/>
        <div style="width:500px">
        <div class="right">
            <a href="#" class="show-help" tabindex="99">formatting help</a>
            <a href="#" class="hide-help" tabindex="99" style="display:none">hide help</a>
        </div>
        </div>
        <input type="submit" value="submit"/>
        <button type="button" class="preview">preview</button>
        <span class="status"></span>
    </form>

    <div class="preview-area" style="display:none">
        <a href="#" class="preview-hide">close</a>
        <div class="preview-box md"></div>
    </div>

    ${self.markdown_help()}
</div>
%   endif
% else:
<br/>
<div class="notice">
    You are viewing a single comment thread.<br/>
    <a href="${post.permalink}">View the rest of the comments</a>
    <% parents = len(c.hilight_comment.parents) %>
    % if parents > c.comment_context:
    <br/>
    <a href="${url.current(context = min(parents, 9))}">Show the context of this thread</a>
    % endif
</div>
% endif
% if can_reply:

<div id="reply-form" class="reply-form" style="display:none">
    <form method="post" action="/">
        <input type="hidden" name="render" value="html"/>

        <textarea name="text"></textarea><br/>
        <div style="width:500px">
        <div class="right">
            <a href="#" class="show-help" tabindex="99">formatting help</a>
            <a href="#" class="hide-help" tabindex="99" style="display:none">hide help</a>
        </div>
        </div>
        <input type="submit" value="submit"/>
        <button type="button" class="preview">preview</button>
        <button type="button" class="cancel">cancel</button>
        <span class="status"></span>
    </form>

    <div class="preview-area" style="display:none">
        <a href="#" class="preview-hide">close</a>
        <div class="preview-box md"></div>
    </div>

    ${self.markdown_help()}
</div>
% endif

<div id="comments">
<div id="comments-empty">${self.empty(comments)}</div>
% for com in comments:
${self.show_comment(com, can_reply = can_reply)}
% endfor
</div>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.