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.
81 lines
2.5 KiB
Plaintext
81 lines
2.5 KiB
Plaintext
<div class="page-header asciicast-heading">
|
|
<h1>
|
|
<span class="title"><%= @asciicast.smart_title %></span>
|
|
|
|
<% if current_user && @asciicast.user == current_user %>
|
|
<% if @asciicast.title.blank? %>
|
|
<%= link_to 'Add a title', edit_asciicast_path(@asciicast, :anchor => 'focus-title'),
|
|
:class => 'edit-title' %>
|
|
<% else %>
|
|
<%= link_to 'Edit title', edit_asciicast_path(@asciicast, :anchor => 'focus-title'),
|
|
:class => 'edit-title' %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<span class="meta">
|
|
Recorded by
|
|
<%= profile_link(@asciicast, :avatar => false) %>
|
|
<%= asciicast_time(@asciicast) %>
|
|
</span>
|
|
</h1>
|
|
|
|
<p class="env-info">
|
|
<span class="os">OS=<span class="value"><%= @asciicast.os %></span></span>
|
|
<span class="shell">SHELL=<span class="value"><%= @asciicast.shell_name %></span></span>
|
|
<span class="term-type">TERM=<span class="value"><%= @asciicast.terminal_type || '?' %></span></span>
|
|
</p>
|
|
</div>
|
|
|
|
<%= render :partial => 'asciicasts/asciicast', :object => @asciicast %>
|
|
|
|
<% if current_user && @asciicast.user == current_user %>
|
|
<% if @asciicast.description.blank? %>
|
|
<%= link_to 'Add a description', edit_asciicast_path(@asciicast, :anchor => 'focus-desc'),
|
|
:class => 'edit-description' %>
|
|
<% else %>
|
|
<%= link_to 'Edit description', edit_asciicast_path(@asciicast, :anchor => 'focus-desc'),
|
|
: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 });
|
|
});
|
|
|
|
$(function() {
|
|
$('.asciicast .description, .asciicast-heading .title').linkify();
|
|
});
|
|
</script>
|