diaspora/app/views/posts/show.html.haml
2012-02-21 15:23:28 -08:00

49 lines
No EOL
1.3 KiB
Text

-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= post_page_title @post
- content_for :head do
=javascript_include_tag 'vendor/bootstrap/bootstrap-transition', 'vendor/bootstrap/bootstrap-modal'
:javascript
$(function(){
$(document).keypress(function(event){
console.log(event.which);
$('#text').focus();
$('#comment').modal();
$('#text').focus();
});
$(document).keydown(function(e){
console.log(e.keyCode);
if (e.keyCode == 37) {
window.location = $('#back').attr('href');
}else if(e.keyCode == 39) {
window.location = $('#forward').attr('href');
}else{}
});
});
#post-author-header
= person_image_tag @post.author
= @post.author.name
#post-content
= link_to image_tag('arrow-left.png'), post_path(@post.id-1), :class => 'nav-arrow left', :id => 'back'
= link_to image_tag('arrow-right.png'), post_path(@post.id+1), :class => 'nav-arrow right', :id => 'forward'
#comment.modal.fade
.modal-body
= form_tag comments_path, :remote => true do
= text_area_tag :text, ''
= hidden_field_tag :post_id, @post.id
= submit_tag 'submit', :onclick => "$('#comment').modal('hide'); $('#text').text('')"