mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: stop mixing in application helper where not needed
We were mixing in 20 or so methods into a controller just to use a single one. The helper itself is not the actual implementation anyway... MobileDetection is responsible here.
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class GroupsController < ApplicationController
|
class GroupsController < ApplicationController
|
||||||
include ApplicationHelper
|
|
||||||
|
|
||||||
requires_login only: [
|
requires_login only: [
|
||||||
:set_notifications,
|
:set_notifications,
|
||||||
:mentionable,
|
:mentionable,
|
||||||
@@ -46,7 +44,7 @@ class GroupsController < ApplicationController
|
|||||||
raise Discourse::InvalidAccess.new(:enable_group_directory)
|
raise Discourse::InvalidAccess.new(:enable_group_directory)
|
||||||
end
|
end
|
||||||
|
|
||||||
page_size = mobile_device? ? 15 : 36
|
page_size = MobileDetection.mobile_device?(request.user_agent) ? 15 : 36
|
||||||
page = params[:page]&.to_i || 0
|
page = params[:page]&.to_i || 0
|
||||||
order = %w{name user_count}.delete(params[:order])
|
order = %w{name user_count}.delete(params[:order])
|
||||||
dir = params[:asc] ? 'ASC' : 'DESC'
|
dir = params[:asc] ? 'ASC' : 'DESC'
|
||||||
|
|||||||
Reference in New Issue
Block a user