Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tighten up the organisation hierarchy.

This commit contains a few related small changes:

- Re-order the organisation navigation
  (https://www.pivotaltracker.com/story/show/24406295)
- Change references from 'board members' to 'management team'
  (https://www.pivotaltracker.com/story/show/24406329)
- Link to the 'Management Team' from the 'About' page rather than the
  main organisation nav
  (https://www.pivotaltracker.com/story/show/24406329)
- Link to the 'Management Team' from underneath the top civil servant
  (https://www.pivotaltracker.com/story/show/24424937)
  • Loading branch information...
commit 5a5d0b5e5572085f45844435c18f1957a88c4ac4 1 parent 9e50b6d
@lazyatom lazyatom authored
View
4 app/controllers/organisations_controller.rb
@@ -1,6 +1,6 @@
class OrganisationsController < PublicFacingController
before_filter :load_organisation, only: [:show, :about, :contact_details, :announcements, :consultations,
- :ministers, :board_members, :policies, :publications]
+ :ministers, :management_team, :policies, :publications]
def index
@organisations_by_type = Organisation.in_listing_order.group_by(&:organisation_type)
@@ -41,7 +41,7 @@ def publications
@publications = Publication.published.in_organisation(@organisation).order("publication_date DESC")
end
- def board_members
+ def management_team
end
def policies
View
9 app/helpers/organisation_helper.rb
@@ -8,7 +8,14 @@ def organisation_display_name(organisation)
end
def organisation_navigation_link_to(body, path)
- link_to body, path, class: ('current' if current_organisation_navigation_path(params) == path)
+ if (current_organisation_navigation_path(params) == path) ||
+ (params[:action] == "management_team" && path == current_organisation_navigation_path(params.merge(action: "about")))
+ css_class = 'current'
+ else
+ css_class = nil
+ end
+
+ link_to body, path, class: css_class
end
def current_organisation_navigation_path(params)
View
7 app/views/organisations/_navigation.html.erb
@@ -2,10 +2,9 @@
<%= organisation_navigation_link_to 'Home', organisation_path(organisation) %>
<%= organisation_navigation_link_to 'About', about_organisation_path(organisation) %>
<%= organisation_navigation_link_to 'News & speeches', announcements_organisation_path(organisation) %>
- <%= organisation_navigation_link_to 'Consultations', consultations_organisation_path(organisation) %>
- <%= organisation_navigation_link_to 'Contact details', contact_details_organisation_path(organisation) %>
- <%= organisation_navigation_link_to 'Ministers', ministers_organisation_path(organisation) %>
- <%= organisation_navigation_link_to 'Board members', board_members_organisation_path(organisation) %>
<%= organisation_navigation_link_to 'Policies', policies_organisation_path(organisation) %>
<%= organisation_navigation_link_to 'Publications', publications_organisation_path(organisation) %>
+ <%= organisation_navigation_link_to 'Consultations', consultations_organisation_path(organisation) %>
+ <%= organisation_navigation_link_to 'Ministers', ministers_organisation_path(organisation) %>
+ <%= organisation_navigation_link_to 'Contact', contact_details_organisation_path(organisation) %>
</nav>
View
7 app/views/organisations/about.html.erb
@@ -11,5 +11,12 @@
</div>
</article>
</div>
+ <div class="g1">
+ <nav>
+ <ul>
+ <li>View <%= link_to "management team", management_team_organisation_path(@organisation)%></li>
+ </ul>
+ </nav>
+ </div>
</div>
</div>
View
4 ...iews/organisations/board_members.html.erb → ...ws/organisations/management_team.html.erb
@@ -1,6 +1,6 @@
-<% page_title "#{@organisation.name} Board Members" %>
+<% page_title "#{@organisation.name} Management Team" %>
<div class="g3f organisation">
- <%= render 'header', organisation: @organisation, title: "#{@organisation.name} Board Members" %>
+ <%= render 'header', organisation: @organisation, title: "#{@organisation.name} Management Team" %>
<div class="g3 page_detail">
<% if @organisation.board_member_roles.any? %>
View
8 app/views/organisations/show.html.erb
@@ -28,8 +28,14 @@
<% end %>
</h3>
<p class="current_appointee"><%= role.current_person_name %></p>
+ <p class="view_all">
+ <% if role.is_a?(MinisterialRole) %>
+ View all <%= @organisation.name %> <%= link_to 'ministers', ministers_organisation_path(@organisation) %>
+ <% else %>
+ View <%= @organisation.name %> <%= link_to 'management team', management_team_organisation_path(@organisation) %>
+ <% end %>
+ </p>
<% end %>
- <p>View all <%= @organisation.name %> <%= link_to 'ministers', ministers_organisation_path(@organisation) %></p>
</section>
<% end %>
</div>
View
2  config/routes.rb
@@ -45,7 +45,7 @@ def redirect(path)
get :consultations
get :contact_details, path: 'contact-details'
get :ministers
- get :board_members, path: 'board-members'
+ get :management_team, path: 'management-team'
get :policies
get :publications
end
View
16 test/functional/organisations_controller_test.rb
@@ -415,40 +415,40 @@ class OrganisationsControllerTest < ActionController::TestCase
assert_select "img[src*=blank-person.png]"
end
- test "shows board members associated with organisation" do
+ test "shows management team associated with organisation" do
permanent_secretary = create(:board_member_role)
organisation = create(:organisation, board_member_roles: [permanent_secretary])
- get :board_members, id: organisation
+ get :management_team, id: organisation
assert_select "#other_board_members" do
assert_select_object(permanent_secretary)
end
end
- test "shows leading board members associated with organisation" do
+ test "shows leading management team members associated with organisation" do
permanent_secretary = create(:board_member_role, permanent_secretary: true)
organisation = create(:organisation, board_member_roles: [permanent_secretary])
- get :board_members, id: organisation
+ get :management_team, id: organisation
assert_select permanent_secretary_board_members_selector do
assert_select_object(permanent_secretary)
end
end
- test "should not display an empty leading board members section" do
+ test "should not display an empty leading management team section" do
junior = create(:board_member_role)
organisation = create(:organisation, board_member_roles: [junior])
- get :board_members, id: organisation
+ get :management_team, id: organisation
refute_select permanent_secretary_board_members_selector
end
- test "should not display an empty board members section" do
+ test "should not display an empty management team section" do
organisation = create(:organisation)
- get :board_members, id: organisation
+ get :management_team, id: organisation
refute_select "#other_board_members"
end
Please sign in to comment.
Something went wrong with that request. Please try again.