-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Addition of the emitter module * fix: Fix failing specs
- Loading branch information
Showing
13 changed files
with
1,103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
234 changes: 234 additions & 0 deletions
234
app/views/decidim/participatory_processes/admin/participatory_processes/_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,234 @@ | ||
<div class="card"> | ||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".title") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row column"> | ||
<%= form.translated :text_field, :title, autofocus: true %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.translated :text_field, :subtitle %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.number_field :weight %> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="columns xlarge-6 slug"> | ||
<%= form.text_field :slug %> | ||
<p class="help-text"> | ||
<%== t(".slug_help", url: decidim_form_slug_url(:processes, form.object.slug)) %> | ||
</p> | ||
</div> | ||
|
||
<div class="columns xlarge-6"> | ||
<%= form.text_field :hashtag %> | ||
</div> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.translated :editor, :short_description %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.translated :editor, :description, toolbar: :full, lines: 25 %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.translated :editor, :announcement %> | ||
<p class="help-text"><%== t(".announcement_help") %></p> | ||
</div> | ||
</div> | ||
|
||
<% if Decidim::Map.available?(:geocoding) %> | ||
<div class="row column"> | ||
<%= form.text_field :address %> | ||
<p class="help-text"><%== t(".address_help") %></p> | ||
</div> | ||
<% end %> | ||
|
||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".duration") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row"> | ||
<div class="columns xlarge-6"> | ||
<%= form.date_field :start_date %> | ||
</div> | ||
|
||
<div class="columns xlarge-6"> | ||
<%= form.date_field :end_date %> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".images") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row"> | ||
<div class="columns xlarge-6"> | ||
<%= form.upload :hero_image %> | ||
</div> | ||
|
||
<div class="columns xlarge-6"> | ||
<%= form.upload :banner_image %> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".metadata") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row"> | ||
<div class="columns xlarge-6"> | ||
<%= form.translated :text_field, :developer_group %> | ||
</div> | ||
|
||
<div class="columns xlarge-6"> | ||
<%= form.translated :text_field, :local_area %> | ||
</div> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.translated :text_field, :meta_scope %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.translated :text_field, :target %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.translated :text_field, :participatory_scope %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.translated :text_field, :participatory_structure %> | ||
</div> | ||
</div> | ||
|
||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".filters") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row column"> | ||
<%= form.check_box :scopes_enabled %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= scopes_picker_field form, :scope_id, root: nil %> | ||
|
||
<div class="row" id="scope-depth "> | ||
<%= form.collection_select :scope_type_max_depth_id, | ||
organization_scope_depths, | ||
:id, | ||
:name, | ||
scope_type_depth_select_options, | ||
scope_type_depth_select_html_options %> | ||
<p class="help-text"> | ||
<%== t(".scope_type_max_depth_help") %> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.areas_select :area_id, | ||
areas_for_select(current_organization), | ||
selected: current_participatory_process.try(:decidim_area_id), | ||
include_blank: t(".select_an_area") %> | ||
</div> | ||
</div> | ||
|
||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".visbility") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row column"> | ||
<% if process_groups_for_select %> | ||
<%= form.select :participatory_process_group_id, | ||
process_groups_for_select, | ||
include_blank: t(".select_process_group") %> | ||
<% end %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.check_box :private_space %> | ||
</div> | ||
<div class="row column"> | ||
<%= form.check_box :promoted %> | ||
</div> | ||
</div> | ||
|
||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".emitter") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row column"> | ||
<%= form.select :emitter_select, options_for_select(emitter_options), { :include_blank => true, label: t(".emitter_logo_select") }, class: "select-emitter" %> | ||
</div> | ||
<div class="row column select-emitter-image"></div> | ||
<label class="row column"> <%= t(".emitter_new") %> </label> | ||
<div class="row column"> | ||
<%= form.text_field :emitter_name_image, label: t(".emitter_name") %> | ||
</div> | ||
<div class="row column"> | ||
<%= form.upload :emitter_image, label: t(".emitter_logo"), help_i18n_scope: "decidim.admin.forms.file_help.emitter" %> | ||
</div> | ||
<% if form.object.emitter_name.present? %> | ||
<div class="row column"> | ||
<%= form.text_field :emitter_read_name, { :readonly => true, :label => t(".emitter_now") } %> | ||
</div> | ||
<% end %> | ||
</div> | ||
|
||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".related_processes") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row column"> | ||
<%= form.select( | ||
:related_process_ids, | ||
@form.processes.order(title: :asc).map{|process| [translated_attribute(process.title), process.id]}, | ||
{ include_blank: true }, | ||
{ multiple: true, class: "chosen-select" } | ||
) %> | ||
</div> | ||
</div> | ||
|
||
<div class="card-divider"> | ||
<h2 class="card-title"><%= t(".other") %></h2> | ||
</div> | ||
|
||
<div class="card-section"> | ||
<div class="row column"> | ||
<%= form.check_box :show_statistics %> | ||
</div> | ||
|
||
<div class="row column"> | ||
<%= form.check_box :show_metrics %> | ||
</div> | ||
|
||
<% if @form.participatory_process_types_for_select.present? %> | ||
<div class="row column"> | ||
<%= form.select( | ||
:participatory_process_type_id, | ||
@form.participatory_process_types_for_select, | ||
include_blank: t(".select_participatory_process_type") | ||
) %> | ||
</div> | ||
<% end %> | ||
</div> | ||
</div> | ||
|
||
<%= javascript_pack_tag "decidim_participatory_processes_admin" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
db/migrate/20241118114335_add_emitter_to_decidim_participatory_process.decidim_emitter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This migration comes from decidim_emitter (originally 20240417082337) | ||
class AddEmitterToDecidimParticipatoryProcess < ActiveRecord::Migration[6.1] | ||
def up | ||
# Ensure that the column is a string and check if it exists | ||
add_column :decidim_participatory_processes, :emitter, :string, if_not_exists: true | ||
change_column :decidim_participatory_processes, :emitter, :string | ||
|
||
add_column :decidim_participatory_processes, :emitter_name, :text, if_not_exists: true | ||
end | ||
|
||
def down | ||
remove_column :decidim_participatory_processes, :emitter_name, if_exists: true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.