Skip to content

Commit a956ce8

Browse files
committed
Reorganize dashboard
1 parent 2dea72b commit a956ce8

10 files changed

Lines changed: 237 additions & 282 deletions

File tree

app/controllers/names_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def observing
134134
end
135135
@title = 'Names with active alerts'
136136
@status = 'user'
137-
@names = user.observing_names.reverse
137+
@names = user.observing_names.reverse_order
138138
index
139139
render(:index)
140140
end

app/views/devise/registrations/edit.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
Personal information
1919
</h4>
2020
<%= f.input :email, required: true, autofocus: true %>
21-
<%= f.input :family, label: 'Family name',
22-
input_html: { autocomplete: 'lastname' } %>
2321
<%= f.input :given, label: 'Given name',
2422
input_html: { autocomplete: 'firstname' } %>
23+
<%= f.input :family, label: 'Family name',
24+
input_html: { autocomplete: 'lastname' } %>
2525
<%= f.input :affiliation,
2626
input_html: { autocomplete: 'affiliation' } %>
2727
<br/><hr/><br/>

app/views/users/_about.html.erb

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
<div class="card">
2-
<div class="card-header py-2">
3-
<h1>About</h1>
4-
</div>
5-
<div class="card-body">
6-
<p>
7-
<b>Username:</b> <%= current_user.username %><br/>
8-
<b>Full name:</b> <%= current_user.full_name %><br/>
9-
<b>Affiliation:</b> <%= current_user.affiliation %><br/>
10-
<b>Registered:</b> <%= current_user.created_at.strftime('%B %e, %Y') %>
11-
<br/>
12-
<b>Roles:</b> <%= current_user.roles.to_sentence %><br/>
13-
</p>
14-
</div>
15-
</div>
1+
<h2>About</h2>
2+
<p>
3+
<b>Username:</b> <%= current_user.username %><br/>
4+
<b>Full name:</b> <%= current_user.full_name %><br/>
5+
<b>Affiliation:</b> <%= current_user.affiliation %><br/>
6+
<b>Registered:</b> <%= current_user.created_at.strftime('%B %e, %Y') %>
7+
<br/>
8+
<b>Roles:</b> <%= current_user.roles.to_sentence %><br/>
9+
</p>

app/views/users/_actions.html.erb

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,35 @@
1-
<div class="card h-100">
2-
<div class="card-header py-2">
3-
<h1>Actions</h1>
4-
</div>
5-
<div class="card-body">
6-
<ul class="nav flex-column">
7-
<li class="nav-item">
8-
<%= link_to(edit_user_registration_path, class: 'nav-link') do %>
9-
<%= fa_icon('user-cog') %>
10-
Edit profile information and settings
11-
<% end %>
12-
</li>
13-
<% unless current_contributor? %>
14-
<li class="nav-item">
15-
<%= link_to(contributor_request_path, class: 'nav-link') do %>
16-
<%= fa_icon('user-check') %>
17-
Request contributor status
18-
<% end %>
19-
</li>
1+
<h2>Actions</h2>
2+
<ul class="nav flex-column">
3+
<li class="nav-item">
4+
<%= link_to(edit_user_registration_path, class: 'nav-link') do %>
5+
<%= fa_icon('user-cog') %>
6+
Edit profile information and settings
7+
<% end %>
8+
</li>
9+
<% unless current_contributor? %>
10+
<li class="nav-item">
11+
<%= link_to(contributor_request_path, class: 'nav-link') do %>
12+
<%= fa_icon('user-plus') %>
13+
Request contributor status
2014
<% end %>
21-
<% unless current_curator? %>
22-
<li class="nav-item">
23-
<%= link_to(curator_request_path, class: 'nav-link') do %>
24-
<%= fa_icon('user-astronaut') %> Request curator status
25-
<% end %>
26-
</li>
15+
</li>
16+
<% end %>
17+
<% unless current_curator? %>
18+
<li class="nav-item">
19+
<%= link_to(curator_request_path, class: 'nav-link') do %>
20+
<%= fa_icon('user-check') %> Request curator status
2721
<% end %>
28-
<% if false # Do not include this option for now %>
29-
<li class='nav-item'>
30-
<%= link_to(
31-
user_registration_path,
32-
data: { confirm: 'Are you sure?' },
33-
method: :delete, class: 'nav-link '
34-
) do %>
35-
<%= fa_icon('user-minus') %> Remove my account
36-
<% end %>
37-
</li>
22+
</li>
23+
<% end %>
24+
<% if false # Do not include this option for now %>
25+
<li class='nav-item'>
26+
<%= link_to(
27+
user_registration_path,
28+
data: { confirm: 'Are you sure?' },
29+
method: :delete, class: 'nav-link '
30+
) do %>
31+
<%= fa_icon('user-minus') %> Remove my account
3832
<% end %>
39-
</ul>
40-
</div>
41-
</div>
33+
</li>
34+
<% end %>
35+
</ul>

