summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-10 14:34:12 +0000
committerDouwe Maan <douwe@gitlab.com>2015-12-10 14:34:12 +0000
commit4e5897f51ef97d7c3ff6c57f81521f552979a3da (patch)
treeef0655df13cef6c267ea3e547d497f92498142ed /app/views
parent3bfedbd25a933d59defbb0875fb80758919df4a6 (diff)
parent10387f6b8a9071688d7db9a12c910ca02660ca87 (diff)
downloadgitlab-ce-4e5897f51ef97d7c3ff6c57f81521f552979a3da.tar.gz
Merge branch 'tmp-reference-pipeline-and-caching' into 'master'
[Second try] Implement different Markdown rendering pipelines and cache Markdown !1602 already got merged in bcd89a58e736685bcce662fe0acf793ee925b536, but it would appear the merge commit disappeared because of #3816 (or some other reason). cc @rspeicher See merge request !2051
Diffstat (limited to 'app/views')
-rw-r--r--app/views/dashboard/milestones/show.html.haml2
-rw-r--r--app/views/events/_commit.html.haml2
-rw-r--r--app/views/groups/milestones/show.html.haml2
-rw-r--r--app/views/projects/commit/_commit_box.html.haml4
-rw-r--r--app/views/projects/commits/_commit.html.haml2
-rw-r--r--app/views/projects/commits/show.atom.builder2
-rw-r--r--app/views/projects/edit.html.haml4
-rw-r--r--app/views/projects/issues/_closed_by_box.html.haml2
-rw-r--r--app/views/projects/issues/show.html.haml4
-rw-r--r--app/views/projects/merge_requests/show/_mr_box.html.haml4
-rw-r--r--app/views/projects/merge_requests/widget/_open.html.haml2
-rw-r--r--app/views/projects/milestones/show.html.haml2
-rw-r--r--app/views/projects/notes/_note.html.haml2
-rw-r--r--app/views/projects/repositories/_feed.html.haml2
-rw-r--r--app/views/shared/snippets/_header.html.haml2
15 files changed, 19 insertions, 19 deletions
diff --git a/app/views/dashboard/milestones/show.html.haml b/app/views/dashboard/milestones/show.html.haml
index 3536bbeaf4b..44b7efe5232 100644
--- a/app/views/dashboard/milestones/show.html.haml
+++ b/app/views/dashboard/milestones/show.html.haml
@@ -12,7 +12,7 @@
.gray-content-block.middle-block
%h2.issue-title
- = gfm escape_once(@milestone.title)
+ = markdown escape_once(@milestone.title), pipeline: :single_line
- if @milestone.complete? && @milestone.active?
.alert.alert-success.prepend-top-default
diff --git a/app/views/events/_commit.html.haml b/app/views/events/_commit.html.haml
index ad63841ccf3..4ba8b84fd92 100644
--- a/app/views/events/_commit.html.haml
+++ b/app/views/events/_commit.html.haml
@@ -2,4 +2,4 @@
.commit-row-title
= link_to truncate_sha(commit[:id]), namespace_project_commit_path(project.namespace, project, commit[:id]), class: "commit_short_id", alt: ''
&middot;
- = gfm event_commit_title(commit[:message]), project: project
+ = markdown event_commit_title(commit[:message]), project: project, pipeline: :single_line
diff --git a/app/views/groups/milestones/show.html.haml b/app/views/groups/milestones/show.html.haml
index 3c1d8815013..350e216fcc6 100644
--- a/app/views/groups/milestones/show.html.haml
+++ b/app/views/groups/milestones/show.html.haml
@@ -18,7 +18,7 @@
.gray-content-block.middle-block
%h2.issue-title
- = gfm escape_once(@milestone.title)
+ = markdown escape_once(@milestone.title), pipeline: :single_line
- if @milestone.complete? && @milestone.active?
.alert.alert-success.prepend-top-default
diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml
index bb37e4a7049..132cdc35c94 100644
--- a/app/views/projects/commit/_commit_box.html.haml
+++ b/app/views/projects/commit/_commit_box.html.haml
@@ -52,10 +52,10 @@
.commit-box.gray-content-block.middle-block
%h3.commit-title
- = gfm escape_once(@commit.title)
+ = markdown escape_once(@commit.title), pipeline: :single_line
- if @commit.description.present?
%pre.commit-description
- = preserve(gfm(escape_once(@commit.description)))
+ = preserve(markdown(escape_once(@commit.description), pipeline: :single_line))
:javascript
$(".commit-info-row.branches").load("#{branches_namespace_project_commit_path(@project.namespace, @project, @commit.id)}");
diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml
index 2e489a0a4d5..0d64486164e 100644
--- a/app/views/projects/commits/_commit.html.haml
+++ b/app/views/projects/commits/_commit.html.haml
@@ -32,7 +32,7 @@
- if commit.description?
.commit-row-description.js-toggle-content
%pre
- = preserve(gfm(escape_once(commit.description)))
+ = preserve(markdown(escape_once(commit.description), pipeline: :single_line))
.commit-row-info
= commit_author_link(commit, avatar: true, size: 24)
diff --git a/app/views/projects/commits/show.atom.builder b/app/views/projects/commits/show.atom.builder
index 268b9b815ee..7ffa7317196 100644
--- a/app/views/projects/commits/show.atom.builder
+++ b/app/views/projects/commits/show.atom.builder
@@ -17,7 +17,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.name commit.author_name
xml.email commit.author_email
end
- xml.summary gfm(commit.description)
+ xml.summary markdown(commit.description, pipeline: :single_line)
end
end
end
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index b28ada909b7..d865d299135 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -24,10 +24,10 @@
.col-sm-10
= f.text_area :description, class: "form-control", rows: 3, maxlength: 250
- - if @project.repository.exists? && @project.repository.branch_names.any?
+ - unless @project.empty_repo?
.form-group
= f.label :default_branch, "Default Branch", class: 'control-label'
- .col-sm-10= f.select(:default_branch, @repository.branch_names, {}, {class: 'select2 select-wide'})
+ .col-sm-10= f.select(:default_branch, @project.repository.branch_names, {}, {class: 'select2 select-wide'})
= render 'shared/visibility_level', f: f, visibility_level: @project.visibility_level, can_change_visibility_level: can_change_visibility_level?(@project, current_user), form_model: @project
diff --git a/app/views/projects/issues/_closed_by_box.html.haml b/app/views/projects/issues/_closed_by_box.html.haml
index 917d5181689..3c491c1a8b8 100644
--- a/app/views/projects/issues/_closed_by_box.html.haml
+++ b/app/views/projects/issues/_closed_by_box.html.haml
@@ -1,3 +1,3 @@
.issue-closed-by-widget
= icon('check')
- This issue will be closed automatically when merge request #{gfm(merge_requests_sentence(@closed_by_merge_requests))} is accepted.
+ This issue will be closed automatically when merge request #{markdown(merge_requests_sentence(@closed_by_merge_requests), pipeline: :gfm)} is accepted.
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml
index e2de17cee6d..a78d20cc07e 100644
--- a/app/views/projects/issues/show.html.haml
+++ b/app/views/projects/issues/show.html.haml
@@ -38,13 +38,13 @@
.gray-content-block.middle-block
%h2.issue-title
- = gfm escape_once(@issue.title)
+ = markdown escape_once(@issue.title), pipeline: :single_line
%div
- if @issue.description.present?
.description{class: can?(current_user, :update_issue, @issue) ? 'js-task-list-container' : ''}
.wiki
= preserve do
- = markdown(@issue.description)
+ = markdown(@issue.description, cache_key: [@issue, "description"])
%textarea.hidden.js-task-list-field
= @issue.description
- if @closed_by_merge_requests.present?
diff --git a/app/views/projects/merge_requests/show/_mr_box.html.haml b/app/views/projects/merge_requests/show/_mr_box.html.haml
index b4f62a75890..9bfe202589e 100644
--- a/app/views/projects/merge_requests/show/_mr_box.html.haml
+++ b/app/views/projects/merge_requests/show/_mr_box.html.haml
@@ -1,12 +1,12 @@
.gray-content-block.middle-block
%h2.issue-title
- = gfm escape_once(@merge_request.title)
+ = markdown escape_once(@merge_request.title), pipeline: :single_line
%div
- if @merge_request.description.present?
.description{class: can?(current_user, :update_merge_request, @merge_request) ? 'js-task-list-container' : ''}
.wiki
= preserve do
- = markdown(@merge_request.description)
+ = markdown(@merge_request.description, cache_key: [@merge_request, "description"])
%textarea.hidden.js-task-list-field
= @merge_request.description
diff --git a/app/views/projects/merge_requests/widget/_open.html.haml b/app/views/projects/merge_requests/widget/_open.html.haml
index e0013fb769a..55dbae598d3 100644
--- a/app/views/projects/merge_requests/widget/_open.html.haml
+++ b/app/views/projects/merge_requests/widget/_open.html.haml
@@ -26,4 +26,4 @@
%i.fa.fa-check
Accepting this merge request will close #{"issue".pluralize(@closes_issues.size)}
= succeed '.' do
- != gfm(issues_sentence(@closes_issues))
+ != markdown issues_sentence(@closes_issues), pipeline: :gfm
diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml
index c3bda794c65..7ecee440337 100644
--- a/app/views/projects/milestones/show.html.haml
+++ b/app/views/projects/milestones/show.html.haml
@@ -32,7 +32,7 @@
.gray-content-block.middle-block
%h2.issue-title
- = gfm escape_once(@milestone.title)
+ = markdown escape_once(@milestone.title), pipeline: :single_line
%div
- if @milestone.description.present?
.description
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index dd0abc8c746..922535e5c4a 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -38,7 +38,7 @@
.note-body{class: note_editable?(note) ? 'js-task-list-container' : ''}
.note-text
= preserve do
- = markdown(note.note, {no_header_anchors: true})
+ = markdown(note.note, pipeline: :note, cache_key: [note, "note"])
- if note_editable?(note)
= render 'projects/notes/edit_form', note: note
diff --git a/app/views/projects/repositories/_feed.html.haml b/app/views/projects/repositories/_feed.html.haml
index f3526ad0747..6ca919f7f80 100644
--- a/app/views/projects/repositories/_feed.html.haml
+++ b/app/views/projects/repositories/_feed.html.haml
@@ -12,7 +12,7 @@
= link_to namespace_project_commits_path(@project.namespace, @project, commit.id) do
%code= commit.short_id
= image_tag avatar_icon(commit.author_email), class: "", width: 16, alt: ''
- = gfm escape_once(truncate(commit.title, length: 40))
+ = markdown escape_once(truncate(commit.title, length: 40)), pipeline: :single_line
%td
%span.pull-right.cgray
= time_ago_with_tooltip(commit.committed_date)
diff --git a/app/views/shared/snippets/_header.html.haml b/app/views/shared/snippets/_header.html.haml
index eb0fd21c2d4..669e6119fb6 100644
--- a/app/views/shared/snippets/_header.html.haml
+++ b/app/views/shared/snippets/_header.html.haml
@@ -22,4 +22,4 @@
.gray-content-block.middle-block
%h2.issue-title
- = gfm escape_once(@snippet.title)
+ = markdown escape_once(@snippet.title), pipeline: :single_line