You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.3 KiB
Plaintext
51 lines
1.3 KiB
Plaintext
<div class="page-header asciicast-heading">
|
|
<h1>
|
|
<%= asciicast_title(@asciicast) %>
|
|
|
|
<span class="meta">
|
|
Recorded by
|
|
<%= profile_link(@asciicast, :avatar => false) %>
|
|
<%= asciicast_time(@asciicast) %>
|
|
</span>
|
|
</h1>
|
|
</div>
|
|
|
|
<%= render :partial => 'asciicasts/asciicast', :object => @asciicast %>
|
|
|
|
<% if @asciicast.user == current_user %>
|
|
<%= link_to 'Delete this asciicast', asciicast_path(@asciicast),
|
|
:method => :delete, :confirm => 'U SHURE?',
|
|
:class => 'delete-link' %>
|
|
<% end %>
|
|
|
|
<div class="comments-container">
|
|
<h2>Comments</h2>
|
|
|
|
<ul id="comments">
|
|
</ul>
|
|
|
|
<% if current_user %>
|
|
<form id="new-comment">
|
|
<label>Your comment</label>
|
|
<p>
|
|
<textarea type="text" name="body" id="comment-body"></textarea>
|
|
</p>
|
|
<button type="submit" class="btn">Post</button>
|
|
</form>
|
|
<% else %>
|
|
<div><%= link_to "Login in", login_path %> to comment.</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var comments = new AsciiIo.Collections.Comments();
|
|
var asciicast_id = <%= @asciicast.id %>
|
|
|
|
comments.url = ['/api/asciicasts/', asciicast_id, '/comments'].join('');
|
|
comments.fetch();
|
|
|
|
new AsciiIo.Views.CommentsIndex({ collection: comments });
|
|
});
|
|
</script>
|