app/views/decidim/initiatives/initiatives/_form.html.erb in decidim-initiatives-0.26.10 vs app/views/decidim/initiatives/initiatives/_form.html.erb in decidim-initiatives-0.27.0.rc1

- old
+ new

@@ -1,7 +1,26 @@ <%= form_required_explanation %> +<div class="field"> + <%= form.text_field :title, autofocus: true, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.title) %> +</div> + +<div class="field"> + <%= form.editor :description, toolbar: :full, lines: 8, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.description) %> +</div> + +<div class="field"> + <%= form.text_field :hashtag, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %> +</div> + +<div class="field"> + <%= form.select :state, + Decidim::Initiative.states.keys.map { |state| [I18n.t(state, scope: "decidim.initiatives.admin_states"), state] }, + {}, + { disabled: !@form.state_updatable? } %> +</div> + <% unless single_initiative_type? %> <div class="field"> <%= form.select :type_id, initiative_type_options, {}, @@ -16,42 +35,21 @@ } %> </div> <% end %> <div class="field"> - <%= form.text_field :title, autofocus: true, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.title) %> + <%= form.select :scope_id, + @form.available_scopes.map { |scope| [translated_attribute(scope.scope_name), scope&.scope&.id] }, + { disabled: !@form.state_updatable? } %> </div> -<div class="field"> - <%= text_editor_for(form, :description, toolbar: :content, lines: 8, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative), value: translated_attribute(@form.description)) %> -</div> - -<div class="field"> - <%= form.text_field :hashtag, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %> -</div> - -<% signature_type_options = signature_type_options(form.object) %> -<% if signature_type_options.length == 1 %> - <%= form.hidden_field :signature_type %> -<% else %> - <div class="field"> - <%= form.select :signature_type, signature_type_options, {}, { disabled: !@form.signature_type_updatable? } %> - </div> -<% end %> - <% if can_edit_custom_signature_end_date?(current_initiative) %> <div class="row column"> <%= form.date_field :signature_end_date, disabled: !allowed_to?(:update, :initiative, initiative: current_initiative) %> </div> <% end %> -<div class="field"> - <%= form.select :scope_id, - @form.available_scopes.map { |scope| [translated_attribute(scope.scope_name), scope&.scope&.id] }, - { disabled: !@form.state_updatable? } %> -</div> - <% if current_initiative.area_enabled? %> <div class="field"> <%= form.areas_select :area_id, areas_for_select(current_organization), { @@ -61,16 +59,12 @@ disabled: !@form.area_updatable? %> </div> <% end %> <div class="field"> - <%= form.select :state, - Decidim::Initiative.states.keys.map { |state| [I18n.t(state, scope: "decidim.initiatives.admin_states"), state] }, - {}, - { disabled: !@form.state_updatable? } %> + <%= form.select :signature_type, [], {}, { disabled: !@form.signature_type_updatable? } %> </div> - <% if current_initiative.type.attachments_enabled? %> <fieldset class="attachments_container"> <legend><%= t("attachment_legend", scope: "decidim.initiatives.form") %></legend> <% if @form.photos.any? %> @@ -113,6 +107,8 @@ <% if current_initiative.type.promoting_committee_enabled? %> <%= render partial: "committee_members" %> <% end %> -<%= javascript_pack_tag "decidim_initiatives" %> +<% content_for :js_content do %> + <%= javascript_pack_tag "decidim_initiatives" %> +<% end %>