Permalink
Browse files

Share organisation page header with about & news pages

  • Loading branch information...
1 parent e80997b commit b3d93b5e1d0a3aec56d69f963a04f42aab3987ed @tomstuart tomstuart committed Feb 1, 2012
@@ -0,0 +1,22 @@
+<section class="page_header organisation">
+ <h1 class="page_title name has_meta">
+ <% if local_assigns.has_key?(:title) %>
+ <%= title %>
+ <% else %>
+ <%= organisation.name %>
+ <% if organisation.acronym.present? %>
+ (<%= organisation.acronym %>)
+ <% end %>
+ <% end %>
+ </h1>
+ <div class="meta">
+ <% if organisation.organisation_type %>
+ <h2 class="category"><%= organisation.organisation_type.name %></h2>
+ <% end %>
+ <% organisation.parent_organisations.each do |organisation| %>
+ <%= link_to organisation_display_name(organisation), organisation_path(organisation), class: "organisation" %>
+ <% end %>
+ </div>
+</section>
+
+<%= render 'navigation', organisation: organisation %>
@@ -1,17 +1,7 @@
<% page_title "About " + @organisation.name %>
<div class="g3f organisation">
- <section class="page_header organisation">
- <h1 class="page_title"><%= @organisation.name %>
- <% if @organisation.acronym.present? %>
- (<%= @organisation.acronym %>)
- <% end %>
- </h1>
- <% if @organisation.organisation_type %>
- <h2 class="category"><%= @organisation.organisation_type.name %></h2>
- <% end %>
- </section>
- <%= render 'navigation', organisation: @organisation %>
+ <%= render 'header', organisation: @organisation %>
<div class="g3f document_page">
<div class="g2 document_view">
@@ -1,12 +1,6 @@
<% page_title "#{@organisation.name} News" %>
<div class="g3f organisation">
- <section class="page_header organisation" id="news_articles">
- <h1 class="page_title"><%= @organisation.name %> News</h1>
- <% if @organisation.organisation_type %>
- <h2 class="category"><%= @organisation.organisation_type.name %></h2>
- <% end %>
- </section>
- <%= render 'navigation', organisation: @organisation %>
+ <%= render 'header', organisation: @organisation, title: "#{@organisation.name} News" %>
<div class="g3" style="margin-top: 1.5em">
<% if @news_articles.any? %>
@@ -2,22 +2,7 @@
<%= content_tag_for :div, @organisation, class: "hcard" do %>
<div class="g3f">
- <section class="page_header organisation">
- <h1 class="page_title name has_meta"><%= @organisation.name %>
- <% if @organisation.acronym.present? %>
- (<%= @organisation.acronym %>)
- <% end %>
- </h1>
- <div class="meta">
- <% if @organisation.organisation_type %>
- <h2 class="category"><%= @organisation.organisation_type.name %></h2>
- <% end %>
- <% @organisation.parent_organisations.each do |organisation| %>
- <%= link_to organisation_display_name(organisation), organisation_path(organisation), class: "organisation" %>
- <% end %>
- </div>
- </section>
- <%= render 'navigation', organisation: @organisation %>
+ <%= render 'header', organisation: @organisation %>
</div>
<div class="g3f page_detail">

0 comments on commit b3d93b5

Please sign in to comment.