|
1 |
| --reset_protip_result_index |
2 |
| --show_job = defined?(opportunity) && !opportunity.nil? |
| 1 | +- reset_protip_result_index |
| 2 | +- show_job = defined?(opportunity) && opportunity.present? |
3 | 3 | - width = (defined?(width) && width) || 4
|
4 |
| -- show_ad_every = width*2+width-2 |
5 |
| -- items = show_job ? protips.each_slice(show_ad_every).map{|row| row.count == show_ad_every ? row.concat(['show-ad', nil]) : row }.flatten : protips |
| 4 | +- show_ad_every = width * 2 + width - 2 |
| 5 | +- items = show_job ? protips.each_slice(show_ad_every).map{ |row| row.count == show_ad_every ? row.concat(['show-ad', nil]) : row }.flatten : protips |
6 | 6 |
|
7 |
| -- if collection.failure? |
| 7 | +- logger.ap(collection, :debug) |
| 8 | +- if collection.respond_to?(:failure?) && collection.failure? |
8 | 9 | .error
|
9 |
| - ="#{collection.error} Meanwhile you can " |
10 |
| - =link_to 'create a pro tip', new_protip_path |
| 10 | + = "#{collection.error} Meanwhile you can " |
| 11 | + = link_to 'create a pro tip', new_protip_path |
11 | 12 | = "about #{@topic}" unless @topic.nil?
|
12 | 13 |
|
13 |
| --items.in_groups_of(width, nil).each_with_index do |group, row| |
14 |
| - -if (row > 0) && blur_protips? |
| 14 | +- items.in_groups_of(width, nil).each_with_index do |group, row| |
| 15 | + - if (row > 0) && blur_protips? |
15 | 16 | .blurred-tips
|
16 |
| - =render :partial => "sessions/join_buttons", :locals => {:message => "Join to start earning badges for your open source contributions, discover protips and connect with other developers"} |
17 |
| - -break |
| 17 | + = render(partial: 'sessions/join_buttons', locals: { message: 'Join to start earning badges for your open source contributions, discover protips and connect with other developers' }) |
| 18 | + - break |
18 | 19 | %ul.protips-grid.cf
|
19 |
| - -group.each do |protip| |
20 |
| - -if protip == 'show-ad' |
21 |
| - =render :partial => 'opportunities/mini', :locals => {:opportunity => opportunity} |
22 |
| - -elsif !protip.nil? |
| 20 | + - group.each do |protip| |
| 21 | + - if protip == 'show-ad' |
| 22 | + = render(partial: 'opportunities/mini', locals: { opportunity: opportunity }) |
| 23 | + -elsif protip.present? |
23 | 24 | - if protip = protip.load rescue nil # HACK: User deleted, protip no longer exists. Won't be found.
|
24 |
| - %li{:class => (protip.kind == 'link' ? 'ext-link' : '') } |
25 |
| - = render :partial => 'protips/mini', :locals => {:protip => protip, :mode => mode} |
| 25 | + %li{ class: (protip.kind == 'link' ? 'ext-link' : '') } |
| 26 | + = render(partial: 'protips/mini', locals: { protip: protip, mode: mode }) |
26 | 27 |
|
27 | 28 | - unless collection.nil? || !collection.respond_to?(:next_page) || collection.next_page.nil? || hide_more
|
28 |
| - - next_url = url_for(params.merge(:tags=> params[:tags], :q => params[:q], :source => params[:action], :controller =>params[:controller], :page => collection.current_page + 1, :section => (defined?(section) ? section : nil), :width => width, :mode => mode )) |
29 |
| - %div{:class => ("#{number_to_word(width)}-cols-more" unless width.nil?)} |
30 |
| - #more=link_to 'More', next_url, :class => 'final-more track' , :rel => 'next', :remote => true, :method => (params[:action] == "search" ? :post : :get), 'data-action' => 'more protips', 'data-from' => params[:action] |
| 29 | + - next_url = url_for(params.merge(tags: params[:tags], q: params[:q], source: params[:action], controller:params[:controller], page: collection.current_page + 1, section: (defined?(section) ? section : nil), width: width, mode: mode )) |
| 30 | + %div{ class: ("#{number_to_word(width)}-cols-more" unless width.nil?) } |
| 31 | + #more= link_to('More', next_url, class: 'final-more track', rel: 'next', remote: true, method: (params[:action] == 'search' ? :post : :get), 'data-action' => 'more protips', 'data-from' => params[:action]) |
0 commit comments