|
20 | 20 | -content_for :mixpanel do
|
21 | 21 | =record_event("viewed protip", :featured => @protip.featured, :distinction => @protip.best_stat[0])
|
22 | 22 |
|
23 |
| --if params[:old] == 'true' |
24 |
| - %article{:id => @protip.public_id} |
25 |
| - -unless signed_in? |
26 |
| - =link_to('upvote', upvote_protip_path(@protip.public_id), :remote => true, :method => :post, :rel => "nofollow", :class => 'track slide-signup', 'data-action' => 'upvote protip', 'data-from' => 'protip ribbon') |
27 |
| - %header.cf |
28 |
| - -if !signed_in? |
29 |
| - .side-conversion-alert.hide |
30 |
| - %p Where developers come to connect, share, build and be inspired. |
31 |
| - %a.convert-signup.track{:href => '/', 'data-action' => 'view homepage', 'data-from' => 'convert button on protip'} Join Coderwall |
32 |
| - =image_tag(users_image_path(@protip.user), :class => 'avatar') |
33 |
| - %ul.who-and-when |
34 |
| - %li |
35 |
| - %h2 |
36 |
| - %a.track{:href => profile_path(@protip.user.username), 'data-action' => 'view user profile', 'data-from' => 'protip author name on top'} |
37 |
| - = @protip.user.display_name |
38 |
| - - if is_admin? or viewing_self? or @protip.total_views > 100 |
39 |
| - %li.views |
40 |
| - = @protip.total_views |
41 |
| - Views |
42 |
| - =share_on_twitter(@protip) |
43 |
| - .tip-content |
44 |
| - -#.hide=text_area_tag :protip_markdown, escape_scripts(@protip.body) |
45 |
| - %h1.tip-title=sanitize(@protip.title) |
46 |
| - %ul#tags.tags.cf |
47 |
| - - @protip.topics.each_with_index do |tag, index| |
48 |
| - %li |
49 |
| - %a{:href => "/p/t/#{tag.parameterize}"} |
50 |
| - = tag |
51 |
| - - if is_admin? |
52 |
| - =link_to 'delete', delete_tag_protip_path(@protip.public_id, CGI.escape(tag)), :method => :post, :class => "delete" |
53 |
| - - if is_admin? && @protip.orphan? |
54 |
| - %li.orphan Orphan |
55 |
| - .tip-body |
56 |
| - #body=sanitize(formatted_protip(@protip)) |
57 |
| - - if is_admin? |
58 |
| - %ul.admin-links |
59 |
| - %li |
60 |
| - =link_to '', flag_protip_path(@protip), :method => :post, :remote => true, :class => (@protip.flagged? ? 'flagged' : "") + " flag" |
61 |
| - %li |
62 |
| - =link_to '', queue_protip_path(@protip, :queue => 'hackernews'), :method => :post, :remote => true, :class => (@protip.queued_for?(:hackernews) ? 'queued' : "") + " queue" |
63 |
| - %li |
64 |
| - =link_to '', feature_protip_path(@protip), :method => :post, :remote => true, :class => (@protip.featured? ? 'featured' : "") + " feature" |
65 |
| - %li |
66 |
| - %p.reviewed |
67 |
| - =protip_reviewer(@protip) |
68 |
| - |
69 |
| - -if is_admin? or (signed_in? && @protip.owned_by?(current_user)) |
70 |
| - %a.add-tag{:href => edit_protip_path(@protip.public_id)} Edit Protip |
71 |
| - = upvote_link(@protip, "upvote") |
72 |
| - - authors_team = @job && @protip.author.belongs_to_team?(@job.team) |
73 |
| - |
74 |
| - -if @protip.user.about.blank? |
75 |
| - %footer.about-footer.no-about.cf |
76 |
| - %ul.links.cf |
77 |
| - %li=link_to('View profile', profile_path(@protip.user.username), :class => 'view-profile track', 'data-action' => 'view user profile', 'data-from' => 'protip about (view profile)') |
78 |
| - %li=link_to('View pro tips', user_protips_path(@protip.user.username), :class => 'view-protips track', 'data-action' => 'view user protips', 'data-from' => 'protip about (view pro tips)') |
79 |
| - %li |
80 |
| - - follow = follow_or_following(@protip.user) |
81 |
| - =link_to "#{follow} #{@protip.user.short_name}", follow == "follow" ? follow_user_path(@protip.user.username) : '', :method => :post, :remote => true, :class => "#{follow}-user track", 'data-action' => 'follow user', 'data-from' => 'protip about (follow xxx)' |
82 |
| - -else |
83 |
| - %footer.about-footer.cf |
84 |
| - .about |
85 |
| - %h4==About #{@protip.user.short_name} |
86 |
| - %p |
87 |
| - =@protip.user.about |
88 |
| - -if @protip.user.team |
89 |
| - Member of team |
90 |
| - =link_to(@protip.user.team.name, friendly_team_path(@protip.user.team), :class => "track", 'data-action' => 'view team', 'data-from' => 'protip job (member of team xxx)', 'data-properties' => {"author's team" => authors_team}.to_json) |
91 |
| - %ul.links.cf |
92 |
| - %li=link_to('View profile', profile_path(@protip.user.username), :class => 'view-profile track', 'data-action' => 'view user profile', 'data-from' => 'protip about (view profile)') |
93 |
| - %li=link_to('View pro tips', user_protips_path(@protip.user.username), :class => 'view-protips track', 'data-action' => 'view user protips', 'data-from' => 'protip about (view pro tips)') |
94 |
| - %li |
95 |
| - - follow = follow_or_following(@protip.user) |
96 |
| - =link_to "#{follow} #{@protip.user.short_name}", follow == "follow" ? follow_user_path(@protip.user.username) : '', :method => :post, :remote => true, :class => "#{follow}-user track", 'data-action' => 'follow user', 'data-from' => 'protip about (follow xxx)' |
97 |
| - - if @job |
98 |
| - .work-for-wrap |
99 |
| - .works-for.cf |
100 |
| - .left |
101 |
| - %a.team-ava.track{:href => team_job_path(@job.team), 'data-action' => 'view team jobs', 'data-from' => 'job on protip (team avatar)', 'data-properties' => {"author's team" => authors_team}.to_json} |
102 |
| - =image_tag(@job.team.avatar_url) |
103 |
| - .right |
104 |
| - %p |
105 |
| - - if authors_team |
106 |
| - = @protip.author.short_name |
107 |
| - works for |
108 |
| - %a.team.track{:href => team_job_path(@protip.author.team), 'data-action' => 'view team jobs', 'data-from' => 'job on protip (team name)', 'data-properties' => {"author's team" => authors_team}.to_json} |
109 |
| - = @protip.user.team.name |
110 |
| - ==– want to join them as a |
111 |
| - = succeed "?" do |
112 |
| - %a.position.track{:href => team_job_path(@protip.user.team), 'data-action' => 'view team jobs', 'data-from' => 'job on protip (job title)', 'data-properties' => {"author's team" => authors_team}.to_json} |
113 |
| - =@job.title |
114 |
| - - else |
115 |
| - - adjective = ["is amazing", "is awesome", "has a great engineering team"].sample |
116 |
| - Calling all |
117 |
| - == #{@job.title.pluralize}. |
118 |
| - %a.team.track{:href => team_job_path(@job.team), 'data-action' => 'view team jobs', 'data-from' => 'job on protip (team name)', 'data-properties' => {"author's team" => authors_team, 'adjective' => adjective}.to_json} |
119 |
| - = @job.team.name |
120 |
| - = adjective |
121 |
| - and is |
122 |
| - %a.position.track{:href => team_job_path(@job.team), 'data-action' => 'view team jobs', 'data-from' => 'job on protip (hiring)', 'data-properties' => {"author's team" => authors_team, 'adjective' => adjective}.to_json} |
123 |
| - hiring |
124 |
| - |
125 |
| - -if !@next_protip.nil? |
126 |
| - -next_protip = Protip::SearchWrapper.new(@next_protip) |
127 |
| - |
128 |
| - %a.main-link.track{:href => protip_or_link_path(next_protip), 'data-action' => 'next protip', 'data-from' => 'protip', 'data-properties' => {'mobile' => false}.to_json} |
129 |
| - %article.next-tip{:class => dom_class(next_protip), :id => next_protip.public_id} |
130 |
| - |
131 |
| - %section.comments |
132 |
| - %h2.comments-header Comments |
133 |
| - %ul.comment-list |
134 |
| - = render @comments |
135 |
| - |
136 |
| - = render 'comments/add_comment' |
137 |
| - |
138 |
| - |
139 |
| - - if !next_protip.nil? and mobile_device? |
140 |
| - %a.next-tip-mob.track{:href => protip_or_link_path(next_protip), 'data-action' => 'next protip', 'data-from' => 'protip', 'data-properties' => {'mobile' => true}.to_json} |
141 |
| - Next pro tip |
142 |
| - |
143 |
| --else |
144 |
| - #x-active-preview-pane |
145 |
| - -if !signed_in? |
146 |
| - .side-conversion-alert.hide |
147 |
| - %p Where developers come to connect, share, build and be inspired. |
148 |
| - %a.convert-signup.track{:href => '/', 'data-action' => 'view homepage', 'data-from' => 'convert button on protip'} Join Coderwall |
149 |
| - =render :partial => 'cacheable_protip', :locals => {:protip => @protip, :mode => 'fullpage', :include_comments => true, :job => @job} |
| 23 | +#x-active-preview-pane |
| 24 | + -unless signed_in? |
| 25 | + .side-conversion-alert.hide |
| 26 | + %p Where developers come to connect, share, build and be inspired. |
| 27 | + %a.convert-signup.track{:href => '/', 'data-action' => 'view homepage', 'data-from' => 'convert button on protip'} Join Coderwall |
| 28 | + =render :partial => 'cacheable_protip', :locals => {:protip => @protip, :mode => 'fullpage', :include_comments => true, :job => @job} |
0 commit comments