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.
asciinema.org/app/views/asciicasts/show.html.erb

71 lines
1.9 KiB
Plaintext

<div class="page-header asciicast-heading">
<h1>
<%= asciicast_title(@asciicast) %>
<% if @asciicast.user == current_user %>
<% if @asciicast.title.blank? %>
<%= link_to 'Add a title', edit_asciicast_path(@asciicast),
:class => 'edit-title' %>
<% else %>
<%= link_to 'Edit title', edit_asciicast_path(@asciicast),
:class => 'edit-title' %>
<% end %>
<% end %>
<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 %>
<% if @asciicast.description.blank? %>
<%= link_to 'Add a description', edit_asciicast_path(@asciicast),
:class => 'edit-description' %>
<% else %>
<%= link_to 'Edit description', edit_asciicast_path(@asciicast),
:class => 'edit-description' %>
<% end %>
|
<%= link_to 'Delete this asciicast', asciicast_path(@asciicast),
:method => :delete, :confirm => 'U SHURE?',
:class => 'asciicast-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>