Skip to content

Commit

Permalink
Moving file manager to manage course (#2154)
Browse files Browse the repository at this point in the history
* File manager moved to manage course

* Index directly into folder of course

* Erblint

* Shorten path name

* Shortened names of other routes
  • Loading branch information
KesterTan committed May 4, 2024
1 parent f554808 commit ba32ae1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/controllers/file_manager_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def populate_directory(current_directory, current_url)
rescue StandardError
'-'
end,
relative: CGI.unescape("/file_manager/#{new_url}#{file}"),
relative: "/file_manager/#{new_url}#{file}",
entry: "#{file}#{is_file ? '' : '/'}",
absolute: abs_path_str,
instructor: inst,
Expand Down
3 changes: 3 additions & 0 deletions app/views/courses/manage.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
<%= link_to "Export course", export_course_path(@course),
{ title: "Export course configurations and assessments" } %>
</li>
<li>
<%= link_to "File Manager", path_file_manager_index_path(@course.name), { title: "File manager" } %>
</li>

<li class="collection-item red-text danger-bottom no-hover"><h4>Danger Zone</h4></li>
<li class="danger-side">
Expand Down
4 changes: 0 additions & 4 deletions app/views/layouts/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@

<li role="presentation"><%= link_to "Clear Cache", clear_cache_admin_url,
title: "Clear Cache", data: { method: "post" } %></li>

<li role="presentation"><%= link_to "File Manager", file_manager_index_path, title: "File manager" %></li>
</ul>
<% end %>
Expand All @@ -83,8 +81,6 @@
<li role="presentation"><%= link_to "Configure Autolab", autolab_config_admin_path, title: "Configure Autolab settings" %></li>

<li role="presentation"><%= link_to "Clear Cache", clear_cache_admin_url, title: "Clear Cache", data: { method: "post" } %></li>

<li role="presentation"><%= link_to "File Manager", file_manager_index_path, title: "File manager" %></li>
</ul>
<% end %>

Expand Down
8 changes: 4 additions & 4 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
post 'upload', to: 'file_manager#upload'
post '/', to: 'file_manager#upload'
post 'download_tar', to: 'file_manager#download_tar'
get ':path', to: 'file_manager#index', constraints: { path: /.+/ }, as: :path_file_manager
put ':path', to: 'file_manager#rename', constraints: { path: /.+/ }, as: :rename_file_manager
post ':path', to: 'file_manager#upload', constraints: { path: /.+/ }, as: :upload_file_manager
delete ':path', to: 'file_manager#delete', constraints: { path: /.+/ }, as: :delete_file_manager
get ':path', to: 'file_manager#index', constraints: { path: /.+/ }, as: :path
put ':path', to: 'file_manager#rename', constraints: { path: /.+/ }, as: :rename
post ':path', to: 'file_manager#upload', constraints: { path: /.+/ }, as: :upload_path
delete ':path', to: 'file_manager#delete', constraints: { path: /.+/ }, as: :delete
end
end

Expand Down
2 changes: 1 addition & 1 deletion docs/instructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ Displays files within a course and allows you to rename, delete, and add files a

You can view all courses that you are an instructor of and all associated files.

You can access the File Manager via the Manage Autolab dropdown.
You can access the File Manager under Admin Course after clicking Manage Course.

Note:

Expand Down

0 comments on commit ba32ae1

Please sign in to comment.