diff options
Diffstat (limited to 'app/views/projects')
-rw-r--r-- | app/views/projects/_wiki.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/blob/edit.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/blob/preview.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/blob/viewers/_markup.html.haml | 8 | ||||
-rw-r--r-- | app/views/projects/wikis/_form.html.haml | 4 | ||||
-rw-r--r-- | app/views/projects/wikis/_sidebar.html.haml | 3 | ||||
-rw-r--r-- | app/views/projects/wikis/show.html.haml | 3 |
7 files changed, 18 insertions, 8 deletions
diff --git a/app/views/projects/_wiki.html.haml b/app/views/projects/_wiki.html.haml index 5646dc464f8..0737f94e766 100644 --- a/app/views/projects/_wiki.html.haml +++ b/app/views/projects/_wiki.html.haml @@ -2,7 +2,8 @@ %div{ class: container_class } .prepend-top-default.append-bottom-default .wiki - = render_wiki_content(@wiki_home) + - context = params[:legacy_render] ? { markdown_engine: :redcarpet} : {} + = render_wiki_content(@wiki_home, context) - else - can_create_wiki = can?(current_user, :create_wiki, @project) .project-home-empty{ class: [('row-content-block' if can_create_wiki), ('content-block' unless can_create_wiki)] } diff --git a/app/views/projects/blob/edit.html.haml b/app/views/projects/blob/edit.html.haml index 27cf040da7c..fdab8a53b41 100644 --- a/app/views/projects/blob/edit.html.haml +++ b/app/views/projects/blob/edit.html.haml @@ -21,7 +21,7 @@ Write %li - = link_to '#preview', 'data-preview-url' => project_preview_blob_path(@project, @id) do + = link_to '#preview', 'data-preview-url' => project_preview_blob_path(@project, @id, legacy_render: params[:legacy_render]) do = editing_preview_title(@blob.name) = form_tag(project_update_blob_path(@project, @id), method: :put, class: 'js-quick-submit js-requires-input js-edit-blob-form', data: blob_editor_paths) do diff --git a/app/views/projects/blob/preview.html.haml b/app/views/projects/blob/preview.html.haml index da2cef17e8a..da29eb7a133 100644 --- a/app/views/projects/blob/preview.html.haml +++ b/app/views/projects/blob/preview.html.haml @@ -2,7 +2,8 @@ .diff-content - if markup?(@blob.name) .file-content.wiki - = markup(@blob.name, @content) + - context = params[:legacy_render] ? { markdown_engine: :redcarpet} : {} + = markup(@blob.name, @content, context) - else .file-content.code.js-syntax-highlight - unless @diff_lines.empty? diff --git a/app/views/projects/blob/viewers/_markup.html.haml b/app/views/projects/blob/viewers/_markup.html.haml index 230305b488d..ced08c659a9 100644 --- a/app/views/projects/blob/viewers/_markup.html.haml +++ b/app/views/projects/blob/viewers/_markup.html.haml @@ -1,4 +1,8 @@ - blob = viewer.blob -- rendered_markup = blob.rendered_markup if blob.respond_to?(:rendered_markup) +- context = {} +- if params[:legacy_render] + - context[:markdown_engine] = :redcarpet +- else + - context[:rendered] = blob.rendered_markup if blob.respond_to?(:rendered_markup) .file-content.wiki - = markup(blob.name, blob.data, rendered: rendered_markup) + = markup(blob.name, blob.data, context) diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 05791e9d4fc..707fc1dc842 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -1,8 +1,10 @@ - commit_message = @page.persisted? ? s_("WikiPageEdit|Update %{page_title}") : s_("WikiPageCreate|Create %{page_title}") - commit_message = commit_message % { page_title: @page.title } +- markdown_version = params[:legacy_render] ? CacheMarkdownField::CACHE_REDCARPET_VERSION : 0 = form_for [@project.namespace.becomes(Namespace), @project, @page], method: @page.persisted? ? :put : :post, - html: { class: 'wiki-form common-note-form prepend-top-default js-quick-submit' } do |f| + html: { class: 'wiki-form common-note-form prepend-top-default js-quick-submit' }, + data: { markdown_version: markdown_version } do |f| = form_errors(@page) - if @page.persisted? diff --git a/app/views/projects/wikis/_sidebar.html.haml b/app/views/projects/wikis/_sidebar.html.haml index 28353927135..6542ef3b4e0 100644 --- a/app/views/projects/wikis/_sidebar.html.haml +++ b/app/views/projects/wikis/_sidebar.html.haml @@ -12,7 +12,8 @@ .blocks-container .block.block-first - if @sidebar_page - = render_wiki_content(@sidebar_page) + - context = params[:legacy_render] ? { markdown_engine: :redcarpet} : {} + = render_wiki_content(@sidebar_page, context) - else %ul.wiki-pages = render @sidebar_wiki_entries, context: 'sidebar' diff --git a/app/views/projects/wikis/show.html.haml b/app/views/projects/wikis/show.html.haml index a08973c7f32..eb1410fc87d 100644 --- a/app/views/projects/wikis/show.html.haml +++ b/app/views/projects/wikis/show.html.haml @@ -26,6 +26,7 @@ .prepend-top-default.append-bottom-default .wiki - = render_wiki_content(@page) + - context = params[:legacy_render] ? { markdown_engine: :redcarpet} : {} + = render_wiki_content(@page, context) = render 'sidebar' |