Major update of Selectricity to work with Rails 2.2.2 from 1.2!
[selectricity-live] / app / views / layouts / main.rhtml
index 027ef145567213b95a8406ffc5450a8467c44588..75f196ae3c4c9cb9fbcc4c28bacd008802167cab 100644 (file)
@@ -1,49 +1,61 @@
-<% %>
-<html>
-    <head>
-        <title><%= @page_title || "Selectricity" %></title>
-        <%= stylesheet_link_tag "main", :media => "all" %>
-        <%= javascript_include_tag "prototype", "effects", "dragdrop", "controls" %>
-    </head>
-    <body>
-        <div id="top">
-           <% if @page_title %>
-              <h3><%= @page_title %></h3>  
-           <% else %>
-             <span id="headertext"><%= link_to('<h3>Selectricity<br />
-             <font size="-1">Voting Machinery for the Masses</font></h3>', :controller => 
-             'site', :action => 'index')%></span>
-          <% end %>
-
-           <div id="links">
-             <% if session[:user] %>
-               Welcome <strong><%= User.find(session[:user]).login.capitalize %></strong>
-               <%= link_to("Logout", :controller => "account", :action => "logout") %>  |
-             <% else %>
-               <%= link_to("Login", :controller => "account", :action => "login")
-                %>/<%= link_to("Sign up", :controller => "account", :action => "signup")%>
-             <% end %> |
-             
-            <%= link_to("Help/About", :controller => "site", :action => "about") %>
-           </div>
-        </div>
-        
+<!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">
+  <head>
+    <title><%= @page_title || "Selectricity" %></title>
+    <%= stylesheet_link_tag "common", :media => "all" %>
+    <%= stylesheet_link_tag "main", :media => "all" %>
+    <%= stylesheet_link_tag *(@stylesheets) %>
+    <%begin%>
+      <%= stylesheet_link_tag "ie6hacks", :media => "all" if 
+      request.user_agent =~ /msie\s(5\.[5-9]|[6]\.[0-9]*).*(win)/i %>
+    <%rescue NoMethodError%>
+    <%end%>
+    <%= javascript_include_tag "prototype", "effects", "dragdrop", "controls" %>
+  </head>
+
+  <body>
+  <div id="page-wrapper">
+
+    <div id="left-side">
+      <%= link_to "<h1>Selectricity</h1>", :controller => 'front' %>
+
+      <div id="left-side-content">
         <% if flash[:notice]%>
-          <div id="notice"><%= flash[:notice] %></div>
+        <div id="notice"><%= flash[:notice] %></div>
         <% end%>
 
-        <div id="main">
-          <%= @content_for_layout %>
+        <%= @sidebar_content %>
+      </div>
+
+    </div>
+
+    <div id="right-side">
+      <div id="top-bar">
+           <div id="bar-left">
+        <% if session[:user] %>
+          <%= link_to User.find(session[:user]).login.downcase,
+                      :controller => "account",
+                      :action => "summary", :id => session[:user][:id] %>
+          <%= link_to "logout", :controller => "account",
+                      :action => "logout" %> 
+        <% else %>
+          <%= link_to "login", :controller => "account", :action => "login" 
+          %><!-- /<%= link_to "sign up", :controller => "account", :action => "signup" %>-->
+        <% end %> 
         </div>
 
-        <div id="footer">
-          <hr />
-         <%= link_to "Copyleft", "http://code.selectricity.org/"
-         %> 2006, 2007 || 
-         <%= link_to "MIT Media Lab", "http://www.media.mit.edu" %> and the
-         <a href="http://code.selectricity.org/team">Selectricity Team</a>
-       </div>
+        <div id="bar-right">
+          <%= link_to "help/about", :controller => 'about' %>
+        </div>
+      </div> <!-- end of top-bar -->
+      
+      <div id="main-box">
+        <%= @content_for_layout %>
+      </div>
 
-    </body>
+    </div> <!-- end of right-side -->
+    <div class="clear-div"></div>
+    <%= render :partial => 'layouts/footer' %>
+    </div>
+  </body>
 </html>

Benjamin Mako Hill || Want to submit a patch?