diff --git a/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js b/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js
index 12f9e6ea..c7551761 100644
--- a/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js
+++ b/app/assets/javascripts/metamaps/Metamaps.GlobalUI.js
@@ -229,13 +229,24 @@ Metamaps.GlobalUI.CreateMap = {
}
var formId = Metamaps.GlobalUI.lightbox === 'forkmap' ? '#fork_map' : '#new_map';
- var form = $(formId);
+ var form = $(formId)
self.newMap.set('name', form.find('#map_name').val());
self.newMap.set('desc', form.find('#map_desc').val());
// TODO validate map attributes
-
+ if (self.newMap.get('name').length===0){
+ console.log('Empty map name.');
+ Metamaps.GlobalUI.notifyUser('map name is mandatory.');
+ return;
+
+ } else if (self.newMap.get('name').length>140){
+ console.log('map name cannot exceed 140 characteres.');
+ Metamaps.GlobalUI.notifyUser('map name cannot exceed 140 characteres.');
+ return;
+ }
+ //console.log('self.newMap.get("name").length='+self.newMap.get("name").length.toString());
+
self.newMap.save(null, {
success: self.success
// TODO add error message
diff --git a/app/views/maps/show.html.erb~ b/app/views/maps/show.html.erb~
new file mode 100644
index 00000000..474a6c1a
--- /dev/null
+++ b/app/views/maps/show.html.erb~
@@ -0,0 +1,133 @@
+<%#
+ # @file
+ # Code to display a map
+ # /maps/:id
+ #%>
+
+<% content_for :title, @map.name + " | Metamaps" %>
+
+
+

+
+
+
+<% if authenticated? %>
+ <% if @map.permission == "commons" || @map.user == user %>
+
+ <% end %>
+
+ <% if @map.permission == "commons" || @map.user == user %>
+
+ <% end %>
+<% end %>
+
+
+
+
+

+
<%= @map.name %>
+
+
+ <%= render :partial => 'maps/mapinfobox' %>
+
+
+
+
+
+<% if authenticated? %>
+
+ <% # add these if you have edit permissions on the map %>
+ <% if @map.permission == "commons" || @map.user == user %>
+
+ <% # for creating and pulling in topics and synapses %>
+ <%= render :partial => 'newtopic' %>
+ <%= render :partial => 'newsynapse' %>
+
+ <% # for saving the layout of the map %>
+ <%= form_for @map, :url => savelayout_path(@map), :html => { :class => "saveMapLayout", :id => "saveMapLayout"}, remote: true do |form| %>
+ <%= form.hidden_field "coordinates", :value => "" %>
+ <% end %>
+
+ <% end %>
+
+ <% # for populating the change metacode list on the topic card %>
+ <%= render :partial => 'main/metacodeoptions' %>
+<% end %>
+
+
+
\ No newline at end of file
diff --git a/db/schema.rb b/db/schema.rb
index c3fce2b2..ec86b421 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,129 +1,129 @@
-# encoding: UTF-8
-# This file is auto-generated from the current state of the database. Instead
-# of editing this file, please use the migrations feature of Active Record to
-# incrementally modify your database, and then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your
-# database schema. If you need to create the application database on another
-# system, you should be using db:schema:load, not running all the migrations
-# from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20140707161810) do
-
- create_table "in_metacode_sets", :force => true do |t|
- t.integer "metacode_id"
- t.integer "metacode_set_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
- add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
-
- create_table "mappings", :force => true do |t|
- t.text "category"
- t.integer "xloc"
- t.integer "yloc"
- t.integer "topic_id"
- t.integer "synapse_id"
- t.integer "map_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "maps", :force => true do |t|
- t.text "name"
- t.boolean "arranged"
- t.text "desc"
- t.text "permission"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.boolean "featured"
- end
-
- create_table "metacode_sets", :force => true do |t|
- t.string "name"
- t.text "desc"
- t.integer "user_id"
- t.boolean "mapperContributed"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
-
- create_table "metacodes", :force => true do |t|
- t.text "name"
- t.string "icon"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "synapses", :force => true do |t|
- t.text "desc"
- t.text "category"
- t.text "weight"
- t.text "permission"
- t.integer "node1_id"
- t.integer "node2_id"
- t.integer "user_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- end
-
- create_table "topics", :force => true do |t|
- t.text "name"
- t.text "desc"
- t.text "link"
- t.text "permission"
- t.integer "user_id"
- t.integer "metacode_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "image_file_name"
- t.string "image_content_type"
- t.integer "image_file_size"
- t.datetime "image_updated_at"
- t.string "audio_file_name"
- t.string "audio_content_type"
- t.integer "audio_file_size"
- t.datetime "audio_updated_at"
- end
-
- create_table "users", :force => true do |t|
- t.string "name"
- t.string "email"
- t.text "settings"
- t.string "code", :limit => 8
- t.string "joinedwithcode", :limit => 8
- t.string "crypted_password"
- t.string "password_salt"
- t.string "persistence_token"
- t.string "perishable_token"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.string "encrypted_password", :limit => 128, :default => ""
- t.string "remember_token"
- t.datetime "remember_created_at"
- t.string "reset_password_token"
- t.datetime "last_sign_in_at"
- t.string "last_sign_in_ip"
- t.integer "sign_in_count", :default => 0
- t.datetime "current_sign_in_at"
- t.string "current_sign_in_ip"
- t.datetime "reset_password_sent_at"
- t.boolean "admin"
- t.string "image_file_name"
- t.string "image_content_type"
- t.integer "image_file_size"
- t.datetime "image_updated_at"
- end
-
- add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
-
-end
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20140707161810) do
+
+ create_table "in_metacode_sets", :force => true do |t|
+ t.integer "metacode_id"
+ t.integer "metacode_set_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "in_metacode_sets", ["metacode_id"], :name => "index_in_metacode_sets_on_metacode_id"
+ add_index "in_metacode_sets", ["metacode_set_id"], :name => "index_in_metacode_sets_on_metacode_set_id"
+
+ create_table "mappings", :force => true do |t|
+ t.text "category"
+ t.integer "xloc"
+ t.integer "yloc"
+ t.integer "topic_id"
+ t.integer "synapse_id"
+ t.integer "map_id"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "maps", :force => true do |t|
+ t.text "name"
+ t.boolean "arranged"
+ t.text "desc"
+ t.text "permission"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.boolean "featured"
+ end
+
+ create_table "metacode_sets", :force => true do |t|
+ t.string "name"
+ t.text "desc"
+ t.integer "user_id"
+ t.boolean "mapperContributed"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ add_index "metacode_sets", ["user_id"], :name => "index_metacode_sets_on_user_id"
+
+ create_table "metacodes", :force => true do |t|
+ t.text "name"
+ t.string "icon"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "synapses", :force => true do |t|
+ t.text "desc"
+ t.text "category"
+ t.text "weight"
+ t.text "permission"
+ t.integer "node1_id"
+ t.integer "node2_id"
+ t.integer "user_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "topics", :force => true do |t|
+ t.text "name"
+ t.text "desc"
+ t.text "link"
+ t.text "permission"
+ t.integer "user_id"
+ t.integer "metacode_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "image_file_name"
+ t.string "image_content_type"
+ t.integer "image_file_size"
+ t.datetime "image_updated_at"
+ t.string "audio_file_name"
+ t.string "audio_content_type"
+ t.integer "audio_file_size"
+ t.datetime "audio_updated_at"
+ end
+
+ create_table "users", :force => true do |t|
+ t.string "name"
+ t.string "email"
+ t.text "settings"
+ t.string "code", :limit => 8
+ t.string "joinedwithcode", :limit => 8
+ t.string "crypted_password"
+ t.string "password_salt"
+ t.string "persistence_token"
+ t.string "perishable_token"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "encrypted_password", :limit => 128, :default => ""
+ t.string "remember_token"
+ t.datetime "remember_created_at"
+ t.string "reset_password_token"
+ t.datetime "last_sign_in_at"
+ t.string "last_sign_in_ip"
+ t.integer "sign_in_count", :default => 0
+ t.datetime "current_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.datetime "reset_password_sent_at"
+ t.boolean "admin"
+ t.string "image_file_name"
+ t.string "image_content_type"
+ t.integer "image_file_size"
+ t.datetime "image_updated_at"
+ end
+
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
+
+end