posts: add /posts/{id}.html?variant=tooltip template.
This commit is contained in:
@@ -9,6 +9,7 @@ class ApplicationController < ActionController::Base
|
||||
before_action :set_started_at_session
|
||||
before_action :api_check
|
||||
before_action :set_safe_mode
|
||||
before_action :set_variant
|
||||
# before_action :secure_cookies_check
|
||||
layout "default"
|
||||
helper_method :show_moderation_notice?
|
||||
@@ -184,6 +185,10 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
def set_variant
|
||||
request.variant = params[:variant].try(:to_sym)
|
||||
end
|
||||
|
||||
User::Roles.each do |role|
|
||||
define_method("#{role}_only") do
|
||||
if !CurrentUser.user.is_banned_or_ip_banned? && CurrentUser.user.__send__("is_#{role}?")
|
||||
|
||||
Reference in New Issue
Block a user