Set attributes on newly created notes
authorTom Hughes <tom@compton.nu>
Sun, 14 Oct 2012 13:04:59 +0000 (14:04 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 14 Oct 2012 15:01:36 +0000 (16:01 +0100)
app/assets/javascripts/index/notes.js.erb
app/assets/javascripts/templates/notes/new.jst.ejs
app/views/site/index.html.erb

index 779ae1ab086d1ceda39d84ed74c073bc2b0471b7..9c7d001763c70d24de6eef64f6fbc36ef0050bd6 100644 (file)
@@ -30,8 +30,7 @@ $(document).ready(function () {
       success: function (data) {
         map.noteSelector.unselect(feature);
 
-        feature.attributes.status = "open";
-        feature.attributes.id = data;
+        feature.attributes = data.properties;
 
         map.noteLayer.drawFeature(feature);
 
index 9c82a60a4220c51065623512f891bd90e3aeda29..9295ce873e8a33bfebc237b1ab9642ba5522dcbd 100644 (file)
@@ -5,7 +5,7 @@
 <form action="#">
   <input type="hidden" name="lon">
   <input type="hidden" name="lat">
-  <textarea name="comment" cols="40" rows="10"></textarea>
+  <textarea name="text" cols="40" rows="10"></textarea>
   <br/>
   <input type="submit" name="add" value="<%- I18n.t('javascripts.notes.new.add') %>" id="note-add">
 </form>
index 39e54c7f6c13e8fcd5589b2489a905cd10900d18..248b5a0b624df4323a077fd871749ad694ce02b0 100644 (file)
@@ -28,7 +28,7 @@
   <div id="permalink">
     <a href="/" id="permalinkanchor" class="geolink llz layers object"><%= t 'site.index.permalink' %></a>
     <a href="/" id="shortlinkanchor"><%= t 'site.index.shortlink' %></a>
-    <%= link_to t("site.index.createnote"), notes_url,
+    <%= link_to t("site.index.createnote"), notes_url(:format => :json),
         :id => "createnoteanchor",
         :data => { :minzoom => 12 },
         :title => "javascripts.site.createnote_tooltip",