-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default to contents for project show page (#1127)
* Switched the show page to show the contents and the metadata to be the details page * Adjusted test to new logic * Adjust the tests to the new logic * Adjusted a few more tests * Adjusted a few more tests to account for the new logic
- Loading branch information
1 parent
c162d8e
commit 20a08f1
Showing
12 changed files
with
215 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<%= render partial: "project_details_heading" %> | ||
|
||
<show id="show"> | ||
<% unless @project.in_mediaflux? %> | ||
<div class="pending-project"> | ||
Your new project request is in the queue. Please allow 5 business days for our team to review your needs and set everything up. For assistance, please contact [email protected]. | ||
</div> | ||
<% end %> | ||
|
||
<div id="project-nav"> | ||
<button id="project-content" class="tab-nav"> Content Preview </button> | ||
<button id="project-details" class="tab-nav"> Details </button> | ||
<button id="project-script" class="tab-nav"> View Create Script </button> | ||
<button id="project-approval" class="tab-nav"> Approval Setting </button> | ||
</div> | ||
|
||
<div class="details"> | ||
<h2>Roles | ||
<%# Per ticket #1114 only superusers have edit access %> | ||
<% if @project_eligible_to_edit && current_user.superuser || current_user.sysadmin %> | ||
<%= link_to "Edit", edit_project_path(@project.id), id:"revisible-heading", class: "btn btn-primary btn-sm" %> | ||
<% end %> | ||
</h2> | ||
<dl> | ||
<% if !@data_sponsor.nil? %> | ||
<dt>Data Sponsor</dt> | ||
<dd id="data_sponsor"> | ||
<%= @data_sponsor.display_name_safe %> | ||
</dd> | ||
<% end %> | ||
<% if !@data_manager.nil? %> | ||
<dt>Data Manager</dt> | ||
<dd id="data_manager"> | ||
<%= @data_manager.display_name_safe %> | ||
</dd> | ||
<% end %> | ||
|
||
<dt>Data Users</dt> | ||
<% if @data_users.present? %> | ||
<dd> | ||
<%= @data_user_names %> | ||
</dd> | ||
<% else %> | ||
<dd> | ||
<p>None</p> | ||
</dd> | ||
<% end %> | ||
</dl> | ||
</div> | ||
|
||
<div class="details"> | ||
<h2>Project Description | ||
<%# Per ticket #1114 only superusers have edit access %> | ||
<% if @project_eligible_to_edit && current_user.superuser %> | ||
<%= link_to "Edit", edit_project_path(@project.id), id:"revisible-heading", class: "btn btn-primary btn-sm" %> | ||
<% end %> | ||
</h2> | ||
<dl> | ||
<dt>Departments</dt> | ||
<% if @departments.empty? %> | ||
<dd><strong class="px-0">None</strong></dd> | ||
<% else %> | ||
<dd> | ||
<% @project.project.metadata_json["departments"].each do |department_code| %> | ||
<% Affiliation.all.each do |hash| %> | ||
<% if hash[:code] == department_code %> | ||
<%= hash[:name] %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</dd> | ||
<% end %> | ||
<dt>Project Directory</dt> | ||
<dd><%= @project.project_directory %></dd> | ||
<dt>Title</dt> | ||
<dd><%= @project.title %></dd> | ||
<dt>Description:<dt/> <dd><%= @project.description %></dd> | ||
</dl> | ||
</div> | ||
|
||
<div class="details"> | ||
<%= if @project.pending? | ||
render partial: "pending_details" | ||
else | ||
render partial: "approved_details" | ||
end %> | ||
</div> | ||
|
||
<div class="details"> | ||
<h2> Provenance </h2> | ||
<p class="provenance-header"> Submission </p> | ||
<ul class> | ||
<% @provenance_events.each do |event| %> | ||
<li class="provenance"> <%= event.event_details %>, <%=event.created_at.to_time.in_time_zone("America/New_York").iso8601%> </li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
|
||
<div class="details"> | ||
<% if current_user.eligible_sysadmin? %> | ||
<% if @project.pending? %> | ||
<%= link_to "Approve Project", project_approve_path(@project.id), class: "btn btn-primary btn-sm" %> | ||
<%= link_to " View Create Script", "#", class: "bi bi-code btn btn-secondary btn-sm", id: "create-script-btn" %> | ||
<% end %> | ||
<% end %> | ||
</div> | ||
|
||
<!-- this div is populated by the AJAX below --> | ||
<div id="create-script-text"></div> | ||
</show> | ||
|
||
<script type="module"> | ||
// Make the AJAX call to fetch the aterm script | ||
showCreateScript('<%= project_create_script_path(format: "json") %>'); | ||
projectStyle('<%= @project_session %>'); | ||
projectTab("<%= project_path %>", "<%= project_details_path %>"); | ||
</script> |
Oops, something went wrong.