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

56 lines
1.2 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>
<div class="asciicast">
<div class="wrapper">
<div class="player"></div>
<div class="clear"></div>
</div>
<div class="description">
<%= random_description %>
</div>
</div>
<%= player_script(@asciicast) %>
<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">
jQuery( 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>