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 decidim-initiatives #388

Closed
wants to merge 7 commits into from
Closed
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
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ source "https://rubygems.org"
ruby RUBY_VERSION

gem "decidim", "0.24.3"
gem "decidim-initiatives", "0.24.3"

gem "decidim-comments", path: "decidim-comments"

Expand Down
19 changes: 19 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
colorize (0.8.1)
concurrent-ruby (1.1.9)
connection_pool (2.2.5)
cookiejar (0.3.3)
Expand Down Expand Up @@ -315,6 +316,17 @@ GEM
wkhtmltopdf-binary (~> 0.12)
decidim-generators (0.24.3)
decidim-core (= 0.24.3)
decidim-initiatives (0.24.3)
decidim-admin (= 0.24.3)
decidim-comments (= 0.24.3)
decidim-core (= 0.24.3)
decidim-verifications (= 0.24.3)
kaminari (~> 1.2, >= 1.2.1)
origami (~> 2.1)
virtus-multiparams (~> 0.1)
wicked (~> 1.3)
wicked_pdf (~> 1.4)
wkhtmltopdf-binary (~> 0.12)
decidim-meetings (0.24.3)
cells-erb (~> 0.1.0)
cells-rails (~> 0.0.9)
Expand Down Expand Up @@ -628,6 +640,8 @@ GEM
omniauth-twitter (1.4.0)
omniauth-oauth (~> 1.1)
rack
origami (2.1.0)
colorize (~> 0.7)
orm_adapter (0.5.0)
paper_trail (10.3.1)
activerecord (>= 4.2)
Expand Down Expand Up @@ -867,6 +881,8 @@ GEM
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
virtus-multiparams (0.1.1)
virtus (~> 1.0)
warden (1.2.9)
rack (>= 2.0.9)
web-console (3.7.0)
Expand All @@ -881,6 +897,8 @@ GEM
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
wicked (1.4.0)
railties (>= 3.0.7)
wicked_pdf (1.4.0)
activesupport
wisper (2.0.1)
Expand All @@ -901,6 +919,7 @@ DEPENDENCIES
decidim-comments!
decidim-decidim_awesome (~> 0.7.0)
decidim-dev (= 0.24.3)
decidim-initiatives (= 0.24.3)
decidim-term_customizer!
decidim-user_extension!
deface
Expand Down
66 changes: 66 additions & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ ja:
name: アカウントID
group:
nickname: アカウントID
initiative:
offline_votes: 対面署名
offline_votes_for_scope: '%{scope_name} の 対面署名'
signature_type_values:
any: ハイブリッド
offline: 対面
online: オンライン
initiatives_type:
area_enabled: 作成者がイニシアチブの領域を選択できるようにする
only_global_scope_enabled: グローバルスコープのイニシアチブの作成のみを許可する
promoting_committee_enabled: 推進委員会を有効にする
question:
origin_title: 起案者
origin_url: 元のURL
Expand All @@ -25,6 +36,12 @@ ja:
secondary_color: セカンダリ
minutes:
visible: 表示する
activerecord:
models:
decidim/initiative:
other: イニシアチブ
decidim/initiative_comittee:
other: イニシアチブ委員会
date:
formats:
decidim_short: "%Y/%m/%d"
Expand Down Expand Up @@ -871,3 +888,52 @@ ja:
long_dashed: "%Y-%m-%d %H:%M:%S"
short: "%Y/%m/%d %H:%M"
time_of_day: "%H:%M"
decidim:
admin:
actions:
new_initiative_type: 新しいイニシアチブ種別
menu:
initiatives: イニシアチブ
initiatives_types: イニシアチブ種別
models:
initiatives_votes:
fields:
initiative_signatures_count: 署名数
initiative_start_date: 開始日
initiative_title: イニシアチブのタイトル
name_and_surname: 氏名
initiatives:
actions:
initiatives:
edit:
accept: 取り組みを承認する
admin_states:
accepted: 署名数達成
created: 作成済み
discarded: 破棄済み
published: 公開済み
rejected: 署名数未達成
validating: 技術的検証
application_helper:
filter_state_values:
accepted: 署名数達成
all: すべて
answered: 回答済み
closed: 終了
open: 公開
rejected: 署名数未達成
committee_requests:
new:
help_text: このイニシアチブの推進委員会のメンバーになることをリクエストします
create_initiative:
previous_form:
help: このイニシアチブはどのようなものですか?タイトルと説明を書いてください。簡潔なタイトルと、提案する解決策に焦点を当てた説明をお勧めします。
share_committee_link:
invite_to_committee_help: 推進委員会に参加する人を招待するためのリンク
initiatives:
closed_initiatives_warning: 現在開催中のイニシアチブはありませんが、ここに記録されているすべてのイニシアチブから探すことができます。
no_initiatives_warning: 検索基準に一致するイニシアチブは見つかりませんでした
layouts:
decidim:
initiative_creation_header:
promotal_committee: 推進委員会
44 changes: 44 additions & 0 deletions config/locales/v0243_initiative_ja.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
ja:
activemodel:
attributes:
initiative:
area_id: エリア
decidim_scope_id: スコープ
signature_end_date: 署名収集期間の終了日
signature_start_date: 署名収集期間の開始日
initiatives_type:
area_enabled: 作成者がイニシアチブのエリアを選択できるようにする
only_global_scope_enabled: グローバルスコープのイニシアチブの作成のみを許可する
initiatives_type_scope:
supports_required: 必要署名数
decidim_scopes_id: スコープ
organization_data:
name: 氏名
activerecord:
models:
decidim/initiative:
other: イニシアチブ
decidim/initiative_comittee:
other: 委員会
decidim:
admin:
actions:
new_initiative_type: 新しいイニシアチブ種別
menu:
initiatives: イニシアチブ
initiatives_types: イニシアチブ種別
models:
initiatives:
fields:
supports_count: 署名数
initiatives_type_scope:
fields:
supports_required: 必要署名数
initiatives:
admin:
initiatives:
edit:
accept: イニシアチブを承認する
initiatives_types:
form:
only_global_scope_enabled_help: '「子スコープ署名」を有効にし、グローバルスコープを親スコープとして設定する場合、このフラグをチェックします。これを有効にすると、イニシアチブ作成ウィザードでイニシアチブタイプの選択がスキップされます。 この設定の仕組みについての詳細は、この <a href="https://docs.decidim.org/admin-manual/en/initiatives/" target="_blank">リンク</a> を参照してください。'
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20170906091626)

