-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f3d22de
commit 49d8532
Showing
16 changed files
with
203 additions
and
3 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,5 @@ | ||
class Claims::OrganisationsController < ApplicationController | ||
def index | ||
@schools = current_user.schools | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class Placements::OrganisationsController < ApplicationController | ||
def index | ||
@schools = current_user.schools | ||
@providers = current_user.providers | ||
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 @@ | ||
# == Schema Information | ||
# | ||
# Table name: memberships | ||
# | ||
# id :uuid not null, primary key | ||
# organisation_type :string not null | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# organisation_id :uuid not null | ||
# user_id :uuid not null | ||
# | ||
# Indexes | ||
# | ||
# index_memberships_on_organisation (organisation_type,organisation_id) | ||
# index_memberships_on_user_id (user_id) | ||
# | ||
# Foreign Keys | ||
# | ||
# fk_rails_... (user_id => users.id) | ||
# | ||
class Membership < ApplicationRecord | ||
belongs_to :user | ||
belongs_to :organisation, polymorphic: true | ||
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
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,15 @@ | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-xl"><%= t("organisations") %></h1> | ||
|
||
<% if @schools.any? %> | ||
<ul class="govuk-list"> | ||
<% @schools.each do |school| %> | ||
<li> | ||
<%= govuk_link_to school.name, request.env["PATH_INFO"], class: "govuk-link--no-visited-state" %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<h1 class="govuk-heading-xl"><%= t("organisations") %></h1> | ||
|
||
<% if @schools.any? %> | ||
<h2 class="govuk-heading-l"><%= t("schools") %></h2> | ||
<ul class="govuk-list"> | ||
<% @schools.each do |school| %> | ||
<li> | ||
<%= govuk_link_to school.name, request.env["PATH_INFO"], class: "govuk-link--no-visited-state" %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
|
||
<% if @providers.any? %> | ||
<h2 class="govuk-heading-l"><%= t("providers") %></h2> | ||
<ul class="govuk-list"> | ||
<% @providers.each do |provider| %> | ||
<li> | ||
<%= govuk_link_to provider.code, request.env["PATH_INFO"], class: "govuk-link--no-visited-state" %> | ||
</li> | ||
<% end %> | ||
</ul> | ||
<% end %> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
SCHOOLS = [ | ||
{ claims: true }, | ||
{ placements: true }, | ||
{ claims: true, placements: true }, | ||
{ claims: true, placements: true } | ||
].freeze |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
scope module: :claims, as: :claims, constraints: { host: ENV["CLAIMS_HOST"] } do | ||
root to: "pages#index" | ||
|
||
resources :organisations, only: [:index] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
host: ENV["PLACEMENTS_HOST"] | ||
} do | ||
root to: "pages#index" | ||
|
||
resources :organisations, only: [:index] | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CreateMemberships < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :memberships, id: :uuid do |t| | ||
t.references :user, null: false, foreign_key: true, type: :uuid | ||
t.references :organisation, polymorphic: true, null: false, type: :uuid | ||
|
||
t.timestamps | ||
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
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,25 @@ | ||
# == Schema Information | ||
# | ||
# Table name: memberships | ||
# | ||
# id :uuid not null, primary key | ||
# organisation_type :string not null | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# organisation_id :uuid not null | ||
# user_id :uuid not null | ||
# | ||
# Indexes | ||
# | ||
# index_memberships_on_organisation (organisation_type,organisation_id) | ||
# index_memberships_on_user_id (user_id) | ||
# | ||
# Foreign Keys | ||
# | ||
# fk_rails_... (user_id => users.id) | ||
# | ||
FactoryBot.define do | ||
factory :membership do | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# == Schema Information | ||
# | ||
# Table name: memberships | ||
# | ||
# id :uuid not null, primary key | ||
# organisation_type :string not null | ||
# created_at :datetime not null | ||
# updated_at :datetime not null | ||
# organisation_id :uuid not null | ||
# user_id :uuid not null | ||
# | ||
# Indexes | ||
# | ||
# index_memberships_on_organisation (organisation_type,organisation_id) | ||
# index_memberships_on_user_id (user_id) | ||
# | ||
# Foreign Keys | ||
# | ||
# fk_rails_... (user_id => users.id) | ||
# | ||
require 'rails_helper' | ||
|
||
RSpec.describe Membership, type: :model do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |