diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 3b236925a..667eb51a4 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -23,7 +23,7 @@ class PostsController < ApplicationController end if @post - @commenting_disabled = can_not_comment_on_post? + # @commenting_disabled = can_not_comment_on_post? # mark corresponding notification as read if user_signed_in? && notification = Notification.where(:recipient_id => current_user.id, :target_id => @post.id).first notification.unread = false diff --git a/app/views/posts/show.html.haml b/app/views/posts/show.html.haml index d8a30340a..a81f7f525 100644 --- a/app/views/posts/show.html.haml +++ b/app/views/posts/show.html.haml @@ -5,43 +5,27 @@ - content_for :page_title do = post_page_title @post -- content_for :head do - = javascript_include_tag 'vendor/bootstrap/bootstrap-transition', 'vendor/bootstrap/bootstrap-modal' - -.header - .header-container - #post-author.media - .img - = person_image_link @post.author - .bd - = person_link(@post.author, :class => 'author-name') - - - if @post.is_a?(Reshare) && @post.root.present? - %i.icon-retweet - = person_link(@post.root.author, :class => "author-name") - - .post-time - %i.icon-time - = time_ago_in_words(@post.created_at) + ' ago' +/- content_for :head do +/ = javascript_include_tag 'vendor/bootstrap/bootstrap-transition', 'vendor/bootstrap/bootstrap-modal' #container -#comment.modal.fade - .modal-header - %h3 - Responses +-# #comment.modal.fade + -# .modal-header + -# %h3 + -# Responses - .modal-body - - @post.comments.each do |c| - .media - .img - = person_image_link c.author - .bd - %strong= person_link(c.author) - %br - = c.text - .modal-footer - = form_tag comments_path, :remote => true do - = text_area_tag :text, '', :class => 'span6' - = hidden_field_tag :post_id, @post.id - = submit_tag 'submit', :onclick => "$('#comment').modal('hide'); $('#text').text('')" + -# .modal-body + -# - @post.comments.each do |c| + -# .media + -# .img + -# = person_image_link c.author + -# .bd + -# %strong= person_link(c.author) + -# %br + -# = c.text + -# .modal-footer + -# = form_tag comments_path, :remote => true do + -# = text_area_tag :text, '', :class => 'span6' + -# = hidden_field_tag :post_id, @post.id + -# = submit_tag 'submit', :onclick => "$('#comment').modal('hide'); $('#text').text('')" diff --git a/public/javascripts/app/templates/post-viewer.handlebars b/public/javascripts/app/templates/post-viewer.handlebars index daa33ab8d..6270d8f8c 100644 --- a/public/javascripts/app/templates/post-viewer.handlebars +++ b/public/javascripts/app/templates/post-viewer.handlebars @@ -1,3 +1,29 @@ + + +
+
+
+
+ + + +
+ +
+ + {{author.name}} + + +
+ + {{created_at}} +
+
+
+
+
+ +
diff --git a/public/javascripts/app/views/post_nav_view.js b/public/javascripts/app/views/post_nav_view.js index b17bb76c2..f04cc9009 100644 --- a/public/javascripts/app/views/post_nav_view.js +++ b/public/javascripts/app/views/post_nav_view.js @@ -2,6 +2,10 @@ app.views.PostViewerNav = app.views.Base.extend({ templateName: "post-viewer/nav", + events : { + "click a" : "pjax" + }, + postRenderTemplate : function() { var mappings = {"#forward" : "next_post", "#back" : "previous_post"}; @@ -13,6 +17,11 @@ app.views.PostViewerNav = app.views.Base.extend({ setArrow : function(arrow, loc) { loc ? arrow.attr('href', loc) : arrow.remove() + }, + + pjax : function(evt) { + if(evt) { evt.preventDefault(); } + app.router.navigate($(evt.target).attr("href").substring(1), true) } })