Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

Commit

Permalink
restructured (but NOT refactored) the views and layouts and partials …
Browse files Browse the repository at this point in the history
…for page
  • Loading branch information
Adam Dill committed Aug 24, 2008
1 parent c1d8f15 commit feb9cee
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 91 deletions.
7 changes: 2 additions & 5 deletions app/views/content/multipage.html.erb
@@ -1,8 +1,5 @@
<% if @page.display_title %>
<h1><%= @page.full_title %></h1>
<h2><%= @page.full_title %></h2>
<% end %>
<%= @page.page_body %>

<br/><br/>
<div id="page_controls"><%= page_controls(@page) %></div>

<div id="page_controls"><%= page_controls(@page) %></div>
6 changes: 4 additions & 2 deletions app/views/content/page.html.erb
@@ -1,2 +1,4 @@
<% if @page.display_title %><h1><%= @page.full_title %></h1><% end %>
<%= @page.page_body %>
<% if @page.display_title %>
<h2><%= @page.full_title %></h2>
<% end %>
<%= @page.page_body %>
27 changes: 14 additions & 13 deletions app/views/layouts/page.html.erb
@@ -1,28 +1,29 @@
<!-- Generated Using Ansuz CMS -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" id="bodybg">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Ansuz CMS: <%= @page.title if @page%></title>
<title>Ansuz CMS: <%= @page.title if @page -%></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta name="description" content="Ansuz Content Management System" />
<meta name="keywords" content="Ansuz Content Management System" />
<link rel="shortcut icon" href="favicon.ico" type="image/vnd.microsoft.icon" />
<link rel="icon" href="favicon.ico" type="image/vnd.microsoft.icon" />
<%= stylesheet_link_tag 'yui-reset-fonts' %>
<%= stylesheet_link_tag 'base' %>
<%= stylesheet_link_tag 'sprite' %>
<%= javascript_include_tag :defaults %>
<%= stylesheet_link_tag 'yui-reset-fonts' -%>
<%= stylesheet_link_tag 'base' -%>
<%= stylesheet_link_tag 'sprite' -%>
<%= javascript_include_tag :defaults -%>
<!--[if lt IE 7.]><%= javascript_include_tag 'pngfix.js' %><![endif]-->
</head>
<body>
<div id="header"></div><!-- end div header -->
<div id="navigation"><%= render :partial => "page/flatTopNav"%></div>
<div id="breadcrumb"><%= render :partial => "page/breadcrumb" if @page!=@root %></div>
<div id="content"><%= @content_for_layout %></div>
<div id="flatChildNav"><%= render :partial => "page/flatChildNav" %></div>
<div id="footer"><%= (render :partial => "page/footer") %></div>
<h1 id="header"><span>Ansuz CMS</span></h1>
<div id="content">
<%= render :partial => "page/breadcrumb" if @page!=@root -%>
<%= @content_for_layout -%>
<%= render :partial => "page/child_nav" if !@page.children.empty? -%>
</div>
<%= render :partial => "page/top_nav" -%>
<%= render :partial => "page/footer" -%>
</body>
</html>
15 changes: 8 additions & 7 deletions app/views/page/_breadcrumb.html.erb
@@ -1,7 +1,8 @@
<% url = ""
@breadcrumb.each do |crumb| # Itterate through breadcrumb, from root to parent of current
url = (url!="")? url+crumb.name+"/" : url = "/" # Create URLs for Breadcrumb sequentially
%>
<%= link_to crumb.title, ((url=='/')? '/' + @root.name + '/' : url ) %> &gt; <% # Code for generating links and '>' seperators
end # End breadcrumb itteration
%><b><%= (@pageNum!=nil)? link_to(@page.title, './') + " &gt; page " + @pageNum.to_s : @page.title %></b> <%# Print the current page without a link and end the div %>
<div id="breadcrumb">
<% url = ""
@breadcrumb.each do |crumb|
url = (url!="")? url+crumb.name+"/" : url = "/" %>
<%= link_to crumb.title, ((url=='/')? '/' + @root.name + '/' : url ) %> &gt;
<% end %>
<b><%= (@pageNum!=nil)? link_to(@page.title, './') + " &gt; page " + @pageNum.to_s : @page.title %></b>
</div>
10 changes: 10 additions & 0 deletions app/views/page/_child_nav.html.erb
@@ -0,0 +1,10 @@
<% if @page.show_sub_menu %>
<div id="flatChildNav">
<h4>Child Pages:</h4>
<ul>
<% @page.children.each do |page| %>
<li><a href='<%= page.name %>/'><%= page.title %></a></li>
<% end %>
</ul>
</div>
<% end %>
43 changes: 0 additions & 43 deletions app/views/page/_dropTopNav.html.erb

This file was deleted.

6 changes: 0 additions & 6 deletions app/views/page/_flatChildNav.html.erb

This file was deleted.

9 changes: 0 additions & 9 deletions app/views/page/_flatTopNav.html.erb

This file was deleted.

10 changes: 4 additions & 6 deletions app/views/page/_footer.html.erb
@@ -1,6 +1,4 @@
<ul><% # Center and open UL for Footer links: top level navigation
@topNav.each do |page| # Itterate through top level navigation: Root and all it's sub-pages
%><li><a href='<%= "/"+page.name %>'><%= page.title %></a></li> <% # Code for each link
end # End Itteration
%>
</ul><%# Close UL %>
<div id="footer">
<h4>Footer Message here</h4>
<h5>Copyright &copy; Message here</h5>
</div>
12 changes: 12 additions & 0 deletions app/views/page/_top_nav.html.erb
@@ -0,0 +1,12 @@
<div id="navigation">
<h3>Navigation:</h3>
<ul>
<% @topNav.each do |page|
isActive = (page==@breadcrumb[1]||(@breadcrumb.length==1 && page==@page))
url = "/"+page.name+"/" %>
<li <%= "id=\"active\"" if isActive -%> >
<a href='<%= url %>'><%= page.title -%></a>
</li>
<% end %>
</ul>
</div>

0 comments on commit feb9cee

Please sign in to comment.