|
1 | 1 | # frozen_string_literal: true |
2 | 2 | class ProjectsController < ApplicationController |
| 3 | + |
| 4 | + before_action :set_breadcrumbs |
| 5 | + |
3 | 6 | def new |
| 7 | + add_breadcrumb("New Project Request") |
4 | 8 | return build_new_project if current_user.eligible_sponsor? |
5 | 9 |
|
6 | 10 | redirect_to root_path |
@@ -67,6 +71,8 @@ def create |
67 | 71 | end |
68 | 72 |
|
69 | 73 | def show |
| 74 | + add_breadcrumb(project.title, project_path) |
| 75 | + add_breadcrumb("Details") |
70 | 76 | project |
71 | 77 | @departments = project.departments.join(", ") |
72 | 78 | @project_metadata = project.metadata_model |
@@ -122,6 +128,8 @@ def show |
122 | 128 | end |
123 | 129 |
|
124 | 130 | def edit |
| 131 | + add_breadcrumb(project.title, project_path) |
| 132 | + add_breadcrumb("Edit") |
125 | 133 | project |
126 | 134 | if project.metadata_model.status != Project::APPROVED_STATUS |
127 | 135 | flash[:notice] = "Pending projects can not be edited." |
@@ -164,6 +172,8 @@ def confirmation; end |
164 | 172 | def revision_confirmation; end |
165 | 173 |
|
166 | 174 | def contents |
| 175 | + add_breadcrumb(project.title, project_path) |
| 176 | + add_breadcrumb("Contents", project_contents_path) |
167 | 177 | project |
168 | 178 |
|
169 | 179 | @storage_usage = project.storage_usage(session_id: current_user.mediaflux_session) |
@@ -208,6 +218,9 @@ def file_list_download |
208 | 218 |
|
209 | 219 | def approve |
210 | 220 | if current_user.eligible_sysadmin? |
| 221 | + add_breadcrumb(project.title, project_path) |
| 222 | + add_breadcrumb("Approval Settings", project_approve_path) |
| 223 | + add_breadcrumb("Edit") |
211 | 224 | project |
212 | 225 | @departments = project.departments.join(", ") |
213 | 226 | @project_metadata = project.metadata |
@@ -248,4 +261,8 @@ def shared_file_location(filename) |
248 | 261 | location = Pathname.new(Rails.configuration.mediaflux["shared_files_location"]) |
249 | 262 | location.join(filename).to_s |
250 | 263 | end |
| 264 | + |
| 265 | + def set_breadcrumbs |
| 266 | + add_breadcrumb("Dashboard","/") |
| 267 | + end |
251 | 268 | end |
0 commit comments