Commit 7c491d4f authored by Douwe Maan's avatar Douwe Maan

Misc tweaks

parent 5f758aff
...@@ -93,13 +93,13 @@ module NotesHelper ...@@ -93,13 +93,13 @@ module NotesHelper
end end
end end
def notes_url(extra_params = {}) def notes_url(params = {})
if @snippet.is_a?(PersonalSnippet) if @snippet.is_a?(PersonalSnippet)
snippet_notes_path(@snippet, extra_params) snippet_notes_path(@snippet, params)
else else
params = { target_id: @noteable.id, target_type: @noteable.class.name.underscore } params.merge!(target_id: @noteable.id, target_type: @noteable.class.name.underscore)
project_noteable_notes_path(@project, params.merge(extra_params)) project_noteable_notes_path(@project, params)
end end
end end
......
...@@ -3,7 +3,7 @@ class NoteEntity < API::Entities::Note ...@@ -3,7 +3,7 @@ class NoteEntity < API::Entities::Note
expose :type expose :type
expose :author, using: UserNoteEntity expose :author, using: NoteUserEntity
expose :human_access do |note| expose :human_access do |note|
note.project.team.human_max_access(note.author_id) note.project.team.human_max_access(note.author_id)
...@@ -15,7 +15,7 @@ class NoteEntity < API::Entities::Note ...@@ -15,7 +15,7 @@ class NoteEntity < API::Entities::Note
expose :redacted_note_html, as: :note_html expose :redacted_note_html, as: :note_html
expose :last_edited_at, if: -> (note, _) { note.is_edited? } expose :last_edited_at, if: -> (note, _) { note.is_edited? }
expose :last_edited_by, using: UserNoteEntity, if: -> (note, _) { note.is_edited? } expose :last_edited_by, using: NoteUserEntity, if: -> (note, _) { note.is_edited? }
expose :current_user do expose :current_user do
expose :can_edit do |note| expose :can_edit do |note|
......
class NoteUserEntity < UserEntity
unexpose :web_url
end
class UserNoteEntity < API::Entities::UserBasic
include RequestAwareEntity
unexpose :web_url
expose :path do |user|
user_path(user)
end
end
- @gfm_form = true - @gfm_form = true
- content_for :note_actions do - content_for :note_actions do
- if can?(current_user, :update_issue, @issue) - if can?(current_user, :update_issue, @issue)
= link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue' = link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
= link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue' = link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue'
%section.js-vue-notes-event %section.js-vue-notes-event
#js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json), #js-vue-notes{ data: { discussions_path: discussions_project_issue_path(@project, @issue, format: :json),
register_path: "#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane", register_path: new_session_path(:user, redirect_to_referer: 'yes', anchor: 'register-pane'),
new_session_path: new_session_path(:user, redirect_to_referer: 'yes'), new_session_path: new_session_path(:user, redirect_to_referer: 'yes'),
markdown_docs_path: help_page_path('user/markdown'), markdown_docs_path: help_page_path('user/markdown'),
quick_actions_docs_path: help_page_path('user/project/quick_actions'), quick_actions_docs_path: help_page_path('user/project/quick_actions'),
...@@ -14,6 +15,3 @@ ...@@ -14,6 +15,3 @@
last_fetched_at: Time.now.to_i, last_fetched_at: Time.now.to_i,
issue_data: serialize_issuable(@issue), issue_data: serialize_issuable(@issue),
current_user_data: UserSerializer.new.represent(current_user).to_json } } current_user_data: UserSerializer.new.represent(current_user).to_json } }
- content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'notes'
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
- page_title "#{@issue.title} (#{@issue.to_reference})", "Issues" - page_title "#{@issue.title} (#{@issue.to_reference})", "Issues"
- page_description @issue.description - page_description @issue.description
- page_card_attributes @issue.card_attributes - page_card_attributes @issue.card_attributes
- content_for :page_specific_javascripts do
= webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'notes'
- can_update_issue = can?(current_user, :update_issue, @issue) - can_update_issue = can?(current_user, :update_issue, @issue)
- can_report_spam = @issue.submittable_as_spam_by?(current_user) - can_report_spam = @issue.submittable_as_spam_by?(current_user)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
- elsif !current_user - elsif !current_user
.disabled-comment.text-center.prepend-top-default .disabled-comment.text-center.prepend-top-default
Please Please
= link_to "register", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-register-link' = link_to "register", new_session_path(:user, redirect_to_referer: 'yes', anchor: 'register-pane'), class: 'js-register-link'
or or
= link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-sign-in-link' = link_to "sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: 'js-sign-in-link'
to comment to comment
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment