Commit 86be555b authored by Nivaldo Neto's avatar Nivaldo Neto

alphabetic search order

parent 19c78725
Pipeline #78644125 passed with stages
in 47 minutes and 34 seconds
......@@ -12,7 +12,9 @@ module SearchHelper
'more_active' => _('More active'),
'more_recent' => _('More recent'),
'more_relevant' => _('More relevant'),
'more_comments' => _('More comments')
'more_comments' => _('More comments'),
'alpha_az' => _('A-Z'),
'alpha_za' => _('Z-A')
},
:display => {
'map' => _('Map'),
......
......@@ -5,7 +5,7 @@ class Enterprise < Organization
:activities_short_description
SEARCH_FILTERS = {
:order => %w[more_recent more_popular more_active],
:order => %w[more_recent more_popular more_active alpha_az alpha_za],
:display => %w[compact full map]
}
......
......@@ -12,7 +12,7 @@ include OrganizationHelper
alias_method :requires_email?, :requires_email
SEARCH_FILTERS = {
:order => %w[more_recent more_popular more_active],
:order => %w[more_recent more_popular more_active alpha_az alpha_za],
:display => %w[compact]
}
......
......@@ -8,7 +8,7 @@ class Person < Profile
:following_articles, :editor
SEARCH_FILTERS = {
:order => %w[more_recent more_popular more_active],
:order => %w[more_recent more_popular more_active alpha_az alpha_za],
:display => %w[compact]
}
......
......@@ -29,7 +29,7 @@ class Profile < ApplicationRecord
}
SEARCH_FILTERS = {
:order => %w[more_recent],
:order => %w[more_recent alpha_az alpha_za],
:display => %w[compact]
}
......@@ -282,6 +282,8 @@ class Profile < ApplicationRecord
scope :more_popular, -> { }
scope :more_active, -> { order 'profiles.activities_count DESC' }
scope :more_recent, -> { order "profiles.created_at DESC" }
scope :alpha_az, -> { order "profiles.name ASC" }
scope :alpha_za, -> { order "profiles.name DESC" }
scope :followed_by, -> person{
distinct.select('profiles.*').
......@@ -1111,6 +1113,12 @@ private :generate_url, :url_options
_("Since: ")
end
def alpha_az_label
end
def alpha_za_label
end
def recent_actions
tracked_actions.recent
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment