Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 6c50aac

Browse files
Fix order of members on landing page
Move filter to lower location, following UX on job page
1 parent 4ca5829 commit 6c50aac

File tree

4 files changed

+33
-32
lines changed

4 files changed

+33
-32
lines changed

app/controllers/directory/users_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ def index
88
@members = User.open_profile
99
end
1010

11+
@members = @members.order(:first_name, :last_name)
12+
1113
if (user_params.has_key?(:name) && safe_param)
1214
search_letter = "^[" + user_params[:name].downcase + "].*"
1315
@users = @members.where("lower(first_name) ~ ?", search_letter).order(:first_name, :last_name).page(params[:page])

app/views/directory/users/index.html.erb

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,6 @@
2121
<% end %>
2222

2323
<%= directory_letters(params[:name]) %>
24-
25-
<div>
26-
<h4 class="filter-title">Filter all members by</h4>
27-
<%= link_to(directory_users_path(state: 'new_role')) do %>
28-
<%= content_tag(:button, class: display_button_filter_class(params, 'new_role')) do %>
29-
Looking for a new role
30-
<% end %>
31-
<% end %>
32-
33-
<%= link_to(directory_users_path(state: 'freelance')) do %>
34-
<%= content_tag(:button, class: display_button_filter_class(params, 'freelance')) do %>
35-
Available for freelance
36-
<% end %>
37-
<% end %>
38-
39-
<%= link_to(directory_users_path(state: 'mentor')) do %>
40-
<%= content_tag(:button, class: display_button_filter_class(params, 'mentor')) do %>
41-
Available to mentor
42-
<% end %>
43-
<% end %>
44-
45-
<%= link_to(directory_users_path(state: 'mentee')) do %>
46-
<%= content_tag(:button, class: display_button_filter_class(params, 'mentee')) do %>
47-
Looking for a mentor
48-
<% end %>
49-
<% end %>
50-
</div>
5124
</div>
5225
</div>
5326
</div>
@@ -56,8 +29,6 @@
5629

5730
</section><!-- #page-title end -->
5831

59-
<%= content_for :flash %>
60-
6132
<!-- Content
6233
============================================= -->
6334
<section id="content">
@@ -66,6 +37,35 @@
6637

6738
<div class="container clearfix">
6839

40+
<div>
41+
<span>Filter members by</span> &nbsp;
42+
43+
<%= link_to(directory_users_path(state: 'new_role')) do %>
44+
<%= content_tag(:button, class: display_button_filter_class(params, 'new_role')) do %>
45+
Looking for a new role
46+
<% end %>
47+
<% end %>
48+
49+
<%= link_to(directory_users_path(state: 'freelance')) do %>
50+
<%= content_tag(:button, class: display_button_filter_class(params, 'freelance')) do %>
51+
Available for freelance
52+
<% end %>
53+
<% end %>
54+
55+
<%= link_to(directory_users_path(state: 'mentor')) do %>
56+
<%= content_tag(:button, class: display_button_filter_class(params, 'mentor')) do %>
57+
Available to mentor
58+
<% end %>
59+
<% end %>
60+
61+
<%= link_to(directory_users_path(state: 'mentee')) do %>
62+
<%= content_tag(:button, class: display_button_filter_class(params, 'mentee')) do %>
63+
Looking for a mentor
64+
<% end %>
65+
<% end %>
66+
</div>
67+
<br/>
68+
6969
<% if @users.blank? %>
7070

7171
<div class="alert alert-info alert-dismissible" role="alert">
@@ -74,6 +74,7 @@
7474
</div>
7575

7676
<% else %>
77+
7778
<%= render(partial: "list_profiles", locals: {users: @users}) %>
7879

7980
<div class="text-center">

app/views/jobs/index.html.erb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
</section><!-- #page-title end -->
2121

22-
<%= render("shared/flash") %>
23-
2422
<!-- Content
2523
============================================= -->
2624
<section id="content">

spec/requests/directory_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
expect(page).to have_content('Available for freelance')
5353
end
5454

55-
it "should be able to filter based on interest#freelanc" do
55+
it "should be able to filter based on interest#freelance" do
5656
visit(directory_users_path(state: 'freelance'))
5757

5858
expect(page).not_to have_content(user_1.name)

0 commit comments

Comments
 (0)