Skip to content

Commit

Permalink
Another attempt at a modular system to build things. I call this syst…
Browse files Browse the repository at this point in the history
…em "HTML5". See lighthouse for more details. [concerto#105 state:resolved]
  • Loading branch information
bamnet committed Aug 17, 2010
1 parent 3cd3bfc commit be0439e
Show file tree
Hide file tree
Showing 13 changed files with 141 additions and 141 deletions.
2 changes: 1 addition & 1 deletion app/controllers/contents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def new
@content = @content_const.new()

respond_to do |format|
format.html { render :layout => 'manual' } # new.html.erb
format.html { } # new.html.erb
format.xml { render :xml => @content }
end
end
Expand Down
12 changes: 0 additions & 12 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,4 @@ def back_button(path, name = "Back", options = {})
tag("div", {:class => "C-header_back"}, true) + link_to(name, path, options) + raw("</div>")
end

# Figure out which class we should be using to setup the sidebar.
# The default for no sidebar is "no" but if a sidebar is used
# the default becomes "sm" (small) but it can be overridden by
# setting @sidebar_class anywhere a sidebar is used.
def sidebar_class
if content_for?(:sidebar)
@sidebar_class || "sm"
else
"no"
end
end

end
66 changes: 36 additions & 30 deletions app/views/contents/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
<% content_for :header do %>
<%= back_button screens_path %>
<h1>New Screen</h1>
<% end %>
<% content_for :sidebar do %>
<ul class="feedbuttons">
<li class="selected"><%= link_to "#", :class => "button" do %><span>99+</span>Service &amp; Community<% end %></li>
<li><%= link_to "#", :class => "button" do %><span>7</span>Entertainment<% end %></li>
</ul>
<% end %>

<a class="button" href="#" onclick="this.blur();"><span>Design a Graphic</span></a>
<% @contents.each do |content| %>
<ul class="iconlist">
<li>
<a href="">
<div class="iconlist_padding">
<div class="ins">
<div class="type-folder"><%= content.data %><%#= image_tag("ph/ph.png", :alt => "") %></div>
</div>
<h2>
<%= content.name %>
<br />
<%= content.start_time %> - <%= content.end_time %>
</h2>
</div>
</a>
</li>
</ul>
<% end %>
<section class="C-full sm">
<header>
<%= back_button "#" %>
<h1>Browse Content</h1>
</header>
<div class="C-cont">
<article>
<a class="button" href="#" onclick="this.blur();"><span>Design a Graphic</span></a>
<% @contents.each do |content| %>
<ul class="iconlist">
<li>
<a href="">
<div class="iconlist_padding">
<div class="ins">
<div class="type-folder"><%= content.data %><%#= image_tag("ph/ph.png", :alt => "") %></div>
</div>
<h2>
<%= content.name %>
<br />
<%= content.start_time %> - <%= content.end_time %>
</h2>
</div>
</a>
</li>
</ul>
<% end %>
</article>
<aside>
<ul class="feedbuttons">
<li class="selected"><%= link_to "#", :class => "button" do %><span>99+</span>Service &amp; Community<% end %></li>
<li><%= link_to "#", :class => "button" do %><span>7</span>Entertainment<% end %></li>
</ul>
</aside>
<div class="clear"></div>
</div>
</section>
30 changes: 15 additions & 15 deletions app/views/contents/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<div class="MS-frame">
<h1>Select Content Type to Add</h1>
<section class="MS-frame">
<header>
<h1>Select Content Type to Add</h1>
</header>
<div class="MS-outer">
<div class="MS-inner">
<article>
<ul class="iconlist">
<% content_types.each do |subclass| %>
<li>
Expand All @@ -17,24 +19,22 @@
<% end%>
</ul>
<div class="clear"></div>
</div>
</article>
</div>
</div>
</section>

<div class="C-full lg">
<div class="C-header">
<section class="C-full lg">
<header>
<%= back_button "#" %>
<div class="C-header_right"><a class="button" href="#">Design a Graphic</a></div>
<h1>Add <%= @content.class %> Content</h1>
</div>
</header>
<div class="C-cont">
<div class="C-center column">
<article>
<%= render 'form' %>
</div>
<div class="C-sidebar column">
<%# content_for :left_sidebar do %>
<%# end %>
</div>
</article>
<aside>
</aside>
<div class="clear"></div>
</div>
</div>
</section>
17 changes: 12 additions & 5 deletions app/views/feeds/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<% content_for :header do %>
<%= back_button feeds_path %>
<h1>Edit Feed</h1>
<% end %>
<%= render 'form' %>
<section class="C-full no">
<header>
<%= back_button feeds_path %>
<h1>Edit Feed</h1>
</header>
<div class="C-cont">
<article>
<%= render 'form' %>
</article>
<div class="clear"></div>
</div>
</section>
17 changes: 12 additions & 5 deletions app/views/feeds/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<% content_for :header do %>
<%= back_button feeds_path %>
<h1>New Feed</h1>
<% end %>
<%= render 'form' %>
<section class="C-full no">
<header>
<%= back_button feeds_path %>
<h1>New Feed</h1>
</header>
<div class="C-cont">
<article>
<%= render 'form' %>
</article>
<div class="clear"></div>
</div>
</section>
17 changes: 12 additions & 5 deletions app/views/groups/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<% content_for :header do %>
<%= back_button groups_path %>
<h1>Edit Group</h1>
<% end %>
<%= render 'form' %>
<section class="C-full no">
<header>
<%= back_button groups_path %>
<h1>Edit Group</h1>
</header>
<div class="C-cont">
<article>
<%= render 'form' %>
</article>
<div class="clear"></div>
</div>
</section>
17 changes: 12 additions & 5 deletions app/views/groups/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<% content_for :header do %>
<%= back_button groups_path %>
<h1>New Group</h1>
<% end %>
<%= render 'form' %>
<section class="C-full no">
<header>
<%= back_button groups_path %>
<h1>New Group</h1>
</header>
<div class="C-cont">
<article>
<%= render 'form' %>
</article>
<div class="clear"></div>
</div>
</section>
18 changes: 1 addition & 17 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,7 @@
<% if flash[:notice] %>
<p class="notice"><%= notice %></p>
<% end %>
<div class="C-full <%= sidebar_class %>">
<div class="C-header">
<% if content_for?(:header) %>
<%= yield :header %>
<% end %>
</div>
<div class="C-cont">
<div class="C-center column">
<%= yield %>
</div>
<% if content_for?(:sidebar) %>
<div class="C-sidebar column">
<%= yield :sidebar %>
</div>
<% end %>
<div class="clear"></div>
</div>
<%= yield %>
</div>
</body>
</html>
20 changes: 0 additions & 20 deletions app/views/layouts/manual.html.erb

This file was deleted.

17 changes: 12 additions & 5 deletions app/views/screens/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<% content_for :header do %>
<%= back_button screens_path %>
<h1>Edit Screen</h1>
<% end %>
<%= render 'form' %>
<section class="C-full no">
<header>
<%= back_button screens_path %>
<h1>Edit Screen</h1>
</header>
<div class="C-cont">
<article>
<%= render 'form' %>
</article>
<div class="clear"></div>
</div>
</section>
17 changes: 12 additions & 5 deletions app/views/screens/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<% content_for :header do %>
<%= back_button screens_path %>
<h1>New Screen</h1>
<% end %>
<%= render 'form' %>
<section class="C-full no">
<header>
<%= back_button screens_path %>
<h1>New Screen</h1>
</header>
<div class="C-cont">
<article>
<%= render 'form' %>
</article>
<div class="clear"></div>
</div>
</section>
32 changes: 16 additions & 16 deletions public/stylesheets/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,25 @@ h5 { font-size:1.3em; }

/*########## BASIC LAYOUT ##########*/
.C-full { margin-bottom:18px; box-shadow: #ababab 0 3px 2px; -moz-box-shadow:#ababab 0 3px 2px; -webkit-box-shadow: #ababab 0 3px 2px; }
.C-header { background:#FFF url(../images/layout/C/header_bg.png) bottom left repeat-x; padding:12px 14px; padding-bottom:5px; border:solid 1px #ababab; border-bottom:0px; border-top-left-radius:8px; -moz-border-radius-topleft:8px; border-top-right-radius:8px; -moz-border-radius-topright:8px; }
.C-header h1 { color:#666; font-size:1.8em; letter-spacing:-0.05em; text-shadow:0 1px #eee; padding-top:9px; }
.C-full header { background:#FFF url(../images/layout/C/header_bg.png) bottom left repeat-x; padding:12px 14px; padding-bottom:5px; border:solid 1px #ababab; border-bottom:0px; border-top-left-radius:8px; -moz-border-radius-topleft:8px; border-top-right-radius:8px; -moz-border-radius-topright:8px; }
.C-full header h1 { color:#666; font-size:1.8em; letter-spacing:-0.05em; text-shadow:0 1px #eee; padding-top:9px; }
.C-cont { padding-left:184px; border-left:solid 1px #ababab; border-right:solid 1px #ababab; }
.C-cont .column { position:relative; float:left; }
.C-center { padding:0px; width:100%; } /* padding inside of this div should be determined by the contained content, not by a wrapper div defined here! */
.C-sidebar { min-height:300px; width:164px; padding: 0 10px; right:184px; margin-left:-100%; }
.C-cont article, .C-cont aside { position:relative; float:left; }
.C-full article { padding:0px; width:100%; } /* padding inside of this div should be determined by the contained content, not by a wrapper div defined here! */
.C-full aside { min-height:300px; width:164px; padding: 0 10px; right:184px; margin-left:-100%; }
.C-header_back { float:left; margin-left:-37px; padding-top:12px; margin-right:8px; } /* This is an optional floated area for the back button that appears to the left of the header. */
.C-header_right { float:right; padding-top:8px; margin-left:20px; } /* this is an optional floated area that appears to the right of the header */

/* for each variant, overwrite the padding-left for C-cont and change the background image to fit the right faux columns */
/* SMALL VARIANT (most things, esp. browsing content in feeds) */
.C-full.sm .C-cont { background:#FFF url(../images/layout/C/bg_sm.png) top left repeat-y; }
.C-full.sm .C-sidebar { background:url(../images/layout/C/sidebar_sm.png) top left no-repeat; }
.C-full.sm aside { background:url(../images/layout/C/sidebar_sm.png) top left no-repeat; }
/* LARGE VARIANT (Add Content with live preview screen) */
.C-full.lg .C-cont { background:#FFF url(../images/layout/C/bg_lg.png) top left repeat-y; padding-left:318px; }
.C-full.lg .C-sidebar { background:url(../images/layout/C/sidebar_lg.png) top left no-repeat; width:298px; right:318px; }
.C-full.lg aside { background:url(../images/layout/C/sidebar_lg.png) top left no-repeat; width:298px; right:318px; }
/* NO-SIDEBAR VARIANT (Basic New/Edit Forms) */
.C-full.no .C-cont { background:#FFF; padding-left:0px; }
.C-full.no .C-sidebar { background:#FFF; width:0; display:none; } /* this div can be omitted completely if desired */
.C-full.no aside { background:#FFF; width:0; display:none; } /* this div can be omitted completely if desired */


/*##########################################################################*/
Expand Down Expand Up @@ -163,14 +163,14 @@ form .submit_bar { background:#FFF url(../images/layout/C/submit_bar_bg.png) top
/*##########################################################################*/

.MS-frame { }
.MS-frame h1 { color:#666; margin-left:30px; font-size:1.8em; text-shadow:0 1px #FFF; letter-spacing:-0.05em; margin-bottom:4px; }
.MS-outer { background:url(../images/layout/MS/outer.png) repeat; padding:6px; border-radius:20px; -moz-border-radius:20px; margin-bottom:22px; }
.MS-inner { background:url(../images/layout/MS/inner.png) repeat; border-radius:14px; -moz-border-radius:14px; padding:17px; }
.MS-inner ul.iconlist { margin:0px -6px; }
.MS-inner ul.iconlist li { margin:0px 6px; }
.MS-inner ul.iconlist li a { color:#FFF; text-decoration:none; border-radius:8px; -moz-border-radius:8px; background:url(../images/layout/MS/iconlist_inactive.png) repeat; border:solid 1px #999; opacity:0.5; }
.MS-inner ul.iconlist li a:hover { opacity:1; }
.MS-inner ul.iconlist li a h2 { font-size:1.5em; color:#FFF !important; }
.MS-frame header h1 { color:#666; margin-left:30px; font-size:1.8em; text-shadow:0 1px #FFF; letter-spacing:-0.05em; margin-bottom:4px; }
.MS-frame .MS-outer { background:url(../images/layout/MS/outer.png) repeat; padding:6px; border-radius:20px; -moz-border-radius:20px; margin-bottom:22px; }
.MS-frame article { background:url(../images/layout/MS/inner.png) repeat; border-radius:14px; -moz-border-radius:14px; padding:17px; }
.MS-frame article ul.iconlist { margin:0px -6px; }
.MS-frame article ul.iconlist li { margin:0px 6px; }
.MS-frame article ul.iconlist li a { color:#FFF; text-decoration:none; border-radius:8px; -moz-border-radius:8px; background:url(../images/layout/MS/iconlist_inactive.png) repeat; border:solid 1px #999; opacity:0.5; }
.MS-frame article ul.iconlist li a:hover { opacity:1; }
.MS-frame article ul.iconlist li a h2 { font-size:1.5em; color:#FFF !important; }



Expand Down

0 comments on commit be0439e

Please sign in to comment.