From 5a38e7618ea8219d86b75ef565702e2147ec7f2b Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sat, 26 Aug 2023 20:47:02 -0500 Subject: [PATCH] Add an edit button to the file manager file viewer. The edit button is only available for text files. Also make the download link on that page a button. --- .../Instructor/FileManager/view.html.ep | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/templates/ContentGenerator/Instructor/FileManager/view.html.ep b/templates/ContentGenerator/Instructor/FileManager/view.html.ep index 55e3c8014a..529044ad96 100644 --- a/templates/ContentGenerator/Instructor/FileManager/view.html.ep +++ b/templates/ContentGenerator/Instructor/FileManager/view.html.ep @@ -3,9 +3,16 @@ % my $fileManagerURL = $c->systemLink(url_for, params => { download => $filename, pwd => $c->{pwd} } ); % % # Include a download link -
+
<%= $name %> - <%= link_to maketext('Download') => $fileManagerURL =%> +
+ <%= link_to maketext('Download') => $fileManagerURL, class => 'btn btn-primary' =%> + % if (-T $file) { + <%= link_to maketext('Edit') => + $c->systemLink(url_for, params => { action => 'Edit', files => [$filename], pwd => $c->{pwd} } ), + class => 'btn btn-primary' =%> + % } +

%