Skip to content

Commit

Permalink
Merge branch '0.12-stable' into 0.16-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
moustachu committed Mar 13, 2019
2 parents 07f9e82 + 678a619 commit edfa337
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 27 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ use the following command in your rails console : `Decidim::User.find_each { |us
- **decidim-participatory_processes**: Fix hastag display on participatory processes. [\#200](https://github.com/OpenSourcePolitics/decidim/pull/200)
- **decidim-core**: Fix test consistency [#222](https://github.com/OpenSourcePolitics/decidim/pull/222)
- **decidim-core**: Add shinier signature. [#186](https://github.com/OpenSourcePolitics/decidim/pull/186)
- **decidim-comments**: Comments not displayed with IE [#432](https://github.com/OpenSourcePolitics/decidim/issues/432)

**Backported**:

Expand All @@ -94,6 +95,7 @@ use the following command in your rails console : `Decidim::User.find_each { |us
- **decidim-proposals**: Hide withdrawn proposals from index [\#4012](https://github.com/decidim/decidim/pull/4012)
- **decidim-core**: Allows users with admin access to preview unpublished components [\#209](https://github.com/OpenSourcePolitics/decidim/pull/209)
- **decidim-core**: Fix proposal mentioned notification. [\#4281](https://github.com/decidim/decidim/pull/4281)
- **decidim-core**: Use org default locale as fallback on emails [#4892](https://github.com/decidim/decidim/pull/4892)

## [Unreleased](https://github.com/decidim/decidim/tree/0.11-stable)
## [Unreleased](https://github.com/decidim/decidim/tree/0.15-stable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def attributes
body: body_with_hashtags,
category: form.category,
scope: form.scope,
address: form.address,
latitude: form.latitude,
longitude: form.longitude
address: has_address? ? form.address : nil,
latitude: has_address? ? form.latitude : nil,
longitude: has_address? ? form.longitude : nil
}
end

Expand Down Expand Up @@ -111,6 +111,10 @@ def current_user_proposals
def user_group_proposals
Proposal.from_user_group(user_group).where(component: form.current_component).published.where.not(id: proposal.id).except_withdrawn
end

def has_address?
form.has_address && form.address.present?
end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<div class="column dynamic-map-instructions">
<h3><%= t(".primary") %></h3>
<p><%= t(".secondary") %></p>
<div class="callout warning">
<h5><%= t(".primary") %></h5>
<p><%= t(".secondary") %></p>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,20 @@
<div class="field">
<%= form.check_box :has_address, checked: form_has_address? %>
</div>

<div class="field" id="address_input">
<%= form.text_field :address %>
</div>

<% if has_position?(@form) %>
<%= dynamic_map_for proposal_preview_data_for_map(@proposal) do %>
<%= stylesheet_link_tag "decidim/map" %>
<%= javascript_include_tag "decidim/map" %>
<%= form.text_field :address, placeholder: t("decidim.proposals.proposals.placeholder.address") %>
<% if has_position?(@proposal) %>
<div class="callout warning"><%= t("decidim.proposals.proposals.dynamic_map_instructions.primary") %></div>
<%= dynamic_map_for proposal_preview_data_for_map(@proposal) do %>
<%= stylesheet_link_tag "decidim/map" %>
<%= javascript_include_tag "decidim/map" %>
<% end %>
<%= form.hidden_field :latitude, data: { type: "latitude" } %>
<%= form.hidden_field :longitude, data: { type: "longitude" } %>
<% elsif form_has_address? %>
<div class="callout warning"><%= t("decidim.proposals.proposals.preview.not_geocoded") %></div>
<% end %>
<%= form.hidden_field :latitude, data: { type: "latitude" } %>
<%= form.hidden_field :longitude, data: { type: "longitude" } %>
<% else %>
<div class="column text-center">
<p><%= t(".not_geocoded") %></p>
<p><%= t(".address", address: @form.address) %></p>
</div>
<% end %>
</div>
<% end %>

<% if @form.categories&.any? %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<%= render partial: "proposal_preview", locals: { proposal: @proposal } %>

<% if component_settings.geocoding_enabled? %>
<%= render partial: "dynamic_map_instructions" %>
<% if has_position?(@proposal) %>
<%= render partial: "dynamic_map_instructions" %>
<%= dynamic_map_for proposal_preview_data_for_map(@proposal), "column" do %>
<%= stylesheet_link_tag "decidim/map" %>
<%= javascript_include_tag "decidim/map" %>
Expand All @@ -35,10 +35,12 @@
<%= form.submit t(".update_pos"), class: "button expanded", data: { disable: true } %>
</div>
<% end %>
<% else %>
<% elsif form_has_address? %>
<div class="column text-center">
<p><%= t(".not_geocoded") %></p>
<p><%= t(".address", address: @proposal.address) %></p>
<div class="callout warning">
<p><%= t(".not_geocoded") %></p>
<p><%= t(".address", address: @proposal.address) %></p>
</div>
</div>
<% end %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion decidim-proposals/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ en:
view_index:
see_index: See index
placeholder:
address: 32 rue des cascades 75020 Paris
address: "[n°] [street] [postal] [city]"
preview:
address: 'Address: %{address}'
modify: Modify the proposal
Expand Down
2 changes: 1 addition & 1 deletion decidim-proposals/config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ fr:
view_index:
see_index: Voir l'index
placeholder:
address: 32, rue des cascades 75020 Paris
address: "[n°] [voie] [code postal] [ville]"
preview:
address: 'Adresse : %{address}'
modify: Modifier la proposition
Expand Down

0 comments on commit edfa337

Please sign in to comment.