Skip to content
Snippets Groups Projects
Commit 23d5e11f authored by Phil Hughes's avatar Phil Hughes
Browse files

Updated some system notes

parent 6d0e6b75
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -182,6 +182,8 @@ ul.notes {
 
.discussion-header,
.note-header {
color: $notes-light-color;
a {
color: inherit;
 
Loading
Loading
@@ -191,11 +193,16 @@ ul.notes {
}
}
 
}
.note-author {
color: $gl-gray;
font-weight: 600;
 
.note-headline-light,
.discussion-headline-light {
color: $notes-light-color;
&:hover,
&:focus {
color: $gl-link-color;
text-decoration: none;
}
}
}
 
/**
Loading
Loading
@@ -331,35 +338,25 @@ ul.notes {
}
}
 
.note-author {
color: inherit;
font-weight: 600;
&:hover,
&:focus {
color: $gl-link-color;
text-decoration: none;
}
}
.note-system {
line-height: 40px;
 
.author_link,
p,
.note-created-ago {
p {
display: inline-block;
margin: 0;
}
 
p {
> strong {
color: $gl-gray;
}
strong {
color: $gl-gray;
}
.note-header {
display: inline-block;
line-height: 20px;
}
}
 
.note-system-text {
display: inline-block;
line-height: 20px;
.note-system-icon {
margin-right: 5px;
color: $notes-light-color;
}
Loading
Loading
@@ -74,9 +74,14 @@ module NotesHelper
end
 
CHANGED_REGEX = /^(title|status|milestone) changed/i.freeze
DOWNCASE_FIRST_REGEX = /^(removed|reassigned|added|mentioned)/i.freeze
def system_note_text(note_text)
if note_text =~ CHANGED_REGEX
note_text.gsub!(CHANGED_REGEX) { "changed #{Regexp.last_match[1].downcase}" }
elsif note_text =~ DOWNCASE_FIRST_REGEX
note_text.sub!(/^[A-Z]/, &:downcase)
elsif note_text == "Assignee removed"
note_text = "removed assignee"
end
 
note_text
Loading
Loading
@@ -85,8 +90,10 @@ module NotesHelper
LABEL_REGEX = /^(added|removed) (.*) label/i.freeze
TITLE_REGEX = /^title changed/i.freeze
MILESTONE_REGEX = /^milestone changed/i.freeze
STATUS_CLOSED = /^status changed to closed/i.freeze
STATUS_OPEN = /^status changed to (open|reopened)/i.freeze
STATUS_CLOSED_REGEX = /^status changed to closed/i.freeze
STATUS_OPEN_REGEX = /^status changed to (open|reopened)/i.freeze
ASSIGNEE_REGEX = /^(reassigned|assignee)/i.freeze
MENTIONED_REGEX = /^(mentioned)/i.freeze
def system_note_icon(note_text)
if note_text =~ LABEL_REGEX
'tags'
Loading
Loading
@@ -94,10 +101,14 @@ module NotesHelper
'pencil'
elsif note_text =~ MILESTONE_REGEX
'clock-o'
elsif note_text =~ STATUS_CLOSED
elsif note_text =~ STATUS_CLOSED_REGEX
'check'
elsif note_text =~ STATUS_OPEN
elsif note_text =~ STATUS_OPEN_REGEX
'circle-o'
elsif note_text =~ ASSIGNEE_REGEX
'user'
elsif note_text =~ MENTIONED_REGEX
'bookmark'
end
end
end
Loading
Loading
@@ -5,21 +5,22 @@
= image_tag avatar_icon(note.author), alt: '', class: 'avatar s40'
.timeline-content
- if note.system
- system_icon = system_note_icon(note.note)
.note-system
.note-system-text
= icon(system_note_icon(note.note))
.note-header
- if !system_icon.nil?
= icon(system_icon, class: 'note-system-icon')
= link_to_member(note.project, note.author, { avatar: false, link_class: 'note-author' })
.inline.note-headline-light
= note.author.to_reference
= markdown(system_note_text(note.note), pipeline: :note)
= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago')
= note.author.to_reference
-# = markdown(system_note_text(note.note), pipeline: :note, cache_key: [note, "note"])
= markdown(system_note_text(note.note), pipeline: :note)
= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago')
- else
.note-header
= link_to_member(note.project, note.author, { avatar: false, link_class: 'note-author' })
.inline.note-headline-light
= "#{note.author.to_reference} commented"
%a{ href: "##{dom_id(note)}" }
= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago')
= "#{note.author.to_reference} commented"
%a{ href: "##{dom_id(note)}" }
= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago')
.note-actions
- access = note.project.team.human_max_access(note.author.id)
- if access
Loading
Loading
Loading
Loading
@@ -2,10 +2,9 @@
.discussion.js-toggle-container{ class: note.discussion_id }
.discussion-header
= link_to_member(@project, note.author, avatar: false)
.inline.discussion-headline-light
= "#{note.author.to_reference} started a discussion"
= link_to diffs_namespace_project_merge_request_path(note.project.namespace, note.project, note.noteable, anchor: note.line_code) do
on the diff
= "#{note.author.to_reference} started a discussion"
= link_to diffs_namespace_project_merge_request_path(note.project.namespace, note.project, note.noteable, anchor: note.line_code) do
on the diff
.discussion-actions
= link_to "#", class: "discussion-action-button discussion-toggle-button js-toggle-button" do
%i.fa.fa-chevron-up
Loading
Loading
Loading
Loading
@@ -4,10 +4,9 @@
.discussion.js-toggle-container{ class: note.discussion_id }
.discussion-header
= link_to_member(@project, note.author, avatar: false)
.inline.discussion-headline-light
= "#{note.author.to_reference} started a discussion on #{commit_description}"
- if commit
= link_to(commit.short_id, namespace_project_commit_path(note.project.namespace, note.project, note.noteable), class: 'monospace')
= "#{note.author.to_reference} started a discussion on #{commit_description}"
- if commit
= link_to(commit.short_id, namespace_project_commit_path(note.project.namespace, note.project, note.noteable), class: 'monospace')
.discussion-actions
= link_to "#", class: "note-action-button discussion-toggle-button js-toggle-button" do
%i.fa.fa-chevron-up
Loading
Loading
Loading
Loading
@@ -2,9 +2,8 @@
.discussion.js-toggle-container{ class: note.discussion_id }
.discussion-header
= link_to_member(@project, note.author, avatar: false)
.inline.discussion-headline-light
= "#{note.author.to_reference} started a discussion"
on the outdated diff
= "#{note.author.to_reference} started a discussion"
on the outdated diff
.discussion-actions
= link_to "#", class: "note-action-button discussion-toggle-button js-toggle-button" do
%i.fa.fa-chevron-down
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment