diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-15 11:12:17 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-15 11:12:17 +0200 |
| commit | f598cc789789bcde01e3c703d9149204247c0a46 (patch) | |
| tree | a95d42cbd39649c71065c1660f7e955a41759d79 /app/views/notes | |
| parent | bda7fe38d0b0e39a408c4eb44374a330c24c3a49 (diff) | |
| download | gitlab-ce-f598cc789789bcde01e3c703d9149204247c0a46.tar.gz | |
change logic on line_code
Diffstat (limited to 'app/views/notes')
| -rw-r--r-- | app/views/notes/_discussion.html.haml | 24 | ||||
| -rw-r--r-- | app/views/notes/_discussion_diff.html.haml | 2 | ||||
| -rw-r--r-- | app/views/notes/_note.html.haml | 6 |
3 files changed, 24 insertions, 8 deletions
diff --git a/app/views/notes/_discussion.html.haml b/app/views/notes/_discussion.html.haml index 031f4477ce3..093775f0d88 100644 --- a/app/views/notes/_discussion.html.haml +++ b/app/views/notes/_discussion.html.haml @@ -12,8 +12,15 @@ %div = link_to note.author_name, project_team_member_path(@project, @project.team_member_by_id(note.author)), class: "note-author" - if note.for_merge_request? - started a discussion on this merge request diff - = link_to_merge_request_diff_line_note(note) + - if note.diff + started a discussion on this merge request diff + = link_to_merge_request_diff_line_note(note) + - else + started + %strong + %i.icon-remove + outdated + discussion on this merge request diff - elsif note.for_commit? started a discussion on commit #{link_to note.noteable.short_id, project_commit_path(@project, note.noteable)} @@ -29,8 +36,17 @@ ago .discussion-body - if note.for_diff_line? - .content - .diff_file= render "notes/discussion_diff", discussion_notes: discussion_notes, note: note + - if note.diff + .content + .diff_file= render "notes/discussion_diff", discussion_notes: discussion_notes, note: note + - else + = link_to 'show outdated discussion', '#', class: 'js-show-outdated-discussion' + %div.hide.outdated-discussion + .content + .notes{ rel: discussion_notes.first.discussion_id } + = render discussion_notes + + - else .content .notes{ rel: discussion_notes.first.discussion_id } diff --git a/app/views/notes/_discussion_diff.html.haml b/app/views/notes/_discussion_diff.html.haml index 78f06f78f69..93ab59c72c5 100644 --- a/app/views/notes/_discussion_diff.html.haml +++ b/app/views/notes/_discussion_diff.html.haml @@ -9,7 +9,7 @@ %br/ .diff_file_content %table - - each_diff_line(diff.diff.lines.to_a, note.diff_file_index) do |line, type, line_code, line_new, line_old| + - each_diff_line(diff, note.diff_file_index) do |line, type, line_code, line_new, line_old| %tr.line_holder{ id: line_code } - if type == "match" %td.old_line= "..." diff --git a/app/views/notes/_note.html.haml b/app/views/notes/_note.html.haml index 6f7eea9827f..dd5d7c1ba8c 100644 --- a/app/views/notes/_note.html.haml +++ b/app/views/notes/_note.html.haml @@ -6,8 +6,8 @@ Link here - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) - = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, confirm: 'Are you sure?', remote: true, class: "danger js-note-delete" do - %i.icon-remove-circle + = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, confirm: 'Are you sure you want to remove comment?', remote: true, class: "danger js-note-delete" do + %i.icon-trash.cred = image_tag gravatar_icon(note.author.email), class: "avatar s32" = link_to note.author_name, project_team_member_path(@project, @project.team_member_by_id(note.author)), class: "note-author" %span.note-last-update @@ -29,7 +29,7 @@ = markdown(note.note) - if note.attachment.url - if note.attachment.image? - = image_tag note.attachment.url, class: 'thumbnail span4' + = image_tag note.attachment.url, class: 'note-image-attach' .attachment.right = link_to note.attachment.url, target: "_blank" do %i.icon-attachment |
