diff --git a/Dockerfile b/Dockerfile index da60f4d96f..955a27449a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,9 @@ RUN yarn install COPY . . -RUN bundle exec bootsnap precompile --gemfile app/ lib/ config/ bin/ db/ && bundle exec rails assets:precompile +RUN bundle exec bootsnap precompile --gemfile app/ lib/ config/ bin/ db/ && \ + bundle exec rails assets:precompile && \ + bundle exec rails deface:precompile # Configure endpoint. COPY ./entrypoint.sh /usr/bin/ diff --git a/Gemfile b/Gemfile index 447caf5786..8d0225b937 100644 --- a/Gemfile +++ b/Gemfile @@ -19,11 +19,12 @@ gem "decidim-templates", "~> #{DECIDIM_VERSION}.0" gem "decidim-cache_cleaner" gem "decidim-decidim_awesome" gem "decidim-friendly_signup", git: "https://github.com/OpenSourcePolitics/decidim-module-friendly_signup.git" +gem "decidim-gallery" gem "decidim-homepage_interactive_map", git: "https://github.com/OpenSourcePolitics/decidim-module-homepage_interactive_map.git", branch: DECIDIM_BRANCH gem "decidim-ludens", git: "https://github.com/OpenSourcePolitics/decidim-ludens.git", branch: DECIDIM_BRANCH gem "decidim-phone_authorization_handler", git: "https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler", branch: DECIDIM_BRANCH gem "decidim-spam_detection" -gem "decidim-term_customizer", git: "https://github.com/mainio/decidim-module-term_customizer.git", branch: DECIDIM_BRANCH +gem "decidim-term_customizer", git: "https://github.com/armandfardeau/decidim-module-term_customizer.git", branch: "fix/precompile-on-docker-0.26" # Omniauth gems gem "omniauth-france_connect", git: "https://github.com/OpenSourcePolitics/omniauth-france_connect" diff --git a/Gemfile.lock b/Gemfile.lock index 8c981de9b3..4f5a9cd016 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,9 +49,9 @@ GIT omniauth-oauth2 (>= 1.7.2, < 2.0) GIT - remote: https://github.com/mainio/decidim-module-term_customizer.git - revision: f0d720710822f1231ea249dd71f978143d38a6c4 - branch: release/0.26-stable + remote: https://github.com/armandfardeau/decidim-module-term_customizer.git + revision: 63170f69b51bb7e7f60f20856e944ae1357f4dc7 + branch: fix/precompile-on-docker-0.26 specs: decidim-term_customizer (0.26.0) decidim-admin (~> 0.26.0) @@ -384,6 +384,10 @@ GEM decidim-core (= 0.26.7) wicked_pdf (~> 2.1) wkhtmltopdf-binary (~> 0.12) + decidim-gallery (0.0.1) + decidim-admin (~> 0.26.0) + decidim-core (~> 0.26.0) + deface (~> 1.9) decidim-generators (0.26.7) decidim-core (= 0.26.7) decidim-meetings (0.26.7) @@ -425,6 +429,12 @@ GEM declarative-option (< 0.2.0) declarative-option (0.1.0) deepl-rb (2.5.3) + deface (1.9.0) + actionview (>= 5.2) + nokogiri (>= 1.6) + polyglot + railties (>= 5.2) + rainbow (>= 2.1.0) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) devise (4.9.2) @@ -692,6 +702,7 @@ GEM pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) + polyglot (0.3.5) premailer (1.21.0) addressable css_parser (>= 1.12.0) @@ -996,6 +1007,7 @@ DEPENDENCIES decidim-decidim_awesome decidim-dev (~> 0.26.0) decidim-friendly_signup! + decidim-gallery decidim-homepage_interactive_map! decidim-ludens! decidim-phone_authorization_handler! diff --git a/README.md b/README.md index b36b3470fd..ad25b247ba 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ You can find below an exhaustive list of modules with their repository links and | [decidim-phone_authorization_handler](https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler) | ✅ |Module allowing gathering phone number on a particular participant action| | [decidim-spam_detection](https://github.com/OpenSourcePolitics/decidim-spam_detection) | ✅ |Module adding a spam detection algorithm that runs periodically detecting spam accounts| | [decidim-term_customizer](https://github.com/mainio/decidim-module-term_customizer) | ✅ |Module allowing the change of translated strings | +| [decidim-gallery](https://github.com/alecslupu-pfa/decidim-module-gallery)| ✅ |Module allowing the creation of galleries | Some non-official customizations can be found see [OVERLOADS.MD](./OVERLOADS.md). diff --git a/db/migrate/20230612152043_create_decidim_gallery_gallery_items.decidim_gallery.rb b/db/migrate/20230612152043_create_decidim_gallery_gallery_items.decidim_gallery.rb new file mode 100644 index 0000000000..b4a3d878c0 --- /dev/null +++ b/db/migrate/20230612152043_create_decidim_gallery_gallery_items.decidim_gallery.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# This migration comes from decidim_gallery (originally 20211019215121) + +class CreateDecidimGalleryGalleryItems < ActiveRecord::Migration[6.0] + def change + create_table :decidim_gallery_gallery_items do |t| + t.jsonb :title + t.references :decidim_component, index: true + + t.string :decidim_author_type, null: false + t.integer :decidim_author_id, null: false + t.integer :decidim_user_group_id + t.datetime :published_at + t.jsonb :data, default: {} + t.integer :weight, default: 0 + + t.timestamps + end + add_index :decidim_gallery_gallery_items, + [:decidim_author_id, :decidim_author_type], + name: "index_decidim_gallery_gallery_items_on_decidim_author" + add_index :decidim_gallery_gallery_items, :published_at + add_index :decidim_gallery_gallery_items, :decidim_user_group_id + end +end diff --git a/db/migrate/20230612152044_add_gallery_id_to_decidim_static_pages.decidim_gallery.rb b/db/migrate/20230612152044_add_gallery_id_to_decidim_static_pages.decidim_gallery.rb new file mode 100644 index 0000000000..d772d8081e --- /dev/null +++ b/db/migrate/20230612152044_add_gallery_id_to_decidim_static_pages.decidim_gallery.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This migration comes from decidim_gallery (originally 20211019215122) + +class AddGalleryIdToDecidimStaticPages < ActiveRecord::Migration[5.2] + def change + add_column :decidim_static_pages, :gallery_id, :integer, default: 0 + end +end diff --git a/db/schema.rb b/db/schema.rb index 614a5615ea..ca5b7830fb 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: 2023_04_06_122933) do +ActiveRecord::Schema.define(version: 2023_06_12_152044) do # These are extensions that must be enabled in order to support this database enable_extension "ltree" @@ -814,6 +814,23 @@ t.index ["position"], name: "index_decidim_forms_questions_on_position" end + create_table "decidim_gallery_gallery_items", force: :cascade do |t| + t.jsonb "title" + t.bigint "decidim_component_id" + t.string "decidim_author_type", null: false + t.integer "decidim_author_id", null: false + t.integer "decidim_user_group_id" + t.datetime "published_at" + t.jsonb "data", default: {} + t.integer "weight", default: 0 + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["decidim_author_id", "decidim_author_type"], name: "index_decidim_gallery_gallery_items_on_decidim_author" + t.index ["decidim_component_id"], name: "index_decidim_gallery_gallery_items_on_decidim_component_id" + t.index ["decidim_user_group_id"], name: "index_decidim_gallery_gallery_items_on_decidim_user_group_id" + t.index ["published_at"], name: "index_decidim_gallery_gallery_items_on_published_at" + end + create_table "decidim_gamification_badge_scores", force: :cascade do |t| t.bigint "user_id", null: false t.string "badge_name", null: false @@ -1615,6 +1632,7 @@ t.boolean "show_in_footer", default: false, null: false t.bigint "topic_id" t.boolean "allow_public_access", default: false, null: false + t.integer "gallery_id", default: 0 t.index ["decidim_organization_id"], name: "index_decidim_static_pages_on_decidim_organization_id" t.index ["topic_id"], name: "index_decidim_static_pages_on_topic_id" end