From: Nguyễn Thái Ngọc Duy Date: Mon, 28 Aug 2006 13:25:49 +0000 (+0700) Subject: Reduced User#is_guest?, User#is_admin?, User#is_mod? calls X-Git-Url: https://repo.or.cz/punbbonrails.git/commitdiff_plain/b712879d8f8ca735a2d87f27ee2a489dfff16deb Reduced User#is_guest?, User#is_admin?, User#is_mod? calls --- diff --git a/app/helpers/forum_helper.rb b/app/helpers/forum_helper.rb index 0ca0b70..cf41afc 100644 --- a/app/helpers/forum_helper.rb +++ b/app/helpers/forum_helper.rb @@ -1,6 +1,7 @@ module ForumHelper def topic_info(topic) cu = current_user + is_guest = cu.is_guest? icon_text = 'Normal icon' item_status = '' icon_type = 'icon' @@ -21,7 +22,7 @@ module ForumHelper end subject_new_posts = '' - if !cu.is_guest? and topic.last_post > cu.last_visit and topic.moved_to.nil? + if !is_guest and topic.last_post > cu.last_visit and topic.moved_to.nil? icon_text += ' ' + 'New icon' item_status += ' inew' icon_type = 'icon inew' @@ -29,7 +30,7 @@ module ForumHelper subject_new_posts = '[ '+link_to('New posts', {:controller => 'topic', :action => 'view', :id => topic.id, :new_posts => true}, {:title => 'New posts info'})+' ]' end - if !cu.is_guest? and Settings.show_dot == true + if !is_guest and Settings.show_dot == true subject = (topic.posts.find_by_poster_id(cu.id) != nil ? '· ' : '  ') + subject end diff --git a/app/views/forum/index.rhtml b/app/views/forum/index.rhtml index 1be0dec..b63eb03 100644 --- a/app/views/forum/index.rhtml +++ b/app/views/forum/index.rhtml @@ -1,5 +1,6 @@ <% cu = current_user + is_guest = cu.is_guest? content_for :head_links do -%>