app/views/users/_admin.html.erb

Lines changed: 58 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,63 @@
11
<% if current_admin? %>
2-
<div class="col-12 my-3">
3-
<div class="card">
4-
<div class="card-header p-0">
5-
<%= link_to('#admin-dashboard',
6-
class: 'btn btn-light w-100 text-left m-0 px-4 py-2',
7-
aria: { expanded: 'false', controls: 'admin-dashboard' },
8-
role: 'button', data: { toggle: 'collapse' }) do %>
9-
<h1>Administrator Dashboard</h1>
10-
<% end %>
11-
</div>
12-
<div class="card-body collapse show" id="admin-dashboard">
13-
<h2>Contributor applications</h2>
14-
<% if @contributor_applications.empty? %>
15-
None pending
16-
<% else %>
17-
<ul class="nav flex-column">
18-
<% @contributor_applications.each do |u| %>
19-
<li class="nav-item">
20-
<b><%= link_to u.username, u %></b>:
21-
<%= u.contributor_statement %>
22-
<br/>
23-
<%= link_to contributor_grant_path(u), method: :post,
24-
class: 'btn text-info btn-sm',
25-
data: { confirm: 'Are you sure?' } do %>
26-
<%= fa_icon 'check-circle' %> Grant
27-
<% end %>
28-
<%= link_to contributor_deny_path(u), method: :post,
29-
class: 'btn text-danger btn-sm',
30-
data: { confirm: 'Are you sure?' } do %>
31-
<%= fa_icon 'ban' %> Deny
32-
<% end %>
33-
</li>
34-
<% end %>
35-
</ul>
36-
<% end %>
37-
38-
<hr/>
39-
<h2>Curator applications</h2>
40-
<% if @curator_applications.empty? %>
41-
None pending
42-
<% else %>
43-
<ul class="nav flex-column">
44-
<% @curator_applications.each do |u| %>
45-
<li class="nav-item">
46-
<b><%= link_to u.username, u %></b>:
47-
<%= u.curator_statement %>
48-
<br/>
49-
<%= link_to curator_grant_path(u), method: :post,
50-
class: 'btn text-info btn-sm',
51-
data: { confirm: 'Are you sure?' } do %>
52-
<%= fa_icon 'check-circle' %> Grant
53-
<% end %>
54-
<%= link_to curator_deny_path(u), method: :post,
55-
class: 'btn text-danger btn-sm',
56-
data: { confirm: 'Are you sure?' } do %>
57-
<%= fa_icon 'ban' %> Deny
58-
<% end %>
59-
</li>
60-
<% end %>
61-
</ul>
62-
<% end %>
2+
<h2>Contributor applications</h2>
3+
<% if @contributor_applications.empty? %>
4+
None pending
5+
<% else %>
6+
<ul class="nav flex-column">
7+
<% @contributor_applications.each do |u| %>
8+
<li class="nav-item">
9+
<b><%= link_to u.username, u %></b>:
10+
<%= u.contributor_statement %>
11+
<br/>
12+
<%= link_to contributor_grant_path(u), method: :post,
13+
class: 'btn text-info btn-sm',
14+
data: { confirm: 'Are you sure?' } do %>
15+
<%= fa_icon 'check-circle' %> Grant
16+
<% end %>
17+
<%= link_to contributor_deny_path(u), method: :post,
18+
class: 'btn text-danger btn-sm',
19+
data: { confirm: 'Are you sure?' } do %>
20+
<%= fa_icon 'ban' %> Deny
21+
<% end %>
22+
</li>
23+
<% end %>
24+
</ul>
25+
<% end %>
6326

64-
<hr/>
65-
<h2>Actions</h2>
27+
<hr/>
28+
<h2>Curator applications</h2>
29+
<% if @curator_applications.empty? %>
30+
None pending
31+
<% else %>
6632
<ul class="nav flex-column">
67-
<li class="nav-item">
68-
<%= link_to(users_path) do %>
69-
<%= fa_icon('users') %>
70-
See all registered users
71-
<% end %>
72-
</li>
33+
<% @curator_applications.each do |u| %>
34+
<li class="nav-item">
35+
<b><%= link_to u.username, u %></b>:
36+
<%= u.curator_statement %>
37+
<br/>
38+
<%= link_to curator_grant_path(u), method: :post,
39+
class: 'btn text-info btn-sm',
40+
data: { confirm: 'Are you sure?' } do %>
41+
<%= fa_icon 'check-circle' %> Grant
42+
<% end %>
43+
<%= link_to curator_deny_path(u), method: :post,
44+
class: 'btn text-danger btn-sm',
45+
data: { confirm: 'Are you sure?' } do %>
46+
<%= fa_icon 'ban' %> Deny
47+
<% end %>
48+
</li>
49+
<% end %>
7350
</ul>
74-
</div>
75-
</div>
76-
</div>
51+
<% end %>
52+
53+
<hr/>
54+
<h2>Actions</h2>
55+
<ul class="nav flex-column">
56+
<li class="nav-item">
57+
<%= link_to(users_path) do %>
58+
<%= fa_icon('users') %>
59+
See all registered users
60+
<% end %>
61+
</li>
62+
</ul>
7763
<% end %>
Lines changed: 51 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,53 @@
11
<% if current_contributor? %>
2-
<div class="col-12 my-3">
3-
<div class="card">
4-
<div class="card-header p-0">
5-
<%= link_to('#contributor-dashboard',
6-
class: 'btn btn-light w-100 text-left m-0 px-4 py-2',
7-
aria: { expanded: 'false', controls: 'contributor-dashboard' },
8-
role: 'button', data: { toggle: 'collapse' }) do %>
9-
<h1>Contributor Dashboard</h1>
10-
<% end %>
11-
</div>
12-
<div class="card-body collapse show" id="contributor-dashboard">
13-
<ul class="nav flex-column">
14-
<li class="nav-item">
15-
<%= link_to(user_names_path) do %>
16-
<%= fa_icon('list-alt') %>
17-
My names
18-
<% end %>
19-
</li>
20-
<li class="nav-item">
21-
<%= link_to(registers_path(status: :user)) do %>
22-
<%= fa_icon('list-alt') %>
23-
My register lists
24-
<% end %>
25-
</li>
26-
<li class="nav-item">
27-
<%= link_to(observing_names_path) do %>
28-
<%= fa_icon('bell') %>
29-
Names with active email alerts
30-
<% end %>
31-
</li>
32-
<li class="nav-item">
33-
<%= link_to(registers_path(status: :observing)) do %>
34-
<%= fa_icon('bell') %>
35-
Register lists with active email alerts
36-
<% end %>
37-
</li>
38-
<li class="nav-item">
39-
<%= link_to(new_name_path) do %>
40-
<%= fa_icon('plus-circle') %>
41-
Register a name
42-
<% end %>
43-
</li>
44-
<li class="nav-item">
45-
<%= link_to(tutorials_url(pipeline: :lineage), method: :post) do %>
46-
<%= fa_icon('plus-circle') %>
47-
Register names by lineage
48-
<% end %>
49-
</li>
50-
<li class="nav-item">
51-
<%= link_to(tutorials_url(pipeline: :batch), method: :post) do %>
52-
<%= fa_icon('plus-circle') %>
53-
Register names in batch
54-
<% end %>
55-
</li>
56-
<li class="nav-item">
57-
<%= link_to(new_publication_path) do %>
58-
<%= fa_icon('plus-circle') %>
59-
Register publication
60-
<% end %>
61-
</li>
62-
</ul>
63-
</div>
64-
</div>
65-
</div>
2+
<h2>Actions</h2>
3+
<ul class="nav flex-column">
4+
<li class="nav-item">
5+
<%= link_to(user_names_path) do %>
6+
<%= fa_icon('list-alt') %>
7+
My names
8+
<% end %>
9+
</li>
10+
<li class="nav-item">
11+
<%= link_to(registers_path(status: :user)) do %>
12+
<%= fa_icon('list-alt') %>
13+
My register lists
14+
<% end %>
15+
</li>
16+
<li class="nav-item">
17+
<%= link_to(observing_names_path) do %>
18+
<%= fa_icon('bell') %>
19+
Names with active email alerts
20+
<% end %>
21+
</li>
22+
<li class="nav-item">
23+
<%= link_to(registers_path(status: :observing)) do %>
24+
<%= fa_icon('bell') %>
25+
Register lists with active email alerts
26+
<% end %>
27+
</li>
28+
<li class="nav-item">
29+
<%= link_to(new_name_path) do %>
30+
<%= fa_icon('plus-circle') %>
31+
Register a name
32+
<% end %>
33+
</li>
34+
<li class="nav-item">
35+
<%= link_to(tutorials_url(pipeline: :lineage), method: :post) do %>
36+
<%= fa_icon('plus-circle') %>
37+
Register names by lineage
38+
<% end %>
39+
</li>
40+
<li class="nav-item">
41+
<%= link_to(tutorials_url(pipeline: :batch), method: :post) do %>
42+
<%= fa_icon('plus-circle') %>
43+
Register names in batch
44+
<% end %>
45+
</li>
46+
<li class="nav-item">
47+
<%= link_to(new_publication_path) do %>
48+
<%= fa_icon('plus-circle') %>
49+
Register publication
50+
<% end %>
51+
</li>
52+
</ul>
6653
<% end %>

0 commit comments

Comments
 (0)