-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8383 from alphagov/562_Add-More-page
562 add more page
- Loading branch information
Showing
5 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class Admin::MoreController < Admin::BaseController | ||
before_action :check_new_design_system_permissions, only: %i[index] | ||
layout :get_layout | ||
|
||
def index; end | ||
|
||
private | ||
|
||
def check_new_design_system_permissions | ||
forbidden! unless new_design_system? | ||
end | ||
|
||
def get_layout | ||
design_system_actions = %w[index] if preview_design_system?(next_release: false) | ||
|
||
if design_system_actions&.include?(action_name) | ||
"design_system" | ||
else | ||
"admin" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<% content_for :page_title, "More" %> | ||
<% content_for :title, "More" %> | ||
<% content_for :title_margin_bottom, 6 %> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<%= render "govuk_publishing_components/components/list", { | ||
items: [ | ||
admin_cabinet_ministers_link, | ||
admin_fields_of_operation_link, | ||
admin_get_involved_link, | ||
admin_governments_link, | ||
admin_policy_groups_link, | ||
admin_organisations_link, | ||
admin_people_link, | ||
admin_roles_link, | ||
admin_sitewide_settings_link, | ||
admin_topical_events_link, | ||
admin_world_location_news_link, | ||
admin_worldwide_organisations_link, | ||
], | ||
} %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require "test_helper" | ||
|
||
class Admin::MoreControllerTest < ActionController::TestCase | ||
setup do | ||
login_as_preview_design_system_user :writer | ||
end | ||
|
||
view_test "GET #index renders the 'More' page with a correctly formatted list of links" do | ||
get :index | ||
|
||
assert_response :success | ||
assert_select "h1.govuk-heading-xl", text: "More" | ||
assert_select ".govuk-list" | ||
assert_select "a.govuk-link", text: "Cabinet ministers order" | ||
end | ||
end |