OPEN_NOTE_MARKER: <%= image_path("open_note_marker.png").to_json %>,
CLOSED_NOTE_MARKER: <%= image_path("closed_note_marker.png").to_json %>,
+ SEARCHING: <%= image_path("searching.gif").to_json %>,
+
apiUrl: function (object) {
var url = "/api/" + OSM.API_VERSION + "/" + object.type + "/" + object.id;
} else {
enableAuth();
}
+
+ $("#user_all").change(function () {
+ $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
+ });
+
+ $("#content.user_confirm").each(function () {
+ $(this).hide();
+ $(this).find("#confirm").submit();
+ });
+
+ $("input[name=legale]").change(function () {
+ var url = $(this).data("url");
+
+ $("#contributorTerms").html("<img src='" + OSM.SEARCHING + "' />");
+ $("#contributorTerms").load(url);
+ });
});
<% end %>
<% if params[:confirm_string] %>
- <script>
- $("#content").hide();
- </script>
+ <% content_for :head do %>
+ <%= javascript_include_tag "user" %>
+ <% end %>
+
+ <% content_for(:content_class) { "user_confirm" } %>
<p><%= t 'user.confirm.press confirm button' %></p>
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
<input type="submit" name="confirm_action" value="<%= t 'user.confirm.button' %>">
<% end %>
-
- <script>
- $("#confirm").submit();
- </script>
<% else %>
<h1>
<%= t "user.confirm.introduction_1" %>
-<script>
-$("#content").hide();
-</script>
+<% content_for :head do %>
+ <%= javascript_include_tag "user" %>
+<% end %>
+
+<% content_for(:content_class) { "user_confirm" } %>
<% content_for :heading do %>
<h1><%= t 'user.confirm_email.heading' %></h1>
<input type="hidden" name="confirm_string" value="<%= params[:confirm_string] %>">
<input type="submit" name="confirm_action" value="<%= t 'user.confirm_email.button' %>">
<% end %>
-
-<script>
-$("#confirm").submit();
-</script>
<% @title = t('user.list.title') %>
+<% content_for :head do %>
+ <%= javascript_include_tag "user" %>
+<% end %>
+
<% content_for :heading do %>
<h1><%= t('user.list.heading') %></h1>
<% end %>
<%= submit_tag t('user.list.confirm'), :name => "confirm" %>
<%= submit_tag t('user.list.hide'), :name => "hide" %>
</div>
-
- <script type="text/javascript">
- $("#user_all").change(function () {
- $("#user_list input[type=checkbox]").prop("checked", $("#user_all").prop("checked"));
- });
- </script>
<% end %>
<% else %>
<p><%= t "user.list.empty" %></p>
+<% content_for :head do %>
+ <%= javascript_include_tag "user" %>
+<% end %>
+
<% content_for :heading do %>
<h1><%= t 'user.terms.heading' %></h1>
<div class='header-illustration new-user-terms'></div>
<% [['france', 'FR'], ['italy', 'IT'], ['rest_of_world', 'GB']].each do |name, legale| %>
<div class="form-row">
<label for="legale_<%= legale %>">
- <%= radio_button_tag 'legale', legale, @legale == legale %>
+ <%= radio_button_tag 'legale', legale, @legale == legale, :data => { :url => url_for(:legale => legale) } %>
<%= t('user.terms.legale_names.' + name) %>
</label>
- <script>
- $("#legale_<%= legale %>").change(function () {
- $("#contributorTerms").html("<%=j image_tag 'searching.gif' %>");
- $("#contributorTerms").load("<%= url_for :legale => legale %>");
- });
- </script>
</div>
<% end %>
</div>