posts: add /posts/{id}.html?variant=tooltip template.

This commit is contained in:
evazion
2018-04-25 20:12:06 -05:00
parent f2998585e9
commit e772de40a7
6 changed files with 32 additions and 1 deletions

View File

@@ -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}?")