Permalink
Browse files

Stop referring to "parent" and "child" organisations

This has been done by making the front-end terminology more vague, so
we're leaving the association names alone for the sake of clarity.
  • Loading branch information...
2 parents 1a5ef63 + 5efa544 commit 3ab3027e65c9f6985aaf28aea33609e85d454869 @tomstuart tomstuart committed Feb 1, 2012
@@ -24,7 +24,8 @@
h2.category {
@include type-16;
- margin-left: 1%;
+ display: inline;
+ margin-right: 0.5em;
margin-bottom: 0;
}
@@ -10,8 +10,8 @@
<%= organisation_form.select :organisation_type_id, options_from_collection_for_select(OrganisationType.all, "id", "name", organisation.organisation_type_id), {include_blank: true}, class: 'chzn-select', data: { placeholder: "Choose the organisation type..." } %>
</fieldset>
<fieldset>
- <%= organisation_form.label :parent_organisation_ids, 'Parent organisations' %>
- <%= organisation_form.select :parent_organisation_ids, options_from_collection_for_select(Organisation.all - [organisation_form.object], 'id', 'name', organisation.parent_organisation_ids), {}, multiple: true, class: 'chzn-select', data: { placeholder: "Choose parent organisations..." } %>
+ <%= organisation_form.label :parent_organisation_ids, 'Associated departments' %>
+ <%= organisation_form.select :parent_organisation_ids, options_from_collection_for_select(Organisation.all - [organisation_form.object], 'id', 'name', organisation.parent_organisation_ids), {}, multiple: true, class: 'chzn-select', data: { placeholder: "Choose associated departments..." } %>
</fieldset>
<fieldset>
<%= organisation_form.label :policy_area_ids, 'Policy areas' %>
@@ -3,14 +3,19 @@
<%= content_tag_for :div, @organisation, class: "hcard" do %>
<div class="g3f">
<section class="page_header organisation">
- <h1 class="page_title name"><%= @organisation.name %>
+ <h1 class="page_title name has_meta"><%= @organisation.name %>
<% if @organisation.acronym.present? %>
(<%= @organisation.acronym %>)
<% end %>
</h1>
- <% if @organisation.organisation_type %>
- <h2 class="category"><%= @organisation.organisation_type.name %></h2>
- <% end %>
+ <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 %>
</div>
@@ -86,20 +91,11 @@
<% if @organisation.child_organisations.any? %>
<div class="g1 related_documents">
<section id="child_organisations">
- <h1>Child organisations</h1>
+ <h1>Associated organisations</h1>
<%= render partial: "organisations/list", locals: {organisations: @organisation.child_organisations} %>
</section>
</div>
<% end %>
-
- <% if @organisation.parent_organisations.any? %>
- <div class="g1 related_documents">
- <section id="parent_organisations">
- <h1>Parent organisations</h1>
- <%= render partial: "organisations/list", locals: {organisations: @organisation.parent_organisations} %>
- </section>
- </div>
- <% end %>
</div>
<div class="g3">
@@ -103,7 +103,7 @@
Then /^I should see that "([^"]*)" is the responsibility of "([^"]*)"$/ do |child_org_name, parent_org_name|
parent_org = Organisation.find_by_name!(parent_org_name)
- assert page.has_css?("#parent_organisations #{record_css_selector(parent_org)}")
+ assert page.has_css?(".meta a[href='#{organisation_path(parent_org)}']")
end
Then /^I should see the following speeches are associated with the "([^"]*)" organisation:$/ do |name, table|
@@ -183,7 +183,7 @@ class OrganisationsControllerTest < ActionController::TestCase
parent_organisation = create(:organisation)
child_organisation = create(:organisation, parent_organisations: [parent_organisation])
get :show, id: child_organisation
- assert_select "#parent_organisations a[href='#{organisation_path(parent_organisation)}']"
+ assert_select ".meta a[href='#{organisation_path(parent_organisation)}']"
end
test "should not display the parent organisations section" do

0 comments on commit 3ab3027

Please sign in to comment.