Extract dashboard posts sort options to a constant (#11123)

This commit is contained in:
Krzysztof Rybka 2020-10-27 21:09:08 +01:00 committed by GitHub
parent d479834344
commit 75fe6fd245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,12 +1,14 @@
module ArticlesHelper
DASHBOARD_POSTS_SORT_OPTIONS = [
["Recently Created", "creation-desc"],
["Recently Published", "published-desc"],
["Most Views", "views-desc"],
["Most Reactions", "reactions-desc"],
["Most Comments", "comments-desc"],
].freeze
def sort_options
[
["Recently Created", "creation-desc"],
["Recently Published", "published-desc"],
["Most Views", "views-desc"],
["Most Reactions", "reactions-desc"],
["Most Comments", "comments-desc"],
]
DASHBOARD_POSTS_SORT_OPTIONS
end
def has_vid?(article)