Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15766 from hellcp-work/files-controller-p3
Move view_file into files controller
- Loading branch information
Showing
26 changed files
with
721 additions
and
1,063 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 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 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 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 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
8 changes: 6 additions & 2 deletions
8
src/api/app/views/webui/packages/files/_breadcrumb_items.html.haml
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
= render partial: 'webui/package/breadcrumb_items' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Add File | ||
- if action_name == 'new' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Add File | ||
- if action_name == 'show' | ||
%li.breadcrumb-item.active.text-word-break-all{ 'aria-current' => 'page' } | ||
= truncate(@filename, length: 50) |
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,30 @@ | ||
- @pagetitle = "File #{truncate(@filename, length: 50)} of Package #{truncate(@package.name, length: 50)}" | ||
- content_for(:content_for_head, javascript_include_tag('webui/cm2/codemirror-file')) | ||
|
||
.card.mb-3 | ||
= render partial: 'webui/package/tabs', locals: { project: @project, package: @package } | ||
.card-body | ||
%h3.text-word-break-all | ||
File #{@filename} of Package #{@package} | ||
- if @rev | ||
(Revision #{@rev}) | ||
- if @rev | ||
%p | ||
Currently displaying revision | ||
%i= @rev | ||
, | ||
= link_to('Show latest', project: @project, package: @package, filename: @filename, expand: @expand) | ||
|
||
- if @addeditlink | ||
- if @filename.ends_with?('.changes') | ||
%p | ||
%a.changes-link{ href: '#', onclick: 'addChangesEntryTemplate(); return false;', | ||
data: { packagername: User.session!.realname, packageremail: User.session!.email } } | ||
Insert changes entry template | ||
|
||
-# TODO: Provide a comments field through a callback | ||
= render(partial: 'webui/shared/editor', locals: { text: @file, mode: guess_code_class(@filename), | ||
save: { url: project_package_file_path(@project, @package, @filename), method: :put, | ||
data: { project: @project.name, package: @package.name, submit: 'file', comment: '', filename: @filename, rev: @rev } } }) | ||
- else | ||
= render(partial: 'webui/shared/editor', locals: { text: @file, mode: guess_code_class(@filename), style: { read_only: true } }) |
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,7 @@ | ||
- @pagetitle = "File #{@filename} of Package #{@package}" | ||
|
||
.card.mb-3 | ||
= render partial: 'webui/package/tabs', locals: { project: @project, package: @package } | ||
.card-body | ||
%h3= @pagetitle | ||
%pre.border.border-dotted.bg-body-secondary.p-2.mb-0= force_utf8_and_transform_nonprintables(@file) |
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
Oops, something went wrong.