gitlab-org--gitlab-foss/app/views/projects/notes/_note.html.haml

93 lines
4.8 KiB
Text
Raw Normal View History

2016-05-10 18:41:46 -04:00
- return unless note.author
- return if note.cross_reference_not_visible_for?(current_user)
- note_editable = note_editable?(note)
2016-05-10 18:41:46 -04:00
%li.timeline-entry{ id: dom_id(note), class: ["note", "note-row-#{note.id}", ('system-note' if note.system)], data: {author_id: note.author.id, editable: note_editable} }
.timeline-entry-inner
.timeline-icon
%a{ href: user_path(note.author) }
= image_tag avatar_icon(note.author), alt: '', class: 'avatar s40'
.timeline-content
.note-header
2017-02-07 14:34:41 -05:00
%a.visible-xs{ href: user_path(note.author) }
2016-05-10 18:41:46 -04:00
= note.author.to_reference
= link_to_member(note.project, note.author, avatar: false, extra_class: 'hidden-xs')
.note-headline-light
%span.hidden-xs
= note.author.to_reference
2016-05-10 18:41:46 -04:00
- unless note.system
commented
makes system notes less intrusive to a conversation adds dicussion icon and color change in system note links adds discussion icons and sticky note icon for other system notes for now fixes scss lint error adds faded commit lists hides first paragraph in commit list box css tweak for commit list system notes adds commit-list toggle functionality, css tweaks and css classnames more readable small css fix in header. makes links bold in system note renames class no-shade to hide-shade adds entry for this merge request in changelog removes commented line removes the avatar-icon from discussion header minor css tweaks to make the commit list alignment with header text uses monospaced font to make the commit list lined up with all removes icon from system note and align bullet list resolves scss lint warings adds helper function to extract system note message from first p tag adds helper functions to check commit list count and haml cleanup adds changelog entry under 8.14 adds changelog entry with changelog cli removes helper and regex and makes commit list li count using JS makes link in system note normal brakeman build failure resolved fixing rspec test based on new design for discussion shows system note in lowercase removes extra spaces from comments adds code commenting for functions adds semi-colon in some lines fixes rspec given when merge build success removes commented codes rewrite changelog yml file moves isMetaKey to common utils file fixes some indentation issues removes unnecessary variables and resolves some discussions replaces jQuery parent function with siblings fixes scss issues and variable spelling mistake uses constant rather using hardcoded number for visible li count in long commit list makes system note header all lowercase uses color variables and adjust gradient a little some minor changes for adding css classes renames functions name for readability changes changelog title minor scss newline changes makes system note less intrusive to a conversation
2016-10-08 02:50:28 -04:00
- if note.system
%span.system-note-message
= note.redacted_note_html
%a{ href: "##{dom_id(note)}" }
= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago')
2016-07-26 00:48:15 -04:00
- unless note.system?
.note-actions
- access = note_max_access_for_user(note)
- if access
%span.note-role= access
2016-07-26 00:48:15 -04:00
2016-07-29 06:52:08 -04:00
- if note.resolvable?
- can_resolve = can?(current_user, :resolve_note, note)
%resolve-btn{ "discussion-id" => "#{note.discussion_id}",
":note-id" => note.id,
":resolved" => note.resolved?,
":can-resolve" => can_resolve,
"resolved-by" => "#{note.resolved_by.try(:name)}",
"v-show" => "#{can_resolve || note.resolved?}",
"inline-template" => true,
2016-11-07 05:05:58 -05:00
"ref" => "note_#{note.id}" }
.note-action-button
= icon("spin spinner", "v-show" => "loading")
%button.line-resolve-btn{ type: "button",
class: ("is-disabled" unless can_resolve),
":class" => "{ 'is-active': isResolved }",
":aria-label" => "buttonText",
"@click" => "resolve",
":title" => "buttonText",
"v-show" => "!loading",
2016-11-07 05:05:58 -05:00
":ref" => "'button'" }
2016-07-26 00:48:15 -04:00
= render "shared/icons/icon_status_success.svg"
2016-07-26 00:48:15 -04:00
- if current_user
- if note.emoji_awardable?
= link_to '#', title: 'Award Emoji', class: 'note-action-button note-emoji-button js-add-award js-note-emoji', data: { position: 'right' } do
= icon('spinner spin')
2016-08-04 11:53:05 -04:00
= icon('smile-o', class: 'link-highlight')
2016-07-26 00:48:15 -04:00
- if note_editable
= link_to '#', title: 'Edit comment', class: 'note-action-button js-note-edit' do
2016-08-04 11:53:05 -04:00
= icon('pencil', class: 'link-highlight')
= link_to namespace_project_note_path(note.project.namespace, note.project, note), title: 'Remove comment', method: :delete, data: { confirm: 'Are you sure you want to remove this comment?' }, remote: true, class: 'note-action-button js-note-delete danger' do
2016-10-20 18:35:17 -04:00
= icon('trash-o', class: 'danger-highlight')
.note-body{ class: note_editable ? 'js-task-list-container' : '' }
.note-text.md
2015-07-21 07:59:14 -04:00
= preserve do
2016-10-06 17:52:44 -04:00
= note.redacted_note_html
= edited_time_ago_with_tooltip(note, placement: 'bottom', html_class: 'note_edited_ago', include_author: true)
- if note_editable
2017-01-04 16:44:00 -05:00
.original-note-content.hidden{ data: { post_url: namespace_project_note_path(@project.namespace, @project, note), target_id: note.noteable.id, target_type: note.noteable.class.name.underscore } }
#{note.note}
%textarea.hidden.js-task-list-field.original-task-list{ data: {update_url: namespace_project_note_path(@project.namespace, @project, note) } }= note.note
2016-05-27 11:29:27 -04:00
.note-awards
= render 'award_emoji/awards_block', awardable: note, inline: false
makes system notes less intrusive to a conversation adds dicussion icon and color change in system note links adds discussion icons and sticky note icon for other system notes for now fixes scss lint error adds faded commit lists hides first paragraph in commit list box css tweak for commit list system notes adds commit-list toggle functionality, css tweaks and css classnames more readable small css fix in header. makes links bold in system note renames class no-shade to hide-shade adds entry for this merge request in changelog removes commented line removes the avatar-icon from discussion header minor css tweaks to make the commit list alignment with header text uses monospaced font to make the commit list lined up with all removes icon from system note and align bullet list resolves scss lint warings adds helper function to extract system note message from first p tag adds helper functions to check commit list count and haml cleanup adds changelog entry under 8.14 adds changelog entry with changelog cli removes helper and regex and makes commit list li count using JS makes link in system note normal brakeman build failure resolved fixing rspec test based on new design for discussion shows system note in lowercase removes extra spaces from comments adds code commenting for functions adds semi-colon in some lines fixes rspec given when merge build success removes commented codes rewrite changelog yml file moves isMetaKey to common utils file fixes some indentation issues removes unnecessary variables and resolves some discussions replaces jQuery parent function with siblings fixes scss issues and variable spelling mistake uses constant rather using hardcoded number for visible li count in long commit list makes system note header all lowercase uses color variables and adjust gradient a little some minor changes for adding css classes renames functions name for readability changes changelog title minor scss newline changes makes system note less intrusive to a conversation
2016-10-08 02:50:28 -04:00
- if note.system
.system-note-commit-list-toggler
Toggle commit list
%i.fa.fa-angle-down
- if note.attachment.url
.note-attachment
- if note.attachment.image?
2015-02-20 09:19:50 -05:00
= link_to note.attachment.url, target: '_blank' do
= image_tag note.attachment.url, class: 'note-image-attach'
.attachment
2015-04-29 16:11:48 -04:00
= link_to note.attachment.url, target: '_blank' do
= icon('paperclip')
= note.attachment_identifier
2015-05-12 06:16:34 -04:00
= link_to delete_attachment_namespace_project_note_path(note.project.namespace, note.project, note),
2015-04-29 16:11:48 -04:00
title: 'Delete this attachment', method: :delete, remote: true, data: { confirm: 'Are you sure you want to remove the attachment?' }, class: 'danger js-note-attachment-delete' do
= icon('trash-o', class: 'cred')