Permalink
Browse files

Custom home page and preliminary layout and css

  • Loading branch information...
1 parent cb5c43b commit 244116ad4332a64f32f8ab6f94c41457167a8d3c @SNlsn committed Feb 20, 2012
@@ -1,14 +1,20 @@
-initial application layout (views>layouts>applicaiton.html.erb:
+initial application layout (views>layouts>application.html.erb:
<!DOCTYPE html>
<html>
<head>
- <title>Ruby on Rails Tutorial Sample App | <%= yield(:title) %></title>
+ <title>Unify2 | <%= yield(:title) %></title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
- <%= yield %>
+ <div id="container">
+ <% flash.each do |name, msg| %>
+ <%= content_tag :div, msg, :id => "flash_#{name}" %>
+ <% end %>
+ <%= content_tag :h1, yield(:title) if :title? %>
+ <%= yield %>
+ </div>
</body>
</html>
@@ -91,7 +91,6 @@ rails generate controller home index --no-test-framework
Put placeholder text in home index view:
<% provide(:title, 'Unify2: Home') %>
-<h1>Unify2</h1>
<p>
This is the home page for version 2 of the Unify application.
</p>
@@ -101,6 +100,10 @@ git rm public/index.html
modify routes:
root :to => "home#index"
+Replace initial app layout (Hartle) and stylesheet (Bates, nifty layout) as outlined in "initial layout and css" document.
+
+Start the server and see what happens.
+
If everything is okay, merge branch:
git checkout master
git merge custom-homepage
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -9,5 +9,83 @@
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
- *= require_tree .
+ * I think require_tree might lead to trouble with calendar, so I have, for the moment,
+ * removed the = sign which I hope will disable it
+ * require_tree .
*/
+/* generated by nifty-generator, layout module */
+body {
+ background-color: #4B7399;
+ font-family: Verdana, Helvetica, Arial;
+ font-size: 14px;
+}
+
+a img {
+ border: none;
+}
+
+a {
+ color: #0000FF;
+}
+
+.clear {
+ clear: both;
+ height: 0;
+ overflow: hidden;
+}
+
+#container {
+ width: 75%;
+ margin: 0 auto;
+ background-color: #FFF;
+ padding: 20px 40px;
+ border: solid 1px black;
+ margin-top: 20px;
+}
+
+#flash_notice, #flash_error, #flash_alert {
+ padding: 5px 8px;
+ margin: 10px 0;
+}
+
+#flash_notice {
+ background-color: #CFC;
+ border: solid 1px #6C6;
+}
+
+#flash_error, #flash_alert {
+ background-color: #FCC;
+ border: solid 1px #C66;
+}
+
+.fieldWithErrors {
+ display: inline;
+}
+
+.error_messages {
+ width: 400px;
+ border: 2px solid #CF0000;
+ padding: 0px;
+ padding-bottom: 12px;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+ font-size: 12px;
+}
+
+.error_messages h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 10px;
+ font-size: 12px;
+ margin: 0;
+ background-color: #c00;
+ color: #fff;
+}
+
+.error_messages p {
+ margin: 8px 10px;
+}
+
+.error_messages ul {
+ margin: 0;
+}
@@ -0,0 +1,3 @@
+// Place all the styles related to the home controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,4 @@
+class HomeController < ApplicationController
+ def index
+ end
+end
@@ -0,0 +1,2 @@
+module HomeHelper
+end
@@ -0,0 +1,4 @@
+<% provide(:title, 'Unify2: Home') %>
+<p>
+ This is the home page for version 2 of the Unify application.
+</p>
@@ -1,14 +1,18 @@
<!DOCTYPE html>
<html>
-<head>
- <title>Unify2</title>
- <%= stylesheet_link_tag "application", :media => "all" %>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
-</head>
-<body>
-
-<%= yield %>
-
-</body>
-</html>
+ <head>
+ <title>Unify2 | <%= yield(:title) %></title>
+ <%= stylesheet_link_tag "application", :media => "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+ </head>
+ <body>
+ <div id="container">
+ <% flash.each do |name, msg| %>
+ <%= content_tag :div, msg, :id => "flash_#{name}" %>
+ <% end %>
+ <%= content_tag :h1, yield(:title) if :title? %>
+ <%= yield %>
+ </div>
+ </body>
+</html>
View
@@ -1,4 +1,7 @@
Unify2::Application.routes.draw do
+ get "home/index"
+ root :to => "home#index"
+
# The priority is based upon order of creation:
# first created -> highest priority.
Oops, something went wrong.

0 comments on commit 244116a

Please sign in to comment.