This repository has been archived by the owner on Jun 7, 2021. It is now read-only.
/
show.html.haml
86 lines (77 loc) · 3.92 KB
/
show.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
%script{"type"=>"text/javascript", "src"=>"http://www.plaxo.com/css/m/js/util.js"}
%script{"type"=>"text/javascript", "src"=>"http://www.plaxo.com/css/m/js/basic.js"}
%script{"type"=>"text/javascript", "src"=>"http://www.plaxo.com/css/m/js/abc_launcher.js"}
- @section = (@post.category && @post.category.name)
- @meta = { :title => "#{@post.title}", :description => "#{truncate_words(@post.post, 75, '...' )}", :keywords => "#{@post.tags.join(", ") unless @post.tags.nil?}", :robots => configatron.robots_meta_show_content }
#send_to_friend.modal.fade{:role => 'dialog', "aria-hidden" => "true", :"aria-labelledby" => "send_to_friend_label", :tabindex => "-1", :style => 'padding-top: 60px;'}
=render :partial => 'author_profile', :locals => {:user => @user}
- unless @related.empty?
-widget do
%h4
.small=:related_posts.l
%ul.list-unstyled
- @related.each do |post|
%li=link_to truncate(post.title, :length => 75), user_post_path(post.user, post)
- unless @popular_posts.empty?
-widget do
%h4
.small=:popular_posts.l
%ul.list-unstyled
- @popular_posts.each do |post|
%li=link_to truncate(post.title, :length => 75), user_post_path(post.user, post)
%h2=:users_blog.l :user=> @user.login
.clearfix
.pull-right.col-sm-3
.list-group
%a.list-group-item{:href => "#{user_post_path(@user, @post)}", :rel => "bookmark"}
=fa_icon "calendar fw"
%abbr.published{:title => "#{@post.published_at}"}= @post.published_at_display(:literal_date)
%li.list-group-item
=fa_icon "eye fw", :text => :view_count.l
%span.badge= @post.view_count
%a.list-group-item{:href => "#{user_post_path(@user, @post)}", :name => 'comments'}
=fa_icon "comment fw", :text => :comments.l
%span.badge.badge-info=@post.comments.count
- if current_user and current_user.can_request_friendship_with(@post.user)
%li.list-group-item
= add_friend_link(@post.user)
%a.list-group-item{:href => "#", :onclick=>"window.print(); return false;", :title=>:print_this_story.l}
=fa_icon "print fw", :text => :print.l
%a.email.list-group-item{:href => "#", :title => :email_this_story_to_friends.l}
=fa_icon "envelope fw", :text => :email_to_friends.l
%li.list-group-item
%script{:type=>"text/javascript", :src=>"http://w.sharethis.com/widget/?tabs=web&charset=utf-8&style=default&publisher=4488bdef-d776-4c80-93e1-ac1fb8359971&linkfg=%23131358&button=false"}
=sharethis_options(@post)
-if @is_current_user || admin? || moderator?
%a.list-group-item{:href => "#{edit_user_post_path(@post.user, @post)}"}
=fa_icon "pencil-square-o fw", :text => :edit.l
= link_to fa_icon("trash-o fw", :text => :delete.l), user_post_path(@post.user, @post), {:method => :delete, data: { confirm: :permanently_delete_this_post.l }, :class => "list-group-item"}
= @post.post.html_safe
/ clearfix
= render :partial => 'polls/poll_ui', :locals => {:poll => @post.polls.first} unless @post.polls.empty?
- unless @post.tags.empty?
.clearfix
%ul.list-unstyled
- @post.tags.each do |t|
%li
%a.label.label-info{:href => tag_url(t), :rel => 'tag'}
=fa_icon "tag inverse", :text => t.name
%h2= :post_comments.l
%h3= :add_your_comment.l
= render :partial => 'comments/comment_form', :locals => {:commentable => @post}
%a#newest_comment
= render :partial => 'comments/comment', :collection => @comments
%span#more_comments_links= more_comments_links(@post)
-content_for :end_javascript do
:javascript
$.ajax({
type: "PATCH",
url: "#{update_views_user_post_path(@post.user, @post)}",
});
$('.email').on('click', function(e){
e.preventDefault();
$.post("#{send_to_friend_user_post_path(:user_id => @user.id, :id => @post.id)}", function(response){
$('#send_to_friend').html(response);
});
$('#send_to_friend').modal();
});