summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Levorato <git@flevour.net>2015-09-17 16:50:20 +0200
committerFrancesco Levorato <git@flevour.net>2015-09-18 16:35:53 +0200
commit322913f331dddc811760f7d42201974b02aa9f5e (patch)
treed8667acc8bd89cd6863dc9535a79bb16e779e5d8
parentac571623d88314c89773ecdb484fc1c4ea92de1a (diff)
downloadgitlab-ce-322913f331dddc811760f7d42201974b02aa9f5e.tar.gz
Fix URL targets for uploads, markdown preview and autocomplete in MR textareas
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/layouts/_init_auto_complete.html.haml3
-rw-r--r--app/views/layouts/project.html.haml5
3 files changed, 6 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 7a54700af04..6b533bffd9d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -55,6 +55,7 @@ v 8.0.0 (unreleased)
- Webhook for issue now contains repository field (Jungkook Park)
- Add ability to add custom text to the help page (Jeroen van Baarsen)
- Add pg_schema to backup config
+ - Fix references to target project issues in Merge Requests markdown preview and textareas (Francesco Levorato)
v 7.14.3
- No changes
diff --git a/app/views/layouts/_init_auto_complete.html.haml b/app/views/layouts/_init_auto_complete.html.haml
index 3c58f10e759..035fe0056d3 100644
--- a/app/views/layouts/_init_auto_complete.html.haml
+++ b/app/views/layouts/_init_auto_complete.html.haml
@@ -1,3 +1,4 @@
+- project = @target_project || @project
:javascript
- GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(@project.namespace, @project, type: @noteable.class, type_id: params[:id])}"
+ GitLab.GfmAutoComplete.dataSource = "#{autocomplete_sources_namespace_project_path(project.namespace, project, type: @noteable.class, type_id: params[:id])}"
GitLab.GfmAutoComplete.setup();
diff --git a/app/views/layouts/project.html.haml b/app/views/layouts/project.html.haml
index 78dafcd8bfa..abf73bcc709 100644
--- a/app/views/layouts/project.html.haml
+++ b/app/views/layouts/project.html.haml
@@ -3,10 +3,11 @@
- sidebar "project" unless sidebar
- content_for :scripts_body_top do
+ - project = @target_project || @project
- if current_user
:javascript
- window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
- window.markdown_preview_path = "#{markdown_preview_namespace_project_path(@project.namespace, @project)}";
+ window.project_uploads_path = "#{namespace_project_uploads_path project.namespace,project}";
+ window.markdown_preview_path = "#{markdown_preview_namespace_project_path(project.namespace, project)}";
- content_for :scripts_body do
= render "layouts/init_auto_complete" if current_user