Extracted default layout
This commit is contained in:
parent
041c250837
commit
832cfdf605
|
@ -4,6 +4,7 @@ require 'redcloth_for_tex'
|
||||||
|
|
||||||
class WikiController < ApplicationController
|
class WikiController < ApplicationController
|
||||||
|
|
||||||
|
layout 'default', :except => [:rss_feed, :rss_with_headlines, :tex_web, :tex]
|
||||||
before_filter :pre_process
|
before_filter :pre_process
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
15
app/views/top.rhtml → app/views/layouts/default.rhtml
Executable file → Normal file
15
app/views/top.rhtml → app/views/layouts/default.rhtml
Executable file → Normal file
|
@ -11,7 +11,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</title>
|
</title>
|
||||||
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
h1#pageName, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, #TextileHelp h3 {
|
h1#pageName, .newWikiWord a, a.existingWikiWord, .newWikiWord a:hover, #TextileHelp h3 {
|
||||||
|
@ -28,12 +28,13 @@
|
||||||
|
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
<%= @style_additions %>
|
<%= @style_additions %>
|
||||||
<%= @web ? @web.additional_style : "" %>
|
<%= @web ? @web.additional_style : '' %>
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="Container">
|
<div id="Container">
|
||||||
<div id="Content">
|
<div id="Content">
|
||||||
|
|
||||||
<h1 id="pageName">
|
<h1 id="pageName">
|
||||||
<% if @page and (@page.name == 'HomePage') and %w( show published print ).include?(@action_name) %>
|
<% if @page and (@page.name == 'HomePage') and %w( show published print ).include?(@action_name) %>
|
||||||
|
@ -46,4 +47,10 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<%= render 'navigation' unless @web.nil? || @hide_navigation %>
|
<%= render 'navigation' unless @web.nil? || @hide_navigation %>
|
||||||
|
<%= @content_for_layout %>
|
||||||
|
|
||||||
|
</div> <!-- Content -->
|
||||||
|
</div> <!-- Container -->
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = 'Authors' %><%= render 'top' %>
|
<% @title = 'Authors' %>
|
||||||
|
|
||||||
<ul id="authorList">
|
<ul id="authorList">
|
||||||
<% for author in @authors %>
|
<% for author in @authors %>
|
||||||
|
@ -9,5 +9,3 @@
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
@title = "Editing #{@page.name}"
|
@title = "Editing #{@page.name}"
|
||||||
@content_width = 720
|
@content_width = 720
|
||||||
@hide_navigation = true
|
@hide_navigation = true
|
||||||
%><%= render 'top' %>
|
%>
|
||||||
|
|
||||||
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
|
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
|
||||||
|
|
||||||
|
@ -27,5 +27,3 @@ function cleanAuthorName() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "Edit Web" %><%= render 'top' %>
|
<% @title = "Edit Web" %>
|
||||||
|
|
||||||
<form action="../update_web" id="setup" method="post" onSubmit="cleanAddress(); return validateSetup()">
|
<form action="../update_web" id="setup" method="post" onSubmit="cleanAddress(); return validateSetup()">
|
||||||
<h2 style="margin-bottom: 3px">Name and address</h2>
|
<h2 style="margin-bottom: 3px">Name and address</h2>
|
||||||
|
@ -134,5 +134,3 @@ function validateSetup() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "Export" %><%= render 'top' %>
|
<% @title = "Export" %>
|
||||||
|
|
||||||
<p>You can export all the pages in this web as a zip file in either HTML (with working links and all) or the pure markup (to import in another wiki).</p>
|
<p>You can export all the pages in this web as a zip file in either HTML (with working links and all) or the pure markup (to import in another wiki).</p>
|
||||||
|
|
||||||
|
@ -10,5 +10,3 @@
|
||||||
<li><a href="../export_pdf">PDF</a>
|
<li><a href="../export_pdf">PDF</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "Feeds" %><%= render 'top' %>
|
<% @title = "Feeds" %>
|
||||||
|
|
||||||
<p>You can subscribe to this wiki by RSS and get either just the headlines of the pages that change or the entire page.</p>
|
<p>You can subscribe to this wiki by RSS and get either just the headlines of the pages that change or the entire page.</p>
|
||||||
|
|
||||||
|
@ -6,5 +6,3 @@
|
||||||
<li><a href="../rss_with_content<%= "?password=#{web.password}" if @web.password %>">Full content (RSS 2.0)</a>
|
<li><a href="../rss_with_content<%= "?password=#{web.password}" if @web.password %>">Full content (RSS 2.0)</a>
|
||||||
<li><a href="../rss_with_headlines<%= "?password=#{web.password}" if @web.password %>">Headlines (RSS 2.0)</a>
|
<li><a href="../rss_with_headlines<%= "?password=#{web.password}" if @web.password %>">Headlines (RSS 2.0)</a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "All Pages" %><%= render 'top' %>
|
<% @title = "All Pages" %>
|
||||||
|
|
||||||
<% unless @categories.empty? %>
|
<% unless @categories.empty? %>
|
||||||
<div id="categories">
|
<div id="categories">
|
||||||
|
@ -55,5 +55,3 @@
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "#{@page.plain_name} is locked" %><%= render 'top' %>
|
<% @title = "#{@page.plain_name} is locked" %>
|
||||||
|
|
||||||
<% if @page.lock_duration(Time.now) == 0 %>
|
<% if @page.lock_duration(Time.now) == 0 %>
|
||||||
<p><%= @page.locked_by_link %> just started editing this page.</p>
|
<p><%= @page.locked_by_link %> just started editing this page.</p>
|
||||||
|
@ -10,5 +10,3 @@
|
||||||
<a href="<%= @page.name %>?break_lock=1" accesskey="E">Edit the page anyway</a> |
|
<a href="<%= @page.name %>?break_lock=1" accesskey="E">Edit the page anyway</a> |
|
||||||
<a href="../show/<%= @page.name %>">Cancel</a>
|
<a href="../show/<%= @page.name %>">Cancel</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "#{@web_name} Login" %><% @hide_navigation = true %><%= render 'top' %>
|
<% @title = "#{@web_name} Login" %><% @hide_navigation = true %>
|
||||||
|
|
||||||
<form action="authenticate" method="post">
|
<form action="authenticate" method="post">
|
||||||
<p>
|
<p>
|
||||||
|
@ -6,6 +6,3 @@
|
||||||
<input type="password" name="password" />
|
<input type="password" name="password" />
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -2,7 +2,7 @@
|
||||||
@title = "Creating #{WikiWords.separate(CGI.unescape(@page_name))}"
|
@title = "Creating #{WikiWords.separate(CGI.unescape(@page_name))}"
|
||||||
@content_width = 720
|
@content_width = 720
|
||||||
@hide_navigation = true
|
@hide_navigation = true
|
||||||
%><%= render 'top' %>
|
%>
|
||||||
|
|
||||||
<%= render("#{@web.markup}_help") if @web %>
|
<%= render("#{@web.markup}_help") if @web %>
|
||||||
|
|
||||||
|
@ -23,5 +23,3 @@ function cleanAuthorName() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "Instiki Setup"; @content_width = 500 %><%= render 'top' %>
|
<% @title = "Instiki Setup"; @content_width = 500 %>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Congratulations on succesfully installing and starting Instiki.
|
Congratulations on succesfully installing and starting Instiki.
|
||||||
|
@ -74,5 +74,3 @@ function validateSetup() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "New Wiki Web"; @content_width = 500 %><%= render 'top' %>
|
<% @title = "New Wiki Web"; @content_width = 500 %>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Each web serves as an isolated name space for wiki pages, so different subjects or projects can write about different <i>MuppetShows</i>.
|
Each web serves as an isolated name space for wiki pages, so different subjects or projects can write about different <i>MuppetShows</i>.
|
||||||
|
@ -60,5 +60,3 @@ function validateSetup() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -1,5 +1,4 @@
|
||||||
<% @title = @page.plain_name %>
|
<% @title = @page.plain_name %>
|
||||||
<%= render 'top' %>
|
|
||||||
|
|
||||||
<div id="revision">
|
<div id="revision">
|
||||||
<%= @page.display_content %>
|
<%= @page.display_content %>
|
||||||
|
@ -77,5 +76,3 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
@hide_navigation = true
|
@hide_navigation = true
|
||||||
@style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
|
@style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
|
||||||
@inline_style = true
|
@inline_style = true
|
||||||
%><%= render 'top' %>
|
%>
|
||||||
|
|
||||||
<%= @page.display_content_for_export %>
|
<%= @page.display_content_for_export %>
|
||||||
|
|
||||||
|
@ -12,5 +12,3 @@
|
||||||
by
|
by
|
||||||
<%= @page.author_link({ :mode => :export }) %>
|
<%= @page.author_link({ :mode => :export }) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -3,8 +3,6 @@
|
||||||
@hide_navigation = false
|
@hide_navigation = false
|
||||||
@style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
|
@style_additions = ".newWikiWord { background-color: white; font-style: italic; }"
|
||||||
@inline_style = true
|
@inline_style = true
|
||||||
%><%= render 'top' %>
|
%>
|
||||||
|
|
||||||
<%= @page.display_published %>
|
<%= @page.display_published %>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "Recently Revised" %><%= render 'top' %>
|
<% @title = "Recently Revised" %>
|
||||||
|
|
||||||
<% unless @categories.empty? %>
|
<% unless @categories.empty? %>
|
||||||
<div id="categories">
|
<div id="categories">
|
||||||
|
@ -26,5 +26,3 @@
|
||||||
|
|
||||||
<% revision_date = page.revised_on %>
|
<% revision_date = page.revised_on %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "#{@page.plain_name} (Rev ##{@revision.number})" %><%= render 'top' %>
|
<% @title = "#{@page.plain_name} (Rev ##{@revision.number})" %>
|
||||||
|
|
||||||
<div id="revision">
|
<div id="revision">
|
||||||
<%= @revision.display_content %>
|
<%= @revision.display_content %>
|
||||||
|
@ -77,5 +77,3 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
|
@ -2,7 +2,7 @@
|
||||||
@title = "Rollback to #{@page.plain_name} Rev ##{@revision.number}"
|
@title = "Rollback to #{@page.plain_name} Rev ##{@revision.number}"
|
||||||
@content_width = 720
|
@content_width = 720
|
||||||
@hide_navigation = true
|
@hide_navigation = true
|
||||||
%><%= render 'top' %>
|
%>
|
||||||
|
|
||||||
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
|
<%= "<p style='color:red'>Please correct the error that caused this error in rendering:<br/><small>#{@params["msg"]}</small></p>" if @params["msg"] %>
|
||||||
|
|
||||||
|
@ -27,5 +27,3 @@ function cleanAuthorName() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = @results.length > 0 ? "#{@results.length} pages contains \"#{@params["query"]}\"" : "No pages contains \"#{@query}\"" %><%= render 'top' %>
|
<% @title = @results.length > 0 ? "#{@results.length} pages contains \"#{@params["query"]}\"" : "No pages contains \"#{@query}\"" %>
|
||||||
|
|
||||||
<% if @results.length > 0 %>
|
<% if @results.length > 0 %>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -11,5 +11,3 @@
|
||||||
|
|
||||||
<p>If you're a high-tech computer wizard, you might even want try constructing a regular expression. That's actually what Instiki uses, so go right ahead and flex your "[a-z]*Leet?RegExpSkill(s|z)"</p>
|
<p>If you're a high-tech computer wizard, you might even want try constructing a regular expression. That's actually what Instiki uses, so go right ahead and flex your "[a-z]*Leet?RegExpSkill(s|z)"</p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<% @title = "Wiki webs" %><%= render 'top' %>
|
<% @title = "Wiki webs" %>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<% for web in @webs %>
|
<% for web in @webs %>
|
||||||
|
@ -16,5 +16,3 @@
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<%= render 'bottom' %>
|
|
||||||
|
|
|
@ -427,7 +427,7 @@ class WikiControllerTest < Test::Unit::TestCase
|
||||||
@request.port = 8080
|
@request.port = 8080
|
||||||
|
|
||||||
r = process 'rss_with_headlines', 'web' => 'wiki1'
|
r = process 'rss_with_headlines', 'web' => 'wiki1'
|
||||||
|
|
||||||
assert_success
|
assert_success
|
||||||
pages = r.template_objects['pages_by_revision']
|
pages = r.template_objects['pages_by_revision']
|
||||||
assert_equal [@home, @oak, @elephant], pages,
|
assert_equal [@home, @oak, @elephant], pages,
|
||||||
|
|
Loading…
Reference in a new issue