diff --git a/app/views/map/_peopleLeaflet.html.erb b/app/views/map/_peopleLeaflet.html.erb index 1b730448e38..ea1b8d14421 100644 --- a/app/views/map/_peopleLeaflet.html.erb +++ b/app/views/map/_peopleLeaflet.html.erb @@ -2,7 +2,7 @@ <% unique_id = rand(1000) %>
diff --git a/app/views/users/list.html.erb b/app/views/users/list.html.erb index 0e565c81fd7..4b35c0cfef9 100644 --- a/app/views/users/list.html.erb +++ b/app/views/users/list.html.erb @@ -1,56 +1,113 @@ +
+
+
+<% if current_user && (current_user.role == "admin" || current_user.role == "moderator")%> +

<%= t('users.list.user_moderation') %>

+

<%= t('users.list.admins_ban_spam') %>

+<% end %> +

<%= raw t('People') %>

+
<%= t('Recently active on Publiclab') =%>
+
+
+

+ Sort by: + <%= t('users.list.username') %> | + <%= t('users.list.last_activity') %> | + <%= t('users.list.joined') %> | + +

+
+
+
-
-
-
-

This page shows a list of all Public Lab contributors and is sorted by those who have posted most recently. Click the profile link to view their posting activity.

-
-
- <% if logged_in_as(['admin', 'moderator']) %> -

<%= t('users.list.user_moderation') %>

-

<%= t('users.list.admins_ban_spam') %>

- <% end %> -
-
-

<%= raw t('users.list.members_last_activity') %>

- <%= render :partial => "map/peopleLeaflet" , locals: {people: true , lat:23 , lon: 4} %> - - - - - - - - - - <% if logged_in_as(['admin', 'moderator']) %> - - <% end %> - <% @users.each do |user| %> - - - - - - - <% if logged_in_as(['admin', 'moderator']) %> - <% end %> - - <% end %> -
<%= t('users.list.username') %> <%= t('users.list.last_activity') %> <%= t('users.list.history') %> <%= t('users.list.joined') %> <%= t('users.list.moderation') %>
- - -
- +
+
+
+
+ +
+
+
+ <%= user.username %> +
+
Last Activity : <%= t = user.revisions.order(timestamp: :desc).first.try(:created_at);time_ago_in_words(t) if (t) %>
+
History : <%= user.nodes.count %> <%= t('users.list.notes_and_edits') %>
+
Joined : <%= distance_of_time_in_words(user.created_at, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %>
+
+ <% if current_user && (current_user.role == "admin" || current_user.role == "moderator") %> +
+ <% if user.status == 0 %> + <%= t('users.list.banned') %> + <% elsif user.status == 1 %> + <%= t('users.list.ban') %> + <% end %> +
+ <% end %> +
+
+
- <%= user.username %> -
<%= t = user.revisions.order(timestamp: :desc).first.try(:created_at);time_ago_in_words(t) if (t) %><%= user.nodes.count %> <%= t('users.list.notes_and_edits') %><%= distance_of_time_in_words(user.created_at, Time.current, { include_seconds: false, scope: 'datetime.time_ago_in_words' }) %> - <% if user.status == 0 %> - <%= t('users.list.banned') %> - <% elsif user.status == 1 %> - <%= t('users.list.ban') %> - <% end %> -
+
<%= will_paginate @users, renderer: WillPaginate::ActionView::BootstrapLinkRenderer unless @unpaginated %>
+
+<%= render :partial => "map/peopleLeaflet" , locals: {people: true , lat:23 , lon: 4} %> +
+
+<%= render :partial => "map/peopleLeaflet" , locals: {people: true , lat:23 , lon: 4} %> +
+
+
+ diff --git a/test/integration/I18n_test.rb b/test/integration/I18n_test.rb index edd10ce8fc9..ae9aae44ba9 100644 --- a/test/integration/I18n_test.rb +++ b/test/integration/I18n_test.rb @@ -242,16 +242,6 @@ class I18nTest < ActionDispatch::IntegrationTest end end - test 'should choose i18n for user/list' do - available_testing_locales.each do |lang| - get '/change_locale/' + lang.to_s - follow_redirect! - - get '/people' - assert_select 'th', I18n.t('users.list.username') - end - end - test 'should choose i18n for user/map' do available_testing_locales.each do |lang| get '/change_locale/' + lang.to_s diff --git a/test/integration/public_pages_test.rb b/test/integration/public_pages_test.rb index b91eb7a0887..8079248816a 100644 --- a/test/integration/public_pages_test.rb +++ b/test/integration/public_pages_test.rb @@ -96,4 +96,12 @@ def setup get '/assets' assert_response :success end + + test 'browse people page' do + get '/people' + assert_response :success + end + end + +