Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
James Adam lazyatom authored
4 app/controllers/organisations_controller.rb
... ... @@ -1,6 +1,6 @@
1 1 class OrganisationsController < PublicFacingController
2 2 before_filter :load_organisation, only: [:show, :about, :contact_details, :announcements, :consultations,
3   - :ministers, :board_members, :policies, :publications]
  3 + :ministers, :management_team, :policies, :publications]
4 4
5 5 def index
6 6 @organisations_by_type = Organisation.in_listing_order.group_by(&:organisation_type)
@@ -41,7 +41,7 @@ def publications
41 41 @publications = Publication.published.in_organisation(@organisation).order("publication_date DESC")
42 42 end
43 43
44   - def board_members
  44 + def management_team
45 45 end
46 46
47 47 def policies
9 app/helpers/organisation_helper.rb
@@ -8,7 +8,14 @@ def organisation_display_name(organisation)
8 8 end
9 9
10 10 def organisation_navigation_link_to(body, path)
11   - link_to body, path, class: ('current' if current_organisation_navigation_path(params) == path)
  11 + if (current_organisation_navigation_path(params) == path) ||
  12 + (params[:action] == "management_team" && path == current_organisation_navigation_path(params.merge(action: "about")))
  13 + css_class = 'current'
  14 + else
  15 + css_class = nil
  16 + end
  17 +
  18 + link_to body, path, class: css_class
12 19 end
13 20
14 21 def current_organisation_navigation_path(params)
7 app/views/organisations/_navigation.html.erb
@@ -2,10 +2,9 @@
2 2 <%= organisation_navigation_link_to 'Home', organisation_path(organisation) %>
3 3 <%= organisation_navigation_link_to 'About', about_organisation_path(organisation) %>
4 4 <%= organisation_navigation_link_to 'News & speeches', announcements_organisation_path(organisation) %>
5   - <%= organisation_navigation_link_to 'Consultations', consultations_organisation_path(organisation) %>
6   - <%= organisation_navigation_link_to 'Contact details', contact_details_organisation_path(organisation) %>
7   - <%= organisation_navigation_link_to 'Ministers', ministers_organisation_path(organisation) %>
8   - <%= organisation_navigation_link_to 'Board members', board_members_organisation_path(organisation) %>
9 5 <%= organisation_navigation_link_to 'Policies', policies_organisation_path(organisation) %>
10 6 <%= organisation_navigation_link_to 'Publications', publications_organisation_path(organisation) %>
  7 + <%= organisation_navigation_link_to 'Consultations', consultations_organisation_path(organisation) %>
  8 + <%= organisation_navigation_link_to 'Ministers', ministers_organisation_path(organisation) %>
  9 + <%= organisation_navigation_link_to 'Contact', contact_details_organisation_path(organisation) %>
11 10 </nav>
7 app/views/organisations/about.html.erb
@@ -11,5 +11,12 @@
11 11 </div>
12 12 </article>
13 13 </div>
  14 + <div class="g1">
  15 + <nav>
  16 + <ul>
  17 + <li>View <%= link_to "management team", management_team_organisation_path(@organisation)%></li>
  18 + </ul>
  19 + </nav>
  20 + </div>
14 21 </div>
15 22 </div>
4 app/views/organisations/board_members.html.erb → app/views/organisations/management_team.html.erb
... ... @@ -1,6 +1,6 @@
1   -<% page_title "#{@organisation.name} Board Members" %>
  1 +<% page_title "#{@organisation.name} Management Team" %>
2 2 <div class="g3f organisation">
3   - <%= render 'header', organisation: @organisation, title: "#{@organisation.name} Board Members" %>
  3 + <%= render 'header', organisation: @organisation, title: "#{@organisation.name} Management Team" %>
4 4
5 5 <div class="g3 page_detail">
6 6 <% if @organisation.board_member_roles.any? %>
8 app/views/organisations/show.html.erb
@@ -28,8 +28,14 @@
28 28 <% end %>
29 29 </h3>
30 30 <p class="current_appointee"><%= role.current_person_name %></p>
  31 + <p class="view_all">
  32 + <% if role.is_a?(MinisterialRole) %>
  33 + View all <%= @organisation.name %> <%= link_to 'ministers', ministers_organisation_path(@organisation) %>
  34 + <% else %>
  35 + View <%= @organisation.name %> <%= link_to 'management team', management_team_organisation_path(@organisation) %>
  36 + <% end %>
  37 + </p>
31 38 <% end %>
32   - <p>View all <%= @organisation.name %> <%= link_to 'ministers', ministers_organisation_path(@organisation) %></p>
33 39 </section>
34 40 <% end %>
35 41 </div>
2  config/routes.rb
@@ -45,7 +45,7 @@ def redirect(path)
45 45 get :consultations
46 46 get :contact_details, path: 'contact-details'
47 47 get :ministers
48   - get :board_members, path: 'board-members'
  48 + get :management_team, path: 'management-team'
49 49 get :policies
50 50 get :publications
51 51 end
16 test/functional/organisations_controller_test.rb
@@ -415,40 +415,40 @@ class OrganisationsControllerTest < ActionController::TestCase
415 415 assert_select "img[src*=blank-person.png]"
416 416 end
417 417
418   - test "shows board members associated with organisation" do
  418 + test "shows management team associated with organisation" do
419 419 permanent_secretary = create(:board_member_role)
420 420 organisation = create(:organisation, board_member_roles: [permanent_secretary])
421 421
422   - get :board_members, id: organisation
  422 + get :management_team, id: organisation
423 423
424 424 assert_select "#other_board_members" do
425 425 assert_select_object(permanent_secretary)
426 426 end
427 427 end
428 428
429   - test "shows leading board members associated with organisation" do
  429 + test "shows leading management team members associated with organisation" do
430 430 permanent_secretary = create(:board_member_role, permanent_secretary: true)
431 431 organisation = create(:organisation, board_member_roles: [permanent_secretary])
432 432
433   - get :board_members, id: organisation
  433 + get :management_team, id: organisation
434 434
435 435 assert_select permanent_secretary_board_members_selector do
436 436 assert_select_object(permanent_secretary)
437 437 end
438 438 end
439 439
440   - test "should not display an empty leading board members section" do
  440 + test "should not display an empty leading management team section" do
441 441 junior = create(:board_member_role)
442 442 organisation = create(:organisation, board_member_roles: [junior])
443 443
444   - get :board_members, id: organisation
  444 + get :management_team, id: organisation
445 445
446 446 refute_select permanent_secretary_board_members_selector
447 447 end
448 448
449   - test "should not display an empty board members section" do
  449 + test "should not display an empty management team section" do
450 450 organisation = create(:organisation)
451   - get :board_members, id: organisation
  451 + get :management_team, id: organisation
452 452 refute_select "#other_board_members"
453 453 end
454 454

0 comments on commit 5a5d0b5

Please sign in to comment.
Something went wrong with that request. Please try again.