Skip to content

Commit f7c1fe3

Browse files
authored
allowing system administrators to edit the approve form (#992)
1 parent fef55bb commit f7c1fe3

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

app/views/projects/_approved_details.html.erb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11

2-
<h2>Project Settings</h2>
2+
<h2>Project Settings
3+
<% if current_user.eligible_sysadmin? %>
4+
<%= link_to "Edit", project_approve_path(@project.id), id:"revisible-heading", class: "btn btn-primary btn-sm" %>
5+
<% end %>
6+
</h2>
37
<dl>
48
<dt>Project ID</dt><dd id="project_id"><%= @project_id %></dd>
59
<dt>Storage Capacity</dt>

app/views/projects/show.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Project Details:
2424

2525
<div class="details">
2626
<h2>Roles
27-
<% if @project_eligible_to_edit %>
27+
<% if @project_eligible_to_edit && current_user.eligible_sponsor? %>
2828
<%= link_to "Edit", edit_project_path(@project.id), id:"revisible-heading", class: "btn btn-primary btn-sm" %>
2929
<% end %>
3030
</h2>
@@ -57,7 +57,7 @@ Project Details:
5757

5858
<div class="details">
5959
<h2>Project Description
60-
<% if @project_eligible_to_edit %>
60+
<% if @project_eligible_to_edit && current_user.eligible_sponsor? %>
6161
<%= link_to "Edit", edit_project_path(@project.id), id:"revisible-heading", class: "btn btn-primary btn-sm" %>
6262
<% end %>
6363
</h2>

spec/system/project_show_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
project_in_mediaflux.save!
6969
visit "/projects/#{project_in_mediaflux.id}"
7070

71-
expect(page).not_to have_selector(:link_or_button, "Edit") # button next to role and description heading
71+
expect(page).to have_selector(:link_or_button, "Edit") # button next to project settings
7272
expect(page).to have_selector(:link_or_button, "Review Contents")
7373
expect(page).not_to have_selector(:link_or_button, "Withdraw Project Request")
7474
expect(page).to have_selector(:link_or_button, "Return to Dashboard")

0 commit comments

Comments
 (0)