This repository has been archived by the owner on Mar 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_edit_form_fields.html.erb
81 lines (71 loc) · 2.55 KB
/
_edit_form_fields.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<div class="field hashtags__container">
<%= form.text_field :title, class: "js-hashtags", hashtaggable: true, value: form_presenter.title %>
</div>
<div class="field hashtags__container">
<%= text_editor_for_proposal_body(form) %>
</div>
<% if @form.component_automatic_hashtags.any? %>
<div class="field">
<%= form.label :automatic_hashtags %>
<div class="checkboxes hashtags">
<% @form.component_automatic_hashtags.each do |hashtag| %>
<label>
<%= check_box_tag "", "", { checked: true }, { disabled: true } %>#<%= hashtag %>
</label>
<% end %>
</div>
</div>
<% end %>
<% if @form.component_suggested_hashtags.any? %>
<div class="field">
<%= form.label :suggested_hashtags %>
<div class="checkboxes hashtags">
<%= form.collection_check_boxes :suggested_hashtags, @form.component_suggested_hashtags.map {|hashtag| [hashtag.downcase, "##{hashtag}"]}, :first, :last do |option|
option.label { option.check_box(checked: @form.suggested_hashtag_checked?(option.value)) + option.text }
end %>
</div>
</div>
<% end %>
<% if component_settings.geocoding_enabled? %>
<div class="field">
<%= form.check_box :has_address, checked: form_has_address? %>
</div>
<div class="field" id="address_input">
<%= form.text_field :address %>
</div>
<% end %>
<% if @form.categories&.any? %>
<div class="field">
<%= form.categories_select :category_id, @form.categories, prompt: t("decidim.proposals.proposals.edit.select_a_category") %>
</div>
<% end %>
<% if current_participatory_space.has_subscopes? %>
<div class="field">
<%= scopes_picker_field form, :scope_id %>
</div>
<% end %>
<% if current_organization.user_groups_enabled? && Decidim::UserGroups::ManageableUserGroups.for(current_user).verified.any? %>
<div class="field">
<%= user_group_select_field form, :user_group_id %>
</div>
<% end %>
<% if component_settings.attachments_allowed? && @proposal %>
<div id="photo-field">
<%= form.fields_for :attachment, @form.attachment do |nested_form| %>
<div class="field">
<%= nested_form.hidden_field :title, value: "Untitled" %>
</div>
<div class="field">
<%= nested_form.upload :file, optional: false %>
<% if @form.errors[:attachment].present? %>
<% @form.errors[:attachment].each do |message| %>
<small class="form-error is-visible">
<%= message %>
</small>
<% end %>
<% end %>
</div>
<% end %>
</div>
</div>
<% end %>