From e360058acada5b3b8a714d2789e4ad8e013e5ee4 Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Fri, 2 Nov 2018 13:40:01 -0700 Subject: [PATCH] refactor --- app/helpers/application_helper.rb | 4 ++++ app/views/posts/partials/show/_pool_list.html.erb | 6 +++--- app/views/posts/partials/show/_pool_list_item.html.erb | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bb105419c..82796dc41 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -7,6 +7,10 @@ module ApplicationHelper raw(wordbreaked_string) end + def pro_fontawesome_enabled? + request.domain =~ /donmai\.us/ + end + def nav_link_to(text, url, **options) klass = options.delete(:class) diff --git a/app/views/posts/partials/show/_pool_list.html.erb b/app/views/posts/partials/show/_pool_list.html.erb index 840f3574b..04edc82a2 100644 --- a/app/views/posts/partials/show/_pool_list.html.erb +++ b/app/views/posts/partials/show/_pool_list.html.erb @@ -1,7 +1,7 @@
diff --git a/app/views/posts/partials/show/_pool_list_item.html.erb b/app/views/posts/partials/show/_pool_list_item.html.erb index 6cd6728cb..1f3d5b9c8 100644 --- a/app/views/posts/partials/show/_pool_list_item.html.erb +++ b/app/views/posts/partials/show/_pool_list_item.html.erb @@ -17,9 +17,9 @@ <%= link_to("Pool: #{pool.pretty_name}", pool_path(pool), title: "page #{pool.page_number(post.id)}/#{pool.post_count}") -%> - <% if pool.neighbors(post, :next).tap do |previous_post_id| -%> - <% if previous_post_id %> - <%= link_to("next ›".html_safe, post_path(next_post_in_pool, pool_id: pool.id), rel: selected ? "next" : nil, class: "next", title: "to page #{pool.page_number(previous_post_id)}") -%> + <% pool.neighbors(post, :next).tap do |next_post_id| -%> + <% if next_post_id %> + <%= link_to("next ›".html_safe, post_path(next_post_id, pool_id: pool.id), rel: selected ? "next" : nil, class: "next", title: "to page #{pool.page_number(next_post_id)}") -%> <% else -%> next › <% end -%>