diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index 2df26c81e4cca0cf165077ed156c56e750981861..ed3728c7391027a4fbe7b73795db390730efafb4 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -18,6 +18,7 @@ # slug :string # text :text # title :string +# type :string # created_at :datetime not null # updated_at :datetime not null # communication_website_id :uuid not null, indexed @@ -54,6 +55,7 @@ class Communication::Website::Page < ApplicationRecord include WithPosition include WithTree include WithPath + include WithType include WithPermalink has_summernote :text diff --git a/app/models/communication/website/page/accessibility.rb b/app/models/communication/website/page/accessibility.rb new file mode 100644 index 0000000000000000000000000000000000000000..f4837f53a3884b07d7038040f8db8de4b25fb04f --- /dev/null +++ b/app/models/communication/website/page/accessibility.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Accessibility < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/administrators.rb b/app/models/communication/website/page/administrators.rb new file mode 100644 index 0000000000000000000000000000000000000000..e52736db5847f0af06891953ee122ff0d33c1ac0 --- /dev/null +++ b/app/models/communication/website/page/administrators.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Administrators < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/authors.rb b/app/models/communication/website/page/authors.rb new file mode 100644 index 0000000000000000000000000000000000000000..24c5e7aee033af976c6171e4de19ca2f1dc404fc --- /dev/null +++ b/app/models/communication/website/page/authors.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Authors < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/communication_posts.rb b/app/models/communication/website/page/communication_posts.rb index 6b81a470ac43907c37ca437671098b3e0f5d726f..b3cc671eb01f4fc2ffbcf11526ea067c306a3e5d 100644 --- a/app/models/communication/website/page/communication_posts.rb +++ b/app/models/communication/website/page/communication_posts.rb @@ -1,4 +1,45 @@ -class Communication::Website::Page::CommunicationPosts < Communication::Website::Page::Special +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::CommunicationPosts < Communication::Website::Page def git_path(website) "#{git_path_content_prefix(website)}posts/_index.html" @@ -12,4 +53,4 @@ class Communication::Website::Page::CommunicationPosts < Communication::Website: website.posts ].flatten end -end \ No newline at end of file +end diff --git a/app/models/communication/website/page/education_diplomas.rb b/app/models/communication/website/page/education_diplomas.rb new file mode 100644 index 0000000000000000000000000000000000000000..52877ff07068b49455a1c382a271bc8f96838e66 --- /dev/null +++ b/app/models/communication/website/page/education_diplomas.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::EducationDiplomas < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/education_programs.rb b/app/models/communication/website/page/education_programs.rb new file mode 100644 index 0000000000000000000000000000000000000000..c94991234df3fcb6c78c076bd1db80d3423fbf47 --- /dev/null +++ b/app/models/communication/website/page/education_programs.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::EducationPrograms < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/home.rb b/app/models/communication/website/page/home.rb index 14ebb4cc7bdbce995c87ab5ff4cc863d61e2c406..b62ff158eb516b1f25e2520a7b7c42fc34bfab8c 100644 --- a/app/models/communication/website/page/home.rb +++ b/app/models/communication/website/page/home.rb @@ -1,4 +1,46 @@ -class Communication::Website::Page::Home < Communication::Website::Page::Special +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Home < Communication::Website::Page + def git_path(website) "#{git_path_content_prefix(website)}_index.html" end @@ -8,4 +50,4 @@ class Communication::Website::Page::Home < Communication::Website::Page::Special def set_slug self.slug = '' end -end \ No newline at end of file +end diff --git a/app/models/communication/website/page/legal_term.rb b/app/models/communication/website/page/legal_term.rb new file mode 100644 index 0000000000000000000000000000000000000000..2a9dfeb2a4419b095df265e053d83b35c5a5d277 --- /dev/null +++ b/app/models/communication/website/page/legal_term.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::LegalTerm < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/organizations.rb b/app/models/communication/website/page/organizations.rb new file mode 100644 index 0000000000000000000000000000000000000000..faf79eb67018d42902b4c448c3096794408a71c9 --- /dev/null +++ b/app/models/communication/website/page/organizations.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Organizations < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/persons.rb b/app/models/communication/website/page/persons.rb new file mode 100644 index 0000000000000000000000000000000000000000..bc6479fc3b27c5310177605d524e751d14539ddd --- /dev/null +++ b/app/models/communication/website/page/persons.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Persons < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/privacy_policy.rb b/app/models/communication/website/page/privacy_policy.rb new file mode 100644 index 0000000000000000000000000000000000000000..d3fe6738bee27f48cfaee74779fbebf54a9d3f93 --- /dev/null +++ b/app/models/communication/website/page/privacy_policy.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::PrivacyPolicy < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/research_papers.rb b/app/models/communication/website/page/research_papers.rb new file mode 100644 index 0000000000000000000000000000000000000000..c2b9393d3a1f63a7c7cdaf859586829010b82d21 --- /dev/null +++ b/app/models/communication/website/page/research_papers.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::ResearchPapers < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/research_volumes.rb b/app/models/communication/website/page/research_volumes.rb new file mode 100644 index 0000000000000000000000000000000000000000..0dc34f594f5a59ba7b442b22d93cbb7e9dafdbc7 --- /dev/null +++ b/app/models/communication/website/page/research_volumes.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::ResearchVolumes < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/researchers.rb b/app/models/communication/website/page/researchers.rb new file mode 100644 index 0000000000000000000000000000000000000000..38d9cb85076dfcf463e6f1c3fbcea0c2bc6b5f85 --- /dev/null +++ b/app/models/communication/website/page/researchers.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Researchers < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/sitemap.rb b/app/models/communication/website/page/sitemap.rb new file mode 100644 index 0000000000000000000000000000000000000000..6ffd3d0272935b48cfe42d70883743669f86f5ef --- /dev/null +++ b/app/models/communication/website/page/sitemap.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Sitemap < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/teachers.rb b/app/models/communication/website/page/teachers.rb new file mode 100644 index 0000000000000000000000000000000000000000..06ec7215e99c16cff1102e99153a9d1c45950861 --- /dev/null +++ b/app/models/communication/website/page/teachers.rb @@ -0,0 +1,44 @@ +# == Schema Information +# +# Table name: communication_website_pages +# +# id :uuid not null, primary key +# bodyclass :string +# breadcrumb_title :string +# description :text +# description_short :text +# featured_image_alt :string +# featured_image_credit :text +# full_width :boolean default(FALSE) +# github_path :text +# header_text :text +# kind :integer +# position :integer default(0), not null +# published :boolean default(FALSE) +# slug :string +# text :text +# title :string +# type :string +# created_at :datetime not null +# updated_at :datetime not null +# communication_website_id :uuid not null, indexed +# language_id :uuid indexed +# parent_id :uuid indexed +# university_id :uuid not null, indexed +# +# Indexes +# +# index_communication_website_pages_on_communication_website_id (communication_website_id) +# index_communication_website_pages_on_language_id (language_id) +# index_communication_website_pages_on_parent_id (parent_id) +# index_communication_website_pages_on_university_id (university_id) +# +# Foreign Keys +# +# fk_rails_1a42003f06 (parent_id => communication_website_pages.id) +# fk_rails_280107c62b (communication_website_id => communication_websites.id) +# fk_rails_d208d15a73 (university_id => universities.id) +# +class Communication::Website::Page::Teachers < Communication::Website::Page + +end diff --git a/app/models/communication/website/page/special.rb b/app/models/communication/website/page/with_type.rb similarity index 66% rename from app/models/communication/website/page/special.rb rename to app/models/communication/website/page/with_type.rb index d5770ee2139e6e934765da060d38d35d1c4fdc33..e3a30a650bed071523e7a6be10576ce2e36ae390 100644 --- a/app/models/communication/website/page/special.rb +++ b/app/models/communication/website/page/with_type.rb @@ -1,4 +1,6 @@ -class Communication::Website::Page::Special < Communication::Website::Page +module Communication::Website::Page::WithType + extend ActiveSupport::Concern + def is_necessary? true end @@ -14,4 +16,4 @@ class Communication::Website::Page::Special < Communication::Website::Page def unpublishable? true end -end +end \ No newline at end of file diff --git a/app/models/university/organization.rb b/app/models/university/organization.rb index 31c57551e4fcb3762a7855bde913e3d9558f5cdd..e3119d42a2eaea768a62406ea0abd08e2a4781c5 100644 --- a/app/models/university/organization.rb +++ b/app/models/university/organization.rb @@ -2,26 +2,27 @@ # # Table name: university_organizations # -# id :uuid not null, primary key -# active :boolean default(TRUE) -# address :string -# city :string -# country :string -# description :text -# email :string -# kind :integer default("company") -# long_name :string -# name :string -# nic :string -# phone :string -# siren :string -# slug :string -# text :text -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# active :boolean default(TRUE) +# address :string +# city :string +# country :string +# description :text +# description_short :text +# email :string +# kind :integer default("company") +# long_name :string +# name :string +# nic :string +# phone :string +# siren :string +# slug :string +# text :text +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # diff --git a/app/services/blocks_migration.rb b/app/services/blocks_migration.rb deleted file mode 100644 index e6a7db5bcd4bf6dc26b07968eafb73981733f735..0000000000000000000000000000000000000000 --- a/app/services/blocks_migration.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'communication/block/template/base' -require 'communication/block/template/chapter' - -class BlocksMigration - - def self.cleanup - Communication::Website::Post.find_each do |post| - cleanup_item post - end - Communication::Website::Page.find_each do |page| - cleanup_item page - end - end - - private - - def self.cleanup_item(item) - return if item.text.blank? - return if item.blocks.any? - puts "#{item.university}, #{item.website}, #{item.class.to_s.demodulize}, #{item.id}, #{item}" - # puts item.text.to_html - # return - block = item.blocks.create university: item.university, template_kind: :chapter - data = block.data - data['text'] = item.text.to_html - block.data = data - block.save - end -end diff --git a/db/migrate/20230103132305_add_type_to_communication_website_pages.rb b/db/migrate/20230103132305_add_type_to_communication_website_pages.rb new file mode 100644 index 0000000000000000000000000000000000000000..d8bc0f87aa9630ba98c32499f873be66ea5cee18 --- /dev/null +++ b/db/migrate/20230103132305_add_type_to_communication_website_pages.rb @@ -0,0 +1,5 @@ +class AddTypeToCommunicationWebsitePages < ActiveRecord::Migration[7.0] + def change + add_column :communication_website_pages, :type, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index dd8b5176e102821f5cea9c2fc13f71a3262595cd..f326460b9744682e43467a6b610cc662fa4e4b3e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2022_12_29_103238) do +ActiveRecord::Schema[7.0].define(version: 2023_01_03_132305) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -322,6 +322,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_29_103238) do t.uuid "language_id" t.text "featured_image_credit" t.boolean "full_width", default: false + t.string "type" t.index ["communication_website_id"], name: "index_communication_website_pages_on_communication_website_id" t.index ["language_id"], name: "index_communication_website_pages_on_language_id" t.index ["parent_id"], name: "index_communication_website_pages_on_parent_id" @@ -713,6 +714,7 @@ ActiveRecord::Schema[7.0].define(version: 2022_12_29_103238) do t.string "slug" t.text "text" t.string "nic" + t.text "description_short" t.index ["university_id"], name: "index_university_organizations_on_university_id" end diff --git a/lib/tasks/app.rake b/lib/tasks/app.rake index b3c536e31ffdf2f80760ee58f2370825ac6b8fef..fdb5a6a689b384355942b2a8f91c47e8ac2e0d6f 100644 --- a/lib/tasks/app.rake +++ b/lib/tasks/app.rake @@ -8,7 +8,9 @@ namespace :app do desc 'Fix things' task fix: :environment do - BlocksMigration.cleanup + Communication::Website::Page.find_each do |page| + page.update_column :type, "::Communication::Website::Page::#{page.kind.to_s.classify}" + end end namespace :websites do diff --git a/test/fixtures/university/organizations.yml b/test/fixtures/university/organizations.yml index e692022061fa2b47eeeeb8670b045dcaeeb51371..6643990449ea289284e78cdfd7d0fc3bc2434af7 100644 --- a/test/fixtures/university/organizations.yml +++ b/test/fixtures/university/organizations.yml @@ -2,26 +2,27 @@ # # Table name: university_organizations # -# id :uuid not null, primary key -# active :boolean default(TRUE) -# address :string -# city :string -# country :string -# description :text -# email :string -# kind :integer default("company") -# long_name :string -# name :string -# nic :string -# phone :string -# siren :string -# slug :string -# text :text -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# active :boolean default(TRUE) +# address :string +# city :string +# country :string +# description :text +# description_short :text +# email :string +# kind :integer default("company") +# long_name :string +# name :string +# nic :string +# phone :string +# siren :string +# slug :string +# text :text +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes # diff --git a/test/models/university/organization_test.rb b/test/models/university/organization_test.rb index a57d401f936874cbe119b9daf79fbf03d9ee4f78..bb3781c188907a250c42061a4923957c56fc6ab2 100644 --- a/test/models/university/organization_test.rb +++ b/test/models/university/organization_test.rb @@ -2,26 +2,27 @@ # # Table name: university_organizations # -# id :uuid not null, primary key -# active :boolean default(TRUE) -# address :string -# city :string -# country :string -# description :text -# email :string -# kind :integer default("company") -# long_name :string -# name :string -# nic :string -# phone :string -# siren :string -# slug :string -# text :text -# url :string -# zipcode :string -# created_at :datetime not null -# updated_at :datetime not null -# university_id :uuid not null, indexed +# id :uuid not null, primary key +# active :boolean default(TRUE) +# address :string +# city :string +# country :string +# description :text +# description_short :text +# email :string +# kind :integer default("company") +# long_name :string +# name :string +# nic :string +# phone :string +# siren :string +# slug :string +# text :text +# url :string +# zipcode :string +# created_at :datetime not null +# updated_at :datetime not null +# university_id :uuid not null, indexed # # Indexes #