Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module gallery #321

Merged
merged 4 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
18 changes: 15 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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!
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
20 changes: 19 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down