-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b839212
commit 5ee011c
Showing
7 changed files
with
133 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
.blame { | ||
display: grid; | ||
grid-template-columns: [time] max-content [user] 20px [commit] max-content [button] min-content [line] min-content [content] auto; | ||
column-gap: 1rem; | ||
.revision { | ||
display: grid; | ||
grid-template-columns: subgrid; | ||
grid-column: time / span 6; | ||
border-bottom: var(--bs-border-width) solid var(--bs-border-color); | ||
.info { | ||
display: grid; | ||
grid-template-columns: subgrid; | ||
grid-column: time / span 4; | ||
.time { | ||
grid-column-start: time; | ||
} | ||
.user { | ||
grid-column-start: user; | ||
} | ||
.commit { | ||
grid-column-start: commit; | ||
max-width: 200px; | ||
} | ||
.button { | ||
grid-column-start: button; | ||
} | ||
} | ||
.code { | ||
display: grid; | ||
grid-template-columns: subgrid; | ||
grid-column: line / span 2; | ||
font-family: monospace; | ||
white-space: pre; | ||
text-wrap: wrap; | ||
.number { | ||
grid-column-start: line; | ||
text-align: end; | ||
user-select: none; | ||
} | ||
.content { | ||
grid-column-start: content; | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
- @pagetitle = "Blame #{truncate(@filename, length: 50)} of Package #{truncate(@package.name, length: 50)}" | ||
|
||
.card.mb-3 | ||
= render partial: 'webui/package/tabs', locals: { project: @project, package: @package } | ||
.card-body | ||
%h3.text-word-break-all | ||
Blame #{@filename} of Package #{@package} | ||
- if @rev | ||
(Revision #{@rev}) | ||
- if params[:rev] | ||
%p | ||
Currently displaying revision | ||
%i= @rev | ||
, | ||
= link_to('Show latest', expand: @expand) | ||
// Coderay doesn't support rpmspec, which would be prerequisite here | ||
-# code = CodeRay.scan(@file, :ruby).html.each_line.to_a | ||
.blame | ||
- @blame_info.each do |revision| | ||
.revision | ||
.info | ||
- info = revision.first | ||
.time= render TimeComponent.new(time: "#[info['date']} #{info['time']}".to_datetime) | ||
.user | ||
- if (user = User.find_by_login(info['login'])) | ||
= link_to(user_path(user)) do | ||
= render AvatarComponent.new(name: info['login'], email: user.email) | ||
.commit.text-truncate | ||
- rev = @revisions[info['revision']] | ||
- if rev | ||
= link_to(package_show_path(@project, @package_name, rev: info['revision'])) do | ||
- if rev['comment'] | ||
= rev['comment'] | ||
- else | ||
%i No commit message | ||
.button | ||
- if info['revision'].present? && info['revision'] != @rev | ||
= link_to(project_package_file_blame_path(@project, @package_name, @filename, rev: info['revision'])) do | ||
%i.fas.fa-eye | ||
.code.CodeRay<> | ||
- revision.each do |line| | ||
.number= line['line'] | ||
.content= line['content'] |
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