Skip to content

Commit

Permalink
content_for? sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
BigCat committed Dec 13, 2010
1 parent 0496fdf commit 0ba0994
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions app/views/boards/show.html.erb
@@ -1,3 +1,6 @@
<% content_for(:sidebar) do %>
<%=render :partial => "categories/category_tree" %>
<% end %>
<h2>Board: <%= @board.name %></h2>

<%= will_paginate @topics %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/categories/index.html.erb
@@ -1 +1 @@
Forum
<%= render :partial => "categories/category_tree" %>
3 changes: 3 additions & 0 deletions app/views/categories/show.html.erb
@@ -1,3 +1,6 @@
<% content_for(:sidebar) do %>
<%=render :partial => "categories/category_tree" %>
<% end %>
<h2>Category: <%= @category.name %></h2>

<%= will_paginate @topics %>
Expand Down
19 changes: 12 additions & 7 deletions app/views/layouts/application.html.erb
Expand Up @@ -14,22 +14,27 @@
<%= render :partial => "common/user_block" %>
</div>
<div class="clear"></div>
<div id="content" class="grid_9">

<div id="content" class="grid_<%= content_for?(:sidebar) ? 9 : 12 %>">
<div class="box">
<div class="flash-messages">
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
</div>
<%= yield %>
<%= content_for?(:main_content) ? yield(:main_content) : yield %>
</div>
</div>
<div id="sidebar" class="grid_3">
<div class="box">
<h2>Sidebar</h2>
<%= render :partial => "categories/category_tree" %>

<% if content_for?(:sidebar) %>
<div id="sidebar" class="grid_3">
<div class="box">
<h2>Sidebar</h2>
<%= yield :sidebar %>
</div>
</div>
</div>
<% end %>
</div>

</body>
</html>

Empty file.
1 change: 0 additions & 1 deletion app/views/topics/_form.html.erb
Expand Up @@ -9,6 +9,5 @@
<%= text_area(:post, :content) %>
</p>
<%= hidden_field_tag(:attachment_ids, "") %>
<input type="button" id="preview-button" value="Preview" />
<%= f.submit %>

3 changes: 3 additions & 0 deletions app/views/topics/show.html.erb
@@ -1,3 +1,6 @@
<% content_for(:sidebar) do %>
<%=render :partial => "categories/category_tree" %>
<% end %>
<div>
Forum &gt;&gt; <%= link_to(@board.name, board_path(@board)) %>
</div>
Expand Down

0 comments on commit 0ba0994

Please sign in to comment.