diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index b334262e3..428eb08bd 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -117,6 +117,7 @@ class WikiController < ApplicationController def compare_wiki if request.post? @versions = params[:versions] || [] + puts "VERSIONS1: " + @versions.inspect if @versions.size < 2 redirect_to history_project_wiki_index_path(@project) else @@ -125,6 +126,7 @@ class WikiController < ApplicationController end elsif request.get? @versions = params[:versions].split(/\.{2,3}/) + puts "VERSIONS2: " + @versions.inspect if @versions.size < 2 redirect_to history_project_wiki_index_path(@project) return diff --git a/app/views/wiki/_page.html.haml b/app/views/wiki/_page.html.haml index c6af67350..850bc403c 100644 --- a/app/views/wiki/_page.html.haml +++ b/app/views/wiki/_page.html.haml @@ -19,5 +19,5 @@ = t("layout.time.ago") - unless action_name == 'preview' or cannot? :write, @project %p#delete-link - = link_to project_wiki_path(@project, escaped_name), :method => :delete, :confirm => t("layout.confirm") do + = link_to project_wiki_path(@project, escaped_name), :method => :delete, :confirm => t("layout.confirm"), :class => 'button width100' do %span= t("layout.wiki.delete_page") diff --git a/app/views/wiki/compare.html.haml b/app/views/wiki/compare.html.haml index 4ab54c5ff..6e560e1de 100644 --- a/app/views/wiki/compare.html.haml +++ b/app/views/wiki/compare.html.haml @@ -1,29 +1,46 @@ = render :partial => 'gollum_includes' -= render :partial => 'project_short' +=# render :partial => 'project_short' += render :partial => 'projects/submenu' -%a{ :name => "wiki"} -.block - = render :partial => 'navigation' +%h3.wiki + - if @name + = t("layout.wiki.history_for") + %strong= @page.name + - else + = t("layout.wiki.wiki_history") - .content - #wiki-wrapper.inner.compare - #head - %h1.title - - if @name - = t("layout.wiki.history_for") - %strong= @page.name - - else - = t("layout.wiki.wiki_history") +.r + - if can? :read, @project + = link_to t("layout.wiki.back_to_history"), + @name ? history_project_wiki_path(@project, escaped_name) : history_project_wiki_index_path(@project), + :class => 'button width100' - %ul.actions - - if can? :read, @project - %li.minibutton= link_to t("layout.wiki.back_to_history"), - @name ? history_project_wiki_path(@project, escaped_name) : history_project_wiki_index_path(@project) - = render :partial => 'searchbar' +#wiki-content + = render :partial => "compare" - #wiki-content - = render :partial => "compare" +//%a{ :name => "wiki"} +//.block +// = render :partial => 'navigation' +// +// .content +// #wiki-wrapper.inner.compare +// #head +// %h1.title +// - if @name +// = t("layout.wiki.history_for") +// %strong= @page.name +// - else +// = t("layout.wiki.wiki_history") +// +// %ul.actions +// - if can? :read, @project +// %li.minibutton= link_to t("layout.wiki.back_to_history"), +// @name ? history_project_wiki_path(@project, escaped_name) : history_project_wiki_index_path(@project) +// = render :partial => 'searchbar' +// +// #wiki-content +// = render :partial => "compare" - content_for :sidebar do - - render :partial => 'projects/sidebar' + - render :partial => 'sidebar' diff --git a/config/routes.rb b/config/routes.rb index cf410d285..5c41fec18 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -101,7 +101,7 @@ Rosa::Application.routes.draw do match '_access' => 'wiki#git', :as => :git, :via => :get match '_revert/:sha1/:sha2' => 'wiki#revert_wiki', :as => :revert, :via => [:get, :post] match '_compare' => 'wiki#compare_wiki', :as => :compare, :via => :post - match '_compare/*versions' => 'wiki#compare_wiki', :as => :compare_versions, :via => :get + match '_compare/:versions' => 'wiki#compare_wiki', :versions => /.*/, :as => :compare_versions, :via => :get post :preview get :search get :pages