diff --git a/app/controllers/admin/communication/websites/pages_controller.rb b/app/controllers/admin/communication/websites/pages_controller.rb index d4bb7ed163d2e42d696776656648b484f81be6e8..f4065516d9eed0ce612ae301c0a26ffede1ab3ae 100644 --- a/app/controllers/admin/communication/websites/pages_controller.rb +++ b/app/controllers/admin/communication/websites/pages_controller.rb @@ -91,7 +91,7 @@ class Admin::Communication::Websites::PagesController < Admin::Communication::We :communication_website_id, :title, :breadcrumb_title, :bodyclass, :description, :description_short, :header_text, :text, :slug, :published, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, - :parent_id, :related_category_id, :language_id + :parent_id, :language_id ) .merge(university_id: current_university.id) end diff --git a/app/models/communication/website/page.rb b/app/models/communication/website/page.rb index 0a8959ca643a67e935023e428b42be5b06c5141b..bdb083c2a5a3d96131a7e4348950e2e3fae3a2db 100644 --- a/app/models/communication/website/page.rb +++ b/app/models/communication/website/page.rb @@ -23,7 +23,6 @@ # communication_website_id :uuid not null, indexed # language_id :uuid indexed # parent_id :uuid indexed -# related_category_id :uuid indexed # university_id :uuid not null, indexed # # Indexes @@ -31,14 +30,12 @@ # 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_related_category_id (related_category_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_47b37cf8b2 (related_category_id => communication_website_categories.id) # fk_rails_d208d15a73 (university_id => universities.id) # @@ -58,9 +55,6 @@ class Communication::Website::Page < ApplicationRecord belongs_to :website, foreign_key: :communication_website_id - belongs_to :related_category, - class_name: 'Communication::Website::Category', - optional: true belongs_to :parent, class_name: 'Communication::Website::Page', optional: true diff --git a/app/views/admin/communication/websites/pages/_form.html.erb b/app/views/admin/communication/websites/pages/_form.html.erb index f2c2e2064d48a4c30dd882dee5e062f3024306ca..00d096e51246a0b8869a5c9227360a2c4327b5e4 100644 --- a/app/views/admin/communication/websites/pages/_form.html.erb +++ b/app/views/admin/communication/websites/pages/_form.html.erb @@ -14,10 +14,6 @@ <%= f.input :description_short, input_html: { value: page.description_short&.gsub('&', '&') } %> <%= f.input :header_text, as: :string %> <%= f.input :text, as: :summernote if page.text&.to_plain_text.present? %> - <%= f.association :related_category, - collection: collection_tree(@website.categories), - label_method: ->(p) { sanitize p[:label] }, - value_method: ->(p) { p[:id] } if @website.categories.any? && page.is_regular_page? %> </div> </div> <div class="card"> diff --git a/app/views/admin/communication/websites/pages/show.html.erb b/app/views/admin/communication/websites/pages/show.html.erb index c8f5773399a9b98cad09e4fec5cc5c75e7cb8395..6241359b1420110801295f4bd3e022a2c6f063e0 100644 --- a/app/views/admin/communication/websites/pages/show.html.erb +++ b/app/views/admin/communication/websites/pages/show.html.erb @@ -71,15 +71,6 @@ </p> <% end %> - <% if @page.related_category %> - <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('related_category') %></h3> - <p><%= link_to_if can?(:read, @page.related_category), - @page.related_category, - admin_communication_website_category_path( - website_id: @website.id, - id: @page.related_category.id - ) %></p> - <% end %> <% if @page.children.any? %> <h3 class="h5"><%= Communication::Website::Page.human_attribute_name('children') %></h3> <ul class="list-unstyled mb-0"> diff --git a/app/views/admin/communication/websites/pages/static.html.erb b/app/views/admin/communication/websites/pages/static.html.erb index 710adbec98809df944bb1167c0338bbfc653c45f..e9c8061eef03a0114cbe40a01f86be40269a249a 100644 --- a/app/views/admin/communication/websites/pages/static.html.erb +++ b/app/views/admin/communication/websites/pages/static.html.erb @@ -12,9 +12,6 @@ children: - <%= child.path %> <% end %> <% end %> -<% if @about.related_category %> -category: "<%= @about.related_category.path %>" -<% end %> description: > <%= prepare_text_for_static @about.description %> description_short: > diff --git a/db/migrate/20220519100506_remove_pages_related_category_id.rb b/db/migrate/20220519100506_remove_pages_related_category_id.rb new file mode 100644 index 0000000000000000000000000000000000000000..c23410315056f374b4af40bf7245475ab6ca9746 --- /dev/null +++ b/db/migrate/20220519100506_remove_pages_related_category_id.rb @@ -0,0 +1,5 @@ +class RemovePagesRelatedCategoryId < ActiveRecord::Migration[6.1] + def change + remove_column :communication_website_pages, :related_category_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 931135610066d1d6eea271bcebf5a84074972d96..be781469c4836c52797c1bfb4adfbe20732871e4 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.define(version: 2022_05_16_095044) do +ActiveRecord::Schema.define(version: 2022_05_19_100506) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" @@ -300,7 +300,6 @@ ActiveRecord::Schema.define(version: 2022_05_16_095044) do t.datetime "updated_at", precision: 6, null: false t.boolean "published", default: false t.text "github_path" - t.uuid "related_category_id" t.string "featured_image_alt" t.text "text" t.text "description_short" @@ -313,7 +312,6 @@ ActiveRecord::Schema.define(version: 2022_05_16_095044) do 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" - t.index ["related_category_id"], name: "index_communication_website_pages_on_related_category_id" t.index ["university_id"], name: "index_communication_website_pages_on_university_id" end @@ -828,7 +826,6 @@ ActiveRecord::Schema.define(version: 2022_05_16_095044) do add_foreign_key "communication_website_menu_items", "universities" add_foreign_key "communication_website_menus", "communication_websites" add_foreign_key "communication_website_menus", "universities" - add_foreign_key "communication_website_pages", "communication_website_categories", column: "related_category_id" add_foreign_key "communication_website_pages", "communication_website_pages", column: "parent_id" add_foreign_key "communication_website_pages", "communication_websites" add_foreign_key "communication_website_pages", "universities"