Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c503a13cf6
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (36 sloc) 1.539 kb
<%- page.htmlContent() %>
<% if (page.path !== '/') { %>
<h2 id="discussion">Discussion</h2>
<% if (request.session.twitter) { %>
<% form_for('', {action: path_to.comments, class: 'new-comment'}, function (form) { %>
<div class="comment-header">
<% if (request.session.twitter && request.session.twitter.profile_image_url) { %>
<img src="<%= request.session.twitter.profile_image_url %>" class="avatar" />
<% } %>
Leave comment as <%- request.session.twitter.name || request.session.twitter.screen_name %><br />
</div>
<%- form.input('path', {type: 'hidden', value: page.path}) %>
<%- form.textarea('text') %><br />
<%- form.submit('Post comment') %>
<% }); %>
<% } else { %>
<%- link_to('Connect with twitter', '/twitter_connect') %> to leave comment.
<% } %>
<% page.comments.forEach(function (comment) { %>
<div class="comment">
<div class="comment-header">
<% if (comment.pic) { %>
<img src="<%= comment.pic %>" class="avatar" />
<% } %>
<%- comment.author %>
<%- comment.timeAgo() %>
<% if (request.session.twitter && comment.twid == request.session.twitter.id) { %>
<%- link_to('Delete comment', path_to.comment(comment), {remote: true, confirm: 'Are you sure want to delete comment?', method: 'DELETE', jsonp: '(function(){})'}) %>
<% } %>
</div>
<div class="comment-body">
<%- comment.htmlContent() %>
</div>
</div>
<% }); %>
<% } %>
Jump to Line
Something went wrong with that request. Please try again.