class CreateDecidimInitiativesTypes < ActiveRecord::Migration[5.1]
def change
create_table :decidim_initiatives_types do |t|
t.jsonb :title, null: false
t.jsonb :description, null: false
t.integer :supports_required, null: false

t.integer :decidim_organization_id,
foreign_key: true,
index: {
name: "index_decidim_initiative_types_on_decidim_organization_id"
}

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20170906094044)

# Migration that creates the decidim_initiatives table
class CreateDecidimInitiatives < ActiveRecord::Migration[5.1]
def change
create_table :decidim_initiatives do |t|
t.jsonb :title, null: false
t.jsonb :description, null: false

t.integer :decidim_organization_id,
foreign_key: true,
index: {
name: "index_decidim_initiatives_on_decidim_organization_id"
}

# Text search indexes for initiatives.
t.index :title, name: "decidim_initiatives_title_search"
t.index :description, name: "decidim_initiatives_description_search"

t.references :decidim_author, index: true
t.string :banner_image

# Publicable
t.datetime :published_at, index: true

# Scopeable
t.integer :decidim_scope_id, index: true

t.references :type, index: true
t.integer :state, null: false, default: 0
t.integer :signature_type, null: false, default: 0
t.date :signature_start_time, null: false
t.date :signature_end_time, null: false
t.jsonb :answer
t.datetime :answered_at, index: true
t.string :answer_url
t.integer :initiative_votes_count, null: false, default: 0

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20170917072556)

class CreateDecidimInitiativesVotes < ActiveRecord::Migration[5.1]
def change
create_table :decidim_initiatives_votes do |t|
t.references :decidim_initiative, null: false, index: true
t.references :decidim_author, null: false, index: true
t.integer :scope, null: false, default: 0

t.timestamps
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20170922152432)

# Migration that creates the decidim_initiatives_committee_members table
class CreateDecidimInitiativesCommitteeMembers < ActiveRecord::Migration[5.1]
def change
create_table :decidim_initiatives_committee_members do |t|
t.references :decidim_initiatives, index: {
name: "index_decidim_committee_members_initiative"
}
t.references :decidim_users, index: {
name: "index_decidim_committee_members_user"
}
t.integer :state, index: true, null: false, default: 0

t.timestamps
end
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_initiatives (originally 20170927131354)

class AddDecidimUserGroupIdToDecidimInitiatives < ActiveRecord::Migration[5.1]
def change
add_column :decidim_initiatives,
:decidim_user_group_id, :integer, index: true
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_initiatives (originally 20170927153744)

class ChangeSignatureIntervalToOptional < ActiveRecord::Migration[5.1]
def change
change_column :decidim_initiatives, :signature_start_time, :date, null: true
change_column :decidim_initiatives, :signature_end_time, :date, null: true
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_initiatives (originally 20170928160302)

class AddDecidimUserGroupIdToDecidimInitiativesVotes < ActiveRecord::Migration[5.1]
def change
add_column :decidim_initiatives_votes,
:decidim_user_group_id, :integer, index: true
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20170928160912)

class RemoveScopeFromDecidimInitiativesVotes < ActiveRecord::Migration[5.1]
def change
remove_column :decidim_initiatives_votes, :scope, :integer
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20171011110714)

class AddBannerImageToInitiativeType < ActiveRecord::Migration[5.1]
def change
add_column :decidim_initiatives_types, :banner_image, :string
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20171011152425)

class AddHashtagToInitiatives < ActiveRecord::Migration[5.1]
def change
add_column :decidim_initiatives, :hashtag, :string, unique: true
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20171013090432)

class AddInitiativeSupportsCountToInitiative < ActiveRecord::Migration[5.1]
class Initiative < ApplicationRecord
self.table_name = :decidim_initiatives
end

def change
add_column :decidim_initiatives, :initiative_supports_count, :integer, null: false, default: 0

reversible do |change|
change.up do
Initiative.find_each do |initiative|
initiative.initiative_supports_count = initiative.votes.supports.count
initiative.save
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true
# This migration comes from decidim_initiatives (originally 20171017090551)

class CreateDecidimInitiativesDecidimInitiativesTypeScopes < ActiveRecord::Migration[5.1]
def change
create_table :decidim_initiatives_type_scopes do |t|
t.references :decidim_initiatives_types, index: { name: "idx_scoped_initiative_type_type" }
t.references :decidim_scopes, index: { name: "idx_scoped_initiative_type_scope" }
t.integer :supports_required, null: false

t.timestamps
end
end
end
Loading