Skip to content
Snippets Groups Projects
Unverified Commit daddfc5c authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

Merge branch 'summernote' of github.com:noesya/osuny into summernote

parents 5b1519a9 cb8fd0c8
No related branches found
No related tags found
No related merge requests found
Showing
with 107 additions and 385 deletions
......@@ -20,60 +20,60 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
actioncable (6.1.4.6)
actionpack (= 6.1.4.6)
activesupport (= 6.1.4.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.4)
actionpack (= 6.1.4.4)
activejob (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionmailbox (6.1.4.6)
actionpack (= 6.1.4.6)
activejob (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
mail (>= 2.7.1)
actionmailer (6.1.4.4)
actionpack (= 6.1.4.4)
actionview (= 6.1.4.4)
activejob (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionmailer (6.1.4.6)
actionpack (= 6.1.4.6)
actionview (= 6.1.4.6)
activejob (= 6.1.4.6)
activesupport (= 6.1.4.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.4.4)
actionview (= 6.1.4.4)
activesupport (= 6.1.4.4)
actionpack (6.1.4.6)
actionview (= 6.1.4.6)
activesupport (= 6.1.4.6)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.4.4)
actionpack (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
actiontext (6.1.4.6)
actionpack (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
nokogiri (>= 1.8.5)
actionview (6.1.4.4)
activesupport (= 6.1.4.4)
actionview (6.1.4.6)
activesupport (= 6.1.4.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.4.4)
activesupport (= 6.1.4.4)
activejob (6.1.4.6)
activesupport (= 6.1.4.6)
globalid (>= 0.3.6)
activemodel (6.1.4.4)
activesupport (= 6.1.4.4)
activerecord (6.1.4.4)
activemodel (= 6.1.4.4)
activesupport (= 6.1.4.4)
activestorage (6.1.4.4)
actionpack (= 6.1.4.4)
activejob (= 6.1.4.4)
activerecord (= 6.1.4.4)
activesupport (= 6.1.4.4)
activemodel (6.1.4.6)
activesupport (= 6.1.4.6)
activerecord (6.1.4.6)
activemodel (= 6.1.4.6)
activesupport (= 6.1.4.6)
activestorage (6.1.4.6)
actionpack (= 6.1.4.6)
activejob (= 6.1.4.6)
activerecord (= 6.1.4.6)
activesupport (= 6.1.4.6)
marcel (~> 1.0.0)
mini_mime (>= 1.1.0)
activesupport (6.1.4.4)
activesupport (6.1.4.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
......@@ -87,7 +87,7 @@ GEM
autoprefixer-rails (10.4.2.0)
execjs (~> 2)
aws-eventstream (1.2.0)
aws-partitions (1.553.0)
aws-partitions (1.554.0)
aws-sdk-core (3.126.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
......@@ -139,7 +139,7 @@ GEM
countries (~> 4.2)
sort_alphabetical (~> 1.1)
crass (1.0.6)
curation (1.7)
curation (1.8)
metainspector
nokogiri
delayed_job (4.1.10)
......@@ -253,7 +253,7 @@ GEM
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.13.0)
loofah (2.14.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
......@@ -291,7 +291,7 @@ GEM
pg (1.3.1)
popper_js (2.9.3)
public_suffix (4.0.6)
puma (5.6.1)
puma (5.6.2)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.3)
......@@ -301,32 +301,32 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.4.4)
actioncable (= 6.1.4.4)
actionmailbox (= 6.1.4.4)
actionmailer (= 6.1.4.4)
actionpack (= 6.1.4.4)
actiontext (= 6.1.4.4)
actionview (= 6.1.4.4)
activejob (= 6.1.4.4)
activemodel (= 6.1.4.4)
activerecord (= 6.1.4.4)
activestorage (= 6.1.4.4)
activesupport (= 6.1.4.4)
rails (6.1.4.6)
actioncable (= 6.1.4.6)
actionmailbox (= 6.1.4.6)
actionmailer (= 6.1.4.6)
actionpack (= 6.1.4.6)
actiontext (= 6.1.4.6)
actionview (= 6.1.4.6)
activejob (= 6.1.4.6)
activemodel (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
bundler (>= 1.15.0)
railties (= 6.1.4.4)
railties (= 6.1.4.6)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
rails-i18n (7.0.1)
rails-i18n (7.0.2)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (6.1.4.4)
actionpack (= 6.1.4.4)
activesupport (= 6.1.4.4)
railties (6.1.4.6)
actionpack (= 6.1.4.6)
activesupport (= 6.1.4.6)
method_source
rake (>= 0.13)
thor (~> 1.0)
......@@ -335,7 +335,7 @@ GEM
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.2.0)
regexp_parser (2.2.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
......
......@@ -27,6 +27,7 @@ class ApplicationRecord < ActiveRecord::Base
# https://github.com/rails/rails/blob/b961af3345fe2f9e492ba1e5424c2ceb75ac6ead/actiontext/lib/action_text/attribute.rb#L4
# https://github.com/rails/rails/blob/b961af3345fe2f9e492ba1e5424c2ceb75ac6ead/actiontext/lib/action_text/content.rb#L121
def self.has_summernote(name)
# https://dalibornasevic.com/posts/16-ruby-class_eval-__file__-and-__line__-arguments
class_eval <<-CODE, __FILE__, __LINE__ + 1
serialize :#{name}, ActionText::Content
CODE
......
......@@ -75,6 +75,11 @@
</div>
<% end %>
<% content_for :preview do %>
<%= @page.text.to_s %>
<% end %>
<% content_for :action_bar_right do %>
<%= preview_link %>
<%= edit_link @page %>
<% end %>
......@@ -8,7 +8,7 @@
<h5 class="card-title mb-0"><%= t('admin.infos') %></h5>
</div>
<div class="card-body">
<%= f.input :description %>
<%= f.input :description, as: :string %>
</div>
</div>
</div>
......
......@@ -2,5 +2,7 @@
<%= render 'admin/education/program/roles/list', roles: @roles %>
<% content_for :action_bar_right do %>
<%= link_to t('add'), new_admin_education_program_role_path(program_id: @program.id), class: button_classes if can? :create, University::Role %>
<%= link_to t('create'),
new_admin_education_program_role_path(program_id: @program.id),
class: button_classes if can? :create, University::Role %>
<% end %>
......@@ -11,7 +11,7 @@
<%= f.association :person, collection: @available_people %>
</div>
<div class="col-md-6">
<%= f.input :description %>
<%= f.input :description, as: :string %>
</div>
</div>
</div>
......
......@@ -2,5 +2,7 @@
<%= render 'admin/education/program/teachers/list', involvements: @involvements %>
<% content_for :action_bar_right do %>
<%= link_to t('add'), new_admin_education_program_teacher_path(program_id: @program.id), class: button_classes %>
<%= link_to t('create'),
new_admin_education_program_teacher_path(program_id: @program.id),
class: button_classes %>
<% end %>
......@@ -54,8 +54,8 @@
:contacts,
:accessibility,
:other
].each_with_index do |prop, index| %>
<%= render 'admin/application/property/text', object: @program, property: prop %>
].each_with_index do |property, index| %>
<%= render 'admin/application/property/text', object: @program, property: property %>
<% end %>
</div>
</div>
......@@ -78,8 +78,8 @@
:evaluation,
:opportunities,
:results
].each do |prop| %>
<%= render 'admin/application/property/text', object: @program, property: prop %>
].each do |property| %>
<%= render 'admin/application/property/text', object: @program, property: property %>
<% end %>
</div>
</div>
......@@ -115,6 +115,27 @@
</div>
<% end %>
<% content_for :preview do %>
<% [
:registration,
:pricing,
:duration,
:contacts,
:accessibility,
:other,
:objectives,
:content,
:prerequisites,
:pedagogy,
:evaluation,
:opportunities,
:results
].each do |property| %>
<%= @program.send(property).to_s %>
<% end %>
<% end %>
<% content_for :action_bar_right do %>
<%= preview_link %>
<%= edit_link @program %>
<% end %>
......@@ -88,10 +88,10 @@ A l'enregistrement, la balise est vidée.
Etapes normales :
-[x] A l'import d'une image, ajouter l'action-text-attachement autour
-[x] A la suppression d'une image dans l'éditeur, supprimer l'action-text-attachement autour
-[x] A l'enregistrement, déshydrater les action-text-attachements
-[x] A l'édition, réhydrater les action-text-attachements
-[x] Après l'enregistrement mettre à jour les blobs attachés à l'objet parent (le post, par exemple)
-[x] A la suppression d'une image dans l'éditeur, bien supprimer l'élément <figure data-trix-attachment="..."></figure>
Si un programme a 5 champs summernote avec 3 images dans chaque champ, cela fait 15 attachments à lier au programme.
Si on enlève une image d'un champ, il faut mettre à jour la liste pour avoir les 14 bons attachments.
......
test:
university: test
name: Site de test
# == Schema Information
#
# Table name: communication_website_github_files
#
# id :uuid not null, primary key
# about_type :string not null
# github_path :string
# manifest_identifier :string
# created_at :datetime not null
# updated_at :datetime not null
# about_id :uuid not null
# website_id :uuid not null
#
# Indexes
#
# index_communication_website_github_files_on_about (about_type,about_id)
# index_communication_website_github_files_on_website_id (website_id)
#
# Foreign Keys
#
# fk_rails_... (website_id => communication_websites.id)
#
one:
github_path: MyString
about: one
two:
github_path: MyString
about: two
test:
university: test
website: test
title: Test
slug: test
# == Schema Information
#
# Table name: education_program_members
#
# id :uuid not null, primary key
# role :string
# created_at :datetime not null
# updated_at :datetime not null
# member_id :uuid not null
# program_id :uuid not null
#
# Indexes
#
# index_education_program_members_on_member_id (member_id)
# index_education_program_members_on_program_id (program_id)
#
# Foreign Keys
#
# fk_rails_... (member_id => university_people.id)
# fk_rails_... (program_id => education_programs.id)
#
one:
role: MyString
member: one
program: one
two:
role: MyString
member: two
program: two
# == Schema Information
#
# Table name: education_program_role_people
#
# id :uuid not null, primary key
# position :integer
# created_at :datetime not null
# updated_at :datetime not null
# person_id :uuid not null
# role_id :uuid not null
#
# Indexes
#
# index_education_program_role_people_on_person_id (person_id)
# index_education_program_role_people_on_role_id (role_id)
#
# Foreign Keys
#
# fk_rails_... (person_id => university_people.id)
# fk_rails_... (role_id => education_program_roles.id)
#
one:
position: 1
person: one
role: one
two:
position: 1
person: two
role: two
# == Schema Information
#
# Table name: education_program_roles
#
# id :uuid not null, primary key
# position :integer
# title :string
# created_at :datetime not null
# updated_at :datetime not null
# program_id :uuid not null
# university_id :uuid not null
#
# Indexes
#
# index_education_program_roles_on_program_id (program_id)
# index_education_program_roles_on_university_id (university_id)
#
# Foreign Keys
#
# fk_rails_... (program_id => education_programs.id)
# fk_rails_... (university_id => universities.id)
#
one:
title: MyString
position: 1
program: one
university: one
two:
title: MyString
position: 1
program: two
university: two
# == Schema Information
#
# Table name: education_program_teachers
#
# id :uuid not null, primary key
# description :text
# created_at :datetime not null
# updated_at :datetime not null
# person_id :uuid not null
# program_id :uuid not null
#
# Indexes
#
# index_education_program_teachers_on_person_id (person_id)
# index_education_program_teachers_on_program_id (program_id)
#
# Foreign Keys
#
# fk_rails_... (person_id => university_people.id)
# fk_rails_... (program_id => education_programs.id)
#
one:
description: MyText
program: one
person: one
two:
description: MyText
program: two
person: two
# == Schema Information
#
# Table name: education_school_administrators
#
# id :uuid not null, primary key
# description :text
# created_at :datetime not null
# updated_at :datetime not null
# person_id :uuid not null
# school_id :uuid not null
#
# Indexes
#
# index_education_school_administrators_on_person_id (person_id)
# index_education_school_administrators_on_school_id (school_id)
#
# Foreign Keys
#
# fk_rails_... (person_id => university_people.id)
# fk_rails_... (school_id => education_schools.id)
#
one:
description: MyText
school: one
person: one
two:
description: MyText
school: two
person: two
# == Schema Information
#
# Table name: research_laboratories
#
# id :uuid not null, primary key
# address :string
# city :string
# country :string
# name :string
# zipcode :string
# created_at :datetime not null
# updated_at :datetime not null
# university_id :uuid not null, indexed
#
# Indexes
#
# index_research_laboratories_on_university_id (university_id)
#
# Foreign Keys
#
# fk_rails_f61d27545f (university_id => universities.id)
#
one:
university: one
name: MyString
address: MyString
zipcode: MyString
city: MyString
country: MyString
two:
university: two
name: MyString
address: MyString
zipcode: MyString
city: MyString
country: MyString
# == Schema Information
#
# Table name: research_laboratory_axes
#
# id :uuid not null, primary key
# description :text
# name :string
# position :integer
# short_name :string
# created_at :datetime not null
# updated_at :datetime not null
# research_laboratory_id :uuid not null, indexed
# university_id :uuid not null, indexed
#
# Indexes
#
# index_research_laboratory_axes_on_research_laboratory_id (research_laboratory_id)
# index_research_laboratory_axes_on_university_id (university_id)
#
# Foreign Keys
#
# fk_rails_ad2cb9a562 (research_laboratory_id => research_laboratories.id)
# fk_rails_d334f832b4 (university_id => universities.id)
#
one:
university: one
research_laboratory: one
name: MyString
description: MyText
position: 1
two:
university: two
research_laboratory: two
name: MyString
description: MyText
position: 1
# == Schema Information
#
# Table name: research_theses
#
# id :uuid not null, primary key
# abstract :text
# completed :boolean default(FALSE)
# completed_at :date
# started_at :date
# title :string
# created_at :datetime not null
# updated_at :datetime not null
# author_id :uuid not null, indexed
# director_id :uuid not null, indexed
# research_laboratory_id :uuid not null, indexed
# university_id :uuid not null, indexed
#
# Indexes
#
# index_research_theses_on_author_id (author_id)
# index_research_theses_on_director_id (director_id)
# index_research_theses_on_research_laboratory_id (research_laboratory_id)
# index_research_theses_on_university_id (university_id)
#
# Foreign Keys
#
# fk_rails_1e42972d90 (author_id => university_people.id)
# fk_rails_44b431f9e5 (university_id => universities.id)
# fk_rails_8d223fdbaf (director_id => university_people.id)
# fk_rails_b3380066dc (research_laboratory_id => research_laboratories.id)
#
one:
university: one
research_laboratory: one
author: one
director: one
title: MyString
abstract: MyText
started_at: 2022-01-20
completed: false
completed_at: 2022-01-20
two:
university: two
research_laboratory: two
author: two
director: two
title: MyString
abstract: MyText
started_at: 2022-01-20
completed: false
completed_at: 2022-01-20
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment