[refs #193] Compare routes repair and compare design
This commit is contained in:
parent
7863869a30
commit
d9025b093f
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue