From a963721f797b451efec15702e73752c8b8830631 Mon Sep 17 00:00:00 2001 From: Brett Walker Date: Sun, 2 Sep 2018 10:24:27 -0500 Subject: render using RedCarpet if legacy_render parameter is set --- app/views/projects/_wiki.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/views/projects/_wiki.html.haml') 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)] } -- cgit v1.2.1 From 589776fc2e421df12c2526f9cf8cd7f3f239a21f Mon Sep 17 00:00:00 2001 From: Brett Walker Date: Tue, 4 Sep 2018 08:42:23 -0500 Subject: move logic into legacy_render_context helper method --- app/views/projects/_wiki.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/views/projects/_wiki.html.haml') diff --git a/app/views/projects/_wiki.html.haml b/app/views/projects/_wiki.html.haml index 0737f94e766..5adca007f7e 100644 --- a/app/views/projects/_wiki.html.haml +++ b/app/views/projects/_wiki.html.haml @@ -2,8 +2,7 @@ %div{ class: container_class } .prepend-top-default.append-bottom-default .wiki - - context = params[:legacy_render] ? { markdown_engine: :redcarpet} : {} - = render_wiki_content(@wiki_home, context) + = render_wiki_content(@wiki_home, legacy_render_context(params)) - 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)] } -- cgit v1.2.1