Skip to content

Commit 9c15c55

Browse files
committed
Improve navigability for user names
1 parent 1b70e2b commit 9c15c55

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

app/controllers/names_controller.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def autocomplete
5353
# GET /names
5454
# GET /names.json
5555
def index(opts = {})
56-
return user if params[:status] == 'user' && opts == {}
56+
return user if params[:user].present? && opts == {}
5757
@submitted ||= false
5858
@endorsed ||= false
5959
@draft ||= false
@@ -115,13 +115,14 @@ def type_genomes
115115
end
116116

117117
# GET /names/user
118+
# GET /names/user?user=abc
118119
def user
119120
user = current_user
120121
if params[:user] && current_user.admin?
121122
user = User.find_by(username: params[:user])
122123
end
123124
@title = "Names by #{user.username}"
124-
@status = 'user'
125+
@status = 'all'
125126
index(where: { created_by: user })
126127
render(:index)
127128
end

app/views/names/edit_type.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
container.hide();
7979
$('#name_genome_strain').val('');
8080
acc_label.html('Text');
81-
acc_hint.html('Describe in full the type material');
81+
acc_hint.html('Describe the type material in full');
8282
} else {
8383
container.hide();
8484
$('#name_genome_strain').val('');

app/views/names/index.html.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
<%
2+
npar = { status: @status }
3+
npar[:user] = params[:user] if params[:user].present?
4+
%>
15
<%= download_buttons(
2-
[[names_url(format: :json, status: @status), 'file-code', 'JSON']]
6+
[[names_url(npar.merge(format: :json), 'file-code', 'JSON']]
37
) %>
48

59
<h1>

0 commit comments

Comments
 (0)