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 #4498 from hennevogel/feature/project_commits_page
Introduces ProjectLogEntry view
- Loading branch information
Showing
8 changed files
with
54 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,3 +99,7 @@ table.buildstatus { | |
th.buildstatus img { | ||
margin-bottom: -3px; | ||
} | ||
|
||
nav.pagination { | ||
text-align: center; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- @pagetitle = "Pulse of #{@project}" | ||
- project_bread_crumb 'Pulse' | ||
|
||
|
||
= render partial: 'webui/project/tabs' | ||
%h3 Pulse of #{@project} | ||
- @pulse.each do |log_entry| | ||
%p | ||
• | ||
= log_entry.event_type.camelcase.prepend('Event::').constantize.description | ||
- if log_entry.package_name | ||
(#{link_to(log_entry.package_name, package_show_path(@project.name, log_entry.package_name))}) | ||
- if log_entry.user_name | ||
by #{link_to(log_entry.user_name, user_show_path(log_entry.user_name))} | ||
- if log_entry.bs_request | ||
via request #{link_to("##{log_entry.bs_request.number}", request_show_path(log_entry.bs_request.number))} | ||
= fuzzy_time(log_entry.datetime) | ||
|
||
= paginate @pulse |
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
21 changes: 21 additions & 0 deletions
21
src/api/db/data/20180214132015_project_log_entry_user_name.rb
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,21 @@ | ||
class ProjectLogEntryUserName < ActiveRecord::Migration[5.1] | ||
def up | ||
ProjectLogEntry.where('event_type like "%comment_for%"').in_batches do |log_entry| | ||
user = User.find_by(id: log_entry.user_name).try(:login) | ||
user ||= User::NOBODY_LOGIN | ||
# rubocop:disable Rails/SkipsModelValidations | ||
log_entry.update_attribute(user_name: user) | ||
# rubocop:enable Rails/SkipsModelValidations | ||
end | ||
end | ||
|
||
def down | ||
ProjectLogEntry.where('event_type like "%comment_for%"').in_batches do |log_entry| | ||
user = User.find_by(id: log_entry.user_name).try(:id) | ||
user ||= User.find_nobody!.try(:id) | ||
# rubocop:disable Rails/SkipsModelValidations | ||
log_entry.update_attribute(user_name: user) | ||
# rubocop:enable Rails/SkipsModelValidations | ||
end | ||
end | ||
end |