summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-02-06 12:19:00 +0000
committerFilipa Lacerda <filipa@gitlab.com>2019-02-06 12:19:00 +0000
commit5bfa8e2f5e03849645570ba8c2dbfcc5c834f1b1 (patch)
treeb8a5f15796039af3f659f74cbc131c401818be9b /app/helpers
parent3b4c4095bbda55ae0b4d32f9b17c0e4f03c5ceed (diff)
parentd279cc94088fddd6f6bb2847e456bbf68ae616ea (diff)
downloadgitlab-ce-5bfa8e2f5e03849645570ba8c2dbfcc5c834f1b1.tar.gz
Merge branch '43681-display-last-activity-and-created-at-datetimes-for-users-in-admin-users' into 'master'
Resolve "Display last activity and created at datetimes for users" Closes #43681 See merge request gitlab-org/gitlab-ce!24181
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/sorting_helper.rb20
-rw-r--r--app/helpers/users_helper.rb9
2 files changed, 28 insertions, 1 deletions
diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb
index 02762897c89..07ec129dea3 100644
--- a/app/helpers/sorting_helper.rb
+++ b/app/helpers/sorting_helper.rb
@@ -128,7 +128,9 @@ module SortingHelper
sort_value_recently_created => sort_title_recently_created,
sort_value_oldest_created => sort_title_oldest_created,
sort_value_recently_updated => sort_title_recently_updated,
- sort_value_oldest_updated => sort_title_oldest_updated
+ sort_value_oldest_updated => sort_title_oldest_updated,
+ sort_value_recently_last_activity => sort_title_recently_last_activity,
+ sort_value_oldest_last_activity => sort_title_oldest_last_activity
}
end
@@ -317,6 +319,14 @@ module SortingHelper
s_('SortOptions|Most stars')
end
+ def sort_title_oldest_last_activity
+ s_('SortOptions|Oldest last activity')
+ end
+
+ def sort_title_recently_last_activity
+ s_('SortOptions|Recent last activity')
+ end
+
# Values.
def sort_value_access_level_asc
'access_level_asc'
@@ -445,4 +455,12 @@ module SortingHelper
def sort_value_most_stars
'stars_desc'
end
+
+ def sort_value_oldest_last_activity
+ 'last_activity_on_asc'
+ end
+
+ def sort_value_recently_last_activity
+ 'last_activity_on_desc'
+ end
end
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 73c1402eae5..73ca17c6605 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -74,6 +74,15 @@ module UsersHelper
Gitlab.config.gitlab.impersonation_enabled
end
+ def user_badges_in_admin_section(user)
+ [].tap do |badges|
+ badges << { text: s_('AdminUsers|Blocked'), variant: 'danger' } if user.blocked?
+ badges << { text: s_('AdminUsers|Admin'), variant: 'success' } if user.admin?
+ badges << { text: s_('AdminUsers|External'), variant: 'secondary' } if user.external?
+ badges << { text: s_("AdminUsers|It's you!"), variant: nil } if current_user == user
+ end
+ end
+
private
def get_profile_tabs