diff --git a/app/assets/javascripts/admin/communication/websites.js b/app/assets/javascripts/admin/communication/websites.js index d27e2bf1b60fd7858eb8ea2a56d9962ea24a234e..5249436f0baf83e7d02d27ee6420dd54989d13f0 100644 --- a/app/assets/javascripts/admin/communication/websites.js +++ b/app/assets/javascripts/admin/communication/websites.js @@ -4,8 +4,8 @@ window.osuny.communication.websites = { 'use strict'; this.languagesCheckboxes = document.querySelectorAll('.js-languages input[type="checkbox"]'); this.defaultLanguageSelect = document.querySelector('.js-default-language'); - this.defaultLanguageOptions = this.defaultLanguageSelect.querySelectorAll('option'); if (this.defaultLanguageSelect) { + this.defaultLanguageOptions = this.defaultLanguageSelect.querySelectorAll('option'); this.initEvents(); this.onChangeCheckbox(); } diff --git a/app/assets/stylesheets/extranet/pages/_posts.sass b/app/assets/stylesheets/extranet/pages/_posts.sass index 281026c4ef8673e3fb728f56b16c488bb0f53597..54af62b4d12a3a7d6c7613a5b96abfff7a0df1b0 100644 --- a/app/assets/stylesheets/extranet/pages/_posts.sass +++ b/app/assets/stylesheets/extranet/pages/_posts.sass @@ -1,29 +1,30 @@ .posts-show header figure display: inline-block position: relative + &::after + bottom: 0 + content: '©' + padding: 0.5rem + padding-right: 0 + position: absolute + right: 0 + transform: translateY(100%) figcaption - display: block + display: none font-size: 1rem + font-weight: 400 left: 0 + padding: 0.5rem + padding-right: 1.5rem position: absolute right: 0 text-align: right z-index: 10 - &::before - content: '©' - padding: 0.5rem - padding-right: 0 - position: absolute - right: 0 - top: 0 p - display: none - font-weight: 400 - padding: 0.5rem - padding-right: 1rem + margin-bottom: 0 a text-decoration: underline - &:hover figcaption p + &:hover figcaption display: block @include media-breakpoint-down(md) figcaption p diff --git a/app/controllers/admin/communication/extranets/posts_controller.rb b/app/controllers/admin/communication/extranets/posts_controller.rb index c63ad06a8a6d07e8e42e4cbfcca287b6907c4ff1..50ae86c383c34202c8ae3834a92670770dbaacbd 100644 --- a/app/controllers/admin/communication/extranets/posts_controller.rb +++ b/app/controllers/admin/communication/extranets/posts_controller.rb @@ -67,7 +67,7 @@ class Admin::Communication::Extranets::PostsController < Admin::Communication::E params.require(:communication_extranet_post) .permit( :title, :summary, :text, - :published, :published_at, :slug, + :published, :published_at, :pinned, :slug, :featured_image, :featured_image_delete, :featured_image_infos, :featured_image_alt, :featured_image_credit, :author_id, :category_id ) diff --git a/app/controllers/admin/education/schools_controller.rb b/app/controllers/admin/education/schools_controller.rb index f3322b1f881bfc90dcf402ce18d9627d6a311f6e..93593ffc8f4bde0b4071a911721c42150fcea930 100644 --- a/app/controllers/admin/education/schools_controller.rb +++ b/app/controllers/admin/education/schools_controller.rb @@ -47,7 +47,7 @@ class Admin::Education::SchoolsController < Admin::Education::ApplicationControl def destroy @school.destroy_and_sync - redirect_to admin_university_schools_url, notice: t('admin.successfully_destroyed_html', model: @school.to_s) + redirect_to admin_education_schools_url, notice: t('admin.successfully_destroyed_html', model: @school.to_s) end private diff --git a/app/controllers/admin/university/organizations/categories_controller.rb b/app/controllers/admin/university/organizations/categories_controller.rb index 36711d762dd949e4c382441f67595f9db3694a31..47d9da04ec01fc48324a5182166b8eef0c391ff9 100644 --- a/app/controllers/admin/university/organizations/categories_controller.rb +++ b/app/controllers/admin/university/organizations/categories_controller.rb @@ -4,7 +4,7 @@ class Admin::University::Organizations::CategoriesController < Admin::University through_association: :organization_categories def index - @categories = @organizations.ordered.page(params[:page]) + @categories = @categories.ordered.page(params[:page]) breadcrumb end diff --git a/app/controllers/extranet/account_controller.rb b/app/controllers/extranet/account_controller.rb index ace02aa0c1e5fadb66a76367bb8c6d0ba7fe53b4..56389029177958ffa40f8e7e89d89e2dbe2f7726 100644 --- a/app/controllers/extranet/account_controller.rb +++ b/app/controllers/extranet/account_controller.rb @@ -1,6 +1,6 @@ class Extranet::AccountController < Extranet::ApplicationController def show - # Superadmins don't have a person + # Admin or Superadmins can have NO person @person = current_user.person breadcrumb end @@ -39,4 +39,4 @@ class Extranet::AccountController < Extranet::ApplicationController super add_breadcrumb t('extranet.account.my'), account_path end -end \ No newline at end of file +end diff --git a/app/controllers/extranet/application_controller.rb b/app/controllers/extranet/application_controller.rb index f455db6b782632c4c14d7b9126ede7ccf3cc17a2..7ab0b8d0566ad621498e7defaf38fe697921785d 100644 --- a/app/controllers/extranet/application_controller.rb +++ b/app/controllers/extranet/application_controller.rb @@ -31,11 +31,11 @@ class Extranet::ApplicationController < ApplicationController end def user_is_alumnus - about.alumni.find_by(id: current_user.person&.id).present? + current_extranet.feature_alumni? && about.alumni.find_by(id: current_user.person&.id).present? end def user_is_contact - current_extranet.connected_people.find_by(id: current_user.person&.id).present? + current_extranet.feature_contacts? && current_extranet.connected_people.find_by(id: current_user.person&.id).present? end end diff --git a/app/controllers/extranet/pages_controller.rb b/app/controllers/extranet/pages_controller.rb index a3bc8035e5d7d9c40a26063051c6c4832affdcb5..f22016105fc1c180f8e6963d11ce1d2fc107c9e8 100644 --- a/app/controllers/extranet/pages_controller.rb +++ b/app/controllers/extranet/pages_controller.rb @@ -22,14 +22,19 @@ class Extranet::PagesController < Extranet::ApplicationController @metrics.concat [ { value: current_extranet.alumni.count, name: University::Person::Alumnus.model_name.human(count: 2) }, { value: current_extranet.academic_years.count, name: Education::AcademicYear.model_name.human(count: 2) }, - { value: current_extranet.cohorts.count, name: Education::Cohort.model_name.human(count: 2) } + { value: current_extranet.cohorts.count, name: Education::Cohort.model_name.human(count: 2) }, + { value: current_extranet.about.university_person_alumni_organizations.count, name: University::Organization.model_name.human(count: 2) } + ] + end + if current_extranet.has_feature?(:contacts) + @metrics.concat [ + { value: current_extranet.connected_organizations.count, name: University::Organization.model_name.human(count: 2) } ] end if current_extranet.has_feature?(:alumni) || current_extranet.has_feature?(:contacts) @metrics.concat [ { value: current_extranet.users.count, name: User.model_name.human(count: 2) }, { value: current_extranet.experiences.count, name: University::Person::Experience.model_name.human(count: 2) }, - { value: current_extranet.organizations.count, name: University::Organization.model_name.human(count: 2) } ] end breadcrumb diff --git a/app/controllers/extranet/posts/posts_controller.rb b/app/controllers/extranet/posts/posts_controller.rb index ff73d6cf5fe27cb6f04d1d4a33d5c404faab725d..3705bd3fb3c5a9c7c43c1880d2bf9c888de5b922 100644 --- a/app/controllers/extranet/posts/posts_controller.rb +++ b/app/controllers/extranet/posts/posts_controller.rb @@ -9,7 +9,7 @@ class Extranet::Posts::PostsController < Extranet::Posts::ApplicationController end def show - @post = current_extranet.posts.find_by slug: params[:slug] + @post = current_extranet.posts.find_by! slug: params[:slug] breadcrumb end diff --git a/app/controllers/media_controller.rb b/app/controllers/media_controller.rb index 01f365cb228592c4be91a5e91228313353f3453c..0065ebbb88868a565e8c5b8fce84f4507f251175 100644 --- a/app/controllers/media_controller.rb +++ b/app/controllers/media_controller.rb @@ -1,8 +1,9 @@ class MediaController < ApplicationController skip_before_action :authenticate_user! + before_action :load_blob + def show - @blob = ActiveStorage::Blob.find_signed! params[:signed_id] @size = @blob.byte_size if @blob.variable? variant_service = VariantService.compute(@blob, params[:filename_with_transformations], params[:format]) @@ -20,4 +21,14 @@ class MediaController < ApplicationController response.headers["Content-Length"] = "#{@size}" redirect_to blob_or_variant_url end + + protected + + def load_blob + begin + @blob = ActiveStorage::Blob.find_signed! params[:signed_id] + rescue ActiveSupport::MessageVerifier::InvalidSignature + raise ActiveRecord::RecordNotFound + end + end end diff --git a/app/models/communication/extranet.rb b/app/models/communication/extranet.rb index c99daf122abc88d0f162d495cacdae7a82b36e3b..6081c7eb153c6373af2dd54bc14f139e18e6b630 100644 --- a/app/models/communication/extranet.rb +++ b/app/models/communication/extranet.rb @@ -52,6 +52,11 @@ class Communication::Extranet < ApplicationRecord include WithStyle include WithUniversity + has_summernote :home_sentence + has_summernote :terms + has_summernote :privacy_policy + has_summernote :cookies_policy + has_one_attached_deletable :logo has_one_attached_deletable :favicon do |attachable| attachable.variant :thumb, resize_to_limit: [228, 228] @@ -94,7 +99,13 @@ class Communication::Extranet < ApplicationRecord end def users - university.users.where(person: alumni) + if feature_alumni? + university.users.where(person: alumni) + elsif feature_contacts? + university.users.where(person: connected_people) + else + university.users.none + end end def cohorts diff --git a/app/models/communication/extranet/post.rb b/app/models/communication/extranet/post.rb index 9161c77213f9625cc114e29a1a9450ed92086f28..bfd250d7ad5d551a4f5287860e065f7091838dca 100644 --- a/app/models/communication/extranet/post.rb +++ b/app/models/communication/extranet/post.rb @@ -5,6 +5,7 @@ # id :uuid not null, primary key # featured_image_alt :string # featured_image_credit :text +# pinned :boolean default(FALSE) # published :boolean default(FALSE) # published_at :datetime # slug :string @@ -46,6 +47,8 @@ class Communication::Extranet::Post < ApplicationRecord validates :title, presence: true + scope :ordered, -> { order(pinned: :desc, published_at: :desc, created_at: :desc) } + def to_s "#{title}" end diff --git a/app/models/communication/extranet/with_style.rb b/app/models/communication/extranet/with_style.rb index cb8709cd240056215c956adc11b3db969b296635..d4ccf9414c4304f0e6d67714215be41bddccf42c 100644 --- a/app/models/communication/extranet/with_style.rb +++ b/app/models/communication/extranet/with_style.rb @@ -8,6 +8,10 @@ module Communication::Extranet::WithStyle protected def generate_css - self.css = SassC::Engine.new(sass, syntax: :sass, style: :compressed).render + begin + self.css = SassC::Engine.new(sass, syntax: :sass, style: :compressed).render + rescue SassC::SyntaxError + errors.add(:sass, :invalid) + end end end \ No newline at end of file diff --git a/app/models/concerns/with_featured_image.rb b/app/models/concerns/with_featured_image.rb index d7f8102d2d1fa8bdffe9a164adc8598a1c6b8bde..201d796c43f7ca788cdfd2330184c8ad0546f930 100644 --- a/app/models/concerns/with_featured_image.rb +++ b/app/models/concerns/with_featured_image.rb @@ -2,6 +2,7 @@ module WithFeaturedImage extend ActiveSupport::Concern included do + has_summernote :featured_image_credit has_one_attached_deletable :featured_image validates :featured_image, size: { less_than: 5.megabytes } diff --git a/app/models/education/program.rb b/app/models/education/program.rb index 12d8b9e11792b7f87205d0974f52454dc264ca04..6a231ae77816d3535016df0d4c1f0c9d9b7be265 100644 --- a/app/models/education/program.rb +++ b/app/models/education/program.rb @@ -83,6 +83,8 @@ class Education::Program < ApplicationRecord :content, :results + has_summernote :presentation + belongs_to :parent, class_name: 'Education::Program', optional: true diff --git a/app/models/education/school/with_alumni.rb b/app/models/education/school/with_alumni.rb index 976721f5c5c34bb1068ed92716a1f5bf7ed80703..3a55dadd78b031beb661c98ef637866320462677 100644 --- a/app/models/education/school/with_alumni.rb +++ b/app/models/education/school/with_alumni.rb @@ -4,7 +4,8 @@ module Education::School::WithAlumni included do has_many :education_cohorts, - class_name: 'Education::Cohort' + class_name: 'Education::Cohort', + dependent: :destroy alias_attribute :cohorts, :education_cohorts has_many :alumni, -> { distinct }, diff --git a/app/models/research/journal/paper.rb b/app/models/research/journal/paper.rb index b699dd1c89a251b72f14a4717fa7e79d8e612991..b437dcf8dfcf7e03ef1e04de0ea1c04b4a1e3d5b 100644 --- a/app/models/research/journal/paper.rb +++ b/app/models/research/journal/paper.rb @@ -51,7 +51,8 @@ class Research::Journal::Paper < ApplicationRecord include WithSlug include WithUniversity include WithWebsites - + + has_summernote :references has_summernote :text has_one_attached :pdf diff --git a/app/views/admin/communication/blocks/templates/call_to_action/_preview.html.erb b/app/views/admin/communication/blocks/templates/call_to_action/_preview.html.erb index b9f76636bd6aed01b82e5e86b52f1d293fb59e0d..06a081142d9601c9c79a8fee47e088915554a69e 100644 --- a/app/views/admin/communication/blocks/templates/call_to_action/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/call_to_action/_preview.html.erb @@ -1,17 +1,17 @@ <% -$class = "block block-call_to_action" +class_name = "block block-call_to_action" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end -$image_class = "call_to_action--with" + (@block.template.image.empty? ? "out" : "") + "-image" +image_class = "call_to_action--with" + (@block.template.image.empty? ? "out" : "") + "-image" %> -<section class="block block-call_to_action"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> - <div class="call_to_action <%= $image_class %>"> + <div class="call_to_action <%= image_class %>"> <div> <% unless @block.title.blank? %> <h2><%= @block.title %></h2> diff --git a/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb b/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb index 1be71e833ea3c6e71f390bff03dba5d6877661ed..838aa58f37f665c868037905aa36990f93b8c255 100644 --- a/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/chapter/_preview.html.erb @@ -1,19 +1,19 @@ <% -$class = "block block-chapter" +class_name = "block block-chapter" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end if @block.template.image[:id] #TODO comment vérifier proprement la présence de l'image? - $class += " block-chapter--with-image" + class_name += " block-chapter--with-image" end -$class += " block-chapter--" + @block.template.layout +class_name += " block-chapter--" + @block.template.layout %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <div class="chapter"> diff --git a/app/views/admin/communication/blocks/templates/contact/_preview.html.erb b/app/views/admin/communication/blocks/templates/contact/_preview.html.erb index 9a617582b13cab08266f6fa1c5ab33d85cae7e28..5c37e6e40126cab800221fa2d984ebb908175d53 100644 --- a/app/views/admin/communication/blocks/templates/contact/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/contact/_preview.html.erb @@ -1,11 +1,11 @@ <% -$class = "block block-contact" +class_name = "block block-contact" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% unless @block.title.blank? && @block.template.description.blank? %> diff --git a/app/views/admin/communication/blocks/templates/datatable/_preview.html.erb b/app/views/admin/communication/blocks/templates/datatable/_preview.html.erb index fdd161bde54b44ad473f41e1ef64b24d634e20d6..f1df7239485769a17ed013d1a5f3ab414b250324 100644 --- a/app/views/admin/communication/blocks/templates/datatable/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/datatable/_preview.html.erb @@ -1,10 +1,10 @@ <% -$class = "block block-datatable" +class_name = "block block-datatable" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% unless @block.title.blank? && @block.template.description.blank? %> diff --git a/app/views/admin/communication/blocks/templates/definitions/_preview.html.erb b/app/views/admin/communication/blocks/templates/definitions/_preview.html.erb index 6770c718db2441be651771243356072bc485a695..0673ec78f459ffbb22726e9d679b4812547841ff 100644 --- a/app/views/admin/communication/blocks/templates/definitions/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/definitions/_preview.html.erb @@ -1,11 +1,11 @@ <% - $class = "block block-definitions" + class_name = "block block-definitions" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% unless @block.title.blank? && @block.template.description.blank? %> diff --git a/app/views/admin/communication/blocks/templates/files/_preview.html.erb b/app/views/admin/communication/blocks/templates/files/_preview.html.erb index 4d72187e5486d77ad39904ce7f0bf0574eabc5ae..f9ebe021d0db9bb41f3a4614bea4539abd712014 100644 --- a/app/views/admin/communication/blocks/templates/files/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/files/_preview.html.erb @@ -1,11 +1,11 @@ <% -$class = "block block-files" +class_name = "block block-files" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% unless @block.title.blank? && @block.template.description.blank? %> @@ -25,17 +25,14 @@ end <% @block.template.elements.each do |element| %> <% next unless element.blob %> <li> - <figure> + <figure> <a href="<%= element.blob.url %>" target="_blank" title="<%= element.title %>"><%= element.title %></a> - <% if document.file.attached? %> - <% file = document.file %> <figcaption> - <abbr title=""><%= file.filename.extension.upcase %></abbr> - - <abbr title=""><%= number_to_human_size file.byte_size %></abbr> + <abbr title=""><%= element.blob.filename.extension.upcase %></abbr> + - <abbr title=""><%= number_to_human_size element.blob.byte_size %></abbr> </figcaption> - <% end %> + </a> </figure> - </a> </li> <% end %> </ul> diff --git a/app/views/admin/communication/blocks/templates/gallery/_preview.html.erb b/app/views/admin/communication/blocks/templates/gallery/_preview.html.erb index 1930887a150cc86d8c272c88c9b40751c2b36762..c392691021f29c9ce39d518c0ae3ccf97f55d52d 100644 --- a/app/views/admin/communication/blocks/templates/gallery/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/gallery/_preview.html.erb @@ -1,13 +1,13 @@ <% -$class = "block block-gallery" +class_name = "block block-gallery" if @block.title.present? - $class += " block-with-title" + class_name += " block-with-title" end -$class += " block-gallery--" + @block.template.layout +class_name += " block-gallery--" + @block.template.layout %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% if @block.title.present? || @block.template.description.present? %> diff --git a/app/views/admin/communication/blocks/templates/image/_preview.html.erb b/app/views/admin/communication/blocks/templates/image/_preview.html.erb index cdb2997ed03d37cf8861f6581f40d0430957d78f..622c48b2622e888d83869233070bd71aeca2f71c 100644 --- a/app/views/admin/communication/blocks/templates/image/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/image/_preview.html.erb @@ -1,11 +1,11 @@ <% -$class = "block block-image" +class_name = "block block-image" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% unless @block.title.blank? %> diff --git a/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb b/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb index 4ca7f51f60737fd74aff8d0b24c857cfe1225354..27615c8ef0dec5bbc05b650d4595453da39d95db 100644 --- a/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/key_figures/_preview.html.erb @@ -1,10 +1,10 @@ <% -$class = "block block-key_figures" +class_name = "block block-key_figures" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% unless @block.title.blank? && @block.template.description.blank? %> diff --git a/app/views/admin/communication/blocks/templates/organization_chart/_preview.html.erb b/app/views/admin/communication/blocks/templates/organization_chart/_preview.html.erb index 54ee97c8f71c681e952276e524813a864cfd5129..7dae993fea68d01ee3438556aeb1026ab95a56c1 100644 --- a/app/views/admin/communication/blocks/templates/organization_chart/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/organization_chart/_preview.html.erb @@ -1,34 +1,52 @@ -<div class="top"> - <div class="description"> - <%= block_component_preview :description %> - </div> -</div> - -<div class="persons"> - <% @block.template.elements.each do |element| - person = element.person - next if person.nil? - %> - <div> - <article class="person" itemscope itemtype="https://schema.org/Person"> - <div class="description"> - <h3 class="name" itemprop="name"> - <% if @block.template.with_link %> - <%= link_to person, [:admin, person] %> - <% else %> - <%= element.person %> - <% end %> - </h3> - <p itemprop="jobTitle"><%= element.role %></p> +<% +class_name = "block block-organization_chart" +unless @block.title.blank? + class_name += " block-with-title" +end +%> +<section class="<%= class_name %>"> + <div class="container"> + <div class="block-content"> + <% unless @block.title.blank? && @block.template.description.blank? %> + <div class="top"> + <% unless @block.title.blank? %> + <h2><%= @block.title %></h2> + <% end %> + <% unless @block.template.description.blank? %> + <div class="description"> + <p><%= block_component_preview :description %></p> + </div> + <% end %> </div> - <% if @block.template.with_photo %> - <div class="avatar" itemprop="image"> - <% if person.best_picture.attached? %> - <%= kamifusen_tag person.best_picture, class: 'img-fluid rounded-circle' %> + <% end %> + + <div class="persons"> + <% @block.template.elements.each do |element| + person = element.person + next if person.nil? + %> + <article class="person" itemscope itemtype="https://schema.org/Person"> + <div class="description"> + <h3 class="name" itemprop="name"> + <% if @block.template.with_link %> + <%= link_to person, [:admin, person] %> + <% else %> + <%= element.person %> + <% end %> + </h3> + <p itemprop="jobTitle"><%= element.role %></p> + </div> + <% if @block.template.with_photo %> + <div class="avatar" itemprop="image"> + <% if person.best_picture.attached? %> + <%= kamifusen_tag person.best_picture, class: 'img-fluid rounded-circle' %> + <% end %> + </div> <% end %> - </div> + </article> <% end %> - </article> + </div> + </div> - <% end %> -</div> \ No newline at end of file + </div> +</section> diff --git a/app/views/admin/communication/blocks/templates/pages/_preview.html.erb b/app/views/admin/communication/blocks/templates/pages/_preview.html.erb index 4f49735e43270a02a91cb66e0da9c775ef0f626e..42f0873509ba6bec96c72a782d8ebf2352379e5e 100644 --- a/app/views/admin/communication/blocks/templates/pages/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/pages/_preview.html.erb @@ -1,49 +1,60 @@ -<% if @block.data %> +<% +class_name = "block block-pages" +unless @block.title.blank? + class_name += " block-with-title" +end +class_name += " block-pages--" + @block.template.layout +%> +<section class="<%= class_name %>" style="display: none;"> + <div class="container"> + <div class="block-content"> + <% if @block.data %> + <% if @block.template.page %> + <%#= @block.template.page.slug %> + <% end %> + + <% if @block.template.show_main_description %> + <p></p> + <% end %> + + <% if @block.template.layout === "list" %> + + <ul> + <% @block.template.elements.each do |element| %> + <li> + <%#= element %> + </li> + <% end %> + </ul> + + <% elsif @block.template.layout === "cards" %> + + <div class="cards"> + <% @block.template.elements.each do |element| %> + <article class="card"> + <%# <%= element %> + <% if @block.template.show_description %> + <p><%#= element.summary %></p> + <% end %> + </article> + <% end %> + </div> + + <% else %> + + <div class="grid"> + <% @block.template.elements.each do |element| %> + <article> + <%# <%= element %> + <% if @block.template.show_description %> + <p><%#= element.summary %></p> + <% end %> + </article> + <% end %> + </div> + <% end %> -<% if @block.template.page %> - <%= @block.template.page.slug %> - <% end %> - - <% if @block.template.show_main_description %> - <p></p> - <% end %> - - <% if @block.template.layout === "list" %> - - <ul> - <% @block.template.elements.each do |element| %> - <li> - <%= element %> - </li> - <% end %> - </ul> - - <% elsif @block.template.layout === "cards" %> - - <div class="cards"> - <% @block.template.elements.each do |element| %> - <article class="card"> - <%= element %> - <% if @block.template.show_description %> - <p><%#= element.summary %></p> - <% end %> - </article> <% end %> </div> - - <% else %> - - <div class="grid"> - <% @block.template.elements.each do |element| %> - <article> - <%= element %> - <% if @block.template.show_description %> - <p><%#= element.summary %></p> - <% end %> - </article> - <% end %> - </div> - - <% end %> - -<% end %> + </div> +</section> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/partners/_preview.html.erb b/app/views/admin/communication/blocks/templates/partners/_preview.html.erb index 6a226b15dd2672707d4e5ee35a4c08ff7b40619d..34110c536bb3e56c60530999f5c84ccf8a2941d0 100644 --- a/app/views/admin/communication/blocks/templates/partners/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/partners/_preview.html.erb @@ -1,24 +1,46 @@ -<div class="top"> - <div class="description"> - <%= block_component_preview :description %> - </div> -</div> +<% +class_name = "block block-partners" +unless @block.title.blank? + class_name += " block-with-title" +end +class_name += " block-partners--" + @block.template.layout +%> +<section class="<%= class_name %>"> + <div class="container"> + <div class="block-content"> -<div class="organizations"> - <% @block.template.elements.each do |element| %> - <article class="organization"> - <h3> - <% if element.best_url %> - <a href="<%= element.best_url %>" target="_blank"> - <% end %> - <%= element.best_name %> - <% if element.best_url%> - </a> + <% unless @block.title.blank? && @block.template.description.blank? %> + <div class="top"> + <% unless @block.title.blank? %> + <h2><%= @block.title %></h2> + <% end %> + <% unless @block.template.description.blank? %> + <div class="description"> + <p><%= block_component_preview :description %></p> + </div> + <% end %> + </div> + <% end %> + + <div class="grid organizations"> + <% @block.template.elements.each do |element| %> + <article class="organization"> + <h3> + <% if element.best_url %> + <a href="<%= element.best_url %>" target="_blank"> + <% end %> + <%= element.best_name %> + <% if element.best_url%> + </a> + <% end %> + </h3> + <div class="media"> + <%= kamifusen_tag element.best_logo, width: 600%> + </div> + </article> <% end %> - </h3> - <div class="media"> - <%= kamifusen_tag element.best_logo, width: 600%> </div> - </article> - <% end %> -</div> \ No newline at end of file + + </div> + </div> +</section> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/posts/_preview.html.erb b/app/views/admin/communication/blocks/templates/posts/_preview.html.erb index f6e2422c3e90fc4f2dc7ce0b8fd4735a47ee83ef..0d73386078540ecaa076a29d2db3ed8cbbeb7d8f 100644 --- a/app/views/admin/communication/blocks/templates/posts/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/posts/_preview.html.erb @@ -1,20 +1,38 @@ -<div class="posts"> - <% if @block.data %> - <% @block.template.selected_posts.each do |post| %> - <div> - <article class="post"> - <div> - <p class="title"><%= post %></p> - <p><%= post.summary %></p> - <time datetime="<%= post.published_at %>"><%= post.published_at.to_date %></time> - </div> - <% if post.best_featured_image.attached? %> - <div class="media"> - <%= kamifusen_tag post.best_featured_image %> - </div> +<% +$class = "block block-posts" +unless @block.title.blank? + $class += " block-with-title" +end +$class += " block-posts--" + @block.template.layout +%> +<section class="<%= $class %>"> + <div class="container"> + <div class="block-content"> + <% unless @block.title.blank? %> + <div class="top"> + <h2><%= @block.title %></h2> + </div> + <% end %> + <div class="list"> + <% if @block.data %> + <% @block.template.selected_posts.each do |post| %> + <article class="post" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting"> + <div class="post-content"> + <a href="#"><%= post %></a> + <p itemprop="articleBody"><%= post.summary %></p> + </div> + <div class="post-meta"> + <time itemprop="datePublished" datetime="<%= post.published_at %>"><%= post.published_at.to_date %></time> + </div> + <% if post.best_featured_image.attached? %> + <div class="media"> + <%= kamifusen_tag post.best_featured_image %> + </div> + <% end %> + </article> <% end %> - </article> + <% end %> </div> - <% end %> - <% end %> -</div> + </div> + </div> +</section> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/programs/_preview.html.erb b/app/views/admin/communication/blocks/templates/programs/_preview.html.erb index 7b067c7450bf12bfa07765f21a6ef83f642e0295..adda2a10c96ddae8c77b783cac0f71414345269d 100644 --- a/app/views/admin/communication/blocks/templates/programs/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/programs/_preview.html.erb @@ -1,7 +1,19 @@ -<ol class="programs"> - <% @block.template.selected_programs.each do |program| %> - <li> - <%= program %></p> - </li> - <% end %> -</ol> +<% +$class = "block block-programs" +unless @block.title.blank? + $class += " block-with-title" +end +%> +<section class="<%= $class %>" style="display: none;"> + <div class="container"> + <div class="block-content"> + <ol class="programs"> + <% @block.template.selected_programs.each do |program| %> + <li> + <%= program %></p> + </li> + <% end %> + </ol> + </div> + </div> +</section> \ No newline at end of file diff --git a/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb b/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb index ff8f7921a6131a2a9963d9a012c45f47fe15284b..acbde3057d1016f290d11505a273d7966dbe4fed 100644 --- a/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb @@ -1,12 +1,12 @@ <% - $class = "block block-timeline" + class_name = "block block-timeline" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end - $class += " block-timeline--" + @block.template.layout + class_name += " block-timeline--" + @block.template.layout %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <% if @block.template.layout == "vertical" %> <div class="block-content"> diff --git a/app/views/admin/communication/blocks/templates/video/_preview.html.erb b/app/views/admin/communication/blocks/templates/video/_preview.html.erb index 62a19434c45d78bf9c6684524b477f0e404091a2..5876a6ccb8503c3bfff23607bad534040799b0d8 100644 --- a/app/views/admin/communication/blocks/templates/video/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/video/_preview.html.erb @@ -1,10 +1,10 @@ <% -$class = "block block-video" +class_name = "block block-video" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <% unless @block.title.blank? %> diff --git a/app/views/admin/communication/extranets/documents/_form.html.erb b/app/views/admin/communication/extranets/documents/_form.html.erb index 3f04d4e9f6bb4f4850766f9c53916df37f7d1ba7..baa0cca4db31fc9e98351a9ad1c9a8b840b81877 100644 --- a/app/views/admin/communication/extranets/documents/_form.html.erb +++ b/app/views/admin/communication/extranets/documents/_form.html.erb @@ -6,7 +6,9 @@ <div class="col-md-8"> <%= osuny_panel t('content') do %> <%= f.input :name %> - <%= f.input :file, as: :single_deletable_file %> + <%= f.input :file, + as: :single_deletable_file, + direct_upload: true %> <% end %> </div> <div class="col-md-4"> diff --git a/app/views/admin/communication/extranets/posts/_form.html.erb b/app/views/admin/communication/extranets/posts/_form.html.erb index b47a22d4d98937fb928aa45244277055a1d7f1f9..36b4fca73b1a9ffebe04a1632cad7570ac61d41c 100644 --- a/app/views/admin/communication/extranets/posts/_form.html.erb +++ b/app/views/admin/communication/extranets/posts/_form.html.erb @@ -12,7 +12,14 @@ <div class="col-md-4"> <%= osuny_panel t('metadata') do %> <% if can? :publish, post %> - <%= f.input :published %> + <div class="row pure__row--small"> + <div class="col-6"> + <%= f.input :published %> + </div> + <div class="col-6"> + <%= f.input :pinned %> + </div> + </div> <%= f.input :published_at, html5: true, as: :date %> <% end %> <%= f.association :category, diff --git a/app/views/admin/communication/extranets/posts/show.html.erb b/app/views/admin/communication/extranets/posts/show.html.erb index 4895b36dcec1e322112143a3c39a91e9819b04dc..5332d5d25a7807e0c55c5c8c11572db40b238671 100644 --- a/app/views/admin/communication/extranets/posts/show.html.erb +++ b/app/views/admin/communication/extranets/posts/show.html.erb @@ -24,6 +24,10 @@ <% end %> </p> </div> + <div class="col-6"> + <%= osuny_label Communication::Extranet::Post.human_attribute_name('pinned') %> + <p><%= t @post.pinned %></p> + </div> </div> <% if @post.category %> <%= osuny_label Communication::Extranet::Post.human_attribute_name('category') %> diff --git a/app/views/admin/communication/photo_imports/_selector.html.erb b/app/views/admin/communication/photo_imports/_selector.html.erb index e68b465d8d4397cbeffbf3ede68f83d1a2e5da89..318a89a28ea04bea3b27069910c19c0e3962b2da 100644 --- a/app/views/admin/communication/photo_imports/_selector.html.erb +++ b/app/views/admin/communication/photo_imports/_selector.html.erb @@ -3,6 +3,12 @@ search = about.to_s # communication_website_page about_identifier = about.class.base_class.to_s.parameterize.underscore +# input[name="communication_website_post[featured_image]"] +about_featured_image_file = "input[name=\"#{about_identifier}[featured_image]\"]".html_safe +# input[name="communication_website_post[featured_image_delete]"] +about_featured_image_file_delete = "input[name=\"#{about_identifier}[featured_image_delete]\"]".html_safe +# input[name="communication_website_post[featured_image_infos]"] +about_featured_image_file_infos = "input[name=\"#{about_identifier}[featured_image_infos]\"]".html_safe # .communication_website_post_featured_image about_featured_image_image = ".#{about_identifier}_featured_image" # #communication_website_page_featured_image_alt @@ -12,8 +18,8 @@ about_featured_image_credit = "##{about_identifier}_featured_image_credit" # fr, en... lang = about&.language&.iso_code if about.respond_to? :language # /admin/communication/photo_import.json?query=Page%20de%20test&per_page=12&page=1&lang=fr -unsplash_path = admin_communication_unsplash_path(website_id: nil, extranet_id: nil, lang: nil, format: :json) -pexels_path = admin_communication_pexels_path(website_id: nil, extranet_id: nil, lang: nil, format: :json) +unsplash_path = admin_communication_unsplash_path(website_id: nil, extranet_id: nil, journal_id: nil, lang: nil, format: :json) +pexels_path = admin_communication_pexels_path(website_id: nil, extranet_id: nil, journal_id: nil, lang: nil, format: :json) %> <div id="photo-import-app" v-cloak> @@ -179,6 +185,10 @@ pexels_path = admin_communication_pexels_path(website_id: nil, extranet_id: nil, selected: null }, targets: { + fileInput: document.querySelector('<% about_featured_image_image %> <%= about_featured_image_file %>'), + fileLabel: document.querySelector('<% about_featured_image_image %> .js-sdfi-deletable-file__label'), + fileDeleteInput: document.querySelector('<%= about_featured_image_image %> <%= about_featured_image_file_delete %>'), + fileInfosInput: document.querySelector('<%= about_featured_image_image %> <%= about_featured_image_file_infos %>'), image: document.querySelector('<%= about_featured_image_image %> img'), imageContainer: document.querySelector('<%= about_featured_image_image %> .sdfi-deletable-file__preview'), alt: document.querySelector('<%= about_featured_image_alt %>'), @@ -264,6 +274,12 @@ pexels_path = admin_communication_pexels_path(website_id: nil, extranet_id: nil, this.select(image); }, select(image) { + this.targets.fileInput.value = null; + this.targets.fileLabel.textContent = image.filename; + this.targets.fileDeleteInput.value = null; + this.targets.fileInfosInput.value = null; + // Refresh in case cropper replaces img + this.targets.image = document.querySelector('<%= about_featured_image_image %> img'); if (!this.targets.image) { this.targets.image = document.createElement('img'); this.targets.image.classList.add('img-fluid', 'img-thumbnail'); diff --git a/app/views/admin/communication/photo_imports/pexels.json.jbuilder b/app/views/admin/communication/photo_imports/pexels.json.jbuilder index 0c00b26f0d77c96eaf4d1505c935c82b0dc6eb73..11561793ed09abb2fd7b7fde4f4c1f2933d8f06e 100644 --- a/app/views/admin/communication/photo_imports/pexels.json.jbuilder +++ b/app/views/admin/communication/photo_imports/pexels.json.jbuilder @@ -6,4 +6,4 @@ json.results @search.photos do |photo| json.credit "Photo by <a href=\"#{photo.user.url}\">#{photo.user.name}</a> on <a href=\"https://www.pexels.com\">Pexels</a>" json.thumb photo.src['large'] json.preview photo.src['large2x'] -end +end if @search diff --git a/app/views/admin/communication/websites/posts/index.html.erb b/app/views/admin/communication/websites/posts/index.html.erb index c440db38826dba9537c8454b6274d6614fd2bd27..a007077e007ae5d9bbb0c663268d99c426b474d9 100644 --- a/app/views/admin/communication/websites/posts/index.html.erb +++ b/app/views/admin/communication/websites/posts/index.html.erb @@ -6,31 +6,39 @@ <% end %> <%= render 'admin/communication/websites/sidebar' do %> - <%= render 'filters', current_path: admin_communication_website_posts_path, filters: @filters %> - <div data-batch-selectable class="mb-5"> - <%= form_tag publish_admin_communication_website_posts_path do %> - <%= render 'admin/communication/websites/posts/list', posts: @posts, selectable: true %> - <%= paginate @posts, theme: 'bootstrap-5' %> - <div> - <div data-batch-selectable-role="actions-container"> - <div class="d-flex align-items-center"> - <div class="col-auto me-3"> - <%= t('batch_selectable.title') %> - </div> - <div class="col-auto me-3"> - <select name="published" class="form-select"> - <option value="false"><%= t('communication.website.posts.unpublished') %></option> - <option value="true"><%= t('communication.website.posts.published') %></option> - </select> - </div> - <div class="col-auto me-3"> - <%= submit_tag t("save"), class: "btn btn-primary" %> + <% + action = create_link Communication::Website::Post + action += link_to t('communication.website.posts.new_curation'), + new_admin_communication_website_post_curation_path(website_id: @website.id), + class: button_classes('ms-2 btn-light') if can?(:create, Communication::Website::Post) + %> + <%= osuny_panel Communication::Website::Post.model_name.human(count: 2), action: action do %> + <%= render 'filters', current_path: admin_communication_website_posts_path, filters: @filters %> + <div data-batch-selectable class="mb-5"> + <%= form_tag publish_admin_communication_website_posts_path do %> + <%= render 'admin/communication/websites/posts/list', posts: @posts, selectable: true %> + <%= paginate @posts, theme: 'bootstrap-5' %> + <div> + <div data-batch-selectable-role="actions-container"> + <div class="d-flex align-items-center"> + <div class="col-auto me-3"> + <%= t('batch_selectable.title') %> + </div> + <div class="col-auto me-3"> + <select name="published" class="form-select"> + <option value="false"><%= t('communication.website.posts.unpublished') %></option> + <option value="true"><%= t('communication.website.posts.published') %></option> + </select> + </div> + <div class="col-auto me-3"> + <%= submit_tag t("save"), class: "btn btn-primary" %> + </div> </div> </div> </div> - </div> - <% end %> - </div> + <% end %> + </div> + <% end %> <% if can?(:create, Communication::Website::Category) || (@root_categories.any? && can?(:edit, @root_categories.first)) %> <% action = create_link Communication::Website::Category %> <%= osuny_panel Communication::Website::Category.model_name.human(count: 2), action: action do %> @@ -51,13 +59,3 @@ <% end %> <% end %> - -<% content_for :action_bar_left do %> - <%= link_to t('communication.website.posts.new_curation'), - new_admin_communication_website_post_curation_path(website_id: @website.id), - class: button_classes if can?(:create, Communication::Website::Post) %> -<% end %> - -<% content_for :action_bar_right do %> - <%= create_link Communication::Website::Post %> -<% end %> diff --git a/app/views/admin/communication/websites/show/_posts.html.erb b/app/views/admin/communication/websites/show/_posts.html.erb index 6a58f65738b84b34f86beb9b9b45bde7993cb46e..e46152ab639c358ff2ea7317af1673bdb8ad33ab 100644 --- a/app/views/admin/communication/websites/show/_posts.html.erb +++ b/app/views/admin/communication/websites/show/_posts.html.erb @@ -1,11 +1,11 @@ <% action = '' -action += link_to t('communication.website.posts.new_curation'), - new_admin_communication_website_post_curation_path(website_id: @website.id), - class: button_classes if can?(:create, Communication::Website::Post) action += link_to t('create'), new_admin_communication_website_post_path(website_id: @website), - class: button_classes('ms-1') if can?(:create, Communication::Website::Post) + class: button_classes if can?(:create, Communication::Website::Post) +action += link_to t('communication.website.posts.new_curation'), + new_admin_communication_website_post_curation_path(website_id: @website.id), + class: button_classes('ms-2 btn-light') if can?(:create, Communication::Website::Post) subtitle = link_to t('communication.website.see_all', number: @all_posts.size), admin_communication_website_posts_path(website_id: @website) %> <%= osuny_panel t('communication.website.last_posts'), diff --git a/app/views/extranet/account/show.html.erb b/app/views/extranet/account/show.html.erb index d36d78bad6c0351babe368cb53646604b38261a1..861f8affa218afd399190591f418dbad521b2241 100644 --- a/app/views/extranet/account/show.html.erb +++ b/app/views/extranet/account/show.html.erb @@ -2,16 +2,18 @@ <div class="row"> <div class="col-md-9"> - <% unless @person.biography.blank? %> + <% unless @person&.biography.blank? %> <div class="biography mb-5"> <%= sanitize @person.biography %> </div> <% end %> - <p><%= t('extranet.experiences.title') %></p> - <%= link_to University::Person::Experience.human_attribute_name('new'), - new_experience_path, - class: 'btn btn-sm btn-primary mt-md-n5 float-md-end' %> - <%= render 'extranet/experiences/list', person: @person, edit: true %> + <% if @person %> + <p><%= t('extranet.experiences.title') %></p> + <%= link_to University::Person::Experience.human_attribute_name('new'), + new_experience_path, + class: 'btn btn-sm btn-primary mt-md-n5 float-md-end' %> + <%= render 'extranet/experiences/list', person: @person, edit: true %> + <% end %> </div> <div class="col-md-3"> <%= kamifusen_tag @person.best_picture, width: 400, class: 'img-fluid person__portrait' if @person&.best_picture&.attached? %> diff --git a/config/locales/communication/en.yml b/config/locales/communication/en.yml index 1ee3d1b693de6ccb26f76c3c8a6f47fdd4d0a642..6696b0dde052fde3abaa15259e645df9b1acbf82 100644 --- a/config/locales/communication/en.yml +++ b/config/locales/communication/en.yml @@ -113,6 +113,7 @@ en: featured_image: Featured image featured_image_alt: Alt text featured_image_credit: Credit + pinned: Pinned published: Published? published_at: Publication date slug: Slug diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 8448493c6cd8eccd65a50a2c23b6d436e2459367..e4ea3d45c04dacb0ead54ee24696193c72a953ee 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -113,6 +113,7 @@ fr: featured_image: Image à la une featured_image_alt: Texte alternatif featured_image_credit: Crédit + pinned: Mis en avant published: Publié ? published_at: Date de publication slug: Identifiant diff --git a/db/migrate/20230317160229_add_pinned_to_communication_extranet_posts.rb b/db/migrate/20230317160229_add_pinned_to_communication_extranet_posts.rb new file mode 100644 index 0000000000000000000000000000000000000000..bac562ba7074d5c2fdaa235a972b757cd1134a29 --- /dev/null +++ b/db/migrate/20230317160229_add_pinned_to_communication_extranet_posts.rb @@ -0,0 +1,5 @@ +class AddPinnedToCommunicationExtranetPosts < ActiveRecord::Migration[7.0] + def change + add_column :communication_extranet_posts, :pinned, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 5f57cb7bad01af31f414ad0632c2a213a5569ceb..f7806b05688f3f9461df83576534ab9d675fd76a 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: 2023_03_16_153131) do +ActiveRecord::Schema[7.0].define(version: 2023_03_17_160229) do # These are extensions that must be enabled in order to support this database enable_extension "pgcrypto" enable_extension "plpgsql" @@ -168,6 +168,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_03_16_153131) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.uuid "category_id" + t.boolean "pinned", default: false t.index ["author_id"], name: "index_communication_extranet_posts_on_author_id" t.index ["category_id"], name: "index_communication_extranet_posts_on_category_id" t.index ["extranet_id"], name: "index_communication_extranet_posts_on_extranet_id" diff --git a/test/fixtures/communication/extranet/posts.yml b/test/fixtures/communication/extranet/posts.yml index 0221b524146d8f75722e8324a5c00dbb2fe08bbd..d8186038c65fd6c80e0ef6e35553f63af1652f7f 100644 --- a/test/fixtures/communication/extranet/posts.yml +++ b/test/fixtures/communication/extranet/posts.yml @@ -5,6 +5,7 @@ # id :uuid not null, primary key # featured_image_alt :string # featured_image_credit :text +# pinned :boolean default(FALSE) # published :boolean default(FALSE) # published_at :datetime # slug :string diff --git a/test/models/communication/extranet/post_test.rb b/test/models/communication/extranet/post_test.rb index 91308df6033cd50a8f7cf6c55c58c52bdd224fb0..282ac65598229aa3f484de919dc58dc877012e4e 100644 --- a/test/models/communication/extranet/post_test.rb +++ b/test/models/communication/extranet/post_test.rb @@ -5,6 +5,7 @@ # id :uuid not null, primary key # featured_image_alt :string # featured_image_credit :text +# pinned :boolean default(FALSE) # published :boolean default(FALSE) # published_at :datetime # slug :string