Skip to content

Commit

Permalink
Add permalinking stuff to comment template
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuxax committed Dec 16, 2011
1 parent 98b1681 commit 9808796
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions raggregate/templates/base/comment_item.mak
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,19 @@
down_active_vote_str = 'active-vote'
down_arrow_src = 'med-arrow-down-active.png'

comment_perma = None
if 'comment_perma' in request.session['safe_params']:
comment_perma = request.session['safe_params']['comment_perma']

%>
<div class="comment" id="${c.id}" style="margin-left: ${margin}px;">
<a name="${c.id}" id="${c.id}-anchor" />
<div class="comment-votes-picture">
% if comment_perma and comment_perma == str(c.id):
<b>this is only one thread from this submission. click <a href="${request.route_url('full', sub_id=template_filters.get_submission_identifier_for_url(c.submission_id))}">here</a> to see all the commentary.</b><br />
<div class="comment" id="${c.id}" style="margin-left: ${margin}px; background-color: #fffdc9 ! important;">
% else:
<div class="comment" id="${c.id}" style="margin-left: ${margin}px;">
% endif
<a name="${c.id}" id="${c.id}-anchor" />
<div class="comment-votes-picture">
<%
# leave this indentation this way please
if c.submitter.picture_ref:
Expand All @@ -50,7 +59,7 @@ else:
## <span class="c-body-text" id="body-${c.id}">${c.body.replace("\n", "<br />\n") | n}</span>
<div class="c-body-text" id="body-${c.id}">${c.body | template_filters.render_md,n}</div>
<div class="comment-controls">
<a href="#comment" id="reply-${c.id}" class="comment-reply logged-in-only">reply</a> &nbsp; <a href="javascript:void(0)" class="follow-link logged-in-only" data-submitter-id="${c.submitter.id}" id="follow-${c.submitter.id}">${followed_term}</a>
<a href="#comment" id="reply-${c.id}" class="comment-reply logged-in-only">reply</a> &nbsp; <a href="javascript:void(0)" class="follow-link logged-in-only" data-submitter-id="${c.submitter.id}" id="follow-${c.submitter.id}">${followed_term}</a> &nbsp; <a href="${request.route_url('full', sub_id=template_filters.get_submission_identifier_for_url(c.submission_id), _query=[('comment_perma', c.id)])}">permalink</a>
% if str(c.submitter.id) == request.session['users.id'] or logged_in_admin:
&nbsp; <a href="${request.route_url('full', sub_id=template_filters.get_submission_identifier_for_url(c.submission_id), _query=[('op', 'del'), ('comment_id', str(c.id))])}">delete</a>
% endif
Expand Down

0 comments on commit 9808796

Please sign in to comment.