From d6fa2480934e19c25981cdb8d4a9ad926d4854b2 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Wed, 28 Jan 2015 14:56:18 -0500 Subject: [PATCH] UX: Update 404 page category badge to use centralized helper and style --- app/assets/stylesheets/desktop/discourse.scss | 4 ++++ app/helpers/application_helper.rb | 4 ++++ app/helpers/user_notifications_helper.rb | 5 ----- app/mailers/user_notifications.rb | 1 + app/views/exceptions/not_found.html.erb | 8 ++++++-- app/views/user_notifications/digest.html.erb | 4 ++-- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/assets/stylesheets/desktop/discourse.scss b/app/assets/stylesheets/desktop/discourse.scss index e35b97994c8..2e9ee7e8412 100644 --- a/app/assets/stylesheets/desktop/discourse.scss +++ b/app/assets/stylesheets/desktop/discourse.scss @@ -136,6 +136,10 @@ body { margin-bottom: 10px; } + .not-found-topic { + a[href] { margin-right: 10px; line-height: 2;} + } + .page-not-found-topics .span8 { line-height: 1.5em; margin-right: 20px; diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7cf3271f3a7..9bf4db32db8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -5,6 +5,7 @@ require_dependency 'unread' require_dependency 'age_words' require_dependency 'configurable_urls' require_dependency 'mobile_detection' +require_dependency 'category_badge' module ApplicationHelper include CurrentUser @@ -153,5 +154,8 @@ module ApplicationHelper controller.class.name.split("::").first == "Admin" || session[:disable_customization] end + def category_badge(category, opts=nil) + CategoryBadge.html_for(category, opts).html_safe + end end diff --git a/app/helpers/user_notifications_helper.rb b/app/helpers/user_notifications_helper.rb index 689e860ed3e..77dea02d7a5 100644 --- a/app/helpers/user_notifications_helper.rb +++ b/app/helpers/user_notifications_helper.rb @@ -1,5 +1,3 @@ -require_dependency 'category_badge' - module UserNotificationsHelper def indent(text, by=2) @@ -60,7 +58,4 @@ module UserNotificationsHelper PrettyText.format_for_email(html).html_safe end - def email_category(category, opts=nil) - CategoryBadge.html_for(category, opts).html_safe - end end diff --git a/app/mailers/user_notifications.rb b/app/mailers/user_notifications.rb index 736e5d64d5f..6e5f6006092 100644 --- a/app/mailers/user_notifications.rb +++ b/app/mailers/user_notifications.rb @@ -3,6 +3,7 @@ require_dependency 'email/message_builder' require_dependency 'age_words' class UserNotifications < ActionMailer::Base + helper :application default charset: 'UTF-8' include Email::BuildEmailHelper diff --git a/app/views/exceptions/not_found.html.erb b/app/views/exceptions/not_found.html.erb index 4a4a7db01c2..47ab572429d 100644 --- a/app/views/exceptions/not_found.html.erb +++ b/app/views/exceptions/not_found.html.erb @@ -6,7 +6,9 @@